Delete a bargain API
<?php
include("src/Ratebe.php");
include("config.php");
$action = 'bargain_edit';
$msg = 'You can update this bargain';
$deleted = false;
$id = @$_REQUEST["id"];
if(@$_POST["submit"]=="Delete"){
$action = 'bargain_delete';
$rest_data = array(
'bargainID' => $id
);
$Ratebe = new Ratebe($auth_arr,$action,$rest_data);
$result_arr = $Ratebe->go();
$deleted = true;
if($result_arr["result"]=="success")
$msg = 'You have deleted the bargain successfully';
else if($result_arr["result"]=="fail")
$msg = 'You have failed to delete the bargain. Reason: '.$result_arr["error"];
}
?>
Scroll