121 lines
3.1 KiB
PHP
121 lines
3.1 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('includes/functions.php');
|
|
include('log_entry.php');
|
|
$noOfRows=$_POST['count_items'];
|
|
|
|
//error_log("rows: ".$noOfRows);
|
|
|
|
$patient_id = $_REQUEST['patient_id'];
|
|
$question_id = $_POST['question_id'];
|
|
$question_hindi = $_POST['question_hindi'];
|
|
$answer = $_POST['answer'];
|
|
$recommendation = $_POST['recommendation'];
|
|
$q1 = $_POST['q1'];
|
|
$q2 = $_POST['q2'];
|
|
$q3 = $_POST['q3'];
|
|
$q4 = $_POST['q4'];
|
|
$q5 = $_POST['q5'];
|
|
$q6 = $_POST['q6'];
|
|
$q7 = $_POST['q7'];
|
|
$q8 = $_POST['q8'];
|
|
$q9 = $_POST['q9'];
|
|
$q10 = $_POST['q10'];
|
|
$q11 = $_POST['q11'];
|
|
$q12 = $_POST['q12'];
|
|
$q13 = $_POST['q13'];
|
|
$rac_test = $_POST['rac_test'];
|
|
$rac_result = $_POST['rac_result'];
|
|
|
|
|
|
//error_log($pulse);
|
|
|
|
//$question_id = $_REQUEST['question_id'];
|
|
// $dis_agncy = $_POST['dis_agncy'];
|
|
//error_log('1');
|
|
//echo "hello".$noOfRows;
|
|
|
|
//
|
|
//echo $sql_ifexists;
|
|
|
|
// $result_ifexists = mysqli_query($conn,$sql_ifexists );
|
|
// echo "adarsh";
|
|
// $exists = @mysqli_num_rows($result_ifexists);
|
|
// echo "existing rows:".$exists;
|
|
// if($exists>0){
|
|
// $del_qry="delete from covid_questionaire where question_id = '".$question_id."'";
|
|
|
|
// echo $del_qry;
|
|
// mysqli_query($conn,$del_qry);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//$question_id = $_POST['question_id'];
|
|
|
|
|
|
// $question_id_str="question_id".$i;
|
|
// $question_id=$_REQUEST[$question_id_str];
|
|
// echo $communication_id;
|
|
|
|
|
|
//error_log("question_id".$question_id);
|
|
$count=getFieldFromTable('count(patient_id)','answer_covid','patient_id',$patient_id);
|
|
|
|
if($count !=0){
|
|
|
|
$query1="update answer_covid set q1='$q1',q2='$q2',q3='$q3',q4='$q4',q5='$q5',q6='$q6',q7='$q7',q8='$q8',q9='$q9',q10='$q10',q11='$q11',q12='$q12',q13='$q13',rac_test='$rac_test',rac_result='$rac_result' WHERE patient_id='$patient_id'";
|
|
}
|
|
|
|
else{
|
|
$query1="insert into answer_covid set patient_id='$patient_id',q1='$q1',q2='$q2',q3='$q3',q4='$q4',q5='$q5',q6='$q6',q7='$q7',q8='$q8',q9='$q9',q10='$q10',q11='$q11',q12='$q12',q13='$q13',rac_test='$rac_test',rac_result='$rac_result',recommendation='$recommendation'";
|
|
}
|
|
error_log($query1);
|
|
|
|
|
|
|
|
|
|
|
|
// $query1="insert into covid_hindi set question_id='$question_id',patient_id='".$_REQUEST['patient_id']."',question_hindi='$question_hindi',answer='$answer'";
|
|
|
|
if (!$result = @mysqli_query($conn,$query1)) {
|
|
exit(mysqli_error($conn));
|
|
}
|
|
if(mysqli_num_rows($result) > 0) {
|
|
while ($row = @mysqli_fetch_assoc($result)) {
|
|
|
|
$data=$row;
|
|
}
|
|
}
|
|
|
|
if($data==null)
|
|
{
|
|
$data['status'] = 200;
|
|
$data['message'] = "Data not found!";
|
|
}
|
|
echo json_encode($data);
|
|
|
|
|
|
|
|
|
|
|
|
// //echo $procurement_refno;
|
|
// $query_initial="insert into ";
|
|
// $endquery="";
|
|
|
|
|
|
|
|
// $query=$query_initial." covid_questionaire set question_id ='".${"question_id$i"}."',question_hindi ='".${"question_hindi$i"}."',answer_status ='".${"answer_status$i"}."',score ='".${"score$i"}."',modified_by = '".$_SESSION['user_id']."' ".$endquery;
|
|
|
|
// echo $query;
|
|
// error_log($query);
|
|
// if (!$result = @mysqli_query($conn,$query)) {
|
|
// rollback();
|
|
// exit(error_log(mysqli_error($conn)));
|
|
// }
|
|
// }
|
|
//commit();
|
|
|
|
?>
|
|
|