public static function addPerson_property($obj_Person_property)
 {
     $db = config::dbconfig();
     $obj_retresult = new returnResult();
     $obj_Person_property->PropertyId = DAL_managePerson_property::getLastPerson_propertyId() + 1;
     $sql = "INSERT INTO tbl_person_property (PropertyId,PropertyName,PropertyType,AssessValue,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Person_property->PropertyId) . "," . "'" . common::noSqlInject($obj_Person_property->PropertyName) . "'" . "," . common::noSqlInject($obj_Person_property->PropertyType) . "," . common::noSqlInject($obj_Person_property->AssessValue) . "," . "'" . common::noSqlInject($obj_Person_property->Description) . "'" . ");";
     $rs = mysql_query($sql);
     if (mysql_affected_rows() > 0) {
         $obj_retresult->type = 1;
         $obj_retresult->msg = "success";
         $obj_retresult->data = $obj_Person_property;
     } else {
         $obj_retresult->type = 0;
         $obj_retresult->msg = "failed";
     }
     return $obj_retresult;
 }
function updatePerson_property($sessionkey, $appcode, $Person_propertydata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Person_property = new Person_property();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "PROPERTYID":
                    $obj_Person_property->PropertyId = $child;
                    break;
                case "PROPERTYNAME":
                    $obj_Person_property->PropertyName = $child;
                    break;
                case "PROPERTYTYPE":
                    $obj_Person_property->PropertyType = $child;
                    break;
                case "ASSESSVALUE":
                    $obj_Person_property->AssessValue = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Person_property->Description = $child;
                    break;
            }
        }
        $obj_retResult_Person_property = DAL_managePerson_property::updatePerson_property($obj_Person_property);
        if ($obj_retResult_Person_property->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getPerson_propertyXml($obj_retResult_Person_property->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function isChildPerson_property($PropertyId, $ChildPropertyId)
 {
     $ischild = false;
     $obj_retResult = DAL_managePerson_property::getPerson_propertyListByPropertyId($ChildPropertyId);
     //get child node
     if ($obj_retResult->type == 1) {
         $arr_Person_propertyList = $obj_retResult->data;
         $obj_Person_property = $arr_Person_propertyList[0];
         $arrParentIds = explode(",", $obj_Person_property->Url);
         foreach ($arrParentIds as $Person_propertyParentId) {
             if ($Person_propertyParentId == $PropertyId) {
                 $ischild = true;
             }
         }
     }
     return $ischild;
 }