updations : kdk

This commit is contained in:
resicovenba 2018-02-12 17:54:26 +05:30
parent b22f1c1c30
commit ade2356e6e
5 changed files with 83 additions and 29 deletions

View File

@ -128,7 +128,7 @@ class Employee_model extends CI_Model
$this->db->where('t2.StaffID', $EmpId);
$this->db->where('t2.IsActive', 1);
$this->db->join('' . BRANCH . ' as t3', 't2.BranchCode = t3.BranchCode', 'LEFT');
// $this->db->where('t3.IsActive', 1);
// $this->db->where('t3.IsActive', 1);STAFF_BRANCH
// $this->db->join('T_StaffDetails as t2', 't1.StaffID = t2.StaffID', 'LEFT');
$branchDetails = $this->db->get();
$result['branchStatus'] = true;
@ -164,11 +164,13 @@ class Employee_model extends CI_Model
if ($loginUserBranchId == 'All') {
// for getting all branch details
$staffId = $this->selfGetEmpId($loginUserId);
$this->db->select('*');
$this->db->order_by('CreatedOn', 'DESC');
$this->db->from(STAFF);
$this->db->select('t1.*');
$this->db->order_by('t1.CreatedOn', 'DESC');
$this->db->from('' . STAFF . ' as t1');
// $this->db->join('' . STAFF_BRANCH . ' as t3', 't3.StaffID = t1.StaffID', 'LEFT');
// not for SuperAdmin and Student Role code
$this->db->where_not_in('StaffID', $staffId);
$this->db->where_not_in('t1.StaffID', $staffId);
// $this->db->group_by('t3.StaffID');
// $this->db->where('BranchCode', $loginUserBranchId);
$empDetails = $this->db->get();
$checkArr = $empDetails->result();
@ -568,7 +570,7 @@ class Employee_model extends CI_Model
$this->db->join('' . STAFF_BRANCH . ' as t2', 't2.BranchCode = t1.BranchCode', 'LEFT');
$this->db->where('t2.StaffID', $staffId);
$this->db->where('t2.IsActive', 1);
$this->db->where('t1.IsActive', 1);
// $this->db->where('t1.IsActive', 1);
$branchDetails = $this->db->get();
$branchArr = $branchDetails->result();
if( count($branchArr) > 0 ) {

View File

@ -361,9 +361,9 @@ class StatusUpdation_model extends CI_Model
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON
SC.CourseID = C.CourseID
WHERE
SC.UniversityID LIKE '%$University%'
AND SC.CourseID LIKE '%$Course%'
AND SC.BatchCode LIKE '%$Batch%'
(SC.UniversityID = '$University'
OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')
OR (SC.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University'))
AND S.IsActive = '1'
AND SC.IsActive = '1'";
@ -371,17 +371,23 @@ class StatusUpdation_model extends CI_Model
$results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result();
} else {
// echo $University;
// echo $branch;
$subQuery = "SELECT S.* , SC.CourseID , C.CourseName , U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON
SC.CourseID = C.CourseID
WHERE
SC.UniversityID LIKE '%$University%'
AND SC.CourseID LIKE '%$Course%'
AND SC.BatchCode LIKE '%$Batch%'
(SC.UniversityID = '$University'
OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')
OR (SC.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University'))
AND S.IsActive = '1'
AND S.BranchCode = '$branch'
AND SC.BranchID = '$branch'
AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true;

View File

@ -4,7 +4,7 @@
* Simple table with sorting and filtering on AngularJS
*/
app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", "$interval", function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory, $interval) {
app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", "$interval", 'SweetAlert', function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory, $interval, SweetAlert) {
/**
* student details capture
* by : kdk
@ -55,6 +55,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
'enrollmentid': ''
};
$scope.inActiveBranchStatus = false;
$scope.addStudentView = function () {
// check the local branch is active for add a new student for this branch
var checkBranchActiveForStuAdd = {
@ -74,7 +75,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
$scope.inActiveBranchStatus = true;
swal(" ", "Cannot create a new Student for In-Active Branch", "warning");
}else {
// $scope.inActiveBranchStatus = false;
$scope.inActiveBranchStatus = false;
}
} else {
}
@ -518,10 +519,25 @@ $scope.studentListLength = 0;
$http(checkReq).then(function (response) {
if (response.data.existMobile == true) {
if(response.data.details.type === 'R001'){
swal("Warning!", response.data.message, "warning");
// swal("Warning!", response.data.message, "warning");
$scope.myModel.primaryPhone = '';
// student registration find student previously exist
// $scope.existingStudentView = true;
// $scope.existingStudentId = response.data.details.studentId;
SweetAlert.swal({
title: "Warning!",
text: "Student, Exsit with this same Number." + "\n Want to need see the details!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes!"
}, function (res) {
if(res === true){
$scope.existingStudentView = true;
$scope.existingStudentId = response.data.details.studentId;
}
});
}else if (response.data.details.type === 'R002' || response.data.details.type === 'R003'){
swal("Warning!", response.data.message, "warning");
$scope.myModel.primaryPhone = '';
@ -553,8 +569,11 @@ $scope.studentListLength = 0;
});
}
$scope.stuExistingDetailsShowLoading = false;
$scope.getExistStudentDetails = function() {
// alert($scope.existingStudentId);
$scope.stuExistingDetailsShowLoading = true;
var checkExisReq = {
method: 'POST',
url: apiPoint.url + 'getExistingStudentDetails/',
@ -570,8 +589,9 @@ $scope.studentListLength = 0;
if (response.data.existingStudentDetailsStatus == true) {
$scope.existingStuPersonalDetails = response.data.personalDetails[0];
$scope.existingStuCourseDetails = response.data.courseDetails;
$scope.stuExistingDetailsShowLoading = false;
} else {
$scope.stuExistingDetailsShowLoading = false;
}
});
}
@ -925,8 +945,10 @@ $scope.studentListLength = 0;
$scope.stepsModelEdit.length = 0;
}
$scope.editSaveButtonDisable = false;
// update student details
$scope.updateStuDetails = function (form, p, hidedob) {
$scope.editSaveButtonDisable = true;
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
@ -969,12 +991,15 @@ $scope.studentListLength = 0;
swal(" ", "Updated successfully.", "success");
$scope.getStudentList();
$scope.editId = -1;
$scope.editSaveButtonDisable = false;
} else {
// $scope.ldloading1[loading.replace('-', '_')] = false;
swal(" ", response.data.message, "error");
$scope.editSaveButtonDisable = false;
}
});
} else {
// alert();
var formData = new FormData();
var idStuUpProof = $scope.filesEdit[0];
// alert(idProof);
@ -985,14 +1010,17 @@ $scope.studentListLength = 0;
$http.post(apiPoint.url + 'updateStudentImgDetails/', formData, {
transformRequest: angular.identity,
headers: { 'Content-Type': undefined, 'Process-Data': false },
}).success(function (response) {
if (response.data.updateStuStatus === true) {
}).success(function(res) {
// alert(JSON.stringify(res));
if (res.updateStuStatus == true) {
swal(" ","Updated successfully." , "success");
$scope.getStudentList();
$scope.editId = -1;
$scope.editSaveButtonDisable = false;
} else {
// $scope.ldloading1[loading.replace('-', '_')] = false;
swal(" ", response.data.message, "error");
$scope.editSaveButtonDisable = false;
}
});
}
@ -1901,9 +1929,11 @@ $scope.myUnivSearch = "";
$scope.stepsModelEdit.length = 0;
}
$scope.editSaveButtonDisable = false;
// update student details
$scope.updateStuDetails = function (form, p, hidedob) {
var firstError = null;
$scope.editSaveButtonDisable = true;
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
@ -1945,10 +1975,12 @@ $scope.myUnivSearch = "";
swal("", "Updated successfully.", "success");
$scope.getStudentList();
$scope.editId = -1;
$scope.editSaveButtonDisable = false;
} else {
// $scope.ldloading1[loading.replace('-', '_')] = false;
// alert(response.data.message);
swal("", response.data.message, "error");
$scope.editSaveButtonDisable = false;
}
});
} else {
@ -1963,14 +1995,16 @@ $scope.myUnivSearch = "";
transformRequest: angular.identity,
headers: { 'Content-Type': undefined, 'Process-Data': false },
}).success(function (response) {
if (response.data.updateStuStatus === true) {
if (response.updateStuStatus == true) {
swal("", "Updated successfully.", "success");
$scope.getStudentList();
$scope.editId = -1;
$scope.editSaveButtonDisable = false;
} else {
// $scope.ldloading1[loading.replace('-', '_')] = false;
// swal("", data.message, "error");
swal("", response.data.message, "error");
$scope.editSaveButtonDisable = false;
}
});
}

View File

@ -378,8 +378,8 @@
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<button type="button" ladda="ldloading1.zoom_in" tabindex="19" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateStuDetails(Form, p, hidden_DOB)">
Save
<button type="button" ng-disabled="editSaveButtonDisable" ladda="ldloading1.zoom_in" tabindex="19" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateStuDetails(Form, p, hidden_DOB)">
<i class='fa fa-spinner fa-spin' ng-if="editSaveButtonDisable"> </i> Save
</button>
<button type="reset" class="btn btn-warning btn-wide" tabindex="20" ng-click="cancel()">
Cancel

View File

@ -248,6 +248,7 @@
<tab heading="Add Student" id="addstudent" ng-click="addStudentView()">
<div ng-hide="inActiveBranchStatus == true">
<div ng-if="existingStudentView == false">
<form name="Form" id="form" novalidate ng-submit="studentFORM.submit(Form, myModel)" method="post">
<div class="row">
@ -801,7 +802,10 @@
<div ng-if="existingStudentView == true">
<div ng-init="getExistStudentDetails()">
<div class="container">
<div ng-if="stuExistingDetailsShowLoading == true" class="text-center">
<h3>Fetching ...</h3>
</div>
<div class="container" ng-if="stuExistingDetailsShowLoading == false">
<div>
<button class="btn btn-danger btn-sm pull-right" ng-click="cancelExisStudentView()">
<i class="ti-close" tooltip="Personal Details" ></i>
@ -936,7 +940,9 @@
<label class="block">
Gender <span class="symbol required"></span>
</label>
<div class="clip-radio radio-primary">
<input readonly type="text" name="gender" tabindex="7" placeholder="Enter Gender" class="form-control" ng-model="existingStuPersonalDetails.Gender"
ng-minlength="10" ng-maxlength="12" required/>
<!--<div class="clip-radio radio-primary">
<input type="radio" tabindex="9" id="female" name="gender" value="female" ng-model="existingStuPersonalDetails.Gender" required>
<label for="female">
Female
@ -947,7 +953,7 @@
</label>
<span class="error text-small block" ng-if="Form.gender.$dirty && Form.gender.$invalid">Gender is required.</span>
</div>
</div>-->
</div>
</div>
<div class="row">
@ -1112,10 +1118,12 @@
Active/De-Active
</label>
<div ng-if="existingStuPersonalDetails.IsActive==true">
<switch ng-model="existingStuPersonalDetails.IsActive" ng-init="existingStuPersonalDetails.IsActive = true" class="green"></switch>
<label>Active</label>
<!--<switch ng-model="existingStuPersonalDetails.IsActive" ng-init="existingStuPersonalDetails.IsActive = true" class="green"></switch>-->
</div>
<div ng-if="existingStuPersonalDetails.IsActive==false">
<switch ng-model="existingStuPersonalDetails.IsActive" ng-init="existingStuPersonalDetails.IsActive = false" class="green"></switch>
<label>In-Active</label>
<!--<switch ng-model="existingStuPersonalDetails.IsActive" ng-init="existingStuPersonalDetails.IsActive = false" class="green"></switch>-->
</div>
</div>
<div class="col-md-4" ng-if="existingStuPersonalDetails.IsActive == false" ng-class="{'has-error':Form.DeactiveComments.$dirty && Form.DeactiveComments.$invalid, 'has-success':Form.DeactiveComments.$valid}">
@ -1138,6 +1146,7 @@
<legend>
Course Details
</legend>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
@ -1173,6 +1182,7 @@
</tr>
</tbody>
</table>
</div>
</fieldset>
<!--<pre>{{ p | json}}</pre>-->
</div>
@ -1183,8 +1193,7 @@
Cancel
</button>
</div>
</div>
<div class="container">
<div class="container">
<fieldset>
<legend>
Add New Cource
@ -1361,6 +1370,8 @@
</form>
</fieldset>
</div>
</div>
<!--{{existingStuPersonalDetails.Religion}}
@ -1370,6 +1381,7 @@
</div>
</div>
</div>
</div>
</tab>
</tabset>
</div>