748 lines
35 KiB
PHP
748 lines
35 KiB
PHP
<?php
|
|
include ('techsyn_header.php');
|
|
include ('log_entry.php');
|
|
$Rolecodes = explode(',', $_SESSION['RoleCode']);
|
|
error_log($_SESSION['RoleCode'] . 'xxxx' . in_array('STR', $Rolecodes));
|
|
if (in_array('STR', $Rolecodes) == 0) {
|
|
echo "<script>location.href='accessDenied.php'</script>";
|
|
}
|
|
?>
|
|
<link rel="stylesheet" href="css/wizard.css">
|
|
|
|
|
|
<script src="js/Chart.min.js"></script>
|
|
<script type="text/javascript"
|
|
src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.4.0/dist/chartjs-plugin-datalabels.min.js"></script>
|
|
|
|
|
|
<style type="text/css">
|
|
.hidden-radio {
|
|
position: absolute;
|
|
top: 11px;
|
|
left: 27px;
|
|
width: 60px;
|
|
height: 60px;
|
|
border-radius: 100%;
|
|
background: #fff;
|
|
opacity: 0;
|
|
cursor: pointer;
|
|
}
|
|
|
|
button:focus {
|
|
outline-color: black;
|
|
}
|
|
|
|
#nearExpiringMedicineTable th:nth-child(1),
|
|
#nearExpiringMedicineTable td:nth-child(1) {
|
|
max-width: 14rem;
|
|
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
.table-background-white {
|
|
background-color: white;
|
|
}
|
|
</style>
|
|
|
|
<!-- Main Content Container for side bar and body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) { }
|
|
</script>
|
|
<?php include ('techsyn_sidebar.php'); ?>
|
|
|
|
<!--breadcrumb-->
|
|
<?php
|
|
$sql_procure_items = "select * from procurement_items where isExpired='0' and expiry < (CURRENT_DATE + INTERVAL 30 DAY) and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' order by expiry asc";
|
|
error_log('query: 19: ' . $sql_procure_items);
|
|
$results_procure_items = mysqli_query($conn, $sql_procure_items);
|
|
$total_proc = mysqli_num_rows($results_procure_items);
|
|
|
|
//added on 04-12-2021 - start
|
|
$ohc_type = $_SESSION['current_ohcttype'];
|
|
$sql_count_stock_in = "select ifNull(count(*),0) from stock_issue where status='Y' and stock_issue_id not in (SELECT issue_id FROM `received_master`) and ohc_location_id in ($ohc_type)";
|
|
error_log('query:va: ' . $sql_count_stock_in);
|
|
$results_stock_in_items = mysqli_query($conn, $sql_count_stock_in);
|
|
|
|
$total_stock_in_row = mysqli_fetch_array($results_stock_in_items);
|
|
$total_stock_in = $total_stock_in_row[0];
|
|
|
|
error_log("total_stock_in: " . $total_stock_in);
|
|
// end
|
|
|
|
$total_item = NearExpryItemsCount();
|
|
$total_item_amb = NearExpryItemsCountForAmbulance();
|
|
|
|
?>
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
<li><i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a>
|
|
</li>
|
|
<li class="active">Dashboard</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
<div class="content">
|
|
<!-- Start new dashboard view -->
|
|
<div class="container-fluid">
|
|
|
|
<form id="store_form">
|
|
<div class="row" style="margin-top: 10px;">
|
|
<?php $Rolecodes = explode(',', $_SESSION['RoleCode']);
|
|
if (in_array('DIS', $Rolecodes)) { ?>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice" data-toggle="wizard-radio" rel="tooltip" title="OPDs"
|
|
data-original-title="OPDs">
|
|
<!-- <input type="radio" name="task" value="visitor_opd"> -->
|
|
<span class="info-box-icon bg-green "><input type="radio" name="task"
|
|
class="hidden-radio" value="opd"><i
|
|
class="ace-icon fa fa-plus-square"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Pending OPD Medicine</span>
|
|
<span class="info-box-number">
|
|
<?php echo getTodayOpdPendingPharamacyCount() ?>
|
|
<?php //echo getTodayOpdCount() ?>
|
|
<small>Cases</small>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice" data-toggle="wizard-radio" rel="tooltip" title="OPDs"
|
|
data-original-title="OPDs">
|
|
<!-- <input type="radio" name="task" value="visitor_opd"> -->
|
|
<span class="info-box-icon bg-green "><input type="radio" name="task"
|
|
class="hidden-radio" value="opd-total"><i
|
|
class="ace-icon fa fa-plus-square"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Total OPD</span>
|
|
<span class="info-box-number">
|
|
<?php //echo getTodayOpdPendingPharamacyCount() ?>
|
|
<?php echo getTodayOpdCount() ?>
|
|
<small>Cases</small>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<!-- /.col -->
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice mb-3">
|
|
<span class="info-box-icon bg-red "><input type="radio" name="task"
|
|
class="hidden-radio" value="injury"><i
|
|
class="ace-icon fa fa-plus-square"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Pending Injury Medicine</span>
|
|
<span class="info-box-number">
|
|
<?php echo getTodayInjuryPendingPharamacyCount() ?>
|
|
<?php //echo getTodayInjuryCount() ?>
|
|
<small>Cases</small>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice mb-3">
|
|
<span class="info-box-icon bg-red "><input type="radio" name="task"
|
|
class="hidden-radio" value="injury-total"><i
|
|
class="ace-icon fa fa-plus-square"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Total Injury</span>
|
|
<span
|
|
class="info-box-number"><?php //echo getTodayInjuryPendingPharamacyCount() ?>
|
|
<?php echo getTodayInjuryCount() ?>
|
|
<small>Cases</small>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice" data-toggle="wizard-radio" rel="tooltip" title="OPDs"
|
|
data-original-title="OPDs">
|
|
<!-- <input type="radio" name="task" value="visitor_opd"> -->
|
|
<span class="info-box-icon bg-green "><input type="radio" name="task"
|
|
class="hidden-radio" value="pendingPurachase"><i
|
|
class="ace-icon fa fa-plus-square"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Pending Purchase Items</span>
|
|
<span class="info-box-number">
|
|
<?php echo PendingPurchaseItems() ?>
|
|
<small>Items</small>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<!-- /.col -->
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice mb-3">
|
|
<span class="info-box-icon bg-green "><input type="radio" name="task"
|
|
class="hidden-radio" value="Design"><i
|
|
class="ace-icon fa fa-plus-square"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Items Stock</span>
|
|
<span class="info-box-number"><?php echo getTotalStockCount() ?>
|
|
<small>Items</small>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<!-- /.col -->
|
|
<!-- fix for small devices only -->
|
|
<!-- <div class="clearfix hidden-md-up"></div> -->
|
|
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice mb-3">
|
|
<span class="info-box-icon bg-green "><input type="radio" name="task"
|
|
class="hidden-radio" value="Code"><i
|
|
class="ace-icon fa fa-opencart"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Items Inward In Stock</span> <span
|
|
class="info-box-number"><?php echo getTodayProcurementCount() ?>
|
|
<small>Items</small></span>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3 choice">
|
|
<span class="info-box-icon bg-red"><input type="radio" name="task"
|
|
class="hidden-radio" value="stock"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Issued Items From Stock</span>
|
|
<span class="info-box-number"><?php echo getTodayIssueCount() ?>
|
|
<small>Items</small></span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
|
|
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3 choice">
|
|
<span class="info-box-icon bg-red"><input type="radio" name="task"
|
|
class="hidden-radio" value="exp"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Near Expiring Medicine</span>
|
|
<span class="info-box-number"><?php echo $total_item ?>
|
|
<small>Items</small></span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3 choice">
|
|
<span class="info-box-icon bg-red"><input type="radio" name="task"
|
|
class="hidden-radio" value="expiry"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Expiry Items</span>
|
|
<span class="info-box-number"><?php echo getExpiredMedCount() ?>
|
|
<small>Items</small></span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<!-- /.col -->
|
|
|
|
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3 choice">
|
|
<span class="info-box-icon bg-red"><input type="radio" name="task"
|
|
class="hidden-radio" value="indent"><i
|
|
class="fa fa-shopping-cart"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Indents</span>
|
|
<span class="info-box-number"><?php echo getIndentCount() ?>
|
|
<small>Items</small></span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3 choice">
|
|
<span class="info-box-icon bg-red"><input type="radio" name="task"
|
|
class="hidden-radio" value="shift"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Staff Handover Notes</span>
|
|
<span class="info-box-number"> <small>Current Shift :
|
|
<?php echo getCurrentShift() ?></small></span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3 choice">
|
|
<span class="info-box-icon bg-red"><input type="radio" name="task" class="hidden-radio" value="ambExpiry"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Ambulance Expiry Items</span>
|
|
<span class="info-box-number"><?php echo getExpiredMedCount() ?>
|
|
<small>Items</small></span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box mb-3 choice">
|
|
<span class="info-box-icon bg-red"><input type="radio" name="task" class="hidden-radio" value="ambExp"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Ambulance Near Expiring Medicine</span>
|
|
<span class="info-box-number"><?php echo $total_item_amb ?>
|
|
<small>Items</small></span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-3">
|
|
<div class="info-box choice mb-3">
|
|
<span class="info-box-icon bg-green "><input type="radio" name="task" class="hidden-radio" value="ambItemStock"><i class="ace-icon fa fa-plus-square"></i></span>
|
|
|
|
<div class="info-box-content"><br>
|
|
<span class="info-box-text">Ambulance Item Stock</span>
|
|
<span class="info-box-number"><?php echo getTotalStockCountAmbulance() ?>
|
|
<small>Items</small>
|
|
</span>
|
|
</div>
|
|
<!-- /.info-box-content -->
|
|
</div>
|
|
<!-- /.info-box -->
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
<!-- medicines pending purchase -->
|
|
<div class="col-sm-6" style="padding-top: 30px;margin-left: 1rem;">
|
|
<div class="box box-success">
|
|
<div class="box-header box-header-flat clickable" id="medicineTableHeader">
|
|
<h5 class="box-title lighter">
|
|
<a role="button" data-toggle="collapse" href="#collapse_medicine_table"
|
|
aria-expanded="false" aria-controls="collapseOne">
|
|
Medicines Pending Purchase (Total :<span
|
|
id="total"><?php echo PendingPurchaseItems() ?></span>)
|
|
</a>
|
|
</h5>
|
|
</div>
|
|
|
|
<div id="collapse_medicine_table" class="panel-collapse collapse">
|
|
<div id="medicine_table_content">
|
|
|
|
<div id="medicineTableLoadingIcon" style="display: none;">
|
|
<img src="assets/images/loading-spinner.gif" alt="Loading..." />
|
|
</div>
|
|
|
|
<table class="table table-bordered table-hover" id="medicineTable">
|
|
<thead class="thin-border-bottom">
|
|
<tr>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Item</th>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Available Qty</th>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Min. Qty</th>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Reorder. Qty</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- nearly exipring -->
|
|
<div class="col-sm-5" style="padding-top: 30px;">
|
|
<div class="box box-success">
|
|
<div class="box-header box-header-flat clickable" id="nearExpiringMedicineHeader">
|
|
<h5 class="box-title lighter">
|
|
<a role="button" data-toggle="collapse" href="#collapse_check3"
|
|
aria-expanded="false" aria-controls="collapseOne">
|
|
Near Expiring Medicine (Total :<span
|
|
id="totalItem"><?php echo $total_item; ?></span>)
|
|
</a>
|
|
|
|
</h5>
|
|
</div>
|
|
|
|
<div id="collapse_check3" class="panel-collapse collapse">
|
|
<div id="collapse_check3_content">
|
|
|
|
<div id="nearExpiringMedicineLoadingIcon" style="display: none;">
|
|
<img src="assets/images/loading-spinner.gif" alt="Loading..." />
|
|
</div>
|
|
|
|
<table class="table table-bordered table-hover" id="nearExpiringMedicineTable">
|
|
<thead class="thin-border-bottom">
|
|
<tr>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Item</th>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Available Qty</th>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Batch</th>
|
|
<th><i class="ace-icon fa fa-caret-right blue"></i>Expiry date</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<!-- /.page-content -->
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6" style="padding-top: 30px; margin-left: 10px">
|
|
<div class="box box-success">
|
|
<div class="box-header box-header-flat clickable" id="pieChartHeader">
|
|
<h5 class="box-title lighter" style="cursor: pointer; color:#3c8dbc ;">
|
|
Top 10 Medicines
|
|
</h5>
|
|
</div>
|
|
<div id="collapse_check2" class="panel-collapse collapse">
|
|
<div id="medicineChartContainer">
|
|
<canvas id="piechart" width="1000" height="1000"></canvas>
|
|
<div id="medicineLoadingIcon" style="display: none;">
|
|
<img src="assets/images/loading-spinner.gif" alt="Loading..." />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.main-content -->
|
|
|
|
|
|
</div>
|
|
<?php include ('form/direct_checkup_selector.php'); ?>
|
|
<?php include ('techsyn_footer.php'); ?>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
var chartLoaded = false;
|
|
|
|
$('#pieChartHeader').click(function () {
|
|
$('#collapse_check2').toggle();
|
|
|
|
if (!chartLoaded && $('#collapse_check2').is(':visible')) {
|
|
showLoadingIcon(true, 'medicineLoadingIcon');
|
|
|
|
$.ajax({
|
|
url: 'medicine_details_chart.php',
|
|
type: 'GET',
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
// console.log(data )
|
|
drawMedicineChart('piechart', data);
|
|
chartLoaded = true;
|
|
showLoadingIcon(false, 'medicineLoadingIcon');
|
|
},
|
|
error: function (xhr, status, error) {
|
|
showLoadingIcon(false, 'medicineLoadingIcon');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
function showLoadingIcon(show, loadingIconId) {
|
|
document.getElementById(loadingIconId).style.display = show ? 'block' : 'none';
|
|
}
|
|
|
|
function drawMedicineChart(chartId, data) {
|
|
// console.log(data);
|
|
|
|
if (data !== null && data.labels && data.data) {
|
|
var labels = data.labels;
|
|
var chartData = data.data;
|
|
|
|
var options = {
|
|
responsive: true,
|
|
legend: {
|
|
position: 'bottom'
|
|
},
|
|
plugins: {
|
|
datalabels: {
|
|
formatter: function (value, ctx) {
|
|
let sum = chartData.reduce((acc, val) => acc + val, 0);
|
|
let percentage = ((value / sum) * 100).toFixed(1) + '%';
|
|
return percentage;
|
|
},
|
|
color: '#000',
|
|
font: {
|
|
size: 11
|
|
},
|
|
}
|
|
}
|
|
};
|
|
|
|
var ctx = document.getElementById(chartId).getContext('2d');
|
|
|
|
|
|
if (window.myMedicineChart) {
|
|
window.myMedicineChart.destroy();
|
|
}
|
|
|
|
|
|
window.myMedicineChart = new Chart(ctx, {
|
|
type: 'pie',
|
|
data: {
|
|
labels: labels,
|
|
datasets: [{
|
|
data: chartData,
|
|
label: "Medicine",
|
|
backgroundColor: [
|
|
'#f56954', '#00a65a', '#f39c12', '#00c0ef', '#3c8dbc', '#d2d6de',
|
|
"#FF3383", "#33A4FF", "#43FF33", "#B9FF33"
|
|
],
|
|
}]
|
|
},
|
|
options: options
|
|
});
|
|
|
|
console.log('Chart Initialized');
|
|
} else {
|
|
console.error('Invalid data format received:', data);
|
|
}
|
|
}
|
|
|
|
|
|
//medicines pending purchase
|
|
$(document).ready(function () {
|
|
var medicineTableLoaded = false;
|
|
|
|
$('#medicineTableHeader').click(function () {
|
|
toggleMedicineTable();
|
|
});
|
|
|
|
function toggleMedicineTable() {
|
|
$('#collapse_medicine_table').toggle();
|
|
if ($('#collapse_medicine_table').is(':visible') && !medicineTableLoaded) {
|
|
loadMedicineTable();
|
|
medicineTableLoaded = true;
|
|
}
|
|
}
|
|
|
|
function loadMedicineTable() {
|
|
$('#medicineTableLoadingIcon').show();
|
|
|
|
$.ajax({
|
|
url: 'medicine_list_table_store.php',
|
|
type: 'GET',
|
|
dataType: 'json',
|
|
data: {
|
|
limit: 10,
|
|
start: 0
|
|
},
|
|
success: function (response) {
|
|
displayMedicineTable(response);
|
|
$('#medicineTableLoadingIcon').hide();
|
|
},
|
|
error: function (xhr, status, error) {
|
|
console.error(error);
|
|
$('#medicineTableLoadingIcon').hide();
|
|
}
|
|
});
|
|
}
|
|
|
|
function displayMedicineTable(response) {
|
|
var data = response.data;
|
|
var tableBody = $('#medicineTable tbody');
|
|
tableBody.empty();
|
|
|
|
data.forEach(function (item) {
|
|
var row = '<tr>' +
|
|
'<td>' + item.item_name + '</td>' +
|
|
'<td>' + item.item_stock_qty + '</td>' +
|
|
'<td>' + item.min_store_level + '</td>' +
|
|
'<td>' + item.reorder_store_level + '</td>' +
|
|
'</tr>';
|
|
tableBody.append(row);
|
|
});
|
|
|
|
var dataTable = $('#medicineTable').DataTable();
|
|
var dataTableContainer = dataTable.table().container();
|
|
$(dataTableContainer).addClass('table-background-white');
|
|
}
|
|
});
|
|
|
|
|
|
|
|
//nearly expired
|
|
$(document).ready(function () {
|
|
var nearExpiringMedicineLoaded = false;
|
|
|
|
$('#nearExpiringMedicineHeader').click(function () {
|
|
toggleNearExpiringMedicine();
|
|
});
|
|
|
|
function toggleNearExpiringMedicine() {
|
|
$('#collapse_check3').toggle();
|
|
if ($('#collapse_check3').is(':visible') && !nearExpiringMedicineLoaded) {
|
|
loadNearExpiringMedicine();
|
|
nearExpiringMedicineLoaded = true;
|
|
}
|
|
}
|
|
|
|
function loadNearExpiringMedicine() {
|
|
$('#nearExpiringMedicineLoadingIcon').show();
|
|
|
|
$.ajax({
|
|
url: 'fetch_near_expiring_medicine.php',
|
|
type: 'GET',
|
|
dataType: 'json',
|
|
data: {
|
|
limit: 10,
|
|
start: 0
|
|
},
|
|
success: function (data) {
|
|
displayNearExpiringMedicine(data);
|
|
$('#nearExpiringMedicineLoadingIcon').hide();
|
|
},
|
|
error: function (xhr, status, error) {
|
|
console.error(error);
|
|
$('#nearExpiringMedicineLoadingIcon').hide();
|
|
}
|
|
});
|
|
}
|
|
|
|
function displayNearExpiringMedicine(data) {
|
|
var tableBody = $('#nearExpiringMedicineTable tbody');
|
|
tableBody.empty();
|
|
|
|
data.forEach(function (item) {
|
|
var row = '<tr>' +
|
|
'<td>' + item.item_name + '</td>' +
|
|
'<td>' + item.stock_qty + '</td>' +
|
|
'<td>' + item.item_batch_no + '</td>' +
|
|
'<td>' + item.expiry_date + '</td>' +
|
|
'</tr>';
|
|
tableBody.append(row);
|
|
});
|
|
|
|
var dataTable = $('#nearExpiringMedicineTable').DataTable();
|
|
var dataTableContainer = dataTable.table().container();
|
|
$(dataTableContainer).addClass('table-background-white');
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
$(".choice").on("click", function () {
|
|
var v = $(this).closest("div").find("input[name='task']").attr("checked", "checked");
|
|
task = $(this).closest("div").find("input[name='task']").val()
|
|
$("#store_form").attr('method', 'POST');
|
|
if (task == 'Design') {
|
|
$("#store_form").attr('action', 'stock_list.php');
|
|
} else if (task == 'opd') {
|
|
$("#store_form").attr('action', 'pending_medical_disbursement_list.php');
|
|
} else if (task == 'injury') {
|
|
$("#store_form").attr('action', 'pending_medical_disbursement_list_injury.php');
|
|
} else if (task == 'opd-total') {
|
|
$("#store_form").attr('action', 'opd_list.php');
|
|
} else if (task == 'injury-total') {
|
|
$("#store_form").attr('action', 'aod_list.php');
|
|
} else if (task == 'visitor_opd') {
|
|
$("#store_form").attr('action', 'visitor_pending_medical_disbursement_list.php');
|
|
} else if (task == 'Code') {
|
|
$("#store_form").attr('action', 'procurement_list.php');
|
|
} else if (task == 'stock') {
|
|
$("#store_form").attr('action', 'item_issue_list.php');
|
|
} else if (task == 'direct') {
|
|
$("#store_form").attr('action', 'direct_medicine_issue.php');
|
|
} else if (task == 'expiry') {
|
|
$("#store_form").attr('action', 'expiry_list.php');
|
|
} else if (task == 'indent') {
|
|
$("#store_form").attr('action', 'indent_form.php');
|
|
} else if (task == 'exp') {
|
|
$("#store_form").attr('action', 'pending_expiry_list.php');
|
|
}
|
|
else if (task == 'shift') {
|
|
$("#store_form").attr('action', 'communication_details.php');
|
|
}
|
|
else if (task == 'pendingPurachase') {
|
|
$("#store_form").attr('action', '#');
|
|
}else if (task == 'ambItemStock') {
|
|
$("#store_form").attr('action', 'ambulance_stock.php');
|
|
} else if (task == 'ambExp') {
|
|
$("#store_form").attr('action', 'pending_mis_expiry_list.php');
|
|
} else if (task == 'ambExpiry') {
|
|
$("#store_form").attr('action', 'mis_expiry_list.php');
|
|
}
|
|
|
|
|
|
$("#store_form").submit();
|
|
|
|
});
|
|
});
|
|
</script>
|