diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 190c084f..a47d030f 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -216,6 +216,8 @@ $route['update_DayBookDetails'] = 'DayBook_Controller/update_DayBookDetailsData' $route['Getnotificcations'] = 'Student_Controller/Getnotificcations'; +$route['GetPhoneHistory'] = 'Student_Controller/GetPhoneHistory'; + $route['AllgetUniversity'] = 'Report/getAllUniversity'; diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index 36a3839c..0ccb8af5 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -385,6 +385,10 @@ class Student_Controller extends REST_Controller { } public function updateStudentExistDetail_post() { + + // $mobile = $this->post('OldPhone'); + $olddata= $this->post('OldDetails'); + $data = $this->post('data'); $updatedBy = $this->post('updatedBy'); $updateStudent = $data['StudentID']; @@ -426,6 +430,216 @@ class Student_Controller extends REST_Controller { $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; $studentUpdate = $this->student_model->update_student($req, $updateStudent, $imagename, $imageSource, $size); // Check if the employee exist + + // if($mobile!= $req['MobileNumber']) + // { + + // $mobileHistory['StudentID'] = $data['StudentID']; + // $mobileHistory['Previous_No'] = $mobile; + // $mobileHistory['Current_No'] = $req['MobileNumber']; + // $mobileHistory['UpdateBy'] = $req['UpdatedBy']; + // $date = date('Y-m-d H:i:s'); + // $mobileHistory['UpdatedOn'] = $date; + // $mobileHistory['branch']=$data['BranchCode']; + + // $updatemobilehistory = $this->student_model->UpdateMobileHistory($mobileHistory); + + + // } + + $changed = 0; + + if($olddata['AadharNumber'] != $req['AadharNumber']) + { + $mobileHistory['AadharNumber'] = $olddata['AadharNumber']; + $changed =1; + } + + if($olddata['AdmittedBy'] != $req['AdmittedBy']) + { + $mobileHistory['AdmittedBy'] = $olddata['AdmittedBy']; + $changed =1; + } + + if($olddata['AlternateNumber'] != $req['AlternateNumber']) + { + $mobileHistory['AlternateNumber'] = $olddata['AlternateNumber']; + $changed =1; + } + + if($olddata['Caste'] != $req['Caste']) + { + $mobileHistory['Caste'] = $olddata['Caste']; + $changed =1; + } + + if($olddata['Category'] != $req['Category']) + { + $mobileHistory['Category'] = $olddata['Category']; + $changed =1; + } + + if($olddata['Comments'] != $req['Comments']) + { + $mobileHistory['Comments'] = $olddata['Comments']; + $changed =1; + } + + if($olddata['Companyname'] != $req['Companyname']) + { + $mobileHistory['Companyname'] = $olddata['Companyname']; + $changed =1; + } + + if($olddata['DOB'] != $req['DOB']) + { + $mobileHistory['DOB'] = $olddata['DOB']; + $changed =1; + } + + if($olddata['Designation'] != $req['Designation']) + { + $mobileHistory['Designation'] = $olddata['Designation']; + $changed =1; + } + + if($olddata['EmailID'] != $req['EmailID']) + { + $mobileHistory['EmailID'] = $olddata['EmailID']; + $changed =1; + } + + if($olddata['Fathername'] != $req['Fathername']) + { + $mobileHistory['Fathername'] = $olddata['Fathername']; + $changed =1; + } + + if($olddata['Firstname'] != $req['Firstname']) + { + $mobileHistory['Firstname'] = $olddata['Firstname']; + $changed =1; + } + + if($olddata['Gender'] != $req['Gender']) + { + $mobileHistory['Gender'] = $olddata['Gender']; + $changed =1; + } + + if($olddata['Lastname'] != $req['Lastname']) + { + $mobileHistory['Lastname'] = $olddata['Lastname']; + $changed =1; + } + + if($olddata['MobileNumber'] != $req['MobileNumber']) + { + $mobileHistory['Previous_No'] = $olddata['MobileNumber']; + $changed =1; + } + + if($olddata['MotherName'] != $req['MotherName']) + { + $mobileHistory['MotherName'] = $olddata['MotherName']; + $changed =1; + } + + + if($olddata['Nationality'] != $req['Nationality']) + { + $mobileHistory['Nationality'] = $olddata['Nationality']; + $changed =1; + } + + if($olddata['Occupation'] != $req['Occupation']) + { + $mobileHistory['Occupation'] = $olddata['Occupation']; + $changed =1; + } + + if($olddata['OtherID'] != $req['OtherID']) + { + $mobileHistory['OtherID'] = $olddata['OtherID']; + $changed =1; + } + + if($olddata['OtherIDDetails'] != $req['OtherIDDetails']) + { + $mobileHistory['OtherIDDetails'] = $olddata['OtherIDDetails']; + $changed =1; + } + + + if($olddata['PermanentAddress'] != $req['PermanentAddress']) + { + $mobileHistory['PermanentAddress'] = $olddata['PermanentAddress']; + $changed =1; + } + + + if($olddata['PreQualification'] != $req['PreQualification']) + { + $mobileHistory['PreQualification'] = $olddata['PreQualification']; + $changed =1; + } + + + if($olddata['PresentAddress'] != $req['PresentAddress']) + { + $mobileHistory['PresentAddress'] = $olddata['PresentAddress']; + $changed =1; + } + + + if($olddata['Qualification'] != $req['Qualification']) + { + $mobileHistory['Qualification'] = $olddata['Qualification']; + $changed =1; + } + + + + if($olddata['ReferersMobileNumber'] != $req['ReferersMobileNumber']) + { + $mobileHistory['ReferersMobileNumber'] = $olddata['ReferersMobileNumber']; + $changed =1; + } + + + if($olddata['ReferredBy'] != $req['ReferredBy']) + { + $mobileHistory['ReferredBy'] = $olddata['ReferredBy']; + $changed =1; + } + + + if($olddata['Religion'] != $req['Religion']) + { + $mobileHistory['Religion'] = $olddata['Religion']; + $changed =1; + } + + + if($changed == 1) + { + $mobileHistory['StudentID'] = $data['StudentID']; + + $mobileHistory['Current_No'] = $req['MobileNumber']; + $mobileHistory['UpdateBy'] = $req['UpdatedBy']; + $date = date('Y-m-d H:i:s'); + $mobileHistory['UpdatedOn'] = $date; + $mobileHistory['branch']=$data['BranchCode']; + + $updatemobilehistory = $this->student_model->UpdateMobileHistory($mobileHistory); + } + + + + + + + if ($studentUpdate) { $studentUpdate['status'] = REST_Controller::HTTP_OK; // Set the response and exit @@ -716,4 +930,26 @@ class Student_Controller extends REST_Controller { } + + public function GetPhoneHistory_post() + { + $get['studentID'] = $this->post('StudentID'); + $get['loginBranch'] = $this->post('loginBranch'); + + $phonenumberdetails = $this->student_model->GetPhoneDetails($get); + + if ($phonenumberdetails) + { + $phonenumberdetails['status'] = REST_Controller::HTTP_OK; + $this->response($phonenumberdetails, REST_Controller::HTTP_OK); + } + else { + + $this->response(['message' => 'No data found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); + } + + + + } + } \ 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 7e01a3e0..45eeb16e 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -1844,4 +1844,56 @@ class Student_model extends CI_Model { } + + + public function UpdateMobileHistory($mobileHistory) + { + + $this->db->insert('T_Student_PhoneHistory',$mobileHistory); + $r = $this->db->affected_rows(); + if(count($r)>0) + { + return $r; + } + else + { + return false; + } + + } + + + public function GetPhoneDetails($get) + { + + $this->db->select('Current_No,Previous_No,DATE_FORMAT(UpdatedOn,"%d-%m-%Y") as Date'); + $this->db->from('T_Student_PhoneHistory'); + $this->db->where('StudentID',$get['studentID']); + $this->db->where('branch',$get['loginBranch']); + $this->db->where('Previous_No !=',null); + $this->db->group_by('Previous_No'); + + $studentMobile = $this->db->get(); + + + if($studentMobile ->result()) + { + + $result_array['stuidStatus'] = true; + $result_array['Mobiledetails'] = $studentMobile->result(); + } + + else + { + $result_array['stuidStatus'] = false; + $result_array['Mobiledetails'] = 'No Records Found'; + } + + // print_r($this->db->last_query());die(); + + return $result_array; + + + } + } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/feesStatusCtrl.js b/Apollo/assets/js/controllers/feesStatusCtrl.js index 6f411b6a..255998ac 100755 --- a/Apollo/assets/js/controllers/feesStatusCtrl.js +++ b/Apollo/assets/js/controllers/feesStatusCtrl.js @@ -302,7 +302,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n * */ $scope.changeSessions = function (details,type) { - //console.log(details.Sem_Year);return false; + // console.log(details.Sem_Year);return false; // console.log($scope.setfeedetails);return false; @@ -318,7 +318,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n if(role=='R002' || role == 'R005') { - //console.log('if') + console.log('if') $scope.readonlycheck =true; } @@ -326,7 +326,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n else { - //console.log('ses'); + console.log('ses'); $scope.readonlycheck =false; } } diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 5afdbc5c..ba096f55 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -53,7 +53,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // load when html page load $scope.init = function () { - + // alert('dsc'); var logcheck = JSON.parse(localStorage.getItem('localObj')); const LOCALTYPE = logcheck.localType; @@ -752,16 +752,149 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", //======================================================================> + +$scope.CopyModel={ + +'AadharNumber':'', +'AdmittedBy':'', +'AlternateNumber':'', +'BranchCode': '', +'Caste':'', +'Category':'', +'Comments': '', +'Companyname':'', +'CourseCode': '', +'CourseID':'', +'CourseName': '', +'CreatedBy': '', +'CreatedOn':'', +'DOB': '', +'DeactiveComments':'', +'Designation':'', +'EmailID':'', +'Fathername':'', +'Firstname':'', +'Gender': '', +'IsActive':'', +'Lastname': '', +'MobileNumber':'', +'MotherName': '', +'Nationality':'', +'Occupation':'', +'OtherID':'', +'OtherIDDetails':'', +'PermanentAddress':'', +'PreQualification':'', +'PresentAddress':'', +'ProfilePicPath':'', +'Qualification':'', +'ReferersMobileNumber':'', +'ReferredBy':'', +'Religion':'', +'StudentID':'', +'Student_Course_id':'', +'UniversityID':'', +'UniversityName':'', + +}; + + + + $scope.editId = -1; $scope.editCourseId = -1; - $scope.setEditId = function (unique_id, id) { + $scope.OldPhone=''; + $scope.setEditId = function (unique_id, id,k) { // alert() + + + $scope.CopyModel.Fathername=k.Fathername; + $scope.CopyModel.AadharNumber=k.AadharNumber; + $scope.CopyModel.AdmittedBy=k.AdmittedBy; + $scope.CopyModel.AlternateNumber = k.AlternateNumber; + $scope.CopyModel.Caste = k.Caste; + $scope.CopyModel.Category = k.Category; + $scope.CopyModel.Comments=k.Comments; + $scope.CopyModel.Companyname=k.Companyname; + $scope.CopyModel.CourseCode= k.CourseCode; + $scope.CopyModel.CourseID=k.CourseID; + $scope.CopyModel.CourseName=k.CourseName; + $scope.CopyModel.DOB = k.DOB; + $scope.CopyModel.DeactiveComments = k.DeactiveComments; + $scope.CopyModel.EmailID=k.EmailID; + $scope.CopyModel.Firstname=k.Firstname; + $scope.CopyModel.Gender=k.Gender; + $scope.CopyModel.IsActive=k.IsActive; + $scope.CopyModel.Lastname=k.Lastname; + $scope.CopyModel.MobileNumber=k.MobileNumber; + $scope.CopyModel.MotherName=k.MotherName; + $scope.CopyModel.Nationality=k.Nationality; + $scope.CopyModel.Occupation=k.Occupation; + $scope.CopyModel.OtherID=k.OtherID; + $scope.CopyModel.OtherIDDetails=k.OtherIDDetails; + $scope.CopyModel.PermanentAddress=k.PermanentAddress; + $scope.CopyModel.PreQualification=k.PreQualification; + $scope.CopyModel.PresentAddress=k.PresentAddress; + $scope.CopyModel.ReferersMobileNumber=k.ReferersMobileNumber; + $scope.CopyModel.ReferredBy=k.ReferredBy; + $scope.CopyModel.Religion=k.Religion; + $scope.CopyModel.StudentID=k.StudentID; + + $scope.editId = unique_id; $scope.editCourseId = -1; $scope.studentViewPage = -1; + $scope.OldPhone=mobile; + + $scope.OldPhone=k.MobileNumber; + + + } +$scope.PreviousPhoneDetails =''; +$scope.Changecheck = false; +$scope.getPhoneNoHistoy = function(studentId) +{ + + // alert('fn') + var getphonehistory = { + method: 'POST', + url: apiPoint.url + 'GetPhoneHistory/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + + StudentID:studentId, + loginBranch: localDetails.localBranchID, + createdBy: localDetails.localUserID, + } + }; + + + $http(getphonehistory).then(function (response) + { + + //console.log(response.data) + if(response.data.stuidStatus == true) + { + $scope.PreviousPhoneDetails= response.data.Mobiledetails; + $scope.Changecheck= true; + } + else + { + $scope.PreviousPhoneDetails= ''; + $scope.Changecheck= false; + } + + console.log($scope.PreviousPhoneDetails) + }); +} + + + $scope.setEditCourseId = function (unique_id,id) { $scope.list = false; @@ -1567,6 +1700,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // update student details $scope.updateStuDetails = function (form, p, hidedob) { + + // console.log($scope.OldPhone);return false; var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -1602,6 +1737,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", data: { data: p, updatedBy: localDetails.localUserID, + OldPhone: $scope.OldPhone, + OldDetails:$scope.CopyModel } }; $http(req).then(function (response) { @@ -1668,6 +1805,9 @@ $scope.allcourselist =''; // load when html page load $scope.init = function () { $scope.che='123'; + +//console.log($scope.che); + $scope.localUserType = localDetails.localType; if (localDetail != null) { if (localDetails.localType === 'R004') { @@ -1961,19 +2101,157 @@ $scope.allcourselist =''; }); } + + +$scope.CopyModel={ + +'AadharNumber':'', +'AdmittedBy':'', +'AlternateNumber':'', +'BranchCode': '', +'Caste':'', +'Category':'', +'Comments': '', +'Companyname':'', +'CourseCode': '', +'CourseID':'', +'CourseName': '', +'CreatedBy': '', +'CreatedOn':'', +'DOB': '', +'DeactiveComments':'', +'Designation':'', +'EmailID':'', +'Fathername':'', +'Firstname':'', +'Gender': '', +'IsActive':'', +'Lastname': '', +'MobileNumber':'', +'MotherName': '', +'Nationality':'', +'Occupation':'', +'OtherID':'', +'OtherIDDetails':'', +'PermanentAddress':'', +'PreQualification':'', +'PresentAddress':'', +'ProfilePicPath':'', +'Qualification':'', +'ReferersMobileNumber':'', +'ReferredBy':'', +'Religion':'', +'StudentID':'', +'Student_Course_id':'', +'UniversityID':'', +'UniversityName':'', + +}; + + $scope.editId = -1; $scope.editCourseId = -1; $scope.editTrackingId=-1; $scope.msgdetID = -1; - $scope.setEditId = function (uniqe_id ,id) { + $scope.OldPhone=''; + $scope.setEditId = function (uniqe_id ,id,k) { - // alert() + //alert() + //console.log(k); + $scope.CopyModel.Fathername=k.Fathername; + $scope.CopyModel.AadharNumber=k.AadharNumber; + $scope.CopyModel.AdmittedBy=k.AdmittedBy; + $scope.CopyModel.AlternateNumber = k.AlternateNumber; + $scope.CopyModel.Caste = k.Caste; + $scope.CopyModel.Category = k.Category; + $scope.CopyModel.Comments=k.Comments; + $scope.CopyModel.Companyname=k.Companyname; + $scope.CopyModel.CourseCode= k.CourseCode; + $scope.CopyModel.CourseID=k.CourseID; + $scope.CopyModel.CourseName=k.CourseName; + $scope.CopyModel.DOB = k.DOB; + $scope.CopyModel.DeactiveComments = k.DeactiveComments; + $scope.CopyModel.EmailID=k.EmailID; + $scope.CopyModel.Firstname=k.Firstname; + $scope.CopyModel.Gender=k.Gender; + $scope.CopyModel.IsActive=k.IsActive; + $scope.CopyModel.Lastname=k.Lastname; + $scope.CopyModel.MobileNumber=k.MobileNumber; + $scope.CopyModel.MotherName=k.MotherName; + $scope.CopyModel.Nationality=k.Nationality; + $scope.CopyModel.Occupation=k.Occupation; + $scope.CopyModel.OtherID=k.OtherID; + $scope.CopyModel.OtherIDDetails=k.OtherIDDetails; + $scope.CopyModel.PermanentAddress=k.PermanentAddress; + $scope.CopyModel.PreQualification=k.PreQualification; + $scope.CopyModel.PresentAddress=k.PresentAddress; + $scope.CopyModel.ReferersMobileNumber=k.ReferersMobileNumber; + $scope.CopyModel.ReferredBy=k.ReferredBy; + $scope.CopyModel.Religion=k.Religion; + $scope.CopyModel.StudentID=k.StudentID; + + + //console.log($scope.CopyModel) + + // console.log(id) $scope.editId = uniqe_id; $scope.editCourseId = -1; $scope.editTrackingId=-1; $scope.msgdetID = -1; + + $scope.OldPhone=k.MobileNumber; + + + } + + +$scope.PreviousPhoneDetails =''; +$scope.Changecheck = false; +$scope.getPhoneNoHistoy = function(studentId) +{ + + // alert('fn') + var getphonehistory = { + method: 'POST', + url: apiPoint.url + 'GetPhoneHistory/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + + StudentID:studentId, + loginBranch: localDetails.localBranchID, + createdBy: localDetails.localUserID, + } + }; + + + $http(getphonehistory).then(function (response) + { + + //console.log(response.data) + if(response.data.stuidStatus == true) + { + $scope.PreviousPhoneDetails= response.data.Mobiledetails; + $scope.Changecheck= true; + + console.log($scope.PreviousPhoneDetails) + } + else + { + $scope.PreviousPhoneDetails= ''; + $scope.Changecheck= false; + } + + console.log($scope.PreviousPhoneDetails) + }); +} + + + + $scope.setEditCourseId = function (uniqe_id ,id) { //alert('1'); @@ -3324,6 +3602,12 @@ $scope.allcourselist =''; // update student details $scope.updateStuDetails = function (form, p, hidedob) { var firstError = null; + + + // console.log($scope.OldPhone); + + + // console.log($scope.CopyModel);return false; if (form.$invalid) { var field = null, firstError = null; @@ -3360,6 +3644,8 @@ $scope.allcourselist =''; data: { data: p, updatedBy: localDetails.localUserID, + OldPhone: $scope.OldPhone, + OldDetails:$scope.CopyModel } }; $http(req).then(function (response) { @@ -3488,7 +3774,6 @@ app.controller('studentModalDemoCtrl', ["$scope","$rootScope", "$modal", "$log", $scope.open = function (studentDetails) { - // get student view details var getcourse = { method: 'POST', diff --git a/Apollo/assets/views/student/editStudentDetails.html b/Apollo/assets/views/student/editStudentDetails.html index e7e9c957..b98e088b 100755 --- a/Apollo/assets/views/student/editStudentDetails.html +++ b/Apollo/assets/views/student/editStudentDetails.html @@ -453,6 +453,33 @@ +
+ + +
+ +
+ + + + + + + + + + + + + + + + + +
Previous NumberPresent NumberUpdated On
{{ph.Previous_No}}{{ph.Current_No}}{{ph.Date}}
+
+
+
diff --git a/Apollo/assets/views/student/student_details.html b/Apollo/assets/views/student/student_details.html index 43c7bed8..9fda468e 100755 --- a/Apollo/assets/views/student/student_details.html +++ b/Apollo/assets/views/student/student_details.html @@ -243,7 +243,7 @@ - + diff --git a/Apollo/assets/views/student/student_details_SuperAdmin.html b/Apollo/assets/views/student/student_details_SuperAdmin.html index 7c2772fc..ae920ef0 100755 --- a/Apollo/assets/views/student/student_details_SuperAdmin.html +++ b/Apollo/assets/views/student/student_details_SuperAdmin.html @@ -275,7 +275,7 @@ - +