View difference between Paste ID: K3CBAYxC and jMHFsLPR
SHOW: | | - or go back to the newest paste.
1-
public function polling_detail($id=NULL) { 
1+
<?php
2-
	//echo "here";
2+
3-
	//print_r($_POST);DIE;
3+
/*
4-
        $t['title'] 					= 'Polling Media Indonesia | Refrensi Indonesia';
4+
 * To change this license header, choose License Headers in Project Properties.
5-
		$data['polling_detail'] 		= $t['title'] ;
5+
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7-
		
7+
 */
8-
        //$this->output->enable_profiler(TRUE);
8+
9-
        $this->load->model('data', 'polling_detail');
9+
  function polling_detail($id = NULL) {
10-
        $this->load->helper('analytics'); 
10+
    //echo "here";
11-
        $this->output->cache(10);
11+
    //print_r($_POST);DIE;
12-
        
12+
    $t['title'] = 'Polling Media Indonesia | Refrensi Indonesia';
13-
		//$t['rows'] 		= $this->model_utama->polling_sum($row['id'])->row_array();
13+
    $data['polling_detail'] = $t['title'];
14-
		//$t['polling'] 	= $this->model_utama->polling();
14+
15-
        //$t['id'] 			= $this->polling_detail->polling_sum($row['id'])->row_array();
15+
16-
		$t['polling']	            	    = $this->polling_detail->all_polling();
16+
    //$this->output->enable_profiler(TRUE);
17-
		echo "post:<pre>";        
17+
    $this->load->model('data', 'polling_detail');
18-
			print_r($_POST);         
18+
    $this->load->helper('analytics');
19-
		echo "</pre>";
19+
    $this->output->cache(10);
20-
		//DIE;
20+
21-
		
21+
    //$t['rows'] 		= $this->model_utama->polling_sum($row['id'])->row_array();
22-
		/*
22+
    //$t['polling'] 	= $this->model_utama->polling();
23-
		cek apakah ada post masuk
23+
    //$t['id'] 			= $this->polling_detail->polling_sum($row['id'])->row_array();
24-
		
24+
    $t['polling'] = $this->polling_detail->all_polling();
25-
		*/
25+
    echo "post:<pre>";
26-
		if($this->input->post('poll')){
26+
    print_r($_POST);
27-
			if($id!==NULL) die('error');
27+
    echo "</pre>";
28-
			$poll = $this->input->post('poll'); //POLL
28+
    //DIE;
29-
			echo($poll);die;
29+
30-
			//$poll	= $this->input->post('id');//ambil IP
30+
    /*
31-
			//echo($poll);die;
31+
      cek apakah ada post masuk
32-
			foreach($poll as $id=>$row){
32+
33-
				//insert disini
33+
     */
34-
				//ambil nilai si poll
34+
    if ($this->input->post('poll')) {
35-
				//ambil ip
35+
        if ($id !== NULL) {
36-
				//simpan
36+
            die('error no id send');
37-
				
37+
        }
38-
				
38+
        $poll = $this->input->post('poll'); //POLL
39-
				$t['polling_detail']	            	    = $this->polling_detail->polling_sum($id);
39+
        //echo($poll);
40-
				echo "<pre>";
40+
        //die;
41-
					print_r($t['polling_detail']);
41+
        //$poll	= $this->input->post('id');//ambil IP
42-
				echo "</pre>";
42+
        //echo($poll);die;
43-
		
43+
        foreach ($poll as $id_poll => $row) {
44-
				redirect("home/polling_detail/".$id);
44+
45-
			}
45+
            $ip = '123123'; // silakan ganti dgn fungsi yg bs dapetin IP
46-
		}
46+
            $choose = $row;
47-
		$t['polling_detail']	            	    = $this->polling_detail->polling_sum($id);
47+
            $data=array(
48-
		
48+
                'ip'=>$ip,
49-
		
49+
                'choose'=>$choose,
50-
		//die('ha');
50+
                'poll_id'=>$id_poll
51-
		
51+
            );
52
            
53
            $this->db->insert('poll',$data);
54-
			
54+
55-
            #Menu
55+
            $t['polling_detail'] = $this->polling_detail->polling_sum($id);
56-
			$t['v_menu'] 					= $this->load->view('template/v_menu',NULL,TRUE);
56+
            echo "<pre>";
57-
			#Footer
57+
            print_r($t['polling_detail']);
58-
			$t['v_footer']				    = $this->load->view('template/v_footer',NULL,TRUE);
58+
            echo "</pre>";
59-
            #Analytic
59+
60-
            $t['analytics']                 = google();
60+
61-
            #Revive
61+
        }
62-
            $t['revive']                    = revive();
62+
        //cek apakah ada data yg masuk
63-
            $page = $this->load->view('read/v_detail_polling' ,$t,FALSE);
63+
        die('stop');
64-
        
64+
        redirect("home/polling_detail/" . $id);
65
    }
66-
    }
66+
    $t['polling_detail'] = $this->polling_detail->polling_sum($id);
67
68
69
    //die('ha');
70
    #Menu
71
    $t['v_menu'] = $this->load->view('template/v_menu', NULL, TRUE);
72
    #Footer
73
    $t['v_footer'] = $this->load->view('template/v_footer', NULL, TRUE);
74
    #Analytic
75
    $t['analytics'] = google();
76
    #Revive
77
    $t['revive'] = revive();
78
    $page = $this->load->view('read/v_detail_polling', $t, FALSE);
79
}