diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index ce09afb1..c9edcbd4 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -348,6 +348,9 @@ $route['report_examfee'] = 'Report/examfee'; $route['report_balfee'] = 'Report/balfee'; $route['report_lead'] = 'Report/lead'; $route['insertUniversityfile'] = 'UniversityFile_Controller/insertUniversityfile'; +//Data correction +$route['Stud_Merge'] = 'DataCorrection_Controller/StudMerge'; +$route['get_Mob'] = 'DataCorrection_Controller/getMob'; //Application Form Details $route['getApplicationFromDetails'] = 'StatusUpdation_Controller/getApplicationFromDetails'; diff --git a/Apollo/api/application/controllers/DataCorrection_Controller.php b/Apollo/api/application/controllers/DataCorrection_Controller.php index 70660b6f..0bfe5b5e 100644 --- a/Apollo/api/application/controllers/DataCorrection_Controller.php +++ b/Apollo/api/application/controllers/DataCorrection_Controller.php @@ -35,9 +35,32 @@ class DataCorrection_Controller extends REST_Controller { public function StudMerge_post() { - $toDelete = $this->post('toDelete'); - $toMerge = $this->post('toMerge'); - $getStatus = $this->Data_correction->Student_Merge($toDelete,$toMerge); + $name = $this->post('name'); + $getStatus = $this->Data_Correction->Student_Merge($name); + //print_r($getStatus); + if ($getStatus) + { + $getStatus['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getStatus, 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 + } + + + } + + public function getMob_post() + { + $deleteNo = $this->post('deleteNo'); + $mergeNo = $this->post('mergeNo'); + $getStatus = $this->Data_Correction->getMobile($deleteNo,$mergeNo); //print_r($getStatus); if ($getStatus) { diff --git a/Apollo/api/application/models/Data_correction.php b/Apollo/api/application/models/Data_correction.php index f84ea742..4f912ab3 100644 --- a/Apollo/api/application/models/Data_correction.php +++ b/Apollo/api/application/models/Data_correction.php @@ -7,9 +7,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); class Data_Correction extends CI_Model { - Public function Student_Merge($toDelete=null,$toMerge=null) + Public function Student_Merge($name=null) { - $sql = ""; + $sql = "select scd.StudentID as Student_id,scd.CourseID as cid,Firstname as Student_name,std.MobileNumber as Phone_number,CourseName as Course_name,UniversityName as University +from T_Student_CourseDetails as scd +left join T_StudentDetails as std on std.StudentID = scd.StudentID and std.IsActive = 1 +left join T_CourseMaster AS cm ON cm.CourseID = scd.CourseID +left join T_UniversityMaster as univ on univ.UniversityID = scd.UniversityID +where Firstname like '".$name."' +group by Student_id,cid"; $b=$this->db->query($sql); $batch = $b->result(); if (count($batch) > 0) { @@ -21,6 +27,26 @@ class Data_Correction extends CI_Model } return $results; } + + Public function getMobile($deleteNo=null,$mergeNo=null) + { + $sql = "call SP_MERGE_STUDENT_DATA('".$deleteNo."','".$mergeNo."',@countRow); + "; + $a=$this->db->query($sql); + $sqlOut = " select @countRow as counts;"; + $b=$this->db->query($sqlOut); + $batch = $b->result(); + //echo $batch[0]->counts; + if ($batch[0]->counts > 0) { + $results['MergeStatus'] = true; + $results['after_Merge'] = $batch; + $results['message'] = 'Student details successfully merged'; + } else { + $results['MergeStatus'] = false; + $results['message'] = 'Can not Merge'; + } + return $results; + } diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index 85282b7d..1d1a7aab 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -157,7 +157,8 @@ }, "entry": { "MAIN": "My Details", - "coursecorrection": "Course Details" + "coursecorrection": "Course Details", + "stud_merge": "Student Merge" }, "announcement": { "MAIN": "ANNOUNCEMENT", diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index 15774703..ee716a2d 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -236,7 +236,10 @@ app.constant('JS_REQUIRES', { 'report_examfeeCtrl':'assets/js/controllers/report_examfeeCtrl.js', 'report_balfeeCtrl':'assets/js/controllers/report_balfeeCtrl.js', 'report_leadCtrl':'assets/js/controllers/report_leadCtrl.js', - + + //Data Correction + 'studentMergeCtrl':'assets/js/controllers/studentMergeCtrl.js', + /** * univesity sutdent fee compare details */ diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index 5e5edef4..c878eaf4 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -807,6 +807,15 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com label: 'coursecorrection' }, + }).state('app.entry.stud_merge', { + url: '/studentMergeCtrl', + templateUrl: "assets/views/StudentMerge.html", + resolve: loadSequence('studentMergeCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'Student Merge', + ncyBreadcrumb: { + label: 'Student Merge' + }, + }); // $locationProvider.html5Mode(true); diff --git a/Apollo/assets/js/controllers/studentMergeCtrl.js b/Apollo/assets/js/controllers/studentMergeCtrl.js new file mode 100644 index 00000000..5467a6e0 --- /dev/null +++ b/Apollo/assets/js/controllers/studentMergeCtrl.js @@ -0,0 +1,225 @@ +'use strict'; +/*** controller***/ +app.controller('studentMergeCtrl', ["$scope", "$filter","$rootScope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService","$modal", + function ($scope, $filter,$rootScope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService,$modal,$log) { + + $scope.name = { + "studentName": "", + + }; + + $scope.onSubmit = function (form) { + var firstError = null; + if (form.$invalid) { + var field = null, firstError = null; + $scope.show = true; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$studentName; + } + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[batch=' + firstError + ']').focus(); + }else { + //alert($scope.batch.name); + $scope.stud_merge = ''; + $scope.message = ''; + console.log($scope.stud_merge); + var response_data = { + method: 'POST', + url: apiPoint.url + 'Stud_Merge/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + name: $scope.name.studentName + + } + + }; + + $http(response_data).then(function (response) { + if (response.data.MergeStatus == true) { + $scope.stud_merge = response.data.Stud_Merge; + } else { + $scope.message = response.data.message; + } + + }); + + } + } + + + //merge student + $scope.selectedStudentsID = []; + $scope.number1 = ''; + $scope.number2 = ''; + $scope.getMobile = ''; + $scope.toDelete = ''; + $scope.toMerge = ''; + // $rootScope.num1 = ''; + // $rootScope.num2 = ''; + $scope.isCheckAll = function(e){ + var val = (e.target.checked ? true : false); + if(val) + { + // $scope.disable = false; + var len = $scope.Stud_Merge.length; + var i = 0; + for(i=0;i +
+
+ +
+
+ + Select Mobile number to merge + + + +
+ + +   {{num1}} to merge with {{num2}} + +
+
+ +   {{num2}} to merge with {{num1}} +
+ + + + +
+
+ + + +
+
+
+
+
+
+ \ No newline at end of file diff --git a/Apollo/assets/views/StudentMerge.html b/Apollo/assets/views/StudentMerge.html new file mode 100644 index 00000000..4dc3ea98 --- /dev/null +++ b/Apollo/assets/views/StudentMerge.html @@ -0,0 +1,109 @@ +
+
+
+

Student Merge

+
+ +
+
+ + + + +
+
+
+
+
+
+ +
+ +
+ + + +
+ + +
+
+ + + +
+
+
+
+
+
+ +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Student NameMobile NumberCourse NameUniversityAction
{{p.Student_name}}{{p.Phone_number}}{{p.Course_name}}{{p.University}}
+

{{message}}

+ +
+ + + +
+
\ No newline at end of file diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index a05d13dc..95d799f6 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -555,6 +555,11 @@ COURSECORRECTION +
  • + + Student Merge + +