commitall
This commit is contained in:
391
application/views/inventory/add-edit-new-entry.php
Normal file
391
application/views/inventory/add-edit-new-entry.php
Normal file
@ -0,0 +1,391 @@
|
||||
<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"><a href="<?= base_url() . 'admin/inventory/item-purchase' ?>">Purchase</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">
|
||||
<button type="button" class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#supplierModal">
|
||||
Suppliers
|
||||
</button>
|
||||
<div class="modal fade" id="supplierModal" 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">Add New Supplier</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="<?= base_url(); ?>admin/inventory/suppliers" method="POST" onkeydown=" return event.key != 'Enter'" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="name" name="name" class=" form-control" placeholder='Enter Supplier Name' required>
|
||||
<span>Supplier Name <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="address" name="address" class=" form-control" placeholder='Enter Supplier Address' required>
|
||||
<span>Supplier Address <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="contact_number" name="contact_number" min="10" max="14" class=" form-control" placeholder='Enter Supplier Contact Number' required>
|
||||
<span>Contact Number <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="purchaseId" value="<?= $recId ?>">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
|
||||
<input type="submit" name="addSupplier" class="btn btn-sm btn-success" value="Add">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<?php
|
||||
// echo '<pre>';
|
||||
// var_dump($purchase_item);
|
||||
$item_id = isset($purchase_item) ? $purchase_item['item_id'] : 0;
|
||||
$supplier = isset($purchase_item) ? $purchase_item['purchased_from'] : 0;
|
||||
$purchased_on = isset($purchase_item) ? $purchase_item['purchased_on'] : '';
|
||||
$qty = isset($purchase_item) ? (int) $purchase_item['qty'] : 1;
|
||||
$unit_price = isset($purchase_item) ? $purchase_item['unit_price'] : '';
|
||||
$total_price = isset($purchase_item) ? $purchase_item['total_price'] : '';
|
||||
$selling_price = isset($purchase_item) ? $purchase_item['selling_price'] : '';
|
||||
|
||||
$paid_amount = isset($purchase_item) ? $purchase_item['paid_amount'] : '';
|
||||
$remaining_amount = isset($purchase_item) ? $purchase_item['remaining_amount'] : '';
|
||||
$remarks = isset($purchase_item) ? $purchase_item['remarks'] : '';
|
||||
$submitName = isset($purchase_item) ? 'updatePurchase' : 'addPurchase';
|
||||
$submitValue = isset($purchase_item) ? 'Update' : 'Add';
|
||||
?>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/inventory/add-edit-new-entry/<?= $recId ?>" enctype="multipart/form-data">
|
||||
<?php
|
||||
$purchase_photo = '';
|
||||
if (isset($purchase_item)) {
|
||||
|
||||
if (!empty($purchase_item['photo'])) {
|
||||
if (file_exists('assets_inventory/images/purchase/' . $purchase_item['photo'])) {
|
||||
$purchase_photo = base_url() . 'assets_inventory/images/purchase/' . $purchase_item['photo'];
|
||||
} else {
|
||||
$purchase_photo = base_url() . 'common_assets/' . $purchase_item['photo'];
|
||||
}
|
||||
} else {
|
||||
$purchase_photo = base_url() . 'common_assets/No-Image.jpg';
|
||||
}
|
||||
|
||||
?>
|
||||
<img src="<?= $purchase_photo ?>" class="img-thumbnail img-fluid" width="100px">
|
||||
<input type="hidden" name="photo_name" value="<?= $purchase_item['photo'] ?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="hidden" name="recId" value="<?= $recId ?>">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="item" class="form-control selectpicker" name="item" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Item
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_items as $i_key => $i_value) {
|
||||
?>
|
||||
<option value="<?= $i_value['id'] ?>" <?= $item_id == $i_value['id'] ? 'selected' : '' ?>>
|
||||
<?= $i_value['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Item <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="item" class="form-control selectpicker" name="supplier" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Supplier
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_suppliers as $is_key => $is_value) {
|
||||
?>
|
||||
<option value="<?= $is_value['id'] ?>" <?= $supplier == $is_value['id'] ? 'selected' : '' ?>>
|
||||
<?= $is_value['name'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Purchased From <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="purchased_on" value="<?= $today_date ?>" value="<?= $purchased_on ?>" name="purchased_on" class=" form-control">
|
||||
<span>Purchased On</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-100"></div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="number" min="1" id="qty" name="qty" class=" form-control" value="<?= $qty ?>" placeholder="Enter Quantity">
|
||||
<span>Quantity <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="number" id="unit_price" name="unit_price" class=" form-control" value="<?= $unit_price ?>" placeholder="Enter item price per unit">
|
||||
<span>Unit Price (In <?= $school_info['currency_symbol'] ?> ) <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="number" id="total_price" name="total_price" class=" form-control" value="<?= $total_price ?>" placeholder="Item total price">
|
||||
<span>Total Price (In <?= $school_info['currency_symbol'] ?> ) <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-100"></div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="number" id="selling_price" name="selling_price" class=" form-control" value="<?= $selling_price ?>" placeholder="Enter item selling price per unit">
|
||||
<span>Selling Price <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="number" id="paid_amount" name="paid_amount" class=" form-control" value="<?= $paid_amount ?>" placeholder="Enter paid amount">
|
||||
<span>Paid Amount <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="number" id="remaining_amount" name="remaining_amount" class=" form-control" value="<?= $remaining_amount ?>" placeholder="Enter remaining amount">
|
||||
<span>Remaining Amount <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="file" id="photo" name="photo" class=" form-control" style="padding: 0.75rem 0.75rem;">
|
||||
<span>Photo</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="remarks" name="remarks" class=" form-control" placeholder="Remarks (if any)" value="<?= $remarks ?>">
|
||||
<span>Remarks</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 w-100">
|
||||
<input type="submit" name="<?= $submitName ?>" id="<?= $submitName ?>" class="btn btn-sm btn-success w-100" value="<?= $submitValue ?>">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</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>
|
||||
$('#contact_number').bind('keyup paste', function() {
|
||||
this.value = this.value.replace(/[^0-9]/g, '');
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
let NDate = NepaliFunctions.GetCurrentBsDate();
|
||||
let todayDate = `${NDate.year}-${NDate.month}-${NDate.day}`;
|
||||
$('#purchased_on').nepaliDatePicker({
|
||||
disableAfter: todayDate,
|
||||
language: 'english',
|
||||
ndpMonth: true,
|
||||
ndpYear: true
|
||||
|
||||
});
|
||||
$("#course-section").hide();
|
||||
//table js
|
||||
$('#tbl').DataTable({
|
||||
"lengthMenu": [
|
||||
[25, 50, 100, 150, -1],
|
||||
[25, 50, 100, 150, "All"]
|
||||
]
|
||||
});
|
||||
//table js end
|
||||
});
|
||||
|
||||
$('#qty').on('change', function() {
|
||||
|
||||
var id_val = $('#qty').val();
|
||||
var amount = $('#unit_price').val();
|
||||
var validAmount = /^\d{0,4}(\.\d{0,2})?$/.test(amount);
|
||||
var validQuality = /^\d{0,4}(\.\d{0,2})?$/.test(id_val);
|
||||
|
||||
if (!validAmount || !validQuality) {
|
||||
alert("Please check the Amount or Quantity");
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
|
||||
} else {
|
||||
var calculation = parseFloat(id_val) * parseFloat(amount);
|
||||
if ($.isNumeric(calculation)) {
|
||||
$('#total_price').val(calculation);
|
||||
$('#paid_amount').val(calculation);
|
||||
} else {
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#total_price').on('change', function() {
|
||||
$('#paid_amount').val($('#total_price').val());
|
||||
$('#remaining_amount').val(parseFloat($('#total_price').val()) - parseFloat($('#paid_amount').val()))
|
||||
});
|
||||
|
||||
$('#paid_amount').on('change', function() {
|
||||
$('#remaining_amount').val(parseFloat($('#total_price').val()) - parseFloat($('#paid_amount').val()))
|
||||
});
|
||||
|
||||
$('#unit_price').on('change', function() {
|
||||
var id_val = $('#qty').val();
|
||||
var amount = $('#unit_price').val();
|
||||
var validAmount = /^\d{0,9}(\.\d{0,7})?$/.test(amount);
|
||||
var validQuality = /^\d{0,7}(\.\d{0,7})?$/.test(id_val);
|
||||
|
||||
if (!validAmount || !validQuality) {
|
||||
alert("Please check the Amount or Quantity");
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
$('#selling_price').val("");
|
||||
$('#remaining_amount').val("");
|
||||
} else {
|
||||
var calculation = parseFloat(id_val) * parseFloat(amount);
|
||||
if ($.isNumeric(calculation)) {
|
||||
$('#total_price').val(calculation);
|
||||
$('#paid_amount').val(calculation);
|
||||
$('#selling_price').val(amount);
|
||||
$('#remaining_amount').val(calculation - calculation);
|
||||
} else {
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
$('#selling_price').val("");
|
||||
$('#remaining_amount').val("");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
547
application/views/inventory/add-sales-record.php
Normal file
547
application/views/inventory/add-sales-record.php
Normal file
@ -0,0 +1,547 @@
|
||||
<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;
|
||||
}
|
||||
|
||||
label .error {
|
||||
top: 2.5rem !important;
|
||||
color: red;
|
||||
left: 0em;
|
||||
}
|
||||
|
||||
.display tr {
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
table.dataTable thead th,
|
||||
table.dataTable thead td {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
</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"><a href="<?= base_url() . 'admin/inventory/item-sales' ?>">Sales</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="col-md-5">
|
||||
<form id="itemForm">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-right">
|
||||
<h6 id="available-stock"> </h6>
|
||||
</div>
|
||||
<div class="h6">Student Details</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="student" class="form-control selectpicker" name="student" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Student
|
||||
</option>
|
||||
<?php
|
||||
foreach ($students as $std_key => $student) {
|
||||
?>
|
||||
<option value="<?= $student['id'] ?>">
|
||||
<?= $student['name'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Student <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" name="s_class" class="form-control" id="s_class" placeholder="Class" readonly>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="text" name="s_section" class="form-control" id="s_section" placeholder="Section" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="h6">Item Details</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="item" class="form-control selectpicker" name="item" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Item
|
||||
</option>
|
||||
|
||||
</select>
|
||||
<span>Item <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<!-- <label class="has-float-label"> -->
|
||||
<select id="i_price" class="form-control selectpicker" name="i_price" data-live-search="true">
|
||||
<option value="">
|
||||
Select Price
|
||||
</option>
|
||||
</select>
|
||||
<!-- <span>Price <b class="text-danger">*</b></span> -->
|
||||
<!-- </label> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="number" name="i_qty" class="form-control" id="i_qty" placeholder="Quantity" min="1">
|
||||
<input type="hidden" name="i_purchase_id" class="form-control" id="i_purchase_id" placeholder="Purchase Id">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="number" name="i_selling_price" class="form-control" id="i_selling_price" placeholder="Amount">
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-100"></div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<input type="number" name="i_total_price" class="form-control" id="i_total_price" placeholder="Total Amount" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" id="itemAddBtn" class="btn btn-sm btn-outline-primary w-100 mt-4">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<div class="card col-md-12">
|
||||
<div class="card-body">
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/inventory/add-new-sales-record/0" enctype="multipart/form-data">
|
||||
<table id="tbl" class="display table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="0%" 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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<div class="row mt-3" id="summary" style=" display: none;">
|
||||
<div class="col-md-8">
|
||||
<h6>Total : <?= $school_info['currency_symbol'] . '. ' ?><span id="totalPrice">0</span></h6>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input type="submit" name="addSalesEntry" value="Submit" class="btn w-100 btn-sm btn-outline-success">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</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>
|
||||
$('#contact_number').bind('keyup paste', function() {
|
||||
this.value = this.value.replace(/[^0-9]/g, '');
|
||||
});
|
||||
|
||||
$("#itemAddBtn").click(function() {
|
||||
|
||||
$("#itemForm").validate({
|
||||
student: {
|
||||
student: {
|
||||
required: true
|
||||
},
|
||||
item: {
|
||||
required: true
|
||||
}
|
||||
|
||||
},
|
||||
messages: {
|
||||
student: {
|
||||
required: "Select any student"
|
||||
},
|
||||
item: {
|
||||
required: "Select a item"
|
||||
}
|
||||
},
|
||||
submitHandler: function(form) {
|
||||
// alert("button");
|
||||
|
||||
$("#student").attr('disabled', 'disabled');
|
||||
// $(".selectpicker[data-id='yourSelect']").addClass("disabled");
|
||||
|
||||
// var studentId = $("#itemForm").val();
|
||||
var studentId = $('#student option:selected').val();
|
||||
var item = $('#item option:selected').val();
|
||||
var itemSellingPrice = $('#i_selling_price').val();
|
||||
var itemTotalPrice = $('#i_total_price').val();
|
||||
|
||||
var itemQuantity = $('#i_qty').val();
|
||||
var itemPurchaseId = $('#i_purchase_id').val();
|
||||
|
||||
// console.log(studentId + ' => ' + item + ' => ' + itemSellingPrice + ' => ' + itemTotalPrice + ' => ' + itemQuantity);
|
||||
|
||||
var rowCount = $("#tbl tr").length;
|
||||
rowCount = rowCount;
|
||||
var trDiv = '';
|
||||
trDiv += '<tr>';
|
||||
trDiv += '<td>';
|
||||
trDiv += rowCount;
|
||||
trDiv += '</td>';
|
||||
|
||||
trDiv += '<td class="text-left">';
|
||||
var items = <?= json_encode($inventory_items) ?>;
|
||||
for (var a = 0; a < items.length; a++) {
|
||||
if (items[a]['id'] == item) {
|
||||
trDiv += '<input type="hidden" name="itemId[' + rowCount + ']" value="' + items[a]['id'] + '">'
|
||||
trDiv += items[a]['title'];
|
||||
}
|
||||
}
|
||||
trDiv += '</td>';
|
||||
|
||||
trDiv += '<td>';
|
||||
trDiv += '<input type="hidden" name="itemQty[' + rowCount + ']" value="' + itemQuantity + '">'
|
||||
trDiv += itemQuantity;
|
||||
trDiv += '</td>';
|
||||
|
||||
trDiv += '<td>';
|
||||
trDiv += '<input type="hidden" name="purchaseId[' + rowCount + ']" value="' + itemPurchaseId + '">'
|
||||
trDiv += itemSellingPrice;
|
||||
trDiv += '</td>';
|
||||
|
||||
trDiv += '<td>';
|
||||
trDiv += '<input type="hidden" name="studentId[' + rowCount + ']" value="' + studentId + '">'
|
||||
trDiv += '<input type="hidden" name="sellingPrice[' + rowCount + ']" value="' + itemSellingPrice + '">'
|
||||
|
||||
trDiv += itemTotalPrice;
|
||||
trDiv += '</td>';
|
||||
|
||||
trDiv += '</tr>';
|
||||
|
||||
|
||||
$('#tbl tr:last').after(trDiv);
|
||||
var totalPrice = parseFloat($('#totalPrice').text());
|
||||
var calc = totalPrice + parseFloat(itemSellingPrice);
|
||||
|
||||
$('#totalPrice').text(calc);
|
||||
$("#summary").show();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#student').on('change', function() {
|
||||
var students = <?= json_encode($students) ?>;
|
||||
var items = <?= json_encode($inventory_items) ?>;
|
||||
var selectedStudent = this.value;
|
||||
|
||||
for (var a = 0; a < students.length; a++) {
|
||||
|
||||
if (selectedStudent == students[a]['id']) {
|
||||
var divData = '';
|
||||
divData += "<option value='' > Select Section </option>";
|
||||
// console.log(students[a]);
|
||||
$('#s_class').val(students[a]['course_name']);
|
||||
$('#s_section').val(students[a]['section_name']);
|
||||
// s_section
|
||||
for (var b = 0; b < items.length; b++) {
|
||||
// console.log(items[b]['course_id'] + ' ========> ' + students[a]['course']);
|
||||
if ((items[b]['course_id'] == students[a]['course']) || (items[b]['course_id'] == 0)) {
|
||||
// console.log(items[b]);
|
||||
divData += "<option value='" + items[b]['id'] + "'>" + items[b]['title'] + "</option>";
|
||||
}
|
||||
}
|
||||
$('#item').empty().append(divData).selectpicker("refresh");
|
||||
|
||||
priceDivData = "<option value='' > Select Price </option>";
|
||||
$('#i_price').empty().append(priceDivData).selectpicker("refresh");
|
||||
$('#i_qty').val('');
|
||||
$('#i_purchase_id').val('');
|
||||
$('#i_selling_price').val('');
|
||||
$('#i_total_price').val('');
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#item').on('change', function() {
|
||||
var items = <?= json_encode($inventory_items) ?>;
|
||||
var selectedItem = $('#item option:selected').val();
|
||||
var currencySymbol = '<?= $school_info['currency_symbol'] ?>';
|
||||
for (var a = 0; a < items.length; a++) {
|
||||
if (items[a]['id'] == selectedItem) {
|
||||
if (items[a]['short_label'] != null) {
|
||||
$('#available-stock').html('Available Stock : ' + items[a]['available_stock'] + ' <small>' + items[a]['short_label'] + '</small>');
|
||||
} else {
|
||||
$('#available-stock').html('Available Stock : ' + items[a]['available_stock']);
|
||||
}
|
||||
|
||||
var itemPurchases = items[a]['item_purchases'];
|
||||
|
||||
console.log(itemPurchases);
|
||||
var divData = '';
|
||||
var sellingPrice = 0;
|
||||
var itemPurchaseId = 0;
|
||||
for (var b = 0; b < itemPurchases.length; b++) {
|
||||
divData += "<option value='" + itemPurchases[b]['id'] + "'>" + currencySymbol + '. ' + itemPurchases[b]['selling_price'] + "</option>";
|
||||
if (b == 0) {
|
||||
sellingPrice = itemPurchases[b]['selling_price'];
|
||||
itemPurchaseId = itemPurchases[b]['id'];
|
||||
}
|
||||
}
|
||||
console.log('Selling Price = ' + sellingPrice);
|
||||
$('#i_qty').val(1);
|
||||
$('#i_purchase_id').val(itemPurchaseId);
|
||||
$('#i_selling_price').val(sellingPrice);
|
||||
$('#i_total_price').val(sellingPrice * 1);
|
||||
|
||||
$('#i_price').empty().append(divData).selectpicker("refresh");
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#i_price').on('change', function() {
|
||||
var selectedItem = $('#item option:selected').val();
|
||||
var selectedPurchaseId = $('#i_price option:selected').val();
|
||||
var items = <?= json_encode($inventory_items) ?>;
|
||||
var currencySymbol = '<?= $school_info['currency_symbol'] ?>';
|
||||
|
||||
for (var a = 0; a < items.length; a++) {
|
||||
if (items[a]['id'] == selectedItem) {
|
||||
var itemPurchases = items[a]['item_purchases'];
|
||||
for (var b = 0; b < itemPurchases.length; b++) {
|
||||
if (selectedPurchaseId == itemPurchases[b]['id']) {
|
||||
$('#i_qty').val(1);
|
||||
$('#i_purchase_id').val(itemPurchases[b]['id']);
|
||||
$('#i_selling_price').val(itemPurchases[b]['selling_price']);
|
||||
$('#i_total_price').val(itemPurchases[b]['selling_price'] * 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#i_qty').on('change', function() {
|
||||
var qty_val = $('#i_qty').val();
|
||||
var amount = $('#i_selling_price').val();
|
||||
|
||||
var calculation = parseFloat(qty_val) * parseFloat(amount);
|
||||
if ($.isNumeric(calculation)) {
|
||||
$('#i_total_price').val(calculation);
|
||||
} else {
|
||||
$('#i_total_price').val("");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#i_selling_price').on('change', function() {
|
||||
var qty_val = $('#i_qty').val();
|
||||
var amount = $('#i_selling_price').val();
|
||||
|
||||
var calculation = parseFloat(qty_val) * parseFloat(amount);
|
||||
if ($.isNumeric(calculation)) {
|
||||
$('#i_total_price').val(calculation);
|
||||
} else {
|
||||
$('#i_total_price').val("");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#summary").hide();
|
||||
//table js
|
||||
$('#tbl').DataTable({
|
||||
paging: false,
|
||||
ordering: false,
|
||||
info: false,
|
||||
"footerCallback": function(row, data, start, end, display) {
|
||||
//var theDynTdCnt = (theTdCnt - 7);
|
||||
for (let fi = 4; fi < theTdCnt; fi++) {
|
||||
var api = this.api(),
|
||||
data;
|
||||
|
||||
// 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(fi)
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Total over this page
|
||||
pageTotal = api
|
||||
.column(fi, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
$(api.column(fi).footer()).html(
|
||||
//currency_symbol + ' ' + pageTotal + ' ( ' + currency_symbol + ' ' + total + ' total )'
|
||||
pageTotal
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
//table js end
|
||||
let NDate = NepaliFunctions.GetCurrentBsDate();
|
||||
let todayDate = `${NDate.year}-${NDate.month}-${NDate.day}`;
|
||||
$('#purchased_on').nepaliDatePicker({
|
||||
disableAfter: todayDate,
|
||||
language: 'english',
|
||||
ndpMonth: true,
|
||||
ndpYear: true
|
||||
|
||||
});
|
||||
$("#course-section").hide();
|
||||
|
||||
});
|
||||
|
||||
$('#qty').on('change', function() {
|
||||
|
||||
var id_val = $('#qty').val();
|
||||
var amount = $('#unit_price').val();
|
||||
var validAmount = /^\d{0,4}(\.\d{0,2})?$/.test(amount);
|
||||
var validQuality = /^\d{0,4}(\.\d{0,2})?$/.test(id_val);
|
||||
|
||||
if (!validAmount || !validQuality) {
|
||||
alert("Please check the Amount or Quantity");
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
|
||||
} else {
|
||||
var calculation = parseFloat(id_val) * parseFloat(amount);
|
||||
if ($.isNumeric(calculation)) {
|
||||
$('#total_price').val(calculation);
|
||||
$('#paid_amount').val(calculation);
|
||||
} else {
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#total_price').on('change', function() {
|
||||
$('#paid_amount').val($('#total_price').val());
|
||||
$('#remaining_amount').val(parseFloat($('#total_price').val()) - parseFloat($('#paid_amount').val()))
|
||||
});
|
||||
|
||||
$('#paid_amount').on('change', function() {
|
||||
$('#remaining_amount').val(parseFloat($('#total_price').val()) - parseFloat($('#paid_amount').val()))
|
||||
});
|
||||
|
||||
$('#unit_price').on('change', function() {
|
||||
var id_val = $('#qty').val();
|
||||
var amount = $('#unit_price').val();
|
||||
var validAmount = /^\d{0,9}(\.\d{0,7})?$/.test(amount);
|
||||
var validQuality = /^\d{0,7}(\.\d{0,7})?$/.test(id_val);
|
||||
|
||||
if (!validAmount || !validQuality) {
|
||||
alert("Please check the Amount or Quantity");
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
$('#selling_price').val("");
|
||||
$('#remaining_amount').val("");
|
||||
} else {
|
||||
var calculation = parseFloat(id_val) * parseFloat(amount);
|
||||
if ($.isNumeric(calculation)) {
|
||||
$('#total_price').val(calculation);
|
||||
$('#paid_amount').val(calculation);
|
||||
$('#selling_price').val(amount);
|
||||
$('#remaining_amount').val(calculation - calculation);
|
||||
} else {
|
||||
$('#total_price').val("");
|
||||
$('#paid_amount').val("");
|
||||
$('#selling_price').val("");
|
||||
$('#remaining_amount').val("");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
179
application/views/inventory/book_publications.php
Normal file
179
application/views/inventory/book_publications.php
Normal file
@ -0,0 +1,179 @@
|
||||
<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="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add New Publication</h5>
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/inventory/book-publication">
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" placeholder='Enter book publication title' required>
|
||||
<span>Publication Title</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 w-100">
|
||||
<input type="submit" name="addPublication" id="addPublication" class="btn btn-sm btn-success w-100" value="Add">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 pl-0">
|
||||
<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">Is Active</th>
|
||||
<th class="textCenter">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($book_publications as $bp_key => $p_value) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $bp_key + 1 ?></td>
|
||||
<td class="text-left"><?= $p_value['title'] ?></td>
|
||||
<td><?= ucfirst($p_value['is_active']) ?></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#updateModal<?= $p_value['id'] ?>">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
|
||||
<div class="modal fade" id="updateModal<?= $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">Update</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="<?= base_url(); ?>admin/inventory/book-publication" method="POST" onkeydown=" return event.key != 'Enter'">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="unitId" value="<?= $p_value['id'] ?>">
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" value="<?= $p_value['title'] ?>" placeholder='Enter publication title' required>
|
||||
<span>Publication Title</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-4">
|
||||
<label class="has-float-label">
|
||||
<select id="is_active" class="form-control custom-select" placeholder="Is Active" name="is_active">
|
||||
<option value="yes" <?= $p_value['is_active'] == 'yes' ? 'selected' : '' ?>>
|
||||
Yes
|
||||
</option>
|
||||
<option value="no" <?= $p_value['is_active'] == 'no' ? 'selected' : '' ?>>
|
||||
No
|
||||
</option>
|
||||
</select>
|
||||
<span>Is Active</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
|
||||
<input type="submit" name="updatePublication" class="btn btn-sm btn-success" value="Update">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</div>
|
||||
|
||||
<!--End right-top side-->
|
||||
|
||||
<!-- <script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.2.1.slim.min.js"></script> -->
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/popper.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/all.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/main.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/owl-carousel/js/owl.carousel.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//table js
|
||||
$('#tbl').DataTable({
|
||||
"lengthMenu": [
|
||||
[25, 50, 100, 150, -1],
|
||||
[25, 50, 100, 150, "All"]
|
||||
]
|
||||
});
|
||||
//table js end
|
||||
|
||||
});
|
||||
</script>
|
284
application/views/inventory/dashboard.php
Normal file
284
application/views/inventory/dashboard.php
Normal file
@ -0,0 +1,284 @@
|
||||
<style>
|
||||
.dashboard-tabs a {
|
||||
justify-content: start;
|
||||
}
|
||||
|
||||
.dashboard-tabs .tab-sub-sec p {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
<div class="wraper responsive-width">
|
||||
<main class="" id="main">
|
||||
<div class="main-wrap">
|
||||
<div class="dashboard-cover">
|
||||
<div class="common-heading">
|
||||
<h2>Inventory DashBoard</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="dashboard-tabs col">
|
||||
<a href="<?= base_url(); ?>admin/subject" class="dashboard-tab-link">
|
||||
<!-- <img src="<?= base_url(); ?>assets_admin/images/icons/subjects.png"> -->
|
||||
<div class="tab-sub-sec">
|
||||
<h3 class="tab-number"><?php echo ($subject_count) ? $subject_count : '0' ?></h3>
|
||||
<p>Total Items</p>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="dashboard-tabs col">
|
||||
<a href="<?= base_url(); ?>admin/course">
|
||||
<!-- <img src="<?= base_url(); ?>assets_admin/images/icons/courses.png"> -->
|
||||
<div class="tab-sub-sec">
|
||||
<h3 class="tab-number"><?php echo ($course_count) ? $course_count : '0' ?></h3>
|
||||
<p>Total Purchase</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="dashboard-tabs col">
|
||||
<a href="<?= base_url(); ?>admin/classroom">
|
||||
<!-- <img src="<?= base_url(); ?>assets_admin/images/icons/classrooms.png"> -->
|
||||
<div class="tab-sub-sec">
|
||||
<h3 class="tab-number"><?php echo ($classroom_count) ? $classroom_count : '0' ?></h3>
|
||||
<p>Total Sales</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="dashboard-tabs col">
|
||||
<a href="<?= base_url(); ?>admin/teacher">
|
||||
<!-- <img src="<?= base_url(); ?>assets_admin/images/icons/teachers.png"> -->
|
||||
<div class="tab-sub-sec">
|
||||
<h3 class="tab-number"><?php echo ($teacher_count) ? $teacher_count : '0' ?></h3>
|
||||
<p>Total Stocks</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <button type="button" class="btn btn-success" onclick="<?php echo base_url() ?>Admin/sendSMS()">Sign Up</button> -->
|
||||
<div class="subject_lsec dashboard_graph">
|
||||
<div class="report_sec_cover">
|
||||
<!-- chart data -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="subject_lhead">Girl's and Boy's Count</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<select id="course_name" name="course_name">
|
||||
<?php if (!empty($courses)) { ?>
|
||||
<option value="">--- Select Course ----</option>
|
||||
<?php foreach ($courses as $key => $value) { ?>
|
||||
<option value="<?php echo $value['id'] ?>"> <?php echo $value['course_name'] ?></option>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<select id="section" name="section_name" style="width:253px">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="charts_section mx-3 my-3" id="girls-boys-chart">
|
||||
<div class="text-center mt-4" id="data_hidden">
|
||||
<h5>Select the Course to view Chart</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/send-message">
|
||||
|
||||
<input type="submit" name="submit" class="btn btn-success" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<!--End right-top side-->
|
||||
</div>
|
||||
<script src="https://code.highcharts.com/highcharts.js"></script>
|
||||
<script src="https://code.highcharts.com/modules/drilldown.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.user-drpdown').click(function() {
|
||||
$('.drpdown-items').toggle();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// var graph_data = <?php //echo json_encode($graph_data);
|
||||
?>;
|
||||
// console.log(graph_data);
|
||||
|
||||
// Highcharts.setOptions({
|
||||
// lang: {
|
||||
// drillUpText: '<< Back'
|
||||
// }
|
||||
// });
|
||||
|
||||
// Highcharts.chart('recoveryGraf', {
|
||||
// chart: {
|
||||
// type: 'pie'
|
||||
// },
|
||||
// title: {
|
||||
// text: ''
|
||||
// },
|
||||
// plotOptions: {
|
||||
// series: {
|
||||
// dataLabels: {
|
||||
// enabled: true,
|
||||
// format: '{point.name}: {point.y:.1f}'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
// tooltip: {
|
||||
// headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
|
||||
// pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}</b> of total<br/>'
|
||||
// },
|
||||
// series: [{
|
||||
// name: 'Fee Report',
|
||||
// colorByPoint: true,
|
||||
// colors: ['#032da1', '#133ba7', '#2449ad', '#3557b3', '#4665ba', '#5773c0', '#6781c6', '#788fcd', '#899dd3'],
|
||||
// data: [
|
||||
// <?php
|
||||
// foreach ($graph_data as $v) {
|
||||
// echo "['" . $v['typename'] . "'," . $v['total'] . "],\n";
|
||||
// }
|
||||
?>
|
||||
// ]
|
||||
// }],
|
||||
// drilldown: {
|
||||
// series: [{
|
||||
// name: 'Recycleds',
|
||||
// id: 'Recycleds',
|
||||
// colors: ['#032da1', '#133ba7', '#2449ad', '#3557b3', '#4665ba', '#5773c0', '#6781c6', '#788fcd', '#899dd3'],
|
||||
// data: [
|
||||
// <?php
|
||||
// foreach ($graph_data as $v) {
|
||||
// echo "['" . $v['typename'] . "'," . $v['total'] . "],\n";
|
||||
// }
|
||||
?>
|
||||
// ]
|
||||
// }]
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// });
|
||||
|
||||
|
||||
function theGirlsandBoyChart(boy, girl) {
|
||||
boy = parseInt(boy);
|
||||
girl = parseInt(girl);
|
||||
$('#data_hidden').hide();
|
||||
|
||||
var data_title = 'Chart Description';
|
||||
|
||||
//Type can be : line, spline, area, areaspline, column, bar, pie, scatter, gauge, arearange, areasplinerange and columnrange
|
||||
|
||||
$('#girls-boys-chart').highcharts({
|
||||
chart: {
|
||||
type: 'column',
|
||||
borderWidth: 0
|
||||
},
|
||||
title: {
|
||||
text: data_title
|
||||
},
|
||||
plotOptions: {
|
||||
borderWidth: 0
|
||||
},
|
||||
xAxis: {
|
||||
title: {
|
||||
text: 'Girls And Boys',
|
||||
},
|
||||
min: 1,
|
||||
tickInterval: 1,
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'Total Count',
|
||||
},
|
||||
},
|
||||
series: [{
|
||||
name: "Boy's",
|
||||
data: [0, boy]
|
||||
|
||||
}, {
|
||||
name: "Girl's",
|
||||
data: [0, girl]
|
||||
}, ]
|
||||
});
|
||||
|
||||
//To hide the text "Highcharts.com" which comes as default
|
||||
//$('.highcharts-credits').hide();
|
||||
|
||||
//$('.highcharts-legend-item').hide();
|
||||
}
|
||||
|
||||
$('#course_name').change(function() {
|
||||
var id = $(this).find(":selected").val();
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url() . 'admin/get_sections_from_classroom/' ?>' + id,
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
let section = '';
|
||||
section += '<option value=""> - Select Section - </option>';
|
||||
$.each(result, function(key, value) {
|
||||
section += '<option value="' + value['id'] + '">' + value['section_name'] + '</option>';
|
||||
|
||||
});
|
||||
$("#section").html(section);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var course_id = $('#course_name').find(":selected").val();
|
||||
if (course_id > 0) {
|
||||
$.ajax({
|
||||
url: '<?php echo base_url() . 'admin/get_count_of_girl_and_boy/' ?>' + course_id + '/0',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
theGirlsandBoyChart(result['male'], result['female']);
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert("Please select the Course ");
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#section').change(function() {
|
||||
var course_id = $('#course_name').find(":selected").val();
|
||||
var section_id = $(this).find(":selected").val();
|
||||
if (course_id > 0 && section_id > 0) {
|
||||
$.ajax({
|
||||
url: '<?php echo base_url() . 'admin/get_count_of_girl_and_boy/' ?>' + course_id + '/' + section_id,
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
theGirlsandBoyChart(result['male'], result['female']);
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert("select the course or section");
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
80
application/views/inventory/footer.php
Normal file
80
application/views/inventory/footer.php
Normal file
@ -0,0 +1,80 @@
|
||||
<!--<script src="<?php echo base_url(); ?>assets_admin/js/jquery-3.4.1.min.js"></script>-->
|
||||
<script src="<?php echo base_url(); ?>assets_admin/js/jquery-ui.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets_admin/js/popper.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets_admin/js/bootstrap.min.js"></script>
|
||||
<!-- <script defer src="<?php echo base_url(); ?>assets_admin/js/all.js"></script> -->
|
||||
<script defer src="<?php echo base_url(); ?>assets_admin/js/main.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets_admin/owl-carousel/js/owl.carousel.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets_admin/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets_admin/js/nepali.datepicker.v3.7.min.js" type="text/javascript"></script>
|
||||
<script src="<?php echo base_url(); ?>assets_admin/js/bootstrap4-toggle.min.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/datatable-2-1-0/dataTables.buttons.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/datatable-2-1-0/pdfmake.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/datatable-2-1-0/vfs_fonts.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/datatable-2-1-0/buttons.html5.min.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/datatable-2-1-0/jszip.min.js"> </script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/datatable-2-1-0/buttons.print.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/datatable-2-1-0/buttons.print.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.colVis.min.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.semanticui.min.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets_admin/js/dataTables.fixedColumns.min.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.user-drpdown').click(function() {
|
||||
$('.drpdown-items').toggle();
|
||||
});
|
||||
|
||||
let url = window.location.href.toLowerCase();
|
||||
let flag = false;
|
||||
let Clickedurl;
|
||||
$('ul.admin-sidebar li').removeClass('active');
|
||||
|
||||
$('ul.admin-sidebar li a').each(function() {
|
||||
Clickedurl = $(this).attr('href').toLowerCase();
|
||||
|
||||
if (url == Clickedurl) {
|
||||
console.log(url, Clickedurl)
|
||||
flag = true;
|
||||
let liParent = $(this).parent();
|
||||
liParent.addClass('active');
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url() ?>teacher/update_link_active',
|
||||
data: {
|
||||
link: url
|
||||
},
|
||||
type: 'POST',
|
||||
async: false,
|
||||
success: function(data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (flag == false) {
|
||||
|
||||
Clickedurl = '<?php echo isset($_SESSION['active_old_link']) ? $_SESSION['active_old_link'] : 0 ?>';
|
||||
|
||||
$('ul.admin-sidebar li a').each(function() {
|
||||
if ($(this).attr('href') == Clickedurl) {
|
||||
let liParent = $(this).parent();
|
||||
liParent.addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
209
application/views/inventory/header.php
Normal file
209
application/views/inventory/header.php
Normal file
@ -0,0 +1,209 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title><?= $school_info['school_name']; ?></title>
|
||||
<link rel="icon" type="image/x-icon" href="<?php echo base_url(); ?>common_assets/fav.png">
|
||||
<!--styles links-->
|
||||
<!-- <link rel="stylesheet" href="https://cdn.datatables.net/fixedcolumns/4.2.1/css/fixedColumns.bootstrap4.min.css"> -->
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/fixedColumns.bootstrap4.min.css">
|
||||
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/jquery-ui.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/all.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/owl-carousel/css/owl.carousel.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/style-admin.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/style-admin-responsive.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/jquery.dataTables.min.css">
|
||||
<!-- <link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/style.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/responsive.css"> -->
|
||||
<!-- <link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/fontawesome.min.css" /> -->
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/nepali.datepicker.v3.7.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/bootstrap4-toggle.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/bootstrap-select.css">
|
||||
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/datatable/buttons.dataTables.min.css">
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/bootstrap-float-label.min.css" />
|
||||
<!--<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.semanticui.min.css">-->
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/css/datatable/dt-custom.css">
|
||||
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.8/semantic.min.css">-->
|
||||
<link href="<?php echo base_url(); ?>assets_admin/css/cwc-font.css" rel="stylesheet">
|
||||
|
||||
<script src="<?php echo base_url(); ?>assets_student/js/jquery-3.6.0.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets_admin/js/jquery.validate.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets_admin/sweetalert/sweet-alert.css">
|
||||
<script src="<?php echo base_url(); ?>assets_admin/sweetalert/sweet-alert.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="mob_bg">
|
||||
|
||||
<?php if (isset($_SESSION['admin_id'])) { ?>
|
||||
|
||||
<header id="header" class="responsive-width">
|
||||
<div class="search-bar-wrap">
|
||||
<!-- <input type="text" name="" placeholder="Search..">
|
||||
<button class="search-btn"><i class="fas fa-search"></i></button> -->
|
||||
</div>
|
||||
<div class="user-login-section">
|
||||
|
||||
<div class="user-wrap">
|
||||
<div class="user-login-head">
|
||||
<img src="<?= base_url(); ?>assets_admin/images/A.png">
|
||||
<h5><span class="user-name"><?php echo $_SESSION['admin_name']; ?></span><i class="fa fa-caret-down" aria-hidden="true"></i><i class="fa fa-caret-up" aria-hidden="true"></i></h5>
|
||||
</div>
|
||||
<div class="login-wrap-open">
|
||||
<ul>
|
||||
<!--li><a href="<?= base_url(); ?>admin/my-profile"><span><i class="fa fa-user" aria-hidden="true"></i></span>My Profile</a></li-->
|
||||
<li>
|
||||
<a href="<?php echo base_url() . 'admin/admin-change-password'; ?>">
|
||||
<span><i class="fas fa-lock"></i></span>Change Password
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo base_url() . 'admin-logout'; ?>">
|
||||
<span><i class="fas fa-sign-out-alt"></i></span>Sign Out
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mobileMenu">
|
||||
<i class="fas fa-bars"></i>
|
||||
</div>
|
||||
<div class="mob_screen">
|
||||
<h3>To use <img src="<?= base_url(); ?>assets_admin/images/<?= $logo['logo']; ?>"> on your mobile, install the
|
||||
<img src="<?= base_url(); ?>assets_admin/images/<?= $logo['logo']; ?>"> mobile app. <h3>
|
||||
<a href=""><img src="<?= base_url(); ?>assets_admin/images/google_play.png" /> </a>
|
||||
</div>
|
||||
</header>
|
||||
<aside id="mySidebar" class="sideMenu" id="style-2">
|
||||
<div class="logo-wrap">
|
||||
<img src="<?= base_url(); ?>common_assets/<?= $school_info['logo']; ?>">
|
||||
</div>
|
||||
|
||||
<?php /*?><ul class="side-list">
|
||||
<?php
|
||||
if(!isset($currentURL)) $currentURL = '';
|
||||
|
||||
$url = explode(base_url(), $currentURL); ?>
|
||||
<?php if(isset($menulist)) {foreach($menulist as $menu){ ?>
|
||||
<li class="list <?php if($url[1]==$menu['page_link']){echo 'active'; } ?> ">
|
||||
<a href="<?= base_url(); ?><?= $menu['page_link']; ?>">
|
||||
<img src="<?= base_url(); ?>assets_admin/images/<?= $menu['inactive_icon']; ?>" class="icon-inactive">
|
||||
<img src="<?= base_url(); ?>assets_admin/images/<?= $menu['active_icon']; ?>" class="icon-active">
|
||||
<span><?= $menu['menu_name']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } } ?>
|
||||
</ul><?php */ ?>
|
||||
<!--<ul>
|
||||
<li class="list ">
|
||||
<a href="subject-create.html" class="dropdown" id="dropdownMenuButton1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<img src="../assets/images/subject1.png" class="icon-inactive">
|
||||
<img src="../assets/images/subject2.png" class="icon-active">
|
||||
<span>Subjects</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="list active ">
|
||||
<a href="#" id="btn-1" class="dropdown-toggle" data-toggle="collapse" data-target="#submenu1" aria-expanded="false">
|
||||
<img src="../assets/images/dashboard1.png" class="icon-inactive">
|
||||
<img src="../assets/images/dashboard2.png" class="icon-active">
|
||||
<span>Dashboard</span>
|
||||
</a>
|
||||
<div class="nav collapse" id="submenu1" role="menu" aria-labelledby="btn-1">
|
||||
<a class="dropdown-item active" href="#">Submenu 1</a>
|
||||
<a class="dropdown-item" href="#">option 2 submenu</a>
|
||||
<a class="dropdown-item" href="#">Something submenu</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>-->
|
||||
|
||||
<ul class="side-list admin-sidebar">
|
||||
<?php
|
||||
if (!isset($currentURL))
|
||||
$currentURL = '';
|
||||
$url = explode(base_url() . 'index.php/', $currentURL);
|
||||
//echo $currentURL;
|
||||
//echo '<pre>';print_r($url);
|
||||
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('Admin_model');
|
||||
|
||||
$adminMenuHere = $CI->Admin_model->get_admin_menu();
|
||||
|
||||
|
||||
$adminRolePerms = $CI->Admin_model->get_admin_role_permissions("admin_role_ids IN(" . $_SESSION['admin_role_ids'] . ")");
|
||||
|
||||
if (!empty($adminRolePerms)) {
|
||||
$arpStr = '';
|
||||
$arpArr = array();
|
||||
foreach ($adminRolePerms as $arp) {
|
||||
if ($arpStr == '')
|
||||
$arpStr = $arp['menu_ids'];
|
||||
else
|
||||
$arpStr .= ',' . $arp['menu_ids'];
|
||||
}
|
||||
$arpArr = array_unique(explode(',', $arpStr));
|
||||
|
||||
|
||||
if (!empty($adminMenuHere)) {
|
||||
// dd($adminMenuHere);
|
||||
foreach ($adminMenuHere as $key => $menuData) {
|
||||
if (in_array($key, $arpArr)) {
|
||||
if (isset($menuData[$key]) && !empty($menuData[$key])) {
|
||||
$smPageLinks = array();
|
||||
foreach ($menuData[$key] as $tmactive) {
|
||||
array_push($smPageLinks, $tmactive['page_link']);
|
||||
}
|
||||
//echo '<pre>'; print_r($smPageLinks);
|
||||
//echo $url[1];
|
||||
$mmmActive = '';
|
||||
if (in_array($url[1], $smPageLinks))
|
||||
$mmmActive = 'active';
|
||||
?>
|
||||
<li class="list listWithDrpdwn <?php echo $mmmActive; ?>">
|
||||
<a href="javascript:void(0)" id="btn-1" class="dropdown-toggle " data-toggle="collapse" data-target="#<?php echo $menuData['menu_name'] . '-submenu'; ?>" aria-expanded="false">
|
||||
<!-- <img src="<?php echo base_url(); ?>assets_admin/images/<?php echo $menuData['inactive_icon']; ?>" class="icon-inactive"> -->
|
||||
<img src="<?php echo base_url(); ?>assets_admin/images/<?php echo $menuData['active_icon']; ?>" class="icon-active">
|
||||
<span><?php echo $menuData['menu_name']; ?></span>
|
||||
</a>
|
||||
<div class="nav collapse" id="<?php echo $menuData['menu_name'] . '-submenu'; ?>" role="menu" aria-labelledby="btn-1">
|
||||
|
||||
<?php
|
||||
foreach ($menuData[$key] as $subMenu) {
|
||||
?>
|
||||
<a class="dropdown-item <?php if ($url[1] == $subMenu['page_link']) { ?>active<?php } ?>" href="<?php echo base_url() . $subMenu['page_link']; ?>"><?php echo $subMenu['menu_name']; ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<li class="list <?php if ($url[1] == $menuData['page_link']) { ?>active<?php } ?>">
|
||||
<a href="<?php echo base_url() . $menuData['page_link']; ?>" class="dropdown">
|
||||
<!-- <img src="<?php echo base_url(); ?>assets_admin/images/<?php echo $menuData['inactive_icon']; ?>" class="icon-inactive"> -->
|
||||
<img src="<?php echo base_url(); ?>assets_admin/images/<?php echo $menuData['active_icon']; ?>" class="icon-active">
|
||||
<span><?php echo $menuData['menu_name']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
</aside>
|
||||
<?php } ?>
|
217
application/views/inventory/item-category.php
Normal file
217
application/views/inventory/item-category.php
Normal file
@ -0,0 +1,217 @@
|
||||
<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="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add New Item Category</h5>
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/inventory/item-categories">
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" placeholder='Enter category title' required>
|
||||
<span>Category Title</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="is_class_based" class="form-control custom-select" placeholder="Based on Class" name="is_class_based">
|
||||
<option value="yes">
|
||||
Yes
|
||||
</option>
|
||||
<option value="no" selected>
|
||||
No
|
||||
</option>
|
||||
</select>
|
||||
<span>Class Based</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 w-100">
|
||||
<input type="submit" name="addCategory" id="addCategory" class="btn btn-sm btn-success w-100" value="Add">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 pl-0">
|
||||
<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">Based On Class</th>
|
||||
<th class="textCenter">Is Active</th>
|
||||
|
||||
<th class="textCenter">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($inventory_categories as $ic_key => $ic_value) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $ic_key + 1 ?></td>
|
||||
<td class="text-left"><?= $ic_value['title'] ?></td>
|
||||
<td><?= ucfirst($ic_value['class_based']) ?></td>
|
||||
<td><?= ucfirst($ic_value['is_active']) ?></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#updateModal<?= $ic_value['id'] ?>">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
|
||||
<div class="modal fade" id="updateModal<?= $ic_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">Update</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="<?= base_url(); ?>admin/inventory/item-categories" method="POST" onkeydown=" return event.key != 'Enter'">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="recId" value="<?= $ic_value['id'] ?>">
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" value="<?= $ic_value['title'] ?>" placeholder='Enter category title' required>
|
||||
<span>Category Title</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-4">
|
||||
<label class="has-float-label">
|
||||
<select id="is_class_based" class="form-control custom-select" placeholder="Based on Class" name="is_class_based">
|
||||
<option value="yes" <?= $ic_value['class_based'] == 'yes' ? 'selected' : '' ?>>
|
||||
Yes
|
||||
</option>
|
||||
<option value="no" <?= $ic_value['class_based'] == 'no' ? 'selected' : '' ?>>
|
||||
No
|
||||
</option>
|
||||
</select>
|
||||
<span>Class Based</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-4">
|
||||
<label class="has-float-label">
|
||||
<select id="is_active" class="form-control custom-select" placeholder="Is Active" name="is_active">
|
||||
<option value="yes" <?= $ic_value['is_active'] == 'yes' ? 'selected' : '' ?>>
|
||||
Yes
|
||||
</option>
|
||||
<option value="no" <?= $ic_value['is_active'] == 'no' ? 'selected' : '' ?>>
|
||||
No
|
||||
</option>
|
||||
</select>
|
||||
<span>Is Active</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
|
||||
<?php if ($ic_value['is_editable'] == 'yes') { ?>
|
||||
<input type="submit" name="updateCategory" class="btn btn-sm btn-success" value="Update">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</div>
|
||||
|
||||
<!--End right-top side-->
|
||||
|
||||
<!-- <script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.2.1.slim.min.js"></script> -->
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/popper.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/all.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/main.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/owl-carousel/js/owl.carousel.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//table js
|
||||
$('#tbl').DataTable({
|
||||
"lengthMenu": [
|
||||
[25, 50, 100, 150, -1],
|
||||
[25, 50, 100, 150, "All"]
|
||||
]
|
||||
});
|
||||
//table js end
|
||||
|
||||
});
|
||||
</script>
|
520
application/views/inventory/item-list.php
Normal file
520
application/views/inventory/item-list.php
Normal file
@ -0,0 +1,520 @@
|
||||
<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 ">
|
||||
<a class="btn btn-sm btn-outline-success" href="<?= base_url() ?>admin/inventory/item-stocks">Stocks</a>
|
||||
<a class="btn btn-sm btn-outline-success" href="<?= base_url() ?>admin/inventory/item-categories">Categories</a>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="clearfix"></div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add New Item</h5>
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/inventory/items" enctype="multipart/form-data">
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" placeholder='Enter item title' required>
|
||||
<span>Item Title</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="item_category" class="form-control selectpicker" name="item_category" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Category
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_categories as $ic_key => $ic_value) {
|
||||
?>
|
||||
<option value="<?= $ic_value['id'] ?>">
|
||||
<?= $ic_value['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Category <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3" id="course-section">
|
||||
<label class="has-float-label">
|
||||
<select id="course_id[]" class="form-control selectpicker" name="course_id[]" multiple data-live-search="true">
|
||||
<option value="">
|
||||
Select Course
|
||||
</option>
|
||||
<?php
|
||||
foreach ($courses as $c_key => $course) {
|
||||
?>
|
||||
<option value="<?= $course['id'] ?>">
|
||||
<?= $course['course_name'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Course <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3" id="book-detail-section">
|
||||
<label class="has-float-label">
|
||||
<select id="publication" class="form-control selectpicker" name="publication" data-live-search="true">
|
||||
<option value="">
|
||||
Select Publication
|
||||
</option>
|
||||
<?php
|
||||
foreach ($book_publications as $p_key => $book_publication) {
|
||||
?>
|
||||
<option value="<?= $book_publication['id'] ?>">
|
||||
<?= $book_publication['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Publication <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
|
||||
<label class="has-float-label mt-3">
|
||||
<input type="text" id="edition" name="edition" class=" form-control" placeholder='Enter book edition'>
|
||||
<span>Edition</span>
|
||||
</label>
|
||||
|
||||
<label class="has-float-label mt-3">
|
||||
<input type="text" id="isbn" name="isbn" class=" form-control" placeholder='Enter book isbn'>
|
||||
<span>ISBN</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3" id="variant-section">
|
||||
<label class="has-float-label">
|
||||
<select id="variant" class="form-control selectpicker" name="variant[]" data-live-search="true" multiple>
|
||||
<option value="">
|
||||
Select Variant
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_variants as $iv_key => $inventory_variant) {
|
||||
?>
|
||||
<option value="<?= $inventory_variant['id'] ?>">
|
||||
<?= $inventory_variant['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Item Variant <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="item_measurement_unit" class="form-control selectpicker" name="item_measurement_unit" data-live-search="true">
|
||||
<option value="">
|
||||
Select Measurement Unit
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_measurements as $im_key => $im_value) {
|
||||
?>
|
||||
<option value="<?= $im_value['id'] ?>">
|
||||
<?= $im_value['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Measurement Unit <b class="text-danger"></b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<textarea class="form-control" name="description" rows="4" cols="50"></textarea>
|
||||
|
||||
<span>Item Description</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="file" id="photo" name="photo" class=" form-control" style="padding: 0.75rem 0.75rem;">
|
||||
<span>Item Photo</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 w-100">
|
||||
<input type="submit" name="addItem" id="addItem" class="btn btn-sm btn-success w-100" value="Add">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 pl-0">
|
||||
<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">Category</th>
|
||||
<th class="textCenter">Class</th>
|
||||
<th class="textCenter">Measurement Unit</th>
|
||||
<th class="textCenter">Is Active</th>
|
||||
<th class="textCenter">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($inventory_items as $i_key => $i_value) {
|
||||
|
||||
echo '<pre>';
|
||||
print_r($i_value);
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $i_key + 1 ?></td>
|
||||
<td class="text-left"><?= $i_value['title'] ?></td>
|
||||
<td class="text-left">
|
||||
<?php
|
||||
if ($i_value['category_id'] != 0) {
|
||||
foreach ($inventory_categories as $ic_key => $ic_value) {
|
||||
if ($ic_value['id'] == $i_value['category_id']) {
|
||||
echo $ic_value['title'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '-';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-left"><?= $i_value['title'] ?></td>
|
||||
<td class="text-left">
|
||||
<?php
|
||||
if ($i_value['measurement_id'] != 0) {
|
||||
foreach ($inventory_measurements as $im_key => $im_value) {
|
||||
|
||||
|
||||
if ($im_value['id'] == $i_value['measurement_id']) {
|
||||
echo $im_value['title'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '-';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?= ucfirst($i_value['is_active']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= base_url() . 'admin/inventory/view-item-detail/' . $i_value['id'] ?>" class="btn btn-sm btn-outline-primary mr-1">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#updateModal<?= $i_value['id'] ?>">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
|
||||
<div class="modal fade" id="updateModal<?= $i_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">Update</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="<?= base_url(); ?>admin/inventory/items" method="POST" onkeydown=" return event.key != 'Enter'" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="recId" value="<?= $i_value['id'] ?>">
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" value="<?= $i_value['title'] ?>" placeholder='Enter item title' required>
|
||||
<span>Item Title</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="item_category<?= $i_value['id'] ?>" class="form-control selectpicker" name="item_category" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Category
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_categories as $ic_key => $ic_value) {
|
||||
?>
|
||||
<option value="<?= $ic_value['id'] ?>" <?= $ic_value['id'] == $i_value['category_id'] ? 'selected' : '' ?>>
|
||||
<?= $ic_value['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Category <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3" id="course-section<?= $i_value['id'] ?>">
|
||||
<label class="has-float-label">
|
||||
<select id="course_id[]" class="form-control selectpicker" name="course_id[]" data-live-search="true">
|
||||
<option value="">
|
||||
Select Course
|
||||
</option>
|
||||
<?php
|
||||
foreach ($courses as $c_key => $course) {
|
||||
?>
|
||||
<option value="<?= $course['id'] ?>" <?= $course['id'] == $i_value['course_id'] ? 'selected' : '' ?>>
|
||||
<?= $course['course_name'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Course <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select id="item_measurement_unit" class="form-control selectpicker" name="item_measurement_unit" data-live-search="true">
|
||||
<option value="">
|
||||
Select Measurement Unit
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_measurements as $im_key => $im_value) {
|
||||
?>
|
||||
<option value="<?= $im_value['id'] ?>" <?= $im_value['id'] == $i_value['measurement_id'] ? 'selected' : '' ?>>
|
||||
<?= $im_value['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Measurement Unit <b class="text-danger"></b></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<textarea class="form-control" name="description" rows="4" cols="50">
|
||||
<?= $i_value['description'] ?>
|
||||
</textarea>
|
||||
<span>Item Description</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3 text-left">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<label class="has-float-label mt-3">
|
||||
<input type="file" id="photo" name="photo" class=" form-control" style="padding: 0.75rem 0.75rem;">
|
||||
<input type="hidden" id="photo_name" name="photo_name" value="<?= $i_value['photo'] ?>" class=" form-control" style="padding: 0.75rem 0.75rem;">
|
||||
<span>Item Photo</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<?php
|
||||
$item_photo = '';
|
||||
if (!empty($i_value['photo'])) {
|
||||
if (file_exists('assets_inventory/images/items/' . $i_value['photo'])) {
|
||||
$item_photo = base_url() . 'assets_inventory/images/items/' . $i_value['photo'];
|
||||
} else {
|
||||
$item_photo = base_url() . 'common_assets/' . $i_value['photo'];
|
||||
}
|
||||
} else {
|
||||
$item_photo = base_url() . 'common_assets/No-Image.jpg';
|
||||
}
|
||||
?>
|
||||
|
||||
<img src="<?= $item_photo ?>" class="img-thumbnail img-fluid" width="100px">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group mt-4">
|
||||
<label class="has-float-label">
|
||||
<select id="is_active" class="form-control custom-select" placeholder="Is Active" name="is_active">
|
||||
<option value="yes" <?= $i_value['is_active'] == 'yes' ? 'selected' : '' ?>>
|
||||
Yes
|
||||
</option>
|
||||
<option value="no" <?= $i_value['is_active'] == 'no' ? 'selected' : '' ?>>
|
||||
No
|
||||
</option>
|
||||
</select>
|
||||
<span>Is Active</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
|
||||
<input type="submit" name="updateItem" class="btn btn-sm btn-success" value="Update">
|
||||
</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();
|
||||
$("#book-detail-section").hide();
|
||||
$("#variant-section").hide();
|
||||
//table js
|
||||
$('#tbl').DataTable({
|
||||
"lengthMenu": [
|
||||
[25, 50, 100, 150, -1],
|
||||
[25, 50, 100, 150, "All"]
|
||||
]
|
||||
});
|
||||
//table js end
|
||||
|
||||
|
||||
var items = <?php echo json_encode($inventory_items); ?>;
|
||||
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
$('#item_category' + i).on('change', function() {
|
||||
var catId = this.value;
|
||||
|
||||
var categories = <?php echo json_encode($inventory_categories); ?>;
|
||||
|
||||
for (var i = 0; i < categories.length; i++) {
|
||||
if (catId == categories[i]['id']) {
|
||||
if ($.trim(categories[i]['class_based']) == "yes") {
|
||||
console.log(categories[i]['class_based']);
|
||||
$("#course-section" + i).show();
|
||||
break;
|
||||
} else {
|
||||
$("#course-section" + i).hide();
|
||||
}
|
||||
} else {
|
||||
$("#course-section" + i).hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#item_category').on('change', function() {
|
||||
var catId = this.value;
|
||||
|
||||
var categories = <?php echo json_encode($inventory_categories); ?>;
|
||||
|
||||
for (var i = 0; i < categories.length; i++) {
|
||||
console.log(categories[i]);
|
||||
if (catId == categories[i]['id']) {
|
||||
if ($.trim(categories[i]['class_based']) == "yes") {
|
||||
console.log(categories[i]['class_based']);
|
||||
$("#course-section").show();
|
||||
break;
|
||||
} else {
|
||||
$("#course-section").hide();
|
||||
}
|
||||
} else {
|
||||
$("#course-section").hide();
|
||||
}
|
||||
}
|
||||
|
||||
if (catId == 1) {
|
||||
$("#book-detail-section").show();
|
||||
} else {
|
||||
$("#book-detail-section").hide();
|
||||
}
|
||||
|
||||
if (catId == 3) {
|
||||
$("#variant-section").show();
|
||||
} else {
|
||||
$("#variant-section").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
180
application/views/inventory/item-purchase.php
Normal file
180
application/views/inventory/item-purchase.php
Normal file
@ -0,0 +1,180 @@
|
||||
<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 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">×</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>
|
245
application/views/inventory/item-stocks.php
Normal file
245
application/views/inventory/item-stocks.php
Normal file
@ -0,0 +1,245 @@
|
||||
<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>
|
247
application/views/inventory/item-variants.php
Normal file
247
application/views/inventory/item-variants.php
Normal file
@ -0,0 +1,247 @@
|
||||
<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="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add New Item Variant</h5>
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/inventory/item-variants">
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" placeholder='Enter variant title' required>
|
||||
<span>Variant Title</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label class="has-float-label">
|
||||
<select class="form-control selectpicker" name="item_category" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Category
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_categories as $ic_key => $ic_value) {
|
||||
?>
|
||||
<option value="<?= $ic_value['id'] ?>">
|
||||
<?= $ic_value['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Category <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 w-100">
|
||||
<input type="submit" name="addVariant" id="addVariant" class="btn btn-sm btn-success w-100" value="Add">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 pl-0">
|
||||
<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">Category</th>
|
||||
<th class="textCenter">Is Active</th>
|
||||
|
||||
<th class="textCenter">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($inventory_variants as $iv_key => $iv_value) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $iv_key + 1 ?></td>
|
||||
<td class="text-left"><?= $iv_value['title'] ?></td>
|
||||
<td><?= ucfirst($iv_value['category_title']) ?></td>
|
||||
<td><?= ucfirst($iv_value['is_active']) ?></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#updateModal<?= $iv_value['id'] ?>">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
|
||||
<div class="modal fade" id="updateModal<?= $iv_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">Update</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="<?= base_url(); ?>admin/inventory/item-variants" method="POST" onkeydown=" return event.key != 'Enter'">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="recId" value="<?= $iv_value['id'] ?>">
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" value="<?= $iv_value['title'] ?>" placeholder='Enter category title' required>
|
||||
<span>Category Title</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-4">
|
||||
<label class="has-float-label">
|
||||
<select id="item_category" class="form-control selectpicker" name="item_category" data-live-search="true" required>
|
||||
<option value="">
|
||||
Select Category
|
||||
</option>
|
||||
<?php
|
||||
foreach ($inventory_categories as $ic_key => $ic_value) {
|
||||
?>
|
||||
<option value="<?= $ic_value['id'] ?>" <?= $ic_value['id'] == $iv_value['category'] ? 'selected' : '' ?>>
|
||||
<?= $ic_value['title'] ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span>Category <b class="text-danger">*</b></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-4">
|
||||
<label class="has-float-label">
|
||||
<select id="is_active" class="form-control custom-select" placeholder="Is Active" name="is_active">
|
||||
<option value="yes" <?= $iv_value['is_active'] == 'yes' ? 'selected' : '' ?>>
|
||||
Yes
|
||||
</option>
|
||||
<option value="no" <?= $iv_value['is_active'] == 'no' ? 'selected' : '' ?>>
|
||||
No
|
||||
</option>
|
||||
</select>
|
||||
<span>Is Active</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
|
||||
<input type="submit" name="updateVariant" class="btn btn-sm btn-success" value="Update">
|
||||
|
||||
</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 src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/popper.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/all.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/main.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/owl-carousel/js/owl.carousel.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//table js
|
||||
$('#tbl').DataTable({
|
||||
"lengthMenu": [
|
||||
[25, 50, 100, 150, -1],
|
||||
[25, 50, 100, 150, "All"]
|
||||
]
|
||||
});
|
||||
//table js end
|
||||
|
||||
});
|
||||
</script>
|
193
application/views/inventory/item_units.php
Normal file
193
application/views/inventory/item_units.php
Normal file
@ -0,0 +1,193 @@
|
||||
<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="pr-5 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="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add New Item Unit</h5>
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/inventory/item-unit">
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" placeholder='Enter item unit title' required>
|
||||
<span>Item Unit Title</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mb-0 mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="short_label" name="short_label" class=" form-control" placeholder='Enter item unit short name (e.g. pc, gm, kg)' required>
|
||||
<span>Short Name</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 w-100">
|
||||
<input type="submit" name="addItemUnit" id="addItemUnit" class="btn btn-sm btn-success w-100" value="Add">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 pl-0">
|
||||
<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">Short Label</th>
|
||||
<th class="textCenter">Is Active</th>
|
||||
<th class="textCenter">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($inventory_measurements as $im_key => $im_value) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $im_key + 1 ?></td>
|
||||
<td class="text-left"><?= $im_value['title'] ?></td>
|
||||
<td><?= $im_value['short_label'] ?></td>
|
||||
<td><?= ucfirst($im_value['is_active']) ?></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#updateModal<?= $im_value['id'] ?>">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
|
||||
<div class="modal fade" id="updateModal<?= $im_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">Update</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="<?= base_url(); ?>admin/inventory/item-unit" method="POST" onkeydown=" return event.key != 'Enter'">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="unitId" value="<?= $im_value['id'] ?>">
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="title" name="title" class=" form-control" value="<?= $im_value['title'] ?>" placeholder='Enter item unit title' required>
|
||||
<span>Item Unit Title</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mb-0 mt-3">
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="short_label" name="short_label" class=" form-control" value="<?= $im_value['short_label'] ?>" placeholder='Enter item unit short name (e.g. pc, gm, kg)' required>
|
||||
<span>Short Name</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group mt-4">
|
||||
<label class="has-float-label">
|
||||
<select id="is_active" class="form-control custom-select" placeholder="Is Active" name="is_active">
|
||||
<option value="yes" <?= $im_value['is_active'] == 'yes' ? 'selected' : '' ?>>
|
||||
Yes
|
||||
</option>
|
||||
<option value="no" <?= $im_value['is_active'] == 'no' ? 'selected' : '' ?>>
|
||||
No
|
||||
</option>
|
||||
</select>
|
||||
<span>Is Active</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
|
||||
<input type="submit" name="updateItemUnit" class="btn btn-sm btn-success" value="Update">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</div>
|
||||
|
||||
<!--End right-top side-->
|
||||
|
||||
<!-- <script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.2.1.slim.min.js"></script> -->
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/popper.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/all.js"></script>
|
||||
<script defer src="<?php echo base_url(); ?>assets-bustracking/js/main.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets-bustracking/owl-carousel/js/owl.carousel.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//table js
|
||||
$('#tbl').DataTable({
|
||||
"lengthMenu": [
|
||||
[25, 50, 100, 150, -1],
|
||||
[25, 50, 100, 150, "All"]
|
||||
]
|
||||
});
|
||||
//table js end
|
||||
|
||||
});
|
||||
</script>
|
436
application/views/inventory/list-expenses.php
Normal file
436
application/views/inventory/list-expenses.php
Normal file
@ -0,0 +1,436 @@
|
||||
<div class="wraper responsive-width">
|
||||
<main class="long-tbl-main students_list_table" id="main">
|
||||
<?php
|
||||
$currency_symbol = $school_info['currency_symbol'];
|
||||
?>
|
||||
|
||||
<div class="from-group adding-class form-group_lng " style="width: 95%;">
|
||||
<a href="<?= base_url() ?>admin/addExpeses/0"><button type="button" class="btn btn-outline-primary btn-sm">Add Expenses</button></a>
|
||||
</div>
|
||||
<!-- admin template section -->
|
||||
<div class="admin_tempblock">
|
||||
<div class="admin_tempsec">
|
||||
<div class="admin_sec">
|
||||
<form method="post" action="<?php echo base_url(); ?>admin/listExpeses">
|
||||
<div class="subsec_sec">
|
||||
<div class="subject_r">
|
||||
<div class="subject_lsec">
|
||||
<div class="subject_lhead">Expenses List</div>
|
||||
<!-- tab added -->
|
||||
<div class="top-filter mb-0 mt-4" style="display: block;">
|
||||
<div class="row">
|
||||
<div class="col-md-3 pr-0">
|
||||
<div class="form-group mb-0 pr-1">
|
||||
<label class="has-float-label">
|
||||
<select id="course" class="form-control custom-select" placeholder="Select Expense Type" name="filter-expense-type">
|
||||
<option value=" "> Select Expense Type</option>
|
||||
<?php if (isset($expenses_types) || !empty($expenses_types)) {
|
||||
foreach ($expenses_types as $row) { ?>
|
||||
|
||||
<option value="<?php echo $row['expenseId'] ?>" <?php echo set_select('filter-expense-type', $row['expenseId'], (!empty($s_expense_type) ? TRUE : FALSE)); ?>>
|
||||
<?php echo $row['expenseTitle']; ?></option>
|
||||
|
||||
<?php }
|
||||
} ?>
|
||||
</select>
|
||||
<span>Expense Type</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 pr-0 pl-2">
|
||||
<div class="form-group mb-0">
|
||||
<div class="date-fil-row">
|
||||
<!-- <label>Start date</label> -->
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="start_date" name="filter-Sdate" class=" form-control nepal-date" placeholder='dd-mm-yyyy' value="<?php echo (!empty($sdate)) ? $sdate : ''; ?>" <?php echo set_select('filter-Sdate', (!empty($sdate)) ? $sdate : '', (!empty($sdate) ? TRUE : FALSE)); ?>>
|
||||
<span>Start Date</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="text-danger cierr"><?php echo form_error('filter-Sdate'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 pr-0 pl-0">
|
||||
<div class="form-group mb-0">
|
||||
<div class="date-fil-row">
|
||||
<!-- <label>End date</label> -->
|
||||
<label class="has-float-label">
|
||||
<input type="text" id="end_date" name="filter-Edate" class="form-control nepal-date" placeholder='dd-mm-yyyy' value="<?php echo (!empty($edate)) ? $edate : ''; ?>" <?php echo set_select('filter-Edate', (!empty($edate)) ? $edate : '', (!empty($edate) ? TRUE : FALSE)); ?>>
|
||||
<span>End Date</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="text-danger cierr"><?php echo form_error('filter-Edate'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 pr-0 pl-0">
|
||||
<div class="row d-flex justify-content-center pl-2">
|
||||
<input type="submit" name="filterSubmit" id="filter_reset" class="btn btn-outline-success w-100 col-md-6" value="Filter">
|
||||
<a class="col-md-6 pl-0 pr-0 row d-flex justify-content-center" href="<?php echo base_url() ?>admin/listExpeses">
|
||||
<button type="button" name="reset_filter" id="reset_filter" value="reset_filter" class="subject_addbtn p-0 subject_addbtn_nobg ml-4"><i class="fas fa-redo"></i>Reset</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php if ($this->session->flashdata('success')) { ?>
|
||||
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<p><?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><?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 } ?>
|
||||
|
||||
<hr>
|
||||
<div class="applicnts-list-wrap ">
|
||||
<div class="">
|
||||
<table id="tbl1" class="display table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sl.No</th>
|
||||
<th>Title</th>
|
||||
<th>Type</th>
|
||||
<th>Paid Date</th>
|
||||
<th class="noExport">View File </th>
|
||||
<th>Description </th>
|
||||
<th>Quantity</th>
|
||||
<th>Amount</th>
|
||||
<th>Total Amount</th>
|
||||
<th class="noExport">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($expenses_data) {
|
||||
foreach ($expenses_data as $key => $value) { ?>
|
||||
<tr>
|
||||
<td><?php echo $key + 1; ?></td>
|
||||
<td><?php echo $value['title']; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
foreach ($expenses_types as $e_type) {
|
||||
if ($value['expense_type'] == $e_type['expenseId']) {
|
||||
if ($value['expense_s_type'] != '') {
|
||||
echo $e_type['expenseTitle'] . ' <label class="text-small text-muted">(' . ucwords($value['expense_s_type']) . ')</label>';
|
||||
} else {
|
||||
echo $e_type['expenseTitle'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</td>
|
||||
|
||||
<td><?php echo $value['paid_date']; ?> </td>
|
||||
<td><?php if (!empty($value['file_path'])) { ?>
|
||||
<div class="sub_viewbtn" title="edit" onclick="view_image('<?php echo base_url($value['file_path']); ?>')">
|
||||
<i class="fa fa-image"></i>
|
||||
</div>
|
||||
<?php } else {
|
||||
echo '-';
|
||||
} ?>
|
||||
</td>
|
||||
<td><?php echo substr($value['description'], 0, 20) . '-'; ?></td>
|
||||
<td><?php echo $value['quantity']; ?></td>
|
||||
<td><?php echo $value['amount']; ?></td>
|
||||
<td><?php echo $value['total_amount']; ?></td>
|
||||
<td>
|
||||
<div class="sub_tabbtnsec stud_tabbtnsec">
|
||||
|
||||
<div class="sub_viewbtn" data-toggle="tooltip" title="edit">
|
||||
<a href="<?= base_url() ?>admin/addExpeses/<?php echo $value['id'] ?>">
|
||||
<i class="fas fa-pencil-alt"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="sub_delbtn" data-toggle="tooltip" title="Remove">
|
||||
<a data-toggle="modal" onclick="examdel(<?php echo $value['id']; ?>)" href="#deleteModal">
|
||||
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th> </th>
|
||||
<th></th>
|
||||
|
||||
<th></th>
|
||||
<th style="font-size:13px;" class="text-center"> In <?= $currency_symbol; ?></th>
|
||||
<th style="font-size:13px" class="text-center"></th>
|
||||
|
||||
<th style="font-size:13px;" class="text-center"></th>
|
||||
<th style="font-size:13px;" class="text-center"></th>
|
||||
<th></th>
|
||||
<!-- <th></th> -->
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- admin template section end -->
|
||||
|
||||
<div class="viewDoc delete-modal-wrap">
|
||||
<div class="modal fade" id="deleteModal" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<div class="delete-modal">
|
||||
|
||||
<i class="far fa-times-circle"></i>
|
||||
<input type="hidden" id="thid" />
|
||||
<h4>Are you sure?</h4>
|
||||
<p>Are you sure you want to delete this Expenses?</p>
|
||||
<div class="delete-modal-btn">
|
||||
<button type="button" class="subject_addbtn subject_addbtn_red" onclick="deletedata($('#thid').val());">Delete</button>
|
||||
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal " id="imageModal" role="dialog" style="padding-top: 100px !important;">
|
||||
|
||||
<!-- Modal Content (The Image) -->
|
||||
<img class="modal-content_img" id="get_image">
|
||||
</div>
|
||||
|
||||
|
||||
</main>
|
||||
<!--End right-top side-->
|
||||
<style type="text/css">
|
||||
/* The Modal (background) */
|
||||
.imageModal {
|
||||
display: none;
|
||||
/* Hidden by default */
|
||||
position: fixed;
|
||||
/* Stay in place */
|
||||
z-index: 4;
|
||||
/* Sit on top */
|
||||
padding-top: 100px !important;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
/* Full width */
|
||||
height: 100%;
|
||||
/* Full height */
|
||||
overflow: auto;
|
||||
/* Enable scroll if needed */
|
||||
background-color: rgb(0, 0, 0);
|
||||
/* Fallback color */
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
/* Black w/ opacity */
|
||||
}
|
||||
|
||||
/* Modal Content (Image) */
|
||||
.modal-content_img {
|
||||
margin: auto;
|
||||
display: block;
|
||||
width: 80%;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
/* Caption of Modal Image (Image Text) - Same Width as the Image */
|
||||
|
||||
|
||||
/* Add Animation - Zoom in the Modal */
|
||||
.modal-content_img {
|
||||
animation-name: zoom;
|
||||
animation-duration: 0.6s;
|
||||
}
|
||||
|
||||
@keyframes zoom {
|
||||
from {
|
||||
transform: scale(0)
|
||||
}
|
||||
|
||||
to {
|
||||
transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 100% Image Width on Smaller Screens */
|
||||
@media only screen and (max-width: 700px) {
|
||||
.modal-content_img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$theExportHeader = 'Expense List';
|
||||
?>
|
||||
|
||||
<script>
|
||||
function examdel(icn) {
|
||||
$('#thid').val(icn);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var currency_symbol = "<?php echo $currency_symbol; ?>";
|
||||
|
||||
var jsTheExportHeader = '<?php echo $theExportHeader; ?>';
|
||||
$('.user-drpdown').click(function() {
|
||||
$('.drpdown-items').toggle();
|
||||
});
|
||||
|
||||
|
||||
//table js
|
||||
$('#tbl1').DataTable({
|
||||
"lengthMenu": [
|
||||
[-1],
|
||||
["All"]
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"dom": 'lBfrtip',
|
||||
"buttons": [{
|
||||
extend: 'pdfHtml5',
|
||||
title: 'Student List',
|
||||
orientation: 'landscape',
|
||||
exportOptions: {
|
||||
columns: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
header: true,
|
||||
footer: true,
|
||||
title: jsTheExportHeader,
|
||||
|
||||
exportOptions: {
|
||||
columns: "thead th:not(.noExport)",
|
||||
rows: function(indx, rowData, domElement) {
|
||||
return $(domElement).css("display") != "none";
|
||||
}
|
||||
},
|
||||
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) {
|
||||
|
||||
for (let td_count = 7; td_count <= 8; td_count++) {
|
||||
var api = this.api(),
|
||||
data;
|
||||
|
||||
// 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(td_count)
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Total over this page
|
||||
pageTotal = api
|
||||
.column(td_count, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
$(api.column(td_count).footer()).html(
|
||||
//currency_symbol + ' ' + pageTotal + ' ( ' + currency_symbol + ' ' + total + ' total )'
|
||||
pageTotal
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//table js end
|
||||
|
||||
|
||||
|
||||
/* Select your element */
|
||||
let NDate = NepaliFunctions.GetCurrentBsDate();
|
||||
let todayDate = `${NDate.year}-${NDate.month}-${NDate.day}`;
|
||||
/* Initialize Datepicker with options */
|
||||
$('#start_date').nepaliDatePicker({
|
||||
disableAfter: todayDate,
|
||||
language: 'english',
|
||||
|
||||
});
|
||||
|
||||
$('#end_date').nepaliDatePicker({
|
||||
disableAfter: todayDate,
|
||||
language: 'english',
|
||||
|
||||
});
|
||||
|
||||
// nepali date end
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function deletedata(id) {
|
||||
let url = window.location.pathname.split('/');
|
||||
let postUrl = url[1] + '/' + url[2];
|
||||
// console.log('admin/delete-section/'+postUrl + id);
|
||||
window.location.replace('<?php echo base_url() ?>' + 'admin/delete_expenses/' + id);
|
||||
}
|
||||
|
||||
function view_image(documentPath) {
|
||||
|
||||
var src1 = documentPath;
|
||||
$("#get_image").attr("src", src1);
|
||||
$("#imageModal").modal('show');
|
||||
}
|
||||
</script>
|
267
application/views/inventory/sales.php
Normal file
267
application/views/inventory/sales.php
Normal file
@ -0,0 +1,267 @@
|
||||
<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-new-sales-record/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">Name</th>
|
||||
<th class="textCenter">Item</th>
|
||||
<th class="textCenter">Purchased On</th>
|
||||
<th class="textCenter">Qty</th>
|
||||
<th class="textCenter">Unit Price</th>
|
||||
<th class="textCenter">Total Price</th>
|
||||
<th class="textCenter noExport">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($sales_list as $s_key => $sales) {
|
||||
// echo '<pre>';
|
||||
// print_r($sales);
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $s_key + 1 ?></td>
|
||||
<td class="text-left"><?= $sales['name'] ?></td>
|
||||
<td class="text-left"><?= $sales['title'] ?>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
$date_time = explode(' ', $sales['sales_on']);
|
||||
echo $date_time[0];
|
||||
?>
|
||||
</td>
|
||||
<td><?= $sales['qty'] ?></td>
|
||||
<td><?= $sales['unit_price'] ?></td>
|
||||
<td><?= $sales['total_amount'] ?></td>
|
||||
<td>
|
||||
|
||||
<a href="<?= base_url() . 'admin/inventory/view-invoice/' . urlsafe_b64encode($sales['salesId']) ?>" class="mr-1" data-toggle="tooltip" title="Invoice" target="_blank">
|
||||
<i class="fas fa-file-invoice text-primary fa-lg"></i>
|
||||
</a>
|
||||
<a href="<?= base_url() . 'admin/inventory/view-sales-detail/' . $sales['id'] ?>" data-toggle="tooltip" title="View" target="_blank">
|
||||
<i class="fa fa-eye text-primary fa-lg"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>Total (In <?= $school_info['currency_symbol'] ?>)</th>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"></th>
|
||||
<th></th>
|
||||
</tfoot>
|
||||
</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({
|
||||
"dom": 'lBfrtip',
|
||||
"lengthMenu": [
|
||||
[25, 50, 100, 150, -1],
|
||||
[25, 50, 100, 150, "All"]
|
||||
],
|
||||
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(4)
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Total over this page
|
||||
pageTotal = api
|
||||
.column(4, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
pageTotal5 = api
|
||||
.column(5, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
pageTotal6 = api
|
||||
.column(6, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Update footer
|
||||
$(api.column(4).footer()).html(pageTotal);
|
||||
$(api.column(5).footer()).html(pageTotal5);
|
||||
$(api.column(6).footer()).html(pageTotal6);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
169
application/views/inventory/view-invoice.php
Normal file
169
application/views/inventory/view-invoice.php
Normal file
@ -0,0 +1,169 @@
|
||||
<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;
|
||||
}
|
||||
|
||||
label .error {
|
||||
top: 2.5rem !important;
|
||||
color: red;
|
||||
left: 0em;
|
||||
}
|
||||
|
||||
.display tr {
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
table.dataTable thead th,
|
||||
table.dataTable thead td {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
</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"><a href="<?= base_url() . 'admin/inventory/item-sales' ?>">Sales</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="row justify-content-center ">
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-right">
|
||||
<h6 id="available-stock"> </h6>
|
||||
</div>
|
||||
<div class="h6">Student Details</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="s_name" value="<?= $sales_detail['name'] ?>" class="form-control bg-white" id="s_name" placeholder="Class" readonly>
|
||||
<span>Student</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="s_class" value="<?= $sales_detail['course_name'] ?>" class="form-control bg-white" id="s_class" placeholder="Class" readonly>
|
||||
<span>Class</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="s_section" value="<?= $sales_detail['section_name'] ?>" class="form-control bg-white" id="s_section" placeholder="Class" readonly>
|
||||
<span>Section</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<div class="h6">Item Details</div>
|
||||
<div class="form-group mt-3">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_title" value="<?= $sales_detail['title'] ?>" class="form-control bg-white" id="i_title" placeholder="Item" readonly>
|
||||
<span>Item</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_qty" value="<?= $sales_detail['qty'] ?>" class="form-control bg-white" id="i_qty" placeholder="Quantity" readonly>
|
||||
<span>Quantity</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_price" value="<?= $sales_detail['unit_price'] ?>" class="form-control bg-white" id="i_price" placeholder="Price" readonly>
|
||||
<span>Price</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_total_amt" value="<?= $sales_detail['total_amount'] ?>" class="form-control bg-white" id="i_total_amt" placeholder="Total Amount" readonly>
|
||||
<span>Total Amount</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <button type="submit" id="itemAddBtn" class="btn btn-sm btn-outline-primary w-100 mt-4">Add</button> -->
|
||||
</div>
|
||||
</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> -->
|
443
application/views/inventory/view-item-detail.php
Normal file
443
application/views/inventory/view-item-detail.php
Normal file
@ -0,0 +1,443 @@
|
||||
<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;
|
||||
}
|
||||
|
||||
label .error {
|
||||
top: 2.5rem !important;
|
||||
color: red;
|
||||
left: 0em;
|
||||
}
|
||||
|
||||
.display tr {
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
table.dataTable thead th,
|
||||
table.dataTable thead td {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.detail-card .title {
|
||||
font-weight: 500;
|
||||
}
|
||||
</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"><a href="<?= base_url() . 'admin/inventory/item-sales' ?>">Item</a></li>
|
||||
|
||||
<li class="breadcrumb-item active" aria-current="page"><?= isset($item_info) ? $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 ">
|
||||
|
||||
<?php
|
||||
// echo '<pre>';
|
||||
// print_r($item_info);
|
||||
?>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-right">
|
||||
<h6 id="available-stock"> </h6>
|
||||
</div>
|
||||
<div class="h6">Item Details</div>
|
||||
<?php
|
||||
$item_photo = '';
|
||||
if (!empty($item_info['photo'])) {
|
||||
if (file_exists('assets_inventory/images/items/' . $item_info['photo'])) {
|
||||
$item_photo = base_url() . 'assets_inventory/images/items/' . $item_info['photo'];
|
||||
} else {
|
||||
$item_photo = base_url() . 'common_assets/' . $item_info['photo'];
|
||||
}
|
||||
} else {
|
||||
$item_photo = base_url() . 'common_assets/No-Image.jpg';
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- <img src="<?= $item_photo ?>" class="img-thumbnail float-right img-fluid" width="100px">
|
||||
<div class="clearfix"></div> -->
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-10 my-auto">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card detail-card">
|
||||
<div class="card-body py-2">
|
||||
<label class="w-100 mb-0 h6 small text-dark title">Title</label>
|
||||
<label class="mb-0 h6"><?= $item_info['title'] ?></label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card detail-card">
|
||||
<div class="card-body py-2">
|
||||
<label class="w-100 mb-0 h6 small text-dark title">Category</label>
|
||||
<label class="mb-0 h6">
|
||||
<?php
|
||||
if ($item_info['category_id'] != 0) {
|
||||
foreach ($categories as $c_key => $category) {
|
||||
if ($category['id'] == $item_info['category_id']) {
|
||||
echo $category['title'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '-';
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card detail-card">
|
||||
<div class="card-body py-2">
|
||||
<label class="w-100 mb-0 h6 small text-dark title">Measurement Unit</label>
|
||||
<label class="mb-0 h6">
|
||||
<?php
|
||||
if ($item_info['measurement_id'] != 0) {
|
||||
foreach ($measurement_units as $mu_key => $measurement_unit) {
|
||||
if ($measurement_unit['id'] == $item_info['measurement_id']) {
|
||||
echo $measurement_unit['title'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '-';
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-100 mt-3"></div>
|
||||
<div class="col">
|
||||
<div class="card detail-card">
|
||||
<div class="card-body py-2">
|
||||
<label class="w-100 mb-0 h6 small text-dark title">Class</label>
|
||||
<label class="mb-0 h6">
|
||||
<?php
|
||||
if ($item_info['course_id'] != 0) {
|
||||
foreach ($courses as $c_key => $course) {
|
||||
if ($course['id'] == $item_info['course_id']) {
|
||||
echo $course['course_name'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '-';
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
|
||||
</div>
|
||||
<div class="col">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<img src="<?= $item_photo ?>" class="img-thumbnail float-right img-fluid" width="100px">
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="h6">Stock Details</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card detail-card">
|
||||
<div class="card-body py-2">
|
||||
<label class="w-100 mb-0 h6 small text-dark title">Total</label>
|
||||
<label class="mb-0 h6"><?= isset($item_info['stock']['total_stock']) ? $item_info['stock']['total_stock'] : '0' ?></label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card detail-card">
|
||||
<div class="card-body py-2">
|
||||
<label class="w-100 mb-0 h6 small text-dark title">Available</label>
|
||||
<label class="mb-0 h6"><?= isset($item_info['stock']['current_stock']) ? $item_info['stock']['current_stock'] : '0' ?></label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card detail-card">
|
||||
<div class="card-body py-2">
|
||||
<label class="w-100 mb-0 h6 small text-dark title">Sold</label>
|
||||
<label class="mb-0 h6"><?= isset($item_info['stock']['sold_stock']) ? $item_info['stock']['sold_stock'] : 0 ?></label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="h6">Purchase</div>
|
||||
<table id="tbl" class="display table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">S.No.</th>
|
||||
<th class="text-center">Supplier</th>
|
||||
<th class="text-center">Contact No.</th>
|
||||
<th class="text-center">Qty.</th>
|
||||
<th class="text-center">Unit Price</th>
|
||||
<th class="text-center">Total Amount</th>
|
||||
<th class="text-center">Purchased On</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($item_info['purchases'] as $p_key => $i_purchase) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $p_key + 1 ?></td>
|
||||
<td class="text-left"><?= $i_purchase['supplier_name'] ?></td>
|
||||
<td><?= $i_purchase['supplier_contact_number'] ?></td>
|
||||
<td><?= $i_purchase['qty'] ?></td>
|
||||
<td><?= number_format($i_purchase['unit_price']) ?></td>
|
||||
<td><?= number_format($i_purchase['total_price']) ?></td>
|
||||
<td><?= $i_purchase['purchased_on'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th class="text-center">Total</th>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"></th>
|
||||
<th></th>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
|
||||
<hr>
|
||||
<div class="h6">Sales</div>
|
||||
<table id="tbl2" class="display table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">S.No.</th>
|
||||
<th class="text-center">Name</th>
|
||||
<th class="text-center">Class</th>
|
||||
<th class="text-center">Qty.</th>
|
||||
<th class="text-center">Unit Price</th>
|
||||
<th class="text-center">Total Amount</th>
|
||||
<th class="text-center">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($item_info['sales'] as $s_key => $i_sales) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $s_key + 1 ?></td>
|
||||
<td class="text-left"><?= $i_sales['name'] ?></td>
|
||||
<td><?= $i_sales['course_name'] ?></td>
|
||||
<td><?= $i_sales['qty'] ?></td>
|
||||
<td><?= number_format($i_sales['unit_price']) ?></td>
|
||||
<td><?= number_format($i_sales['total_amount']) ?></td>
|
||||
<td><?php $dateTime = explode(' ', $i_sales['sales_on']);
|
||||
echo $dateTime[0]; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th class="text-center">Total</th>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"></th>
|
||||
<th></th>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<!-- <button type="submit" id="itemAddBtn" class="btn btn-sm btn-outline-primary w-100 mt-4">Add</button> -->
|
||||
</div>
|
||||
</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() {
|
||||
|
||||
var currencySymbol = '<?= $school_info['currency_symbol'] ?>'
|
||||
|
||||
$('#tbl').DataTable({
|
||||
paging: false,
|
||||
ordering: true,
|
||||
info: false,
|
||||
bFilter: false,
|
||||
"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(3)
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Total over this page
|
||||
pageTotal = api
|
||||
.column(4, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
pageTotal5 = api
|
||||
.column(5, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Update footer
|
||||
$(api.column(3).footer()).html(total);
|
||||
// $(api.column(4).footer()).html(pageTotal);
|
||||
$(api.column(5).footer()).html(currencySymbol + '. ' + Intl.NumberFormat('en-IN').format((pageTotal5)));
|
||||
}
|
||||
});
|
||||
|
||||
$('#tbl2').DataTable({
|
||||
paging: false,
|
||||
ordering: true,
|
||||
info: false,
|
||||
bFilter: false,
|
||||
"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(3)
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Total over this page
|
||||
pageTotal = api
|
||||
.column(4, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
pageTotal5 = api
|
||||
.column(5, {
|
||||
page: 'current'
|
||||
})
|
||||
.data()
|
||||
.reduce(function(a, b) {
|
||||
return intVal(a) + intVal(b);
|
||||
}, 0);
|
||||
|
||||
// Update footer
|
||||
$(api.column(3).footer()).html(total);
|
||||
// $(api.column(4).footer()).html(pageTotal);
|
||||
$(api.column(5).footer()).html(currencySymbol + '. ' + Intl.NumberFormat('en-IN').format((pageTotal5)));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
177
application/views/inventory/view-sales-detail.php
Normal file
177
application/views/inventory/view-sales-detail.php
Normal file
@ -0,0 +1,177 @@
|
||||
<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;
|
||||
}
|
||||
|
||||
label .error {
|
||||
top: 2.5rem !important;
|
||||
color: red;
|
||||
left: 0em;
|
||||
}
|
||||
|
||||
.display tr {
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
table.dataTable thead th,
|
||||
table.dataTable thead td {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
</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"><a href="<?= base_url() . 'admin/inventory/item-sales' ?>">Sales</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="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-right">
|
||||
<h6 id="available-stock"> </h6>
|
||||
</div>
|
||||
<div class="h6">Student Details</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="s_name" value="<?= $sales_detail['name'] ?>" class="form-control bg-white" id="s_name" placeholder="Class" readonly>
|
||||
<span>Student</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="s_class" value="<?= $sales_detail['course_name'] ?>" class="form-control bg-white" id="s_class" placeholder="Class" readonly>
|
||||
<span>Class</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="s_section" value="<?= $sales_detail['section_name'] ?>" class="form-control bg-white" id="s_section" placeholder="Class" readonly>
|
||||
<span>Section</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<div class="h6">Item Details</div>
|
||||
<div class="form-group mt-3">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_title" value="<?= $sales_detail['title'] ?>" class="form-control bg-white" id="i_title" placeholder="Item" readonly>
|
||||
<span>Item</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_qty" value="<?= $sales_detail['qty'] ?>" class="form-control bg-white" id="i_qty" placeholder="Quantity" readonly>
|
||||
<span>Quantity</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_price" value="<?= $sales_detail['unit_price'] ?>" class="form-control bg-white" id="i_price" placeholder="Price" readonly>
|
||||
<span>Price</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label class="has-float-label">
|
||||
<input type="text" name="i_total_amt" value="<?= $sales_detail['total_amount'] ?>" class="form-control bg-white" id="i_total_amt" placeholder="Total Amount" readonly>
|
||||
<span>Total Amount</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <button type="submit" id="itemAddBtn" class="btn btn-sm btn-outline-primary w-100 mt-4">Add</button> -->
|
||||
</div>
|
||||
</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> -->
|
Reference in New Issue
Block a user