tripsdoc

barang/tampil.php

Dec 12th, 2016
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1. <div class="col-md-20">
  2.     <div class="panel panel-default">
  3.         <div class="panel-body">
  4.             <form class="form-horizontal" id="form_datatransaksi" role="form">
  5.                 <?php  
  6.                     $is_login = $this->session->userdata('is_login');
  7.                     $username = $this->session->userdata('username');
  8.                 ?>
  9.  
  10.                 <?php if ($is_login): ?>
  11.                 <?php
  12.                     if($jumlah > 0){
  13.                 ?>
  14.                     <table>
  15.                         <tr>
  16.                             <td>Jumlah Barang : <?= $jumlah?> </td>
  17.                         </tr>
  18.                     </table>
  19.                         <table class="table table-hover" width="100%">
  20.                             <thead>
  21.                                 <tr bgcolor="#4CAF50">
  22.                                     <th scope="col">No. </th>
  23.                                     <th scope="col">Kode</th>
  24.                                     <th scope="col">Nama Barang</th>
  25.                                     <th scope="col">Harga Barang</th>
  26.                                     <th scope="col">Stok Barang</th>
  27.                                     <th colspan="3" scope="col">Opsi</th>
  28.                                 </tr>
  29.                             </thead>
  30.                         <tbody>
  31.                         <?php
  32.                             $n=1;
  33.                         ?>
  34.                             <?php foreach($data as $row): ?>
  35.                             <tr>
  36.                                 <td><?= $n++ ?></td>
  37.                                 <td><?= $row['kode'] ?></td>
  38.                                 <td><?= $row['nama'] ?></td>
  39.                                 <td><?= $row['harga'] ?></td>
  40.                                 <td><?= $row['stok'] ?></td>
  41.                                 <td>
  42.                                     <a href="<?= base_url() ?>kasir/detailBarang/<?= $row['kode'] ?>" class="btn btn-info">Detail</a>
  43.                                     <a href="<?= base_url() ?>kasir/ubahBarang/<?= $row['kode'] ?>" class="btn btn-warning">Update</a> 
  44.                                     <a href="<?= base_url() ?>kasir/deleteBarangDB/<?= $row['kode'] ?>" class="btn btn-danger">Delete</a>
  45.                                 </td>
  46.                             </tr>
  47.                             <?php endforeach ?>
  48.                         </tbody>
  49.                         </table>
  50.                     <?php
  51.                         }
  52.                     ?>
  53.                 <?php else: ?>
  54.                 <?= header("location:index.php?pesan=gagal")or die(mysql_error()); ?>
  55.                 <?php endif ?>
  56.             </form>
  57.             <br>
  58.             <div>
  59.                 <a class="btn btn-primary" href="<?= base_url() ?>Kasir/tambahBarang">Daftar Barang</a>
  60.                 <a class="btn btn-primary" href="<?= base_url() ?>laporan-barang">Tampilkan Laporan</a>
  61.             </div>
  62.         </div>
  63.     </div>
  64. </div>
Add Comment
Please, Sign In to add comment