diff --git a/Apollo/api/application/config/constants.php b/Apollo/api/application/config/constants.php index 940ae6c4..af611e46 100644 --- a/Apollo/api/application/config/constants.php +++ b/Apollo/api/application/config/constants.php @@ -103,6 +103,7 @@ defined('PICK_LIST_DETAILS') OR define('PICK_LIST_DETAILS','T_PickListDetails'); defined('BATCH') OR define('BATCH','T_BatchMaster'); defined('STUDENTCOURSE') OR define('STUDENTCOURSE','T_Student_CourseDetails'); defined('STUDENTS') OR define('STUDENTS','T_StudentDetails'); +defined('ANNOUNCEMENT') OR define('ANNOUNCEMENT','T_AnnouncementDetails'); //end of database table name diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 6e196527..e5099bd2 100644 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -108,12 +108,21 @@ $route['chkUpdateStuExistDetail'] = 'Student_Controller/chkUpdateStuExistDetail' $route['getStudentCourseList'] = 'Student_Controller/getStudentCourseList'; $route['getStudentCourseDetails'] = 'Student_Controller/getStudentCourseDetails'; $route['updateStudentCourseDetail'] = 'Student_Controller/updateStudentCourseDetail'; +$route['insertStudentCourse'] = 'Student_Controller/insertStudentCourse'; //batch $route['addBatchDetails'] = 'Batch_Controller/addBatchDetails'; $route['updateBatchDetails'] = 'Batch_Controller/updateBatchDetails'; $route['getBatchDetails'] = 'Batch_Controller/getBatchDetails'; +/*Announcement*/ +$route['addAnnouncementDetails'] = 'Announcement_Controller/addAnnouncementDetails'; +$route['getAnnouncementDetails'] = 'Announcement_Controller/getAnnouncementDetails'; +$route['updateAnnouncementDetails'] = 'Announcement_Controller/updateAnnouncementDetails'; + +// dash board +$route['getDashboardCallTrack'] = 'Call_Tracking_Controller/getDashboardCallTrack'; + diff --git a/Apollo/api/application/controllers/Announcement_Controller.php b/Apollo/api/application/controllers/Announcement_Controller.php new file mode 100644 index 00000000..d919d4b9 --- /dev/null +++ b/Apollo/api/application/controllers/Announcement_Controller.php @@ -0,0 +1,135 @@ +methods['addAnnouncementDetails_get']['limit'] = 500; // 500 requests per hour per user/key + $this->methods['addAnnouncementDetails_post']['limit'] = 100; // 100 requests per hour per user/key + $this->methods['addAnnouncementDetails_delete']['limit'] = 50; // 50 requests per hour per user/key + $this->methods['getAnnouncementDetails_post']['limit'] = 500; // 50 requests per hour per user/key + $this->methods['updateAnnouncementDetails_post']['limit'] = 500; + // load the model + $this->load->model('Announcement_model', 'announcement_model'); + + } + + /* + * This method used to add Announcement Details + * created by Surendiran + * */ + + public function addAnnouncementDetails_post() + { + $details['Heading'] = $this->post('Heading'); + $details['Description'] = $this->post('description'); + $details['CreatedBy'] = $this->post('createdBy'); + $details['IsActive'] = $this->post('status'); + $announcementDetails = $this->announcement_model->addAnnouncement($details);// Check if the users data store contains users (in case the database result returns NULL) + if ($announcementDetails) + { + $announcementDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($announcementDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'Something went wrong.please try again!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + + } + + /* + * get Announcement Details + * created by Surendiran + * */ + public function getAnnouncementDetails_post() + { + $requestedBy = $this->post('requestedBy'); + + $getAnnouncement = $this->announcement_model->getAnnouncement(); + + if ($getAnnouncement) + { + $getAnnouncement['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getAnnouncement, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + + } + + /* + * update Announcement Details + * created by Surendiran + * */ + public function updateAnnouncementDetails_post() + { + $updateID = $this->post('updateID'); + // $details['ID'] = $this->post('ID'); + $details['Heading'] = $this->post('Heading'); + $details['Description'] = $this->post('description'); + $details['IsActive'] = $this->post('status'); + $details['UpdatedBy'] = $this->post('updatedBy'); + $details['UpdatedOn'] = date("Y-m-d", time()); + $announcementDetails = $this->announcement_model->updateAnnouncement($details,$updateID);// Check if the users data store contains users (in case the database result returns NULL) + + if ($announcementDetails) + { + $announcementDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($announcementDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'Something went wrong.please try again!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + + } +} \ No newline at end of file diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index ca3eed1e..6e7135a6 100644 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -134,6 +134,7 @@ class Student_Controller extends REST_Controller { $req['DOJ'] = $data['DOJ']; $req['IsActive'] = $data['IsActive']; $req['BranchID'] = $data['BranchID']; + $req['EnrollmentID'] = $data['EnrollmentID']; $req['UpdatedBy'] = $updatedBy; $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; @@ -249,6 +250,45 @@ class Student_Controller extends REST_Controller { } } + + // add new course for student + public function insertStudentCourse_post(){ + $addStudent = $this->post('addStudent'); + $coursedata = $this->post('coursedata'); + $createdBy = $this->post('createdBy'); + $createdBranch = $this->post('loginBranch'); + + $reqCourse['StudentID'] = $addStudent; + $reqCourse['UniversityID'] = $coursedata['university']; + $reqCourse['CourseID'] = $coursedata['course']; + $reqCourse['BatchCode'] = $coursedata['batch']; + $reqCourse['DOJ'] = $coursedata['dateofjoining']; + $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; + $reqCourse['BranchID'] = $createdBranch; + $reqCourse['IsActive'] = '1'; + $reqCourse['CreatedBy'] = $createdBy; + $date = date('Y-m-d H:i:s'); + $reqCourse['CreatedOn'] = $date; +// print_r($reqCourse);exit(); + + + $studentAddCourse = $this->student_model->add_student_course( $addStudent , $reqCourse);// Check if the employee exist + if ($studentAddCourse) + { + $studentAddCourse['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($studentAddCourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No users were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } + // add student public function addStudent_post() { $data = $this->post('data'); @@ -291,22 +331,20 @@ class Student_Controller extends REST_Controller { $reqCourse['CourseID'] = $coursedata['course']; $reqCourse['BatchCode'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; - $reqCourse['BranchID'] = $createdBranch; + $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; + $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $reqCourse['CreatedOn'] = $date; $studentAdd = $this->student_model->add_student( $req , $reqCourse);// Check if the employee exist - if ($studentAdd) - { + if ($studentAdd) { $studentAdd['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code - } - else - { + } else { // Set the response and exit $this->response([ 'message' => 'No users were found', diff --git a/Apollo/api/application/models/Announcement_model.php b/Apollo/api/application/models/Announcement_model.php new file mode 100644 index 00000000..a2e7ce2b --- /dev/null +++ b/Apollo/api/application/models/Announcement_model.php @@ -0,0 +1,103 @@ +db->select('Heading'); + $this->db->where('Heading', $arrayDetails['Heading']); + if($this->db->get(ANNOUNCEMENT)->first_row()){ + $result['AnnouncementStatus'] = false; + $result['message'] = "This Announcement is already exist!"; + } else { + $this->db->select('Description'); + $this->db->where('Description', $arrayDetails['Description']); + if($this->db->get(ANNOUNCEMENT)->first_row()){ + $result['AnnouncementStatus'] = false; + $result['message'] = "This Announcement name is already exist!"; + } else{ + $this->db->insert(ANNOUNCEMENT, $arrayDetails); + if($this->db->affected_rows() == '1'){ + + $result['AnnouncementStatus'] = true; + $result['message'] = "Successfully Announcement details added"; + } + + else { + $result['AnnouncementStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + + } + + + + return $result; + + } + public function getAnnouncement() + { + $this->db->select('Heading,description,CreatedOn,IsActive,ID'); + $this->db->order_by('CreatedOn','DESC'); + $announcementDetails = $this->db->get(ANNOUNCEMENT); + + if($announcementDetails->result()){ + + $result['AnnouncementStatus'] = true; + $result['details'] = $announcementDetails->result(); + } + else { + $result['AnnouncementStatus'] = false; + $result['message'] = "No records found!"; + } + + return $result; + + } + + /* + * update announcement details + * created by Surendiran + * */ + + public function updateAnnouncement($arrayDetails=null,$updateID=null) + { + $this->db->where('ID',$updateID); + $updateStatus=$this->db->update(ANNOUNCEMENT, $arrayDetails); + + if($updateStatus){ + + $result['AnnouncementStatus'] = true; + $result['message'] = "Successfully Announcement details updated"; + } + + else { + $result['AnnouncementStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + + } + + + return $result; + + } + +} \ No newline at end of file diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index f4282497..58bd5c28 100644 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -209,6 +209,29 @@ class Student_model extends CI_Model return $result; } + // add student course + public function add_student_course( $studID, $Arr) { + $this->db->select('*'); + $this->db->from(STUDENTCOURSE); + $this->db->where('StudentID', $studID); + $this->db->where('CourseID', $Arr['CourseID']); + + if($this->db->get()->first_row()) { + $result['addStuCourseStatus'] = false; + $result['message'] = "This Student Already exist for this course"; + } else { + $this->db->insert(STUDENTCOURSE, $Arr); + if ($this->db->affected_rows() == '1') { + $result['addStuCourseStatus'] = true; + $result['message'] = "Successfully Student Course Details Updated"; + } else { + $result['addStuCourseStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + return $result; + } + // add student public function add_student($Arr, $courseArr) { diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index f1e96bde..683dd34b 100644 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -64,7 +64,8 @@ "UNIVERSITY": "UNIVERSITY DETAILS", "COURSE": "COURSE DETAILS", "ACTIVITY": "ACTIVITY DETAILS", - "EMPLOYEE": "EMPLOYEE DETAILS" + "EMPLOYEE": "EMPLOYEE DETAILS", + "ANNOUNCEMENT": "ANNOUNCEMENT DETAILS" }, "student": { "MAIN": "STUDENTS DETAILS", diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index ce06c3a3..0c34372e 100644 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -99,7 +99,10 @@ app.constant('JS_REQUIRES', { * batch * */ 'batchCtrl': 'assets/js/controllers/batchCtrl.js', - + /* * + announcementCtrl + * */ + 'announcementCtrl': 'assets/js/controllers/announcementCtrl.js', /* * call track diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index dc1ce976..8d1485c0 100644 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -141,6 +141,14 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com label: 'Activity' }, // resolve: loadSequence('iconsCtrl') + }).state('app.master.announcement', { + url: '/announcement', + templateUrl: "assets/views/announcement/Announcement.html", + resolve: loadSequence('ckeditor-plugin', 'ckeditor', 'announcementCtrl','ladda', 'angular-ladda','ngTable'), + title: 'Announcement', + ncyBreadcrumb: { + label: 'Announcement' + }, }).state('app.student', { url: '/student', template: '
STUDENT DETAILS
', diff --git a/Apollo/assets/js/controllers/announcementCtrl.js b/Apollo/assets/js/controllers/announcementCtrl.js new file mode 100644 index 00000000..676753b8 --- /dev/null +++ b/Apollo/assets/js/controllers/announcementCtrl.js @@ -0,0 +1,230 @@ +'use strict'; +/** + * controller for angular-ckeditor +*/ +app.controller("CkeditorCtrl", ["$scope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", function ($scope, toaster, ngTableParams, $filter, apiPoint, $localStorage, $http, $state) { + + $scope.myModel = { + "Heading": "", + "description": "", + "switchsetting": true + + }; + + /* +* edit announcement details +* created by Surendiran +* */ + $scope.editId = -1; + $scope.setEditId = function (pid) { + + $scope.editId = pid; + $scope.viewId = -1; + }; + + /* + * cancel edit div + * created by Surendiran + * */ + $scope.cancel = function () { + $scope.init(); + $scope.editId = -1; + + }; + + // Editor options. + $scope.options = { + language: 'en', + allowedContent: true, + entities: false + }; + + + + + + // Called when the editor is completely ready. + $scope.onReady = function () { + // ... + // alert(); + $scope.myModel.description + + console.log($scope.myModel.description); + }; + + // $scope.submitForm = function() { + // alert(JSON.stringify($scope.myModel.description)); + // } + + + + + + $scope.announcementForm = { + submit: function (form, myModel, loading) { + 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.ldloading1 = {}; + + $scope.ldloading1[loading.replace('-', '_')] = true; + + + + var addAnnouncement = { + method: 'POST', + url: apiPoint.url + 'addAnnouncementDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + Heading: myModel.Heading, + description: myModel.description, + status: myModel.switchsetting, + createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + $http(addAnnouncement).then(function (response) { + if (response.data.status == 200 && response.data.AnnouncementStatus) { + $scope.ldloading1[loading.replace('-', '_')] = false; + swal("Success!", response.data.message, "success"); + $state.go($state.current, {}, { reload: true }); + } else { + $scope.ldloading1[loading.replace('-', '_')] = false; + swal("Failed!", response.data.message, "error"); + } + }); + + + } + }, + + reset: function (form) { + + $scope.myModel = angular.copy($scope.master); + form.$setPristine(true); + $scope.myModel = { + "Heading": "", + "description": "", + "switchsetting": true + + }; + + } + }; + + + + /* + * update the announcement details + * created by Surendiran + * */ + $scope.updateAnnouncement = function (myModel, form, loading) { + + 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].$stop_name; + } + + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + } else { + $scope.ldloading = {}; + + $scope.ldloading[loading.replace('-', '_')] = true; + + + var update = { + method: 'POST', + url: apiPoint.url + 'updateAnnouncementDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + Heading: myModel.Heading, + description: myModel.description, + status: myModel.IsActive, + updateID: myModel.ID, + createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + $http(update).then(function (response) { + if (response.data.status == 200 && response.data.AnnouncementStatus) { + + $scope.ldloading[loading.replace('-', '_')] = false; + swal("Success!", response.data.message, "success"); + $scope.editId = -1; + $scope.init(); + + } else { + $scope.ldloading[loading.replace('-', '_')] = false; + swal("Failed!", response.data.message, "error"); + } + }); + } + }; + + /* + *get announcementForm details when page loading called from view file + * + * created by Surendiran + * */ + $scope.loader = ''; + $scope.announcementInfo = ''; + $scope.emptyData = ''; + + + $scope.init = function () { + + var getAnnouncement = { + method: 'POST', + url: apiPoint.url + 'getAnnouncementDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + $http(getAnnouncement).then(function (response) { + if (response.data.status == 200 && response.data.AnnouncementStatus) { + $scope.emptyData = true; + $scope.loader = true; + + $scope.data = response.data.details; + + + } else { + $scope.emptyData = false; + $scope.loader = true; + + $scope.announcementInfo = ''; + + } + }); + }; + + +}]); \ No newline at end of file diff --git a/Apollo/assets/js/controllers/sessionCtrl.js b/Apollo/assets/js/controllers/sessionCtrl.js index bc362828..644a083b 100644 --- a/Apollo/assets/js/controllers/sessionCtrl.js +++ b/Apollo/assets/js/controllers/sessionCtrl.js @@ -19,7 +19,7 @@ app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", 'ipCookie', if (localDetail.localType == 'R004') { $scope.getLoginDash = 'superAdmin'; } else if (localDetail.localType == 'R003') { - $scope.getLoginDash = 'superAdmin'; + $scope.getLoginDash = 'Admin'; } else if (localDetail.localType == 'R002') { $scope.getLoginDash = 'staff'; } diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index b707824f..5a7f4995 100644 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -45,6 +45,16 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'enrollmentid': '' }; + $scope.addStudentView = function () { + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + } + // 2017-11-23T00:00:00+0530 @@ -64,7 +74,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.currentDate = new Date(); $scope.getStudentList(); $scope.getUniversityList(); - // $scope.currentPage = 1; } else { } @@ -103,9 +112,9 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } $scope.setEditCourseId = function (id) { - $scope.list = false; $scope.getStudentCourseList(id); + $scope.currentStudentId = id; // $scope.getStudentCourseDetails(id); $scope.editCourseId = id; $scope.editId = -1; @@ -118,9 +127,83 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.editCourseId = -1; } - $scope.getStudentCourseList = function(studentId) { + $scope.cancelCourseDetails = function () { + $scope.getStudentCourseList($scope.currentStudentId); + // $scope.editId = -1; + // $scope.editCourseId = -1; + } + + $scope.addStudentCourse = function () { + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + $scope.list = false; + $scope.courseEdit = false; + $scope.courseAdd = true; + } + + // add student course + $scope.addCourseFORM = { + + submit: function (form, myModelCourse, p) { + // alert(); + 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 { + // alert(JSON.stringify(p.StudentID)); + 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.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); + var req = { + method: 'POST', + url: apiPoint.url + 'insertStudentCourse/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + addStudent: p.StudentID, + coursedata: $scope.myModelCourse, + loginBranch: localDetails.localBranchID, + createdBy: localDetails.localUserID, + } + }; + $http(req).then(function (response) { + if (response.data.addStuCourseStatus == true) { + swal("Success!", response.data.message, "success"); + $scope.getStudentCourseList($scope.currentStudentId); + } else { + swal("Failed!", response.data.message, "error"); + $scope.getStudentCourseList($scope.currentStudentId); + } + }); + } + } + } + + // get Student Course List + $scope.getStudentCourseList = function (studentId) { + $scope.courseEditLoading = true; $scope.list = true; $scope.courseEdit = false; + $scope.courseAdd = false; var req = { method: 'POST', url: apiPoint.url + 'getStudentCourseList/', @@ -141,9 +224,12 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); } + // get student particular course details : params : studentCourseID $scope.getStudentCourseDetails = function (studentcourseID) { + $scope.courseEditLoading = true; $scope.stucour = ''; $scope.list = false; + $scope.courseAdd = false; $scope.courseEdit = true; var req = { method: 'POST', @@ -159,15 +245,62 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", if (response.data.stuCourseDetails) { $scope.courseEditLoading = false; $scope.studentCourse = response.data.course_details; - $scope.stucour = $scope.studentCourse[0]; + $scope.stucour = $scope.studentCourse[0]; } else { } }); } + // update sutdent course details + $scope.updateStudentCourseDetails = function (form, datas) { + 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 { + alert(datas.DOJ); + var formate = "dd-MM-yyyy"; + var checkDOJ = $filter('date')(new Date(datas.DOJ), formate); + datas.IsActive = datas.IsActive === true ? 1 : 0; + datas.DOJ = checkDOJ == "NaN-NaN-0NaN" ? datas.DOJ : $filter('date')(new Date(datas.DOJ), formate); + alert(datas.DOJ); + var req = { + method: 'POST', + url: apiPoint.url + 'updateStudentCourseDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: datas, + updatedBy: localDetails.localUserID, + } + }; + $http(req).then(function (response) { + if (response.data.updateStuCourseStatus) { + swal("Success!", response.data.message, "success"); + $scope.getStudentCourseList($scope.currentStudentId); + // $scope.editCourseId = false; + } else { + // $scope.ldloading1[loading.replace('-', '_')] = false; + swal("Failed!", response.data.message, "error"); + $scope.getStudentCourseList($scope.currentStudentId); + } + }); + } + } + $scope.universityData = ''; - $scope.getUniversityList = function () { var empListreq = { method: 'POST', @@ -187,11 +320,17 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); } - $scope.onSlecetUnivEdit = function(id) { + $scope.onSlecetUnivEdit = function (id) { $scope.myModelCourse.university = id; $scope.onSlecetUniv(); } + $scope.onChangeSlecetUnivEdit = function (id) { + $scope.myModelCourse.university = id; + $scope.onSlecetUniv(); + $scope.stucour.CourseID = ''; + $scope.stucour.BatchCode = ''; + } $scope.courseLoading = false; $scope.onSlecetUniv = function () { $scope.courseData = ''; @@ -283,6 +422,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 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 formate = "dd-MM-yyyy"; $scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0; $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); @@ -303,8 +443,10 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $http(req).then(function (response) { if (response.data.addStudentStatus == true) { swal("Success!", response.data.message, "success"); + $scope.disableButton = false; $state.go($state.current, {}, { reload: true }); } else { + $scope.disableButton = false; swal("Failed!", response.data.message, "error"); } }); @@ -349,7 +491,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } - // update check mobile exist + // update check mobile exist $scope.updateCheckMobileExist = function (p) { var checkReq = { method: 'POST', @@ -394,11 +536,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } }); } - + // update student details $scope.updateStuDetails = function (form, p) { var firstError = null; - if (form.$invalid) { + if (form.$invalid) { var field = null, firstError = null; for (field in form) { if (field[0] != '$') { @@ -412,7 +554,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } 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 { + } else { // alert(p.DOB); var formate = "dd-MM-yyyy"; var checkDOB = $filter('date')(new Date(p.DOB), formate); @@ -442,49 +584,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } } - $scope.updateStudentCourseDetails = function (form, datas) { - if (form.$invalid) { - var field = null, firstError = null; - for (field in form) { - if (field[0] != '$') { - if (firstError === null && !form[field].$valid) { - firstError = form[field].$name; - } - if (form[field].$pristine) { - form[field].$dirty = true; - } - } - } - angular.element('.ng-invalid[name=' + firstError + ']').focus(); - // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); - } else { - var formate = "dd-MM-yyyy"; - var checkDOJ = $filter('date')(new Date(datas.DOJ), formate); - datas.IsActive = datas.IsActive === true ? 1 : 0; - datas.DOJ = checkDOJ == "NaN-NaN-0NaN" ? datas.DOJ : $filter('date')(new Date(datas.DOJ), formate); - - var req = { - method: 'POST', - url: apiPoint.url + 'updateStudentCourseDetail/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: datas, - updatedBy: localDetails.localUserID, - } - }; - $http(req).then(function (response) { - if (response.data.updateStuCourseStatus = true) { - swal("Success!", response.data.message, "success"); - $scope.getStudentList(); - $scope.editCourseId = -1; - } else { - // $scope.ldloading1[loading.replace('-', '_')] = false; - swal("Failed!", response.data.message, "error"); - } - }); - } - } + }]); diff --git a/Apollo/assets/views/announcement/Announcement.html b/Apollo/assets/views/announcement/Announcement.html new file mode 100644 index 00000000..31c7edf1 --- /dev/null +++ b/Apollo/assets/views/announcement/Announcement.html @@ -0,0 +1,184 @@ + + +
+
+
+

