sinaga15

Untitled

Nov 15th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4.  
  5.  
  6. class Read extends CI_Controller {
  7.  
  8. /**
  9. * Index Page for this controller.
  10. *
  11. * Maps to the following URL
  12. * http://example.com/index.php/welcome
  13. * - or -
  14. * http://example.com/index.php/welcome/index
  15. * - or -
  16. * Since this controller is set as the default controller in
  17. * config/routes.php, it's displayed at http://example.com/
  18. *
  19. * So any other public methods not prefixed with an underscore will
  20. * map to /index.php/welcome/<method_name>
  21. * @see https://codeigniter.com/user_guide/general/urls.html
  22. */
  23. public function __construct() {
  24. parent::__construct();
  25. $this->load->model('data', 'read');
  26. $this->load->library('session');
  27. $this->load->helper('form');
  28. $this->load->helper('url');
  29. $this->load->helper('html');
  30.  
  31. $this->load->library('form_validation');
  32. }
  33.  
  34. public function index()
  35. {
  36.  
  37.  
  38. $content_details = array();
  39. $t = array();
  40. $channel_main = $this->config->item("channel_main_id");
  41.  
  42.  
  43.  
  44. //$a['v_menu'] = $this->load->view('template/v_menu',TRUE);
  45. //$t['html']['title'] = ('Media Indonesia | News');
  46. //$t['title'] = ($t['read'][0]['title'].' | ');
  47. $t['title'] = 'News Portal Kids Now';
  48. $data['read'] = $t['title'] ;
  49. $t['read'] = $this->read->select_data();
  50.  
  51.  
  52.  
  53. $a['v_detail'] = $this->load->view('read/v_detail', $t, true);
  54. //$t['select_data'] = $this->read->get();
  55.  
  56.  
  57.  
  58. //$t['breaking'] = $this->tommy->all();
  59. //var_dump($t['isi'] );
  60.  
  61. //$this->benchmark->mark('end_view');
  62. $this->load->view("read/v_detail", $t);
  63.  
  64.  
  65.  
  66.  
  67.  
  68. public function detail($idartikel) {
  69. $this->load->model('data', 'detail');
  70. $this->load->library('form_validation');
  71. //$t['judul'] = $judul->judul . ' | News Portal';
  72. //$this->db->get_where($this->read, array('judul' => $judul[1]));
  73. $t['title'] = 'News Portal Kids Now';
  74. //$t['title'] = $this->detail->all();
  75. $data['detail'] = $t['title'] ;
  76.  
  77. $t['read'] = $this->detail->all(10);
  78. $t['terkait'] = $this->detail->all_terkait();
  79. //$t['nasional'] = $this->detail->all_nasional();
  80. //$t['ekonomi'] = $this->detail->all_ekonomi();
  81. //$t['internasional'] = $this->detail->all_internasional();
  82. //$t['olahraga'] = $this->detail->all_olahraga();
  83. //$t['humaniora'] = $this->detail->all_humaniora();
  84. //$t['muda'] = $this->detail->all_muda();
  85. //$t['video'] = $this->detail->videos();
  86. //$id = $this->uri->segment(3);
  87. //$t['berita'] = $this->data->get_detail($id);
  88. //$t['tags'] = $this->read->all_hastag();
  89. $t['detail'] = $this->detail->get($idartikel);
  90.  
  91. //echo "<pre>";
  92. //print_r($t['detail']);
  93. //echo "</pre>";
  94. if(!$t['detail']) {
  95. $this->load->view(
  96. 'Could not load the requested item',
  97. 'warning'
  98. );
  99. redirect('read');
  100. return;
  101. }
  102. //$t['read'] = $this->read->select_data();
  103.  
  104. //$t['title'] = $t->title . ' | MI';
  105. // $t['data'] = $t;
  106. //$t['penulis'] = penulis($t['penulis']->nip);
  107.  
  108. $this->load->view("read/v_detail", $t);
  109.  
  110. }
  111.  
  112.  
  113.  
  114.  
  115. }
Advertisement
Add Comment
Please, Sign In to add comment