BBnepal-Accounts/application/views/inventory/item-purchase.php

180 lines
6.9 KiB
PHP
Raw Permalink Normal View History

2024-07-10 12:43:19 +00:00
<style>
.bootstrap-select>.dropdown-toggle.bs-placeholder,
.bootstrap-select>.dropdown-toggle.bs-placeholder:hover,
.bootstrap-select>.dropdown-toggle.bs-placeholder:focus,
.bootstrap-select>.dropdown-toggle.bs-placeholder:active {
height: 38px;
}
.bootstrap-select .dropdown-toggle .filter-option-inner {
margin-top: 4px;
margin-left: 4px;
}
.form-group .bootstrap-select>.dropdown-toggle {
height: 38px;
}
</style>
<div class="wraper responsive-width">
<main>
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<div class="subsec_sec">
<div class="subject_r subject_r_lng">
<div class="subject_lsec">
<div class="mb-4">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?= base_url() . 'admin/inventory/dashboard' ?>">Dashboard</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $title ?></li>
</ol>
</nav>
</div>
<?php if ($this->session->flashdata('success')) { ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<p><b> Success !</b> <?php echo $this->session->flashdata('success') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<?php if ($this->session->flashdata('danger')) { ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<p><b> Error !</b> <?php echo $this->session->flashdata('danger') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<div class="d-flex justify-content-end mb-3 small">
<b style="font-weight: 500">Quick Links:</b>
<a href="<?= base_url() ?>admin/inventory/book-publication" class="text-primary px-1"> Publications </a> |
<a href="<?= base_url() ?>admin/inventory/item-categories" class="text-primary px-1"> Item Categories </a> |
<a href="<?= base_url() ?>admin/inventory/items" class="text-primary px-1"> Items </a> |
<a href="<?= base_url() ?>admin/inventory/item-stocks" class="text-primary px-1"> Stocks </a> |
<a href="<?= base_url() ?>admin/inventory/add-edit-new-entry/0" class="text-primary px-1"> New Purchase Entry </a> |
<a href="<?= base_url() ?>admin/inventory/add-new-sales-record/0" class="text-primary px-1"> New Sales Entry </a>
</div>
<div class="row justify-content-center ">
<div class="row w-100 mb-4">
<div class="col">
<div class="float-right w-25 ">
<a class="btn btn-sm float-right btn-outline-success" href="<?= base_url() ?>admin/inventory/add-edit-new-entry/0">
Add New Entry
</a>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-12">
<div class="col-md-12 border rounded py-3">
<!-- -->
<table id="tbl" class="display table-responsive">
<thead>
<tr>
<th class="textCenter">S.No</th>
<th class="textCenter">Item</th>
<th class="textCenter">Qty</th>
<th class="textCenter">Unit Price</th>
<th class="textCenter">Total Price</th>
<th class="textCenter">Purchased On</th>
<th class="textCenter">Action</th>
</tr>
</thead>
<tbody>
<?php
foreach ($purchase_list as $p_key => $p_value) {
?>
<tr>
<td><?= $p_key + 1 ?></td>
<td class="text-left"><?= $p_value['title'] ?></td>
<td><?= $p_value['qty'] ?></td>
<td><?= $p_value['unit_price'] ?></td>
<td><?= $p_value['total_price'] ?></td>
<td><?= $p_value['purchased_on'] ?></td>
<td>
<a class="btn btn-sm btn-outline-primary mr-1" href="<?= base_url() ?>admin/inventory/view-purchase-details/<?= $p_value['id'] ?>">
<i class="fa fa-eye"></i>
</a>
<a class="btn btn-sm btn-outline-primary mr-1" href="<?= base_url() ?>admin/inventory/add-edit-new-entry/<?= $p_value['id'] ?>">
<i class="fa fa-edit"></i>
</a>
<button class="btn btn-sm btn-outline-danger" data-toggle="modal" data-target="#deleteModal<?= $p_value['id'] ?>">
<i class="fa fa-trash"></i>
</button>
<div class="modal fade" id="deleteModal<?= $p_value['id'] ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Delete</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form action="<?= base_url(); ?>admin/inventory/item-purchase" method="POST" onkeydown=" return event.key != 'Enter'">
<div class="modal-body text-left">
<input type="hidden" name="recId" value="<?= $p_value['id'] ?>">
<h6>Are you sure you want to delete this record? </h6>
<label class="small"><b class="text-danger">*</b> All records related with the record will be removed and cannot be undone.</label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-success" data-dismiss="modal">Close</button>
<input type="submit" name="deletePurchaseRecord" class="btn btn-sm btn-danger" value="Confirm">
</div>
</form>
</div>
</div>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<script defer src="<?php echo base_url(); ?>assets_admin/js/bootstrap-select.min.js"></script>
<!--End right-top side-->
<!-- <script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.2.1.slim.min.js"></script> -->
<script>
$(document).ready(function() {
$("#course-section").hide();
//table js
$('#tbl').DataTable({
"lengthMenu": [
[25, 50, 100, 150, -1],
[25, 50, 100, 150, "All"]
]
});
});
</script>