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 : 18.219.158.84
<?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);
class batch_wise_detail_report extends FPDF
{
public $aobj_context;
public $college_name;
public $town;
public $address;
public $Degree_name;
function Default_construstor($aobj_context)
{
require_once($aobj_context->main_src.'src/format.php');
$this->aobj_context=$aobj_context;
$this->collcode=$_SESSION['collcode'];
include($this->pdf_writer_class);
session_start();
$this->report_id = $aobj_context->mobj_data["report_id"];
//DIE();
$this->degree = $aobj_context->mobj_data['degree'];
$this->degree_name = $aobj_context->mobj_data['degree_name'];
//echo $this->degree_name;die();
$this->exam = $aobj_context->mobj_data['exam'];
//var_dump($aobj_context);
$this->subject = $aobj_context->mobj_data["sub"];
//var_dump($aobj_context->mobj_data["sub"]);
$this->sub_name = $aobj_context->mobj_data["sub_name"];
//var_dump($this->sub_name);
$this->from_batch= $aobj_context->mobj_data["from_batch"] ;
$this->to_batch= $aobj_context->mobj_data["to_batch"] ;
$this->fs_sub_name= $aobj_context->mobj_data["fs_sub_name"] ;
$this->pdf= new FPDF();
$this->pdf=$this;
$get_date_time="SELECT DATE_FORMAT(now(),'%d-%b-%Y %H:%m %r') as dt";
$ob_dt = $this->aobj_context->mobj_db->GetRow($get_date_time);
$this->date_time=$ob_dt[dt];
}
function Header()
{
$page_header_college ="select concat(FTOWN,', ',FUNIVADD1) as address,FUNIVNAME as college_name ,
pdf_logo_path as pdf_logo_path from control ";
//echo $page_header_college;die();
$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college);
$this->coll_name = $lobj_page_header_college['college_name'];
$this->address = $lobj_page_header_college['address'];
$this->pdf_logo_path = $this->aobj_context->main_src."/".$lobj_page_header_college['pdf_logo_path'];
$get_college_name="select concat(FCOLLNAME,', ',FTOWN) as col_name from college where FCOLLCODE='{$this->collcode}'";
$this->lobj_get_college_name = $this->aobj_context->mobj_db->GetRow($get_college_name);
$this->col_name=$this->lobj_get_college_name['col_name'];
$get_exam_date="select FEXAMDATE as exam_date,FEXAMNAME from degree where FDEGREE='{$this->degree}' and fexamno = '{$this->exam}'";
$this->lobj_get_exam_date = $this->aobj_context->mobj_db->GetRow($get_exam_date);
$this->exam_date=$this->lobj_get_exam_date['exam_date'];
$this->FEXAMNAME=$this->lobj_get_exam_date['FEXAMNAME'];
$query = "select FSSUBNAME from subject where fcsubcode = '{$this->subject}' and fdegree = '{$this->degree}' and fexamno = '{$this->exam}'";
$this->results = $this->aobj_context->mobj_db->GetRow($query);
//var_dump($this->results);
$this->fs_sub_name = $this->results['FSSUBNAME'];
$this->pdf->SetFont('Times','B',14);
$this->pdf->Cell(190,4,$this->coll_name,0,1,'C');
$this->pdf->SetFont('Times','',8);
$this->pdf->Cell(180,4,$this->address,0,0,'C');
$this->pdf->SetFont('Times','B',12);
$this->pdf->Cell(-20,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'C');
$this->pdf->Ln(1);
$this->pdf->SetFont('Times','B',11);
$this->pdf->Cell(200,4,"College : ".$this->collcode." ".$this->col_name,0,1,'C');
$this->pdf->Ln(1);
$this->pdf->SetFont('Times','B',12);
$this->pdf->Cell(190,6,"Degree : "." ".$this->degree." - ".$this->degree_name .", Exam : {$this->FEXAMNAME} - ".$this->exam_date,0,1,'C');
$this->pdf->Ln(1);
$this->pdf->Cell(190,6,"Subject : "." ".$this->subject." - ".$this->sub_name ."(". $this->fs_sub_name.")",0,1,'C');
$this->pdf->Ln(1);
$this->pdf->SetFont('Times','BU',12);
$this->pdf->Cell(190,6,' Batchwise Student List',0,1,'C');
if(file_exists($this->pdf_logo_path))
{
$this->pdf->Image($this->pdf_logo_path,5,7,20);
}
}
function GenerateBatchSetupDetails()
{
}
function GetQuery()
{
$get_records = "select lpad(mak.FBATCH,2,'0') as FBATCH_NO ,group_concat( distinct stu.FREGNO order by stu.FREGNO) AS FBATCH,
sub.FCSUBCODE,FSUBNAME,FSSUBNAME,
count( distinct stu.FREGNO) as batch_cnt
FROM student stu inner join marks_pr mak ON stu.FREGNO=mak.FREGNO
and mak.Fdegree='{$this->degree}' and mak.Fexamno='{$this->exam}' and mak.FCOLLCODE='{$this->collcode}'
inner join subject sub on sub.FCSUBCODE = mak.FSUBCODE
and sub.FCSUBCODE='{$this->subject}'
and mak.FBATCH>='{$this->from_batch}' and mak.FBATCH<='{$this->to_batch}' and sub.FDEGREE='{$this->degree}' and sub.FEXAMNO='{$this->exam}'
WHERE stu.FREGNO != '' and IFNULL(mak.FBATCH, '0')>0
group by mak.FBATCH order by lpad(mak.FBATCH,2,'0') ";
//var_dump($get_records);
$this->aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=10000");
$this->lobj_get_records = $this->aobj_context->mobj_db->GetAll($get_records);
$this->pdf->SetMargins(10,12);
$this->pdf->AddPage();
foreach($this->lobj_get_records as $k=>$v)
{
$FBATCH_NO=$v[FBATCH_NO];
$batch_cnt=$v[batch_cnt];
$FBATCH=$v[FBATCH];
$this->subject=$v[FCSUBCODE];
$this->sub_name=$v[FSUBNAME];
$this->fs_sub_name=$v[FSSUBNAME];
$FBATCH_arr=(explode(",",$FBATCH));
$get_exam_time="select date_format(FEXAMDATE,'%d/%m/%Y') as exam_dt,FEXAMTIME as exam_time from practical_entry_freeze
where FCOLLCODE='{$this->collcode}' and FDEGREE='{$this->degree}' and FEXAM='{$this->exam}'
and FBATCH={$FBATCH_NO} and FCSUBCODE='{$this->subject}'";
//var_dump($get_exam_time);
// echo $get_exam_time;die();
$this->lobj_get_exam_time = $this->aobj_context->mobj_db->GetRow($get_exam_time);
$exam_dt=$this->lobj_get_exam_time[exam_dt];
$exam_time=$this->lobj_get_exam_time[exam_time];
$count=0;
$this->pdf->SetFont('Times','B',10);
$this->pdf->Ln(5);
$this->pdf->Cell(0,8,"Batch ".$FBATCH_NO." (No. of Students : {$batch_cnt}) Date : {$exam_dt} Time : {$exam_time} ",0,1,'L');
$this->pdf->SetFont('Times','',10);
$data_set_count =count($FBATCH_arr);
for($i=0;$i<$data_set_count;$i++)
{
if($count==6)
{
$this->pdf->Ln(6);
$count=0;
}
$this->pdf->Cell(30,6,$FBATCH_arr[$i],1,0,'C');
//$this->pdf->Cell(30,4,$FBATCH_NO,1,0,'C');
$count++;
}
}
$this->pdf->Ln(10);
/* $this->pdf->SetFont('Arial','',9);
$this->pdf->Cell(35,6,'',"",0,'C');
$this->pdf->Cell(30,6,'Examiner - 01',"",0,'C');
$this->pdf->Cell(30,6,'Examiner - 02',"",0,'C');
$this->pdf->Cell(30,6,'Examiner - 03',"",0,'C');
$this->pdf->Cell(30,6,'Examiner - 04',"",1,'C');
$this->pdf->Cell(8,6,'',"",0,'C');
$this->pdf->Cell(25,6,'Name',"",0,'L');
$this->pdf->Cell(3,6,':',"",1,'C');
$this->pdf->Cell(8,6,'',"",0,'C');
$this->pdf->Cell(25,6,'College / Degn',"",0,'L');
$this->pdf->Cell(3,6,':',"",1,'C');
$this->pdf->Cell(8,6,'',"",0,'C');
$this->pdf->Cell(25,6,'Signature',"",0,'L');
$this->pdf->Cell(3,6,':',"",1,'C');
$this->pdf->Cell(8,6,'',"",0,'C');
$this->pdf->Cell(25,6,'Date & Time',"",0,'L');
$this->pdf->Cell(3,6,':',"",0,'C');
$this->pdf->Cell(50,3,$pdf->date_time,'0',1,'L'); */
}
function Footer()
{
$this->pdf->SetFont('Arial','',8);
$this->pdf->setY(-20);
$this->pdf->Cell(90,3,'Printed Date & Time: '.$this->date_time,'0',0,'L');
}
function SendOutput()
{
$this->pdf->Output("Batch_wise_List_report{$this->report_id}.pdf","D");
}
}
function GenerateBatchSetupDetails($aobj_context)
{
//var_dump($aobj_context);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
//var_dump($aobj_context);
$class_obj=new batch_wise_detail_report();
$class_obj->AliasNbPages();
$class_obj->Default_construstor($aobj_context);
$class_obj->GetQuery();
//$class_obj->GenerateBatchSetupDetails();
$class_obj->SendOutput();
}
?>
|