Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php empty( $app ) ? header('location:./index.php') : '' ; if(isset($_SESSION['level'])){?>
- <?php
- $base_url = 'http://'.$_SERVER['HTTP_HOST'].'/login_multiuser/';
- isset ($_GET['master']) ? $app = $_GET['master'] : $app = 'home';
- ?>
- <!doctype html>
- <html>
- <head>
- <title>Product List</title>
- <link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
- <script src="js/jquery.js"></script>
- <script src="bootstrap/js/bootstrap.js"></script>
- </head>
- <body>
- <div class="container">
- <div>
- <h1> Product List </h1>
- <hr>
- <a align="right" href="#"
- onclick="window.open( 'app/tambah.php', 'name', 'location=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,width=800,height=1500' )" class="btn btn-info">
- <span class="glyphicon glyphicon-plus"></span> Add Product</a>
- <button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal<?php echo "a"?>"><span class="glyphicon glyphicon-plus"></span> New Product</button>
- <a href="modal.php" data-toggle="modal" data-target="#theModals">Lab 6</a>
- </hr>
- <div class="modal fade text-center" id="theModals">
- <div class="modal-dialog">
- <div class="modal-content">
- </div>
- </div>
- </div>
- <p></p>
- <!-- Modal -->
- <div id="myModal<?php echo "a"?>" class="modal fade" role="dialog">
- <div class="modal-dialog">
- <!-- konten modal-->
- <div class="modal-content">
- <!-- heading modal -->
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal">×</button>
- <h4 class="modal-title">Bagian heading modal</h4>
- </div>
- <!-- body modal -->
- <div class="modal-body">
- <form method="post" action="app/prosesnew.php" enctype="multipart/form-data">
- <div class="form-group">
- <label>Name </label>
- <div class="form-group">
- <input type="text" class="form-control" name="nama" required autofocus>
- </div>
- <div class="form-group">
- <label>Type</label>
- <select class="form-control" name="jenis">
- <option value="">Choose..</option>
- <option value="food">Food</option>
- <option value="officekit">Office Kit</option>
- </select>
- </div>
- <label>Quantity </label>
- <div class="form-group">
- <input type="text" class="form-control" name="qty" required autofocus>
- </div>
- <label>Count As </label>
- <div class="form-group">
- <input type="text" class="form-control" name="satuan" required autofocus>
- </div>
- <label>Desription </label>
- <div class="form-group">
- <input type="text" class="form-control" name="deskripsi" required autofocus>
- </div>
- <label>Price </label>
- <div class="form-group">
- <input type="text" class="form-control" name="harga" required autofocus>
- </div>
- </div>
- <!-- footer modal -->
- <div class="modal-footer">
- <button type="submit" id="simpan" class="btn btn-primary">Save</button>
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- <table id="product" class="table table-hover table-bordered">
- <thead>
- <tr class="active" >
- <th class="text-center" rowspan="2" width="5%">Nomor</th>
- <th class="text-center" rowspan="2" width="20%">Nama</th>
- <th class="text-center" rowspan="2" width="20%">Jenis</th>
- <th class="text-center" colspan="3" width="10%">Quantity</th>
- <th class="text-center" rowspan="2" width="5%">Unit</th>
- <th class="text-center" rowspan="2" width="15%">Price (Rp)</th>
- <th class="text-center" rowspan="2" width="20%">Action</th>
- <tr class="active">
- <th scope="col" width="5%">In</th>
- <th scope="col" width="5%">Out</th>
- <th scope="col" width="5%">End</th>
- </tr>
- </thead>
- </thead>
- <tbody>
- <?php
- //Data mentah yang ditampilkan ke tabel
- mysql_connect('localhost', 'root', '');
- mysql_select_db('inventory');
- $sql = mysql_query('SELECT * FROM product order by procode desc');
- $no = 1;
- while ($r = mysql_fetch_array($sql)) {
- $id = $r['procode'];
- ?>
- <tr align="center">
- <td><?php echo $no;?></td>
- <td><?php echo"$r[nama]";?></td>
- <td><?php echo"$r[jenis]";?></td>
- <td><?php echo"$r[qtyin]";?></td>
- <td><?php echo"$r[qtyout]";?></td>
- <td><?php echo"$r[qtyend]";?></td>
- <td><?php echo"$r[satuan]";?></td>
- <td><?php echo"$r[harga]";?></td>
- <td>
- <a href="app/edit.php?procode=<?php echo"$r[procode]";?>" class="edit-record" data-id="<?php echo"$r[procode]";?>" data-toggle="modal" data-target="#myModal<?php echo "a"?>"><span class="glyphicon glyphicon-edit"></span> edit</a>
- <a href="del.php?del=<?php echo"$r[procode]";?>" onClick="return confirm('Apakah anda yakin akan menghapus data ini?')"><span class="glyphicon glyphicon-trash"></span> Hapus</a>
- </td>
- </tr>
- <?php
- $no++;
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
- <script type="text/javascript">
- $(function() {
- $("#product").dataTable();
- });
- </script>
- </body>
- </html>
- <?php
- }else{
- echo '<div class="alert alert-error"> Maaf Anda Harus Login terlebih dahulu untuk mengakses halaman ini </div>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement