ESH/save_health_risk.php

32 lines
1.1 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?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 Risk','SAVE','save_health_risk.php');
$health_risk_id = $_POST['health_risk_id'];
error_log("HELATH RISK ID ***------------*******".$health_risk_id);
$health_risk_name =$_POST['health_risk_name'];
$health_risk_cat = $_POST['health_risk_cat'];
if(!empty($health_risk_id)){
$query = "update health_risk set health_risk_name = '$health_risk_name', health_risk_cat = '$health_risk_cat',modified_by = '".$_SESSION['user_id']."' where health_risk_id =
'".$health_risk_id."' ";
}
else {
$query = "insert into health_risk(health_risk_name,health_risk_cat, modified_by)
values ('$health_risk_name','$health_risk_cat','".$_SESSION['user_id']."' ); ";
}
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
?>