From c5a71bc4f77caa44b200364c7d936291de7af1cd Mon Sep 17 00:00:00 2001 From: Sanjeev Date: Fri, 27 Nov 2020 10:50:31 +0530 Subject: [PATCH] Report Changes : ps --- Apollo/api/application/config/routes.php | 3 + .../controllers/DayBook_Controller.php | 8 +- Apollo/api/application/controllers/Report.php | 112 ++++++++++++-- .../api/application/models/DayBook_model.php | 138 +++++++++-------- .../api/application/models/Reports_model.php | 142 +++++++++++++++--- .../js/controllers/report_app_pendingCtrl.js | 29 +++- .../js/controllers/report_certificateCtrl.js | 11 +- .../controllers/report_markcard_statusCtrl.js | 34 ++++- .../views/report_application_pending.html | 53 ++++++- .../views/report_certificate_status.html | 16 +- Apollo/assets/views/report_lead.html | 8 +- .../assets/views/report_markcardstatus.html | 51 +++++-- 12 files changed, 467 insertions(+), 138 deletions(-) diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 5f1146cf..90459ca4 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -414,11 +414,14 @@ $route['promoteBatchInfomation'] = 'Reregister_Controller/promoteBatchInfomation $route['report_status'] = 'Report/status'; $route['report_filters'] = 'Report/filters'; $route['report_filter'] = 'Report/filter'; +$route['report_markcard_filter'] = 'Report/markcard_filter'; $route['report_markcard'] = 'Report/markcard'; +$route['report_certificate_filter'] = 'Report/certificate_filter'; $route['report_certificate'] = 'Report/certificate'; $route['report_markcard_certificate'] = 'Report/mark_cert'; $route['report_expense'] = 'Report/expense'; $route['report_answer_booklet'] = 'Report/answer_booklet'; +$route['report_app_pending_filter'] = 'Report/app_pending_filter'; $route['report_app_pending'] = 'Report/app_pending'; $route['report_app_pending_old'] = 'Report/app_pending_old'; $route['report_doc_pending'] = 'Report/doc_pending'; diff --git a/Apollo/api/application/controllers/DayBook_Controller.php b/Apollo/api/application/controllers/DayBook_Controller.php index 7182a0ae..77eec285 100755 --- a/Apollo/api/application/controllers/DayBook_Controller.php +++ b/Apollo/api/application/controllers/DayBook_Controller.php @@ -624,10 +624,7 @@ public function updateNonOperationalDetails_post() { // echo $from.'from'; // echo $to.'to'; - - //echo $br;die(); $getStatus = $this->daybook_model->Income_expense($from,$to,$br); - //print_r($getStatus); if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; @@ -680,10 +677,9 @@ public function updateNonOperationalDetails_post() { $from= $this->post('from'); $to = $this->post('to'); $branch = $this->post('branch'); - $getexceldet = $this->daybook_model->GetPLexcelDetails($from,$to,$branch); + $getexceldet = $this->daybook_model->GetPLexcelDetails($from,$to,$branch); - - if($getexceldet) + if(!empty($getexceldet)) { $getexceldet['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/controllers/Report.php b/Apollo/api/application/controllers/Report.php index 9e4f07c9..ad9fbb13 100755 --- a/Apollo/api/application/controllers/Report.php +++ b/Apollo/api/application/controllers/Report.php @@ -61,13 +61,43 @@ class Report extends REST_Controller { } + } + public function markcard_filter_post() + { + $br = $this->post('branch'); + // $userID = $this->post('userID'); + $getStatus = $this->report_model->getUniversity2($br); + + if ($getStatus) + { + $result = $this->report_model->getDefaultActivity('C001',$br); + if(!empty($result)){$getStatus['markcardstatus'] = $result;} + else{ $getStatus['markcardstatus'] = array();} + $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 markcard_post() { $bat = $this->post('batch'); $br = $this->post('branch'); $u = $this->post('university'); - $getStatus = $this->report_model->markcard($bat,$br,$u); + $sts = $this->post('status'); + $fd = $this->post('from_date'); + $td = $this->post('to_date'); + + $getStatus = $this->report_model->markcard($bat,$br,$u,$sts,$fd,$td); //print_r($getStatus); if ($getStatus) { @@ -85,15 +115,42 @@ class Report extends REST_Controller { } + } + + public function certificate_filter_post() + { + $br = $this->post('branch'); + $getStatus = $this->report_model->getUniversity($br); + + if ($getStatus) + { + $result = $this->report_model->getDefaultActivity('A001',$br); + if(!empty($result)){$getStatus['certificatestatus'] = $result;} + else{ $getStatus['certificatestatus'] = array();} + $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 certificate_post() { $bat = $this->post('batch'); $br = $this->post('branch'); $u = $this->post('university'); - $from = $this->post('from'); + $st = $this->post('status'); + $from = $this->post('from'); $to = $this->post('to'); - $getStatus = $this->report_model->certificate_status($bat,$br,$u,$from,$to); + $getStatus = $this->report_model->certificate_status($bat,$br,$u,$from,$to,$st); //print_r($getStatus); if ($getStatus) { @@ -187,20 +244,55 @@ class Report extends REST_Controller { } + } + public function app_pending_filter_post(){ + $br = $this->post('branch'); + $getStatus = $this->report_model->getUniversity($br); + + if ($getStatus) + { $cnt = count($getStatus['university']); + if($cnt>=0){ + $getStatus['university'][$cnt]["universityID"] = "all"; + $getStatus['university'][$cnt]["universityName"] = "ALL"; + $getStatus['university'][$cnt]["batchDetails"]= [];} + $getStatus['rollnostatus'] = $this->report_model->getAppPendingStatus($br); + if(!empty($getStatus['rollnostatus'])){ + $cnted = count($getStatus['rollnostatus']); + if($cnted>=0){ + $getStatus['rollnostatus'][$cnted]["ListCode"] = "all"; + $getStatus['rollnostatus'][$cnted]["ListName"] = "ALL"; + $getStatus['rollnostatus'][$cnted]["BranchCode"]= $br; + }} + $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 app_pending_post() { $bat = $this->post('batch'); $br = $this->post('branch'); $u = $this->post('university'); - - $getStatus = $this->report_model->app_pending($bat,$br,$u); - $count = count($getStatus['app_pending_data']); - for ($i = 0;$i < $count;$i++) { - $getStatus['app_pending_data'][$i]->FormType = implode('-', array_map('ucfirst', explode('-', $getStatus['app_pending_data'][$i]->FormType))); + $st = $this->post('status'); + $from = $this->post('from'); + $to = $this->post('to'); + $updateddate = $this->post('updateddate'); + $getStatus = $this->report_model->app_pending($bat,$br,$u,$from,$st,$to,$updateddate); + if($getStatus['app_pendingList']){ + $count = count($getStatus['app_pending_data']); + for ($i = 0;$i < $count;$i++) { + $getStatus['app_pending_data'][$i]->FormType = implode('-', array_map('ucfirst', explode('-', $getStatus['app_pending_data'][$i]->FormType))); + } } - // die(); - //print_r($getStatus); + if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php index 5530104c..1669b158 100644 --- a/Apollo/api/application/models/DayBook_model.php +++ b/Apollo/api/application/models/DayBook_model.php @@ -1126,11 +1126,16 @@ class DayBook_model extends CI_Model $incomecode='I002'; $expensecode='I001'; - $fromd= date("Y-m-d",strtotime($from)); - $tod=date("Y-m-d",strtotime($to)); -// echo $fromd; -// echo $tod; -// die(); + $fromd= date("Y-m-d",strtotime($from)); + $tod=date("Y-m-d",strtotime($to)); + // echo $fromd; + // echo $tod; + // die(); + if($from != null && $to != null){ + $where="str_to_date(Date,'%d-%m-%Y')>=".$fromd." and str_to_date(Date,'%d-%m-%Y')<=".$tod." and"; + }else{ + $where=""; + } $subQuery= 'SELECT DISTINCT(p.Name) AS TID,ListName, SUM(IF(p.Name=?,Amount,0)) AS Income, @@ -1142,16 +1147,17 @@ class DayBook_model extends CI_Model FROM T_DayBookMaster AS p join T_PickListDetails on T_PickListDetails.ListCode = p.name - where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and p.IsActive=? and (p.Name=? and p.Status !=? or p.Name=?) and (p.ModeOfPayment != ? and p.ModeOfPayment != ? ) and Status !=? and p.BranchCode=? + where '.$where.' p.IsActive=? and (p.Name=? and p.Status !=? or p.Name=?) and (p.ModeOfPayment != ? and p.ModeOfPayment != ? ) and Status !=? and p.BranchCode=? GROUP BY p.`Name`'; - $query = $this->db->query($subQuery,array($incomecode,$expensecode,'Pending',$incomecode,$expensecode,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1','I001','Pending','I002','WAIVER','REFERRAL','Cancel',$br)); - $expense = $query->result(); -// print_r($this->db->last_query());die();and p.Isdaybook=? - // if(count($expense) > 0) - // { - $results['expense_data'] = $expense; - // } + $query = $this->db->query($subQuery,array($incomecode,$expensecode,'Pending',$incomecode,$expensecode,'1','I001','Pending','I002','WAIVER','REFERRAL','Cancel',$br)); + $expense = $query->result(); + // print_r($this->db->last_query());die(); + // and p.Isdaybook=? + // if(count($expense) > 0) + // { + $results['expense_data'] = $expense; + // } @@ -1159,7 +1165,6 @@ class DayBook_model extends CI_Model DISTINCT(q.Name) AS TID,ListName,T_Income_Outcome_Master.TypeID as Orgtype, SUM(IF(q.Name=?,Amount,0)) AS Income, SUM(IF(q.Name=? ,Amount,0)) AS Expense, - SUM( CASE Name WHEN ? THEN Amount WHEN ? THEN Amount @@ -1167,20 +1172,20 @@ class DayBook_model extends CI_Model FROM T_NonOperationalMaster AS q Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID=q.Type join T_PickListDetails on T_PickListDetails.ListCode = q.name - where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and q.IsActive=? and (q.Name=? or q.Name=?) + where '.$where.' q.IsActive=? and (q.Name=? or q.Name=?) and Status !=? and q.BranchCode=? and q.Isdaybook=? GROUP BY q.Name'; - $querynon = $this->db->query($subQueryNON,array($incomecode,$expensecode,$incomecode,$expensecode,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1','I001','I002','Cancel',$br,'1')); - $expensenon = $querynon->result(); + $querynon = $this->db->query($subQueryNON,array($incomecode,$expensecode,$incomecode,$expensecode,'1','I001','I002','Cancel',$br,'1')); + $expensenon = $querynon->result(); - // if(count($expensenon)>0) - // { - $results['expense_data_nonop'] = $expensenon; - // } - - // print_r($results);die(); - return $results; + // if(count($expensenon)>0) + // { + $results['expense_data_nonop'] = $expensenon; + // } + + // print_r($results);die(); + return $results; } @@ -1190,58 +1195,60 @@ class DayBook_model extends CI_Model $fromd= date("Y-m-d",strtotime($from)); $tod=date("Y-m-d",strtotime($to)); $expid = 'I001'; + if($from != null && $to != null){ + $where="str_to_date(Date,'%d-%m-%Y')>=".$fromd." and str_to_date(Date,'%d-%m-%Y')<=".$tod." and"; + }else{ + $where=""; + } + // $subQuery='select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster + // left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type + // join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID + // where str_to_date(date,?)>=? and str_to_date(date,?)<=? and Status!=? and T_DayBookMaster.BranchCode=? and (T_DayBookMaster.ModeOfPayment != ? and T_DayBookMaster.ModeOfPayment != ?and T_DayBookMaster.Status !=?) group by Type,Name'; -// $subQuery='select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster -// left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type -// join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID -// where str_to_date(date,?)>=? and str_to_date(date,?)<=? and Status!=? and T_DayBookMaster.BranchCode=? and (T_DayBookMaster.ModeOfPayment != ? and T_DayBookMaster.ModeOfPayment != ?and T_DayBookMaster.Status !=?) group by Type,Name'; + // $query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch,'WAIVER','REFERRAL','Pending')); -// $query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch,'WAIVER','REFERRAL','Pending')); - - //and T_DayBookMaster.Isdaybook=? - $subQuery="select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster -left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type -join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID -where str_to_date(date,?)>=? and str_to_date(date,?)<=? and Status!=? and T_DayBookMaster.BranchCode=? and (case when ListName = 'Income' then T_DayBookMaster.ModeOfPayment != 'WAIVER' and T_DayBookMaster.ModeOfPayment != 'REFERRAL'and T_DayBookMaster.Status !='Pending' and T_Income_Outcome_Master.TypeName NOT LIKE '%BY CASH%' - when ListName = 'Expense' then T_DayBookMaster.Status !='Pending' and T_Income_Outcome_Master.TypeName != 'FEES' and T_Income_Outcome_Master.TypeName NOT LIKE '%CASH TO%' end) group by Type,Name"; -$query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch)); + //and T_DayBookMaster.Isdaybook=? + $subQuery="select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster + left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type + join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID + where ".$where." Status!=? and T_DayBookMaster.BranchCode=? and (case when ListName = 'Income' then T_DayBookMaster.ModeOfPayment != 'WAIVER' and T_DayBookMaster.ModeOfPayment != 'REFERRAL'and T_DayBookMaster.Status !='Pending' and T_Income_Outcome_Master.TypeName NOT LIKE '%BY CASH%' + when ListName = 'Expense' then T_DayBookMaster.Status !='Pending' and T_Income_Outcome_Master.TypeName != 'FEES' and T_Income_Outcome_Master.TypeName NOT LIKE '%CASH TO%' end) group by Type,Name"; + $query = $this->db->query($subQuery,array('Cancel',$branch)); $expense = $query->result(); - if(count($expense)>0) - { - $results['fullexpense_detail'] = $expense; - } + if(count($expense)>0) + { + $results['fullexpense_detail'] = $expense; + } -$subQueryNON = 'select Name,sum(Amount) as Total,T_NonOperationalMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_NonOperationalMaster.Date,Reason,T_NonOperationalMaster.Description,ListName -from T_NonOperationalMaster -left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_NonOperationalMaster.Type -join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID -where str_to_date(date,?)>=? and str_to_date(date,?)<=? -and Status!=? and T_NonOperationalMaster.BranchCode=? and T_NonOperationalMaster.Isdaybook=? group by Type,Name'; + $subQueryNON = 'select Name,sum(Amount) as Total,T_NonOperationalMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_NonOperationalMaster.Date,Reason,T_NonOperationalMaster.Description,ListName + from T_NonOperationalMaster + left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_NonOperationalMaster.Type + join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID + where '.$where.' + Status!=? and T_NonOperationalMaster.BranchCode=? and T_NonOperationalMaster.Isdaybook=? group by Type,Name'; -$queryNon = $this->db->query($subQueryNON,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'Cancel',$branch,'1')); + $queryNon = $this->db->query($subQueryNON,array('Cancel',$branch,'1')); $expenseNon = $queryNon->result(); - if(count($expenseNon)>0) - { - $results['fullNonOpexpense_detail'] = $expenseNon; - } - - - return $results; - - //return $query->result_array(); - + if(count($expenseNon)>0) + { + $results['fullNonOpexpense_detail'] = $expenseNon; + } + + return $results; + + //return $query->result_array(); } @@ -1301,7 +1308,11 @@ public function GetPLexcelDetails($from,$to,$branch) // $query = $this->db->query($subQuery,array('I002','I002','I001','I001','I002','I002','I001','I001','%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,$branch,'%d-%m-%Y')); - +if($from != null && $to != null){ + $where="str_to_date(Date,'%d-%m-%Y')>=".$fromd." and str_to_date(Date,'%d-%m-%Y')<=".$tod." and"; +}else{ + $where=""; +} $subQuery='select Name,ListName,q.Date as dat,month(str_to_date(Date,?)) as month,year(str_to_date(Date,?)) as Year, T_Income_Outcome_Master.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName, @@ -1314,19 +1325,18 @@ $subQuery='select Name,ListName,q.Date as dat,month(str_to_date(Date,?)) as mont from T_NonOperationalMaster as q left Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= q.Type left Join T_PickListDetails on T_PickListDetails.ListCode=q.Name - where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? - and q.BranchCode=? group by month'; + where '.$where.' q.BranchCode=? group by month'; - $query = $this->db->query($subQuery,array('%d-%m-%Y','%d-%m-%Y','I002','I002','I001','I001','I002','I002','I001','I001','I002','I002','I002','I002','I001','I001','I001','I001','%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,$branch)); + $query = $this->db->query($subQuery,array('%d-%m-%Y','%d-%m-%Y','I002','I002','I001','I001','I002','I002','I001','I001','I002','I002','I002','I002','I001','I001','I001','I001',$branch)); - - // print_r($this->db->last_query()); die(); $expenseNon = $query->result(); if(count($expenseNon)>0) { $results['exceldetails'] = $expenseNon; + }else{ + $results = array(); } diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index f3ab84df..d4e95297 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -127,7 +127,7 @@ where BranchCode = '".$br."' and BatchName = '".$batch."'"; $sql = "select ifnull(sms.sid,'-') as Student_id,ifnull(scd.eid,'-') as Enrollment_id,ifnull(sfs.rollno,'-') as Roll_NO,ifnull(std.name,'-') as Student_name,ifnull(std.father,'-') as Father_name,ifnull(std.phone,'-') as Phone_number,ifnull(sms.cid,'-') as Course_id,ifnull(sms.cdate,'-') as Date,ifnull(cfd.syear,'-') as Sem_year,ifnull(sms.sem,'-') as Sem,ifnull(sfs.batch,'-') as Batch_code,ifnull(sms.branch,'-') as Branch_code,ifnull(cm.course,'-') as Course_name,ifnull(cm.uname,'-') as University,ifnull(list.status,'-') as Status,ifnull(sfp.bdate,'-') as Initial_paid_date,bal.balpayable as Balance_Fee,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber,ifnull(appdate,'-') as appdate,ifnull(ansdate,'-') as ansdate ,scd.coursestatus as Course_Status,ifnull(andate.courierdetails,'-') as Courier_Details,IFNULL(sfs.batchname, '-') AS Batch_Name from - (SELECT c.ID,StudentID as sid,c.CourseID as cid,c.BranchCode as branch,c.ListCode as lcode,p.ListName,c.CertificationType as ctype,c.CDate as cdate,c.Sem as sem FROM T_CertificationStatus c + (SELECT c.ID,StudentID as sid,c.CourseID as cid,c.BranchCode as branch,c.ListCode as lcode,p.ListName,c.CertificationType as ctype,c.CDate as cdate,c.Sem as sem,c.CreatedOn FROM T_CertificationStatus c left join T_PickListDetails p on p.ListCode=c.ListCode WHERE c.ID IN (SELECT max(ID) FROM T_CertificationStatus group by StudentID,CourseID,BranchCode,Sem) group by sid,sem,cid,lcode,branch) as sms @@ -171,7 +171,7 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se where std.active = 1 and sms.branch = '".$br."' "; - if ($bat!= ''){ + if ($bat!= ''){ $sql.=" and sfs.batch = '".$bat."'"; @@ -181,8 +181,18 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se $sql.=" and cm.uid = '".$u."'"; } + if ($st != ''){ + $sql.="and list.lcode = '".$st."'"; + } + if ($from != ''){ + $fromd= date("Y-m-d",strtotime($from)); + $sql.="and sms.CreatedOn >= '".$fromd."'"; + } + if ($to != ''){ + $tod=date("Y-m-d",strtotime($to)); + $sql.=" and sms.CreatedOn <= '".$tod."'"; + } $sql.=" group by Student_id,Course_id,Batch_code,Branch_code,Sem,Sem_year"; - // print_r($sql);die(); $leadDet=$this->db->query($sql); $mstatusDetails = $leadDet->result(); if (count($mstatusDetails) > 0) { @@ -196,7 +206,7 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se return $results; } - public function certificate_status($bat=null,$br=null,$u=null,$from=null,$to=null){ + public function certificate_status($bat=null,$br=null,$u=null,$from=null,$to=null,$st=null){ // $sql = "select sms.sid as Student_id,sms.cid,ifnull(sms.status,'-') as status,ifnull(sms.adate,'-') as adate,ifnull(sms.acmts,'-') as acmts,ifnull(sms.ctype,'-') as ctype,ifnull(sms.certname,'-') as certname,ifnull(balance,'-') as balance,ifnull(sfp.BillDate,'-') as initialPaid,ifnull(scd.eid,'-') as Enrollment_id,ifnull(std.name,'-') as Student_name,ifnull(std.father,'-') as Father_name,ifnull(std.phone,'-') as Phone_number,ifnull(cm.course,'-') as Course_name,ifnull(cm.uname,'-') as University,cm.uid as univID,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber // from @@ -240,7 +250,7 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se // (SELECT StudentID as sid,MobileNumber as phone,IsActive as active,concat(FirstName,' ',Lastname) as name,Fathername as father,PermanentAddress as address,AlternateNumber FROM T_StudentDetails) as std on std.sid=sms.sid // left join // (SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid - $sql ="SELECT sms.sid AS Student_id,sms.cid,ifnull(sms.status,'-') AS STATUS,ifnull(DATE_FORMAT(sms.adate, '%d-%m-%Y'),'-') AS adate,ifnull(sms.acmts,'-') AS acmts,ifnull(sms.ctype,'-') AS ctype,ifnull(sms.certname,'-') AS certname,ifnull(balance,'-') AS balance,ifnull(sfb.bdate,'-') AS initialPaid,ifnull(scd.eid,'-') AS Enrollment_id,ifnull(std.name,'-') AS Student_name,ifnull(std.father,'-') AS Father_name,ifnull(std.phone,'-') AS Phone_number,ifnull(cm.course,'-') AS Course_name,ifnull(cm.uname,'-') AS University,cm.uid AS univID,ifnull(std.address,'-') AS address,ifnull(std.AlternateNumber,'') AS AlternateNumber,sfs.batch as Batch,scd.coursestatus as Course_Status,ifnull(andate.courierdetails,'-') as Courier_Details + $sql ="SELECT sms.sid AS Student_id,sms.cid,ifnull(sms.status,'-') AS STATUS,ifnull(DATE_FORMAT(sms.adate, '%d-%m-%Y'),'-') AS adate,ifnull(sms.acmts,'-') AS acmts,ifnull(sms.ctype,'-') AS ctype,ifnull(sms.certname,'-') AS certname,ifnull(balance,'-') AS balance,ifnull(sfb.bdate,'-') AS initialPaid,ifnull(scd.eid,'-') AS Enrollment_id,ifnull(std.name,'-') AS Student_name,ifnull(std.father,'-') AS Father_name,ifnull(std.phone,'-') AS Phone_number,ifnull(cm.course,'-') AS Course_name,ifnull(cm.uname,'-') AS University,cm.uid AS univID,ifnull(std.address,'-') AS address,ifnull(std.AlternateNumber,'') AS AlternateNumber,sfs.batch as Batch,IFNULL(sfs.batchname, '-') AS Batch_Name,scd.coursestatus as Course_Status,IFNULL(certiSt.courierdetails, '-') AS Courier_Details FROM ( SELECT app.ID,app.StudentID AS sid,app.CourseID AS cid,app.BranchCode AS branch,app.ListCode AS lcode,p.ListName AS STATUS,STR_TO_DATE(AppDate, '%d-%m-%Y' @@ -252,8 +262,9 @@ AS adate,app.Comments AS acmts,CertificationType AS ctype,app.CertificationType WHERE app.CertificationType NOT LIKE 'CERT%' AND app.ID IN (SELECT max(ID) FROM T_ApplicationStatus GROUP BY StudentID,CourseID,BranchCode,CertificationType) GROUP BY app.ID) AS sms LEFT JOIN - (SELECT FeesID AS fid,BatchCode AS batch,StudentID AS sid,CourseID AS cid,FeesType AS ftype,sum(CourseFees) AS cf,Sum(STFOrWR) AS stf,sum(Others) AS others + (SELECT FeesID AS fid,T_Students_Fees_Status.BatchCode AS batch,StudentID AS sid,CourseID AS cid,FeesType AS ftype,sum(CourseFees) AS cf,Sum(STFOrWR) AS stf,sum(Others) AS others,T_BatchMaster.BatchName as batchname FROM T_Students_Fees_Status + left join T_BatchMaster on T_BatchMaster.BatchCode = T_Students_Fees_Status.BatchCode GROUP BY sid,cid,fid) AS sfs ON sfs.sid=sms.sid AND sfs.cid=sms.cid AND sfs.ftype=sms.ctype LEFT JOIN @@ -275,11 +286,10 @@ LEFT JOIN LEFT JOIN (SELECT StudentID AS sid,UniversityID AS uid,CourseID AS cid,EnrollmentID AS eid,BranchID AS branch,ifnull(Status,'-') as coursestatus FROM T_Student_CourseDetails) AS scd ON scd.sid=sms.sid AND scd.cid=sms.cid And scd.coursestatus not in ('Cancelled','Discontinued','Refund_issued') -left join (select StudentID as sid,CourierDetails as courierdetails - from T_AnswerBookletStatus abs - left join T_PickListDetails list on list.ListCode=abs.ListCode - where AnsDate is not null and ID in ( select max(ID) from T_AnswerBookletStatus where AnsDate is not null group by StudentID,Sem) - group by sid,Sem) as andate on andate.sid=sms.sid +LEFT JOIN + (SELECT StudentID AS sid, CourierDetails AS courierdetails FROM T_CertificationStatus cs + WHERE CDate IS NOT NULL AND ID IN (SELECT MAX(ID) FROM T_CertificationStatus WHERE CDate IS NOT NULL GROUP BY StudentID , Sem) + GROUP BY sid , Sem) AS certiSt ON certiSt.sid = sms.sid where sms.branch = '".$br."'"; @@ -309,6 +319,9 @@ left join (select StudentID as sid,CourierDetails as courierdetails $sql.=" and sfb.bdate <= '".$tod."'"; } + if ($st != ''){ + $sql.=" and sms.lcode = '".$st."'"; + } $sql.=" group by Student_id,cid,ctype"; $sql.=" ORDER BY sfb.bdate ASC"; //echo $sql; @@ -641,7 +654,7 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se return $results; } - public function app_pending($bat=null,$br=null,$u=null){ + public function app_pending($bat=null,$br=null,$u=null,$st=null,$from=null,$to=null,$udate=null){ @@ -770,10 +783,53 @@ WHERE STU.IsActive = '1' and APFS.ID in (select max(ID) from T_ApplicationFormSt } if ($u!= ''){ - + if($u=="all"){ + $this->db->select('UniversityID'); + $this->db->where('IsActive','1'); + $this->db->where('BranchCode',$br); + $university = $this->db->get(UNIVERSITY); + $q = []; + for($i = 0 ; $iresult());$i++) + { + $q[$i] = $university->result()[$i]->UniversityID; + } + $sql.=" and COUR.UniversityID in ('".implode("','",$q)."')"; + + } + else{ $sql.=" and COUR.UniversityID = '".$u."'"; - + } } + + if($st != ''){ + if($st=="all"){ + $resn = $this->db->query("select ListCode from T_PickListDetails where T_PickListDetails.IsActive = 1 and T_PickListDetails.BranchCode = ? and T_PickListDetails.ListName in ('RECEIVED','PENDING') order by T_PickListDetails.ListGroup desc;",array($br)); + $list = $resn->result(); + $q = []; + for($i = 0 ; $iUniversityID; + } + $sql.=" and APFS.ListCode in ('".implode("','",$q)."')"; + + } + else{ + $sql.=" and APFS.ListCode = '".$st."'"; + } + } + if ($from != ''){ + $fromd= date("Y-m-d",strtotime($from)); + $sql.="and STR_TO_DATE(BALFEE.CreatedOn,'%d-%m-%Y') >= '".$fromd."'"; + } + if ($to != ''){ + $tod=date("Y-m-d",strtotime($to)); + $sql.=" and STR_TO_DATE(BALFEE.CreatedOn,'%d-%m-%Y') <= '".$tod."'"; + } + if ($udate != ''){ + $ud=date("Y-m-d",strtotime($udate)); + $sql.=" and STR_TO_DATE(APFS.AppFormDate,'%d-%m-%Y') = '".$ud."'"; + } + $sql.=" and STU_COUR.IsActive='1'"; $sql.=" and STU.BranchCode='".$br."'"; @@ -782,8 +838,6 @@ WHERE STU.IsActive = '1' and APFS.ID in (select max(ID) from T_ApplicationFormSt $sql.=" ORDER BY StatusUpdationOn,InitialPayDate ASC "; $leadDet=$this->db->query($sql); - // print_r($sql); - // die(); $answer = $leadDet->result(); if (count($answer) > 0) { $results['app_pendingList'] = true; @@ -1241,6 +1295,38 @@ from T_Lead_Tracking_Followup as ltf $this->db->order_by('BatchDate','DESC'); $batchDetails = $this->db->get(BATCH); return $batchDetails->result(); + } + public function getUniversity2($br=null) + { + $this->db->select('UniversityID,UniversityName'); + $this->db->where('BranchCode',$br); + $this->db->order_by('CreatedOn','DESC'); + $university = $this->db->get(UNIVERSITY); + if($university->result()){ + $result = array(); + $result['univlist'] = true; + foreach ($university->result() as $row) + { + + $university_array['universityID'] = $row->UniversityID; + $university_array['universityName'] = $row->UniversityName; + $university_array['batchDetails']= $this->getBatch($row->UniversityID,$br); + $result_array[]=$university_array; + } + $result['university']= $result_array; + } + else { + $result['univlist'] = false; + $result['message'] = "No records found!"; + $result['universityID'] = ""; + $result['universityName'] = ""; + $result['batchDetails']= ""; + } +// print_r( $this->db->last_query()); +// die(); + + return $result; + } public function GetAllUniversity($branchId) { @@ -1266,7 +1352,6 @@ from T_Lead_Tracking_Followup as ltf return $result_array; } - public function GetNewRegList($det) { @@ -1530,5 +1615,26 @@ if($feeDetails) return $results; } - + + public function getDefaultActivity($code,$reqBranch) + { + $this->db->select('DA.StudentActivityCode,PLD.ListCode,PLD.ListName'); + $this->db->from(DEFAULTACTIVITY .' as DA'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = DA.StatusCode'); + $this->db->where('PLD.IsActive','1'); + $this->db->where('DA.IsActive','1'); + $this->db->where('DA.BranchCode', $reqBranch); + $this->db->where('DA.StudentActivityCode',$code); + $result=$this->db->get()->result(); + return $result; + + } + + public function getAppPendingStatus($br){ + $query = "select ListCode,ListName,BranchCode from T_PickListDetails where T_PickListDetails.IsActive = 1 and T_PickListDetails.BranchCode = ? and T_PickListDetails.ListName in ('RECEIVED','PENDING') order by T_PickListDetails.ListGroup desc;"; + $resn = $this->db->query($query,array($br)); + $list = $resn->result(); + $result = count($list) > 0 ? $list : array(); + return $result; + } } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/report_app_pendingCtrl.js b/Apollo/assets/js/controllers/report_app_pendingCtrl.js index 350f73f0..f12290c9 100755 --- a/Apollo/assets/js/controllers/report_app_pendingCtrl.js +++ b/Apollo/assets/js/controllers/report_app_pendingCtrl.js @@ -51,12 +51,16 @@ $scope.generateButtonStatus = false; "branch": "", "university": "", "batch": "", + "status":"", + "from_date":"", + "to_date":"", + "updated_date":"" }; $scope.filters = function () { var filterlist = { method: 'POST', - url: apiPoint.url + 'report_filters/', + url: apiPoint.url + 'report_app_pending_filter/', headers: { 'Content-Type': 'application/json' }, @@ -71,6 +75,7 @@ $scope.generateButtonStatus = false; $scope.batch=[]; $scope.batchlist = response.data.batch; $scope.university = response.data.university; + $scope.statuslist = response.data.rollnostatus; //Desc order Batchlist angular.forEach($scope.batchlist,function (values,key) { var parts = values.BatchDate.split("-"); @@ -92,14 +97,25 @@ $scope.generateButtonStatus = false; $scope.$watch('univModel.university', function (newValue,oldValue) { if(newValue==undefined || newValue==''){ $scope.filterBatchDetails=""; + $scope.disableSubmit=true; console.log($scope.filterBatchDetails); } else{ if(angular.isString(newValue)){ + $scope.disableSubmit=false; $scope.filterBatchDetails=angular.fromJson(newValue); } } + }); + $scope.$watchCollection('univModel.status', function (newValue,oldValue) { + if(newValue==undefined || newValue=='' || newValue==null){ + $scope.disableSubmit=true; + } + else{ + $scope.disableSubmit=false; + } + }); //Response data $scope.show = false; @@ -116,16 +132,17 @@ $scope.generateButtonStatus = false; var field = null, firstError = null; $scope.show = true; for (field in form) { + console.log('field',field); if (field[0] != '$') { if (firstError === null && !form[field].$valid) { - firstError = form[field].$batch; + firstError = form[field].$name; } if (form[field].$pristine) { form[field].$dirty = true; } } } - angular.element('.ng-invalid[batch=' + firstError + ']').focus(); + angular.element('.ng-invalid[name=' + firstError + ']').focus(); }else { //alert($scope.batch.name); $scope.app_pending_data = ''; @@ -139,7 +156,11 @@ $scope.generateButtonStatus = false; data: { branch: JSON.parse(sessionStorage.getItem('localObj')).localBranchID, university: $scope.filterUniv.universityID, - batch: $scope.univModel.batch + batch: $scope.univModel.batch, + status:$scope.univModel.status, + from:$scope.univModel.from_date, + to:$scope.univModel.to_date, + updateddate:$scope.univModel.updated_date } diff --git a/Apollo/assets/js/controllers/report_certificateCtrl.js b/Apollo/assets/js/controllers/report_certificateCtrl.js index b35bc6b6..31cc2782 100755 --- a/Apollo/assets/js/controllers/report_certificateCtrl.js +++ b/Apollo/assets/js/controllers/report_certificateCtrl.js @@ -52,6 +52,7 @@ $scope.generateButtonStatus = false; "branch": "", "university": "", "batch": "", + "status":"", "from_date": "", "to_date": "", @@ -60,7 +61,7 @@ $scope.generateButtonStatus = false; $scope.filters = function () { var filterlist = { method: 'POST', - url: apiPoint.url + 'report_filters/', + url: apiPoint.url + 'report_certificate_filter/', headers: { 'Content-Type': 'application/json' }, @@ -75,6 +76,7 @@ $scope.generateButtonStatus = false; $scope.batch=[]; $scope.batchlist = response.data.batch; $scope.university = response.data.university; + $scope.certificatestatus = response.data.certificatestatus; //Desc order Batchlist angular.forEach($scope.batchlist,function (values,key) { var parts = values.BatchDate.split("-"); @@ -108,7 +110,7 @@ $scope.generateButtonStatus = false; }); // disable submit - $scope.$watchCollection('univModel.from_date', function (newValue,oldValue) { + $scope.$watchCollection('univModel.status', function (newValue,oldValue) { if(newValue==undefined || newValue=='' || newValue==null){ $scope.disableSubmit=true; } @@ -139,6 +141,7 @@ $scope.generateButtonStatus = false; branch: JSON.parse(sessionStorage.getItem('localObj')).localBranchID, university: $scope.filterUniv.universityID, batch: $scope.univModel.batch, + status:$scope.univModel.status, from : $scope.univModel.from_date, to : $scope.univModel.to_date } @@ -185,7 +188,7 @@ $scope.generateButtonStatus = false; $scope.exportData = function () { - alasql('SELECT CAST(SL_NO AS NUMBER) as SLNO,initialPaid as CertificateFeePaidDate,Enrollment_id as EnrollmentID,Student_name as StudentName,Father_name as FatherName,Course_name as Course,University as University,CAST(balance AS NUMBER) as Balance,certname as CertificateName,STATUS as CertificateStatus,acmts as Comments, adate as Date INTO XLS("Certificate_status.xls",?) FROM ?',[mystyle,$scope.cert_data]); + alasql('SELECT CAST(SL_NO AS NUMBER) as SLNO,initialPaid as CertificateFeePaidDate,Enrollment_id as EnrollmentID,Student_name as StudentName,Father_name as FatherName,Course_name as Course,University as University,CAST(balance AS NUMBER) as Balance,certname as CertificateName,STATUS as CertificateStatus,acmts as Comments, adate as Date,Batch_Name as Batch,Courier_Details as CertificationCourierDetails INTO XLS("Certificate_status.xls",?) FROM ?',[mystyle,$scope.cert_data]); }; $scope.$watch(function () { $scope.filteredItems = $scope.$eval(" cert_data | filter: search "); @@ -357,7 +360,7 @@ $scope.generateButtonStatus = false; var firstError = null; if (form.$invalid) { - + console.log('field',field); var field = null, firstError = null; for (field in form) { if (field[0] != '$') { diff --git a/Apollo/assets/js/controllers/report_markcard_statusCtrl.js b/Apollo/assets/js/controllers/report_markcard_statusCtrl.js index 706af0f8..772d6bbb 100755 --- a/Apollo/assets/js/controllers/report_markcard_statusCtrl.js +++ b/Apollo/assets/js/controllers/report_markcard_statusCtrl.js @@ -50,19 +50,20 @@ $scope.generateButtonStatus = false; "branch": "", "university": "", "batch": "", - + "status":"", + "from_date": "", + "to_date": "" }; $scope.filters = function () { var filterlist = { method: 'POST', - url: apiPoint.url + 'report_filters/', + url: apiPoint.url + 'report_markcard_filter/', headers: { 'Content-Type': 'application/json' }, data: { branch : JSON.parse(sessionStorage.getItem('localObj')).localBranchID - } }; @@ -71,6 +72,7 @@ $scope.generateButtonStatus = false; $scope.batch=[]; $scope.batchlist = response.data.batch; $scope.university = response.data.university; + $scope.markcardstatus = response.data.markcardstatus; //Desc order Batchlist angular.forEach($scope.batchlist,function (values,key) { var parts = values.BatchDate.split("-"); @@ -84,6 +86,7 @@ $scope.generateButtonStatus = false; // call service for make a list in desc order based on date $scope.batch=dateListDescService.getOrderByList($scope.batch); console.log(response.data.batch); + // console.log('89',response.data.markcardstatus); console.log($scope.batch); } else { } @@ -94,24 +97,39 @@ $scope.generateButtonStatus = false; $scope.$watch('univModel.university', function (newValue,oldValue) { if(newValue==undefined || newValue==''){ $scope.filterBatchDetails=""; + $scope.disableSubmit=true; } else{ if(angular.isString(newValue)){ $scope.filterBatchDetails=angular.fromJson(newValue); + $scope.disableSubmit=false; } } + }); + // disable submit + $scope.$watchCollection('univModel.status', function (newValue,oldValue) { + if(newValue==undefined || newValue=='' || newValue==null){ + $scope.disableSubmit=true; + } + else{ + $scope.disableSubmit=false; + + } + }); $scope.show = false; $scope.onSubmit = function (form) { $scope.isLoaderShow1 =true; - + console.log(form); var firstError = null; if (form.$invalid) { var field = null, firstError = null; $scope.show = true; for (field in form) { + console.log('field',field); + console.log($batch); if (field[0] != '$') { if (firstError === null && !form[field].$valid) { firstError = form[field].$batch; @@ -136,7 +154,11 @@ $scope.generateButtonStatus = false; data: { branch: JSON.parse(sessionStorage.getItem('localObj')).localBranchID, university: $scope.filterUniv.universityID, - batch: $scope.univModel.batch + batch: $scope.univModel.batch, + status: $scope.univModel.status, + from_date: $scope.univModel.from_date, + to_date: $scope.univModel.to_date + } }; @@ -175,7 +197,7 @@ $scope.generateButtonStatus = false; $scope.exportData = function () { - alasql('SELECT CAST(SL_NO AS NUMBER) as SLNO,Initial_paid_date as InitialPaymentPaidDate,Enrollment_id as EnrollmentID,Roll_NO as RollNO,Student_name as StudentName,Father_name as FatherName,Course_name as Course,Sem_year as SemYear,University as University,CAST(Balance_Fee AS NUMBER) as BalanceFee,appdate as ApplicationSenttoUnivDate,ansdate as AnswerBookletUnivDate,Status as MarkCardStatus,Date as Date INTO XLS("Markcard_status.xls",?) FROM ?',[mystyle,$scope.markcard_data]); + alasql('SELECT CAST(SL_NO AS NUMBER) as SLNO,Initial_paid_date as InitialPaymentPaidDate,Enrollment_id as EnrollmentID,Roll_NO as RollNO,Student_name as StudentName,Father_name as FatherName,Course_name as Course,Sem_year as SemYear,University as University,CAST(Balance_Fee AS NUMBER) as BalanceFee,appdate as ApplicationSenttoUnivDate,ansdate as AnswerBookletUnivDate,Status as MarkCardStatus,Date as Date,Batch_Name as Batch,Courier_Details as AnswerBooksCourierDetails INTO XLS("Markcard_status.xls",?) FROM ?',[mystyle,$scope.markcard_data]); }; $scope.$watch(function () { $scope.filteredItems = $scope.$eval(" markcard_data | filter: search "); diff --git a/Apollo/assets/views/report_application_pending.html b/Apollo/assets/views/report_application_pending.html index 6b57f9c2..43a087f8 100755 --- a/Apollo/assets/views/report_application_pending.html +++ b/Apollo/assets/views/report_application_pending.html @@ -53,23 +53,66 @@ Please select University. -

- - Please select Batch. +
+
+
+ + + Please select Status. +
+ + +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
- @@ -86,7 +129,7 @@
-
+
diff --git a/Apollo/assets/views/report_certificate_status.html b/Apollo/assets/views/report_certificate_status.html index de710d8a..f95491a8 100755 --- a/Apollo/assets/views/report_certificate_status.html +++ b/Apollo/assets/views/report_certificate_status.html @@ -63,6 +63,18 @@ td,th { Please select Batch.
--> +
+
+ + + Please select Status. +
@@ -73,7 +85,7 @@ td,th {
@@ -86,7 +98,7 @@ td,th {
diff --git a/Apollo/assets/views/report_lead.html b/Apollo/assets/views/report_lead.html index 04bf78e5..290f8039 100644 --- a/Apollo/assets/views/report_lead.html +++ b/Apollo/assets/views/report_lead.html @@ -22,9 +22,7 @@ td,th { th { cursor: pointer; } */ - .word-break{ - word-wrap: break-word; - } +