function updateSocierytype($sessionkey, $appcode, $Socierytypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Socierytype = new Socierytype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "SOCIERYTYPEID": $obj_Socierytype->SocieryTypeId = $child; break; case "SOCIERYTYPENAME": $obj_Socierytype->SocieryTypeName = $child; break; case "DESCRIPTION": $obj_Socierytype->Description = $child; break; } } $obj_retResult_Socierytype = DAL_manageSocierytype::updateSocierytype($obj_Socierytype); if ($obj_retResult_Socierytype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getSocierytypeXml($obj_retResult_Socierytype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addSocierytype($obj_Socierytype) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Socierytype->SocieryTypeId = DAL_manageSocierytype::getLastSocierytypeId() + 1; $sql = "INSERT INTO tbl_socierytype (SocieryTypeId,SocieryTypeName,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Socierytype->SocieryTypeId) . "," . "'" . common::noSqlInject($obj_Socierytype->SocieryTypeName) . "'" . "," . "'" . common::noSqlInject($obj_Socierytype->Description) . "'" . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Socierytype; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }
public static function isChildSocierytype($SocieryTypeId, $ChildSocieryTypeId) { $ischild = false; $obj_retResult = DAL_manageSocierytype::getSocierytypeListBySocieryTypeId($ChildSocieryTypeId); //get child node if ($obj_retResult->type == 1) { $arr_SocierytypeList = $obj_retResult->data; $obj_Socierytype = $arr_SocierytypeList[0]; $arrParentIds = explode(",", $obj_Socierytype->Url); foreach ($arrParentIds as $SocierytypeParentId) { if ($SocierytypeParentId == $SocieryTypeId) { $ischild = true; } } } return $ischild; }