university enrolment file upload changes
This commit is contained in:
parent
009f07c7f4
commit
a0e8671a28
@ -64,7 +64,10 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller {
|
|||||||
$updatedDetails = $this->receive_model->updateEnrolmentDetails($enrolmentDetails,$fromDetails);// Check if the users data store contains users (in case the database result returns NULL)
|
$updatedDetails = $this->receive_model->updateEnrolmentDetails($enrolmentDetails,$fromDetails);// Check if the users data store contains users (in case the database result returns NULL)
|
||||||
if ($updatedDetails['status'])
|
if ($updatedDetails['status'])
|
||||||
{
|
{
|
||||||
$updatedDetails['status'] = true;
|
// Set the response and exit
|
||||||
|
$this->response($updatedDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||||
|
}
|
||||||
|
else if($updatedDetails['status']==false){
|
||||||
// Set the response and exit
|
// Set the response and exit
|
||||||
$this->response($updatedDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
$this->response($updatedDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||||
}
|
}
|
||||||
|
|||||||
@ -309,6 +309,7 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sizeof($get_data)>0) {
|
if(sizeof($get_data)>0) {
|
||||||
// check form id exit in table for insert / update
|
// check form id exit in table for insert / update
|
||||||
$formIDData = $this->db->select('FormID')->order_by('SubmitID', 'ASC')->get(ENROLMENTRECEIVEDFROMUNIV)->result_array();
|
$formIDData = $this->db->select('FormID')->order_by('SubmitID', 'ASC')->get(ENROLMENTRECEIVEDFROMUNIV)->result_array();
|
||||||
@ -320,15 +321,16 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
|
|||||||
if(sizeof($get_data)>0){
|
if(sizeof($get_data)>0){
|
||||||
|
|
||||||
$matchedKey = array_search($fvalue['FormID'], array_column($get_data, 'FormID'));
|
$matchedKey = array_search($fvalue['FormID'], array_column($get_data, 'FormID'));
|
||||||
if ($matchedKey!='') {
|
if ($matchedKey!== false) {
|
||||||
// $updateForms[count($updateForms)] = $get_data[$matchedKey];
|
// $updateForms[count($updateForms)] = $get_data[$matchedKey];
|
||||||
// $form_ids[]=$fvalue['FormID'];
|
// $form_ids[]=$fvalue['FormID'];
|
||||||
array_splice($get_data, 0, 1);
|
array_splice($get_data, $matchedKey, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
if (sizeof($get_data) > 0) {
|
if (sizeof($get_data) > 0) {
|
||||||
$this->db->insert_batch(ENROLMENTRECEIVEDFROMUNIV, $get_data);
|
$this->db->insert_batch(ENROLMENTRECEIVEDFROMUNIV, $get_data);
|
||||||
if ($this->db->affected_rows() > 0) {
|
if ($this->db->affected_rows() > 0) {
|
||||||
@ -339,7 +341,7 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
|
|||||||
return $finalArray;
|
return $finalArray;
|
||||||
} else {
|
} else {
|
||||||
$finalArray['status'] = false;
|
$finalArray['status'] = false;
|
||||||
$finalArray['message'] = "Insert failed please check data.";
|
$finalArray['message'] = "Please check file data.";
|
||||||
$finalArray['insertedRows'] = $this->db->affected_rows();
|
$finalArray['insertedRows'] = $this->db->affected_rows();
|
||||||
$finalArray['details'] = $errorArray;
|
$finalArray['details'] = $errorArray;
|
||||||
return $finalArray;
|
return $finalArray;
|
||||||
@ -347,7 +349,7 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
$finalArray['status'] = false;
|
$finalArray['status'] = false;
|
||||||
$finalArray['message'] = "Updated Successfully.";;
|
$finalArray['message'] = "Please check file data.";;
|
||||||
$finalArray['details'] = $errorArray;
|
$finalArray['details'] = $errorArray;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -358,12 +360,11 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$finalArray['status'] = false;
|
$finalArray['status'] = false;
|
||||||
$finalArray['message'] = "Insert failed please check data.";
|
$finalArray['message'] = "Please check file data.";
|
||||||
$finalArray['insertedRows'] = $this->db->affected_rows();
|
$finalArray['insertedRows'] = $this->db->affected_rows();
|
||||||
$finalArray['details'] = $errorArray;
|
$finalArray['details'] = $errorArray;
|
||||||
return $finalArray;
|
return $finalArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $finalArray;
|
return $finalArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -238,7 +238,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil
|
|||||||
$scope.error = function (e) {
|
$scope.error = function (e) {
|
||||||
/* DO SOMETHING WHEN ERROR IS THROWN */
|
/* DO SOMETHING WHEN ERROR IS THROWN */
|
||||||
//console.log(e);
|
//console.log(e);
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,6 +247,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil
|
|||||||
swal("Warning", "No data found for insert ", "warning");
|
swal("Warning", "No data found for insert ", "warning");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
$scope.uniqueDetails = $filter('unique')(details,'Form Id');
|
||||||
var updateUniversityEnrolment = {
|
var updateUniversityEnrolment = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiPoint.url + 'receiveEnrolmentFromUniv/',
|
url: apiPoint.url + 'receiveEnrolmentFromUniv/',
|
||||||
@ -255,7 +256,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
localDetails: localDetail,
|
localDetails: localDetail,
|
||||||
details: details,
|
details: $scope.uniqueDetails,
|
||||||
universityID: angular.fromJson(uploadForDetails.university).UniversityID,
|
universityID: angular.fromJson(uploadForDetails.university).UniversityID,
|
||||||
universityName: angular.fromJson(uploadForDetails.university).UniversityName,
|
universityName: angular.fromJson(uploadForDetails.university).UniversityName,
|
||||||
|
|
||||||
@ -266,7 +267,11 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil
|
|||||||
if (response.data.status == true) {
|
if (response.data.status == true) {
|
||||||
swal("", "Updated Successfully", "success");
|
swal("", "Updated Successfully", "success");
|
||||||
$state.go($state.current, {}, {reload: true});
|
$state.go($state.current, {}, {reload: true});
|
||||||
} else {
|
}
|
||||||
|
else if(response.data.status == false){
|
||||||
|
swal("", response.data.message, "error");
|
||||||
|
}
|
||||||
|
else {
|
||||||
swal("", "Failed", "error");
|
swal("", "Failed", "error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -481,7 +486,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user