<?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>

              </div>
              <!-- /.card-header -->
              <div class="card-body">
              	<table id="example1" class="table table-bordered table-striped">
              		<thead>
              			<tr>
              				<th>No</th>
              				<th>Nama <?php echo $title4; ?></th>
              				<th>Url</th>
              				<th>Petugas</th>
              				<th>Alamat</th>
              				<th>No HP</th>
              				<th>Aksi</th>
              				
              			</tr>
              		</thead>
              		<tbody>
              			<?php $no=1; foreach($gudang as $rows) : ?> 
              				<tr>
												<td><?php echo $no; ?></td>
              					<td><?php echo $rows->nama_gudang; ?></td>
              					<td><?php echo $rows->url_gudang; ?></td>
              					<td><?php echo $rows->nama_petugas; ?></td>
              					<td><?php echo $rows->alamat; ?></td>
              					<td><?php echo $rows->no_hp; ?></td>
              				 

              					<td>

              						<a href=""  type="button" data-toggle="modal" data-target="#modal-edit<?php echo $rows->id_gudang; ?>"><i class="fa fa-edit"></i></a> | 
              						<a href="" style="color: red;"  type="button"  data-toggle="modal" data-target="#modal-hapus<?php echo $rows->id; ?>"><i class="fa fa-trash"></i></a>

              						<!-- Edit -->
              						<form class="form-horizontal" action="<?php echo base_url('gudang/code_ubah'); ?>" method="POST" enctype="multipart/form-data" />  
              							<div class="modal fade" id="modal-edit<?php echo $rows->id_gudang; ?>">
              								<div class="modal-dialog">
              									<div class="modal-content">
              										<div class="modal-header">
              											<h4 class="modal-title">Edit Data <?php echo $rows->nama_gudang; ?></h4>
              											<button type="button" class="close" data-dismiss="modal" aria-label="Close">
              												<span aria-hidden="true">&times;</span>
              											</button>
              										</div>
              										<div class="modal-body">

              											<!-- id kirim -->
              											<input type="hidden" name="id" value="<?php echo $rows->id_gudang; ?>">
              											<div class="form-group">
              												<label for="exampleInputEmail1">Nama <?php echo $title4; ?></label>
              												<input type="text" class="form-control" value="<?php echo $rows->nama_gudang; ?>" id="exampleInputEmail1" name="nama_gudang" placeholder="">
              											</div>
              											<div class="form-group">
              												<label for="exampleInputEmail1">Nama Petugas </label>
              												<input type="text" class="form-control" value="<?php echo $rows->nama_petugas; ?>" id="exampleInputEmail1" name="nama_petugas" placeholder="">
              											</div>
              											<div class="form-group">
              												<label for="exampleInputEmail1">Alamat Supliyer</label>
              												<input type="text" class="form-control" value="<?php echo $rows->alamat; ?>" id="exampleInputEmail1" name="alamat" placeholder="">
              											</div>

              											<div class="form-group">
              												<label for="exampleInputEmail1">Nomor HP </label>
              												<input type="text" class="form-control" value="<?php echo $rows->no_hp; ?>" id="exampleInputEmail1" name="no_hp" placeholder="">
              											</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>

              						<!-- Hapus -->

              						<form class="form-horizontal" action="<?php echo base_url('gudang/code_hapus'); ?>" method="POST" enctype="multipart/form-data" />  
              							<div class="modal fade" id="modal-hapus<?php echo $rows->id; ?>">
              								<div class="modal-dialog">
              									<div class="modal-content bg-danger">
              										<div class="modal-header">
              											<h4 class="modal-title">Hapus 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">
              											<h4>Apakah Yakin Menghapus Data Ini, <?php echo $rows->nama_gudang; ?> ?</h4>
              											<!-- id kirim -->
              											<input type="hidden" name="id" value="<?php echo $rows->id_gudang; ?>">


              										</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">Hapus</button>
              										</div>
              									</div>
              									<!-- /.modal-content -->
              								</div>
              								<!-- /.modal-dialog -->
              							</div>
              						</form>

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

              		</tbody>

              	</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('gudang/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">Nama <?php echo $title4; ?></label>
  							<input type="text" class="form-control" id="exampleInputEmail1" name="nama_gudang" placeholder="Isikan Nama <?php echo $title4; ?>" required="">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputEmail1">Nama Petugas </label>
  							<input type="text" class="form-control"   id="exampleInputEmail1" name="nama_petugas" placeholder="" required="">
  						</div>
  						<div class="form-group">
  							<label for="exampleInputEmail1">Alamat Supliyer</label>
  							<input type="text" class="form-control"   id="exampleInputEmail1" name="alamat" placeholder="">
  						</div>

  						<div class="form-group">
  							<label for="exampleInputEmail1">Nomor HP </label>
  							<input type="text" class="form-control"  id="exampleInputEmail1" name="no_hp" placeholder="">
  						</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>