function getAlsubjectsBySubjectId($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_manageAlsubjects::getAlsubjectsListBySubjectId($id); if ($result->type == 1) { $arr_AlsubjectsList = $result->data; if (count($arr_AlsubjectsList) > 0) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; foreach ($arr_AlsubjectsList as $obj_Alsubjects) { $main_result .= getAlsubjectsXml($obj_Alsubjects); } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function deleteAlsubjects($obj_mainpacket) { $packet = $obj_mainpacket->packet; $SubjectId = $packet[0]; $msg = "failed"; $result = 0; $result_SubjectId = 0; $retResult = BL_manageAlsubjects::getAlsubjectsListBySubjectId($SubjectId); if ($retResult->type == 1) { $obj_Alsubjects = $retResult->data[0]; $obj_result2 = DAL_manageAlsubjects::deleteAlsubjects($obj_Alsubjects->SubjectId); if ($obj_result2->type == 1) { $result = 1; $result_SubjectId = $obj_Alsubjects->SubjectId; $msg = "success"; } else { $msg = "Sorry!!! Problem occured while deleting this Alsubjects"; } } else { $msg = "Sorry!!! The Alsubjects you are tring to delete is not found"; } $obj_mainpacket->returnValues = array($result, $obj_Alsubjects->SubjectId, $msg); $obj_mainpacket->main_setPacket(); }