diff --git a/Apollo/api/application/controllers/Call_Tracking_Controller.php b/Apollo/api/application/controllers/Call_Tracking_Controller.php index f90f7c99..bb94f8bd 100755 --- a/Apollo/api/application/controllers/Call_Tracking_Controller.php +++ b/Apollo/api/application/controllers/Call_Tracking_Controller.php @@ -183,6 +183,9 @@ class Call_Tracking_Controller extends REST_Controller { $update_followup_details['AssignedTo'] = $this->post('assignedTo'); $update_followup_details['UpdatedOn'] = $now->format('Y-m-d H:i:s'); $update_followup_details['CreatedBranch'] = $this->post('branchId'); + $update_followup_details['Address'] = $this->post('address'); + $update_followup_details['AlternateMobile'] = $this->post('alternateMobile'); + $update_followup_details['ReferredBy'] = $this->post('referredBy'); // store followup details for insert $followup_details['TrackingID'] = $this->post('trackingID'); $followup_details['FollowupOn'] = $this->post('date'); diff --git a/Apollo/api/application/controllers/Course_Controller.php b/Apollo/api/application/controllers/Course_Controller.php index 9187a8d1..fc35a4d3 100755 --- a/Apollo/api/application/controllers/Course_Controller.php +++ b/Apollo/api/application/controllers/Course_Controller.php @@ -137,6 +137,7 @@ class Course_Controller extends REST_Controller { $details['CourseID'] = $this->post('courseID'); $details['CourseCode'] = $this->post('courseCode'); $details['CourseName'] = $this->post('courseName'); + $details['UniversityID'] = $this->post('universityID'); $details['Specilization1'] = $this->post('specilization1'); $details['Specilization2'] = $this->post('specilization2'); $details['IsActive'] = $this->post('status'); diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 57424352..93cb0630 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -557,7 +557,7 @@ class Calltracking_model extends CI_Model { $upateStatus = $this->db->update(LEAD_TRACKING, $updateDetails); $result['followupStatus'] = true; $result['trackingID'] = $updateDetails['TrackingID']; - $result['message'] = "Successfully followup details added"; + $result['message'] = "Successfully followup details updated"; } else { $result['followupStatus'] = false; $result['message'] = "Something went wrong.please try again"; @@ -586,7 +586,7 @@ class Calltracking_model extends CI_Model { public function getLoadFollowupDetails($trackingID) { - $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.CreatedBranch,BR.BranchName,LT.StatusCode,LT.University,LT.Course,LT.AlternateMobile,LT.Address,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,AV.ActivityID,AV.ActivityName'); + $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.CreatedBranch,BR.BranchName,LT.StatusCode,LT.University,LT.Course,LT.AlternateMobile,LT.Address,LT.ReferredBy,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,AV.ActivityID,AV.ActivityName'); $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); $this->db->join(LOGIN.' as LO', 'LO.ID = LT.AssignedTo'); @@ -635,6 +635,7 @@ class Calltracking_model extends CI_Model { $tracking_array["ActivityName"]=$row->ActivityName; $tracking_array["AlternateMobile"]=$row->AlternateMobile; $tracking_array["Address"]=$row->Address; + $tracking_array["ReferredBy"]=$row->ReferredBy; $tracking_array["followupDetails"]=$this->getTrackingFollowup($row->TrackingID); $tracking_array["collectTrackedID"]=$this->getStudentTrackedID($row->MobileNumber,$trackingID['CreatedBranch'],$trackingID['requestedDept'],$trackingID['UpdatedBy']); diff --git a/Apollo/api/application/models/Course_model.php b/Apollo/api/application/models/Course_model.php index 77535eaa..3b91345a 100755 --- a/Apollo/api/application/models/Course_model.php +++ b/Apollo/api/application/models/Course_model.php @@ -17,12 +17,12 @@ class Course_model extends CI_Model { public function addCourse($arrayDetails=null,$jsonSemFeesData=null,$subjectDetails=null) { - $this->db->select('CourseCode'); $this->db->where('CourseCode', $arrayDetails['CourseCode']); + $this->db->where('UniversityID', $arrayDetails['UniversityID']); if($this->db->get(COURSE)->first_row()){ $result['courseStatus'] = false; - $result['message'] = "This course id is already exist!"; + $result['message'] = "This course id is already exist in same university"; } else { $this->db->insert(COURSE, $arrayDetails); if ($this->db->affected_rows() == '1') { @@ -132,10 +132,11 @@ class Course_model extends CI_Model { { $this->db->select('CourseCode'); $this->db->where('CourseCode', $arrayDetails['CourseCode']); + $this->db->where('UniversityID', $arrayDetails['UniversityID']); $this->db->where('CourseID !=', $arrayDetails['CourseID']); if($this->db->get(COURSE)->first_row()){ $result['courseStatus'] = false; - $result['message'] = "This course id is already exist!"; + $result['message'] = "This course id is already exist in same university"; } else{ $this->db->where('CourseID',$arrayDetails['CourseID']); diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index da6e87fd..b5164094 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -1152,10 +1152,12 @@ class Fees_status_model extends CI_Model // this is for expense come entry + $now1 = new DateTime(); + $now1->setTimezone(new DateTimezone('Asia/Kolkata')); $expenseArray['Date'] = $data['BillDate']; $expenseArray['CreatedBy'] = $data['CreatedBy']; - $expenseArray['CreatedOn'] = $data['CreatedOn']; + $expenseArray['CreatedOn'] = $now1->format('Y-m-d H:i:s');; $expenseArray['Description'] = $data['InternalComments']; $expenseArray['Amount'] = $data['BillAmount']; $expenseArray['Status'] = 'Approved'; diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index 7db2fe5b..66b9bfae 100755 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -1427,7 +1427,26 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", * update the follow up details * created by kms * */ - $rootScope.updateFollowup = function (followupDetails,myModel1, loading) { + $rootScope.updateFollowup = function (form,followupDetails,myModel1, 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{ + if(isNaN(myModel1.date)){ $scope.nextFollowupDate = myModel1.date; @@ -1479,6 +1498,9 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", comments: myModel1.comments, updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, branchId: $scope.updateBranchID, + address: myModel1.Address, + alternateMobile: myModel1.AlternateMobile, + referredBy: myModel1.ReferredBy, } }; $http(update).then(function (response) { @@ -1493,6 +1515,7 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", } }); } + } }; $rootScope.loadFollowupDetails = function (trackID) { @@ -1515,8 +1538,13 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", if (response.data.status==200 && response.data.followupStatus) { $rootScope.followupDetails=response.data.trackingDetails[0]; $rootScope.myModel1.status=$rootScope.followupDetails.StatusCode; + if($rootScope.followupDetails.followupDetails[0].FollowupOn.length==10){ + $rootScope.currentDate1 = new Date($rootScope.followupDetails.followupDetails[0].FollowupOn.substring(6,10)+'-'+$rootScope.followupDetails.followupDetails[0].FollowupOn.substring(3,5)+'-'+$rootScope.followupDetails.followupDetails[0].FollowupOn.substring(0,2)); + } + else{ + $rootScope.currentDate1=new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2); - $rootScope.currentDate1=new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2); + } $rootScope.myModel1.date=$rootScope.followupDetails.followupDetails[0].FollowupOn; // get 30 plus date for follwup details @@ -1527,6 +1555,9 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", $rootScope.trackingStatus=response.data.statusDetails; $rootScope.myModel1.branch=$rootScope.followupDetails.CreatedBranch; $rootScope.myModel1.assignStaff=$rootScope.followupDetails.AssignedTo; + $rootScope.myModel1.AlternateMobile=$rootScope.followupDetails.AlternateMobile; + $rootScope.myModel1.Address=$rootScope.followupDetails.Address; + $rootScope.myModel1.ReferredBy=$rootScope.followupDetails.ReferredBy; $rootScope.staffArray=''; $rootScope.staffDetails=response.data.staffDetails; if($scope.userType =='R004'){ diff --git a/Apollo/assets/views/callTrackingDetails.html b/Apollo/assets/views/callTrackingDetails.html index 4ddea63d..7265d3ca 100755 --- a/Apollo/assets/views/callTrackingDetails.html +++ b/Apollo/assets/views/callTrackingDetails.html @@ -349,7 +349,7 @@ max-date="futureDate" close-text="Close" required="required" ng-readonly="true"/> Followup Date is required. + ng-if="Form.date.$dirty && Form.date.$error.required">Followup date is required. @@ -548,7 +548,7 @@ ng-model="myModel.referedBy" ng-pattern="/^[a-zA-Z.\s]*$/"/> Invalid refered by name + ng-if="Form.refered.$dirty && Form.refered.$error.pattern">Invalid referred by name
diff --git a/Apollo/assets/views/callTrackingFollowup.html b/Apollo/assets/views/callTrackingFollowup.html index f086caca..1176f047 100755 --- a/Apollo/assets/views/callTrackingFollowup.html +++ b/Apollo/assets/views/callTrackingFollowup.html @@ -33,13 +33,13 @@
- - - @@ -51,6 +51,7 @@
+
@@ -62,7 +63,7 @@ - + @@ -71,7 +72,7 @@ @@ -92,16 +93,43 @@ - + + + + + + + + +
Contact Information
Student Name - {{followupDetails.LeadName}} + {{followupDetails.LeadName}}
Alternate Mobile - {{followupDetails.AlternateMobile}} + + + Enter a valid phone number + +
Address - {{followupDetails.Address}}
Referred By + + + + Invalid referred by name +
@@ -122,13 +150,14 @@ Followup On - +
- - Date is required. + Followup date is required.
@@ -154,7 +183,7 @@ Assigned To - @@ -181,7 +210,7 @@ Assigned To - @@ -312,11 +341,11 @@
- +
- @@ -331,7 +360,7 @@
-

Recent Activities

+

Comments History

@@ -357,6 +386,7 @@
+