390 lines
13 KiB
PHP
390 lines
13 KiB
PHP
<?php
|
||
include('techsyn_header.php');
|
||
include('log_entry.php');
|
||
if (!isset($_SESSION['RoleCode']) || $_SESSION['RoleCode'] != "DIS") {
|
||
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;
|
||
}
|
||
</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) 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
|
||
$c = $_SESSION['current_ohcttype'];
|
||
$sql_reorder_items = "SELECT count(i.item_id) as total from tbl_items i left join (select item_id, stock_qty from item_stock_dispensary isd where ohc_location_id='$c') d on i.item_id=d.item_id where stock_qty =0.00 AND status='1' order by i.item_id";
|
||
|
||
// error_log('query: 262626262 ' . $sql_reorder_items);
|
||
$results_reorder_items = mysqli_query($conn, $sql_reorder_items);
|
||
$total = mysqli_fetch_assoc($results_reorder_items);
|
||
// $total = mysqli_num_rows($results_reorder_items);
|
||
|
||
|
||
?>
|
||
<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="dispensary_form">
|
||
<div class="row" style="margin-top: 10px;">
|
||
<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">OPD Pending 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>
|
||
<!-- /.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="opd"><i class="ace-icon fa fa-plus-square"></i></span>
|
||
|
||
<div class="info-box-content"><br>
|
||
<span class="info-box-text">Injury Pending 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>
|
||
<!-- /.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="stockin"><i class="ace-icon fa fa-opencart"></i></span>
|
||
|
||
<div class="info-box-content"><br>
|
||
<span class="info-box-text">Stock In</span> <span class="info-box-number"><?php echo $total_stock_in ?> <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="shift"><i class="fa fa-clock-o"></i></span>
|
||
|
||
<div class="info-box-content"><br>
|
||
<span class="info-box-text">SHIFT</span>
|
||
<span class="info-box-number"> <small>Current Shift : <?php echo getCurrentShift() ?></small></span>
|
||
</div>
|
||
<!-- /.info-box-content -->
|
||
</div>
|
||
<!-- /.info-box -->
|
||
</div>
|
||
|
||
|
||
<!-- /.col -->
|
||
</div>
|
||
<!-- /.row -->
|
||
</form>
|
||
</div>
|
||
|
||
|
||
<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">
|
||
<h5 class="box-title lighter">
|
||
<a role="button" data-toggle="collapse" href="#collapse_check" aria-expanded="false" aria-controls="collapseOne" id="ali">
|
||
Medicines Pending Purchase - (Total :<?php echo $total['total']; ?>)
|
||
</a>
|
||
|
||
</h5>
|
||
|
||
|
||
</div>
|
||
<div id="collapse_check" class="panel-collapse collapse">
|
||
<div id="collapse_check">
|
||
<table class="table table-bordered table-hover">
|
||
<thead class="thin-border-bottom">
|
||
<tr>
|
||
<th style="background-color:white; color:black"><i class="ace-icon fa fa-caret-right blue"></i>Item</th>
|
||
|
||
<th style="background-color:white; color:black"><i class="ace-icon fa fa-caret-right blue"></i>Available
|
||
Qty</th>
|
||
<th style="background-color:white; color:black"><i class="ace-icon fa fa-caret-right blue"></i>Min. Qty
|
||
</th>
|
||
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody id="loaddata">
|
||
|
||
</tbody>
|
||
</table>
|
||
<!-- /.box-main -->
|
||
</div>
|
||
<script>
|
||
$( document ).ready(function() {
|
||
|
||
var limit = 5;
|
||
if (limit == 5) {
|
||
$("#load").attr('value','Show Data');
|
||
}
|
||
});
|
||
</script>
|
||
<center>
|
||
<input name="load" id="load" class="form-control btn btn-primary" type="submit" value="Load More" onClick="loadmore()">
|
||
</center>
|
||
<script>
|
||
var limit = 0;
|
||
var starting = 0;
|
||
// var limit = 5;
|
||
// // $("#load").inner('Loading.....');
|
||
// const myTimeout = setTimeout(loadmore, 2000);
|
||
function loadmore(){
|
||
// limit = 0;
|
||
// var starting = 0;
|
||
$("#load").attr('value', 'Loading.....');
|
||
// starting= 0;
|
||
|
||
limit +=10;
|
||
starting = limit - 10;
|
||
console.log(starting);
|
||
console.log("starting " + starting);
|
||
$.ajax({
|
||
url:'medicine_list_table.php',
|
||
data:{limit:limit , start:starting},
|
||
success: function(data) {
|
||
if (data == 0) {
|
||
console.log("btn");
|
||
$("#load").attr('value', 'Data Over');
|
||
}else{
|
||
var d = JSON.parse(data);
|
||
var html='';
|
||
|
||
jQuery.each(d, function(index, item) {
|
||
console.log(item.item_id);
|
||
html +='<tr><td style="color:#FF4233">'+item.item_name+'</td><td style="color:#FF4233">'+item.stock_qty+'</td><td style="color:#FF4233">'+item.reorder_dispensary_level+'</td></tr>';
|
||
});
|
||
$("#loaddata").append(html);
|
||
}
|
||
}
|
||
});
|
||
// $("#load").inner('LOAD MORE');
|
||
$("#load").attr('value', 'LOAD MORE');
|
||
|
||
}
|
||
</script>
|
||
<!-- /.box-body -->
|
||
</div>
|
||
</div>
|
||
<!-- /.box-box -->
|
||
</div>
|
||
|
||
<div class="col-sm-5 " style="padding-top: 30px;">
|
||
<div class="box box-success ">
|
||
<div class="box-header box-header-flat">
|
||
<h5 class="box-title lighter">
|
||
<a role="button" data-toggle="collapse" href="#collapse_check2" aria-expanded="false" aria-controls="collapseOne">
|
||
SUMMARY STATISTICS LIST <?php echo date('d-m-Y'); ?>
|
||
</a>
|
||
|
||
</h5>
|
||
</div>
|
||
<div id="collapse_check2" class="panel-collapse collapse">
|
||
|
||
<?php include 'communication_details_dashboard_card.php'; ?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- /.row -->
|
||
|
||
<div class="row">
|
||
<div class="col-sm-6 " style="padding-top: 30px;margin-left: 10px">
|
||
<div class="box box-info">
|
||
<div class="box-header box-header-flat">
|
||
<h5 class="box-title lighter">
|
||
<a role="button" data-toggle="collapse" href="#collapse_check4" aria-expanded="false" aria-controls="collapse_check4">
|
||
OSI weekly report
|
||
</a>
|
||
|
||
</h5>
|
||
</div>
|
||
<div id="collapse_check4" class="panel-collapse collapse">
|
||
<canvas id="patienDetailsChart" style="width:100%;max-width:600px"></canvas>
|
||
<?php include 'chart_OSI_weekly_report.php'; ?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-5 " style="padding-top: 30px;">
|
||
<div class="box box-success ">
|
||
<div class="box-header box-header-flat">
|
||
<h5 class="box-title lighter">
|
||
<a role="button" data-toggle="collapse" href="#collapse_check5" aria-expanded="false" aria-controls="collapse_check5">
|
||
Injury Types
|
||
</a>
|
||
|
||
</h5>
|
||
</div>
|
||
<div id="collapse_check5" class="panel-collapse collapse">
|
||
<canvas id="chart_monthly_injury" style="width:100%;max-width:600px"></canvas>
|
||
<?php include 'chart_monthly_injury.php'; ?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<!-- /.row -->
|
||
|
||
</div>
|
||
|
||
<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">
|
||
<h5 class="box-title lighter">
|
||
<a role="button" data-toggle="collapse" href="#collapse_check3" aria-expanded="false" aria-controls="collapseOne">
|
||
Top 10 medicines
|
||
</a>
|
||
|
||
</h5>
|
||
</div>
|
||
<div id="collapse_check3" class="panel-collapse collapse">
|
||
<canvas id="piechart" width="900" height="600"></canvas>
|
||
<?php include 'medicine_details_chart.php'; ?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-5 " style="padding-top: 30px;">
|
||
|
||
<?php
|
||
$date =date('Y-m-d', strtotime('+1 week'));
|
||
$now_date =date('Y-m-d');
|
||
$sql = "select count(appointment_id) as count, case_type,followup_remarks, patient_name,dept_id,emp_code ,e.id,appointment_id,ep.* ,ep.followup, ep.modified_by as mod_by from employee_appointment ep inner join patient_master e on e.id=ep.emp_id and ep.ohc_type_id='" . $_SESSION['current_ohcttype'] . "' where ep.followup BETWEEN '$now_date' AND '$date' ";
|
||
$result = @mysqli_query($conn,$sql);
|
||
$followup_count =mysqli_fetch_assoc($result);
|
||
|
||
?>
|
||
<div class="box box-success ">
|
||
<div class="box-header box-header-flat">
|
||
<h5 class="box-title lighter">
|
||
<a role="button" data-toggle="collapse" href="#collapse_check55" aria-expanded="false" aria-controls="collapseOne">
|
||
Follow-up Due Date - OPD/Injury <span class="badge badge-danger"><?php echo $followup_count['count'] ?></span>
|
||
</a>
|
||
|
||
</h5>
|
||
</div>
|
||
|
||
<div id="collapse_check55" class="panel-collapse collapse">
|
||
|
||
<?php include 'injury_pending.php'; ?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<!-- /.page-content -->
|
||
|
||
</div>
|
||
</div>
|
||
<!-- /.main-content -->
|
||
</div>
|
||
<?php include('techsyn_footer.php'); ?>
|
||
|
||
<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()
|
||
$("#dispensary_form").attr('method', 'POST');
|
||
if (task == 'opd' || task == 'injury') {
|
||
$("#dispensary_form").attr('action', 'pending_medical_disbursement_list.php');
|
||
} else if (task == 'visitor_opd') {
|
||
$("#dispensary_form").attr('action', 'visitor_pending_medical_disbursement_list.php');
|
||
} else if (task == 'expiry') {
|
||
$("#dispensary_form").attr('action', 'pending_expiry_list.php');
|
||
} else if (task == 'stockin') {
|
||
$("#dispensary_form").attr('action', 'pending_item_received_list.php');
|
||
} else if (task == 'direct') {
|
||
$("#dispensary_form").attr('action', 'direct_medicine_issue.php');
|
||
} else if (task == 'shift') {
|
||
$("#dispensary_form").attr('action', 'communication_details.php');
|
||
}
|
||
|
||
|
||
$("#dispensary_form").submit();
|
||
|
||
});
|
||
});
|
||
</script>
|