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 : 3.138.125.143
<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
require_once($pdf_writer_class);
class report_ra_qp_wise_student_count extends FPDF
{
function DefaultConstructor($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$this->pdf= new FPDF();
$this->pdf=$this;
$this->qp_code_from=trim($this->aobj_context->mobj_data["qp_code_from"]);
$this->qp_code_to=trim($this->aobj_context->mobj_data["qp_code_to"]);
$this->ip=$_SERVER["REMOTE_ADDR"];
$get_date="select date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute) as now_date";
$obj=$this->aobj_context->mobj_db->GetRow($get_date);
$this->current_date=$obj[now_date];
$this->collcode=$_SESSION['collcode'];
}
function Header()
{
$img_path=$this->aobj_context->main_src.$this->photo_path;
if(!empty($this->photo_path) && file_exists($img_path))
{
$this->pdf->Image($img_path,166,50,50);
}
if(!empty($this->pdf_logo_path))
{
$img_logo_path=$this->aobj_context->main_src.$this->pdf_logo_path;
//echo $img_logo_path; die();
$this->pdf->Image($img_logo_path,10,10,20);
}
$this->pdf->SetFont('Times','B',15);
$this->pdf->cell(180,3,$this->FUNIVNAME."","0",1,"C");
$this->pdf->SetFont('Times','B',8);
$this->pdf->cell(180,7, $this->s_state,"0",1,"C");
$this->pdf->SetFont('Times','B',13);
$this->pdf->cell(180,7, $this->college_details,"0",1,"C");
$this->pdf->SetFont('Times','B',11);
$this->pdf->Cell(180,7,"QPwise Students count","0",1,"C");
$this->pdf->SetFont('Times','B',15);
$this->pdf->Cell(180,7," {$this->FEXAMDATE} Examination","0",1,"C");
$this->pdf->Ln(2);
$this->pdf->SetFont('Times','',13);
}
function Footer()
{
$this->SetY(-15);
$this->pdf->SetFont('Times','B',8);
//$this->Cell(140,6,'Entered : IP Address : '.$this->ip_address." Date ".$this->created_date,'0',0,'L');
$this->Cell(140,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',
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->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_data="SELECT c.FCOLLCODE,
CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
where c.FCOLLCODE='{$this->collcode}'";
$obj_student=$this->aobj_context->mobj_db->GetRow($get_data);
$this->college_details=$obj_student[FCOLLNAME];
$this->degree_details=" College : {$this->FCOLLNAME}";
}
function GetFullQry()
{
/* $get_data=" select FEXAMDATE,FQPCODE,FDOE,FSESSION,FSSUBNAME,sum(FCAPACITY) AS FCAPACITY from
(SELECT FEXAMDATE,s.FQPCODE,date_format(ra.FDOE,'%d/%m/%Y') as FDOE,ra.FSESSION,CONCAT(FSUBNAME,' ',FSSUBNAME) AS FSSUBNAME,
(FCAPACITY) AS FCAPACITY FROM room_allotment ra
INNER JOIN subject s ON s.FQPCODE=ra.FQPCODE
inner join degree d on d. FDEGREE=s.FDEGREE
WHERE FCOLLCODE='{$this->collcode}'
AND s.fqpcode between '{$this->qp_code_from}' and '{$this->qp_code_to}'
GROUP BY s.FQPCODE,FHALLNO)a
group by FQPCODE"; */
$get_data=" select d.FEXAMDATE, s.FQPCODE, s.FDOE, s.FSESSION, concat(s.fsubname, ' ', s.FSSUBNAME) as FSSUBNAME,
COUNT(c.FSUBCODE) AS FCAPACITY from degree d, subject s, canddet c, candsum m
where d.fdegree = s.fdegree and d.fexamno = s.fexamno
and s.fdegree = c.fdegree and s.fexamno = c.fexamno and s.fsubcode = c.fsubcode
and c.fregno = m.fregno and ifnull(frecptdate,'0000-00-00') <> '0000-00-00'
and c.fpresent = 'P' and ifnull(c.fpassmth,'') = '' and c.FCOLLCODE='{$this->collcode}'
AND s.fqpcode between '{$this->qp_code_from}' and '{$this->qp_code_to}'
group by FQPCODE order by FQPCODE";
$this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
$this->FEXAMDATE=$this->lobj_get_data[0]['FEXAMDATE'];
}function formData()
{
$this->pdf->SetMargins(10,12,10);
$this->pdf->AddPage();
$empty_cell_width=12;
$this->pdf->SetFont('Times','B',10);
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->cell(15,7, "Sl. No.","1",0,"C");
$this->pdf->cell(20,7, "QP Code","1",0,"C");
$this->pdf->cell(20,7, "Exam Date","1",0,"C");
$this->pdf->cell(20,7, "Session","1",0,"C");
$this->pdf->cell(85,7, "Subject Title","1",0,"C");
$this->pdf->cell(20,7, "Count","1",1,"C");
$this->pdf->SetFont('Times','',9);
$sl_no=1;
foreach($this->lobj_get_data as $dk => $dv)
{
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->cell(15,7, $sl_no,"1",0,"C");
$this->pdf->cell(20,7, $dv['FQPCODE'],"1",0,"C");
$this->pdf->cell(20,7, $dv['FDOE'],"1",0,"C");
$this->pdf->cell(20,7, $dv['FSESSION'],"1",0,"C");
$this->pdf->SetFont('Times','',8);
$this->pdf->cell(85,7, $dv['FSSUBNAME'],"1",0,"L");
$this->pdf->SetFont('Times','',9);
$this->pdf->cell(20,7, $dv['FCAPACITY'],"1",1,"C");
$sl_no++;
}
}
function SendOutput()
{
$this->pdf->Output("QPwise Students count.pdf","D");
}
}
function GenerateRAQPwiseStudentsCount($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new report_ra_qp_wise_student_count();
$class_obj->AliasNbPages();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->GetFullQry();
$class_obj->formcolldata();
$class_obj->formData();
$class_obj->SendOutput();
}
?>
|