Guest User

Untitled

a guest
Sep 15th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.20 KB | None | 0 0
  1. model:
  2. function lihat_outlet1($id_callsheet)
  3.      {
  4.        
  5.        
  6.         $coba = $this->db->query("select * from tabel_callsheet a, tabel_rute b, tabel_outlet c, tabel_tipe_outlet d, tabel_callsheet_outlet e, tabel_brand f
  7.         where a.id_rute=b.id_rute and b.id_rute=c.id_rute and c.id_tipe_outlet=d.id_tipe_outlet and a.id_callsheet=e.id_callsheet and e.id_brand=f.id_brand and
  8.         e.id_outlet=c.id_outlet and a.id_callsheet='".$id_callsheet."' group by c.id_outlet")->row_array();
  9.        
  10.         $detail = $this->db->query("select * from tabel_callsheet_outlet a, tabel_brand b where a.id_brand=b.id_brand and a.id_callsheet='".$coba['id_callsheet']."'
  11.         and a.id_outlet='".$coba['id_outlet']."'");
  12.         return $detail;
  13.      }
  14.  
  15. controller:
  16. public function input_callsheet($id_callsheet)
  17.     {
  18.         $id_callsheet= $this->uri->segment(3);
  19.         $this->load->model("model_brand",'',TRUE);
  20.         $data['brand']=$this->model_brand->lihat();
  21.         $data['notasi']=$this->model_brand->lihat();
  22.        
  23.        
  24.         $this->load->model("model_callsheet");
  25.         $data['callsheet'] = $this->model_callsheet->lihat_data($id_callsheet);
  26.         $data['outlet']= $this->model_callsheet->lihat_outlet($id_callsheet);
  27.         $data['detail']= $this->model_callsheet->lihat_outlet1($id_callsheet);
  28.        
  29.         $data['title']="PT. Surya Mustika Lampung";
  30.         $data['user']=$this->session->userdata('username');
  31.         $data['level']=$this->session->userdata('level');
  32.    
  33.         $this->load->view('admin/callsheet/input_callsheet',$data);
  34.     }
  35.  
  36. view:
  37. <table width="200%">
  38.         <tr align="center">
  39.             <td width="1%" rowspan="2"><b>OPTION</b></td>
  40.             <td width="1%" rowspan="2"><b>NO</b></td>
  41.             <td width="2%" rowspan="2"><b>KODE OUTLET</b></td>
  42.             <td width="5%" rowspan="2"><b>NAMA OUTLET</b></td>
  43.             <td width="8%" rowspan="2"><b>ALAMAT</b></td>
  44.             <td width="2%" rowspan="2"><b>TIPE OUTLET</b></td>
  45.             <?php foreach($brand->result_array() as $brand){?>
  46.             <td width="8%" Colspan="4" align="center"><?php echo $brand['nama_brand'];?></td>
  47.             <?php } ?>
  48.         </tr>
  49.         <tr align="center">
  50.         <?php foreach($notasi->result_array() as $notasi){?>
  51.             <td width="2%">STOCK</td>
  52.             <td width="2%">BUY</td>
  53.             <td width="2%">NOTE</td>
  54.             <td width="2%">VIS</td>
  55.         <?php } ?>
  56.         </tr>
  57.         <?php
  58.         foreach($outlet->result_array() as $outlet){
  59.         $i++;
  60.         ?>
  61.         <tr>
  62.             <td align="center"><img src="<?php echo base_url();?>asset/images/tambah.gif" onclick="window.open('<?php echo base_url();?>callsheet/isi_data/<?php echo $tampil['id_callsheet'];?>/<?php echo $outlet['id_outlet'];?>', 'winpopup', 'toolbar=yes,statusbar=yes,menubar=yes,resizable=yes,scrollbars=yes,width=1200,height=800');" style="cursor:pointer"></td>
  63.             <td align="center"><?php echo $i;?></td>
  64.             <td><?php echo $outlet['kode_outlet'];?></td>
  65.             <td><?php echo $outlet['nama_outlet'];?></td>
  66.             <td><?php echo $outlet['alamat_outlet'];?></td>
  67.             <td align="center"><?php echo $outlet['tipe_outlet'];?></td>
  68.         <?php
  69.         foreach($detail->result_array() as $a){
  70.         ?> 
  71.             <td align="center"><?php echo $a['stock_outlet'];?></td>
  72.             <td align="center"><?php echo $a['buy_outlet'];?></td>
  73.             <td align="center"><?php echo $a['notasi_outlet'];?></td>
  74.             <td align="center"><?php echo $a['visibility_outlet'];?></td>
  75.         <?php } ?> 
  76.         </tr>
  77.        
  78.         <?php } ?>
  79.         </table>
Advertisement
Add Comment
Please, Sign In to add comment