Advertisement
Phantom1605

Cryption

Dec 15th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. /* Controller */
  2.         public function index(){
  3.             $data = $this->SkripsiModel->ambilData();
  4.             $jumlah = $this->SkripsiModel->jumlahData();
  5.  
  6.             $this->load->view('skripsi_view', compact('data', 'jumlah'));
  7.         }
  8.  
  9. /* Model */
  10.         function ambilData(){
  11.             return $this->db->get('tbl_kategori')->result_array();
  12.         }
  13.  
  14.         function jumlahData(){
  15.             return $this->db->count_all('tbl_kategori');
  16.         }
  17.  
  18. /* View */
  19.         <table border="1" cellpadding="5" cellspacing="3" style="border-collapse: collapse;">
  20.             <tr>
  21.                 <th>Nama Karyawan</th>
  22.                 <?php
  23.                     foreach ($data as $row) {
  24.                         echo "<th>".$row['nama_kategori']."</th>";
  25.                     }
  26.                 ?>
  27.             </tr>
  28.             <?php
  29.                 for ($i=1; $i <=5 ; $i++) {
  30.             ?>
  31.             <tr>
  32.                 <td>Karyawan <?php echo $i;?></td>
  33.             <?php
  34.                 for ($ii=1; $ii <= $jumlah ; $ii++) {
  35.             ?>
  36.                 <td><?php echo form_input('karyawan_'.$i, '');?></td>
  37.             <?php
  38.                 }
  39.             ?>
  40.             </tr>
  41.             <?php
  42.                 }
  43.             ?>
  44.         </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement