<?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_job_profile.php');
$job_profile_id = $_POST['job_profile_id'];
$job_profile_name =$_POST['job_profile_name'];

$job_profile_code = $_POST['job_profile_code'];
if(!empty($job_profile_id)){
$query = "update job_profile set job_profile_name = '$job_profile_name', job_profile_code = '$job_profile_code',modified_by = '".$_SESSION['user_id']."' where job_profile_id = 
'".$job_profile_id."'    ";
}
else {
$query = "insert into job_profile(job_profile_name,job_profile_code, modified_by) 
		  values ('$job_profile_name','$job_profile_code','".$_SESSION['user_id']."' ); ";
}
if (!$result = @mysqli_query($conn,$query)) {
            die(mysqli_error($conn));
}
?>