Advertisement
Guest User

Untitled

a guest
Nov 26th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 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. #Construct
  39. $content_details = array();
  40. $t = array();
  41. $channel_main = $this->config->item("channel_main_id");
  42.  
  43. $t['title'] = 'News Portal Kids Now';
  44. $data['read'] = $t['title'] ;
  45. $t['read'] = $this->read->all();
  46.  
  47.  
  48.  
  49. $a['v_detail'] = $this->load->view('read/v_detail', $t, true);
  50. //$t['select_data'] = $this->read->get();
  51.  
  52.  
  53.  
  54. //$t['breaking'] = $this->tommy->all();
  55. //var_dump($t['isi'] );
  56.  
  57. //$this->benchmark->mark('end_view');
  58. $this->load->view("read/v_detail", $t);
  59. //$page = $this->load->view("read/v_detail", $t);
  60. // return $page;
  61.  
  62. //$result = $this->tommy->proses_tampil($id);
  63. //return $pages;
  64. }
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71. public function detail($idartikel) {
  72. $this->load->model('data', 'detail');
  73. $this->load->library('form_validation');
  74. //$t['judul'] = $judul->judul . ' | News Portal';
  75. //$this->db->get_where($this->read, array('judul' => $judul[1]));
  76. //$t['title'] = $post->title . ' | News Portal';
  77.  
  78. //$t['title'] = $this->detail->all();
  79. //$data['detail'] = $t['title'] ;
  80.  
  81. $t['read'] = $this->detail->all(10);
  82. //$t['detail'] = $this->detail->anjing($idartikel);
  83. $t['populer'] = $this->detail->populer();
  84.  
  85. $t['opini'] = $this->detail->all_opini(1);
  86. //$t['read'] = $this->detail->populer(3);
  87.  
  88. //$t['nasional'] = $this->detail->all_nasional();
  89. //$t['ekonomi'] = $this->detail->all_ekonomi();
  90. //$t['internasional'] = $this->detail->all_internasional();
  91. //$t['olahraga'] = $this->detail->all_olahraga();
  92. //$t['humaniora'] = $this->detail->all_humaniora();
  93. //$t['muda'] = $this->detail->all_muda();
  94. //$t['video'] = $this->detail->videos();
  95. //$id = $this->uri->segment(3);
  96. //$t['berita'] = $this->data->get_detail($id);
  97. //$t['tags'] = $this->read->all_hastag();
  98. $t['detail'] = $this->detail->get($idartikel);
  99. $t['title'] = $t['detail'][0]['title'];
  100.  
  101.  
  102. //$t['related'] = $t['detail'][0]['title'];
  103. $t['category'] = $this->detail->kategori($idartikel);
  104. //$t['category'] = $this->detail->kategori();
  105. echo "<pre>";
  106. print_r($t['detail']);
  107. echo "</pre>";
  108. if(!$t['detail']) {
  109. $this->load->view(
  110. 'Could not load the requested item',
  111. 'warning'
  112. );
  113. redirect('read');
  114. return;
  115. }
  116. //$t['read'] = $this->read->select_data();
  117.  
  118. //$t['title'] = $t->title . ' | MI';
  119. // $t['data'] = $t;
  120. //$t['penulis'] = penulis($t['penulis']->nip);
  121.  
  122. $this->load->view("read/v_detail", $t);
  123.  
  124. }
  125.  
  126.  
  127.  
  128.  
  129. }
  130.  
  131.  
  132.  
  133.  
  134. ------------------------------------------------ end controller --------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement