<!DOCTYPE html>
<html>
<?php foreach($kontak as $kontak) :   endforeach; ?>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Data Barang</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Bootstrap 4 -->

  <!-- Font Awesome -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/plugins/fontawesome-free/css/all.min.css">
   
  <!-- Theme style -->
  <link rel="stylesheet" href="<?php echo base_url();?>assets/dist/css/adminlte.min.css">

   
</head>
<body>
<div class="wrapper">
  <!-- Main content -->
  <section class="invoice">
  	<h2>DATA BARANG TOKO <?php echo  strtoupper($jenis_laporan.' '.$kontak->nama_toko) ;?> </h2>
  	<hr>
  	<table class="table table-bordered  ">
  		<thead>
  			<tr style="background: #cccccc;">
  				<th>No</th>
  				<th>Foto</th>
  				<th>Nama Barang</th>
  				<th>Rak </th>
          <th>Selfing </th>
  				<th>Katagori Barang</th>
  				<th>Satuan Beli</th>
  				<th>Isi S.Beli</th>

  				<th> Harga Beli Dos</th>
  				<th> Harga Beli Ecer</th>
  				<th> Satuan Jual</th>
  				<th> Harga Jual Dos</th>
  				<th> Harga Jual Ecer</th>
  				<th> Harga Grosir </th>
  				<th> Minimal Grosir </th>

  			 

  			</tr>
  		</thead>
  		<tbody>
  			<?php $no=1; foreach($barang as $rows) : ?> 
  			<tr>
  				<td><?php echo $no; ?></td>
  				<td><img width="50px" src="<?php echo base_url();?>images/barang/<?php  echo $rows->foto;   ?>" alt="<?php  echo $rows->foto;   ?>" class="brand-image img-circle elevation-2" style="opacity: .8"> </td> 
  				<td><?php echo $rows->nama_barang; ?></td>
  				
  				<td>	<?php 
			  				$id_rak = $rows->id_rak; 
			  				$sql_menuu = "SELECT * FROM tb_rak WHERE  id_rak = '$id_rak' ";
			  				$main_menuu = $this->db->query($sql_menuu)->result();
			  				foreach ($main_menuu as $mainkk) {
			  					echo $nama_rak= $mainkk->nama_rak;


			  				}
			  				?>
			  					
			  	</td>
          <td style="text-align: center">  <?php 
                   $id_selfing = $rows->id_selfing; 
                                        if(empty($id_selfing)){
                                          $id_selfing= 0;
                                          $nama_selfing= 0;
                                        }else{
                                         $sql_selfing = "SELECT * FROM tb_selfing WHERE  id_selfing = '$id_selfing' ";
                                         $mainselfing = $this->db->query($sql_selfing)->result();
                                         foreach ($mainselfing as $s) {

                                          $id_selfing= $s->id_selfing;
                                         echo $nama_selfing= $s->nama_selfing;

                                        }


                                        

                                      }


                ?>
                  
          </td>
			  	<td><?php 
		  				$id_katagori = $rows->id_katagori; 
		  				$sql_menu = "SELECT * FROM tb_katagori WHERE  id_katagori = '$id_katagori' ";
		  				$main_menu = $this->db->query($sql_menu)->result();
		  				foreach ($main_menu as $maink) {
		  					$nama_katagori= $maink->nama_katagori;
		  					echo $nama_katagori;
		  				}
		  				?>
  					
  				</td>



  			 	<td><?php 
			  			$id_satuan_beli = $rows->id_satuan_beli; 
			  			$sql_menu = "SELECT * FROM tb_satuan WHERE  id_satuan = '$id_satuan_beli' ";
			  			$main_menu = $this->db->query($sql_menu)->result();
			  			foreach ($main_menu as $main) {
			  				echo $main->nama_satuan;
			  				$id_satuan_beli= $main->id_satuan;
			  				$nama_satuan_beli= $main->nama_satuan;

			  			} ?>
  				
  				</td>
  			 	<td>
  			 			<?php echo $rows->isi; ?>

  			 	</td>
  			 	<td style="text-align: right;">
  			 			<?php echo nominal($rows->harga_beli_dos); ?>

  			 	</td>
  			 	<td style="text-align: right;">
  			 			<?php echo nominal($rows->harga_beli_ecer); ?>

  			 	</td>
  			 	<td>
	  			 		<?php 
		  				$id_satuan_jual = $rows->id_satuan_jual; 
		  				$sql_menu = "SELECT * FROM tb_satuan WHERE  id_satuan = '$id_satuan_jual' ";
		  				$main_menu = $this->db->query($sql_menu)->result();
		  				foreach ($main_menu as $main) {
		  					echo $main->nama_satuan;
		  					$id_satuan_jual= $main->id_satuan;
		  					$nama_satuan_jual= $main->nama_satuan;

		  				}
		  				?>
  			 	</td>
  			 	<td style="text-align: right;">
  			 			<?php echo nominal($rows->harga_jual_dos); ?>

  			 	</td >
  			 	<td style="text-align: right;">
  			 			<?php echo nominal($rows->harga_jual_ecer); ?>

  			 	</td>

  			 
  			 	<td style="text-align: right;">
  			 		<?php echo nominal($rows->harga_grosir); ?>
  			 	</td>
  			 	<td>
  			 		<?php echo $rows->min_grosir; ?> item
  			 	</td>

  			</td>
  			 


  	</tr>
  	<?php $no++; endforeach; ?>

  		</tbody>

		</table>



                 
  </section>
  <div class="row">
              	<div class="col-lg-12">
              		<table width="100%" border="0">
              			<tr>

              				<td >Mangetahui,</td>
              				<td width="400px;"  ></td>
              				<td ><?php echo $kontak->kab_kota ; ?>, <?php echo tgl_indo(date('Y-m-d'));  ?></td>
              			</tr>
              			<tr>
              				<td>Manager </td>
              				<td width="400px;"></td>
              				<td>Admin</td>
              			</tr>
              			<tr height="70px;">
              				<td></td>
              				<td></td>
              				<td></td>
              			</tr>
              			<tr>
              				<td> _____________________________ </td>
              				<td width="400px;"></td>
              				<td><strong>_____________________________</strong></td>
              			</tr>
              		</table>

              	</div><!-- /.row -->
              </div>
  <!-- /.content -->
</div>
<!-- ./wrapper -->

<script type="text/javascript"> 
  window.addEventListener("load", window.print());
</script>
</body>
</html>
