Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--------------====================VIEW===========================--------------------- -->
- <!-- POLLING -->
- <div class="full_width">
- <div class="rows title">POLLING</div>
- </div>
- <?php
- //$total = count($detail);
- //for($i=0; $i<$total; $i++){
- ?>
- <div class="part">
- <div class="polling">
- <p><?php echo $polling[0]['title']; ?></p>
- <!-- !!!perhatikan penulisannya!!! ini setelah di klik lanjut ke pooling_detail!! -->
- <form action="<?= base_url();?>home/polling_detail" method="post" >
- <ul>
- <?php foreach($polling as $key=>$polls){
- //echo '<li><input type="radio" name="poll" value="'.$polls['id'].'" >'.$polls['answer'].'</li>';
- $pilih = (explode(",",$polls['answer']));
- $hitung = count($pilih);
- $id=1;
- for ($x=0; $x<=$hitung-1; $x++) {
- if ($pilih[$x] != ''){
- <!----- paling penting disini---->
- echo "
- <p><input type='radio' name='pilihan[{$key}]' value='$id' id='$id' required /><label style='font-size:15px;font-family: 'droid-reg', serif; for='$id'> $pilih[$x]</label><br /></p>
- ";
- $id++;
- }
- }
- } ?>
- </ul>
- <input type="submit" value="PILIH"/>
- </form>
- </div>
- <?php //} ?>
- </div>
- <!-- POLLING END -->
- <!------------------------ ====================CONTROLLER==================== ------------------>
- <?php
- // defined('BASEPATH') OR exit('No direct script access allowed');
- class Home extends CI_Controller {
- // public function __construct() {
- // parent::__construct();
- // }
- /**
- * Index Page for this controller.
- *
- * Maps to the following URL
- * http://example.com/index.php/welcome
- * - or -
- * http://example.com/index.php/welcome/index
- * - or -
- * Since this controller is set as the default controller in
- * config/routes.php, it's displayed at http://example.com/
- *
- * So any other public methods not prefixed with an underscore will
- * map to /index.php/welcome/<method_name>
- * @see https://codeigniter.com/user_guide/general/urls.html
- */
- public function index() {
- $t['title'] = 'Rilis | Refrensi Indonesia';
- $data['read'] = $t['title'] ;
- //$this->output->enable_profiler(TRUE);
- $this->load->model('data', 'read');
- $this->load->helper('analytics');
- $this->output->cache(10);
- //$this->output->delete_cache();
- //$this->benchmark->mark('fetch_data');
- //$this->load->driver('cache');
- //$this->benchmark->elapsed_time();
- //$this->benchmark->memory_usage();
- $t['polling'] = $this->read->all_polling();
- echo "<pre>";
- print_r($t['polling']);
- echo "</pre>";
- //$raws_image = json_decode($t['read'][0]['image'],true) ;
- #Menu
- $t['v_menu'] = $this->load->view('template/v_menu',NULL,TRUE);
- #Footer
- $t['v_footer'] = $this->load->view('template/v_footer',NULL,TRUE);
- #Analytic
- $t['analytics'] = google();
- #Revive
- $t['revive'] = revive();
- //$this->benchmark->mark('end_view');
- //echo $this->benchmark->elapsed_time('fetch_data', 'end_view');
- $page = $this->load->view('pages/v_home' ,$t,FALSE);
- }
- /****
- tidak ada proses melakukan proses POST...
- tertulis disini ada parameter id.. tp dari koding view tidak ada memasukkan id!!!
- ***/
- public function polling_detail($id=NULL) {
- $t['title'] = 'Polling Rilis | Refrensi Indonesia';
- $data['polling_detail'] = $t['title'] ;
- //$this->output->enable_profiler(TRUE);
- $this->load->model('data', 'polling_detail');
- $this->load->helper('analytics');
- $this->output->cache(10);
- //$t['rows'] = $this->model_utama->polling_sum($row['id'])->row_array();
- //$t['polling'] = $this->model_utama->polling();
- $t['polling_detail'] = $this->polling_detail->polling_sum($id);
- echo "<pre>";
- print_r($t['polling_detail']);
- echo "</pre>";
- echo "post:<pre>"; print_r($_POST); echo "</pre>";
- #Menu
- $t['v_menu'] = $this->load->view('template/v_menu',NULL,TRUE);
- #Footer
- $t['v_footer'] = $this->load->view('template/v_footer',NULL,TRUE);
- #Analytic
- $t['analytics'] = google();
- #Revive
- $t['revive'] = revive();
- //$this->benchmark->mark('end_view');
- //echo $this->benchmark->elapsed_time('fetch_data', 'end_view');
- //$page = $this->load->view('pages/v_home' ,$t,FALSE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement