94 lines
4.1 KiB
PHP
94 lines
4.1 KiB
PHP
|
<?php
|
||
|
include ('includes/config/config.php');
|
||
|
include ('includes/functions.php');
|
||
|
include ('log_entry.php');
|
||
|
//error_log ( $_POST ['wah_id'] );
|
||
|
error_reporting ( E_ERROR | E_PARSE );
|
||
|
$data = array ();
|
||
|
$wah_id = $_POST ['wah_id'];
|
||
|
//error_log($wah_id);
|
||
|
$status = $_POST ['status'];
|
||
|
|
||
|
$patient_id = $_REQUEST['patient_id'];
|
||
|
error_log('$patient_id');
|
||
|
$height = $_POST ['height'];
|
||
|
$weight = $_POST ['weight'];
|
||
|
$bmi = $_POST ['bmi'];
|
||
|
$bp = $_POST ['bp'];
|
||
|
$pulse = $_POST ['pulse'];
|
||
|
$alcohol = $_POST ['alcohol'];
|
||
|
$smoking = $_POST ['smoking'];
|
||
|
$tobacco = $_POST ['tobacco'];
|
||
|
$chronic_disease = $_POST ['chronic_disease'];
|
||
|
$ptosis = $_POST ['ptosis'];
|
||
|
$diplopia = $_POST ['diplopia'];
|
||
|
$nystagmus = $_POST ['nystagmus'];
|
||
|
$rbs = $_POST ['rbs'];
|
||
|
$bp_after = $_POST ['bp_after'];
|
||
|
$pulse_after = $_POST ['pulse_after'];
|
||
|
$tandem = $_POST ['tandem'];
|
||
|
$romberg_sign = $_POST ['romberg_sign'];
|
||
|
error_log('$romberg_sign');
|
||
|
error_log($romberg_sign);
|
||
|
$coordination = $_POST ['coordination'];
|
||
|
$vertigo = $_POST ['vertigo'];
|
||
|
$tinnitus = $_POST ['tinnitus'];
|
||
|
$height_bar_test = $_POST ['height_bar_test'];
|
||
|
$history_of_wah = $_POST ['history_of_wah'];
|
||
|
$medical_test = $_POST ['medical_test'];
|
||
|
$ref_no = $_POST ['ref_no'];
|
||
|
$screen_date = $_REQUEST['comm_date'];
|
||
|
$remarks = $_POST['remarks'];
|
||
|
|
||
|
error_log($patient_id);
|
||
|
|
||
|
$forward_status = $_POST ['forward_status'];
|
||
|
|
||
|
$ohc_type = $_SESSION ['current_ohcttype'];
|
||
|
$data ['wah_id'] = $wah_id;
|
||
|
if (empty ( $forward_status ) || $forward_status == null) {
|
||
|
error_log ( "forward_status supposed to be null:" . $forward_status );
|
||
|
}
|
||
|
|
||
|
$count=getFieldFromTable('count(patient_id)','work_at_height_details_new','patient_id',$patient_id);
|
||
|
|
||
|
if ($count !=0) {
|
||
|
error_log ( "update case" );
|
||
|
error_log($patient_id);
|
||
|
$query = "update work_at_height_details_new set height='$height',weight='$weight',bmi='$bmi',bp='$bp',pulse='$pulse',alcohol='$alcohol',smoking='$smoking',tobacco='$tobacco',chronic_disease='$chronic_disease',ptosis='$ptosis',diplopia='$diplopia',nystagmus='$nystagmus',rbs='$rbs',bp_after='$bp_after',pulse_after='$pulse_after',tandem='$tandem',romberg_sign='$romberg_sign',coordination='$coordination',vertigo='$vertigo',tinnitus='$tinnitus',history_of_wah='$history_of_wah',medical_test='$medical_test',height_bar_test='$height_bar_test', ref_no='$ref_no',screen_date = STR_TO_DATE('".$screen_date."', '%d/%m/%Y %h:%i %p'),remarks='$remarks' where patient_id='$patient_id'";
|
||
|
|
||
|
} else {
|
||
|
error_log ( "Insert case" );
|
||
|
$query = "insert into work_at_height_details_new set patient_id='$patient_id',height='$height',weight='$weight',bmi='$bmi',bp='$bp',pulse='$pulse',alcohol='$alcohol',smoking='$smoking',tobacco='$tobacco',chronic_disease='$chronic_disease',ptosis='$ptosis',diplopia='$diplopia',nystagmus='$nystagmus',rbs='$rbs',bp_after='$bp_after',pulse_after='$pulse_after',tandem='$tandem',romberg_sign='$romberg_sign',coordination='$coordination',vertigo='$vertigo',tinnitus='$tinnitus',history_of_wah='$history_of_wah',medical_test='$medical_test',height_bar_test='$height_bar_test', ref_no='$ref_no',screen_date = STR_TO_DATE('".$screen_date."', '%d/%m/%Y %h:%i %p'),remarks='$remarks'";
|
||
|
}
|
||
|
|
||
|
error_log($query);
|
||
|
|
||
|
// $query = "insert into work_at_height_details_new set patient_id='$patient_id',height='$height',weight='$weight',bmi='$bmi',bp='$bp',pulse='$pulse',alcohol='$alcohol',smoking='$smoking',tobacco='$tobacco',chronic_disease='$chronic_disease',ptosis='$ptosis',diplopia='$diplopia',nystagmus='$nystagmus',rbs='$rbs',bp_after='$bp_after',pulse_after='$pulse_after',tandem='$tandem',romberg_sign='$romberg_sign',coordination='$coordination',vertigo='$vertigo',tinnitus='$tinnitus',history_of_wah='$history_of_wah',medical_test='$medical_test',ref_no='$ref_no'";
|
||
|
|
||
|
// error_log($query);
|
||
|
|
||
|
|
||
|
// error_log($patient_id);
|
||
|
// error_log('$patient_id');
|
||
|
|
||
|
if (! $result = @mysqli_query($conn,$query )) {
|
||
|
|
||
|
exit ( mysqli_error($conn) );
|
||
|
|
||
|
} else {
|
||
|
|
||
|
$data ['status'] = 200;
|
||
|
|
||
|
$data ['message'] = "success";
|
||
|
|
||
|
}
|
||
|
|
||
|
//echo "Hidden Highlighted fields: ".$_POST['hiddenHighlighter'];
|
||
|
|
||
|
// $list_color_validated_fields =
|
||
|
if (! empty ( $_POST['hiddenHighlighter'] ) ) {
|
||
|
saveHighlightedParams($wah_id , $_POST['hiddenHighlighter'] );
|
||
|
}
|
||
|
|
||
|
?>
|