csrtechnew.ohctech.in/treatment_view_common_short.php
2025-04-14 13:28:09 +05:30

92 lines
3.4 KiB
PHP

<table class="table" style="width: 35%;" border="1" cellspacing="0">
<tr>
<td width="20%"><b>Medicine</b></td>
<td width="10%"><b>Dosage</b></td>
<td width="7%"><b>Days</b></td>
</tr>
<?php
$sql_treatment_items = "select distinct(item_id) as item from treatment where appointment_id='$appointment_id' and followup_id='$followup_id' and is_display!='N'";
error_log('tata' . $sql_treatment_items);
$res_treatment_items = mysqli_query($conn, $sql_treatment_items);
while ($rows_treatement_items = mysqli_fetch_array($res_treatment_items)) {
$sql_treatment = "select *,sum(issued_qty) as issued_qty from treatment where appointment_id='$appointment_id' and followup_id='$followup_id' and is_display!='N' and item_id='".$rows_treatement_items['item']."'";
$res_treatment = mysqli_query($conn, $sql_treatment);
$count = 0;
$total_pay_cost = 0;
while ($rows_treatment = mysqli_fetch_array($res_treatment)) {
$item_id = $rows_treatment['item_id'];
$visit_date = getFieldFromTable('appointment_date', 'employee_appointment', 'appointment_id', $appointment_id);
error_log("date getting :" . $visit_date);
$date_new = date_create($visit_date);
$visit_date = date_format($date_new, "Y-m-d");
error_log("date getting after formatting :" . $visit_date);
$form_name_query = "select mf.* from tbl_items tb left join medicine_form mf on tb.item_form_id = mf.form_id where tb.item_id='" . $item_id . "'";
error_log("checking if its qty is fixed or not " . $form_name_query);
$form_name_result = mysqli_query($conn, $form_name_query);
$form_name_qty = mysqli_fetch_assoc($form_name_result);
$form_name = $form_name_qty['form_code'];
$srno = $count + 1;
$unit_id = getFieldFromTable("unit_id", "tbl_items", "item_id", $item_id);
error_log("bcnxvchdvnhm" . $rows_treatment['timing_id']);
?>
<tr>
<td style="font-size: 10px"><?php echo ucwords(strtolower(getItemWithFormNamePdf($item_id))) ?></td>
<td style="font-size: 10px">
<?php echo strtoupper(getTableFieldValue('medicine_frequency', 'medicine_frequency', 'frequency_id', $rows_treatment['frequency_id'], '')); ?>
</td>
<td style="font-size: 10px"><?php echo $rows_treatment['for_days'] ?> &nbsp;&nbsp;Days</td>
</td>
</tr>
<?php
$count++;
}
}
$sql_treatment = "select * from treatment_external where appointment_id='" . $appointment_id . "'";
$result_for_treatment_external = mysqli_query($conn, $sql_treatment);
$num_rows_treatment_external = @mysqli_num_rows($result_for_treatment_external);
if ($num_rows_treatment_external) {
?>
<!-- <tr>
<td align="center" colspan="7"><b>Additional Treatments Recommended</b></td>
</tr> -->
<?php
}
while ($rows_treatment_external = mysqli_fetch_array($result_for_treatment_external)) {
$srno = $count + 1;
?>
<tr>
<td style="font-size: 12px"><?php echo strtoupper($rows_treatment_external['item_name']) ?></td>
<td style="font-size: 12px"><?php echo strtoupper($rows_treatment_external['dosage']) ?></td>
<td style="font-size: 12px"><?php echo $rows_treatment_external['for_days'] ?>Days</td>
</tr>
<?php
$count++;
}
?>
</table>