32 lines
1.1 KiB
PHP
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,'Bio Waste','SAVE','save_waste_category.php');
|
||
|
$query_initial="";
|
||
|
$endquery="";
|
||
|
$waste_category_id=$_REQUEST['waste_category_id'];
|
||
|
if(!empty($waste_category_id)){
|
||
|
$query_initial="update ";
|
||
|
$endquery=" where waste_category_id = '".$waste_category_id."' ";
|
||
|
}else{
|
||
|
$query_initial="insert into ";
|
||
|
}
|
||
|
|
||
|
$query=$query_initial." waste_category set waste_category_name='".$_REQUEST['waste_category_name']."', waste_category_desc='".$_REQUEST['waste_category_desc']."'".$endquery;
|
||
|
|
||
|
|
||
|
echo $query;
|
||
|
|
||
|
if (!$result = @mysqli_query($conn,$query)) {
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
|