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.

51 lines
1.4 KiB

  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. /**
  4. * Class Memo
  5. * ------------------------------------------------------------------------------
  6. * 메모페이지
  7. */
  8. class Memo extends WB_Controller {
  9. public function index()
  10. {
  11. $this->db->select('*');
  12. $this->db->from('memo');
  13. $this->db->where('status', 'Y');
  14. $this->db->order_by('idx DESC');
  15. $result = $this->db->get()->result_array();
  16. // SELECT * FROM wb_memo WHERE status = 'Y' ORDER BY idx DESC;
  17. $this->data['abcd'] = "1234";
  18. $this->data['list'] = $result;
  19. // 레이아웃 & 뷰파일 설정
  20. $this->theme = $this->site->get_layout();
  21. $this->view = "memo/index";
  22. $this->active = "/memo/index";
  23. }
  24. public function view($getValue="")
  25. {
  26. $this->db->select('*');
  27. $this->db->from('memo');
  28. $this->db->where('status', 'Y');
  29. $this->db->where('idx', $getValue);
  30. $this->db->order_by('idx DESC');
  31. $result = $this->db->get()->row_array();
  32. if(! $result) {
  33. alert('요청하신 메모는 삭제되었습니다.');
  34. exit;
  35. }
  36. $this->data['result'] = $result;
  37. // 레이아웃 & 뷰파일 설정
  38. $this->theme = $this->site->get_layout();
  39. $this->view = "memo/view";
  40. $this->active = "/memo/view";
  41. }
  42. }