enrollment pending document updation : kdk

This commit is contained in:
resicovenba 2018-02-27 14:14:02 +05:30
parent 67d09fafcc
commit abff1cc1f7
7 changed files with 118 additions and 38 deletions

View File

@ -134,6 +134,7 @@ $route['getListofStuDocDetails'] = 'Student_Controller/getListofStuDocDetails';
$route['deleteStuDocDetails'] = 'Student_Controller/deleteStuDocDetails';
$route['getListofStuPendingDocDetails'] = 'Student_Controller/getListofStuPendingDocDetails';
$route['addStudentEnrollPendingDocDetails'] = 'Student_Controller/addStudentEnrollPendingDocDetails';
$route['deleteDocPendingDetails'] = 'Student_Controller/deleteDocPendingDetails';
//batch
$route['addBatchDetails'] = 'Batch_Controller/addBatchDetails';

View File

@ -366,6 +366,29 @@ class Student_Controller extends REST_Controller {
}
}
// delete pending enrollment document details
public function deleteDocPendingDetails_post() {
$expID = $this->post('exceptId');
$localData = $this->post('localData');
// echo $expID;
// print_r($localData);exit();
$stuEnrollPendingDocDeleteDetails = $this->student_model->deleteStu_entrollPending_doc_details($expID);
if ($stuEnrollPendingDocDeleteDetails)
{
$stuEnrollPendingDocDeleteDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($stuEnrollPendingDocDeleteDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function updateStudentImgDetails_post() {
$imagename = $_FILES['idStuUpProof']['name'];
@ -640,7 +663,7 @@ class Student_Controller extends REST_Controller {
$reqCourse['UniversityID'] = $coursedata['university'];
$reqCourse['CourseID'] = $coursedata['course'];
$reqCourse['BatchCode'] = $coursedata['batch'];
$reqCourse['SessionID'] = $coursedata['batch'];
$reqCourse['DOJ'] = $coursedata['dateofjoining'];
$reqCourse['BranchID'] = $createdBranch;
$reqCourse['IsActive'] = $data['switchsetting'];
@ -712,7 +735,7 @@ class Student_Controller extends REST_Controller {
$reqCourse['UniversityID'] = $coursedata['university'];
$reqCourse['CourseID'] = $coursedata['course'];
$reqCourse['BatchCode'] = $coursedata['batch'];
$reqCourse['SessionID'] = $coursedata['batch'];
$reqCourse['DOJ'] = $coursedata['dateofjoining'];
$reqCourse['BranchID'] = $createdBranch;
$reqCourse['IsActive'] = $data['switchsetting'];

View File

@ -1030,6 +1030,20 @@ class Student_model extends CI_Model
return $results;
}
public function deleteStu_entrollPending_doc_details($id) {
// echo $id;exit();
$sql = "DELETE FROM ".STUDENTDOCUMENTTRACKDETAILS." WHERE ID = '" . $id . "'";
if ($this->db->query($sql)) {
$results['deleteStatus'] = true;
$results['message'] = 'Document pending track details deleted.';
} else {
$results['deleteStatus'] = false;
$results['message'] = 'Something went wrong.please try again';
}
return $results;
}
// update student personal details
public function update_student($empArr, $updateFor, $imagename, $imageSource, $size)

View File

@ -180,7 +180,7 @@ $scope.dayBookApprovalAccess = '';
"description": "",
"paidTo": "",
"description_paid": "",
"voucherNumber": ""
"voucherNumber": ""
}
}

View File

@ -709,9 +709,23 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}
$scope.getChangeDate = function () {
var formate = "dd-MM-yyyy";
$scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
// alert();
try {
var formate = "dd-MM-yyyy";
$scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
// alert($scope.myModel.dateofbirth);
// var myDate = new Date($scope.myModel.dateofbirth);
// alert(myDate);
// if(typeof myDate === 'function') {
// alert("true")
// } else {
// alert("error")
// }
}
catch(e) {
// alert('error');
// alert(err);
}
}
// add student
@ -736,10 +750,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
} else {
$scope.disableButton = true;
var formate = "dd-MM-yyyy";
// $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
$scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0;
$scope.myModelCourseAdd.dateofjoining = $filter('date')(new Date($scope.myModelCourseAdd.dateofjoining), formate);
var idStuProof = $scope.files[0];
// alert(JSON.stringify($scope.myModel));
if (idStuProof !== undefined) {
var formData = new FormData();
var idProof = $scope.files[0];
@ -1042,7 +1057,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}
}
$scope.PendingDocNotFound = false;
// $scope.PendingDocNotFound = false;
// student pending document details
$scope.getStudentPendingEntrolDocDetails = function(stuId) {
// $scope.studentDocumentsList = '';
@ -1060,10 +1075,10 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
};
$http(getStudentPendingDocDetails).then(function (response) {
if (response.data.PendingDocListStatus == true) {
$scope.PendingDocNotFound = false;
// $scope.PendingDocNotFound = false;
$scope.studentPendingDocumentsDetails = response.data.student_pending_doc_details;
} else {
$scope.PendingDocNotFound = true;
// $scope.PendingDocNotFound = true;
}
});
}
@ -1073,10 +1088,12 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
"documentDetails": "",
"checkTracking": false
}
$scope.documentTrackAddDetailsLoading = false;
$scope.studentEntrollPendingDocFORM = {
submit: function (form, myModelAddPendingDocDetails, stuID) {
$scope.documentTrackAddDetailsLoading = true;
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
@ -1112,12 +1129,14 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
$http(updateStudentPendingDocDetails).then(function (response) {
if (response.data.AddStuPendingDocStatus == true) {
$scope.getStudentPendingEntrolDocDetails(stuID);
$scope.documentTrackAddDetailsLoading = false;
$scope.myModelAddPendingDocDetails = {
"documentDetails": "",
"checkTracking": false
}
} else {
swal(" ", res.data.message, "error");
$scope.documentTrackAddDetailsLoading = false;
}
});
}
@ -1130,27 +1149,45 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}
}
$scope.deletePendingDocDetails = function(details, StuID, Url) {
// alert(JSON.stringify(details));
$scope.printPdf = function (file_Uid){
alert(file_Uid);
$http({
url : 'http://localhost/apollo_New_Update_20_02_2018/apollodec/Apollo/images/'+ file_Uid,
method : 'GET',
headers : {
'Content-type' : 'application/pdf'
},
responseType : 'arraybuffer'
}).success(function(data, status, headers, config) {
var pdfFile = new Blob([ data ], {
type : 'application/pdf'
});
var pdfUrl = URL.createObjectURL(pdfFile);
var printwWindow = $window.open(pdfUrl);
// printwWindow.print();
}).error(function(data, status, headers, config) {
alert('Sorry, something went wrong')
SweetAlert.swal({
title: "Warning!",
text: "Want to Delete this Entry ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#007aff",
confirmButtonText: "Yes!"
}, function (res) {
if (res === true) {
$scope.documentTrackAddDetailsLoading = true;
var deleteDocEntry = {
method: 'POST',
url: apiPoint.url + 'deleteDocPendingDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
exceptId: details.ID,
localData: localDetail
}
};
$http(deleteDocEntry).then(function (response) {
if (response.data.deleteStatus == true) {
// swal("Success!", response.data.message, "success");
$scope.documentTrackAddDetailsLoading = false;
$scope.studentDocumentsList = '';
$scope.getStudentPendingEntrolDocDetails(StuID);
} else {
swal(" ", res.data.message, "error");
$scope.documentTrackAddDetailsLoading = false;
}
});
}
});
};
}
// end : entrollment document upload ====================================

View File

@ -147,7 +147,9 @@
<td class="center" ng-if="p.Status != 'Pending' && p.ListName != 'Income' ">-</td>
<td class="center" ng-if="p.ListName == 'Income' ">
<span ng-if=" p.PaymentStatus == 1 "> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>
<span ng-if=" p.PaymentStatus == 0 "> <i tooltip="DELETE" class="glyphicon glyphicon-remove" ng-click="deleteFeePayableEntry(p.ID)"></i> </span>
<span ng-if=" p.PaymentStatus == 0 ">
<!--<i tooltip="DELETE" class="glyphicon glyphicon-remove" ng-click="deleteFeePayableEntry(p.ID)"></i> -->
</span>
</td>
<td class="center" ng-if="p.Status == 'Pending'">
<span> <i tooltip="EDIT" class="glyphicon glyphicon-pencil" ng-click="setEditId(p.ID)"></i> </span>

View File

@ -481,7 +481,7 @@
</div>
</div>
</tab>
<!--<tab heading="Pending Document Details">
<tab heading="Pending Document Details">
<fieldset style="background-color: #eaeaea;">
<legend>
Pending Document Details
@ -492,13 +492,13 @@
<div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':FormPendDoc.documentDetails.$dirty && FormPendDoc.documentDetails.$invalid, 'has-success':FormPendDoc.documentDetails.$valid}">
<label>
Document Details <span
Pending Document Details <span
class="symbol required"></span>
</label>
<textarea type="text" placeholder="Document Details" tabindex="1" class="form-control" name="documentDetails" ng-model="myModelAddPendingDocDetails.documentDetails"
maxlength="100" required/>
<span class="text-small block" style="color: rgba(128, 128, 128, 0.64)">Max 100 Characters.</span>
<span class="error text-small block" ng-if="FormPendDoc.documentDetails.$dirty && FormPendDoc.documentDetails.$invalid" ng-hide="FormPendDoc.documentDetails.$error.maxlength || FormPendDoc.documentDetails.$error.minlength || FormPendDoc.documentDetails.$error.pattern">Document Name is required.</span>
<span class="error text-small block" ng-if="FormPendDoc.documentDetails.$dirty && FormPendDoc.documentDetails.$invalid" ng-hide="FormPendDoc.documentDetails.$error.maxlength || FormPendDoc.documentDetails.$error.minlength || FormPendDoc.documentDetails.$error.pattern">Pending Document Details required.</span>
</div>
<div class="col-md-3 form-group">
@ -535,7 +535,7 @@
</div>
<div class="row">
<div class="center">
<h5 ng-show="documentAddDetailsLoading" style="color:#007AFF">Loading...</h5>
<h5 ng-show="documentTrackAddDetailsLoading" style="color:#007AFF">Loading...</h5>
</div>
</div>
</div>
@ -554,9 +554,12 @@
<tbody ng-repeat="penddoc in studentPendingDocumentsDetails">
<tr>
<td>{{penddoc.Details}}</td>
<td>{{penddoc.Status}}</td>
<td>
<span ng-if="penddoc.Status == 1">Open</span>
<span ng-if="penddoc.Status == 0">Close</span>
</td>
<td class="center">
<button tooltip="Delete" class="btn btn-xs btn-danger" ng-click="deleteDocDetails(doc.ID, p.StudentID)">
<button tooltip="Delete" class="btn btn-xs btn-danger" ng-click="deletePendingDocDetails(penddoc, p.StudentID)">
<i class="ti-trash"></i></button>
</td>
</tr>
@ -567,7 +570,7 @@
</div>
</div>
</div>
</tab>-->
</tab>
</tabset>
</tab>
</tabset>