Retrieve a single 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($id!=""){
  $action = 'bargain_record';
  $rest_data = array(
     'bargainID' => $id
  ); 
  $Ratebe = new Ratebe($auth_arr,$action,$rest_data);
  $result_arr = $Ratebe->go();

  if($result_arr["result"]=="fail"){
     $msg = 'You have failed to retrive a bargain record. Reason: '.$result_arr["error"];
  }
  else{
    $title = $result_arr['title'];
    $url = $result_arr['url'];
    $photo_url = $result_arr['photo_url'];
    $start_date = $result_arr['start_date'];
    $end_date = $result_arr['end_date'];
    $des = $result_arr['des'];
    $catID = $result_arr['catID'];
    $tags = $result_arr['tags'];
    $Ratebe = new Ratebe("","","");
    if($start_date!=0){
        $start_date = date("Y-m-d H:i:s",$start_date);
    }
    if($end_date!=0){
        $end_date = date("Y-m-d H:i:s",$end_date);
    }
  }
}
?>