29 lines
1.1 KiB
PHP
29 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,'Requisition','DELETE','delete_requisition.php');
|
||
|
$query1 = "";
|
||
|
$query2 = "";
|
||
|
if (!empty($_REQUEST['req_id'])) {
|
||
|
$query1 = " delete from requisition where req_id = '" . $_REQUEST['req_id'] . "' ";
|
||
|
$query2 = " delete from requisition_items where req_id = '" . $_REQUEST['req_id'] . "' ";
|
||
|
//echo $query1;
|
||
|
error_log("delete from req table:" . $query1 . "delete from req_items table:" . $query2);
|
||
|
if (!$result = @mysqli_query($conn,$query1) and !$result1 = @mysqli_query($conn,$query2)) {
|
||
|
|
||
|
exit(mysqli_error($conn));
|
||
|
echo json_encode("FAILURE");
|
||
|
} else {
|
||
|
error_log("chk delete req query:".@mysqli_query($conn,$query1) ." ".@mysqli_query($conn,$query2));
|
||
|
echo json_encode("SUCCESS");
|
||
|
}
|
||
|
}
|