function updateGroupmissiontype($sessionkey, $appcode, $Groupmissiontypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Groupmissiontype = new Groupmissiontype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "GROUPMISSIONTYPEID": $obj_Groupmissiontype->GroupMissionTypeId = $child; break; case "GROUPMISSIONTYPENAME": $obj_Groupmissiontype->GroupMissionTypeName = $child; break; case "DESCRIPTION": $obj_Groupmissiontype->Description = $child; break; } } $obj_retResult_Groupmissiontype = DAL_manageGroupmissiontype::updateGroupmissiontype($obj_Groupmissiontype); if ($obj_retResult_Groupmissiontype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getGroupmissiontypeXml($obj_retResult_Groupmissiontype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addGroupmissiontype($obj_Groupmissiontype) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Groupmissiontype->GroupMissionTypeId = DAL_manageGroupmissiontype::getLastGroupmissiontypeId() + 1; $sql = "INSERT INTO tbl_groupmissiontype (GroupMissionTypeId,GroupMissionTypeName,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Groupmissiontype->GroupMissionTypeId) . "," . "'" . common::noSqlInject($obj_Groupmissiontype->GroupMissionTypeName) . "'" . "," . "'" . common::noSqlInject($obj_Groupmissiontype->Description) . "'" . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Groupmissiontype; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }
public static function isChildGroupmissiontype($GroupMissionTypeId, $ChildGroupMissionTypeId) { $ischild = false; $obj_retResult = DAL_manageGroupmissiontype::getGroupmissiontypeListByGroupMissionTypeId($ChildGroupMissionTypeId); //get child node if ($obj_retResult->type == 1) { $arr_GroupmissiontypeList = $obj_retResult->data; $obj_Groupmissiontype = $arr_GroupmissiontypeList[0]; $arrParentIds = explode(",", $obj_Groupmissiontype->Url); foreach ($arrParentIds as $GroupmissiontypeParentId) { if ($GroupmissiontypeParentId == $GroupMissionTypeId) { $ischild = true; } } } return $ischild; }