diff --git a/wheeparam/application/controllers/Movie.php b/wheeparam/application/controllers/Movie.php new file mode 100644 index 0000000..fd2c54b --- /dev/null +++ b/wheeparam/application/controllers/Movie.php @@ -0,0 +1,54 @@ +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); + } + //밸류변수가 빈값이면 + } + + } + diff --git a/wheeparam/application/controllers/Order.php b/wheeparam/application/controllers/Order.php index 6e0d79a..baa065b 100644 --- a/wheeparam/application/controllers/Order.php +++ b/wheeparam/application/controllers/Order.php @@ -36,7 +36,7 @@ class Order extends WB_Controller { $this->data['list'] = $result; if(! $result) { - alert("없는 페이지 입니다"); + alert("11 페이지 입니다"); exit; } // 레이아웃 & 뷰파일 설정 @@ -106,7 +106,7 @@ class Order extends WB_Controller { if(! $this->data['view']) { - alert("없는 페이지 입니다"); + alert("35 페이지 입니다"); exit; } } diff --git a/wheeparam/views/themes/desktop/movie/form.php b/wheeparam/views/themes/desktop/movie/form.php new file mode 100644 index 0000000..48aa5f0 --- /dev/null +++ b/wheeparam/views/themes/desktop/movie/form.php @@ -0,0 +1,20 @@ + +=form_open()?> + +
제작비:=$movie['movie_money']?>원 | +영화명:=$movie['movie_name'] ?> | +누적관객수:=$movie['audience']?>명 | +