示例#1
0
 public static function deleteLocation($obj_mainpacket)
 {
     $packet = $obj_mainpacket->packet;
     $LocationId = $packet[0];
     $msg = "failed";
     $result = 0;
     $result_LocationId = 0;
     $retResult = BL_manageLocation::getLocationListByLocationId($LocationId);
     if ($retResult->type == 1) {
         $obj_Location = $retResult->data[0];
         $obj_result2 = DAL_manageLocation::deleteLocation($obj_Location->LocationId);
         if ($obj_result2->type == 1) {
             $result = 1;
             $result_LocationId = $obj_Location->LocationId;
             $msg = "success";
         } else {
             $msg = "Sorry!!! Problem occured while deleting this Location";
         }
     } else {
         $msg = "Sorry!!! The Location you are tring to delete is not found";
     }
     $obj_mainpacket->returnValues = array($result, $obj_Location->LocationId, $msg);
     $obj_mainpacket->main_setPacket();
 }
示例#2
0
function getLocationByLocationId($sessionkey, $appcode, $id)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result .= "<AUTHSTATUS>1</AUTHSTATUS>";
        $result = BL_manageLocation::getLocationListByLocationId($id);
        if ($result->type == 1) {
            $arr_LocationList = $result->data;
            if (count($arr_LocationList) > 0) {
                $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
                foreach ($arr_LocationList as $obj_Location) {
                    $main_result .= getLocationXml($obj_Location);
                }
            } else {
                $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
            }
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}