From 6d68edb1b1decb63157023c10c699c825c6e5b72 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 15:15:18 +0530 Subject: [PATCH 01/19] student view changes done --- Apollo/assets/views/student/studentView.html | 383 ++++++++++++------- 1 file changed, 244 insertions(+), 139 deletions(-) diff --git a/Apollo/assets/views/student/studentView.html b/Apollo/assets/views/student/studentView.html index 75173994..74f48509 100644 --- a/Apollo/assets/views/student/studentView.html +++ b/Apollo/assets/views/student/studentView.html @@ -1,4 +1,35 @@ +
+
+
+

+ +
+
+
+
+
+
+
+
+ Add Day Book Details +
+ +
+ +
+
+ + + Type is required + + +
+ +
+ + + + Name is required + Invalid name + + +
+ +
+
+ + +
+
+ +
+ + +
+
+
+ +
+
+ +
+ +

+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Name + + + Type + + + Status
{{p.TypeName}}{{p.ListName}}ActiveDe-Active + + + +
+ + +
+
\ No newline at end of file From 7e86f1d568d5add24100ee7fb2d7f705089bce2f Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 18:42:21 +0530 Subject: [PATCH 12/19] course details changes done --- .../js/controllers/dayBookMasterCtrl.js | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 Apollo/assets/js/controllers/dayBookMasterCtrl.js diff --git a/Apollo/assets/js/controllers/dayBookMasterCtrl.js b/Apollo/assets/js/controllers/dayBookMasterCtrl.js new file mode 100644 index 00000000..b0da3021 --- /dev/null +++ b/Apollo/assets/js/controllers/dayBookMasterCtrl.js @@ -0,0 +1,208 @@ +'use strict'; +/** + * controllers for ng-table + * Simple table with sorting and filtering on AngularJS + */ +// var helloApp = angular.module("helloApp", []); +app.controller("dayBookMasterCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$localStorage", "$http", "$state", function ($scope, toaster, $filter, apiPoint, $localStorage, $http, $state) { + + $scope.myModel = { + "name": "", + "type": "", + "switchsetting": true + + }; + /* + * edit status 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; + + }; + + // 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 + } + + + $scope.dayForm = { + + 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 addstatus = { + method: 'POST', + url: apiPoint.url + 'addDaybookMasterDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + name: myModel.name, + type: myModel.type, + status: myModel.switchsetting, + createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + + $http(addstatus).then(function (response) { + if (response.data.status == 200 && response.data.addStatus) { + $scope.ldloading1[loading.replace('-', '_')] = false; + $scope.init(); + 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 = { + "name": "", + "switchsetting": true, + "type": "" + }; + + } + }; + /* + *get day book details + * */ + + $scope.loader=''; + + $scope.emptyData=''; + + + $scope.init = function () { + + var getdetails = { + method: 'POST', + url: apiPoint.url + 'getDayBookMasterDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + + $http(getdetails).then(function (response) { + $scope.dayBookType = response.data.getDayBooktype; + if (response.data.status==200 && response.data.daybookStatus) { + $scope.emptyData=true; + $scope.loader=true; + + $scope.dayBookInfo = response.data.details; + + } else { + $scope.emptyData=false; + $scope.loader=true; + + $scope.dayBookInfo=''; + + } + }); + }; + + /* + * update the day book details + * */ + $scope.updateDaybook = 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 + 'updateDayBookMasterDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + ID: myModel.ID, + TypeID: myModel.TypeID, + TypeName: myModel.TypeName, + status: myModel.IsActive, + updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + $http(update).then(function (response) { + if (response.data.status==200 && response.data.updateStatus) { + $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"); + } + }); + + } + }; + + + +}]); \ No newline at end of file From 1f7ab4383110ed9367b50a76ba068c520bcbddb1 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 18:42:40 +0530 Subject: [PATCH 13/19] day master changes done --- .../views/daybook/editDayBookMaster.html | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Apollo/assets/views/daybook/editDayBookMaster.html diff --git a/Apollo/assets/views/daybook/editDayBookMaster.html b/Apollo/assets/views/daybook/editDayBookMaster.html new file mode 100644 index 00000000..68737124 --- /dev/null +++ b/Apollo/assets/views/daybook/editDayBookMaster.html @@ -0,0 +1,78 @@ +
+
+
+
+
+ + Update Day Book Details + + +
+
+ + + Type is required + + +
+ + +
+ + + + Name is required + Invalid name + +
+
+ +
+ + + +
+
+ + +
+ +
+ +
+ +
+
+
+
+ + + + + +
+
+
+ +
+
+
+ \ No newline at end of file From 48f57757cde5458f07d1beb65e90a5dd0ab9de1a Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 18:42:58 +0530 Subject: [PATCH 14/19] course details changes done --- .../controllers/DayBookMaster_Controller.php | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Apollo/api/application/controllers/DayBookMaster_Controller.php diff --git a/Apollo/api/application/controllers/DayBookMaster_Controller.php b/Apollo/api/application/controllers/DayBookMaster_Controller.php new file mode 100644 index 00000000..5704dc8a --- /dev/null +++ b/Apollo/api/application/controllers/DayBookMaster_Controller.php @@ -0,0 +1,134 @@ +methods['addDaybookMasterDetails_post']['limit'] = 100; // 50 requests per hour per user/key + $this->methods['getDayBookMasterDetails_post']['limit'] = 500; // 50 requests per hour per user/key + $this->methods['updateDayBookMasterDetails_post']['limit'] = 500; + // load the model + $this->load->model('DaybookMaster_model', 'daybookmaster_model'); + + } + + /* + * This method used to get day book master details + * created by kms + * */ + + public function addDaybookMasterDetails_post() + { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details['TypeID'] = $this->post('type'); + $details['TypeName'] = $this->post('name'); + $details['IsActive'] = $this->post('status'); + $details['CreatedBy'] = $this->post('createdBy'); + $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); + $addDetails = $this->daybookmaster_model->addDetails($details);// Check if the users data store contains users (in case the database result returns NULL) + if ($addDetails) + { + $addDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($addDetails, 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 + } + + + } + /* + * This method used to get day book master details + * created by kms + * */ + public function getDayBookMasterDetails_post() + { + $requestedBy = $this->post('requestedBy'); + $getdetails = $this->daybookmaster_model->getDayBookDetails($requestedBy); + + if ($getdetails) + { + $getdetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getdetails, 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 the day book details + * created by kms + * */ + public function updateDayBookMasterDetails_post() + { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details['ID'] = $this->post('ID'); + $details['TypeName'] = $this->post('TypeName'); + $details['TypeID'] = $this->post('TypeID'); + $details['IsActive'] = $this->post('status'); + $details['UpdatedBy'] = $this->post('updatedBy'); + $details['UpdatedOn'] = $now->format("Y-m-d H:i:s"); + $updateDetails = $this->daybookmaster_model->updateDayBook($details);// Check if the users data store contains users (in case the database result returns NULL) + + if ($updateDetails) + + { + $updateDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($updateDetails, 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 From dcd72f362385bbf721f4c8500f3c202446b29db6 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 18:43:10 +0530 Subject: [PATCH 15/19] course details changes done --- .../models/DaybookMaster_model.php | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 Apollo/api/application/models/DaybookMaster_model.php diff --git a/Apollo/api/application/models/DaybookMaster_model.php b/Apollo/api/application/models/DaybookMaster_model.php new file mode 100644 index 00000000..998d79a1 --- /dev/null +++ b/Apollo/api/application/models/DaybookMaster_model.php @@ -0,0 +1,118 @@ +db->select('TypeName'); + $this->db->where('TypeName', $arrayDetails['TypeName']); + $this->db->where('TypeID', $arrayDetails['TypeID']); + if($this->db->get(INCOMEOUTCOMEMASTER)->first_row()){ + $result['addStatus'] = false; + $result['message'] = "Name is already exist!"; + } else { + $this->db->insert(INCOMEOUTCOMEMASTER, $arrayDetails); + if($this->db->affected_rows() == '1'){ + $result['addStatus'] = true; + $result['message'] = "Successfully day book details is added"; + } + else { + $result['addStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + + } + + + + + return $result; + + } + + + + /* + * get day book details + * created by kms + * */ + + public function getDayBookDetails($requestedBy=null) + { + $this->db->select('IOM.ID,IOM.TypeName,IOM.TypeID,IOM.IsActive,PLD.ListName'); + + $this->db->from(INCOMEOUTCOMEMASTER .' as IOM'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = IOM.TypeID'); + $this->db->order_by('IOM.ID','DESC'); + $details = $this->db->get(); + if($details->result()){ + + $result['daybookStatus'] = true; + $result['details'] = $details->result(); + } + else { + $result['daybookStatus'] = false; + $result['message'] = "No records found!"; + } + $result['getDayBooktype'] = $this->getDayBookType('10'); + + return $result; + + } + /* + * get day book type + * created by kms + * */ + public function getDayBookType($typeID=null){ + $this->db->select('ListCode,ListName'); + $this->db->where('ListGroup', $typeID); + $typeDetails=$this->db->get(PICK_LIST_DETAILS); + return $typeDetails->result(); + } + /* + * update day book details + * created by kms + * */ + + public function updateDayBook($arrayDetails=null) + { + $this->db->select('TypeName'); + $this->db->where('TypeName', $arrayDetails['TypeName']); + $this->db->where('TypeID', $arrayDetails['TypeID']); + $this->db->where_not_in('ID', $arrayDetails['ID']); + if($this->db->get(INCOMEOUTCOMEMASTER)->first_row()){ + $result['updateStatus'] = false; + $result['message'] = "Name is already exist!"; + } else { + $this->db->where('ID',$arrayDetails['ID']); + $this->db->update(INCOMEOUTCOMEMASTER, $arrayDetails); + if($this->db->affected_rows() == '1'){ + $result['updateStatus'] = true; + $result['message'] = "Successfully day book details is updated"; + } + else { + $result['updateStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + + } + + + + return $result; + + } + +} \ No newline at end of file From c28448aa38cccb7fd409a0b44505e5b262310aec Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 18:45:27 +0530 Subject: [PATCH 16/19] course details changes done --- Apollo/assets/views/daybook/dayBookMaster.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollo/assets/views/daybook/dayBookMaster.html b/Apollo/assets/views/daybook/dayBookMaster.html index e7e30822..1dfc039d 100644 --- a/Apollo/assets/views/daybook/dayBookMaster.html +++ b/Apollo/assets/views/daybook/dayBookMaster.html @@ -11,7 +11,7 @@
-

