View difference between Paste ID: Wr2FnVEa and LMHBdTCD
SHOW: | | - or go back to the newest paste.
1
<?php 
2-
    //echo "here";
2+
/*
3-
    //print_r($_POST);DIE;
3+
tolong backup yg lama
4
*/
5
function polling_detail($id = NULL) {
6
7
    $t['title'] = 'Polling Media Indonesia | Refrensi Indonesia';
8-
    //$this->output->enable_profiler(TRUE);
8+
9
10
    $this->load->model('data', 'polling_detail');
11
    $this->load->helper('analytics');
12
    $this->output->cache(10);
13-
    //$t['rows']        = $this->model_utama->polling_sum($row['id'])->row_array();
13+
14-
    //$t['polling']     = $this->model_utama->polling();
14+
15-
    //$t['id']          = $this->polling_detail->polling_sum($row['id'])->row_array();
15+
16
    /*
17-
    //echo "post:<pre>";
17+
18-
    //print_r($_POST);
18+
19-
    //echo "</pre>";
19+
20-
    //DIE;
20+
21
        if ($id !== NULL) {
22
            die('error no id send');
23
        }
24
		
25
        $poll  = $this->input->post('poll'); //POLL
26
		var_dump($poll );
27
28
        foreach ($poll as $id_poll => $row) {
29
           
30-
        $poll['id'] = $this->input->post('poll'); //POLL
30+
31-
		var_dump($poll['id']);
31+
32-
		//$poll = array('answer_id'=>$this->input->post('poll'),'pool_id' => $id['id']);
32+
33-
        //var_dump($poll);
33+
34-
        //die;
34+
35-
        //$poll = $this->input->post('id');//ambil IP
35+
36-
        //echo($poll);die;
36+
37
				'answer_id'=>$choose
38
            );
39
           
40
            $this->db->insert('micom_votes',$data);
41
 
42
            $t['polling_detail'] = $this->polling_detail->polling_sum($id);
43
            //echo "Terima Kasih atas partisipasi anda";//('Terima Kasih atas partisipasi anda');
44
           
45
        }
46
        //cek apakah ada data yg masuk
47
        //
48
		//echo "<h3>Jumlah Suara Voting: $id</h3>";
49
		$t['count'] = $this->polling_detail->jum_vote($ids);
50
		//r_dump($t['count']);
51
		//MENUJU KE LINK DETAIL
52
        redirect("home/polling_detail/" . $id_poll);
53
    }
54
    else{
55
		if($id==NULL){
56
			die("maaf tidak ada ID yg dibuka!!");
57
			//silaken tentukan aksi apa yg harus dilakukan.. karena tidak akan ada data yg tampil
58
		}
59-
		var_dump($t['count']);
59+
		//kayaknya yg ini ketinggalan
60-
        redirect("home/polling_detail/" . $id);
60+
		$t['count'] = $total=$this->polling_detail->jum_vote($id);
61
		$t['polling_detail'] = $total_detail=$this->polling_detail->polling_sum($id);
62
		//---------Hapus dari sini kl sudah OK----
63-
	
63+
		echo"<pre>";
64-
	//echo "<pre>";
64+
		print_r($total);//nilai harus angka
65-
    //print_r($t['count']);
65+
		print_r($total_detail);//nilai pasti array.. krn ini akan di grup by nilai vote
66-
    //echo "</pre>";
66+
		die; 
67
		//---------Hapus selesai di sini kl sudah OK----
68-
    //die('ha');
68+
	}
69
70
71
    #Menu
72
   $t['v_menu'] = $this->load->view('template/v_menu', NULL, TRUE);
73
    #Footer
74
   $t['v_footer'] = $this->load->view('template/v_footer', NULL, TRUE);
75
    #Analytic
76
   $t['analytics'] = google();
77
    #Revive
78
   $t['revive'] = revive();
79
    $page = $this->load->view('read/v_detail_polling', $t, FALSE);
80
}