From b2fab6b14c8e730d72e510bf28c5f98249a2584c Mon Sep 17 00:00:00 2001 From: kmj1996 Date: Tue, 30 Jun 2020 02:47:01 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=8D=94=EB=B7=B0=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=88=98=EC=A0=95=ED=95=B4=EC=95=BC=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wheeparam/application/controllers/Movie.php | 54 +++++++++++++++++++ wheeparam/application/controllers/Order.php | 4 +- wheeparam/views/themes/desktop/movie/form.php | 20 +++++++ .../views/themes/desktop/movie/index.php | 12 +++++ wheeparam/views/themes/desktop/order/form.php | 2 +- 5 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 wheeparam/application/controllers/Movie.php create mode 100644 wheeparam/views/themes/desktop/movie/form.php create mode 100644 wheeparam/views/themes/desktop/movie/index.php 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 @@ + + + +
영화제목
+
+ +
관객수
+ + +
제작비
+ + +
개봉일자
+ + +
줄거리
+ + + + diff --git a/wheeparam/views/themes/desktop/movie/index.php b/wheeparam/views/themes/desktop/movie/index.php new file mode 100644 index 0000000..a7cd392 --- /dev/null +++ b/wheeparam/views/themes/desktop/movie/index.php @@ -0,0 +1,12 @@ + 등록하기 + + + + + + + + + + +
제작비:영화명:누적관객수:
\ No newline at end of file diff --git a/wheeparam/views/themes/desktop/order/form.php b/wheeparam/views/themes/desktop/order/form.php index c73a506..b9dd52c 100644 --- a/wheeparam/views/themes/desktop/order/form.php +++ b/wheeparam/views/themes/desktop/order/form.php @@ -1,5 +1,5 @@ - +
주문자명