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

  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. /**
  4. * Class Memo
  5. * ------------------------------------------------------------------------------
  6. * 영화페이지
  7. */
  8. class Movie extends WB_Controller
  9. {
  10. public function index()
  11. {
  12. $this->db->select('*');
  13. $this->db->from('movie');
  14. $this->db->order_by('idx DESC');
  15. $result = $this->db->get()->result_array();
  16. // SELECT * FROM wb_memo ORDER BY idx DESC;
  17. //result_array =전체뽑아오기 그러므로 포문을써야 뽑아옴
  18. //row_array = 한줄뽑아오기 그러므로 echo로 뽑히는지 볼수 있음
  19. $this->data['list'] = $result;
  20. // 레이아웃 & 뷰파일 설정
  21. $this->theme = $this->site->get_layout();
  22. $this->view = "/movie/index";
  23. $this->active = "/movie/index";
  24. }
  25. public function form($value = "")
  26. { //코드이그나이트에 들어있는것
  27. $this->load->library('form_validation');
  28. // 필수 입력되어야 하는 필드 설정 input name명 필수규칙
  29. $this->form_validation->set_rules('mov_name','영화이름','required');
  30. $this->form_validation->set_rules('mov_aud','관객수','required');
  31. $this->form_validation->set_rules('mov_money','제작비','required');
  32. $this->form_validation->set_rules('mov_open','개봉일자','required');
  33. $this->form_validation->set_rules('mov_text','줄거리','required');
  34. $this->form_validation->set_rules('mov_img','썸네일','required');
  35. //검사코드를 성공적으로 통과했을 경우에만 run() 함수는TRUE 를 리턴합니다.
  36. //받아온 값이 실패가 아니라면 값을 넣어줌
  37. if($this->form_validation->run() != FALSE)
  38. {
  39. //DB실제컬럼명 <-값을 넣어줌 //input name명
  40. $mov_up['movie_name'] = $this->input->post('mov_name',true);
  41. $mov_up['audience'] = $this->input->post('mov_aud',true);
  42. $mov_up['movie_genre'] = $this->input->post('mov_money',true);
  43. $mov_up['movie_money'] = $this->input->post('mov_open',true);
  44. $mov_up['movie_text'] = $this->input->post('mov_text',true);
  45. }
  46. //밸류변수가 빈값이면
  47. }
  48. }