<?php foreach($kontak as $kontak) :   endforeach; ?>
<?php foreach($admin_login as $user) :   endforeach; ?> 
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark"> 
            		 <?php echo $title1; ?>
            </h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active"><?php echo $title1; ?></li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->
	    
          
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
      	  <div class="card">
              <div class="card-header">
               History Barang

              </div>
              <!-- /.card-header -->
              <div class="card-body">
              	<table  class="table table-bordered table-striped">
              		<thead>
              			<tr>
              				<th>No</th>
											<th>Nama Barang</th>
											<th>Kantor </th>
											<th>Jumlah</th>
											<th>Keterangan</th> 
											<th>Id Transaksi/Faktur</th> 
											<th>Admin</th>               			 
              			 
              				
              			</tr>
              		</thead>
              		<tbody>
              			<?php $no=1; foreach($data->result()  as $rows) : 

											$id_barang= $rows->id_barang;
											$this->db->where('id',$id_barang);
											$query = $this->db->get('tb_barang');
											$row = $query->row();
											$barcode_ecer = $row->barcode_ecer;
											$nama_barang = $row->nama_barang;
										 
						          //rak
										 
										?>  
              				<tr style="background: <?php $cek=$rows->keterangan; if($cek =='masuk'){echo "#00c9fc";} else if($cek =='retur'){echo "#c8ff23";}else if($cek =='buang'){echo "red";} ?>" >
              					<td><?php echo $no; ?></td>
              					<td><?php echo $nama_barang; ?></td>
              					<td>
              						<?php 
              						$id_kantor = $rows->id_kantor; 
              						$sql_menu = "SELECT * FROM tb_kantor WHERE  id_kantor = '$id_kantor' ";
              						$main_menu = $this->db->query($sql_menu)->result();
              						foreach ($main_menu as $maink) {
              							echo  $maink->nama_kantor;

              						}
              						?>
              					
              					<td><?php echo $rows->jumlah;  ?></td>
              					<td><?php echo $rows->keterangan;  ?></td>
              					<td><?php echo $rows->id_transaksi;  ?></td> 
              					<td><?php 
              						$id_admin = $rows->id_admin; 
              						$sql_menu = "SELECT * FROM tb_admin WHERE  id = '$id_admin' ";
              						$main_menu = $this->db->query($sql_menu)->result();
              						foreach ($main_menu as $maink) {
              							echo  $maink->nama_admin;

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

              		</tbody>

              	</table>
                <br>
              	<div class="row">
              		<div class="col">
              			<!--Tampilkan pagination-->
              			<?php echo $pagination; ?>
              		</div>
              	</div>
              </div>
              <!-- /.card-body -->
            </div>
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

   