Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- function polling_detail($id = NULL) {
- //echo "here";
- //print_r($_POST);DIE;
- $t['title'] = 'Polling Media Indonesia | 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['id'] = $this->polling_detail->polling_sum($row['id'])->row_array();
- $t['polling'] = $this->polling_detail->all_polling();
- echo "post:<pre>";
- print_r($_POST);
- echo "</pre>";
- //DIE;
- /*
- cek apakah ada post masuk
- */
- if ($this->input->post('poll')) {
- if ($id !== NULL) {
- die('error no id send');
- }
- $poll = $this->input->post('poll'); //POLL
- //echo($poll);
- //die;
- //$poll = $this->input->post('id');//ambil IP
- //echo($poll);die;
- foreach ($poll as $id_poll => $row) {
- $ip = '123123'; // silakan ganti dgn fungsi yg bs dapetin IP
- $choose = $row;
- $data=array(
- 'ip'=>$ip,
- 'choose'=>$choose,
- 'poll_id'=>$id_poll
- );
- $this->db->insert('poll',$data);
- $t['polling_detail'] = $this->polling_detail->polling_sum($id);
- echo "<pre>";
- print_r($t['polling_detail']);
- echo "</pre>";
- }
- //cek apakah ada data yg masuk
- die('stop');
- redirect("home/polling_detail/" . $id);
- }
- $t['polling_detail'] = $this->polling_detail->polling_sum($id);
- //die('ha');
- #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();
- $page = $this->load->view('read/v_detail_polling', $t, FALSE);
- }
Advertisement
Add Comment
Please, Sign In to add comment