public static function addPerson_educationlevel($obj_Person_educationlevel) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Person_educationlevel->EducationLevelId = DAL_managePerson_educationlevel::getLastPerson_educationlevelId() + 1; $sql = "INSERT INTO tbl_person_educationlevel (EducationLevelId,SchoolId,StartYear,StartClass,EndYear,EndClass,PersonId) \n\t\tVALUES (" . common::noSqlInject($obj_Person_educationlevel->EducationLevelId) . "," . common::noSqlInject($obj_Person_educationlevel->SchoolId) . "," . "'" . common::noSqlInject($obj_Person_educationlevel->StartYear) . "'" . "," . "'" . common::noSqlInject($obj_Person_educationlevel->StartClass) . "'" . "," . "'" . common::noSqlInject($obj_Person_educationlevel->EndYear) . "'" . "," . "'" . common::noSqlInject($obj_Person_educationlevel->EndClass) . "'" . "," . common::noSqlInject($obj_Person_educationlevel->PersonId) . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Person_educationlevel; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }
function updatePerson_educationlevel($sessionkey, $appcode, $Person_educationleveldata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Person_educationlevel = new Person_educationlevel(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "EDUCATIONLEVELID": $obj_Person_educationlevel->EducationLevelId = $child; break; case "SCHOOLID": $obj_Person_educationlevel->SchoolId = $child; break; case "STARTYEAR": $obj_Person_educationlevel->StartYear = $child; break; case "STARTCLASS": $obj_Person_educationlevel->StartClass = $child; break; case "ENDYEAR": $obj_Person_educationlevel->EndYear = $child; break; case "ENDCLASS": $obj_Person_educationlevel->EndClass = $child; break; case "PERSONID": $obj_Person_educationlevel->PersonId = $child; break; } } $obj_retResult_Person_educationlevel = DAL_managePerson_educationlevel::updatePerson_educationlevel($obj_Person_educationlevel); if ($obj_retResult_Person_educationlevel->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getPerson_educationlevelXml($obj_retResult_Person_educationlevel->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function isChildPerson_educationlevel($EducationLevelId, $ChildEducationLevelId) { $ischild = false; $obj_retResult = DAL_managePerson_educationlevel::getPerson_educationlevelListByEducationLevelId($ChildEducationLevelId); //get child node if ($obj_retResult->type == 1) { $arr_Person_educationlevelList = $obj_retResult->data; $obj_Person_educationlevel = $arr_Person_educationlevelList[0]; $arrParentIds = explode(",", $obj_Person_educationlevel->Url); foreach ($arrParentIds as $Person_educationlevelParentId) { if ($Person_educationlevelParentId == $EducationLevelId) { $ischild = true; } } } return $ischild; }