From 067b23a21b0af333422a23860d755292cf592c0d Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 24 Sep 2018 11:58:47 +0530 Subject: [PATCH 1/2] new registration --- Apollo/api/application/controllers/Report.php | 2 +- .../api/application/models/Reports_model.php | 29 +++++++++-- .../js/controllers/newreg_reportCtrl.js | 18 +++++-- Apollo/assets/views/newreg_report.html | 49 ++++++++++++++----- 4 files changed, 76 insertions(+), 22 deletions(-) diff --git a/Apollo/api/application/controllers/Report.php b/Apollo/api/application/controllers/Report.php index 57f79598..a297650c 100755 --- a/Apollo/api/application/controllers/Report.php +++ b/Apollo/api/application/controllers/Report.php @@ -446,7 +446,7 @@ class Report extends REST_Controller { $det['from'] = $this->post('from'); $det['to'] = $this->post('to'); $det['university'] = $this->post('university'); - // print_r($det); + // print_r($det); $newlist = $this->report_model->GetNewRegList($det); diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 0dba6d07..7f2a24e3 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -980,23 +980,44 @@ from T_Lead_Tracking_Followup as ltf $fromd= date("Y-m-d",strtotime($fdate)); $tod=date("Y-m-d",strtotime($tdate)); $university = $det['university']; + $regconst='New Registration'; // echo 'f'.$fromd.'t'.$tod; // die(); -$subQuery='SELECT T_StudentDetails.StudentID,DOJ,BatchName,CourseName ,T_Student_CourseDetails.UniversityID, T_Student_CourseDetails.CourseID, Firstname,T_StudentDetails. MobileNumber, Fathername, UniversityName,CourseName FROM T_Student_CourseDetails +$subQuery="SELECT T_StudentDetails.StudentID,T_Student_CourseDetails.DOJ,BatchName,CourseName ,T_Student_CourseDetails.UniversityID, T_Student_CourseDetails.CourseID, T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails. MobileNumber, T_StudentDetails.Fathername, UniversityName,CourseName,ReferredBy,ReferersMobileNumber,T_StaffDetails.Firstname as Fname,T_StaffDetails.Lastname as Lname FROM T_Student_CourseDetails JOIN T_StudentDetails ON T_StudentDetails.StudentID=T_Student_CourseDetails.StudentID JOIN T_UniversityMaster ON T_UniversityMaster.UniversityID=T_Student_CourseDetails.UniversityID JOIN T_CourseMaster ON T_CourseMaster.CourseID=T_Student_CourseDetails.CourseID left JOIN T_Registration_Details ON T_Registration_Details.CourseID = T_Student_CourseDetails.CourseID and T_Registration_Details.StudentID=T_Student_CourseDetails.StudentID left JOIN T_BatchMaster ON T_BatchMaster.BatchCode = T_Registration_Details.BatchCode -WHERE T_Registration_Details.RegistrationType = ? and str_to_date(DOJ,?)>=? and str_to_date(DOJ,?)<=? and T_Registration_Details.RegistrationMode=? and T_Student_CourseDetails.UniversityID=? group by T_Registration_Details.StudentID'; +left JOIN T_StaffDetails ON T_StaffDetails.StaffID = T_StudentDetails.AdmittedBy +WHERE T_Registration_Details.RegistrationType = '".$regconst."' and T_Registration_Details.RegistrationMode='".'1'."'"; -$query = $this->db->query($subQuery,array(NEWREGISTRATION_CONST,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1',$university)); + if ($fromd != ''){ + // $fromd= date("Y-m-d",strtotime($from)); + //and str_to_date(DOJ,?)>=? + + $subQuery.=" and str_to_date(T_Student_CourseDetails.DOJ,'%d-%m-%Y')>='".$fromd."'"; + + } + if ($tod != ''){ + // $tod=date("Y-m-d",strtotime($to)); + + $subQuery.="and str_to_date(T_Student_CourseDetails.DOJ,'%d-%m-%Y')<='".$tod."'"; + + } + + if($university !='') + { + $subQuery.="and T_Student_CourseDetails.UniversityID='".$university."'"; + } + +$query = $this->db->query($subQuery,array()); $searchDetails =$query->result(); -//print_r( $this->db->last_query()); +//sprint_r( $this->db->last_query()); //die(); //print_r($searchDetails);die(); diff --git a/Apollo/assets/js/controllers/newreg_reportCtrl.js b/Apollo/assets/js/controllers/newreg_reportCtrl.js index 471b1f27..eededf30 100644 --- a/Apollo/assets/js/controllers/newreg_reportCtrl.js +++ b/Apollo/assets/js/controllers/newreg_reportCtrl.js @@ -19,7 +19,7 @@ app.controller('newreg_reportCtrl', ["$scope","$rootScope","toaster", "$filter", var localDetails = JSON.parse(localStorage.getItem('localObj')); //var localDetails = ipCookie('cookiechk'); - console.log(localDetails); + // console.log(localDetails); // $scope.initHead = function() { @@ -91,12 +91,20 @@ $scope.tod=''; { // alert('in') - //console.log(form.$dirty); - var from = $scope.filters.from_date; + // console.log(myModel); + var from = $scope.filters.from_date; var to = $scope.filters.to_date; + if(myModel != undefined) + { + var university = myModel.myUnivSearch ; // console.log(from) + } + else + { + var university = ''; + } @@ -156,6 +164,8 @@ $scope.tod = to_dt; $scope.newreglist = response.data.details; $scope.isShow=true; $scope.isLoaderShow=false; + for(var i=0;i<$scope.newreglist.length;i++) + $scope.newreglist[i].SL_NO = i+1; } @@ -198,7 +208,7 @@ $scope.tod = to_dt; }, }; - console.log(mystyle); + // console.log(mystyle); diff --git a/Apollo/assets/views/newreg_report.html b/Apollo/assets/views/newreg_report.html index 6dc076f9..83d3082c 100644 --- a/Apollo/assets/views/newreg_report.html +++ b/Apollo/assets/views/newreg_report.html @@ -112,7 +112,7 @@