ESH/injury_pending.php

209 lines
6.9 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php
include('log_entry.php');
?>
<table class="table m-0">
<thead>
<tr style="color:black;">
<th style="background-color:white" width="6%"><strong>Sr.</strong></th>
<th style="background-color:white" width="10%"><strong>Ecode/Gpass</strong></th>
<th style="background-color:white" width="25%"><strong>Name</strong></th>
<th style="background-color:white" width="25%"><strong>Ticket No</strong></th>
<!-- <th style="background-color:white" width="25%"><strong>Department</strong></th> -->
<th style="background-color:white" width="25%"><strong>Diagnosis</strong></th>
<th style="background-color:white" width="20%"><strong>Due Date</strong></th>
<th style="background-color:white" width="20%"><strong>Followup</strong></th>
</tr>
</thead>
<tbody>
<?php
$date =date('Y-m-d', strtotime('+1 week'));
$now_date =date('Y-m-d');
$sql = "select 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' ";
// where emp_id in (select id from patient_master where `status`='Active') and deu_date !='0000-00-00' and deu_date <= curdate() + interval 30 day group by emp_id order by emp_id
error_log("query for due date ".$sql);
$result = mysqli_query($conn, $sql);
?>
<?php
$i = 1;
while ($row = mysqli_fetch_array($result)) {
$emp_id = $row['emp_id'];
$appointment_id = $row['appointment_id'];
$appointment_type = $row['appointment_type'];
$edit_link = $space . "<a href=\"#\" class=\"blue\" onclick=\"open_employee_appointment_task('" . $appointment_id . "','" . $appointment_type . "','" . $emp_id . "','F','');\"><i class=\"ace-icon fa fa-edit\" style=\"font-size: 15px;\"></i></a>";
?>
<tr style="background-color:<?= $color ?> ;" onclick="forward( <?= $row['emp_id'] ?>,'V' )">
<td width="6%"><?= $i ?></td>
<td width="25%"><?= $row['emp_code'] ?></td>
<td width="25%"><?= $row['patient_name'] ?></td>
<td width="25%"><?= $row['ticket_no'] ?></td>
<?php $dept = $row['dept_id'] ?>
<!-- <td width="25%"><?= getTableFieldValue('department','dept_name','dept_id',$dept) ?></td> -->
<?php $ailment = $row['ailments_new'] ?>
<td width="25%"><?= getTableFieldValue('ailment','ailment_name','ailment_id',$ailment) ?></td>
<?php
$followup=date_create($row['followup']);
$final_followup = date_format($followup,"d/m/Y");
?>
<td width="30%"><?= $final_followup ?></td>
<td width="30%"><?= $edit_link ?></td>
<!-- <td><?= $deu_date ?></td> -->
<?php $i++; ?>
</tr>
<?php
}
?>
</tbody>
</table>
<form name="flex_approved_patient_form" method="post" action="" id="flex_approved_patient_form">
<input type="hidden" name="emp_id" id="emp_id">
<input type="hidden" name="accessOption" id="accessOption">
<div id="flex1" style="width: 100%">
</div>
</form>
<script>
// function forward(id, action) {
// $("#emp_id").val(id);
// $("#accessOption").val(action);
// $("#flex_approved_patient_form").attr('method', 'POST');
// if (action == 'V') {
// $("#flex_approved_patient_form").attr('action', 'view_employee_details.php');
// } else if (action == 'E') {
// $("#flex_approved_patient_form").attr('action', 'edit_employee_details.php');
// }
// $("#flex_approved_patient_form").submit();
// }
function open_employee_appointment_task(appointmentId, appointment_type, emp_id, action, follow_up) {
if (appointment_type == "O") {
if (action == 'V') {
document.forms['task_form'].action = "view_opd.php";
} else if (action == 'E' || action == 'F') {
document.forms["task_form"].action = "edit_opd.php";
}
} else if (appointment_type == "I") {
if (action == 'V') {
document.forms['task_form'].action = "view_injury.php";
} else if (action == 'E' || action == 'F') {
document.forms['task_form'].action = "edit_injury.php";
}
}
$("#task_form").method = "post";
if (action == 'F') {
$("#task_form").append(jQuery('<input>', {
'name': 'followup_to_opd',
'id': 'followup_to_opd',
'value': appointmentId,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'followup_id',
'id': 'followup_id',
'value': follow_up,
'type': 'hidden'
}));
} else {
$("#task_form").append(jQuery('<input>', {
'name': 'appointmentId',
'id': 'appointmentId',
'value': appointmentId,
'type': 'hidden'
}));
}
$("#task_form").append(jQuery('<input>', {
'name': 'emp_id',
'id': 'emp_id',
'value': emp_id,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': emp_id,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': "appointment_list.php",
'type': 'hidden'
}));
$("#task_form").submit();
}
function open_direct_checkup(checkupId, empId, action, checkup_type_id) {
//window.location = 'checkup.php?checkup_id='+checkupId+'';
console.log(checkupId + ':' + empId + ' ; ' + action + ' : ' + checkup_type_id);
if (checkupId != null && checkupId != '') {
oFormObject = document.forms['task_form'];
$("#task_form").append(jQuery('<input>', {
'name': 'flex_checkup_id',
'id': 'flex_checkup_id',
'value': checkupId,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'checkup_type_id_db',
'id': 'checkup_type_id_db',
'value': checkup_type_id,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'emp_id_history',
'id': 'emp_id_history',
'value': empId,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'toPage',
'id': 'toPage',
'value': action,
'type': 'hidden'
}));
$("#task_form").attr('method', 'POST');
$("#task_form").attr('action', 'checkup_from_before.php');
$("#task_form").submit();
}
}
</script>