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

32 lines
1.1 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,'Injury Classification','SAVE','save_injury_classes.php');
$injury_id = $_POST['injury_class_id'];
$injury_name =$_POST['injury_class_name'];
$injury_desc = $_POST['injury_class_desc'];
$injury_code = $_POST['injury_class_code'];
if(!empty($injury_id)){
$query = "update injury_class set inj_class_name = '".$injury_name."', inj_class_desc = '".$injury_desc."', inj_class_code = '".$injury_code."',modified_by = '".$_SESSION['user_id']."' where inj_class_id =
'".$injury_id."' ";
}
else {
$query = "insert into injury_class(inj_class_name,inj_class_desc,inj_class_code,modified_by)
values ('".$injury_name."','".$injury_desc."','".$injury_code."','".$_SESSION['user_id']."' ); ";
}
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
?>