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.188.69.167
<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tcpdf/tcpdf.php";
require_once($pdf_writer_class);
include_once("stringspliter.php");
require_once("/var/www/html/aws/aws-autoloader.php");
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
ini_set('max_execution_time', 300);
ini_set("memory_limit","500M");
// $pdf_writer_class =$main_src."/maya-pdf/fpdf.php";
// require_once($pdf_writer_class);
class ra_invigilators_dairy extends TCPDF
{
function DefaultConstructor($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$this->pdf= new TCPDF();
$this->pdf=$this;
$this->fromdate=trim($this->aobj_context->mobj_data["fromdate"]);
// var_dump($this->dateto);die();
$this->fromqpcode=trim($this->aobj_context->mobj_data["fqpcode"]);
$this->toqpcode=trim($this->aobj_context->mobj_data["tqpcode"]);
$this->session=trim($this->aobj_context->mobj_data["session"]);
$this->room_range_from=trim($this->aobj_context->mobj_data["room_range_from"]);
$this->room_range_to=trim($this->aobj_context->mobj_data["room_range_to"]);
$this->rtype=trim($this->aobj_context->mobj_data["rtype"]);
$this->room_range_from=str_pad($this->room_range_from, 3, "0", STR_PAD_LEFT);
$this->room_range_to=str_pad($this->room_range_to, 3, "0", STR_PAD_LEFT);
$this->ip=$_SERVER["REMOTE_ADDR"];
$get_date="select now() as now_date";
$obj=$this->aobj_context->mobj_db->GetRow($get_date);
$this->current_date=$obj['now_date'];
$this->collcode=$_SESSION['collcode'];
$this->funivcode=$_SESSION['FUNIVCODE'];
$this->headeractive = true;
$this->startPageGroup();
}
function Header()
{
if($FUNIVCODE == '031')
{
if(!empty($this->pdf_logo_path))
{
$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,60,4,80);
$this->pdf->Ln(10);
}
}
else
{
// $img_path=$this->aobj_context->main_src. '/'.$this->aobj_context->mobj_data["db"].'/'.$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->aobj_context->mobj_data["db"].'/'.$this->pdf_logo_path;
$this->pdf->Image($img_logo_path,10,10,30);
}
$this->pdf->SetFont('Times','B',15);
$this->pdf->ln(3);
$this->pdf->cell(150,3,$this->FUNIVNAME."","0",1,"C");
$this->pdf->SetFont('Times','B',8);
$this->pdf->cell(150,6, $this->s_state,"0",1,"C");
}
$this->pdf->SetFont('Times','B',12);
$this->pdf->cell(150,6, "College : $this->college_details ","0",1,"C");
$this->pdf->SetFont('Times','B',12);
// if($FUNIVCODE == '005')
// $this->pdf->Cell(150,6,"ATTENDANCE SHEET","0",1,"C");
// else
$this->pdf->Cell(150,7,"Principal Freeze","0",1,"C");
$this->pdf->Cell(70,5,$this->date,"0",0,"L");
$this->pdf->Cell(10,5,$this->classid,"0",1,"C");
}
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');
$this->Cell(30, 6,'Page ' .$this->PageNo().'', 0, 1, 'R');
}
function formcolldata($fclassname,$classid, $date)
{
$get_coll_name="select FUNIVNAME as 'FUNIVNAME',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->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'];
$this->funivcode=$lobj_get_coll_name['FUNIVCODE'];
$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}";
// $this->date = " Date : {$date}";
// $this->classid = " Class Name : {$fclassname} ({$classid})";
}
function writepdf($data){
$pdf=$this->pdf;
$pdf->SetMargins(20,35,25,10);
$pdf->startPageGroup();
$pdf->AddPage("P");
// $pdf->SetMargins(10,12,10);
$empty_cell_width=12;
$pdf->SetFont('Times','B',10);
// var_dump($data,'fdgdg');
$this->pdf->cell(15,7, "Sl. No.","1",0,"C");
$this->pdf->cell(30,7, "USN","1",0,"C");
$this->pdf->cell(100,7, "Name","1",0,"C");
$this->pdf->cell(30,7, "Marks","1",1,"C");
$pdf->SetFont('Times','',12);
// $z=0;
$c = 1;
foreach($data as $key=>$value){
$y = $this->pdf->getY();
if($y >260)
{
$pdf->AddPage("P");
$empty_cell_width=12;
$pdf->SetFont('Times','B',10);
$this->pdf->cell(15,7, "Sl. No.","1",0,"C");
$this->pdf->cell(30,7, "USN","1",0,"C");
$this->pdf->cell(100,7, "Name","1",0,"C");
$this->pdf->cell(30,7, "Marks","1",1,"C");
$pdf->SetFont('Times','',12);
}
$this->pdf->cell(15,7, $c,"1",0,"C");
$this->pdf->cell(30,7, $value['fregno'],"1",0,"C");
$this->pdf->cell(100,7, $value['fname'],"1",0,"L");
$this->pdf->cell(30,7, $value['fmarks'],"1",1,"C");
$c++;
}
}
function SendOutput()
{
$this->pdf->Output("Principal_Freeze.pdf","I");
}
}
function principalFreeze_report($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = trim($aobj_context->mobj_data["univcode"]);
$college_code = $_SESSION['collcode'];
$subcode = $aobj_context->mobj_data["subcode"];
$teachcode = $aobj_context->mobj_data["teachcode"];
$classid = $aobj_context->mobj_data["classcode"];
$split = explode(" - ",$classid);
$classcode = $split[0];
$degree = $split[1];
$examno = $split[2];
$class_obj=new ra_invigilators_dairy();
$class_obj->DefaultConstructor($aobj_context);
$query = "select ifnull(m.fregno,'') as fregno,ifnull(m.FMARKS,'') as fmarks,ifnull(s.fname,'') as fname
from marks m
inner join collia c on m.fdegree = c.fdegree and m.fexamno = c.fexamno and m.fsubcode = c.fsubcode
inner join student s on m.fregno = s.fregno
where m.FSUBCODE = '{$subcode}' and m.fdegree = '{$degree}'
and m.fexamno = '{$examno}' and m.fcollcode = '{$college_code}' and c.ffreezed = 'T' and c.ffreezed2 = 'T'
group by fregno";
var_dump($query);
die();
$res1 = $aobj_context->mobj_db->GetAll($query);
$class_obj->formcolldata($res1[0]['fclassname'],$classid, $value['fdate']);
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
$class_obj->writepdf($lobj_get_data);
$class_obj->SendOutput();
}
?>
|