application status updation functionalities new chnages : kdk

This commit is contained in:
dineshkumarkannan 2018-08-21 18:13:34 +05:30
parent fb4133b265
commit 1525c98ccd
5 changed files with 260 additions and 53 deletions

View File

@ -332,3 +332,7 @@ $route['report_balfee'] = 'Report/balfee';
$route['report_lead'] = 'Report/lead'; $route['report_lead'] = 'Report/lead';
$route['insertUniversityfile'] = 'UniversityFile_Controller/insertUniversityfile'; $route['insertUniversityfile'] = 'UniversityFile_Controller/insertUniversityfile';
//Application Form Details
$route['getApplicationFromDetails'] = 'StatusUpdation_Controller/getApplicationFromDetails';
$route['updateApplicationFormStatus'] = 'StatusUpdation_Controller/updateApplicationFormStatus';
$route['getApplicationFormStatusList'] = 'StatusUpdation_Controller/getApplicationFormStatusList';

View File

@ -232,7 +232,6 @@ class StatusUpdation_Controller extends REST_Controller {
public function getApplicationFromDetails_post(){ public function getApplicationFromDetails_post(){
$reqData = $this->post('data'); $reqData = $this->post('data');
$reqBranch = $this->post('reqBranch'); $reqBranch = $this->post('reqBranch');
// print_r($reqData);exit();
$getApplicationFormDetails = $this->statusupdation_model->get_applicationFrom_details($reqData, $reqBranch); // Check if the employee exist $getApplicationFormDetails = $this->statusupdation_model->get_applicationFrom_details($reqData, $reqBranch); // Check if the employee exist
if ($getApplicationFormDetails) { if ($getApplicationFormDetails) {
$getApplicationFormDetails['status'] = REST_Controller::HTTP_OK; $getApplicationFormDetails['status'] = REST_Controller::HTTP_OK;
@ -245,4 +244,38 @@ class StatusUpdation_Controller extends REST_Controller {
} }
} }
}
public function updateApplicationFormStatus_post(){
$reqData = $this->post('data');
$reqBranch = $this->post('requestDetails');
$updateApplicationFormStatus = $this->statusupdation_model->update_applicationForm_status($reqData, $reqBranch); // Check if the employee exist
if ($updateApplicationFormStatus) {
$updateApplicationFormStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($updateApplicationFormStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function getApplicationFormStatusList_post(){
$reqData = $this->post('data');
$reqBranch = $this->post('reqBranch');
$getApplicationFormStatusList = $this->statusupdation_model->get_ApplicationFormStatusDetails($reqData, $reqBranch); // Check if the employee exist
if ($getApplicationFormStatusList) {
$getApplicationFormStatusList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getApplicationFormStatusList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
}

View File

@ -316,7 +316,7 @@ class StatusUpdation_model extends CI_Model {
if( $statuToMsg == 'received' || $statuToMsg == 'Received' || $statuToMsg == 'RECEIVED'){ if( $statuToMsg == 'received' || $statuToMsg == 'Received' || $statuToMsg == 'RECEIVED'){
$cerNamtToMsg = 'Answer booklet'; $cerNamtToMsg = 'Answer booklet';
$getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']);
$getSemYearANDType = "$getSemYearMsg $cerNamtToMsg"; $getSemYearANDType = "$getSemYearMsg";
// $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; // $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg.";
// $mesg = "$cerNamtToMsg Received - Dear $studentName, Your $getSemYearANDType had been received."; // $mesg = "$cerNamtToMsg Received - Dear $studentName, Your $getSemYearANDType had been received.";
$mesg = "Answer booklet Received - Dear $studentName, Your answer booklet for $getSemYearANDType has been received."; $mesg = "Answer booklet Received - Dear $studentName, Your answer booklet for $getSemYearANDType has been received.";
@ -593,7 +593,7 @@ class StatusUpdation_model extends CI_Model {
$config = array( $config = array(
'protocol' => 'smtp', 'protocol' => 'smtp',
'smtp_host' => 'smtp.sendgrid.net', 'smtp_host' => 'smtp.sendgrid.net',
'smtp_port' => 465, 'smtp_port' => 587,
'smtp_user' => 'apikey', 'smtp_user' => 'apikey',
'smtp_pass' => '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', 'smtp_pass' => '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',
'mailtype' => 'html', 'mailtype' => 'html',
@ -602,12 +602,13 @@ class StatusUpdation_model extends CI_Model {
$this->email->initialize($config); $this->email->initialize($config);
$this->email->set_mailtype("html"); $this->email->set_mailtype("html");
$this->email->set_newline("\r\n"); $this->email->set_newline("\r\n");
// print_r($this->email);exit();
//Email content //Email content
// $htmlContent = '<h1>Sending email via SMTP server</h1>'; // $htmlContent = '<h1>Sending email via SMTP server</h1>';
$htmlContent = $msg; $htmlContent = $msg;
// Email body load the html template // Email body load the html template
// $body = $this->load->view('emails/anillabs.php',$data,TRUE); // $body = $this->load->view('emails/anillabs.php',$data,TRUE);
$this->email->to($list); $this->email->to('dineshkumar.k@venbainfotech.com');
$this->email->from('noreply@apollodec.com','Apollo'); $this->email->from('noreply@apollodec.com','Apollo');
$subj = $sub; $subj = $sub;
$this->email->subject($subj); $this->email->subject($subj);
@ -883,8 +884,80 @@ class StatusUpdation_model extends CI_Model {
//get application form details //get application form details
public function get_applicationFrom_details($reqData, $reqBranch) { public function get_applicationFrom_details($reqData, $reqBranch) {
echo $reqData['studId']; $studentId = $reqData['studId'];
echo $reqData['courseId']; $courseId = $reqData['courseId'];
// $searchTableFor = APPLICATION_FORM;
$this->db->select('t1.ID, t1.Student_Fee_Status_Id, t1.BatchCode, t1.FeeType as SemID, CFD.Sem_Year as Sem_Year, t1.RegistrationMode, t1.RegistrationType');
$this->db->from('T_Registration_Details as t1');
$this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = t1.FeeType');
$this->db->where('t1.StudentID', $studentId);
$this->db->where('t1.CourseID', $courseId);
$fromTypes = $this->db->get();
$formTypeDetails = $fromTypes->result();
if($formTypeDetails){
// print_r($formTypeDetails);exit();
$resultArr['formTypeDetails'] = $formTypeDetails;
$resultArr['formTypeStatus'] = true;
$resultArr['message'] = "Successfully data generated";
} else {
// print_r($formTypeDetails);exit();
$resultArr['formTypeDetails'] = [];
$resultArr['formTypeStatus'] = false;
$resultArr['message'] = "No record found";
}
return $resultArr;
} }
}
public function update_applicationForm_status($reqData, $reqBranch){
$arr['Registration_Details_ID'] = $reqData[0]['register_details_id'];
$arr['ListCode'] = $reqData[0]['ListCode'];
$arr['Comments'] = $reqData[0]['Comments'];
$arr['AppFormDate'] = $reqData[0]['SDate'];
$arr['BranchCode'] = $reqBranch['localBranchID'];
$arr['CreatedBy'] = $reqBranch['localUserID'];
$time = date('Y-m-d H:i:s');
$dateTime = $time;
$arr['CreatedOn'] = $dateTime;
// print_r($arr);exit();
$this->db->insert('T_ApplicationFormStatus', $arr);
if ($this->db->affected_rows() >= 1) {
$result['addStatus'] = true;
$result['message'] = "Successfully Application Form Status Updated";
} else {
$result['addStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
return $result;
}
public function get_ApplicationFormStatusDetails($reqData, $reqBranch){
$studentId = $reqData['studId'];
$courseId = $reqData['courseId'];
// echo $studentId;exit();
// $searchTableFor = APPLICATION_FORM;
$this->db->select('t1.ID, t2.BatchCode, t2.FeeType as SemID, CFD.Sem_Year as Sem_Year, t2.RegistrationMode, t2.RegistrationType, t1.AppFormDate as StatusUpdateDate,t3.ListName ');
$this->db->from('T_ApplicationFormStatus as t1');
$this->db->join('T_Registration_Details as t2', 't2.ID = t1.Registration_Details_ID');
$this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = t2.FeeType');
$this->db->join('' . PICK_LIST_DETAILS . ' as t3', 't3.ListCode = t1.ListCode', 'LEFT');
$this->db->where('t2.StudentID', $studentId);
$this->db->where('t2.CourseID', $courseId);
$fromTypes = $this->db->get();
$formTypeDetails = $fromTypes->result();
if($formTypeDetails){
// print_r($formTypeDetails);exit();
$resultArr['formTypeDetails'] = $formTypeDetails;
$resultArr['formTypeStatus'] = true;
$resultArr['message'] = "Successfully data generated";
} else {
// print_r($formTypeDetails);exit();
$resultArr['formTypeDetails'] = [];
$resultArr['formTypeStatus'] = false;
$resultArr['message'] = "No record found";
}
return $resultArr;
}
}

View File

@ -22,13 +22,15 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl
$scope.editId = -1; $scope.editId = -1;
} }
// Student Form type list
$scope.studentFormTypeList = "";
// get local client details // get local client details
var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetail = JSON.parse(localStorage.getItem('localObj'));
var localDetails = ipCookie('cookiechk'); var localDetails = ipCookie('cookiechk');
const localUpdateStatus = 'APPLICATIONFORM_STATUS'; const localUpdateStatus = 'APPICATION_STATUS';
$scope.localTypeSuperAdmin = false; $scope.localTypeSuperAdmin = false;
$scope.localBranchDetails = ''; $scope.localBranchDetails = '';
@ -97,14 +99,7 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl
'Name': '' 'Name': ''
} }
$scope.myStatusModel = {
'semYear': '',
'staus': '',
'dateOn': '',
'comment': '',
'certificatetype': '',
'certificateNumber': ''
}
// get university list while page is loading // get university list while page is loading
$scope.universityData = ''; $scope.universityData = '';
@ -276,8 +271,6 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl
} }
$scope.getApplicationFromDetails = function(frm_details){ $scope.getApplicationFromDetails = function(frm_details){
alert(JSON.stringify(frm_details));
var getStatusL = { var getStatusL = {
method: 'POST', method: 'POST',
url: apiPoint.url + 'getApplicationFromDetails/', url: apiPoint.url + 'getApplicationFromDetails/',
@ -290,8 +283,8 @@ alert(JSON.stringify(frm_details));
} }
}; };
$http(getStatusL).then(function (response) { $http(getStatusL).then(function (response) {
if (response.data.statusList) { if (response.data.formTypeStatus) {
$scope.statusDetailsList = response.data.statusList_details; $scope.studentFormTypeList = response.data.formTypeDetails;
} else { } else {
// $scope.searchLoading = false; // $scope.searchLoading = false;
} }
@ -349,8 +342,29 @@ alert(JSON.stringify(frm_details));
} }
} }
$scope.editStatus = false;
$scope.editStatusID = '';
$scope.statusUpdateView = function(id){
$scope.editStatus = true;
$scope.editStatusID = id;
$scope.myStatusModel = {
'id': '',
'staus': '',
'dateOn': '',
'comment': ''
}
}
$scope.myStatusModel = {
'staus': '',
'dateOn': '',
'comment': ''
}
$scope.statusUpdate = { $scope.statusUpdate = {
submit: function (form, myStatusModel, localBranchDetails) { submit: function (form, localBranchDetails, id) {
alert(id);
var firstError = null; var firstError = null;
if (form.$invalid) { if (form.$invalid) {
var field = null, firstError = null; var field = null, firstError = null;
@ -378,25 +392,20 @@ alert(JSON.stringify(frm_details));
$scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate);
var ItemsSelected = $scope.searchResultDetails.filter(function (item) { var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
if (item.Selected === true) { if (item.Selected === true) {
let getStudentID = new getStudentForUpdateDetails(item.StudentID, item.CourseID, item.BranchCode); let getStudentID = new getStudentForUpdateDetails(id);
studentForUpdate.push(getStudentID); studentForUpdate.push(getStudentID);
return true; return true;
} }
}); });
function getStudentForUpdateDetails(id, courseId, dCode) { function getStudentForUpdateDetails(id) {
this.StudentID = id;
this.CourseID = courseId;
this.BranchCode = dCode;
this.ListCode = $scope.myStatusModel.staus; this.ListCode = $scope.myStatusModel.staus;
this.SDate = $scope.myStatusModel.dateOn; this.SDate = $scope.myStatusModel.dateOn;
this.Coursedetail = id;
this.Comments = $scope.myStatusModel.comment; this.Comments = $scope.myStatusModel.comment;
this.CertificateType = $scope.myStatusModel.certificatetype; this.register_details_id = id
this.CertificateNumber = $scope.myStatusModel.certificateNumber;
} }
var updateStudyMaterial = { var updateStudyMaterial = {
method: 'POST', method: 'POST',
url: apiPoint.url + 'updateApplicationStatus/', url: apiPoint.url + 'updateApplicationFormStatus/',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
@ -430,13 +439,10 @@ alert(JSON.stringify(frm_details));
}, },
reset: function (form) { reset: function (form) {
form.$setPristine(true); form.$setPristine(true);
$scope.myStatusModel = { $scope.myStatusModel = {
'semYear': '',
'staus': '', 'staus': '',
'dateOn': '', 'dateOn': '',
'comment': '', 'comment': ''
'certificatetype': '',
'certificateNumber': ''
} }
} }
} }
@ -452,20 +458,22 @@ alert(JSON.stringify(frm_details));
$scope.prevStatusListForStudentCourse = ''; $scope.prevStatusListForStudentCourse = '';
var getPrevStatus = { var getPrevStatus = {
method: 'POST', method: 'POST',
url: apiPoint.url + 'getPrevStatusDetailsForStu/', url: apiPoint.url + 'getApplicationFormStatusList/',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
data: { data: {
statusFor: localUpdateStatus, data: {
getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID }, studId: p.StudentID,
data: localDetail courseId: p.CourseID
},
reqBranch: localDetails.localBranchID
} }
}; };
$http(getPrevStatus).then(function (response) { $http(getPrevStatus).then(function (response) {
if (response.data.preStatusDetails) { if (response.data.formTypeStatus) {
$scope.prevStatusListForStudentCourseLoading = false; $scope.prevStatusListForStudentCourseLoading = false;
$scope.prevStatusListForStudentCourse = response.data.preStatus_details_list; $scope.prevStatusListForStudentCourse = response.data.formTypeDetails;
$scope.prevNoRecordFound = false; $scope.prevNoRecordFound = false;
} else { } else {
$scope.prevStatusListForStudentCourseLoading = false; $scope.prevStatusListForStudentCourseLoading = false;

View File

@ -183,17 +183,20 @@
<thead style="background-color: cadetblue"> <thead style="background-color: cadetblue">
<th>Status</th> <th>Status</th>
<th>Comments</th> <th>Comments</th>
<th>Document Name</th> <th>Batch</th>
<th>Date</th> <th>Date</th>
<th>Updated By</th> <th>Sem/Year</th>
<th>Form Type</th>
</thead> </thead>
<tbody ng-repeat="s in prevStatusListForStudentCourse"> <tbody ng-repeat="s in prevStatusListForStudentCourse">
<td>{{s.ListName}}</td> <td>{{s.ListName}}</td>
<td><span style="white-space:pre-wrap;">{{s.Comments}}</span></td> <td><span style="white-space:pre-wrap;">{{s.Comments}}</span></td>
<td>{{s.CertificateName}}</td> <td>{{s.BatchCode}}</td>
<td>{{s.AppDate}}</td> <td>{{s.StatusUpdateDate}}</td>
<td>{{s.Firstname}}</td> <td>{{s.Sem_Year}}</td>
<td>{{s.RegistrationType}}</td>
<!--<td>{{s.Firstname}}</td>-->
</tbody> </tbody>
</table> </table>
</div> </div>
@ -238,7 +241,8 @@
<span class="glyphicon glyphicon-remove-circle"></span> <span class="glyphicon glyphicon-remove-circle"></span>
</a> </a>
</div> </div>
<div class="row"> { {studentFormTypeList | json}}
<!--<div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':Form.certificatetype.$dirty && Form.certificatetype.$invalid, 'has-success':Form.certificatetype.$valid}"> <div class="col-md-6 form-group" ng-class="{'has-error':Form.certificatetype.$dirty && Form.certificatetype.$invalid, 'has-success':Form.certificatetype.$valid}">
<label for="form-field-select-2"> <label for="form-field-select-2">
Certificate Type <span class="symbol required"></span> Certificate Type <span class="symbol required"></span>
@ -316,7 +320,7 @@
</button> </button>
</div> </div>
</div> </div>
</div> </div>-->
</fieldset> </fieldset>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@ -325,7 +329,7 @@
</div> </div>
</div> </div>
</form></div> </form></div>
<div ng-if="localTypeSuperAdmin"><form name="Form" id="form" novalidate ng-submit="statusUpdate.submit(Form, myStatusModel , localBranchDetails)" method="post"> <div ng-if="localTypeSuperAdmin">
<style> <style>
#cancel_button { #cancel_button {
margin-top: 1px; margin-top: 1px;
@ -348,8 +352,93 @@
<a id="cancel_button" ng-click="unSelect()" tooltip="Close"> <a id="cancel_button" ng-click="unSelect()" tooltip="Close">
<span class="glyphicon glyphicon-remove-circle"></span> <span class="glyphicon glyphicon-remove-circle"></span>
</a> </a>
</div>
<!--<pre>{{studentFormTypeList | json}}</pre>-->
<div ng-if="studentFormTypeList">
<table class="table table-strip" ng-init="editStatus = false; stufmtype.ID = -1">
<thead>
<tr>
<th>id</th>
<th>Batch</th>
<th>Sem/Year</th>
<th>From Type</th>
<th>Action</th>
</tr>
</thead>
<tbody ng-repeat="stufmtype in studentFormTypeList">
<tr>
<td>{{stufmtype.ID}}</td>
<td>{{stufmtype.BatchCode}}</td>
<td>{{stufmtype.Sem_Year}}</td>
<td>{{stufmtype.RegistrationType}}</td>
<td><i ng-click="statusUpdateView(stufmtype.ID)" tooltip="STATUS UPDATE" class="ti-slice"></i></td>
</tr>
<tr ng-if="editStatusID == stufmtype.ID">
<td colspan="6"><form name="Form" id="form" novalidate ng-submit="statusUpdate.submit(Form, localBranchDetails, stufmtype.ID)" method="post">
<div class="container">
<div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}">
<label for="form-field-select-2">
Status <span class="symbol required"></span>
</label>
<select class="form-control" tabindex="4" class="cs-select cs-skin-elastic" name="status" ng-model="myStatusModel.staus"
required>
<option value="" disabled selected>Select Status</option>
<option ng-repeat="itemStatus in statusDetailsList" value="{{itemStatus.ListCode}}">{{itemStatus.ListName}}</option>
</select>
<span class="error text-small block" ng-if="Form.status.$dirty && Form.status.$error.required">Status is Required</span>
</div>
<div data-ng-controller="DatepickerDemoCtrl">
<div class="col-md-6 form-group" ng-class="{'has-error':Form.dateofstaus.$dirty && Form.dateofstaus.$invalid, 'has-success':Form.dateofstaus.$valid}">
<label>
Date <span
class="symbol required"></span>
</label>
<input type="text" tabindex="6" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myStatusModel.dateOn"
is-open="startOpen" ng-init="startOpen = false" name="dateofstaus"
datepicker-options="dateOptions" placeholder="Select Date " close-text="Close"
required="required" ng-change="getMaxEndDate(myModel.startDate)"
/>
<span class="error text-small block" ng-if="Form.dateofstaus.$dirty && Form.dateofstaus.$invalid" ng-hide="Form.dateofstaus.$error.maxlength">Date is required.</span>
<span class="error text-small block" ng-if="Form.dateofstaus.$error.maxlength">Enter a Valid Date</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':Form.description.$dirty && Form.description.$invalid}">
<label>
Comments
</label>
<textarea type="text" placeholder="Enter Comments" tabindex="7" class="form-control" name="description" ng-model="myStatusModel.comment"
/>
<span class="error text-small block" ng-if="Form.description.$dirty && Form.description.$error.pattern">Invalid Comments</span>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12">
<div class="pull-right">
<button type="submit" ng-disabled="disableButton" tabindex="8" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success"
data-style="zoom-in">
<i class="fa fa-circle-o-notch fa-spin" ng-if="disableButton" style="font-size:14px"></i> Submit
</button>
<button type="reset" tabindex="9" class="btn btn-warning btn-wide" tabindex="9" ng-click="statusUpdate.reset(Form)">
Reset
</button>
</div>
</div>
</div>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<!--<div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':Form.certificatetype.$dirty && Form.certificatetype.$invalid, 'has-success':Form.certificatetype.$valid}"> <div class="col-md-6 form-group" ng-class="{'has-error':Form.certificatetype.$dirty && Form.certificatetype.$invalid, 'has-success':Form.certificatetype.$valid}">
<label for="form-field-select-2"> <label for="form-field-select-2">
Certificate Type <span class="symbol required"></span> Certificate Type <span class="symbol required"></span>
@ -428,7 +517,7 @@
</button> </button>
</div> </div>
</div> </div>
</div> </div>-->
</fieldset> </fieldset>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@ -436,7 +525,7 @@
</div> </div>
</div> </div>
</div> </div>
</form></div> </div>
</div> </div>
</td> </td>