{{ mainTitle }}

+ +
+
+
+
+ + +
+
+ + +
+
+
+ +
Please Wait...
+
+
+ +
+

oops! No + records found...

+
+
+
+ +
+ +

+
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Heading + + Status + +
{{p.Heading}} Active InActive + +
+
+ + +
+ +
+
+
+ +
+ + + + +
+
+ + Add New Announcement Details + +
+
+ +
+
+ + Heading is required +
+
+ +
+
+ +
+
+ + +
+ + +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ + +
+
+ +
+
+
+
+ + + +
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/Apollo/assets/views/announcement/editAnnouncementDetails.html b/Apollo/assets/views/announcement/editAnnouncementDetails.html new file mode 100644 index 00000000..46be6f91 --- /dev/null +++ b/Apollo/assets/views/announcement/editAnnouncementDetails.html @@ -0,0 +1,99 @@ +
+
+ +
+
+ + Update Announcement Details + + + + +
+ + +
+ +
+ +
+
+ + Heading is required +
+ + + +
+ + +
+
+ +
+
+ + +
+ + +
+
+ +
+
+ +
+
+
+ +
+ + + +
+
+ + +
+ +
+ +
+
+
+
+ + + + + +
+
+ + + + + +
+ +
+ + + diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index b8e5543d..c70bb59c 100644 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -59,6 +59,114 @@ EMPLOYEE DETAILS +
  • + + Announcement DETAILS + +
  • + + + + + +
  • + +
    +
    + +
    +
    + CALL TRACKING +
    +
    +
    + +
  • + + + + + + + + + + +
    - +
  • @@ -153,6 +255,9 @@
  • + + + diff --git a/Apollo/assets/views/student/editStudentCourseDetails.html b/Apollo/assets/views/student/editStudentCourseDetails.html index 60c38064..e000d672 100644 --- a/Apollo/assets/views/student/editStudentCourseDetails.html +++ b/Apollo/assets/views/student/editStudentCourseDetails.html @@ -1,64 +1,67 @@ -
    -
    +
    +
    +
    + +

    Fetching ...

    +
    -
    - -

    Fetching ...

    -
    -
    -
    - - Course Details - - -
    - - - - - - - - - - - - - - - - - - - -
    University - Course - Batch - Date of Join -
    {{s.UniversityName}}{{s.CourseName}}{{s.BatchName}}{{s.DOJ}}Edit
    -
    -
    -
    - + -
    - - - - -
    +
    + + + +
    +
    + Enrollment ID required +
    +
    -
    + +
    - - -
    + + + + +
    + +
    +
    +
    + + + + University is Required +
    + +
    + + +
    + fetching... +
    +
    + +
    + Course is required + +
    + +
    + + +
    + fetching... +
    +
    + +
    + Batch is required + +
    +
    +
    +
    + + + Enrollment ID required +
    + +
    + + + + + Date of Joining required +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    - +
    \ No newline at end of file diff --git a/Apollo/assets/views/student/student_details.html b/Apollo/assets/views/student/student_details.html index 9cb1ab15..63f4495e 100644 --- a/Apollo/assets/views/student/student_details.html +++ b/Apollo/assets/views/student/student_details.html @@ -65,7 +65,7 @@ - + @@ -102,7 +102,7 @@ - +
    @@ -468,21 +468,28 @@ /> Enrollment ID required
    - +
    - + .dropdown-menu { + position: relative; + /*top: -225px !important;*/ + } + + + placeholder="Select Date of Joining" close-text="Close" required="required" datepicker-position="top"/> + Date of Joining required
    -
    -
     {{ myModel | json }}
    -
     {{ myModelCourse | json }}
    +