function updatePerson_talent($sessionkey, $appcode, $Person_talentdata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Person_talent = new Person_talent(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "TBLID": $obj_Person_talent->TblId = $child; break; case "PERSONID": $obj_Person_talent->PersonId = $child; break; case "TALENTID": $obj_Person_talent->TalentId = $child; break; } } $obj_retResult_Person_talent = DAL_managePerson_talent::updatePerson_talent($obj_Person_talent); if ($obj_retResult_Person_talent->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getPerson_talentXml($obj_retResult_Person_talent->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addPerson_talent($obj_Person_talent) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Person_talent->TblId = DAL_managePerson_talent::getLastPerson_talentId() + 1; $sql = "INSERT INTO tbl_person_talent (TblId,PersonId,TalentId) \n\t\tVALUES (" . common::noSqlInject($obj_Person_talent->TblId) . "," . common::noSqlInject($obj_Person_talent->PersonId) . "," . common::noSqlInject($obj_Person_talent->TalentId) . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Person_talent; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }
public static function isChildPerson_talent($TblId, $ChildTblId) { $ischild = false; $obj_retResult = DAL_managePerson_talent::getPerson_talentListByTblId($ChildTblId); //get child node if ($obj_retResult->type == 1) { $arr_Person_talentList = $obj_retResult->data; $obj_Person_talent = $arr_Person_talentList[0]; $arrParentIds = explode(",", $obj_Person_talent->Url); foreach ($arrParentIds as $Person_talentParentId) { if ($Person_talentParentId == $TblId) { $ischild = true; } } } return $ischild; }