32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
|
$con= mysqli_connect("localhost","root","","tvs");
|
|
$response = array();
|
|
|
|
$sql_opd = "SELECT * FROM treatment";
|
|
if (!empty($limit)) {
|
|
$sql_opd .= "ORDER BY a.appointment_id DESC LIMIT $page , $limit";
|
|
}
|
|
|
|
if (!empty($search)) {
|
|
$sql_opd .= "and ( b.patient_name like '%$search%' or b.emp_code like '%$search%')";
|
|
}
|
|
|
|
$result=mysqli_query($con,$sql_opd);
|
|
if($result) {
|
|
$i=0;
|
|
while($row = mysqli_fetch_assoc($result)){
|
|
|
|
$response[$i]['appointment_id'] = $row['appointment_id'];
|
|
$response[$i]['item_id'] = $row['item_id'];
|
|
$response[$i]['frequency_id'] = $row['frequency_id'];
|
|
$response[$i]['for_days'] = $row['for_days'];
|
|
$response[$i]['item_qty'] = $row['item_qty'];
|
|
$response[$i]['issued_qty'] = $row['issued_qty'];
|
|
$response[$i]['dosage'] = $row['dosage'];
|
|
$response[$i]['dosage_category_id'] = $row['dosage_category_id'];
|
|
$response[$i]['timing_id'] = $row['timing_id'];
|
|
$i++;
|
|
}
|
|
echo json_encode($response, JSON_PRETTY_PRINT);
|
|
}
|