View difference between Paste ID: HP1KdmQE and Jg55Zqcs
SHOW: | | - or go back to the newest paste.
1
<!--------------====================VIEW===========================--------------------- -->
2
<!-- POLLING -->
3
                <div class="full_width">
4
                    <div class="rows title">POLLING</div>
5
                </div>
6
				<?php 
7
                            //$total = count($detail);
8
                            //for($i=0; $i<$total; $i++){                                                
9
                ?>
10
                <div class="part">
11
                    <div class="polling">
12-
                        <form action="<?= base_url();?>home/polling_detail" method = "post" >
12+
13
<!-- !!!perhatikan penulisannya!!! ini setelah di klik lanjut ke pooling_detail!! -->
14-
								<?php foreach($polling as $polls){
14+
                        <form action="<?= base_url();?>home/polling_detail" method="post" >
15
                            <ul>
16
								<?php foreach($polling as $key=>$polls){
17
									//echo '<li><input type="radio" name="poll" value="'.$polls['id'].'" >'.$polls['answer'].'</li>';
18
								
19
                            $pilih = (explode(",",$polls['answer']));
20
							$hitung = count($pilih);
21
							$id=1;
22
							for ($x=0; $x<=$hitung-1; $x++) {
23-
										 <p><input type='radio' name='pilihan' value='$id' id='$id' required /><label style='font-size:15px;font-family: 'droid-reg', serif; for='$id'> $pilih[$x]</label><br /></p>
23+
24
<!----- paling penting disini---->
25
									echo "
26
										 <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>
27
28
				                ";
29
									$id++;
30
								}
31
							}
32
								
33
								
34
								} ?>
35
                            </ul>
36
                            <input type="submit" value="PILIH"/>
37
                        </form>
38-
                <!-- POLLING END -->
38+
39
					<?php //} ?>
40
                </div> 
41
                <!-- POLLING END -->
42
43
<!------------------------ ====================CONTROLLER==================== ------------------>
44
45
<?php
46
// defined('BASEPATH') OR exit('No direct script access allowed');
47
48
class Home extends CI_Controller {
49
50
	// public function __construct() {
51
 //        parent::__construct();
52
 //    }
53
	/**
54
	 * Index Page for this controller.
55
	 *
56
	 * Maps to the following URL
57
	 * 		http://example.com/index.php/welcome
58
	 *	- or -
59
	 * 		http://example.com/index.php/welcome/index
60
	 *	- or -
61
	 * Since this controller is set as the default controller in
62
	 * config/routes.php, it's displayed at http://example.com/
63
	 *
64
	 * So any other public methods not prefixed with an underscore will
65
	 * map to /index.php/welcome/<method_name>
66
	 * @see https://codeigniter.com/user_guide/general/urls.html
67
	 */
68
	
69
70
	public function index() { 
71
        $t['title'] 					= 'Rilis | Refrensi Indonesia';
72
		$data['read'] 					= $t['title'] ;
73
74
		
75
        //$this->output->enable_profiler(TRUE);
76
        $this->load->model('data', 'read');
77
        $this->load->helper('analytics'); 
78
        $this->output->cache(10);
79
        //$this->output->delete_cache();
80
        //$this->benchmark->mark('fetch_data');
81
        //$this->load->driver('cache');
82
         //$this->benchmark->elapsed_time(); 
83
         //$this->benchmark->memory_usage(); 
84
85
		
86
       
87
        	
88
			$t['polling']	            	    = $this->read->all_polling();
89
			echo "<pre>";
90
            print_r($t['polling']);
91
            echo "</pre>";
92
            //$raws_image                         =  json_decode($t['read'][0]['image'],true) ;
93
94
			
95
            #Menu
96
			$t['v_menu'] 					= $this->load->view('template/v_menu',NULL,TRUE);
97
			#Footer
98
			$t['v_footer']				    = $this->load->view('template/v_footer',NULL,TRUE);
99
            #Analytic
100
            $t['analytics']                 = google();
101
            #Revive
102
            $t['revive']                    = revive();
103
            //$this->benchmark->mark('end_view');
104
            //echo $this->benchmark->elapsed_time('fetch_data', 'end_view');
105
            $page = $this->load->view('pages/v_home' ,$t,FALSE);
106
        
107
108
    }
109
/****	
110
	tidak ada proses melakukan proses POST...
111
tertulis disini ada parameter id.. tp dari koding view tidak ada memasukkan id!!!
112
***/
113
	public function polling_detail($id=NULL) { 
114
        $t['title'] 					= 'Polling Rilis | Refrensi Indonesia';
115
		$data['polling_detail'] 		= $t['title'] ;
116
117
		
118
        //$this->output->enable_profiler(TRUE);
119
        $this->load->model('data', 'polling_detail');
120
        $this->load->helper('analytics'); 
121
        $this->output->cache(10);
122
        
123
		//$t['rows'] 		= $this->model_utama->polling_sum($row['id'])->row_array();
124
		//$t['polling'] 	= $this->model_utama->polling();
125
        	
126
		$t['polling_detail']	            	    = $this->polling_detail->polling_sum($id);
127
		echo "<pre>";
128
        print_r($t['polling_detail']);
129
        echo "</pre>";
130
echo "post:<pre>";        print_r($_POST);         echo "</pre>";
131
            
132
			
133
            #Menu
134
			$t['v_menu'] 					= $this->load->view('template/v_menu',NULL,TRUE);
135
			#Footer
136
			$t['v_footer']				    = $this->load->view('template/v_footer',NULL,TRUE);
137
            #Analytic
138
            $t['analytics']                 = google();
139
            #Revive
140
            $t['revive']                    = revive();
141
            //$this->benchmark->mark('end_view');
142
            //echo $this->benchmark->elapsed_time('fetch_data', 'end_view');
143
            //$page = $this->load->view('pages/v_home' ,$t,FALSE);
144
        
145
146
    }
147
148
149
}