public static function deleteTransport($obj_mainpacket) { $packet = $obj_mainpacket->packet; $TransportId = $packet[0]; $msg = "failed"; $result = 0; $result_TransportId = 0; $retResult = BL_manageTransport::getTransportListByTransportId($TransportId); if ($retResult->type == 1) { $obj_Transport = $retResult->data[0]; $obj_result2 = DAL_manageTransport::deleteTransport($obj_Transport->TransportId); if ($obj_result2->type == 1) { $result = 1; $result_TransportId = $obj_Transport->TransportId; $msg = "success"; } else { $msg = "Sorry!!! Problem occured while deleting this Transport"; } } else { $msg = "Sorry!!! The Transport you are tring to delete is not found"; } $obj_mainpacket->returnValues = array($result, $obj_Transport->TransportId, $msg); $obj_mainpacket->main_setPacket(); }
function getTransportByTransportId($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_manageTransport::getTransportListByTransportId($id); if ($result->type == 1) { $arr_TransportList = $result->data; if (count($arr_TransportList) > 0) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; foreach ($arr_TransportList as $obj_Transport) { $main_result .= getTransportXml($obj_Transport); } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }