47 lines
1.2 KiB
PHP
47 lines
1.2 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,'Company Profile','SAVE','save_company_profile.php');
|
|
$id = $_POST['id'];
|
|
|
|
|
|
|
|
$data = array();
|
|
$query = "";
|
|
|
|
if (!empty($id)) {
|
|
$select_query = "select * from company_profile where company_id = '" . $_POST['company_id'] . "'";
|
|
$result = mysqli_query($conn,$select_query);
|
|
|
|
if(mysqli_num_rows($result) > 0) {
|
|
|
|
$query = "update company_profile set " . $id . "=null,modified_by = '" . $_SESSION['user_id'] . "' where company_id = '" . $_POST['company_id'] . "'";
|
|
// echo $query;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
error_log("query:".$query);
|
|
$data['query'] = $query;
|
|
if (! $result = @mysqli_query($conn,$query)) {
|
|
$data['status'] = 500;
|
|
error_log("query error".$mysqli_error($conn));
|
|
exit(mysqli_error($conn));
|
|
}
|
|
|
|
if ($data == null) {
|
|
$data['status'] = 200;
|
|
$data['message'] = "Data not found!";
|
|
}
|
|
echo json_encode($data);
|
|
?>
|