diff --git a/Apollo/api/application/controllers/DayBook_Controller.php b/Apollo/api/application/controllers/DayBook_Controller.php index 99cfbe37..189a7eff 100755 --- a/Apollo/api/application/controllers/DayBook_Controller.php +++ b/Apollo/api/application/controllers/DayBook_Controller.php @@ -105,6 +105,9 @@ class DayBook_Controller extends REST_Controller { $req['Amount'] = $reqData['amount']; $req['Description'] = $reqData['description']; $req['UpdatedBy'] = $reqbyData['localUserID']; + $req['PaidTo'] = $reqData['paidTo']; + $req['PaidDescription'] = $reqData['description_paid']; + $req['VoucherNumber'] = $reqData['voucherNumber']; $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; $updatedayBookDetails = $this->daybook_model->update_dayBookDetails($req , $updateFor);// Check if the employee exist @@ -126,19 +129,25 @@ class DayBook_Controller extends REST_Controller { // add details daybook public function adddaybook_post() { + $reqData = $this->post('data'); $reqbyData = $this->post('localReqDetails'); $req['Name'] = $reqData['name']; $req['Type'] = $reqData['type']; $req['Amount'] = $reqData['amount']; + // $d = new DateTime($reqData['date']); $req['Date'] = $reqData['date']; $req['Status'] = $reqData['status']; $req['Description'] = $reqData['description']; $req['BranchCode'] = $reqbyData['localBranchID']; $req['CreatedBy'] = $reqbyData['localUserID']; + $req['PaidTo'] = $reqData['paidTo']; + $req['PaidDescription'] = $reqData['description_paid']; + $req['VoucherNumber'] = $reqData['voucherNumber']; $date = date('Y-m-d H:i:s'); $req['CreatedOn'] = $date; + // print_r($req);exit(); $addDayBookDetails = $this->daybook_model->add_dayBook($req);// Check if the employee exist if ($addDayBookDetails) { diff --git a/Apollo/api/application/controllers/Employee_Controller.php b/Apollo/api/application/controllers/Employee_Controller.php index a2e66f63..f8b77302 100755 --- a/Apollo/api/application/controllers/Employee_Controller.php +++ b/Apollo/api/application/controllers/Employee_Controller.php @@ -256,7 +256,7 @@ class Employee_Controller extends REST_Controller { $req['BranchCode'] = $temp['homeBranch']; $req['IsActive'] = $temp['switchsetting']; $req['DOJ'] = $temp['dateofjoining']; - $req['JobResponsibility'] = $data['jobResponsibility']; + $req['JobResponsibility'] = $temp['jobResponsibility']; // $req['DOJ'] = $data['dateofjoining']; $req['ListCode'] = $temp['role']; $req['CreatedBy'] = $createdBy; diff --git a/Apollo/api/application/controllers/StatusUpdation_Controller.php b/Apollo/api/application/controllers/StatusUpdation_Controller.php index 0bba8714..f13ef0be 100755 --- a/Apollo/api/application/controllers/StatusUpdation_Controller.php +++ b/Apollo/api/application/controllers/StatusUpdation_Controller.php @@ -83,8 +83,9 @@ class StatusUpdation_Controller extends REST_Controller { // get Sem/year for the respective course public function getSemYearForCourse_post() { $reqData = $this->post('data'); + $stuFor = $this->post('stuFor'); - $getSemYeatList = $this->statusupdation_model->get_semyear_result($reqData);// Check if the employee exist + $getSemYeatList = $this->statusupdation_model->get_semyear_result($reqData, $stuFor);// Check if the employee exist if ($getSemYeatList) { $getSemYeatList['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php index fbfa0ff1..2960efa0 100755 --- a/Apollo/api/application/models/DayBook_model.php +++ b/Apollo/api/application/models/DayBook_model.php @@ -39,33 +39,46 @@ class DayBook_model extends CI_Model public function get_Daybook_Details_List($reqData, $reqDataBy) { if($reqData['date'] != '' && $reqData['dateTo'] != '') { - $this->db->select('t1.*, t2.ListName, t3.TypeName'); - $this->db->from(''.DAYBOOKMASTER. ' as t1'); - $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT'); - $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT'); - $this->db->where('t1.Date >=', $reqData['date']); - $this->db->where('t1.Date <=', $reqData['dateTo']); + // $this->db->select('t1.*, t2.ListName, t3.TypeName'); + // $this->db->from(''.DAYBOOKMASTER. ' as t1'); + // $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT'); + // $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT'); + + $d = new DateTime($reqData['date']); + $dTo = new DateTime($reqData['dateTo']); + $fromDate = $d->format('Y-m-d'); + $toDate = $dTo->format('Y-m-d'); + $reqpayType = $reqDataBy['localBranchID']; + + $querys = "SELECT t1.*, t2.ListName, t3.TypeName FROM ".DAYBOOKMASTER." as t1 LEFT JOIN ".PICK_LIST_DETAILS." as t2 ON t2.ListCode = t1.Name LEFT JOIN ".INCOMEOUTCOMEMASTER." as t3 ON t3.ID = t1.Type + WHERE STR_TO_DATE(t1.Date, '%d-%m-%Y') BETWEEN '$fromDate' + AND '$toDate' AND t1.BranchCode = '$reqpayType' ORDER BY CreatedOn DESC"; + + // $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $fromDate); + // $this->db->where(' STR_TO_DATE(t1.Date, %d-%m-%Y) >=', $toDate); // $this->db->where('t1.Date', $reqData['date']); - $this->db->order_by('CreatedOn', 'DESC'); - $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']); + // $this->db->order_by('CreatedOn', 'DESC'); + // $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']); + } else { - $this->db->select('t1.*, t2.ListName, t3.TypeName'); - $this->db->from(''.DAYBOOKMASTER. ' as t1'); - $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT'); - $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT'); - // $this->db->where('t1.Date', $reqData['date']); - $this->db->order_by('CreatedOn', 'DESC'); - $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']); + // $this->db->select('t1.*, t2.ListName, t3.TypeName'); + // $this->db->from(''.DAYBOOKMASTER. ' as t1'); + // $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT'); + // $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT'); + // // $this->db->where('t1.Date', $reqData['date']); + // $this->db->order_by('CreatedOn', 'DESC'); + // $this->db->where('t1.BranchCode', $reqDataBy['localBranchID']); + $reqpayType = $reqDataBy['localBranchID']; + $querys = "SELECT t1.*, t2.ListName, t3.TypeName FROM ".DAYBOOKMASTER." as t1 LEFT JOIN ".PICK_LIST_DETAILS." as t2 ON t2.ListCode = t1.Name LEFT JOIN ".INCOMEOUTCOMEMASTER." as t3 ON t3.ID = t1.Type + WHERE t1.BranchCode = '$reqpayType' ORDER BY CreatedOn DESC"; } // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); - $dayBookDetails = $this->db->get(); + $dayBookDetails = $this->db->query($querys); $dayBookDetailsList = $dayBookDetails->result(); - $results['dayBookListStatus'] = true; $results['dayBookListDetails'] = $dayBookDetailsList; return $results; - } public function delete_dayBookDetails($id) { diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index 69e6a225..478748bc 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -150,7 +150,7 @@ class StatusUpdation_model extends CI_Model if( $reqDetailsFor == 'STUDY_MATERIAL') { $searchFor = 'M001'; $searchTableFor = STUDY_MATERIAL_STATUS; - $this->db->select('t1.*, t4.Firstname, t5.ListName'); + $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); $this->db->from(''. $searchTableFor . ' as t1'); $this->db->where('t1.StudentID', $reqDetails['student']); $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); @@ -193,7 +193,7 @@ class StatusUpdation_model extends CI_Model } else if ( $reqDetailsFor == 'CERTIFICATION_STATUS' ) { $searchFor = 'C001'; $searchTableFor = CERTIFICATION_STATUS; - $this->db->select('t1.*, t4.Firstname, t5.ListName'); + $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); $this->db->from(''. $searchTableFor . ' as t1'); $this->db->where('t1.StudentID', $reqDetails['student']); $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); @@ -215,7 +215,7 @@ class StatusUpdation_model extends CI_Model } else if ( $reqDetailsFor == 'ANSWERBOOKLET_STATUS' ) { $searchFor = 'B001'; $searchTableFor = ANSWER_BOOKLET; - $this->db->select('t1.*, t4.Firstname, t5.ListName'); + $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); $this->db->from(''. $searchTableFor . ' as t1'); $this->db->where('t1.StudentID', $reqDetails['student']); $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); @@ -294,11 +294,13 @@ class StatusUpdation_model extends CI_Model } // get sem/Year for the course - public function get_semyear_result($reqData) { - $subQuery = "SELECT CF.Sem_Year, CF.ID - FROM ".COURSE_FEES." as CF + public function get_semyear_result($reqData, $stuFor) { + // echo $stuFor;exit(); + $subQuery = "SELECT CF.Sem_Year, CF.ID + FROM ".COURSE_FEES." as CF LEFT JOIN ".STUDENTS_FEES_STATUS." as SFS ON SFS.FeesType = CF.ID WHERE - CF.CourseID = '$reqData' + SFS.CourseID = '$reqData' + AND SFS.StudentID = '$stuFor' AND CF.ProgramType ='Y001'"; $queryDetails = $this->db->query($subQuery); diff --git a/Apollo/assets/js/controllers/answerBookletStatusCtrl.js b/Apollo/assets/js/controllers/answerBookletStatusCtrl.js index 09b34259..4e7a4cbb 100755 --- a/Apollo/assets/js/controllers/answerBookletStatusCtrl.js +++ b/Apollo/assets/js/controllers/answerBookletStatusCtrl.js @@ -12,17 +12,14 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa $scope.reverse = !$scope.reverse; //if true make it false and vice versa } - $scope.editId = -1; + $scope.editId = -1; $scope.setEditId = function (P) { - // alert(P); $scope.editId = P; } - $scope.cancel = function() { - $scope.editId = -1; + $scope.cancel = function () { + $scope.editId = -1; } - - // get local client details var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetails = ipCookie('cookiechk'); @@ -48,6 +45,7 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } $scope.universityData = ''; + // get university list when the page is loading $scope.getUniversityList = function () { var empListreq = { method: 'POST', @@ -82,16 +80,12 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa $scope.getSearch(); } - // $scope.dealWithItem = function (item) { - // alert(JSON.stringify(item)); - // } - $scope.searchResultDetails = ''; $scope.searchLoading = false; $scope.searchResultLength = 0; + // get student list based on the searched data $scope.getSearch = function () { $scope.OpenWindowStatus = false; - // alert(JSON.stringify($scope.searchData)); $scope.searchLoading = true; var getSearchDetails = { method: 'POST', @@ -122,56 +116,73 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } // mobile number search functionlity - $scope.mySearchChangeFunc = function(val) { - if( val > 0) { + $scope.mySearchChangeFunc = function (val) { + if (val > 0) { $scope.allSelectedHide = true; $scope.allSelected('undefined'); $scope.OpenWindowStatus = false; - } else { - $scope.allSelected('undefined'); - $scope.allSelectedHide = false; - } + } else { + $scope.allSelected('undefined'); + $scope.allSelectedHide = false; + } } // End: mobile number search functionlity // select all or individual functionality - var getAllSelected = function () { - var selectedItems = $scope.searchResultDetails.filter(function (item) { - return item.Selected; - }); + // var getAllSelected = function () { + // var selectedItems = $scope.searchResultDetails.filter(function (item) { + // return item.Selected; + // }); - return selectedItems.length === $scope.searchResultDetails.length; - } + // return selectedItems.length === $scope.searchResultDetails.length; + // } - var setAllSelected = function (value) { + // var setAllSelected = function (value) { + // angular.forEach($scope.searchResultDetails, function (item) { + // item.Selected = value; + // }); + // } + + // $scope.allSelected = function (value) { + // if (value !== undefined) { + // return setAllSelected(value); + // } else { + // return getAllSelected(); + // } + // } + + // Select one row in a table once + $scope.setOneSelect = function (value) { angular.forEach($scope.searchResultDetails, function (item) { item.Selected = value; }); - } - - $scope.allSelected = function (value) { - if (value !== undefined) { - return setAllSelected(value); - } else { - return getAllSelected(); - } + value.Selected = true; + $scope.OpenWindowStatus = true; + $scope.openUpdateWind(); } // End: select all or individual functionality + // unselect all the selected items + $scope.unSelect = function () { + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.openUpdateWind(); + } - // open popup window onselct checkbox + // open popup window onselct checkbox / close the popup all selected items unchecked $scope.OpenWindowStatus = false; $scope.openUpdateWind = function () { var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { return true; } - }); - const courseLocal = $scope.searchData.Course; - $scope.getSemYearList(courseLocal); - $scope.getStatusList(); - // alert($scope.searchData.Course); - if (ItemsSelected.length) { + }) + if (ItemsSelected.length !== 0) { + const courseLocal = ItemsSelected[0].CourseID; + const selectedStuId = ItemsSelected[0].StudentID; + $scope.getSemYearList(courseLocal, selectedStuId); + $scope.getStatusList(); $scope.OpenWindowStatus = true; $scope.myStatusModel = { 'semYear': '', @@ -184,7 +195,7 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } } - // get status list for this activity + // get status list for this activity $scope.getStatusList = function () { var getStatusL = { method: 'POST', @@ -208,7 +219,7 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } // get Sem/Year based on the course select - $scope.getSemYearList = function (courseID) { + $scope.getSemYearList = function (courseID, StuId) { $scope.semYearList = ''; if (courseID !== '' && courseID !== undefined) { var getSemYear = { @@ -218,7 +229,8 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa 'Content-Type': 'application/json' }, data: { - data: courseID + data: courseID, + stuFor: StuId } }; $http(getSemYear).then(function (response) { @@ -234,23 +246,6 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } } - - // $scope.updateItems = function () { - // var studentForUpdate = []; - // var ItemsSelected = $scope.searchResultDetails.filter(function (item) { - // if (item.Selected === true) { - // let getStudentID = new getStudentForUpdateDetails(item.StudentID); - // studentForUpdate.push(getStudentID); - // return true; - // } - // }); - // function getStudentForUpdateDetails(id) { - // this.iD = id; - // } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - // } - $scope.statusUpdate = { submit: function (form, myStatusModel) { var firstError = null; @@ -269,7 +264,7 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa 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 { - $scope.disableButton = true; + $scope.disableButton = true; var studentForUpdate = []; let formate = "dd-MM-yyyy"; $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); @@ -289,9 +284,7 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa this.Coursedetail = id; this.Comments = $scope.myStatusModel.comment; } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - + var updateStudyMaterial = { method: 'POST', url: apiPoint.url + 'updateAnswerBookLetStatus/', @@ -300,42 +293,39 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa }, data: { data: studentForUpdate, - requestDetails : localDetails + requestDetails: localDetails } }; $http(updateStudyMaterial).then(function (response) { if (response.data.addStatus) { - swal("Success!", response.data.message, "success"); - $scope.disableButton = false; - // for success state - $scope.allSelected('undefined'); - $scope.OpenWindowStatus = false; + swal("Success!", response.data.message, "success"); + $scope.disableButton = false; + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.OpenWindowStatus = false; } else { swal("Failed!", response.data.message, "error"); - $scope.disableButton = false; + $scope.disableButton = false; } }); } }, reset: function (form) { form.$setPristine(true); - $scope.myStatusModel = { - 'semYear': '', - 'staus': '', - 'dateOn': '', - 'comment': '' - } + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '' + } } } - - // check unchek for table values - - $scope.prevStatusListForStudentCourse = ''; + $scope.prevStatusListForStudentCourse = ''; // get previous status details for the student - $scope.getPrevStatus = function(p) { - // alert(JSON.stringify(p)); + $scope.getPrevStatus = function (p) { $scope.prevStatusListForStudentCourseLoading = true; $scope.prevStatusListForStudentCourseNoRecord = false; $scope.prevStatusListForStudentCourse = ''; @@ -347,7 +337,7 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa }, data: { statusFor: localUpdateStatus, - getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID} , + getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID }, data: localDetail } }; @@ -364,25 +354,4 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa }); } - - - - // $scope.CheckUncheckAll = function () { - - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // $scope.searchResultDetails[i].Selected = $scope.IsAllChecked; - // } - // }; - - // $scope.CheckUncheckHeader = function () { - // $scope.IsAllChecked = true; - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // if (!$scope.searchResultDetails[i].Selected) { - // $scope.IsAllChecked = false; - // break; - // } - // }; - // }; - - // $scope.CheckUncheckHeader(); }]); diff --git a/Apollo/assets/js/controllers/applicationStatusCtrl.js b/Apollo/assets/js/controllers/applicationStatusCtrl.js index f3edca82..98ff0acb 100755 --- a/Apollo/assets/js/controllers/applicationStatusCtrl.js +++ b/Apollo/assets/js/controllers/applicationStatusCtrl.js @@ -3,7 +3,7 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', function ($scope, toaster, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie) { /** - * Application status update search + * Application status update search / Document status update * by : kdk */ @@ -12,13 +12,13 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.reverse = !$scope.reverse; //if true make it false and vice versa } - $scope.editId = -1; + $scope.editId = -1; $scope.setEditId = function (P) { // alert(P); $scope.editId = P; } - $scope.cancel = function() { - $scope.editId = -1; + $scope.cancel = function () { + $scope.editId = -1; } @@ -26,15 +26,17 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl // get local client details var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetails = ipCookie('cookiechk'); + const localUpdateStatus = 'APPICATION_STATUS'; $scope.init = function () { $scope.getUniversityList(); getCertificateDetailsList(); } - - var getCertificateDetailsList = function() { - var getCerfreg = { + + // get certificate or application list + var getCertificateDetailsList = function () { + var getCerfreg = { method: 'POST', url: apiPoint.url + 'getCertificateList/', headers: { @@ -52,7 +54,7 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl } }); } - + $scope.searchData = { 'University': '', @@ -71,6 +73,7 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl 'certificateNumber': '' } + // get university list while page is loading $scope.universityData = ''; $scope.getUniversityList = function () { var empListreq = { @@ -106,16 +109,12 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.getSearch(); } - // $scope.dealWithItem = function (item) { - // alert(JSON.stringify(item)); - // } - $scope.searchResultDetails = ''; $scope.searchLoading = false; $scope.searchResultLength = 0; + // get student list From the searching data $scope.getSearch = function () { $scope.OpenWindowStatus = false; - // alert(JSON.stringify($scope.searchData)); $scope.searchLoading = true; var getSearchDetails = { method: 'POST', @@ -146,15 +145,15 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl } // mobile number search functionlity - $scope.mySearchChangeFunc = function(val) { - if( val > 0) { + $scope.mySearchChangeFunc = function (val) { + if (val > 0) { $scope.allSelectedHide = true; $scope.allSelected('undefined'); $scope.OpenWindowStatus = false; - } else { - $scope.allSelected('undefined'); - $scope.allSelectedHide = false; - } + } else { + $scope.allSelected('undefined'); + $scope.allSelectedHide = false; + } } // End: mobile number search functionlity @@ -184,9 +183,8 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl // End: select all or individual functionality - // Select one row in a table once + // Select one row in a table once $scope.setOneSelect = function (value) { - // alert(value.Selected); angular.forEach($scope.searchResultDetails, function (item) { item.Selected = value; }); @@ -195,19 +193,24 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.openUpdateWind(); } + // unselect all the selected item + $scope.unSelect = function () { + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.openUpdateWind(); + } - - // open popup window onselct checkbox + // open popup window onselct checkbox clicked or close popup window all the clicked items unchecked $scope.OpenWindowStatus = false; $scope.openUpdateWind = function () { var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { return true; } }); - const courseLocal = $scope.searchData.Course; - $scope.getSemYearList(courseLocal); - $scope.getStatusList(); - // alert($scope.searchData.Course); - if (ItemsSelected.length) { + if (ItemsSelected.length !== 0) { + const courseLocal = $scope.searchData.Course; + $scope.getSemYearList(courseLocal); + $scope.getStatusList(); $scope.OpenWindowStatus = true; $scope.myStatusModel = { 'semYear': '', @@ -238,7 +241,6 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl $http(getStatusL).then(function (response) { if (response.data.statusList) { $scope.statusDetailsList = response.data.statusList_details; - // $scope.searchLoading = false; } else { // $scope.searchLoading = false; } @@ -272,23 +274,6 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl } } - - // $scope.updateItems = function () { - // var studentForUpdate = []; - // var ItemsSelected = $scope.searchResultDetails.filter(function (item) { - // if (item.Selected === true) { - // let getStudentID = new getStudentForUpdateDetails(item.StudentID); - // studentForUpdate.push(getStudentID); - // return true; - // } - // }); - // function getStudentForUpdateDetails(id) { - // this.iD = id; - // } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - // } - $scope.statusUpdate = { submit: function (form, myStatusModel) { var firstError = null; @@ -329,9 +314,6 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl this.CertificateType = $scope.myStatusModel.certificatetype; this.CertificateNumber = $scope.myStatusModel.certificateNumber; } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - var updateStudyMaterial = { method: 'POST', url: apiPoint.url + 'updateApplicationStatus/', @@ -340,51 +322,50 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl }, data: { data: studentForUpdate, - requestDetails : localDetails + requestDetails: localDetails } }; $http(updateStudyMaterial).then(function (response) { if (response.data.addStatus) { - swal("Success!", response.data.message, "success"); - $scope.disableButton = false; - // for success state - angular.forEach($scope.searchResultDetails, function (item) { - item.Selected = false; - }); - // $scope.OpenWindowStatus = false; - $scope.OpenWindowStatus = false; + swal("Success!", response.data.message, "success"); + $scope.disableButton = false; + // for success state + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + // $scope.OpenWindowStatus = false; + $scope.OpenWindowStatus = false; } else { swal("Failed!", response.data.message, "error"); $scope.disableButton = false; // for success state - angular.forEach($scope.searchResultDetails, function (item) { - item.Selected = false; - }); - // $scope.OpenWindowStatus = false; - $scope.OpenWindowStatus = false; + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + // $scope.OpenWindowStatus = false; + $scope.OpenWindowStatus = false; } }); } }, reset: function (form) { form.$setPristine(true); - $scope.myStatusModel = { - 'semYear': '', - 'staus': '', - 'dateOn': '', - 'comment': '', - 'certificatetype': '', - 'certificateNumber': '' - } + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '', + 'certificatetype': '', + 'certificateNumber': '' + } } } // check unchek for table values - - $scope.prevStatusListForStudentCourse = ''; + $scope.prevStatusListForStudentCourse = ''; // get previous status details for the student - $scope.getPrevStatus = function(p) { + $scope.getPrevStatus = function (p) { // alert(JSON.stringify(p)); $scope.prevStatusListForStudentCourseLoading = true; $scope.prevStatusListForStudentCourseNoRecord = false; @@ -397,7 +378,7 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl }, data: { statusFor: localUpdateStatus, - getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID} , + getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID }, data: localDetail } }; @@ -413,25 +394,4 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl } }); } - - - - // $scope.CheckUncheckAll = function () { - - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // $scope.searchResultDetails[i].Selected = $scope.IsAllChecked; - // } - // }; - - // $scope.CheckUncheckHeader = function () { - // $scope.IsAllChecked = true; - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // if (!$scope.searchResultDetails[i].Selected) { - // $scope.IsAllChecked = false; - // break; - // } - // }; - // }; - - // $scope.CheckUncheckHeader(); }]); diff --git a/Apollo/assets/js/controllers/certificationStatusCtrl.js b/Apollo/assets/js/controllers/certificationStatusCtrl.js index 2426322d..07417e06 100755 --- a/Apollo/assets/js/controllers/certificationStatusCtrl.js +++ b/Apollo/assets/js/controllers/certificationStatusCtrl.js @@ -3,7 +3,7 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', function ($scope, toaster, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie) { /** - * Certification status update search + * Certification status update search / Mark card status update * by : kdk */ @@ -12,13 +12,13 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa $scope.reverse = !$scope.reverse; //if true make it false and vice versa } - $scope.editId = -1; + $scope.editId = -1; $scope.setEditId = function (P) { // alert(P); $scope.editId = P; } - $scope.cancel = function() { - $scope.editId = -1; + $scope.cancel = function () { + $scope.editId = -1; } @@ -48,7 +48,7 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa 'certificatetype': '', 'certificateNumber': '' } - + // get University List $scope.universityData = ''; $scope.getUniversityList = function () { @@ -69,7 +69,7 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } }); }; - + //get certificates List $scope.getCertificateList = function () { var getCerfreg = { @@ -106,16 +106,12 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa $scope.getSearch(); } - // $scope.dealWithItem = function (item) { - // alert(JSON.stringify(item)); - // } - $scope.searchResultDetails = ''; $scope.searchLoading = false; $scope.searchResultLength = 0; + // get student list based on search data $scope.getSearch = function () { $scope.OpenWindowStatus = false; - // alert(JSON.stringify($scope.searchData)); $scope.searchLoading = true; var getSearchDetails = { method: 'POST', @@ -146,15 +142,15 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } // mobile number search functionlity - $scope.mySearchChangeFunc = function(val) { - if( val > 0) { + $scope.mySearchChangeFunc = function (val) { + if (val > 0) { $scope.allSelectedHide = true; $scope.allSelected('undefined'); $scope.OpenWindowStatus = false; - } else { - $scope.allSelected('undefined'); - $scope.allSelectedHide = false; - } + } else { + $scope.allSelected('undefined'); + $scope.allSelectedHide = false; + } } // End: mobile number search functionlity @@ -185,10 +181,9 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa // } //---------------------------------------------------> - + // Select one row in a table once $scope.setOneSelect = function (value) { - // alert(value.Selected); angular.forEach($scope.searchResultDetails, function (item) { item.Selected = value; }); @@ -199,20 +194,29 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa // End: select all or individual functionality + // unselect all the items + $scope.unSelect = function () { + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.openUpdateWind(); + } - // open popup window onselct checkbox + + // open popup window onselct checkbox or close unselect all the items $scope.OpenWindowStatus = false; $scope.openUpdateWind = function () { var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { return true; } }); - const courseLocal = $scope.searchData.Course; - $scope.getSemYearList(courseLocal); - $scope.getStatusList(); - // alert($scope.searchData.Course); - if (ItemsSelected.length) { + + if (ItemsSelected.length !== 0) { + const courseLocal = ItemsSelected[0].CourseID; + const selectedStuId = ItemsSelected[0].StudentID; + $scope.getSemYearList(courseLocal, selectedStuId); + $scope.getStatusList(); $scope.OpenWindowStatus = true; - $scope.myStatusModel = { + $scope.myStatusModel = { 'semYear': '', 'staus': '', 'dateOn': '', @@ -249,7 +253,7 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } // get Sem/Year based on the course select - $scope.getSemYearList = function (courseID) { + $scope.getSemYearList = function (courseID, StuId) { $scope.semYearList = ''; if (courseID !== '' && courseID !== undefined) { var getSemYear = { @@ -259,7 +263,8 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa 'Content-Type': 'application/json' }, data: { - data: courseID + data: courseID, + stuFor: StuId } }; $http(getSemYear).then(function (response) { @@ -275,23 +280,6 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } } - - // $scope.updateItems = function () { - // var studentForUpdate = []; - // var ItemsSelected = $scope.searchResultDetails.filter(function (item) { - // if (item.Selected === true) { - // let getStudentID = new getStudentForUpdateDetails(item.StudentID); - // studentForUpdate.push(getStudentID); - // return true; - // } - // }); - // function getStudentForUpdateDetails(id) { - // this.iD = id; - // } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - // } - // Update the status For Certification $scope.statusUpdate = { submit: function (form, myStatusModel) { @@ -311,7 +299,7 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa 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 { - $scope.disableButton = true; + $scope.disableButton = true; var studentForUpdate = []; let formate = "dd-MM-yyyy"; $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); @@ -322,7 +310,6 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa return true; } }); - // alert(JSON.stringify(studentForUpdate)); function getStudentForUpdateDetails(id) { this.StudentID = id; this.CourseID = $scope.myStatusModel.semYear; @@ -334,9 +321,6 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa this.CertificateType = $scope.myStatusModel.certificatetype; this.CertificateNumber = $scope.myStatusModel.certificateNumber; } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - var updateCertificateStatus = { method: 'POST', url: apiPoint.url + 'updateCertificationStatus/', @@ -345,45 +329,44 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa }, data: { data: studentForUpdate, - requestDetails : localDetails + requestDetails: localDetails } }; $http(updateCertificateStatus).then(function (response) { if (response.data.addStatus) { - swal("Success!", response.data.message, "success"); - $scope.disableButton = false; - // for success state - // $scope.allSelected('undefined'); - angular.forEach($scope.searchResultDetails, function (item) { - item.Selected = false; - }); - $scope.OpenWindowStatus = false; + swal("Success!", response.data.message, "success"); + $scope.disableButton = false; + // for success state + // $scope.allSelected('undefined'); + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.OpenWindowStatus = false; } else { swal("Failed!", response.data.message, "error"); - $scope.disableButton = false; + $scope.disableButton = false; } }); } }, reset: function (form) { form.$setPristine(true); - $scope.myStatusModel = { - 'semYear': '', - 'staus': '', - 'dateOn': '', - 'comment': '', - 'certificatetype': '', - 'certificateNumber': '' - } + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '', + 'certificatetype': '', + 'certificateNumber': '' + } } } -// check unchek for table values + // check unchek for table values - $scope.prevStatusListForStudentCourse = ''; + $scope.prevStatusListForStudentCourse = ''; // get previous status details for the student - $scope.getPrevStatus = function(p) { - // alert(JSON.stringify(p)); + $scope.getPrevStatus = function (p) { $scope.prevStatusListForStudentCourseLoading = true; $scope.prevStatusListForStudentCourseNoRecord = false; $scope.prevStatusListForStudentCourse = ''; @@ -395,7 +378,7 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa }, data: { statusFor: localUpdateStatus, - getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID} , + getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID }, data: localDetail } }; @@ -411,25 +394,4 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } }); } - - - - // $scope.CheckUncheckAll = function () { - - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // $scope.searchResultDetails[i].Selected = $scope.IsAllChecked; - // } - // }; - - // $scope.CheckUncheckHeader = function () { - // $scope.IsAllChecked = true; - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // if (!$scope.searchResultDetails[i].Selected) { - // $scope.IsAllChecked = false; - // break; - // } - // }; - // }; - - // $scope.CheckUncheckHeader(); }]); diff --git a/Apollo/assets/js/controllers/daybookCtrl.js b/Apollo/assets/js/controllers/daybookCtrl.js index 9efc45e9..1c13b98f 100755 --- a/Apollo/assets/js/controllers/daybookCtrl.js +++ b/Apollo/assets/js/controllers/daybookCtrl.js @@ -14,6 +14,7 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng "dateTo": "" } + // get the data while page loading functions goes here $scope.init = function () { $scope.currentDate = new Date(); var formate = "dd-MM-yyyy"; @@ -23,8 +24,8 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng $scope.getIncomeExpenseType_Status(); } + // change from date, update and call search functionality $scope.changeDate = function () { - if($scope.searchData.date !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate); @@ -35,8 +36,8 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng } } + // change to date, update and call search functionality $scope.changeToDate = function () { - if($scope.searchData.dateTo !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate); @@ -47,17 +48,16 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng } } - // sorting function for table params + // sorting function for table params $scope.sort = function (keyname) { - // alert(); $scope.sortKey = keyname; //set the sortKey to the param passed $scope.reverse = !$scope.reverse; //if true make it false and vice versa } $scope.noRecordFound = true; - + $scope.dataLength = 0; + // get day book type name list $scope.getDayBookList = function () { - var getDatBookListDetails = { method: 'POST', url: apiPoint.url + 'getDayBookDetails/', @@ -73,6 +73,7 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng if (response.data.dayBookListStatus) { $scope.data = response.data.dayBookListDetails; + $scope.dataLength = $scope.data.length; if ($scope.data.length !== 0) { $scope.noRecordFound = false; } else { @@ -86,6 +87,7 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng }); } + // income expense type status list $scope.getIncomeExpenseType_Status = function () { var getIncomeExpenseType = { method: 'POST', @@ -106,6 +108,7 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng }); } + // parse the income and expense type from the list $scope.getType = function (type) { $scope.getIncomeTypes = $scope.incomeExpenseType.filter(function (val) { return val.TypeID === 'I002' ? 1 : 0; @@ -132,7 +135,10 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng "type": "", "amount": "", "status": "", - "description": "" + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "" } } @@ -143,7 +149,10 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng "type": "", "amount": "", "status": "", - "description": "" + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "" } $scope.copyModel = function (p) { @@ -155,10 +164,14 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng "type": p.Type, "amount": p.Amount, "status": p.Status, - "description": p.Description + "description": p.Description, + "paidTo": p.PaidTo, + "description_paid": p.PaidDescription, + "voucherNumber": p.VoucherNumber } } + // delete the income/expense list row $scope.deleEditEntry = function (id) { swal({ title: "Are you sure?", @@ -202,9 +215,13 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng "type": "", "amount": "", "status": "", - "description": "" + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "" } + // add a new daybook entry $scope.daybookAdd = { submit: function (form, myModelAdd) { var firstError = null; @@ -251,6 +268,7 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng } } + // update a daybook entry details $scope.daybookeditUpdate = { submit: function (form, myModel) { var firstError = null; diff --git a/Apollo/assets/js/controllers/daybookadminCtrl.js b/Apollo/assets/js/controllers/daybookadminCtrl.js index 4a1f1512..e8d9ba65 100755 --- a/Apollo/assets/js/controllers/daybookadminCtrl.js +++ b/Apollo/assets/js/controllers/daybookadminCtrl.js @@ -11,23 +11,13 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" $scope.localTypeViewAdmin = false; $scope.localTypeViewSuperAdmin = false; - // $scope.init = function () { - // const LOCALTYPE = localDetail.localType; - // if (LOCALTYPE === 'R003') { - // $scope.localTypeViewAdmin = true; - // $scope.getDayBookList(); - // } else { - // $scope.localTypeViewSuperAdmin = true; - // } - // } - - $scope.searchData = { + $scope.searchData = { "date": "", "dateTo": "" } + // load functionality when page get loaded $scope.init = function () { - const LOCALTYPE = localDetail.localType; if (LOCALTYPE === 'R003') { $scope.showTheRefValue = 'I001'; @@ -51,9 +41,8 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" } } - + // change from date, update and call search functionality $scope.changeDate = function () { - if($scope.searchData.date !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate); @@ -64,8 +53,8 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" } } + // change to date, update and call search functionality $scope.changeToDate = function () { - if($scope.searchData.dateTo !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate); @@ -83,6 +72,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" $scope.reverse = !$scope.reverse; //if true make it false and vice versa } + // income expense type status list $scope.getIncomeExpenseType_Status = function () { var getIncomeExpenseType = { method: 'POST', @@ -103,12 +93,11 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" }); } - - $scope.noRecordFound = true; - + $scope.dataLengthIncome = 0; + $scope.dataLengthExpense = 0; + // day book entry list $scope.getDayBookList = function () { - var getDatBookListDetails = { method: 'POST', url: apiPoint.url + 'getDayBookDetails/', @@ -122,7 +111,6 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" }; $http(getDatBookListDetails).then(function (response) { if (response.data.dayBookListStatus) { - // $scope.data = response.data.dayBookListDetails; let datas = response.data.dayBookListDetails; let searchResultDetailsBef = datas.filter(val => { @@ -131,14 +119,15 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" $scope.IncomeData = datas.filter(val => { return val.Name == 'I002' ? 1 : 0; }); + $scope.dataLengthIncome = $scope.IncomeData.length; const filterAddSelect = searchResultDetailsBef.filter(val => { val['Selected'] = false; return val; }); $scope.searchResultDetails = filterAddSelect; + $scope.dataLengthExpense = $scope.searchResultDetails.length; // alert(JSON.stringify($scope.searchResultDetails)); $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; - // if ($scope.data.length !== 0) { // $scope.OpenWindowStatus = false; // $scope.noRecordFound = false; @@ -154,20 +143,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" }); } - - // $scope.getDayBookList = function() { - // let searchResultDetailsBef = $scope.data; - // const filterAddSelect = searchResultDetailsBef.filter(val => { - // val['Selected'] = false; - // return val; - // }); - // $scope.searchResultDetails = filterAddSelect; - // $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; - // } - - // select all or individual functionality - var getAllSelected = function () { var selectedItems = $scope.searchResultDetails.filter(function (item) { return item.Selected; @@ -198,6 +174,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" // End: select all or individual functionality $scope.OpenWindowStatus = false; + // open popup window when checkbox get selected / close popup window uncheck the selected items $scope.openUpdateWind = function () { var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { return true; } @@ -215,6 +192,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" } } + // update the status details $scope.statusUpdate = { submit: function (form, myStatusModel) { var firstError = null; @@ -246,8 +224,6 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" this.ListCodeStatus = $scope.myStatusModel.staus; this.comments = $scope.myStatusModel.description; } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(selectedItems)); var updateStudyMaterial = { method: 'POST', url: apiPoint.url + 'updateDayBookStatusAdmin/', @@ -320,9 +296,6 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" "description": "income type income type income type" }]; - - - $scope.incomeExpenseType = [{ "type_id": 1, "type": "Income", @@ -412,6 +385,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" } } + // delete the entry row from the daybook list $scope.deleEditEntry = function (id) { swal({ title: "Are you sure?", @@ -451,6 +425,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" "description": "" } + // add a new entry to the day book list $scope.daybookAdd = { submit: function (form, myModelAdd) { var firstError = null; @@ -477,8 +452,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" } } - - + // update daybook entry data from the list $scope.daybookeditUpdate = { submit: function (form, myModel) { var firstError = null; diff --git a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js index d2f77e3c..3ebba6cd 100755 --- a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js +++ b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js @@ -11,23 +11,13 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi $scope.localTypeViewAdmin = false; $scope.localTypeViewSuperAdmin = false; - // $scope.init = function () { - // const LOCALTYPE = localDetail.localType; - // if (LOCALTYPE === 'R003') { - // $scope.localTypeViewAdmin = true; - // $scope.getDayBookList(); - // } else { - // $scope.localTypeViewSuperAdmin = true; - // } - // } - - $scope.searchData = { + $scope.searchData = { "date": "", "dateTo": "" } + // get details functionality when page get loaded $scope.init = function () { - const LOCALTYPE = localDetail.localType; if(LOCALTYPE === 'R004') { $scope.localTypeViewSuperAdmin = true; @@ -44,8 +34,8 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } } - $scope.changeDate = function () { - + // change from date, update and call search functionality + $scope.changeDate = function () { if($scope.searchData.date !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate); @@ -56,8 +46,8 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } } + // change to date, update and call search functionality $scope.changeToDate = function () { - if($scope.searchData.dateTo !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate); @@ -70,12 +60,11 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi // sorting function for table params $scope.sort = function (keyname) { - // alert(); $scope.sortKey = keyname; //set the sortKey to the param passed $scope.reverse = !$scope.reverse; //if true make it false and vice versa } - + // income expense type status list $scope.getIncomeExpenseType_Status = function () { var getIncomeExpenseType = { method: 'POST', @@ -99,7 +88,9 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi $scope.noRecordFound = true; - + $scope.dataLengthIncome = 0; + $scope.dataLengthExpense = 0; + // day book entry list $scope.getDayBookList = function () { var getDatBookListDetails = { @@ -124,11 +115,13 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi $scope.IncomeData = datas.filter(val => { return val.Name == 'I002' ? 1 : 0; }); + $scope.dataLengthIncome = $scope.IncomeData.length; const filterAddSelect = searchResultDetailsBef.filter(val => { val['Selected'] = false; return val; }); $scope.searchResultDetails = filterAddSelect; + $scope.dataLengthExpense = $scope.searchResultDetails.length; // alert(JSON.stringify($scope.searchResultDetails)); $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; @@ -148,17 +141,6 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } - // $scope.getDayBookList = function() { - // let searchResultDetailsBef = $scope.data; - // const filterAddSelect = searchResultDetailsBef.filter(val => { - // val['Selected'] = false; - // return val; - // }); - // $scope.searchResultDetails = filterAddSelect; - // $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; - // } - - // select all or individual functionality var getAllSelected = function () { @@ -191,6 +173,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi // End: select all or individual functionality $scope.OpenWindowStatus = false; + // open popup window when checkbox get selected / close popup window uncheck the selected items $scope.openUpdateWind = function () { var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { return true; } @@ -208,6 +191,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } } + // update the status details $scope.statusUpdate = { submit: function (form, myStatusModel) { var firstError = null; @@ -404,7 +388,8 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi "description": p.description } } - + + // delete the entry row from the daybook list $scope.deleEditEntry = function (id) { swal({ title: "Are you sure?", @@ -444,6 +429,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi "description": "" } + // add a new entry to the day book list $scope.daybookAdd = { submit: function (form, myModelAdd) { var firstError = null; @@ -470,8 +456,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } } - - + // update daybook entry data from the list $scope.daybookeditUpdate = { submit: function (form, myModel) { var firstError = null; diff --git a/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js b/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js index 3c0521d2..cbde1ea5 100755 --- a/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js +++ b/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js @@ -1,384 +1,369 @@ 'use strict'; /*** controller for Wizard Form example***/ -app.controller('studyMaterialStatusCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', function ($scope, toaster, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie) { +app.controller('studyMaterialStatusCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', + function ($scope, toaster, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { - /** - * Study material status update search - * by : kdk - */ + /** + * Study material status update search + * by : kdk + */ - $scope.sort = function (keyname) { - $scope.sortKey = keyname; //set the sortKey to the param passed - $scope.reverse = !$scope.reverse; //if true make it false and vice versa - } - - $scope.editId = -1; - $scope.setEditId = function (P) { - // alert(P); - $scope.editId = P; - } - $scope.cancel = function() { - $scope.editId = -1; - } - - // get local client details - var localDetail = JSON.parse(localStorage.getItem('localObj')); - var localDetails = ipCookie('cookiechk'); - const localUpdateStatus = 'STUDY_MATERIAL'; - - $scope.init = function () { - $scope.getUniversityList(); - } - - $scope.searchData = { - 'University': '', - 'Course': '', - 'Batch': '', - 'Mobile': '', - 'Name': '' - } - - $scope.myStatusModel = { - 'semYear': '', - 'staus': '', - 'dateOn': '', - 'comment': '' - } - - $scope.universityData = ''; - $scope.getUniversityList = function () { - var empListreq = { - method: 'POST', - url: apiPoint.url + 'getUniveCourseBratch/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: localDetails - } - }; - $http(empListreq).then(function (response) { - if (response.data.univList) { - $scope.universityData = response.data.university_details; - } else { - } - }); - }; - - $scope.getUniveId = function (univ) { - let name = JSON.parse(univ); - $scope.searchData.University = name.UniversityID; - $scope.searchData.Course = ''; - $scope.searchData.Batch = ''; - $scope.courseData = name.Course; - $scope.batchData = name.Batch; - $scope.OpenWindowStatus = false; - $scope.getSearch(); - }; - - $scope.getValueChange = function () { - $scope.getSearch(); - } - - // $scope.dealWithItem = function (item) { - // alert(JSON.stringify(item)); - // } - - $scope.searchResultDetails = []; - $scope.searchLoading = false; - $scope.searchResultLength = 0; - $scope.getSearch = function () { - $scope.OpenWindowStatus = false; - // alert(JSON.stringify($scope.searchData)); - $scope.searchLoading = true; - var getSearchDetails = { - method: 'POST', - url: apiPoint.url + 'getSearchAutoDetails/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: $scope.searchData, - requestDetails: localDetails - } - }; - $http(getSearchDetails).then(function (response) { - if (response.data.searchResult) { - $scope.searchResultStatus = response.data.searchResult; - $scope.searchLoading = false; - let searchResultDetailsBef = response.data.search_result_details; - const filterAddSelect = searchResultDetailsBef.filter(val => { - val['Selected'] = false; - return val; - }); - $scope.searchResultDetails = filterAddSelect; - $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; - } else { - $scope.searchLoading = false; - } - }); - } - - // mobile number search functionlity - $scope.mySearchChangeFunc = function(val) { - if( val > 0) { - $scope.allSelectedHide = true; - $scope.allSelected('undefined'); - $scope.OpenWindowStatus = false; - } else { - $scope.allSelected('undefined'); - $scope.allSelectedHide = false; - $scope.OpenWindowStatus = false; - } - } - // End: mobile number search functionlity - - // select all or individual functionality - - var getAllSelected = function () { - var selectedItems = $scope.searchResultDetails.filter(function (item) { - return item.Selected; - }); - - return selectedItems.length === $scope.searchResultDetails.length; - } - - var setAllSelected = function (value) { - angular.forEach($scope.searchResultDetails, function (item) { - item.Selected = value; - }); - } - - $scope.allSelected = function (value) { - if (value !== undefined) { - return setAllSelected(value); - } else { - return getAllSelected(); + $scope.sort = function (keyname) { + $scope.sortKey = keyname; //set the sortKey to the param passed + $scope.reverse = !$scope.reverse; //if true make it false and vice versa } - } - // End: select all or individual functionality - - - // open popup window onselct checkbox - $scope.OpenWindowStatus = false; - $scope.openUpdateWind = function () { - var ItemsSelected = $scope.searchResultDetails.filter(function (item) { - if (item.Selected === true) { return true; } - }); - const courseLocal = $scope.searchData.Course; - $scope.getSemYearList(courseLocal); - $scope.getStatusList(); - // alert($scope.searchData.Course); - if (ItemsSelected.length) { - $scope.OpenWindowStatus = true; - $scope.myStatusModel = { - 'semYear': '', - 'staus': '', - 'dateOn': '', - 'comment': '' - } - } else { - $scope.OpenWindowStatus = false; + $scope.editId = -1; + $scope.setEditId = function (P) { + $scope.editId = P; + } + $scope.cancel = function () { + $scope.editId = -1; } - } - // get status list for this activity - $scope.getStatusList = function () { - var getStatusL = { - method: 'POST', - url: apiPoint.url + 'getStatusListForUpdate/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - statusFor: 'studyMaterial', - data: localUpdateStatus - } - }; - $http(getStatusL).then(function (response) { - if (response.data.statusList) { - $scope.statusDetailsList = response.data.statusList_details; - // $scope.searchLoading = false; - } else { - // $scope.searchLoading = false; - } - }); - } + // get local client details + var localDetail = JSON.parse(localStorage.getItem('localObj')); + var localDetails = ipCookie('cookiechk'); + const localUpdateStatus = 'STUDY_MATERIAL'; - // get Sem/Year based on the course select - $scope.getSemYearList = function (courseID) { - $scope.semYearList = ''; - if (courseID !== '' && courseID !== undefined) { - var getSemYear = { + $scope.init = function () { + $scope.getUniversityList(); + } + + $scope.searchData = { + 'University': '', + 'Course': '', + 'Batch': '', + 'Mobile': '', + 'Name': '' + } + + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '' + } + + $scope.universityData = ''; + // get university list while the page is load + $scope.getUniversityList = function () { + var empListreq = { method: 'POST', - url: apiPoint.url + 'getSemYearForCourse/', + url: apiPoint.url + 'getUniveCourseBratch/', headers: { 'Content-Type': 'application/json' }, data: { - data: courseID + data: localDetails } }; - $http(getSemYear).then(function (response) { - if (response.data.semYearResult) { - $scope.semYearList = response.data.semYear_result_details; + $http(empListreq).then(function (response) { + if (response.data.univList) { + $scope.universityData = response.data.university_details; } else { - $scope.semYearList = ''; } }); + }; - } else { + $scope.getUniveId = function (univ) { + let name = JSON.parse(univ); + $scope.searchData.University = name.UniversityID; + $scope.searchData.Course = ''; + $scope.searchData.Batch = ''; + $scope.courseData = name.Course; + $scope.batchData = name.Batch; + $scope.OpenWindowStatus = false; + $scope.getSearch(); + }; + $scope.getValueChange = function () { + $scope.getSearch(); } - } - - // $scope.updateItems = function () { - // var studentForUpdate = []; - // var ItemsSelected = $scope.searchResultDetails.filter(function (item) { - // if (item.Selected === true) { - // let getStudentID = new getStudentForUpdateDetails(item.StudentID); - // studentForUpdate.push(getStudentID); - // return true; - // } - // }); - // function getStudentForUpdateDetails(id) { - // this.iD = id; - // } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - // } - - $scope.statusUpdate = { - submit: function (form, myStatusModel) { - 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; - } - } + $scope.searchResultDetails = []; + $scope.searchLoading = false; + $scope.searchResultLength = 0; + // get student list based on the search data + $scope.getSearch = function () { + $scope.OpenWindowStatus = false; + $scope.searchLoading = true; + var getSearchDetails = { + method: 'POST', + url: apiPoint.url + 'getSearchAutoDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.searchData, + requestDetails: localDetails } - 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"); + }; + $http(getSearchDetails).then(function (response) { + if (response.data.searchResult) { + $scope.searchResultStatus = response.data.searchResult; + $scope.searchLoading = false; + let searchResultDetailsBef = response.data.search_result_details; + const filterAddSelect = searchResultDetailsBef.filter(val => { + val['Selected'] = false; + return val; + }); + $scope.searchResultDetails = filterAddSelect; + $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; + } else { + $scope.searchLoading = false; + } + }); + } + + // mobile number search functionlity + $scope.mySearchChangeFunc = function (val) { + if (val > 0) { + $scope.allSelectedHide = true; + $scope.allSelected('undefined'); + $scope.OpenWindowStatus = false; } else { - $scope.disableButton = true; - var studentForUpdate = []; - let formate = "dd-MM-yyyy"; - $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); - var ItemsSelected = $scope.searchResultDetails.filter(function (item) { - if (item.Selected === true) { - let getStudentID = new getStudentForUpdateDetails(item.StudentID); - studentForUpdate.push(getStudentID); - return true; - } - }); - function getStudentForUpdateDetails(id) { - this.StudentID = id; - this.CourseID = $scope.myStatusModel.semYear; - this.BranchCode = localDetails.localBranchID; - this.ListCode = $scope.myStatusModel.staus; - this.SDate = $scope.myStatusModel.dateOn; - this.Coursedetail = id; - this.Comments = $scope.myStatusModel.comment; - } - // alert(JSON.stringify($scope.myStatusModel)); - // alert(JSON.stringify(studentForUpdate)); - - var updateStudyMaterial = { - method: 'POST', - url: apiPoint.url + 'updateStudentMaterialStatus/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: studentForUpdate, - requestDetails : localDetails - } - }; - $http(updateStudyMaterial).then(function (response) { - if (response.data.addStatus) { - swal("Success!", response.data.message, "success"); - $scope.disableButton = false; - // for success state - $scope.allSelected('undefined'); - $scope.OpenWindowStatus = false; - } else { - swal("Failed!", response.data.message, "error"); - $scope.disableButton = false; - } - }); + $scope.allSelected('undefined'); + $scope.allSelectedHide = false; + $scope.OpenWindowStatus = false; } - }, - reset: function (form) { - form.$setPristine(true); - $scope.myStatusModel = { + } + // End: mobile number search functionlity + + // select all or individual functionality + + // var getAllSelected = function () { + // var selectedItems = $scope.searchResultDetails.filter(function (item) { + // return item.Selected; + // }); + + // return selectedItems.length === $scope.searchResultDetails.length; + // } + + // var setAllSelected = function (value) { + // angular.forEach($scope.searchResultDetails, function (item) { + // item.Selected = value; + // }); + // } + + // $scope.allSelected = function (value) { + // if (value !== undefined) { + // return setAllSelected(value); + // } else { + // return getAllSelected(); + // } + // } + + // Select one row in a table once + $scope.setOneSelect = function (value) { + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = value; + }); + value.Selected = true; + $scope.OpenWindowStatus = true; + $scope.openUpdateWind(); + } + + // End: select all or individual functionality + + // unselect all the selected items + $scope.unSelect = function () { + // alert(value.Selected); + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.openUpdateWind(); + } + + // open popup window onselct checkbox / close popup window uncheck all the selected items + $scope.OpenWindowStatus = false; + $scope.openUpdateWind = function () { + // $location.hash('bottom'); + // call $anchorScroll() + // alert(document.getElementById('bottom1')); + $window.scrollTo(0, 1800); + // $window.scrollTo(0, angular.element(document.getElementById('bottom1')).offsetTop); + var ItemsSelected = $scope.searchResultDetails.filter(function (item) { + if (item.Selected === true) { return true; } + }); + + if (ItemsSelected.length !== 0) { + const courseLocal = ItemsSelected[0].CourseID; + const selectedStuId = ItemsSelected[0].StudentID; + $scope.getSemYearList(courseLocal, selectedStuId); + $scope.getStatusList(); + $scope.OpenWindowStatus = true; + $scope.myStatusModel = { 'semYear': '', 'staus': '', 'dateOn': '', 'comment': '' } - } - } - - - // check unchek for table values - - $scope.prevStatusListForStudentCourse = ''; - // get previous status details for the student - $scope.getPrevStatus = function(p) { - // alert(JSON.stringify(p)); - $scope.prevStatusListForStudentCourseLoading = true; - $scope.prevStatusListForStudentCourseNoRecord = false; - $scope.prevStatusListForStudentCourse = ''; - var getPrevStatus = { - method: 'POST', - url: apiPoint.url + 'getPrevStatusDetailsForStu/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - statusFor: localUpdateStatus, - getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID} , - data: localDetail - } - }; - $http(getPrevStatus).then(function (response) { - if (response.data.preStatusDetails) { - $scope.prevStatusListForStudentCourseLoading = false; - $scope.prevStatusListForStudentCourse = response.data.preStatus_details_list; - $scope.prevNoRecordFound = false; } else { - $scope.prevStatusListForStudentCourseLoading = false; - $scope.prevStatusListForStudentCourseNoRecord = true; - $scope.prevNoRecordFound = true; + $scope.OpenWindowStatus = false; } - }); - } + } + + // get status list for this activity + $scope.getStatusList = function () { + var getStatusL = { + method: 'POST', + url: apiPoint.url + 'getStatusListForUpdate/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + statusFor: 'studyMaterial', + data: localUpdateStatus + } + }; + $http(getStatusL).then(function (response) { + if (response.data.statusList) { + $scope.statusDetailsList = response.data.statusList_details; + // $scope.searchLoading = false; + } else { + // $scope.searchLoading = false; + } + }); + } + + // get Sem/Year based on the course select + $scope.getSemYearList = function (courseID, StuId) { + $scope.semYearList = ''; + if (courseID !== '' && courseID !== undefined) { + var getSemYear = { + method: 'POST', + url: apiPoint.url + 'getSemYearForCourse/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: courseID, + stuFor: StuId + } + }; + $http(getSemYear).then(function (response) { + if (response.data.semYearResult) { + $scope.semYearList = response.data.semYear_result_details; + } else { + $scope.semYearList = ''; + } + }); + + } else { + + } + } + + $scope.statusUpdate = { + submit: function (form, myStatusModel) { + 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 { + $scope.disableButton = true; + var studentForUpdate = []; + let formate = "dd-MM-yyyy"; + $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); + var ItemsSelected = $scope.searchResultDetails.filter(function (item) { + if (item.Selected === true) { + let getStudentID = new getStudentForUpdateDetails(item.StudentID); + studentForUpdate.push(getStudentID); + return true; + } + }); + function getStudentForUpdateDetails(id) { + this.StudentID = id; + this.CourseID = $scope.myStatusModel.semYear; + this.BranchCode = localDetails.localBranchID; + this.ListCode = $scope.myStatusModel.staus; + this.SDate = $scope.myStatusModel.dateOn; + this.Coursedetail = id; + this.Comments = $scope.myStatusModel.comment; + } + var updateStudyMaterial = { + method: 'POST', + url: apiPoint.url + 'updateStudentMaterialStatus/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: studentForUpdate, + requestDetails: localDetails + } + }; + $http(updateStudyMaterial).then(function (response) { + if (response.data.addStatus) { + swal("Success!", response.data.message, "success"); + $scope.disableButton = false; + // for success state + // $scope.allSelected('undefined'); + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.OpenWindowStatus = false; + } else { + swal("Failed!", response.data.message, "error"); + $scope.disableButton = false; + } + }); + } + }, + reset: function (form) { + form.$setPristine(true); + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '' + } + } + } - // $scope.CheckUncheckAll = function () { + // check unchek for table values - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // $scope.searchResultDetails[i].Selected = $scope.IsAllChecked; - // } - // }; + $scope.prevStatusListForStudentCourse = ''; + // get previous status details for the student + $scope.getPrevStatus = function (p) { + $scope.prevStatusListForStudentCourseLoading = true; + $scope.prevStatusListForStudentCourseNoRecord = false; + $scope.prevStatusListForStudentCourse = ''; + var getPrevStatus = { + method: 'POST', + url: apiPoint.url + 'getPrevStatusDetailsForStu/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + statusFor: localUpdateStatus, + getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID }, + data: localDetail + } + }; + $http(getPrevStatus).then(function (response) { + if (response.data.preStatusDetails) { + $scope.prevStatusListForStudentCourseLoading = false; + $scope.prevStatusListForStudentCourse = response.data.preStatus_details_list; + $scope.prevNoRecordFound = false; + } else { + $scope.prevStatusListForStudentCourseLoading = false; + $scope.prevStatusListForStudentCourseNoRecord = true; + $scope.prevNoRecordFound = true; + } + }); + } - // $scope.CheckUncheckHeader = function () { - // $scope.IsAllChecked = true; - // for (var i = 0; i < $scope.searchResultDetails.length; i++) { - // if (!$scope.searchResultDetails[i].Selected) { - // $scope.IsAllChecked = false; - // break; - // } - // }; - // }; - - // $scope.CheckUncheckHeader(); -}]); + }]); diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html index 879e660e..9002526b 100755 --- a/Apollo/assets/views/daybook/daybook.html +++ b/Apollo/assets/views/daybook/daybook.html @@ -72,7 +72,32 @@

No records found...

--> + + +
+
+
+
+ Total Count: {{ dataLength }} +
+
+
+
+ @@ -82,15 +107,19 @@ + + - - + @@ -102,9 +131,11 @@ + + - + - @@ -172,12 +172,14 @@
Income/Expense Voucher Number + + Paid To + + Type Amount + Amount Description - - Status
{{p.Date}} {{p.ListName}}{{p.VoucherNumber}}{{p.PaidTo}} {{p.TypeName}} {{p.Amount}}{{p.Description}} {{p.Status}} @@ -122,10 +153,40 @@
+
+
+
+ + + Voucher Number is required. +
+
+ + + Paid To / Received To is required. +
+
+ + + + JOB Responsibility is required + Job Responsibility Should be Less than 1000 Characters.
+
First Name @@ -146,7 +146,7 @@
+ + @@ -207,6 +209,19 @@
+
@@ -217,6 +232,11 @@ Update Status +
+ + + +
+ - + @@ -211,6 +212,19 @@
+
@@ -220,6 +234,15 @@ Update Status +
+ + + + + +
Sem/Year Status Comments Date Updated By
{{s.Sem_Year}} {{s.ListName}} {{s.Comments}} {{s.AnsDate}} Updated By
{{s.ListName}} {{s.Comments}}{{s.CertificateName}}{{s.CertificateName}} {{s.AppDate}} {{s.Firstname}}
+ @@ -179,10 +180,11 @@ + - + @@ -210,6 +212,19 @@
+
@@ -220,6 +235,11 @@ Update Status +
+ + + +
+
@@ -174,12 +174,14 @@
Sem/Year Status Comments TypeUpdated By
{{s.Sem_Year}} {{s.ListName}} {{s.Comments}} {{s.CertificationType}}{{s.CertificationNo}}{{s.CertificationNo}} {{s.CDate}} {{s.Firstname}}
- + First Name @@ -147,7 +147,7 @@
+ + @@ -209,9 +211,25 @@
+ -
+
@@ -221,6 +239,15 @@ Update Status +
+ + + + + +
- +
Sem/Year Status Comments Date Updated By
{{s.Sem_Year}} {{s.ListName}} {{s.Comments}} {{s.SDate}} {{p.Fathername}} ACTIVE DEACTIVE{{p.Comments}}{{p.Comments}} @@ -584,6 +584,7 @@ +