Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 52.15.42.61
<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf_latest/fpdf.php";
require_once($pdf_writer_class);
ini_set('max_execution_time', 300);
class DownloadExamAppFormApplications extends FPDF
{
function DefaultConstructor($aobj_context)
{
include_once($aobj_context->main_src."/src/format.php");
$this->aobj_context=$aobj_context;
$this->pdf= new FPDF();
$this->pdf=$this;
session_start();
$this->ip=$_SERVER["REMOTE_ADDR"];
$this->collcode=$_SESSION['collcode'];
$this->college_code=$_SESSION['collcode'];
$get_date="select date_format(now(),'%d/%m/%Y') as now_date";
$obj=$this->aobj_context->mobj_db->GetRow($get_date);
$this->current_date=$obj['now_date'];
$this->qp_code_start = substr("0000000000".$aobj_context->mobj_data["qp_code_start"],-5);
$this->qp_code_end = substr("ZZZZZZZZZZ".$aobj_context->mobj_data["qp_code_end"],-5);
$this->date_start = substr("0000000000".db_date_Format($aobj_context->mobj_data["Date_start"]),-10);
$this->date_end = substr("ZZZZZZZZZZ".db_date_Format($aobj_context->mobj_data["Date_end"]),-10);
$this->session = stripslashes($aobj_context->mobj_data["session"]);
// var_dump($this->qp_code_start,$this->qp_code_end,$this->date_start,$this->date_end,$this->session);
// die();
if($this->session=="PM")
$this->session="'PM'";
if($this->session=="AM")
$this->session="'AM'";
}
function Header()
{
$this->pdf->SetMargins(6,12,10);
if($this->funivcode == '055')
{
$img_logo_path=$this->aobj_context->main_src. '/'.$this->aobj_context->mobj_data["db"]."/img/report_uni_logo.jpg";
$this->pdf->Image($img_logo_path,30,2,140,20);
$this->pdf->Ln(10);
}else
{
$img_path=$this->aobj_context->main_src.'/'.$this->aobj_context->mobj_data["db"].'/'.$this->pdf_logo_path;
if(!empty($this->pdf_logo_path) && file_exists($img_path))
{
$this->pdf->Image($img_path,10,10,20);
}
$this->pdf->SetFont('Times','B',15);
$this->pdf->cell(0,4,"".$this->FUNIVNAME,"0",1,"C");
$this->pdf->SetFont('Times','',8);
$this->pdf->cell(0,4, $this->s_state,"0",0,"C");
$this->pdf->SetFont('Times','',10);
$this->pdf->Cell(-20,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'C');
$this->pdf->SetFont('Times','B',10);
$this->pdf->cell(0,5, "College : ".$this->FCOLLCODE." - ".$this->FCOLLNAME,"0",1,"C");
}
$this->pdf->SetFont('Times','B',10);
if($this->funivcode == '049' || $this->funivcode == '055')
{
$this->pdf->Cell(0,5,"Course : {$this->qp_code} - {$this->qp_name}","0",0,"C");
$this->pdf->SetFont('Times','B',12);
$this->pdf->Cell(0,5,"Form A","0",1,"R");
$this->pdf->SetFont('Times','B',10);
}
else
$this->pdf->Cell(0,5,"QP Code : {$this->qp_code} - {$this->qp_name}","0",1,"C");
$this->pdf->Cell(0,5,"Date of Examination : {$this->doe}","0",1,"C");
//var_dump($this->session);
if($this->session == "'AM'")
$FSESSION_name = "Morning Session";
if($this->session == "'PM'")
$FSESSION_name = "Afternoon Session";
$this->pdf->Cell(0,5,"Session : {$FSESSION_name}","0",1,"C");
$this->pdf->ln(1);
$new_y=$this->pdf->GetY();
$this->pdf->SetDash(1, .3);
$this->pdf->Line(12,$new_y, 203,$new_y);
$this->pdf->Line(12,$new_y+.5, 203,$new_y+.5);
//$this->pdf->ln(4);
}
function Footer()
{
$this->SetY(-20);
$this->pdf->SetFont('Times','B',8);
//$this->Cell(140,6,'Entered : IP Address : '.$this->ip_address." Date ".$this->created_date,'0',0,'L');
$new_y=$this->pdf->GetY();
$this->pdf->SetDash(1, .3);
$this->pdf->Line(12,$new_y, 203,$new_y);
$this->pdf->Line(12,$new_y+.5, 203,$new_y+.5);
$this->pdf->Ln(2);
$this->Cell(0,6,' Printed : IP Address : '.$this->ip." Date ".$this->current_date,'0',0,'L');
//$this->Cell(50,6,'Page '.$this->PageNo().' of {nb}',0,1,'R');
}
function formcolldata()
{
$get_coll_name="select FUNIVNAME as 'FUNIVNAME',
funivcode,ifnull(fsubas,'') as fsubas,
funivcode,
FUNIVADD1 as 'state', pdf_logo_path From control";
$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
$this->FUNIVNAME=$lobj_get_coll_name['FUNIVNAME'];
$this->funivcode=$lobj_get_coll_name['funivcode'];
$this->fsubas=$lobj_get_coll_name['fsubas'];
$this->s_state=$lobj_get_coll_name['state'];
$this->f_year=$lobj_get_coll_name['f_year'];
$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
$get_coll_name="SELECT FCOLLCODE,FCOLLNAME
FROM college where FCOLLCODE='{$this->collcode}'";
$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
$this->FCOLLCODE=$lobj_get_coll_name['FCOLLCODE'];
$this->FCOLLNAME=$lobj_get_coll_name['FCOLLNAME'];
}
function GetAllSubjects()
{
//print_r($get_fcsubcode_from_both_table);die();
$query1 = "SET SESSION group_concat_max_len=100000";
$results1 = $this->aobj_context->mobj_db->Execute($query1);
if($_SESSION['fexamseparate'] == 'T')
{
$candsum = "examcandsum";
$canddet = "examcanddet";
}else
{
$candsum = "candsum";
$canddet = "canddet";
}
$get_daliy_data= " select '9999' as fbatch, date_format(cd.FDOE,'%d/%m/%Y') as doe_name,cd.FQPCODE as FQPCODE,cd.FSESSION,
concat(sub.FSUBNAME, space(2), '( ',sub.FSSUBNAME,' )') as subject_desp,
FNOBUNDLE,FTOTSCRIPT
from colldesp cd inner join subject sub on
sub.FQPCODE=cd.FQPCODE
where
cd.FCOLLCODE='{$this->college_code}' and
cd.FQPCODE>='{$this->qp_code_start}' and cd.FQPCODE<='{$this->qp_code_end}' and
cd.FDOE>='{$this->date_start}' and cd.FDOE<='{$this->date_end}'
and cd.FSESSION in({$this->session}) and
ifnull(cd.FDELETED,'') <> 'T' and cd.fcollcode = 'xxxxdddddf'
group by cd.FDOE,cd.FQPCODE,cd.FSESSION
order by cd.FDOE, cd.FSESSION, cd.fqpcode ";
// var_dump($get_daliy_data);
// die();
$lobj_get_daliy_data = $this->aobj_context->mobj_db->GetAll($get_daliy_data);
//$result=mysql_query("set group_concat_max_len=10000");
/*$get_daliy_present_data= " select st.fbatch,sub.FQPCODE,date_format(sub.FDOE,'%d/%m/%Y') as doe_name, sub.FSESSION, 'QPP' as type,
concat(sub.FSUBNAME, space(2), '( ',sub.FSSUBNAME,' )') as subject_desp,
GROUP_CONCAT(distinct a.FREGNO order by a.fregno SEPARATOR ' ') as FREGNO, COUNT(DISTINCT a.FREGNO) AS reg_cnt
from canddet a inner join subject sub on
sub.FDEGREE=a.FDEGREE and sub.fexamno = a.fexamno and sub.fsubcode = a.fsubcode
and ifnull(sub.ftheory,'') = 'T' and ifnull(sub.fqpcode,'') <> ''
inner join student st
on a.fdegree = st.fdegree
and a.FCOLLCODE = st.fcollcode
and a.FREGNO = st.fregno
where
sub.FDOE>='{$this->date_start}' and sub.FDOE<='{$this->date_end}'
and sub.FQPCODE>='{$this->qp_code_start}' and sub.FQPCODE<='{$this->qp_code_end}'
and sub.FSESSION in({$this->session})
and a.FCOLLCODE='{$this->college_code}'
and ifnull(a.FDELETED,'') <> 'T' and a.FCOLLCODE='{$this->college_code}' and a.fpresent = 'P'
and concat(a.fcollcode, a.fregno, sub.fqpcode) not in(select concat(fcollcode, fregno, fqpcode) from absent
where FDOE>='{$this->date_start}' and sub.FDOE<='{$this->date_end}'
and FQPCODE>='{$this->qp_code_start}' and sub.FQPCODE<='{$this->qp_code_end}'
and FCOLLCODE='{$this->college_code}')
group by sub.FDOE, sub.FQPCODE, sub.FSESSION,st.fbatch
order by date_format(sub.FDOE,'%d/%m/%Y'), sub.FSESSION, sub.fqpcode,st.fbatch" ;*/
//var_dump($this->session);
if($this->session == "'AM'")
$FSESSION = "M%";
if($this->session == "'PM'")
$FSESSION = "N%";
$get_daliy_present_data= "select deg.fexamname, sub.FQPCODE, date_format(sub.FDOE, '%d/%m/%Y') as doe_name,
sub.FSESSION, 'QPP' as type,
if('$this->funivcode' = '055',concat(sub.fsubshort,' - ',sub.FSUBNAME),concat(sub.FSUBNAME, space(2), '( ',sub.FSSUBNAME,' )')) as subject_desp,
GROUP_CONCAT(distinct a.FREGNO order by a.fregno SEPARATOR ' ' ) as FREGNO, COUNT(DISTINCT a.FREGNO) AS reg_cnt
from $canddet a inner join subject sub
on sub.FDEGREE = a.FDEGREE
and sub.fexamno = a.fexamno
and sub.fsubcode = a.fsubcode
and ifnull(sub.ftheory, '') = 'T'
and ifnull(sub.fqpcode, '') <> ''
inner join degree deg on sub.fdegree = deg.fdegree and sub.fexamno = deg.fexamno
inner join student st
on a.FREGNO = st.fregno
inner join $candsum cs on a.fregno = cs.fregno
left outer join absent on a.fregno = absent.fregno
and sub.fqpcode = absent.fqpcode
where sub.FDOE >= '{$this->date_start}'
and sub.FDOE <= '{$this->date_end}'
and sub.FQPCODE >= '{$this->qp_code_start}'
and sub.FQPCODE <= '{$this->qp_code_end}'
and sub.FSESSION like '{$FSESSION}%'
and cs.fcntrcode = '{$this->college_code}'
and ifnull(a.FDELETED, '') <> 'T'
and a.fpresent = 'P'
and ifnull(a.fhallno,'') <> ''
and ifnull(a.fpassmth,'') = ''
and absent.fregno is null
group by sub.FDOE,
sub.FQPCODE,
sub.FSESSION
order by sub.FDOE,
sub.FSESSION,
sub.fqpcode";
// var_dump($get_daliy_present_data);
// die();
$lobj_get_daliy_present_data = $this->aobj_context->mobj_db->GetAll($get_daliy_present_data);
$get_daliy_absent_data= " select deg.fexamname, a.FQPCODE,date_format(a.FDOE,'%d/%m/%Y') as doe_name,
sub.FSESSION,upper(a.FABSTYPE) as type,
if('$this->funivcode' = '055',sub.FSUBNAME,concat(sub.FSUBNAME, space(2), '( ',sub.FSSUBNAME,' )')) as subject_desp,
GROUP_CONCAT(distinct a.FREGNO order by a.fregno SEPARATOR ' ') as FREGNO,COUNT(DISTINCT a.FREGNO) AS reg_cnt
from absent a
inner join subject sub on
sub.FQPCODE=a.FQPCODE and left(a.FABSTYPE,2)='QP'
inner join degree deg on sub.fdegree = deg.fdegree and sub.fexamno = deg.fexamno
inner join student st
on a.FREGNO = st.fregno
where
a.FDOE>='{$this->date_start}' and a.FDOE<='{$this->date_end}'
and a.FQPCODE>='{$this->qp_code_start}' and a.FQPCODE<='{$this->qp_code_end}'
and a.FSESSION in({$this->session})
and a.FCOLLCODE='{$this->college_code}'
and ifnull(a.FDELETED,'') <> 'T' and a.FCOLLCODE='{$this->college_code}'
group by a.FDOE,a.FQPCODE,a.FABSTYPE,a.FSESSION
order by a.FDOE, a.FSESSION, a.fqpcode, a.FABSTYPE";
// var_dump($get_daliy_absent_data);
// die();
$lobj_get_daliy_absent_data = $this->aobj_context->mobj_db->GetAll($get_daliy_absent_data);
//echo "<pre>".$get_daliy_absent_data;die();
$this->unique_page_arr=array();
$this->qp_code_arr=array();
foreach($lobj_get_daliy_absent_data as $ak=>$av)
{
if($av['type']=='QPA')
{
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['det']['QPA']['cnt']=$av['reg_cnt'];
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['det']['QPA']['FREGNO']=$av['FREGNO'];
}
if($av['type']=='QPM')
{
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['det']['QPM']['cnt']=$av['reg_cnt'];
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['det']['QPM']['FREGNO']=$av['FREGNO'];
}
$this->qp_code_arr[$av['FQPCODE']]=$av['subject_desp'];
}
foreach($lobj_get_daliy_data as $ak=>$av)
{
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['bund']['FNOBUNDLE']=$av['FNOBUNDLE'];
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['bund']['FTOTSCRIPT']=$av['FTOTSCRIPT'];
$this->qp_code_arr[$av['FQPCODE']]=$av['subject_desp'];
}
foreach($lobj_get_daliy_present_data as $ak=>$av)
{
//var_dump($av['fbatch']);
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['det']['QPP']['cnt']=$av['reg_cnt'];
//var_dump($av['fbatch']);
$this->unique_page_arr[$av['doe_name']][$av['FQPCODE']][$av['FSESSION'].', Semester : '.$av['fexamname']]['det']['QPP']['FREGNO']=$av['FREGNO'];
$this->qp_code_arr[$av['FQPCODE']]=$av['subject_desp'];
}
// echo "<pre>";
// print_r($this->unique_page_arr);die();
}
function formData()
{
//var_dump($this->unique_page_arr);
foreach($this->unique_page_arr as $date_k=>$date_v)
{
$this->doe=$date_k;
foreach($date_v as $qp_codek=>$qp_code_v)
{
$this->qp_code=$qp_codek;
$this->qp_name=$this->qp_code_arr[$this->qp_code];
foreach($qp_code_v as $sessk=>$sessv)
{
//var_dump($sessv['det']['QPP']['fbatch']);
$this->session_name=str_replace('PM','Afternoon',str_replace('AM','Morning Session',$sessk));
/* if(substr($this->session_name,0,2)=="AM")
$this->session_name="Morning( Batch : ".$sessv['det']['QPP']['fbatch'].")";
else
$this->session_name="After Noon( Batch : ".$sessv['det']['QPP']['fbatch'].")";
*/ $this->FDOE=$sessv['FDOE'];
$this->pdf->AddPage();
$this->pdf->SetFont('Times','',10);
/* $this->pdf->Cell(180,5,"QP Code : {$this->qp_code} - {$this->qp_name}","0",1,"C");
$this->pdf->Cell(180,5,"Date of Examination : {$this->doe}","0",1,"C");
$this->pdf->Cell(180,5,"Session : {$this->session_name}","0",1,"C");
$this->pdf->ln(1);
$new_y=$this->pdf->GetY();
$this->pdf->SetDash(1, .3);
$this->pdf->Line(5,$new_y, 203,$new_y);
$this->pdf->Line(5,$new_y+.5, 203,$new_y+.5);
$this->pdf->ln(4);*/
if($sessv['bund']['FNOBUNDLE'] != '')
{
$this->pdf->SetFont('Times','',10);
$this->pdf->Cell(15,6,'','0',0,'L');
$this->pdf->Cell(80,6,'Total Number of Bundles','LT',0,'L');
$this->pdf->Cell(95,6,$sessv['bund']['FNOBUNDLE'],'1',1,'C');
$this->pdf->Cell(15,6,'','R',0,'L');
$this->pdf->Cell(80,6,'Total Number of Scripts','LB',0,'L');
$this->pdf->Cell(95,6,$sessv['bund']['FTOTSCRIPT'],'1',1,'C');
}
//total_present
$this->pdf->ln(2);
$cnt=$sessv['det']['QPP']['cnt'];
$FREGNO=$sessv['det']['QPP']['FREGNO'];
$explode_arr=explode(" ",$FREGNO);
$chnk_cnt=count(array_chunk($explode_arr, 8))*1;
if($chnk_cnt<6)
$chnk_cnt=6;
$this->pdf->Cell(15,6,'','0',0,'L');
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(80,6,'Total Present','1',0,'L');
$this->pdf->Cell(95,6,$cnt,'1',1,'C');
$this->pdf->Cell(15,6,'','R',0,'L');
$this->pdf->SetFont('Courier','',10);
$this->pdf->MultiCell(175,$chnk_cnt,$FREGNO,1,"L");
//total_abs
$this->pdf->ln(2);
$cnt=$sessv['det']['QPA']['cnt'];
$FREGNO=$sessv['det']['QPA']['FREGNO'];
$explode_arr=explode(" ",$FREGNO);
$chnk_cnt=count(array_chunk($explode_arr, 8))*1;
if($chnk_cnt<6)
$chnk_cnt=6;
$this->pdf->Cell(15,6,'','0',0,'L');
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(80,6,'Total Absent','1',0,'L');
$this->pdf->Cell(95,6,$cnt,'1',1,'C');
$this->pdf->Cell(15,6,'','R',0,'L');
$this->pdf->SetFont('Courier','',10);
if($FREGNO == '')
$this->pdf->MultiCell(175,$chnk_cnt,"NILL",1,"L");
else
$this->pdf->MultiCell(175,$chnk_cnt,strtoupper($FREGNO),1,"L");
//total_abs
$this->pdf->ln(2);
$cnt=$sessv['det']['QPM']['cnt'];
$FREGNO=$sessv['det']['QPM']['FREGNO'];
$explode_arr=explode(" ",$FREGNO);
$chnk_cnt=count(array_chunk($explode_arr, 9))*1;
if($chnk_cnt<6)
$chnk_cnt=6;
$this->pdf->Cell(15,6,'','0',0,'L');
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(80,6,'Total Mal-practice','1',0,'L');
$this->pdf->Cell(95,6,$cnt,'1',1,'C');
$this->pdf->Cell(15,6,'','R',0,'L');
$this->pdf->SetFont('Courier','',10);
if($FREGNO == '')
$this->pdf->MultiCell(175,$chnk_cnt,"NILL",1,"L");
else
$this->pdf->MultiCell(175,$chnk_cnt,strtoupper($FREGNO),1,"L");
if($this->funivcode == '050' || $this->funivcode == '055')
{
//$this->SetY(-20);
$this->pdf->Ln(10);
$new_y=$this->pdf->GetY();
$this->pdf->SetDash(1, .3);
$this->pdf->Cell(0,6,'Certified that the number shown have been verified and found correct','',0,'C');
$this->pdf->Line(12,$new_y, 203,$new_y);
$this->pdf->SetFont('Times','B',10);
$this->pdf->Ln(20);
$this->pdf->Cell(0,6,'Deputy Chief Superintendent','',0,'L');
if($this->funivcode == '055')
$this->pdf->Cell(0,6,'Chief Superintendent / Controller of Examination','',1,'R');
else
$this->pdf->Cell(0,6,'Chief Superintendent','',1,'R');
}
}
}
}
}
function SendOutput()
{
$this->pdf->Output("daily_report.pdf","I");
}
}
function generateDaliyReportQpNitte($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new DownloadExamAppFormApplications();
$class_obj->AliasNbPages();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->formcolldata();
$class_obj->GetAllSubjects();
$class_obj->formData();
$class_obj->SendOutput();
}
?>
|