+

From f975435eb01e16a8ea7f1b3a1b9fc5ca758cb8ce Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 19:43:16 +0530 Subject: [PATCH 17/19] course details changes done --- Apollo/assets/views/callTrackingFollowup.html | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Apollo/assets/views/callTrackingFollowup.html b/Apollo/assets/views/callTrackingFollowup.html index e25a21e9..666a4718 100755 --- a/Apollo/assets/views/callTrackingFollowup.html +++ b/Apollo/assets/views/callTrackingFollowup.html @@ -169,12 +169,12 @@
From 79668bb93a4b01b7c5defc23bf14cc557209f342 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 19:43:27 +0530 Subject: [PATCH 18/19] course details changes done --- Apollo/api/application/models/Calltracking_model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 93f25399..be4fa74f 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -419,10 +419,11 @@ class Calltracking_model extends CI_Model { public function getStudentTrackedID($stuMobile=null) { $this->db->distinct(); - $this->db->select('LT.TrackingID,LT.LeadID,AV.ActivityID,AV.ActivityName'); + $this->db->select('LT.TrackingID,LT.LeadID,AV.ActivityID,AV.ActivityName,PLD.ListName'); $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); $this->db->join(ACTIVITY.' as AV', 'AV.ActivityID = LT.ActivityStatus'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.StatusCode'); $this->db->where('LD.MobileNumber',$stuMobile); $this->db->order_by('LT.TrackingID','ASC'); $studeTrackID = $this->db->get(); From 21cde43cf26d0c9381bd9a5d6ec397b3f7220610 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Dec 2017 19:43:37 +0530 Subject: [PATCH 19/19] course details changes done --- .../assets/js/controllers/callTrackingCtrl.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index dd4be43c..290a80d4 100755 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -456,9 +456,11 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", $rootScope.loadFollowupDetails($scope.nextTrack.TrackingID); } - /* else{ - $rootScope.loadFollowupDetails($scope.ListOfTracks[0].TrackingID); - }*/ + else{ + swal("EMPTY!", "This is an last tracking details.so please go previous", "info"); + + + } } @@ -618,10 +620,11 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", $rootScope.loadFollowupDetails($scope.prevTrack.TrackingID); } - /* else{ - console.log($scope.ListOfTracksForPre.length); - $rootScope.loadFollowupDetails($scope.ListOfTracksForPre[$scope.ListOfTracksForPre.length-1].TrackingID); - }*/ + else{ + swal("EMPTY!", "This is an last tracking details.so please go next", "info"); + + + } }