diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 0465bb22..472986f4 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -379,4 +379,6 @@ $route['getUniversityCodeForFormDetailsGet'] = 'Receive_Enrolment_Fees_Univ_Cont $route['getUnmatchedFormIdFeesDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUnmatchedFormIdFeesDetails'; $route['addToAccountStateList'] = 'Receive_Enrolment_Fees_Univ_Controller/addToAccountStateList'; $route['addUniversityPaymentDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/addUniversityPaymentDetails'; +$route['updateUniversityPaymentDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/updateUniversityPaymentDetails'; + diff --git a/Apollo/api/application/controllers/HallTickets_Controller.php b/Apollo/api/application/controllers/HallTickets_Controller.php index 33906862..8a0b6b91 100644 --- a/Apollo/api/application/controllers/HallTickets_Controller.php +++ b/Apollo/api/application/controllers/HallTickets_Controller.php @@ -16,7 +16,7 @@ class HallTickets_Controller extends REST_Controller { function __construct() { - // Construct the parent class + // Construct the parent class parent::__construct(); // Configure limits on our controller methods @@ -320,13 +320,33 @@ class HallTickets_Controller extends REST_Controller { $branchId = $this->post('branchId'); $Cdate = new DateTime('now',new DateTimeZone('Asia/Kolkata')); $CreatedOn = $Cdate->format('Y-m-d H:i:s'); -/////////check semcoursemapping//// - // $data['subjectDetails'] = $this->Hallticket_model->getSubjectDetails($universityID,$tempCourseArray,$branchId); - $data['subjectDetails'] = $this->Hallticket_model->getExistDetailsfileupload($university,$courseArray,$branchId); - // print_r( $data['subjectDetails']); - if($data['subjectDetails'] == 1 ) + $fileArray = array(); + foreach($filedetails as $filedetailsarray) + { + $fileArray[]=$filedetailsarray['SubjectID']; + } + // print_r( $fileArray); + $data['subjectDetails'] = $this->Hallticket_model->getExistDetailsfileupload($university,$courseArray,$branchId); + // print_r( $data['subjectDetails']); + if($data['subjectDetails'] == 1 ) { - foreach($courseArray as $CourseDatialArray) + + $data['SubjectMappingDetails'] = $this->Hallticket_model->getSubjectMappingDetails($university,$courseArray,$branchId); + $maparray=array(); + foreach ( $data['SubjectMappingDetails'] as $object) + { + $maparray[]=$object->SubjectCode; + } + // $a1=$fileArray; + // $b1=$maparray; + // print_r($maparray); + $result=array_diff($fileArray,$maparray); + $unmatched= sizeof($result); + + if ($unmatched == 0 ) + { + + foreach($courseArray as $CourseDatialArray) { $course=$CourseDatialArray; $schedulemaster = array('UniversityID'=>$university,'CourseID'=>$course,'BranchCode'=>$branchId,'CreatedBy'=>$requestedBy,'CreatedOn'=>$CreatedOn); @@ -355,28 +375,35 @@ class HallTickets_Controller extends REST_Controller { 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); - } + } + } + else + { + $this->response([ + 'message' => 'Records Do Not Match With Mapped Subjects!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } } // else if($data['subjectDetails'] == 0) else { $this->response([ - 'message' => 'Please Mapping the course supject!', + 'message' => ' Course Mapping for the Subject Not Found !', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); } - // else{ - - // $this->response([ - // 'message' => 'No records found!', - // 'status' => REST_Controller::HTTP_NOT_FOUND - // ], REST_Controller::HTTP_NOT_FOUND); - - // } -///////////////////// - + + + + + + + + + } public function SaveAllBatchSchedule_post() diff --git a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php index 01120c37..39ebe638 100644 --- a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php +++ b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php @@ -38,6 +38,7 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { $this->methods['addManualEnrolmentDetails_post']['limit'] = 1000; $this->methods['addUniversityPaymentDetails_post']['limit'] = 1000; + $this->methods['updateUniversityPaymentDetails_post']['limit'] = 1000; // load the model $this->load->model('Receive_Enrolment_Fees_Univ_model', 'receive_model'); @@ -135,12 +136,12 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { $formData['EnrolmentNo'] = $this->post('enrolmentId');; $getDetails = $this->receive_model->getFormIDFeeDetails($formData); - if ($getDetails['status']=true) + if ($getDetails['formTypeStatus']=true) { // Set the response and exit $this->response($getDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } - else if($getDetails['status']=false){ + else if($getDetails['formTypeStatus']=false){ $this->response([ 'message' => $getDetails['Message'], ], REST_Controller::HTTP_OK); // NOT_FOUND (404) being the HTTP response code @@ -150,7 +151,7 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { // Set the response and exit $this->response([ 'message' => 'Something went wrong.please try again!', - 'status' => false + 'formTypeStatus' => false ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } @@ -159,9 +160,13 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { $getDetailsFor = $this->post('getDetailsFor'); $getUnmatchedFormDetails = $this->receive_model->getUnmatchedFormDetails($getDetailsFor);// Check if the users data store contains users (in case the database result returns NULL) - if ($getUnmatchedFormDetails) + if ($getUnmatchedFormDetails['unMatchedRecordStatus']) + { + // Set the response and exit + $this->response($getUnmatchedFormDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else if ($getUnmatchedFormDetails['unMatchedRecordStatus']==false) { - $getUnmatchedFormDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getUnmatchedFormDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } @@ -170,7 +175,7 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { // Set the response and exit $this->response([ 'message' => 'Something went wrong.please try again!', - 'status' => REST_Controller::HTTP_NOT_FOUND + 'formTypeStatus' => false ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } @@ -277,7 +282,9 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { // kdk public function getForFormIdDraftDetails_post(){ $reqBranch = $this->post('localDetails'); - $getForFormIdDraftDetails = $this->receive_model->getForFormIdDraftDetails(); // Check if the employee exist + $getDetailsFor = $this->post('getDetailsFor'); + + $getForFormIdDraftDetails = $this->receive_model->getForFormIdDraftDetails($getDetailsFor); // Check if the employee exist if ($getForFormIdDraftDetails) { $getForFormIdDraftDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit @@ -517,6 +524,42 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + /* + * update university payment details*/ + public function updateUniversityPaymentDetails_post(){ + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details=$this->post('details'); + $localData=$this->post('localDetails'); + $update['ID']=$details['ID']; + $update['PaymentID']=$details['paymentID']; + $payment['BillNo']=$details['billNo']; + $payment['ReceiptNo']=$details['receiptNo']; + $payment['Amount']=$details['billAmount']; + $payment['ApprovedDate']=$details['date']; + $payment['Remarks']=$details['comments']; + $payment['BranchCode']=$localData['localBranchID']; + $payment['updatedBy']=$localData['localUserID']; + $payment['updatedOn']=$now->format('Y-m-d H:i:s'); + // debit array + $debit['DebitAmount']=$details['billAmount']; + $debit['ApprovedDate']=$details['date']; + $debit['BranchCode']=$localData['localBranchID']; + $debit['updatedBy']=$localData['localUserID']; + $debit['updatedOn']=$now->format('Y-m-d H:i:s'); + $updatePaymentDetails=$this->receive_model->updatePaymentDetails($update,$payment,$debit); + if($updatePaymentDetails['status']==true){ + $this->response($updatePaymentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else if($updatePaymentDetails['status']==false){ + $this->response($updatePaymentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else{ + $this->response(['message' => 'Try again', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + } } \ No newline at end of file diff --git a/Apollo/api/application/models/Hallticket_model.php b/Apollo/api/application/models/Hallticket_model.php index a11cd9b0..4c17cf0e 100644 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -10,7 +10,7 @@ class Hallticket_model extends CI_Model { - + /* * get university details * created by velz @@ -122,7 +122,7 @@ class Hallticket_model extends CI_Model and bsm.CourseID=semmaster.CourseID LEFT JOIN T_Batch_Schedule_Child bsc ON bsc.SchId = bsm.SchId and bsc.SubjectID=semchild.SubjectID LEFT JOIN T_SubjectMaster sm ON sm.SubjectID=semchild.SubjectID -WHERE semchild.isActive = '1' and bsm.SchId='".$mapid."' +WHERE semchild.isActive = '1' and bsm.SchId='".$mapid."' group by semchild.SubjectID,semchild.MapID"; $b=$this->db->query($sql); //print_r($b); @@ -135,8 +135,8 @@ group by semchild.SubjectID,semchild.MapID"; $this->db->select('T_Batch_Schedule_Child.SchId,T_Batch_Schedule_Child.SubjectID,T_Batch_Schedule_Child.ScheduleDate,T_Batch_Schedule_Child.FromTime,T_Batch_Schedule_Child.ToTime,T_Batch_Schedule_Child.SchChildId,T_Batch_Schedule_Child.SchId'); $this->db->from('T_Batch_Schedule_Master SCM'); $this->db->join('T_Batch_Schedule_Child','T_Batch_Schedule_Child.SchId = SCM.SchId'); - //$this->db->where('SCM.BranchCode',$branchcode); - // $this->db->where('T_Batch_Schedule_Child.SchId',$mapid); + $this->db->where('SCM.BranchCode',$branchcode); + $this->db->where('T_Batch_Schedule_Child.SchId',$mapid); $this->db->where('T_Batch_Schedule_Child.SubjectID',$row->SubjectID); $existsheduledetails = $this->db->get(); //print_r($existsheduledetails); @@ -200,16 +200,16 @@ group by semchild.SubjectID,semchild.MapID"; public function getExistDetailsfileupload($universityID,$courseIDS,$branchId) { -// print_r($courseIDS); -// echo $universityID; + $i=0; foreach($courseIDS as $c) { // $tempCourseArray= $c['CourseID']; - $this->db->select ('count(*) as count'); + $this->db->select ('count(*) as count,T_SemSubMap_Child.SubjectID'); $this->db->from('T_SemSubMap_Master'); + $this->db->join('T_SemSubMap_Child','T_SemSubMap_Child.MapID=T_SemSubMap_Master.MapID'); $this->db->where('UniversityID',$universityID); $this->db->where('CourseID',$c); $result = $this->db->get(); @@ -235,6 +235,35 @@ public function getExistDetailsfileupload($universityID,$courseIDS,$branchId) * @params university id and CourseID * created by Bala * */ +public function getSubjectMappingDetails($universityID,$courseIDS,$branchId) + { + + + + foreach($courseIDS as $c) + { + + // $tempCourseArray= $c['CourseID']; + + $this->db->select ('T_SubjectMaster.SubjectCode'); + $this->db->from('T_SemSubMap_Master'); + $this->db->join('T_SemSubMap_Child','T_SemSubMap_Child.MapID=T_SemSubMap_Master.MapID'); + $this->db->join('T_SubjectMaster','T_SubjectMaster.SubjectID=T_SemSubMap_Child.SubjectID'); + $this->db->where('T_SemSubMap_Master.UniversityID',$universityID); + $this->db->where('T_SemSubMap_Master.CourseID',$c); + $this->db->where('T_SubjectMaster.BranchCode',$branchId); + $result = $this->db->get(); + + + } + return $result->result(); + + } + /* + * check existing data,only batchschedule. + * @params university id and CourseID + * created by Bala + * */ public function getExistDetails($universityID,$courseIDS,$branchId) { diff --git a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php index e4c23cf8..2a9f6068 100644 --- a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php +++ b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php @@ -549,7 +549,7 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { } else { $resultArr['studentFeeCompareDetails'] = []; $resultArr['formTypeStatus'] = false; - $resultArr['message'] = "No record found"; + $resultArr['message'] = "No record found..."; } return $resultArr; } @@ -734,7 +734,7 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { $resultArr['unMatchedRecordDetails'] = $mergeFormDetails; $resultArr['unMatchedRecordStatus'] = false; $resultArr['unMatchedRecordFor'] = 'EnrolmentIDFile'; - $resultArr['message'] = "Successfully data generated"; + $resultArr['message'] = "No record found..."; } @@ -743,7 +743,7 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { $resultArr['unMatchedRecordDetails'] = []; $resultArr['unMatchedRecordStatus'] = false; $resultArr['unMatchedRecordFor'] = 'EnrolmentIDFile'; - $resultArr['message'] = "Successfully data generated"; + $resultArr['message'] = "No record found..."; } @@ -893,8 +893,10 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { // get formid draft mode list details // kdk - public function getForFormIdDraftDetails(){ - $selectQuery = "SELECT * FROM T_FormId_FeeDetails_Received_From_University WHERE DraftStatus = 1"; + public function getForFormIdDraftDetails($getUnivDetails){ + $selectUniv = $getUnivDetails['univCode']; + + $selectQuery = "SELECT * FROM T_FormId_FeeDetails_Received_From_University WHERE UniversityID = '$selectUniv' AND DraftStatus = 1"; $details = $this->db->query($selectQuery); $detailsList = $details->result(); if($detailsList) { @@ -1100,7 +1102,8 @@ $result['updatedraftStatus'] = false; $this->db->select('FUD.*, concat(ST.FirstName," ", ST.Lastname) as app_StudentName, IF(concat(ST.FirstName," " , ST.Lastname) = FUD.Student_Name, "YES", "NO") as StudentNameStatus , ST.Fathername as app_FatherName, IF(ST.Fathername = FUD.Father_Name, "YES", "NO") as FathernameStatus, - CM.CourseCode as app_CourseCode, IF(CM.CourseCode = FUD.CourseCode, "YES", "NO" ) as CourseCodeStatus'); + CM.CourseCode as app_CourseCode, IF(CM.CourseCode = FUD.CourseCode, "YES", "NO" ) as CourseCodeStatus, + IF(ENU.SemesterYear = FUD.Semester, "YES", "NO" ) as SemesterStatus'); $this->db->from('T_FormId_FeeDetails_Received_From_University as FUD'); $this->db->join(ENROLMENTRECEIVEDFROMUNIV.' as ENU', 'FUD.FormID = ENU.FormID' ); $this->db->join(STUDENTCOURSE.' as STC', 'STC.EnrollmentID = ENU.EnrolmentNo'); @@ -1352,7 +1355,7 @@ $result['updatedraftStatus'] = false; * created by kms * */ public function getPaymentVerificationDetails($search){ - $this->db->select('UNCD.ID,UNCD.FormMapID,UNCD.PaymentMapID,UNCD.FormID,UNCD.CreditAmount,UNCD.DebitAmount,UNCD.ApprovedDate,UNCD.UniversityCode,UNCD.UniversityName,UNCD.TypeID,ENU.EnrolmentNo,UNP.BillNo,UNP.PID as PaymentID'); + $this->db->select('UNCD.ID,UNCD.FormMapID,UNCD.PaymentMapID,UNCD.FormID,UNCD.CreditAmount,UNCD.DebitAmount,DATE_FORMAT(UNCD.ApprovedDate, "%d-%m-%Y") as FormatDate,UNCD.ApprovedDate,UNCD.UniversityCode,UNCD.UniversityName,UNCD.TypeID,ENU.EnrolmentNo,UNP.BillNo,UNP.PID as PaymentID,UNP.Amount,UNP.ReceiptNo,UNP.Remarks'); $this->db->from(UNIVERSITYCREDITDEBIY.' as UNCD'); $this->db->join(FORMFEESRECEIVEDFROMUNIV.' as UNFR', 'UNFR.ID = UNCD.FormMapID','left'); $this->db->join(UNIVERSITYPAYMENT.' as UNP', 'UNP.PID = UNCD.PaymentMapID','left'); @@ -1467,4 +1470,77 @@ $result['updatedraftStatus'] = false; return $resultArray; } + /* + * update payment details + * created by kms + * */ + public function updatePaymentDetails($update=null,$payment=null,$debit=null){ + $resultArray=array(); + $this->db->where('UNP.BillNo', $payment['BillNo']); + $this->db->where('UNP.PID != ', $update['PaymentID']); + $this->db->select('UNP.BillNo'); + $this->db->from(UNIVERSITYPAYMENT.' as UNP'); + $billExist = $this->db->get(); + if($billExist->num_rows()<=0){ + if($payment['ReceiptNo']!='' AND $payment['ReceiptNo']!=null){ + $this->db->where('UNP1.ReceiptNo', $payment['ReceiptNo']); + $this->db->where('UNP1.PID != ', $update['PaymentID']); + $this->db->select('UNP1.ReceiptNo'); + $this->db->from(UNIVERSITYPAYMENT.' as UNP1'); + $receiptExist = $this->db->get(); + if($receiptExist->num_rows()<=0){ + $this->db->where('PID', $update['PaymentID']); + $this->db->update(UNIVERSITYPAYMENT, $payment); + if ($this->db->affected_rows() > 0) { + $this->db->where('ID', $update['ID']); + $this->db->update(UNIVERSITYCREDITDEBIY, $debit); + if ($this->db->affected_rows() > 0) { + $resultArray['status']=true; + $resultArray['message']="Payment update successfully"; + } + else{ + $resultArray['status']=false; + $resultArray['message']="Payment update failed.try again"; + } + + } else { + $resultArray['status']=false; + $resultArray['message']="Payment failed.Try again"; + } + } + else{ + $resultArray['status']=false; + $resultArray['message']="Receipt no is already exist.."; + } + } + else{ + $this->db->where('PID', $update['PaymentID']); + $this->db->update(UNIVERSITYPAYMENT, $payment); + if ($this->db->affected_rows() > 0) { + $this->db->where('ID', $update['ID']); + $this->db->update(UNIVERSITYCREDITDEBIY, $debit); + if ($this->db->affected_rows() > 0) { + $resultArray['status']=true; + $resultArray['message']="Payment update successfully"; + } + else{ + $resultArray['status']=false; + $resultArray['message']="Payment update failed.try again"; + } + + + } else { + $resultArray['status']=false; + $resultArray['message']="Payment failed.Try again"; + } + + } + } + else { + $resultArray['status']=false; + $resultArray['message']="Bill no is already exist.."; + } + return $resultArray; + + } } \ No newline at end of file diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index 81f26042..610733c7 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -118,6 +118,13 @@ "APPLICATION": "Application" } }, + "formupload": { + "MAIN": "UNIVERSITY FORMS", + "ENROLLMENT": "Enrollment", + "STUDENTFEEDETAILCOMPARE": "Form Enrolment", + "STUDENTFROMIDFEEDETAILS": "Form Fees", + "UNIVERSITYFORMPAYMENT": "Payment" + }, "status": { "MAIN": "STATUS", "APPLICATION": "Application", diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index ac339ca7..233770c9 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -307,30 +307,14 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com ncyBreadcrumb: { label: 'Manage Details' } - }).state('app.student.UnivFormEnroment', { - url: '/univformenrolment', - templateUrl: "assets/views/student/studentUnivFeeCompareDetails.html", - resolve: loadSequence('ui.select', 'spin', 'ui.mask', 'monospaced.elastic', 'ladda', 'touchspin-plugin', 'angular-ladda', 'student_university_fee_compareCtrl', 'ngTable'), - title: 'University Form Enrolment', + }) + .state('app.formupload', { + url: '/student', + template: '