ESH/save_health_advice.php
2024-10-23 18:28:06 +05:30

33 lines
1.3 KiB
PHP

<?php
include('includes/config/config.php');
include ('includes/functions.php');
include ('log_entry.php');
error_log ( "Start Printing Request Attributes" );
$requestStr="";
foreach ( $_REQUEST as $key => $value ) {
$requestStr.=$key . " : " . $value . "\n";
error_log ( $key . " : " . $value . "<br />\r\n" );
}
error_log ( "End Printing Request Attributes" );
save_log($requestStr,'Health Advice','SAVE','save_health_advice.php');
$health_advice_id = $_POST['health_advice_id'];
$health_advice_name =$_POST['health_advice_name'];
$health_advice_cat = $_POST['health_advice_cat'];
error_log("HealthID " . $health_advice_id);
if(!empty($health_advice_id)){
$query = "update health_advice set health_advice_name = '$health_advice_name', health_advice_cat = '$health_advice_cat',modified_by = '".$_SESSION['user_id']."' where health_advice_id =
'".$health_advice_id."' ";
}
else {
$query = "insert into health_advice(health_advice_name,health_advice_cat, modified_by)
values ('$health_advice_name','$health_advice_cat','".$_SESSION['user_id']."' ); ";
}
error_log("Query**************************************". $query);
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
?>