Viewing file: processimportupdate2.php (7.87 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "../../class/clsConnection.php";
include_once "../../class/clsDB.php";
include_once "../global.php";
include_once "../class/clsStudentMaster.php";
include_once "../class/clsStudentBio.php";
$oSm = new StudentMaster($oC2);
$oSm2 = new StudentMaster($oC2);
$oSb = new StudentBio($oC2);
include_once "../class/clsimportupdate.php";
include_once "../class/clsalumnimain.php";
include_once "../class/clsalumnibio.php";
include_once "../class/clsmapprogram.php";
include_once "../link/function.php";
$obj = new ImportUpdate($oC1);
$obj2 = new ImportUpdate($oC1);
$oAm = new AlumniMain($oC1);
$oAm2 = new AlumniMain($oC1);
$oAb = new AlumniBio($oC1);
$oMp = new mapprogram($oC1);
if($method=="add"){
$countup = 0;
for ($i=1; $i<=$maxId; $i++)
{
eval("\$programR = \$programR".$i.";");
eval("\$programId_A = \$programId_A".$i.";");
$oMp->AddNew();
$oMp->mapId=$oMp->GetNextCode();
$oMp->programId_reg=$programR;
$oMp->programId_alumni=$programId_A;
// echo $programR."<br>";
$oMp->Save();
}
$obj->SearchByDate(splitDateForm(getNowDateFw2(),"/"));
if($obj->GetRecord()==0)
{
$obj->AddNew();
$obj->importId=$obj->GetNextCode();
$obj->importDate=splitDateForm(getNowDateFw2(),"/");
$obj->Save();
}
// Alumni Main
$oSm->RSStudentMasterStatusgraduateYear(4);
while($oSm->GetRecord())
{
$oAm2->SearchByStudentId($oSm->studentId);
if($oAm2->GetRecord()==0)
{
//echo $i+1;
//$i++;
$oAm->AddNew();
$oAm->alumniId=$oAm->GetNextCode();
$oAm->studentId=$oSm->studentId;
$oAm->studentCode=$oSm->studentCode;
$oAm->levelId=$oSm->levelId;
$oMp->SearchByprogramId_reg($oSm->programId);
$oMp->GetRecord();
$oAm->programId=$oMp->programId_alumni;
$oAm->prefixId=$oSm->prefixId;
$oAm->studentName=$oSm->studentName;
$oAm->studentSurname=$oSm->studentSurname;
$oAm->studentNameEng=$oSm->studentNameEng;
$oAm->studentSurnameEng=$oSm->studentSurnameEng;
$oAm->creditAttempt=$oSm->creditAttempt;
$oAm->creditSatisfy=$oSm->creditSatisfy;
$oAm->GPA=$oSm->GPA;
$oAm->admitAcadYear=$oSm->admitAcadYear;
$oAm->admitSemester=$oSm->admitSemester;
$oAm->admitDate=$oSm->admitDate;
$oAm->finishDate=$oSm->finishDate;
$oAm->studentPassword=$oSm->studentPassword;
$oAm->studentEmail=$oSm->studentEmail;
$oAm->studentYear=$oSm->studentYear;
$oAm->studentStatus=$oSm->studentStatus;
$oAm->officerId1=$oSm->officerId1;
$oAm->officerId2=$oSm->officerId2;
$oAm->financeStatus=$oSm->financeStatus;
$oAm->updateUserId=$oSm->updateUserId;
$oAm->updateDateTime=$oSm->updateDateTime;
$oAm->citizenId=$oSm->citizenId;
$oAm->graduateYear=$oSm->graduateYear;
$oAm->genStatus=$oSm->genStatus;
$oAm->genNo=$oSm->genNo;
$oAm->entryTypeId=$oSm->entryTypeId;
$oAm->entryTypeId2=$oSm->entryTypeId2;
$oAm->studentSex=$oSm->studentSex;
$oAm->scholarId=$oSm->scholarId;
$oAm->preAdmitPositionId=$oSm->preAdmitPositionId;
$oAm->totalPoint=$oSm->totalPoint;
$oAm->honor=$oSm->honor;
$oAm->medal=$oSm->medal;
$oAm->exitExam=$oSm->exitExam;
$oAm->studentStatusTmp=$oSm->studentStatusTmp;
$oAm->importtoalumni='A';
$oAm->glantId='N';
$oAm->glantDate=$glantDate;
$oAm->glantreqDate=$glantreqDate;
list($finishAcadYear, $monthAd, $dayAd) = split('[-]', (splitDateDbL($oAm->finishDate,"-")));
$oAm->finishAcadYear=$finishAcadYear+544;
$oAm->Save();
$oSb->SearchByKey($oSm->studentId);
$oSb->GetRecord();
$oAb->AddNew();
$oAb->alumniId=$oAm->alumniId;
$oAb->studentId=$oSb->studentId;
$oAb->nationId=$oSb->nationId;
$oAb->religionId=$oSb->religionId;
$oAb->bloodGroup=$oSb->bloodGroup;
$oAb->birthDate=$oSb->birthDate;
$oAb->birthProvinceId=$oSb->birthProvinceId;
$oAb->homeAddress=$oSb->homeAddress;
$oAb->homeDistrictId=$oSb->homeDistrictId;
$oAb->homeAmphurId=$oSb->homeAmphurId;
$oAb->homeProvinceId=$oSb->homeProvinceId;
$oAb->homeZipcode=$oSb->homeZipcode;
$oAb->homePhoneNo=$oSb->homePhoneNo;
$oAb->officeName=$oSb->officeName;
$oAb->officeAddress=$oSb->officeAddress;
$oAb->officeDistrictId=$oSb->officeDistrictId;
$oAb->officeAmphurId=$oSb->officeAmphurId;
$oAb->officeProvinceId=$oSb->officeProvinceId;
$oAb->officeZipcode=$oSb->officeZipcode;
$oAb->officePhoneNo=$oSb->officePhoneNo;
$oAb->workingStatus=$oSb->workingStatus;
$oAb->workingPosition=$oSb->workingPosition;
$oAb->workingSalary=$oSb->workingSalary;
$oAb->fatherName=$oSb->fatherName;
$oAb->fatherAddress=$oSb->fatherAddress;
$oAb->fatherDistrictId=$oSb->fatherDistrictId;
$oAb->fatherAmphurId=$oSb->fatherAmphurId;
$oAb->fatherProvinceId=$oSb->fatherProvinceId;
$oAb->fatherZipcode=$oSb->fatherZipcode;
$oAb->fatherPhoneNo=$oSb->fatherPhoneNo;
$oAb->fatherOccupation=$oSb->fatherOccupation;
$oAb->fatherStatus=$oSb->fatherStatus;
$oAb->motherName=$oSb->motherName;
$oAb->motherAddress=$oSb->motherAddress;
$oAb->motherDistrictId=$oSb->motherDistrictId;
$oAb->motherAmphurId=$oSb->motherAmphurId;
$oAb->motherProvinceId=$oSb->motherProvinceId;
$oAb->motherZipcode=$oSb->motherZipcode;
$oAb->motherPhoneNo=$oSb->motherPhoneNo;
$oAb->motherOccupation=$oSb->motherOccupation;
$oAb->motherStatus=$oSb->motherStatus;
$oAb->studentSex=$oSb->studentSex;
$oAb->parentName=$oSb->parentName;
$oAb->parentRelation=$oSb->parentRelation;
$oAb->parentAddress=$oSb->parentAddress;
$oAb->parentDistrictId=$oSb->parentDistrictId;
$oAb->parentAmphurId=$oSb->parentAmphurId;
$oAb->parentProvinceId=$oSb->parentProvinceId;
$oAb->parentZipcode=$oSb->parentZipcode;
$oAb->parentPhoneNo=$oSb->parentPhoneNo;
$oAb->parentMobile=$oSb->parentMobile;
$oAb->parentOcc=$oSb->parentOcc;
$oAb->parentIncome=$oSb->parentIncome;
$oAb->parentEmail=$oSb->parentEmail;
$oAb->contactPerson=$oSb->contactPerson;
$oAb->contactAddress=$oSb->contactAddress;
$oAb->contactDistrictId=$oSb->contactDistrictId;
$oAb->contactAmphurId=$oSb->contactAmphurId;
$oAb->contactProvinceId=$oSb->contactProvinceId;
$oAb->contactZipcode=$oSb->contactZipcode;
$oAb->contactPhoneNo=$oSb->contactPhoneNo;
$oAb->cardExpiryDate=$oSb->cardExpiryDate;
$oAb->currentAddress=$oSb->currentAddress;
$oAb->currentDistrictId=$oSb->currentDistrictId;
$oAb->currentAmphurId=$oSb->currentAmphurId;
$oAb->currentProvinceId=$oSb->currentProvinceId;
$oAb->currentZipcode=$oSb->currentZipcode;
$oAb->currentPhoneNo=$oSb->currentPhoneNo;
$oAb->graduateAddress=$oSb->graduateAddress;
$oAb->graduateDistrictId=$oSb->graduateDistrictId;
$oAb->graduateAmphurId=$oSb->graduateAmphurId;
$oAb->graduateProvinceId=$oSb->graduateProvinceId;
$oAb->graduateZipcode=$oSb->graduateZipcode;
$oAb->graduatePhoneNo=$oSb->graduatePhoneNo;
$oAb->maritalStatusId=$oSb->maritalStatusId;
$oAb->weight=$oSb->weight;
$oAb->height=$oSb->height;
$oAb->picturePath="../picturePerson/photo.gif";
$oAb->recruitmentTypeId=$oSb->recruitmentTypeId;
$oAb->occExamResult=$oSb->occExamResult;
$oAb->canRefund=$oSb->canRefund;
$oAb->oldStudentName=$oSb->oldStudentName;
$oAb->entryDegree=$oSb->entryDegree;
$oAb->healthPrivId=$oSb->healthPrivId;
$oAb->o1prefixId=$o1prefixId;
$oAb->o1fName=$o1fName;
$oAb->o1lName=$o1lName;
$oAb->o2prefixId=$o2prefixId;
$oAb->o2fName=$o2fName;
$oAb->o2lName=$o2lName;
$countup ++;
$oAb->Save();
}
}
}else if($method=="edit"){
$obj->SearchByKey($importId);
$obj->GetRecord();
$obj->Edit();
$obj->importId=$importId;
$obj->importDate=$importDate;
$obj->Save();
}else if($method=="delete"){
$obj->SearchByKey($importId);
$obj->GetRecord();
$obj->Delete();
}
echo "<meta http-equiv='refresh' content='0; URL=addalumni_reg.php?check=2&numnewrecord=$countup'>";
?>
|