university fees details changes

This commit is contained in:
gandhimathi 2018-08-28 18:47:46 +05:30
parent e9097fcc93
commit 6f83a746e1

View File

@ -20,25 +20,243 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
public function updateEnrolmentDetails($enrolment=null,$local=null)
{
// create array for find sem value
$keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4');
$valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4");
$errorArray=array();
// loop for fetch details
foreach ($enrolment as $checkRow){
// check enrolment no and form id in upload list
if(array_key_exists("Enrollment_No",$checkRow) AND array_key_exists("Form Id",$checkRow)){
// check enrolment no exist in student course details details
$this->db->select('STC.BranchID,US.UniversityID,US.UniversityName');
$this->db->select('STC.StudentID,STC.BranchID,CF.ID,CF.ProgramType,CF.Sem_Year');
$this->db->from(STUDENTCOURSE.' as STC');
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID AND US.BranchCode = STC.BranchID');
$this->db->join(COURSE_FEES.' as CF', 'CF.CourseID = STC.CourseID');
$this->db->where('STC.EnrollmentID',$checkRow['Enrollment_No']);
$studentCourseDetails = $this->db->get()->first_row();
if($studentCourseDetails){
}
else{
$error["StudentName"]=$checkRow['Student_Name'];
$error["Message"]="Enrolment number is not exist in student course details.";
$errorArray[]=$error;
$studentCourseDetails = $this->db->get();
if($studentCourseDetails->num_rows()>1){
foreach ($studentCourseDetails->result() as $feesRow){
// change sem year
$serachKey= array_search(strtoupper($feesRow->Sem_Year),$keyArray);
if($valueArray[$serachKey]==$checkRow['Semester']){
$this->db->select('FeesID');
$this->db->from(STUDENTS_FEES_STATUS.' as SFS');
$this->db->where('SFS.StudentID',$feesRow->StudentID);
$this->db->where('SFS.FeesType',$feesRow->ID);
$studentFeesDetails = $this->db->get()->last_row();
if($studentFeesDetails){
$this->db->select('FeesID');
$this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU');
$this->db->where('ENU.FormID',$checkRow['Form Id']);
$this->db->where('ENU.EnrolmentNo',$checkRow['Enrollment_No']);
$checkFormExist = $this->db->get();
}
if($checkFormExist->num_rows()==0){
$insert['FormID']=$checkRow['Form Id'];
$insert['EnrolmentNo']=$checkRow['Enrollment_No'];
// check key exist in json array
if(array_key_exists('Roll_No',$checkRow)){
$insert['RollNo']=$checkRow['Roll_No'];
}
$insert['CentreCode']=$checkRow['Centre Code'];
$insert['CentreState']=$checkRow['Centre State'];
if(array_key_exists('Student_Mob_No',$checkRow)){
$insert['MobileNumber']=$checkRow['Student_Mob_No'];
}
$insert['StudentName']=$checkRow['Student_Name'];
$insert['FatherName']=$checkRow['Father_Name'];
$insert['MotherName']=$checkRow['Mother_Name'];
$insert['EmailID']=$checkRow['Student_Email_Id'];
$insert['IDProof']=$checkRow['ID_Proof'];
$insert['Gender'] = $checkRow['Gender'];
$insert['DOB'] = $checkRow['Date_Of_Birth'];
if(array_key_exists('Address',$checkRow)) {
$insert['PresentAddress'] = $checkRow['Address'];
}
$insert['AadharNumber'] = $checkRow['Adhar_No'];
if(array_key_exists('Category',$checkRow)) {
$insert['Category'] = $checkRow['Category'];
}
$insert['CourseCode'] = $checkRow['Course_Code'];
$insert['UniversityCode'] = "AU001";
$insert['UniversityName'] = "Anna University";
if(array_key_exists('Specialization',$checkRow)) {
$insert['Specialization'] = $checkRow['Specialization'];
}
$insert['SemesterYear'] = $checkRow['Semester'];
if(array_key_exists('Session',$checkRow)) {
$insert['SessionName'] = $checkRow['Session'];
}
if(array_key_exists('Year',$checkRow)) {
$insert['Year'] = $checkRow['Year'];
}
if(array_key_exists('Form Type',$checkRow)) {
$insert['FormType'] = $checkRow['Form Type'];
}
if(array_key_exists('Entry Mode',$checkRow)) {
$insert['EntryMode'] = $checkRow['Entry Mode'];
}
if(array_key_exists('Remarks',$checkRow)) {
$insert['Remarks'] = $checkRow['Remarks'];
}
if(array_key_exists('Affidavit_Status',$checkRow)) {
$insert['AffidavitStatus'] = $checkRow['Affidavit_Status'];
}
if(array_key_exists('Migration_Status',$checkRow)) {
$insert['MigrationStatus'] = $checkRow['Migration_Status'];
}
if(array_key_exists('Finance_Status',$checkRow)) {
$insert['FinanceStatus'] = $checkRow['Finance_Status'];
}
if(array_key_exists('Most Urgent DMC',$checkRow)) {
$insert['MostUrgentDMC'] = $checkRow['Most Urgent DMC'];
}
$insert['BranchCode'] = $feesRow->Sem_Year;
if(array_key_exists('created_By',$checkRow)) {
$insert['CreatedByName'] = $checkRow['created_By'];
}
if(array_key_exists('Created_Date',$checkRow)) {
$insert['CreatedDate'] = $checkRow['Created_Date'];
}
if(array_key_exists('Approved_By',$checkRow)) {
$insert['ApprovedByName'] = $checkRow['Approved_By'];
}
if(array_key_exists('Approved_Date',$checkRow)) {
$insert['ApprovedDate'] = $checkRow['Approved_Date'];
}
$insert['FeesID'] = $studentFeesDetails->FeesID;
$this->db->insert(ENROLMENTRECEIVEDFROMUNIV, $insert);
}
//this is else for update details
/*else{
}*/
}
else{
// for capture error message
$error["StudentName"]=$checkRow['Student_Name'];
$error["Message"]="This Student Don't have fees details.";
$errorArray[]=$error;
}
}
}
}
else if($studentCourseDetails->num_rows()==1){
foreach ($studentCourseDetails->result() as $feesRow){
// change sem year
$this->db->select('FeesID');
$this->db->from(STUDENTS_FEES_STATUS.' as SFS');
$this->db->where('SFS.StudentID',$feesRow->StudentID);
$this->db->where('SFS.FeesType',$feesRow->ID);
$studentFeesDetails = $this->db->get()->last_row();
if($studentFeesDetails){
$this->db->select('FeesID');
$this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU');
$this->db->where('ENU.FormID',$checkRow['Form Id']);
$this->db->where('ENU.EnrolmentNo',$checkRow['Enrollment_No']);
$checkFormExist = $this->db->get();
if($checkFormExist->num_rows()==0){
$insert['FormID']=$checkRow['Form Id'];
$insert['EnrolmentNo']=$checkRow['Enrollment_No'];
// check key exist in json array
if(array_key_exists('Roll_No',$checkRow)){
$insert['RollNo']=$checkRow['Roll_No'];
}
$insert['CentreCode']=$checkRow['Centre Code'];
$insert['CentreState']=$checkRow['Centre State'];
if(array_key_exists('Student_Mob_No',$checkRow)){
$insert['MobileNumber']=$checkRow['Student_Mob_No'];
}
$insert['StudentName']=$checkRow['Student_Name'];
$insert['FatherName']=$checkRow['Father_Name'];
$insert['MotherName']=$checkRow['Mother_Name'];
$insert['EmailID']=$checkRow['Student_Email_Id'];
$insert['IDProof']=$checkRow['ID_Proof'];
$insert['Gender'] = $checkRow['Gender'];
$insert['DOB'] = $checkRow['Date_Of_Birth'];
if(array_key_exists('Address',$checkRow)) {
$insert['PresentAddress'] = $checkRow['Address'];
}
$insert['AadharNumber'] = $checkRow['Adhar_No'];
if(array_key_exists('Category',$checkRow)) {
$insert['Category'] = $checkRow['Category'];
}
$insert['CourseCode'] = $checkRow['Course_Code'];
$insert['UniversityCode'] = "AU001";
$insert['UniversityName'] = "Anna University";
if(array_key_exists('Specialization',$checkRow)) {
$insert['Specialization'] = $checkRow['Specialization'];
}
$insert['SemesterYear'] = $checkRow['Semester'];
if(array_key_exists('Session',$checkRow)) {
$insert['SessionName'] = $checkRow['Session'];
}
if(array_key_exists('Year',$checkRow)) {
$insert['Year'] = $checkRow['Year'];
}
if(array_key_exists('Form Type',$checkRow)) {
$insert['FormType'] = $checkRow['Form Type'];
}
if(array_key_exists('Entry Mode',$checkRow)) {
$insert['EntryMode'] = $checkRow['Entry Mode'];
}
if(array_key_exists('Remarks',$checkRow)) {
$insert['Remarks'] = $checkRow['Remarks'];
}
if(array_key_exists('Affidavit_Status',$checkRow)) {
$insert['AffidavitStatus'] = $checkRow['Affidavit_Status'];
}
if(array_key_exists('Migration_Status',$checkRow)) {
$insert['MigrationStatus'] = $checkRow['Migration_Status'];
}
if(array_key_exists('Finance_Status',$checkRow)) {
$insert['FinanceStatus'] = $checkRow['Finance_Status'];
}
if(array_key_exists('Most Urgent DMC',$checkRow)) {
$insert['MostUrgentDMC'] = $checkRow['Most Urgent DMC'];
}
$insert['BranchCode'] = $feesRow->Sem_Year;
if(array_key_exists('created_By',$checkRow)) {
$insert['CreatedByName'] = $checkRow['created_By'];
}
if(array_key_exists('Created_Date',$checkRow)) {
$insert['CreatedDate'] = $checkRow['Created_Date'];
}
if(array_key_exists('Approved_By',$checkRow)) {
$insert['ApprovedByName'] = $checkRow['Approved_By'];
}
if(array_key_exists('Approved_Date',$checkRow)) {
$insert['ApprovedDate'] = $checkRow['Approved_Date'];
}
$insert['FeesID'] = $studentFeesDetails->FeesID;
$this->db->insert(ENROLMENTRECEIVEDFROMUNIV, $insert);
}
//this is else for update details
/*else{
}*/
}
else{
// for capture error message
$error["StudentName"]=$checkRow['Student_Name'];
$error["Message"]="This Student Don't have fees details.";
$errorArray[]=$error;
}
}
}
else{
// for capture error message
$error["StudentName"]=$checkRow['Student_Name'];
$error["Message"]="Enrolment number is not exist in course details.";
$errorArray[]=$error;
}
}
else{
@ -47,10 +265,10 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
$error["Message"]="Enrolment number/Form id is not exist.";
$errorArray[]=$error;
}
print_r($errorArray);
}
die();
$finalArray['details']=$errorArray;
print_r($finalArray);die();
return false;
}