Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model:<?php
- function lihat_outlet1($id_callsheet)
- {
- $coba0 = $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
- 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
- e.id_outlet=c.id_outlet and a.id_callsheet='".$id_callsheet."' group by c.id_outlet")->result_array();
- foreach($coba0 as $coba){
- $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']."'
- and a.id_outlet='".$coba['id_outlet']."'");
- }
- return $detail;
- }
- ?>
- controller:
- <?php
- public function input_callsheet($id_callsheet)
- {
- $id_callsheet= $this->uri->segment(3);
- $this->load->model("model_brand",'',TRUE);
- $data['brand']=$this->model_brand->lihat();
- $data['notasi']=$this->model_brand->lihat();
- $this->load->model("model_callsheet");
- $data['callsheet'] = $this->model_callsheet->lihat_data($id_callsheet);
- $data['outlet']= $this->model_callsheet->lihat_outlet($id_callsheet);
- $data['detail']= $this->model_callsheet->lihat_outlet1($id_callsheet);
- $data['title']="PT. Surya Mustika Lampung";
- $data['user']=$this->session->userdata('username');
- $data['level']=$this->session->userdata('level');
- $this->load->view('admin/callsheet/input_callsheet',$data);
- }
- ?>
- view:
- <table width="200%">
- <tr align="center">
- <td width="1%" rowspan="2"><b>OPTION</b></td>
- <td width="1%" rowspan="2"><b>NO</b></td>
- <td width="2%" rowspan="2"><b>KODE OUTLET</b></td>
- <td width="5%" rowspan="2"><b>NAMA OUTLET</b></td>
- <td width="8%" rowspan="2"><b>ALAMAT</b></td>
- <td width="2%" rowspan="2"><b>TIPE OUTLET</b></td>
- <?php foreach($brand->result_array() as $brand){?>
- <td width="8%" Colspan="4" align="center"><?php echo $brand['nama_brand'];?></td>
- <?php } ?>
- </tr>
- <tr align="center">
- <?php foreach($notasi->result_array() as $notasi){?>
- <td width="2%">STOCK</td>
- <td width="2%">BUY</td>
- <td width="2%">NOTE</td>
- <td width="2%">VIS</td>
- <?php } ?>
- </tr>
- <?php
- foreach($outlet->result_array() as $outlet){
- $i++;
- ?>
- <tr>
- <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>
- <td align="center"><?php echo $i;?></td>
- <td><?php echo $outlet['kode_outlet'];?></td>
- <td><?php echo $outlet['nama_outlet'];?></td>
- <td><?php echo $outlet['alamat_outlet'];?></td>
- <td align="center"><?php echo $outlet['tipe_outlet'];?></td>
- <?php
- foreach($detail as $detail1){
- //->result_array() as $a){
- $a=$detail1->result_array();
- ?>
- <td align="center"><?php echo $a['stock_outlet'];?></td>
- <td align="center"><?php echo $a['buy_outlet'];?></td>
- <td align="center"><?php echo $a['notasi_outlet'];?></td>
- <td align="center"><?php echo $a['visibility_outlet'];?></td>
- <?php } ?>
- </tr>
- <?php } ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment