245 lines
7.2 KiB
PHP
245 lines
7.2 KiB
PHP
<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">×</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">×</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 Stock
|
|
</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">Title</th>
|
|
<th class="textCenter">Total Stocks</th>
|
|
<th class="textCenter">Available Stock</th>
|
|
<th class="textCenter">Sold Stocks</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
foreach ($inventory_stocks as $is_key => $stock) {
|
|
?>
|
|
<tr>
|
|
<td><?= $is_key + 1 ?></td>
|
|
<td class="text-left"><?= $stock['title'] ?></td>
|
|
<td><?= $stock['total_stock'] ?></td>
|
|
<td><?= $stock['current_stock'] ?></td>
|
|
<td><?= $stock['sold_stock'] ?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
<tfoot>
|
|
<th></th>
|
|
<th>Total</th>
|
|
<th class="text-center"></th>
|
|
<th class="text-center"></th>
|
|
<th class="text-center"></th>
|
|
</tfoot>
|
|
</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();
|
|
var jsTheExportHeader = '<?php echo $theExportHeader; ?>';
|
|
//table js
|
|
$('#tbl').DataTable({
|
|
"lengthMenu": [
|
|
[25, 50, 100, 150, -1],
|
|
[25, 50, 100, 150, "All"]
|
|
],
|
|
"dom": 'lBfrtip',
|
|
buttons: [{
|
|
extend: 'pdfHtml5',
|
|
// orientation: 'landscape',
|
|
exportOptions: {
|
|
columns: "thead th:not(.noExport)",
|
|
rows: function(indx, rowData, domElement) {
|
|
return $(domElement).css("display") != "none";
|
|
},
|
|
stripNewlines: false,
|
|
stripHtml: true
|
|
},
|
|
orientation: 'landscape',
|
|
pageSize: 'A4'
|
|
// messageTop: 'The information in this table is copyright to Sirius Cybernetics Corp.'
|
|
},
|
|
{
|
|
extend: 'print',
|
|
exportOptions: {
|
|
columns: "thead th:not(.noExport)",
|
|
rows: function(indx, rowData, domElement) {
|
|
return $(domElement).css("display") != "none";
|
|
},
|
|
stripNewlines: false,
|
|
stripHtml: true
|
|
},
|
|
},
|
|
{
|
|
extend: 'excelHtml5',
|
|
header: true,
|
|
footer: true,
|
|
title: jsTheExportHeader,
|
|
|
|
exportOptions: {
|
|
columns: "thead th:not(.noExport)",
|
|
rows: function(indx, rowData, domElement) {
|
|
return $(domElement).css("display") != "none";
|
|
},
|
|
stripNewlines: false,
|
|
stripHtml: true,
|
|
|
|
},
|
|
customize: function(xlsx) {
|
|
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
|
|
|
$('row c[r^="C"]', sheet).attr('s', '2');
|
|
}
|
|
}
|
|
],
|
|
"footerCallback": function(row, data, start, end, display) {
|
|
//var theDynTdCnt = (theTdCnt - 7);
|
|
var api = this.api();
|
|
|
|
// Remove the formatting to get integer data for summation
|
|
var intVal = function(i) {
|
|
return typeof i === 'string' ? i.replace(/[\$,]/g, '') * 1 : typeof i === 'number' ? i : 0;
|
|
};
|
|
|
|
// Total over all pages
|
|
total = api
|
|
.column(2)
|
|
.data()
|
|
.reduce(function(a, b) {
|
|
return intVal(a) + intVal(b);
|
|
}, 0);
|
|
|
|
// Total over this page
|
|
pageTotal = api
|
|
.column(2, {
|
|
page: 'current'
|
|
})
|
|
.data()
|
|
.reduce(function(a, b) {
|
|
return intVal(a) + intVal(b);
|
|
}, 0);
|
|
|
|
pageTotal5 = api
|
|
.column(3, {
|
|
page: 'current'
|
|
})
|
|
.data()
|
|
.reduce(function(a, b) {
|
|
return intVal(a) + intVal(b);
|
|
}, 0);
|
|
|
|
pageTotal6 = api
|
|
.column(4, {
|
|
page: 'current'
|
|
})
|
|
.data()
|
|
.reduce(function(a, b) {
|
|
return intVal(a) + intVal(b);
|
|
}, 0);
|
|
|
|
// Update footer
|
|
$(api.column(2).footer()).html(pageTotal);
|
|
$(api.column(3).footer()).html(pageTotal5);
|
|
$(api.column(4).footer()).html(pageTotal6);
|
|
}
|
|
});
|
|
//table js end
|
|
});
|
|
</script>
|