You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.3 KiB
54 lines
2.3 KiB
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
/**
|
|
* Class Memo
|
|
* ------------------------------------------------------------------------------
|
|
* 영화페이지
|
|
*/
|
|
class Movie extends WB_Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$this->db->select('*');
|
|
$this->db->from('movie');
|
|
$this->db->order_by('idx DESC');
|
|
$result = $this->db->get()->result_array();
|
|
// SELECT * FROM wb_memo ORDER BY idx DESC;
|
|
//result_array =전체뽑아오기 그러므로 포문을써야 뽑아옴
|
|
//row_array = 한줄뽑아오기 그러므로 echo로 뽑히는지 볼수 있음
|
|
$this->data['list'] = $result;
|
|
|
|
// 레이아웃 & 뷰파일 설정
|
|
$this->theme = $this->site->get_layout();
|
|
$this->view = "/movie/index";
|
|
$this->active = "/movie/index";
|
|
}
|
|
|
|
public function form($value = "")
|
|
{ //코드이그나이트에 들어있는것
|
|
$this->load->library('form_validation');
|
|
|
|
// 필수 입력되어야 하는 필드 설정 input name명 필수규칙
|
|
$this->form_validation->set_rules('mov_name','영화이름','required');
|
|
$this->form_validation->set_rules('mov_aud','관객수','required');
|
|
$this->form_validation->set_rules('mov_money','제작비','required');
|
|
$this->form_validation->set_rules('mov_open','개봉일자','required');
|
|
$this->form_validation->set_rules('mov_text','줄거리','required');
|
|
$this->form_validation->set_rules('mov_img','썸네일','required');
|
|
|
|
//검사코드를 성공적으로 통과했을 경우에만 run() 함수는TRUE 를 리턴합니다.
|
|
//받아온 값이 실패가 아니라면 값을 넣어줌
|
|
if($this->form_validation->run() != FALSE)
|
|
{
|
|
//DB실제컬럼명 <-값을 넣어줌 //input name명
|
|
$mov_up['movie_name'] = $this->input->post('mov_name',true);
|
|
$mov_up['audience'] = $this->input->post('mov_aud',true);
|
|
$mov_up['movie_genre'] = $this->input->post('mov_money',true);
|
|
$mov_up['movie_money'] = $this->input->post('mov_open',true);
|
|
$mov_up['movie_text'] = $this->input->post('mov_text',true);
|
|
}
|
|
//밸류변수가 빈값이면
|
|
}
|
|
|
|
}
|
|
|