status screen updation, enroll pending document details updation : kdk

This commit is contained in:
resicovenba 2018-02-23 17:42:48 +05:30
parent 52a5fcf031
commit 2f657d5b67
8 changed files with 332 additions and 76 deletions

View File

@ -132,6 +132,8 @@ $route['getExistingStudentDetails'] = 'Student_Controller/getExistingStudentDeta
$route['addStudentEntrollDocDetails'] = 'Student_Controller/addStudentEntrollDocDetails';
$route['getListofStuDocDetails'] = 'Student_Controller/getListofStuDocDetails';
$route['deleteStuDocDetails'] = 'Student_Controller/deleteStuDocDetails';
$route['getListofStuPendingDocDetails'] = 'Student_Controller/getListofStuPendingDocDetails';
$route['addStudentEnrollPendingDocDetails'] = 'Student_Controller/addStudentEnrollPendingDocDetails';
//batch
$route['addBatchDetails'] = 'Batch_Controller/addBatchDetails';

View File

@ -316,6 +316,55 @@ class Student_Controller extends REST_Controller {
}
// get student pending enrollment document details
public function getListofStuPendingDocDetails_post() {
$StudentID = $this->post('exceptId');
$localdata = $this->post('localData');
$studentPendingDocDetails = $this->student_model->getStudent_PendingDoc_Details($StudentID);
if ($studentPendingDocDetails)
{
$studentPendingDocDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($studentPendingDocDetails, 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 addStudentEnrollPendingDocDetails_post() {
$updateDetails = $this->post('updateDetails');
$localdata = $this->post('localData');
$reqData['StudentID'] = $updateDetails['student'];
$reqData['Details'] = $updateDetails['doc_Details'];
$reqData['Status'] = $updateDetails['checkTracking'];
$reqData['CreatedBy'] = $localdata['localUserID'];
$date = date('Y-m-d H:i:s');
$reqData['CreatedOn'] = $date;
$addStudentPendingDocDetails = $this->student_model->addStu_PendingDoc_Details($reqData);
if ($addStudentPendingDocDetails)
{
$addStudentPendingDocDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($addStudentPendingDocDetails, 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() {

View File

@ -996,6 +996,39 @@ class Student_model extends CI_Model
}
}
public function getStudent_PendingDoc_Details($stuID) {
$this->db->select('*');
$this->db->order_by('CreatedOn', 'DESC');
$this->db->from('T_Student_DocumentTrack_Details');
$this->db->where('StudentID', $stuID);
$getPendDocDetails = $this->db->get();
$documentPendingDetails = $getPendDocDetails->result();
if (count($documentPendingDetails) > 0) {
$results['PendingDocListStatus'] = true;
$results['student_pending_doc_details'] = $documentPendingDetails;
}
else {
$results['PendingDocListStatus'] = false;
$results['message'] = 'No record found';
}
return $results;
}
// add student enrollment pending document details
public function addStu_PendingDoc_Details($reqData) {
// echo "model";
// print_r($reqData);exit();
$this->db->insert('T_Student_DocumentTrack_Details', $reqData);
if ($this->db->affected_rows() > 0) {
$results['AddStuPendingDocStatus'] = true;
$results['message'] = "Added Successfully.";
} else {
$results['AddStuPendingDocStatus'] = 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

@ -293,10 +293,10 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa
}
}
$scope.semDetails =[{"id": 1, "type": "SEM 1"}, {"id": 2, "type": "SEM 2"},
$scope.semDetails =[{"id": 1, "type": "SEM 1"}, {"id": 2, "type": "SEM 2"},
{"id": 3, "type": "SEM 3"}, {"id": 4, "type": "SEM 4"}, {"id": 5, "type": "SEM 5"},
{"id": 6, "type": "SEM 6"}, {"id": 7, "type": "SEM 7"}, {"id": 8, "type": "SEM 8"}]
{"id": 6, "type": "SEM 6"}, {"id": 7, "type": "SEM 7"}, {"id": 8, "type": "SEM 8"}
, {"id": 9, "type": "YEAR 1"}, {"id": 10, "type": "YEAR 2"}, {"id": 11, "type": "YEAR 3"}, {"id": 12, "type": "YEAR 4"}]
$scope.statusUpdate = {
submit: function (form, myStatusModel, localBranchDetails) {

View File

@ -327,10 +327,10 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa
}
}
$scope.semDetails =[{"id": 1, "type": "SEM 1"}, {"id": 2, "type": "SEM 2"},
$scope.semDetails =[{"id": 1, "type": "SEM 1"}, {"id": 2, "type": "SEM 2"},
{"id": 3, "type": "SEM 3"}, {"id": 4, "type": "SEM 4"}, {"id": 5, "type": "SEM 5"},
{"id": 6, "type": "SEM 6"}, {"id": 7, "type": "SEM 7"}, {"id": 8, "type": "SEM 8"}]
{"id": 6, "type": "SEM 6"}, {"id": 7, "type": "SEM 7"}, {"id": 8, "type": "SEM 8"}
, {"id": 9, "type": "YEAR 1"}, {"id": 10, "type": "YEAR 2"}, {"id": 11, "type": "YEAR 3"}, {"id": 12, "type": "YEAR 4"}]
// Update the status For Certification
$scope.statusUpdate = {

View File

@ -1042,6 +1042,94 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}
}
$scope.PendingDocNotFound = false;
// student pending document details
$scope.getStudentPendingEntrolDocDetails = function(stuId) {
// $scope.studentDocumentsList = '';
var getStudentPendingDocDetails = {
method: 'POST',
url: apiPoint.url + 'getListofStuPendingDocDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
exceptId: stuId,
localData: localDetail
}
};
$http(getStudentPendingDocDetails).then(function (response) {
if (response.data.PendingDocListStatus == true) {
$scope.PendingDocNotFound = false;
$scope.studentPendingDocumentsDetails = response.data.student_pending_doc_details;
} else {
$scope.PendingDocNotFound = true;
}
});
}
$scope.myModelAddPendingDocDetails = {
"documentDetails": "",
"checkTracking": false
}
$scope.studentEntrollPendingDocFORM = {
submit: function (form, myModelAddPendingDocDetails, stuID) {
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
if (field[0] != '$') {
if (firstError === null && !form[field].$valid) {
firstError = form[field].$name;
}
if (form[field].$pristine) {
form[field].$dirty = true;
}
}
}
angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else {
var ModelDetails = {
"student" : stuID,
"doc_Details": myModelAddPendingDocDetails.documentDetails,
"checkTracking": myModelAddPendingDocDetails.checkTracking
};
var updateStudentPendingDocDetails = {
method: 'POST',
url: apiPoint.url + 'addStudentEnrollPendingDocDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
updateDetails: ModelDetails,
localData: localDetail
}
};
$http(updateStudentPendingDocDetails).then(function (response) {
if (response.data.AddStuPendingDocStatus == true) {
$scope.getStudentPendingEntrolDocDetails(stuID);
$scope.myModelAddPendingDocDetails = {
"documentDetails": "",
"checkTracking": false
}
} else {
swal(" ", res.data.message, "error");
}
});
}
},
reset: function (form) {
$scope.myModelAddPendingDocDetails = {
"documentDetails": "",
"checkTracking": false
}
}
}
// end : entrollment document upload ====================================
$scope.stepsModelEdit = [];

View File

@ -303,7 +303,8 @@ app.controller('studyMaterialStatusCtrl', ["$scope", "toaster", "$filter", "ngTa
$scope.semDetails =[{"id": 1, "type": "SEM 1"}, {"id": 2, "type": "SEM 2"},
{"id": 3, "type": "SEM 3"}, {"id": 4, "type": "SEM 4"}, {"id": 5, "type": "SEM 5"},
{"id": 6, "type": "SEM 6"}, {"id": 7, "type": "SEM 7"}, {"id": 8, "type": "SEM 8"}]
{"id": 6, "type": "SEM 6"}, {"id": 7, "type": "SEM 7"}, {"id": 8, "type": "SEM 8"}
, {"id": 9, "type": "YEAR 1"}, {"id": 10, "type": "YEAR 2"}, {"id": 11, "type": "YEAR 3"}, {"id": 12, "type": "YEAR 4"}]
$scope.statusUpdate = {
submit: function (form, myStatusModel, localBranchDetails) {

View File

@ -391,99 +391,182 @@
</div>
</div>
</fieldset>
</div>
</div>
</div>
</form>
</tab>
<tab heading="Document Details" id="documentDetails">
<!--<h1>Document Details</h1>-->
<div ng-init="getStuEntrollDocDetails(p.StudentID)">
<fieldset style="background-color: #eaeaea;">
<legend>
Add Document Details
</legend>
<div class="container">
<form name="FormDoc" id="formDoc" novalidate ng-submit="studentEntrollDocFORM.submit(FormDoc, myModelAddDocuments, p.StudentID)"
method="post">
<div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':FormDoc.documentName.$dirty && FormDoc.documentName.$invalid, 'has-success':FormDoc.documentName.$valid}">
<label>
<!--<tab heading="Document Details" id="documentDetails">
<tabset class="tabbable" style="border: 1px solid #c5c5c5; border-radius: 3px; box-shadow: 3px 5px #c3c3c3;">
<tab heading="Add Document Details">
<div ng-init="getStuEntrollDocDetails(p.StudentID)">
<fieldset style="background-color: #eaeaea;">
<legend>
Add Document Details
</legend>
<div class="container">
<form name="FormDoc" id="formDoc" novalidate ng-submit="studentEntrollDocFORM.submit(FormDoc, myModelAddDocuments, p.StudentID)"
method="post">
<div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':FormDoc.documentName.$dirty && FormDoc.documentName.$invalid, 'has-success':FormDoc.documentName.$valid}">
<label>
Document Name <span
class="symbol required"></span>
</label>
<input type="text" name="documentName" tabindex="1" placeholder="Document Name" class="form-control" ng-model="myModelAddDocuments.documentName"
required/>
<span class="error text-small block" ng-if="FormDoc.documentName.$dirty && FormDoc.documentName.$invalid" ng-hide="FormDoc.documentName.$error.maxlength || FormDoc.documentName.$error.minlength || FormDoc.documentName.$error.pattern">Document Name is required.</span>
</div>
<div class="col-md-4 form-group">
<input type="text" name="documentName" tabindex="1" placeholder="Document Name" class="form-control" ng-model="myModelAddDocuments.documentName"
required/>
<span class="error text-small block" ng-if="FormDoc.documentName.$dirty && FormDoc.documentName.$invalid" ng-hide="FormDoc.documentName.$error.maxlength || FormDoc.documentName.$error.minlength || FormDoc.documentName.$error.pattern">Document Name is required.</span>
</div>
<div class="col-md-4 form-group">
<label>
<label>
Attach File <span
class="symbol required"></span>
</label>
<span>
<span>
<input type="file" accept="/*" file-upload-document />
</span>
<!--<span class="d-inline-block">
<button tooltip="Reset" class="btn btn-warning btn-xs pull-right" tabindex="6" ng-click="studentEntrollDocFORM.reset(FormDoc)">
<i class="ti-reload"></i>
</button>
</span>-->
</div>
<div class="col-md-2">
<label>
</div>
<div class="col-md-2">
<label>
</label>
<div>
<button tooltip="Upload" type="submit" ng-disabled="disableButton" tabindex="5" class="btn btn-xs btn-success">
<div>
<button tooltip="Upload" type="submit" ng-disabled="disableButton" tabindex="5" class="btn btn-xs btn-success">
<i class="ti-upload"></i>
</button>
<button tooltip="Reset" class="btn btn-warning btn-xs" tabindex="6" ng-click="studentEntrollDocFORM.reset(FormDoc)">
<button tooltip="Reset" class="btn btn-warning btn-xs" tabindex="6" ng-click="studentEntrollDocFORM.reset(FormDoc)">
<i class="ti-reload"></i>
</button>
</div>
</div>
</div>
<div class="row">
<div class="center">
<h5 ng-show="documentAddDetailsLoading" style="color:#007AFF">Loading...</h5>
</div>
</div>
</div>
</div>
<div class="row">
<div class="center">
<h5 ng-show="documentAddDetailsLoading" style="color:#007AFF">Loading...</h5>
</div>
</div>
</div>
</form>
</fieldset>
<div id="documentDetalils">
<div class="table-responsive">
<table class="table table-hover" ng-controller="studentModalDemoCtrl">
<thead>
<tr>
<th>Document Name</th>
<th>Details</th>
<th class="center">Download/Delete</th>
</tr>
</thead>
<tbody ng-repeat="doc in studentDocumentsList">
<tr>
<td>{{doc.DocumentName}}</td>
<td>{{doc.DocumentStorePath}}</td>
<td class="center"><button tooltip="Download" class="btn btn-xs btn-primary"><i class="ti-download">
</form>
</fieldset>
<div id="documentDetalils">
<div class="table-responsive">
<table class="table table-hover" ng-controller="studentModalDemoCtrl">
<thead>
<tr>
<th>Document Name</th>
<th>Details</th>
<th class="center">Download/Delete</th>
</tr>
</thead>
<tbody ng-repeat="doc in studentDocumentsList">
<tr>
<td>{{doc.DocumentName}}</td>
<td>{{doc.DocumentStorePath}}</td>
<td class="center"><button tooltip="Download" class="btn btn-xs btn-primary"><i class="ti-download">
<a ng-href="http://localhost/apollo_New_Update_20_02_2018/apollodec/Apollo/images/{{doc.DocumentStorePath}}" target="_blank"></a> </i></button>
<button tooltip="Delete" class="btn btn-xs btn-danger" ng-click="deleteDocDetails(doc.ID, p.StudentID)"><i class="ti-trash">
<button tooltip="Delete" class="btn btn-xs btn-danger" ng-click="deleteDocDetails(doc.ID, p.StudentID)"><i class="ti-trash">
</i></button>
<!--<a ng-src="images/{{doc.DocumentStorePath}}" target="_blank">here!</a>-->
<!--http://localhost/apollo_New_Update_20_02_2018/apollodec/Apollo/-->
</td>
</tr>
</tbody>
</table>
<div ng-if="docNotFound">
<span style="color:tomato;"> No document details found **</span>
</td>
</tr>
</tbody>
</table>
<div ng-if="docNotFound">
<span style="color:tomato;"> No document details found **</span>
</div>
</div>
</div>
</div>
</div>
</div>
</tab>
</tab>
<tab heading="Pending Document Details">
<fieldset style="background-color: #eaeaea;">
<legend>
Pending Document Details
</legend>
<div class="container">
<form name="FormPendDoc" id="formPendDoc" novalidate ng-submit="studentEntrollPendingDocFORM.submit(FormPendDoc, myModelAddPendingDocDetails, p.StudentID)"
method="post">
<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
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>
</div>
<div class="col-md-3 form-group">
<label>
Track Status
</label>
<div ng-switch="myModelAddPendingDocDetails.checkTracking">
<div ng-switch-when="true">
<switch ng-model="myModelAddPendingDocDetails.checkTracking" ng-init="myModelAddPendingDocDetails.checkTracking = true" class="green"></switch>
</div>
<div ng-switch-when="false">
<switch ng-model="myModelAddPendingDocDetails.checkTracking" ng-init="myModelAddPendingDocDetails.checkTracking = false"
class="green"></switch>
</div>
<div ng-switch-default>
<switch ng-model="myModelAddPendingDocDetails.checkTracking" ng-init="myModelAddPendingDocDetails.checkTracking = false"
class="green"></switch>
</div>
</div>
</div>
<div class="col-md-3">
<label>
</label>
<div>
<button tooltip="Upload" type="submit" ng-disabled="disableButton" tabindex="5" class="btn btn-xs btn-success">
Add
</button>
<button tooltip="Reset" class="btn btn-warning btn-xs" tabindex="6" ng-click="studentEntrollPendingDocFORM.reset(FormPendDoc)">
Reset
</button>
</div>
</div>
</div>
<div class="row">
<div class="center">
<h5 ng-show="documentAddDetailsLoading" style="color:#007AFF">Loading...</h5>
</div>
</div>
</div>
</form>
</fieldset>
<div id="documentDetalils" ng-init="getStudentPendingEntrolDocDetails(p.StudentID)">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Details</th>
<th>Status</th>
<th class="center">Delete</th>
</tr>
</thead>
<tbody ng-repeat="penddoc in studentPendingDocumentsDetails">
<tr>
<td>{{penddoc.Details}}</td>
<td>{{penddoc.Status}}</td>
<td class="center">
<button tooltip="Delete" class="btn btn-xs btn-danger" ng-click="deleteDocDetails(doc.ID, p.StudentID)">
<i class="ti-trash"></i></button>
</td>
</tr>
</tbody>
</table>
<div ng-if="PendingDocNotFound">
<span style="color:tomato;"> No details found **</span>
</div>
</div>
</div>
</tab>
</tabset>
</tab>-->
</tabset>
<!-- class="editRowTd" -->