Browse Source

오더뷰파일수정해야함

master
kmj1996 5 years ago
parent
commit
b2fab6b14c
  1. 54
      wheeparam/application/controllers/Movie.php
  2. 4
      wheeparam/application/controllers/Order.php
  3. 20
      wheeparam/views/themes/desktop/movie/form.php
  4. 12
      wheeparam/views/themes/desktop/movie/index.php
  5. 2
      wheeparam/views/themes/desktop/order/form.php

54
wheeparam/application/controllers/Movie.php

@ -0,0 +1,54 @@
<?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);
}
//밸류변수가 빈값이면
}
}

4
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;
}
}

20
wheeparam/views/themes/desktop/movie/form.php

@ -0,0 +1,20 @@
<?php echo validation_errors()?>
<?=form_open()?>
<h5>영화제목</h5>
<input name="hu_name" value="<?=element('mov_name', $view)?>"><br>
<h5>관객수</h5>
<input name="ord_name" value="<?=element('mov_aud', $view)?>">
<h5>제작비</h5>
<input name="pay" value="<?=element('mov_money', $view)?>">
<h5>개봉일자</h5>
<input name="ord_num" value="<?=element('mov_open', $view)?>">
<h5>줄거리</h5>
<input name="ord_count" value="<?=element('mov_text', $view)?>">
<button type="submit">등록하기</button>
<?=form_close()?>

12
wheeparam/views/themes/desktop/movie/index.php

@ -0,0 +1,12 @@
<a href="<?=base_url('/movie/form')?>"> 등록하기</a>
<table class="table">
<tbody>
<?php foreach ($list as $movie):?>
<tr>
<td>제작비:<?=$movie['movie_money']?>원</td>
<td>영화명:<?=$movie['movie_name'] ?></td>
<td>누적관객수:<?=$movie['audience']?>명</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

2
wheeparam/views/themes/desktop/order/form.php

@ -1,5 +1,5 @@
<?php echo validation_errors()?>
<?=form_open_multipart()?>
<?=form_open()?>
<h5>주문자명</h5>
<input name="hu_name" value="<?=element('order_hu_name', $view)?>"><br>

Loading…
Cancel
Save