56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
|
<?php
|
||
|
$con= mysqli_connect("localhost","root","","tvs");
|
||
|
$response = array();
|
||
|
if(isset($_POST["patient_name"])){
|
||
|
$patient_name=$_POST["patient_name"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["emp_id"])){
|
||
|
$emp_id=$_POST["emp_id"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["madicine_name"])){
|
||
|
$madicine_name=$_POST["madicine_name"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["dose_frequency"])){
|
||
|
$dose_frequency=$_POST["dose_frequency"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["timing"])){
|
||
|
$timing=$_POST["timing"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["admin_route"])){
|
||
|
$admin_route=$_POST["admin_route"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["duration"])){
|
||
|
$duration=$_POST["duration"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["dose_qty"])){
|
||
|
$dose_qty=$_POST["dose_qty"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["total_qty"])){
|
||
|
$total_qty=$_POST["total_qty"];
|
||
|
}
|
||
|
else return;
|
||
|
if(isset($_POST["availevle_qty"])){
|
||
|
$availevle_qty=$_POST["availevle_qty"];
|
||
|
}
|
||
|
else return;
|
||
|
|
||
|
$query="INSERT INTO `addmedicine`( `patient_name`, `emp_id`, `madicine_name`, `dose_frequency`, `timing`, `admin_route`, `duration`, `dose_qty`, `total_qty`, `availevle_qty`)
|
||
|
VALUES ('$patient_name','$emp_id','$madicine_name','$dose_frequency','$timing','$admin_route','$duration','$dose_qty','$total_qty','$availevle_qty')";
|
||
|
$exe=mysqli_query($con,$query);
|
||
|
|
||
|
$arr=[];
|
||
|
if($exe){
|
||
|
$arr["sucess"]="true";
|
||
|
}else{
|
||
|
$arr["sucess"]="false";
|
||
|
}
|
||
|
print(json_encode($arr))
|
||
|
?>
|