function addPerson_alresult($sessionkey, $appcode, $Person_alresultdata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Person_alresult = new Person_alresult(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "ALRESULTID": $obj_Person_alresult->ALResultId = $child; break; case "SUBJECTID": $obj_Person_alresult->SubjectId = $child; break; case "SCHOOLID": $obj_Person_alresult->SchoolId = $child; break; case "GRADE": $obj_Person_alresult->Grade = $child; break; case "LANGUAGE": $obj_Person_alresult->Language = $child; break; case "DATETIME": $obj_Person_alresult->DateTime = $child; break; case "PERSONID": $obj_Person_alresult->PersonId = $child; break; } } $obj_retResult_Person_alresult = DAL_managePerson_alresult::addPerson_alresult($obj_Person_alresult); if ($obj_retResult_Person_alresult->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getPerson_alresultXml($obj_retResult_Person_alresult->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addPerson_alresult2($ALResultId, $SubjectId, $SchoolId, $Grade, $Language, $DateTime, $PersonId) { $obj_retResult = new returnResult(); $obj_newPerson_alresult = new Person_alresult(); $obj_newuser->setPerson_alresult($ALResultId, $SubjectId, $SchoolId, $Grade, $Language, $DateTime, $PersonId); // $isExist = BL_managePerson_alresult::isExist($obj_newPerson_alresult->id); if (!$isExist) { $obj_retResult_Person_alresult = DAL_managePerson_alresult::addPerson_alresult($obj_newPerson_alresult); if ($obj_retResult_Person_alresult->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Person_alresult->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Person_alresult already exist"; } return $obj_retResult; }