diff --git a/Apollo/api/application/models/Employee_model.php b/Apollo/api/application/models/Employee_model.php index df93c5ef..ecd4e866 100644 --- a/Apollo/api/application/models/Employee_model.php +++ b/Apollo/api/application/models/Employee_model.php @@ -195,14 +195,14 @@ class Employee_model extends CI_Model $results['branch_details'] = $mBranchDetails->result(); } else { // res for Admin - $staffId = $this->selfGetEmpId($reqUserID); - $subQuery = "SELECT t1.BranchCode, t1.BranchName - FROM T_BranchMaster as t1 - LEFT JOIN T_Staff_BranchAccess as t2 ON t2.StaffID = '$staffId' - WHERE t2.BranchCode = t1.BranchCode - AND t1.IsActive = 1 - AND t2.IsActive = 1"; - $mBranchDetails = $this->db->query($subQuery); + $staffId = $this->selfGetEmpId($reqUserID); + $subQuery = "SELECT t1.BranchCode, t1.BranchName + FROM T_BranchMaster as t1 + LEFT JOIN T_Staff_BranchAccess as t2 ON t2.StaffID = '$staffId' + WHERE t2.BranchCode = t1.BranchCode + AND t1.IsActive = 1 + AND t2.IsActive = 1"; + $mBranchDetails = $this->db->query($subQuery); $results['MeasterBranchDetailStatus'] = true; $results['branch_details'] = $mBranchDetails->result(); } @@ -360,23 +360,30 @@ class Employee_model extends CI_Model // get employee branch details public function get_employee_branch($staffId) { - $this->db->select('t1.BranchCode, t1.BranchName'); - $this->db->from('' . BRANCH . ' as t1'); - $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); - $branchDetails = $this->db->get(); - $checkArr = $branchDetails->result(); + $this->db->select('t3.ListCode, t3.ListName'); + $this->db->from('' . PICK_LIST_DETAILS . ' as t3'); + $this->db->join('' . STAFF . ' as t4', 't4.ListCode = t3.ListCode', 'LEFT'); + $this->db->where('t4.StaffID', $staffId); + $roleDetails = $this->db->get(); + $checkArr = $roleDetails->result(); if (count($checkArr) > 0) { - $this->db->select('t3.ListCode, t3.ListName'); - $this->db->from('' . PICK_LIST_DETAILS . ' as t3'); - $this->db->join('' . STAFF . ' as t4', 't4.ListCode = t3.ListCode', 'LEFT'); - $this->db->where('t4.StaffID', $staffId); - $roleDetails = $this->db->get(); - $result['empBranchDetails'] = true; - $result['role_details'] = $roleDetails->result(); - $result['branch_details'] = $branchDetails->result(); + $this->db->select('t1.BranchCode, t1.BranchName'); + $this->db->from('' . BRANCH . ' as t1'); + $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); + $branchDetails = $this->db->get(); + $branchArr = $branchDetails->result(); + if( count($branchArr) > 0 ) { + $result['empBranchDetails'] = true; + $result['role_details'] = $roleDetails->result(); + $result['branch_details'] = $branchDetails->result(); + } else { + $result['empBranchDetails'] = true; + $result['role_details'] = $roleDetails->result(); + $result['branch_details'] = $branchDetails->result(); + } } else { $result['empBranchDetails'] = false; } diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index 560de865..f1e96bde 100644 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -69,7 +69,8 @@ "student": { "MAIN": "STUDENTS DETAILS", "LISTING": "STUDENTS LISTING", - "ENROLLMENT": "STUDENT ENROLLMENT" + "ENROLLMENT": "STUDENT ENROLLMENT", + "STUDENTDETAILS": "STUDENT DETAILS" }, "status": { "MAIN": "STATUS", diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index b791b9ec..4a44c560 100644 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -91,6 +91,10 @@ app.constant('JS_REQUIRES', { Activity * */ 'activityCtrl': 'assets/js/controllers/activityCtrl.js', + /* * + Student + * */ + 'studentCtrl': 'assets/js/controllers/studentCtrl.js', /* diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index c5a8ae7b..4ee2c809 100644 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -142,10 +142,10 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com // resolve: loadSequence('iconsCtrl') }).state('app.student', { url: '/student', - template: '
', - title: 'Tables', + template: '
STUDENT DETAILS
', + title: 'Student', ncyBreadcrumb: { - label: 'Tables' + label: 'Student' } }).state('app.student.listing', { url: '/basic', @@ -154,12 +154,13 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com ncyBreadcrumb: { label: 'Basic' } - }).state('app.student.enrollment', { - url: '/responsive', - templateUrl: "assets/views/table_responsive.html", - title: 'Responsive Tables', + }).state('app.student.studentDetails', { + url: '/studentDetails', + templateUrl: "assets/views/student/student_details.html", + resolve: loadSequence('ui.select','spin', 'ui.mask', 'ladda', 'angular-ladda', 'studentCtrl', 'ngTable'), + title: 'Student Details', ncyBreadcrumb: { - label: 'Responsive' + label: 'Student Details' } }).state('app.status', { url: '/status', diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js new file mode 100644 index 00000000..f92761cc --- /dev/null +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -0,0 +1,164 @@ +'use strict'; +/** + * controllers for ng-table + * 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', function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window) { + /** + * student details capture + * by : kdk + */ + $scope.myModel = { + 'primaryPhone': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'caste': '', + 'category': '', + 'religion': '', + 'nationality': '', + 'prequalification': '', + 'occupation': '', + 'designation': '', + 'companyname': '', + 'referredby': '', + 'referredmobilenumber': '', + 'switchsetting': true, + }; + var data = ''; + $scope.roleDetails = ''; + $scope.branchDetails = ''; + $scope.employeeDetails = ''; + $scope.loader = false; + $scope.emptyData; + // 2017-11-23T00:00:00+0530 + // sorting function for table params + $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 + } + + // get local cliend details + var localDetail = JSON.parse(localStorage.getItem('localObj')); + var localDetails = ipCookie('cookiechk'); + + // load when html page load + $scope.init = function () { + if (localDetail != null) { + $scope.currentDate = new Date(); + // $scope.currentPage = 1; + } else { + } + } + + $scope.editId = -1; + $scope.editBranchId = -1; + $scope.setEditId = function (id) { + $scope.editId = id; + $scope.editBranchId = -1; + } + + $scope.setEditBranchId = function (id) { + $scope.getEmpBranchDetails(id); + $scope.editBranchId = id; + $scope.editId = -1; + $scope.branchEditLoading = true; + } + + $scope.cancel = function () { + $scope.getEmployeeList(); + $scope.editId = -1; + $scope.editBranchId = -1; + } + + $scope.empBranchDetails = ''; + $scope.empRoleDetail = ''; + + // add empolyee + $scope.studentFORM = { + submit: function (form, myModel) { + var firstError = null; + if (form.$invalid) { + alert('error'); + 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 { + alert('ok'); + // var formate = "dd-MM-yyyy"; + // $scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0; + // $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); + // $scope.myModel.dateofjoining = $filter('date')(new Date($scope.myModel.dateofjoining), formate); + // var req = { + // method: 'POST', + // url: apiPoint.url + 'insertEmployee/', + // headers: { + // 'Content-Type': 'application/json' + // }, + // data: { + // data: $scope.myModel, + // createdBy: localDetails.localUserID, + // } + // }; + // $http(req).then(function (response) { + // if (response.data.addEmpStatus == true) { + // swal("Success!", response.data.message, "success"); + // $state.go($state.current, {}, { reload: true }); + // } else { + // swal("Failed!", response.data.message, "error"); + // } + // }); + } + }, + reset: function (form) { + + // $scope.myModel = angular.copy($scope.master); + form.$setPristine(true); + $scope.myModel = { + 'employeeId': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'primaryPhone': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'qualificaion': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'homeBranch': '', + 'dateofjoining': '', + 'dateofjoining': '', + 'role': '', + 'switchsetting': true, + }; + } + } + +}]); diff --git a/Apollo/assets/js/main.js b/Apollo/assets/js/main.js index 99dfe627..57c5c298 100644 --- a/Apollo/assets/js/main.js +++ b/Apollo/assets/js/main.js @@ -67,9 +67,9 @@ function (cfpLoadingBarProvider) { cfpLoadingBarProvider.includeSpinner = false; }]); -app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", function ($scope, $localStorage, $state) { - /** - * checking the session settings and logout for the function - */ +// app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", function ($scope, $localStorage, $state) { +// /** +// * checking the session settings and logout for the function +// */ - }]); +// }]); diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index 70ba902c..bba8f1e9 100644 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -57,6 +57,25 @@ +
  • + +
    +
    + +
    +
    + STUDENT +
    +
    +
    + +
  • diff --git a/Apollo/assets/views/student/student_details.html b/Apollo/assets/views/student/student_details.html new file mode 100644 index 00000000..22b28719 --- /dev/null +++ b/Apollo/assets/views/student/student_details.html @@ -0,0 +1,472 @@ + +
    +
    +
    +

    {{ mainTitle }}

    +
    +
    +
    +
    + + +
    +
    + + + + + + + +
    +
    +
    +
    +
    + + Personal Details + + +
    +
    + + + Mobile Number is required. + Enter a Valid Phone Number +
    + + +
    + + + + First Name required + Invalid First Name +
    + +
    + + + + Last Name required + Invalid Last Name +
    +
    +
    +
    + + + + Father Name required + Invalid Father Name +
    + +
    + + + + Mother Name required + Invalid Last Name +
    + +
    + + + Email is required. + Please, enter a valid email address. +
    +
    +
    + +
    + + + Alternate Mobile Number is required. + Enter a Valid Phone Number +
    + +
    +
    + + + + + Date of Birth is required. + Enter a Valid Date of Birth +
    +
    +
    + +
    + + + + + Gender is required. + +
    +
    + +
    +
    +
    + + + Permanent Address is required +
    +
    + + + Current Address is required +
    +
    + + + Aadhar Number is required. + Enter a Valid Aadhar Number +
    +
    + + + +
    + +
    +
    +
    + + + Aadhar Number is required. + Enter a Valid Details +
    +
    + + + Aadhar Number is required. + Enter a Valid Details +
    +
    +
    +
    + + + + Invalid Caste Name +
    +
    + + + + Invalid Category Name +
    +
    +
    + +
    + + + + Invalid Religion Name +
    +
    + + + + Invalid Nationality Name +
    +
    + + + + Enter a Valid Qualification +
    +
    +
    + +
    + + + + Invalid Occupation +
    +
    + + + + Invalid Designation +
    +
    + + + + Invalid Company +
    +
    +
    +
    + + + + Invalid Referred By +
    +
    + + + Refer's Mobile Number is required. + Enter a Valid Phone Number +
    +
    +
     {{ myModel | json }}
    +
    +
    + + Course Details + + +
    +
    + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file