<?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">
                <button type="button" class="btn btn-info" data-toggle="modal" data-target="#modal-default">
                  <i class="fa fa-plus"></i> Tambah Data 
                </button>
               	<a target="blank" href="<?php echo base_url('laporan/cetak_barang');?>"> <button type="button" class="btn btn-success" >
                  <i class="fa fa-print"></i> Cetak
                </button> </a>
                 

              </div>
              <!-- /.card-header -->
              <div class="card-body">
                <table class="table table-striped" id="mytable">
                  <thead>
                    <tr>
                      <th>Code Barcode Ecer</th>
                      <th>Nama Barang</th>
                      <th>Harga Beli Ecer</th>
                      <th>Harga Jual Ecer</th>
                      <th>Aksi</th>
                    </tr>
                  </thead>
                </table>
              </div>
              <!-- /.card-body -->
            </div>
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  	<!-- Modal Tambah Data -->
  	<form class="form-horizontal" action="<?php echo base_url('barang/code_tambah'); ?>" method="POST" enctype="multipart/form-data" />  
  		<div class="modal fade" id="modal-default">
  			<div class="modal-dialog">
  				<div class="modal-content">
  					<div class="modal-header">
  						<h4 class="modal-title">Tambah Data</h4>
  						<button type="button" class="close" data-dismiss="modal" aria-label="Close">
  							<span aria-hidden="true">&times;</span>
  						</button>
  					</div>
  					<div class="modal-body">
  						<div class="form-group">
  							<label for="exampleInputEmail1">Kode Barcode Ecer</label>
  							<input type="text" class="form-control" id="" name="barcode_ecer" placeholder="Isikan Kode Barcode" required="">
  							<input type="hidden" name="id_admin" value="<?php echo $id_admin_login; ?>">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputEmail1">Kode Barcode Pack/Dos</label>
  							<input type="text" class="form-control" id="" name="barcode_dos" placeholder="Isikan Barcode Barang dalam 1Dos/Pack/Liter dll" required="">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputEmail1">Nama Barang  </label>
  							<input type="text" class="form-control" id="" name="nama_barang" placeholder="Exm: Baterai ABC AAA  " required="">
  							<small>Tambahkan Merk + Ukuran ada Barang</small>
  						</div>
  						<div class="form-group">
  							<label for="exampleInputPassword1">Pilih Satuan Beli</label>
  							<select class="form-control" id="exampleInputPassword1" name="id_satuan_beli">
  								<?php foreach($satuan as $satuan1) : ?>
  									<option value=" <?php echo $satuan1->id_satuan; ?>"> <?php echo $satuan1->nama_satuan; ?></option>
  								<?php endforeach; ?> 

  							</select>  
  						</div>

  						<div class="form-group">
  							<label for="exampleInputEmail1">Isi Satuan Beli</label>
  							<input type="text" class="form-control" id="" name="isi" placeholder="Jumlah dalam satuan beli" required="">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputEmail1">Harga Beli Ecer/Dos</label>
  							<input type="text" class="form-control" id="" name="harga_beli_dos" placeholder="Harga Beli" required="">
  						</div>

  						<div class="form-group">
  							<label for="exampleInputPassword1">Pilih Satuan Jual</label>
  							<select class="form-control" id="exampleInputPassword1" name="id_satuan_jual">
  								<?php foreach($satuan as $satuan2) : ?>
  									<option value=" <?php echo $satuan2->id_satuan; ?>"> <?php echo $satuan2->nama_satuan; ?></option>
  								<?php endforeach; ?> 

  							</select>  
  						</div>
  						<div class="form-group">
  							<label for="exampleInputEmail1">Harga Jual Ecer</label>
  							<input type="text" class="form-control" id="" name="harga_jual_ecer" placeholder="Harga Jual Ecer" required="">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputEmail1">Harga Jual Dos</label>
  							<input type="text" class="form-control" id="" name="harga_jual_dos" placeholder="Harga Jual Dos" required="">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputPassword1">Harga Grosir</label>
  							<input type="text" class="form-control" id="exampleInputPassword1" name="harga_grosir" placeholder="Harga Jual Grosir" required="">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputPassword1">Min Grosir</label>
  							<input type="text" class="form-control" id="exampleInputPassword1" name="min_grosir" placeholder="Harga Grosir" required="">
  						</div>
  						 
  						<div class="form-group">
  							<label for="exampleInputPassword1">Pilih Katagori</label>
  							<select class="form-control" id="exampleInputPassword1" name="id_katagori">
  								<?php foreach($katagori as $katagori1) : ?>
  									<option value=" <?php echo $katagori1->id_katagori; ?>"> <?php echo $katagori1->nama_katagori; ?></option>
  								<?php endforeach; ?> 

  							</select>  
  						</div>
  						<div class="form-group">
  							<label for="exampleInputPassword1">Pilih Rak</label>
  							<select class="form-control" id="exampleInputPassword1" name="id_rak">
  								<?php foreach($rak as $rak1) : ?>
  									<option value=" <?php echo $rak1->id_rak; ?>"> <?php echo $rak1->nama_rak; ?></option>
  								<?php endforeach; ?> 

  							</select>  
  						</div>
              <div class="form-group">
                <label for="exampleInputPassword1">Pilih Selfing</label>
                <select class="form-control" id="exampleInputPassword1" name="id_selfing">
                  <?php foreach($selfing as $selfing1) : ?>
                    <option value=" <?php echo $selfing1->id_selfing; ?>"> <?php echo $selfing1->nama_selfing; ?></option>
                  <?php endforeach; ?> 

                </select>  
              </div>
  						 
  						 
  						<div class="form-group">
  							<label for="exampleInputFile">File Foto</label>
  							<div class="input-group">

  								<input type="file" name="foto">


  							</div>
  						</div>
  					</div>
  						<div class="modal-footer justify-content-between">
  							<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  							<button type="submit" class="btn btn-primary">Simpan</button>
  						</div>
  					</div>
  					<!-- /.modal-content -->
  				</div>
  				<!-- /.modal-dialog -->
  		</div>
  	</form>