AddNew(); $obj->studentId=$obj->GetNextCode(); $obj->studentCode=$studentCode; $obj->levelId=$levelId; $obj->programId=$programId; $obj->prefixId=$prefixId; $obj->studentName=$studentName; $obj->studentSurname=$studentSurname; $obj->studentNameEng=$studentNameEng; $obj->studentSurnameEng=$studentSurnameEng; $obj->creditAttempt=$creditAttempt; $obj->creditSatisfy=$creditSatisfy; $obj->GPA=$GPA; $obj->admitAcadYear=$admitAcadYear; $obj->admitSemester=$admitSemester; $obj->admitDate=$admitDate; $obj->finishDate=$finishDate; $obj->studentPassword=$studentPassword; $obj->studentEmail=$studentEmail; $obj->studentYear=$studentYear; $obj->studentStatus=$studentStatus; if($officerId1 == '') $officerId1 = 'NULL'; $obj->officerId1=$officerId1; if($officerId2 == '') $officerId2 = 'NULL'; $obj->officerId2=$officerId2; $obj->financeStatus=$financeStatus; $obj->updateUserId=$updateUserId; $obj->updateDateTime=date('Y-m-d H:i:s'); $obj->citizenId=$citizenId; $obj->graduateYear=$graduateYear; if($studentCode == '') $obj->genStatus='N'; else $obj->genStatus='Y'; $obj->genNo=$genNo; $obj->entryTypeId=$entryTypeId; $obj->entryTypeId2=1; $obj->studentSex=$studentSex; $obj->scholarId=$scholarId; if($preAdmitPositionId == '') $preAdmitPositionId = 'NULL'; $obj->preAdmitPositionId=$preAdmitPositionId; $obj->totalPoint=100; $obj->honor=$honor; $obj->medal=$medal; $obj->exitExam='N'; $obj->Save(); $obj3->SearchByKey($prefixId); $obj3->GetRecord(); $obj2->AddNew(); $obj2->studentId=$obj->studentId; $obj2->studentSex=$obj3->defaultSex; $obj2->parentName=$parentName; $obj2->parentRelation=$parentRelation; $obj2->parentAddress=$parentAddress; if($currentDistrictId == '') $currentDistrictId = 'NULL'; $obj2->parentDistrictId=$currentDistrictId; if($currentAmphurId == '') $currentAmphurId = 'NULL'; $obj2->parentAmphurId=$currentAmphurId; if($currentProvinceId == '') $currentProvinceId = 'NULL'; $obj2->parentProvinceId=$currentProvinceId; $obj2->parentZipcode=$parentZipcode; $obj2->parentPhoneNo=$parentPhoneNo; if($parentMobile == '') $parentMobile = 'NULL'; $obj2->parentMobile=$parentMobile; $obj2->parentOcc=$parentOcc; $obj2->parentIncome=$parentIncome; $obj2->parentEmail=$parentEmail; $obj2->canRefund=$canRefund; $obj2->Save2(); }else if($method=="edit"){ $obj->SearchByKey($studentId); $obj->GetRecord(); $obj->Edit(); $obj->studentCode=$studentCode; $obj->levelId=$levelId; $obj->programId=$programId; $obj->prefixId=$prefixId; $obj->studentName=$studentName; $obj->studentSurname=$studentSurname; $obj->studentNameEng=$studentNameEng; $obj->studentSurnameEng=$studentSurnameEng; $obj->creditAttempt=$creditAttempt; $obj->creditSatisfy=$creditSatisfy; $obj->GPA=$GPA; $obj->admitAcadYear=$admitAcadYear; $obj->admitSemester=$admitSemester; $obj->admitDate=$admitDate; $obj->finishDate=$finishDate; $obj->studentPassword=$studentPassword; $obj->studentEmail=$studentEmail; $obj->studentYear=$studentYear; $obj->studentStatus=$studentStatus; if($officerId1 == '') $officerId1 = 'NULL'; $obj->officerId1=$officerId1; if($officerId2 == '') $officerId2 = 'NULL'; $obj->officerId2=$officerId2; $obj->financeStatus=$financeStatus; $obj->updateUserId=$updateUserId; $obj->updateDateTime=date('Y-m-d H:i:s'); $obj->citizenId=$citizenId; $obj->graduateYear=$graduateYear; $obj->genStatus=$obj->genStatus; $obj->genNo=$genNo; $obj->entryTypeId=$entryTypeId; $obj->entryTypeId2=1; $obj->studentSex=$studentSex; $obj->scholarId=$scholarId; if($preAdmitPositionId == '') $preAdmitPositionId = 'NULL'; $obj->preAdmitPositionId=$preAdmitPositionId; $obj->totalPoint=$obj->totalPoint; $obj->honor=$honor; $obj->medal=$medal; $obj->exitExam=$obj->exitExam; $obj->Save(); $obj3->SearchByKey($prefixId); $obj3->GetRecord(); $obj2->SearchByKey($studentId); $obj2->GetRecord(); $obj2->Edit(); $obj2->studentSex=$obj3->defaultSex; $obj2->parentName=$parentName; $obj2->parentRelation=$parentRelation; $obj2->parentAddress=$parentAddress; if($currentDistrictId == '') $currentDistrictId = 'NULL'; $obj2->parentDistrictId=$currentDistrictId; if($currentAmphurId == '') $currentAmphurId = 'NULL'; $obj2->parentAmphurId=$currentAmphurId; if($currentProvinceId == '') $currentProvinceId = 'NULL'; $obj2->parentProvinceId=$currentProvinceId; $obj2->parentZipcode=$parentZipcode; $obj2->parentPhoneNo=$parentPhoneNo; if($parentMobile == '') $parentMobile = 'NULL'; $obj2->parentMobile=$parentMobile; $obj2->parentOcc=$parentOcc; $obj2->parentIncome=$parentIncome; $obj2->parentEmail=$parentEmail; $obj2->canRefund=$canRefund; $obj2->Save2(); }else if($method=="delete"){ $obj2->SearchByKey($studentId); $obj2->GetRecord(); $obj2->Delete(); $obj->SearchByKey($studentId); $obj->GetRecord(); $obj->Delete(); } $obj->Destroy(); $conn->Disconnect(); echo ""; ?>