<?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,'Sub Classification','SAVE','save_subclass.php');

$subclass_id = $_POST['subclass_id'];
error_log("HELATH RISK ID ***------------*******".$subclass_id);

$subclass_name =$_POST['subclass_name'];
$subclass_desc = $_POST['subclass_desc'];

if(!empty($subclass_id)){
$query = "update sub_classification set subclass_name = '$subclass_name', subclass_desc = '$subclass_desc',modified_by = '".$_SESSION['user_id']."' where subclass_id = 
'".$subclass_id."'    ";
}
else {
$query = "insert into sub_classification(subclass_name,subclass_desc, modified_by) 
		  values ('$subclass_name','$subclass_desc','".$_SESSION['user_id']."' ); ";
}
if (!$result = @mysqli_query($conn,$query)) {
            exit(mysqli_error($conn));
}
?>