Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <?php $this->load->view("admin/_partials/head.php") ?>
- </head>
- <body id="page-top">
- <!-- Page Wrapper -->
- <div id="wrapper">
- <?php $this->load->view("admin/_partials/sidebar.php") ?>
- <!-- Content Wrapper -->
- <div id="content-wrapper" class="d-flex flex-column">
- <!-- Main Content -->
- <div id="content">
- <?php $this->load->view("admin/_partials/navbar.php") ?>
- <!-- Begin Page Content -->
- <div class="container-fluid">
- <?php //$this->load->view("admin/_partials/breadcrumb.php") ?>
- <!-- Page Heading -->
- <div class="d-sm-flex align-items-center justify-content-between mb-4">
- <h1 class="h3 mb-0 text-gray-800">Cashier - <?php echo $_SESSION['role'] ?></h1>
- </div>
- <div class="row">
- <div class="col-sm-7">
- <div class="card mb-3">
- <div class="card-header">
- <a href="#">Books</a>
- </div>
- <div class="card-body">
- <form action="<?php echo site_url('admin/transactions') ?>" method="post" enctype="multipart/form-data" >
- <div class="form-group row">
- <div class="col-sm-5">
- <input type="text" class="form-control" name="keyword" placeholder="Search...">
- </div>
- <input type="submit" class="btn btn-right btn-info" name="search_submit" value="Search">
- </div>
- </form>
- <div class="table-responsive">
- <table class="table table-hover">
- <thead>
- <tr>
- <th>Book ID</th>
- <th>Title</th>
- <th>Price</th>
- <th>Stock</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($books as $book): ?>
- <tr>
- <td>
- <?php echo $book->book_id ?>
- </td>
- <td>
- <?php echo $book->title ?>
- </td>
- <td>
- Rp. <?php echo number_format($book->price) ?>
- </td>
- <td>
- <?php echo $book->stock ?>
- </td>
- <td>
- <a href="<?php echo site_url('admin/transactions/buy/'.$book->book_id)
- ?>"> Buy </a>
- </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="col-sm-5">
- <div class="card mb-3">
- <div class="card-header">
- <a href="#">Cart</a>
- </div>
- <div class="card-body">
- <p> Transaction code: <?php echo $kode_jual; ?></p>
- <div class="table-responsive">
- <table class="table table-hover">
- <thead>
- <tr>
- <th>No</th>
- <th>Title</th>
- <th>Price</th>
- <th>Qty</th>
- <th>Total</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- <?php $no=1;foreach ($details as $buy): ?>
- <tr>
- <td>
- <?php echo $no ?>
- </td>
- <td>
- <?php echo $buy->title ?>
- </td>
- <td>
- Rp. <?php echo number_format($buy->price) ?>
- </td>
- <td>
- <?php echo $buy->qty ?>
- </td>
- <td>
- Rp. <?php echo number_format( $buy->subtotal) ?>
- </td>
- <td>
- <a href="<?php echo site_url('admin/transactions/remove/'.$kode_jual.'-'.$buy->book_id)
- ?>"> Remove </a>
- </td>
- </tr>
- <?php $no++; endforeach; ?>
- <tr>
- <td colspan="4">Total</td>
- <td colspan="2"><strong>Rp. <?php echo number_format($subtotal->total) ?></strong></td>
- </tr>
- </tbody>
- </table>
- <form action="<?php echo site_url('admin/transactions/checkout/'.$subtotal->total) ?>" method="post" enctype="multipart/form-data" >
- <table>
- <tr>
- <td style="width:760px;" rowspan="2"><button type="submit" class="btn btn-info btn-lg">Checkout</button></td>
- <th style="width:300px;">Total (Rp)</th>
- <th style="text-align:right;width:450px;"><input type="text" name="total2" value="<?php echo $subtotal->total ?>" class="form-control input-sm" style="text-align:right;margin-bottom:5px;" readonly></th>
- <input type="hidden" id="total" name="total" value="<?php echo $subtotal->total;?>" class="form-control input-sm" style="text-align:right;margin-bottom:5px;" readonly>
- </tr>
- <tr>
- <th>Paid (Rp)</th>
- <th style="text-align:right;"><input type="text" id="jml_uang" name="jml_uang" class="jml_uang form-control input-sm" style="text-align:right;margin-bottom:5px;" required></th>
- <input type="hidden" id="jml_uang2" name="jml_uang2" class="form-control input-sm" style="text-align:right;margin-bottom:5px;" required>
- </tr>
- <tr>
- <td></td>
- <th>Change (Rp)</th>
- <th style="text-align:right;"><input type="text" id="kembalian" name="kembalian" class="form-control input-sm" style="text-align:right;margin-bottom:5px;" required></th>
- </tr>
- <input type="hidden" name="user" value="<?php echo $_SESSION['username'] ?>" >
- </table>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- /.container-fluid -->
- </div>
- <!-- End of Main Content -->
- <!-- Footer -->
- <?php $this->load->view("admin/_partials/footer.php") ?>
- <!-- End of Footer -->
- </div>
- <!-- End of Content Wrapper -->
- </div>
- <!-- End of Page Wrapper -->
- <?php $this->load->view("admin/_partials/scrolltop.php") ?>
- <?php $this->load->view("admin/_partials/modal.php") ?>
- <?php $this->load->view("admin/_partials/js.php") ?>
- <script type="text/javascript">
- $(function(){
- $('#jml_uang').on("input",function(){
- var total=$('#total').val();
- var jumuang=$('#jml_uang').val();
- var hsl=jumuang.replace(/[^\d]/g,"");
- $('#jml_uang2').val(hsl);
- $('#kembalian').val(hsl-total);
- })
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment