ohctech_p8/injury_pending.php
2024-10-16 19:18:52 +05:30

105 lines
3.8 KiB
PHP

<?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>Department</strong></th>
<th style="background-color:white" width="25%"><strong>Diagosis</strong></th>
<th style="background-color:white" width="20%"><strong>Due Date</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)) {
// Created_Date >= DATEADD(day,-7, GETDATE())
// $color='';
// $name = getFieldFromTable('patient_name', 'patient_master', 'id', $row['emp_id']);
// $task = getFieldFromTable('checkup_type_name','checkup_type', 'checkup_type_id', $row['task']);
// $checkup_date = date_format(date_create($row['checkup_date']), "d-M-Y");
// $deu_date = date("d-m-Y", strtotime($row['deu_date']));
// $today= date('d-m-Y');
// if( strtotime($today) > strtotime($deu_date) ){ $color='#e505055c'; }
// else {$color='white';}
// error_log( $row['checkup_id'] ."name " . $name . " task " . $task . " date checkup " . $checkup_date ." exp " . $deu_date . " color " . $color);
?>
<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>
<?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,"Y/m/d");
?>
<td width="30%"><?= $final_followup ?></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();
}
</script>