65 lines
2.7 KiB
PHP
65 lines
2.7 KiB
PHP
<?php
|
|
error_reporting(0);
|
|
include "../includes/config/config.php";
|
|
include "functions.php";
|
|
include 'log_entry.php';
|
|
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNING);
|
|
// include log entry header file
|
|
include('log_entry.php');
|
|
foreach ($_REQUEST as $key => $value) {
|
|
$requestStr .= $key . " : " . $value . "\n";
|
|
error_log($key . " : " . $value . "<br />\r\n" . var_dump($value));
|
|
}
|
|
|
|
|
|
|
|
// $appointment = getTableFieldValue('employee_appointment', 'appointment_id', 'ticket_no', "$ticNo");
|
|
$SqlAppointment = "SELECT appointment_id as id From employee_appointment where ticket_no = '". $_REQUEST["appointment_id"] ."' ";
|
|
$SqlQuerApp = mysqli_query($conn , $SqlAppointment);
|
|
$Fetch = mysqli_fetch_assoc($SqlQuerApp);
|
|
|
|
|
|
$Sqlfeq = "SELECT frequency_id as id From medicine_frequency where medicine_frequency = '". $_REQUEST["frequency_id"] ."' ";
|
|
$SqlQuer = mysqli_query($conn , $Sqlfeq);
|
|
$Fetchfreq = mysqli_fetch_assoc($SqlQuer);
|
|
|
|
|
|
$Sqldoc = "SELECT dosage_category_id as id From dosage_category where dosage_category = '". $_REQUEST["dosage_category_id"] ."' ";
|
|
$SqlQuerA = mysqli_query($conn , $Sqldoc);
|
|
$Fetchcat = mysqli_fetch_assoc($SqlQuerA);
|
|
|
|
$Sqltim = "SELECT timing_id as id From medicine_timings where timing_description = '". $_REQUEST["timing_id"] ."' ";
|
|
$SqlQue = mysqli_query($conn , $Sqltim);
|
|
$Fetchtiming = mysqli_fetch_assoc($SqlQue);
|
|
|
|
$SqlItem = "SELECT item_id as id From tbl_items where item_name = '".trim($_REQUEST["item_id"])."' ";
|
|
|
|
error_log($SqlAppointment);
|
|
error_log($SqlItem);
|
|
error_log($Sqlfeq);
|
|
error_log($Sqldoc);
|
|
error_log($Sqltim);
|
|
$QueryItem = mysqli_query($conn , $SqlItem);
|
|
$FetchItem = mysqli_fetch_assoc($QueryItem);
|
|
// $frequency_id = getTableFieldValue('medicine_frequency', 'frequency_description', 'frequency_id', "$_REQUEST['frequency_id']");
|
|
// $dosage_category_id = getTableFieldValue('dosage_category','dosage_category','dosage_category_id',$_REQUEST['dosage_category_id']);
|
|
// $timing_id =getTableFieldValue('medicine_timings', 'timing_description', 'timing_id', $_REQUEST['timing_id']);
|
|
|
|
// $item_id = getTableFieldValue('tbl_items', 'item_id', 'item_name', '$item_id');
|
|
$sql = "INSERT into treatment SET
|
|
appointment_id='" . $Fetch['id'] . "',
|
|
item_id='" . $FetchItem['id'] . "',item_qty='" . $_REQUEST["item_qty"] . "',
|
|
issued_qty='" . $_REQUEST["issued_qty"] . "',dosage='" . $_REQUEST["dosage"] . "',
|
|
for_days='" . $_REQUEST["for_days"] . "', frequency_id='" .$Fetchfreq['id'] . "', timing_id = '" . $Fetchtiming['id'] . "',
|
|
dosage_category_id='" . $Fetchcat['id']. "', modified_by='" . 43 . "'";
|
|
|
|
error_log("DM " . $sql);
|
|
if (!$result = mysqli_query($conn, $sql)) {
|
|
// When Getting Error
|
|
echo 1;
|
|
}else{
|
|
// when Success Run
|
|
echo 0;
|
|
}
|
|
|
|
?>
|