function updateService($sessionkey, $appcode, $Servicedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Service = new Service(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "SERVICEID": $obj_Service->ServiceId = $child; break; case "SERVICENAME": $obj_Service->ServiceName = $child; break; case "DESCRIPTION": $obj_Service->Description = $child; break; } } $obj_retResult_Service = DAL_manageService::updateService($obj_Service); if ($obj_retResult_Service->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getServiceXml($obj_retResult_Service->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addService($obj_Service) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Service->ServiceId = DAL_manageService::getLastServiceId() + 1; $sql = "INSERT INTO tbl_service (ServiceId,ServiceName,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Service->ServiceId) . "," . "'" . common::noSqlInject($obj_Service->ServiceName) . "'" . "," . "'" . common::noSqlInject($obj_Service->Description) . "'" . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Service; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }
public static function isChildService($ServiceId, $ChildServiceId) { $ischild = false; $obj_retResult = DAL_manageService::getServiceListByServiceId($ChildServiceId); //get child node if ($obj_retResult->type == 1) { $arr_ServiceList = $obj_retResult->data; $obj_Service = $arr_ServiceList[0]; $arrParentIds = explode(",", $obj_Service->Url); foreach ($arrParentIds as $ServiceParentId) { if ($ServiceParentId == $ServiceId) { $ischild = true; } } } return $ischild; }