public static function addPerson_workingexperiance($obj_Person_workingexperiance) { $db = config::dbconfig(); $obj_retresult = new returnResult(); $obj_Person_workingexperiance->WorkExpId = DAL_managePerson_workingexperiance::getLastPerson_workingexperianceId() + 1; $sql = "INSERT INTO tbl_person_workingexperiance (WorkExpId,CompanyId,StartDate,EndDate,Position,PersonId) \n\t\tVALUES (" . common::noSqlInject($obj_Person_workingexperiance->WorkExpId) . "," . common::noSqlInject($obj_Person_workingexperiance->CompanyId) . "," . "'" . common::noSqlInject($obj_Person_workingexperiance->StartDate) . "'" . "," . "'" . common::noSqlInject($obj_Person_workingexperiance->EndDate) . "'" . "," . "'" . common::noSqlInject($obj_Person_workingexperiance->Position) . "'" . "," . common::noSqlInject($obj_Person_workingexperiance->PersonId) . ");"; $rs = mysql_query($sql); if (mysql_affected_rows() > 0) { $obj_retresult->type = 1; $obj_retresult->msg = "success"; $obj_retresult->data = $obj_Person_workingexperiance; } else { $obj_retresult->type = 0; $obj_retresult->msg = "failed"; } return $obj_retresult; }
function updatePerson_workingexperiance($sessionkey, $appcode, $Person_workingexperiancedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Person_workingexperiance = new Person_workingexperiance(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "WORKEXPID": $obj_Person_workingexperiance->WorkExpId = $child; break; case "COMPANYID": $obj_Person_workingexperiance->CompanyId = $child; break; case "STARTDATE": $obj_Person_workingexperiance->StartDate = $child; break; case "ENDDATE": $obj_Person_workingexperiance->EndDate = $child; break; case "POSITION": $obj_Person_workingexperiance->Position = $child; break; case "PERSONID": $obj_Person_workingexperiance->PersonId = $child; break; } } $obj_retResult_Person_workingexperiance = DAL_managePerson_workingexperiance::updatePerson_workingexperiance($obj_Person_workingexperiance); if ($obj_retResult_Person_workingexperiance->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getPerson_workingexperianceXml($obj_retResult_Person_workingexperiance->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function isChildPerson_workingexperiance($WorkExpId, $ChildWorkExpId) { $ischild = false; $obj_retResult = DAL_managePerson_workingexperiance::getPerson_workingexperianceListByWorkExpId($ChildWorkExpId); //get child node if ($obj_retResult->type == 1) { $arr_Person_workingexperianceList = $obj_retResult->data; $obj_Person_workingexperiance = $arr_Person_workingexperianceList[0]; $arrParentIds = explode(",", $obj_Person_workingexperiance->Url); foreach ($arrParentIds as $Person_workingexperianceParentId) { if ($Person_workingexperianceParentId == $WorkExpId) { $ischild = true; } } } return $ischild; }