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.14.66.242
<?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 ra_invigilators_dairy extends FPDF
{
function DefaultConstructor($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$this->pdf= new FPDF();
$this->pdf=$this;
$this->qp_code=trim($this->aobj_context->mobj_data["qp_code"]);
$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->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 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()
{
session_start();
$FUNIVCODE = $_SESSION['FUNIVCODE'];
if($FUNIVCODE == '031')
{
if(!empty($this->pdf_logo_path))
{
$img_logo_path=$this->aobj_context->main_src."/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->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;
$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,6, $this->s_state,"0",1,"C");
}
$this->pdf->SetFont('Times','B',12);
$this->pdf->cell(200,6, "Centre : $this->college_details ","0",1,"C");
$this->pdf->SetFont('Times','B',12);
if($FUNIVCODE == '005')
$this->pdf->Cell(180,6,"ATTENDANCE SHEET","0",1,"C");
else
$this->pdf->Cell(180,6,"INVIGILATOR'S DAIRY","0",1,"C");
$this->pdf->SetFont('Times','',11);
$this->pdf->Cell(180,6," {$this->FEXAMDATE} EXAMINATION","0",1,"C");
$this->pdf->SetFont('Times','',12);
$this->pdf->Cell(180,6," {$this->sub_details}","0",1,"C");
$this->pdf->Cell(180,6," {$this->exam_date}","0",1,"C");
$this->pdf->Ln(1);
$this->pdf->SetFont('Times','',12);
$empty_cell_width=12;
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->SetFont('Times','B',14);
$this->pdf->Cell(180,7,"Room No. : {$this->hall_no}","0",1,"L");
$this->pdf->SetFont('Times','B',12);
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->cell(15,7, "Sl. No.","1",0,"C");
$this->pdf->cell(20,7, "Reg. No.","1",0,"C");
$this->pdf->cell(80,7, "Name","1",0,"C");
$this->pdf->cell(28,7, "Ans. Book No.","1",0,"C");
$this->pdf->cell(28,7, "Signature","1",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');
}
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}";
$get_qp_details = "select FEXAMDATE,CONCAT(s.FSUBNAME,' ',s.FSSUBNAME) AS FSSUBNAME from subject s
inner join degree d on d. FDEGREE=s.FDEGREE and d.fexamno = s.fexamno
where s.FQPCODE='{$this->qp_code}'";
$obj_get_qp_details=$this->aobj_context->mobj_db->GetRow($get_qp_details);
$FSSUBNAME=$obj_get_qp_details['FSSUBNAME'];
$this->FEXAMDATE=$obj_get_qp_details['FEXAMDATE'];
$this->sub_details="Subject : {$this->qp_code} - {$FSSUBNAME} ";
$get_qp_data="SELECT distinct DATE_FORMAT(s.FDOE,'%d/%m/%Y') AS FDOE,s.FSESSION, r.fdescpn
FROM room_allotment ra inner join subject s on ra.fqpcode = s.fqpcode left outer join
reason r on s.fsession = r.freasoncd
WHERE ra.FCOLLCODE='{$this->collcode}' AND ra.FQPCODE='{$this->qp_code}'";
$obj_get_qp_data=$this->aobj_context->mobj_db->GetRow($get_qp_data);
$this->exam_date="Exam Date : {$obj_get_qp_data['FDOE']}, {$obj_get_qp_data['fdescpn']} ";
}
function GetFullQry()
{
$get_data="SELECT FHALLNO,cd.FREGNO,st.FNAME,masroom.froomname
FROM canddet cd INNER JOIN subject s ON s.fdegree = cd.fdegree and s.fexamno = cd.fexamno
and s.FSUBCODE=cd.FSUBCODE
inner join candsum cs on cs.FREGNO=cd.FREGNO AND cd.FDEGREE=cs.FDEGREE
AND cd.FCOLLCODE=cs.FCOLLCODE
inner join student st on st.FREGNO=cd.FREGNO AND cd.FCOLLCODE=st.FCOLLCODE
LEFT JOIN masroom ON masroom.froomno = FHALLNO and masroom.fcollcode = cs.FCOLLCODE
WHERE cs.FCNTRCODE='{$this->collcode}' and s.ftheory = 'T' and ifnull(s.fintass,'') <> 'T'
and ifnull(s.fretain,'') <> 'T'
and TRIM(FQPCODE)='{$this->qp_code}' and ifnull(cd.FHALLNO,'') <> ''
AND lpad(cd.FHALLNO,3,'0') between '{$this->room_range_from}' and '{$this->room_range_to}'
and FPRESENT='P' and ifnull(cd.fpassmth,'') = '' and ifnull(FRECPTDATE,'0000-00-00')<>'0000-00-00'
order by FHALLNO,cd.FREGNO";
$this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
$this->final_data_arr=array();
$this->hallname= array();
$c=0;
foreach($this->lobj_get_data as $ak=>$av)
{
$this->final_data_arr[$av['FHALLNO']][$av['FREGNO']]['FREGNO']=$av['FREGNO'];
$this->final_data_arr[$av['FHALLNO']][$av['FREGNO']]['FNAME']=$av['FNAME'];
// To display room name 12/11/2016
$this->hallname[$av['FHALLNO']] = $av['froomname'];
$c++;
}
}
function WriteSlNoRow()
{
}
function formData()
{
session_start();
$FUNIVCODE = $_SESSION['FUNIVCODE'];
$this->pdf->SetMargins(10,12,10);
$empty_cell_width=12;
$this->pdf->SetFont('Times','B',10);
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$cnt=0;
// echo "<pre>";
//print_r($this->final_data_arr);die();
foreach($this->final_data_arr as $hallk=>$hallv)
{
// To display room name 12/11/2016
$this->hall_no = $this->hallname[$hallk];
$this->pdf->AddPage();
$sl_no=1;
$c=1; $t_s=0;
$this->pdf->SetFont('Times','',12);
$cnt=0;
foreach($hallv as $hk=>$hv)
{
$cnt++;
if($cnt > 30)
{
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->Cell(180,7,"End of Room No. {$hallk}, Total Students : {$t_s}","0",1,"L");
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
if($FUNIVCODE != '005')
$this->pdf->Cell(180,7,"Total no. of students present : _________ Total no of students absent : _________","0",1,"L");
$this->pdf->Ln(6);
$this->pdf->Cell(180,7,"Name & Signature of the Invigilator ","0",1,"R");
$this->hall_no=$this->hallname[$hallk];
$this->pdf->AddPage();
$cnt = 1;
$t_s=0;
}
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->cell(15,6, $sl_no,"1",0,"C");
$this->pdf->cell(20,6, $hv['FREGNO'],"1",0,"C");
$this->pdf->cell(80,6, $hv['FNAME'],"1",0,"L");
$this->pdf->cell(28,6, "","1",0,"C");
$this->pdf->cell(28,6, "","1",1,"C");
$c++;
$sl_no++;
$t_s+=1;
}
if($FUNIVCODE == "035")
{
$this->pdf->Ln(5);
if($this->pdf->GetY() > 160)
{
$this->pdf->AddPage();
}
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->SetFont('Times','B',11);
$this->pdf->cell(50,6, "Name of the Invigilator","1",0,"L");
$this->pdf->cell(121,6, "","1",1,"L");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(50,6, "Designation & Address","LR",0,"L");
$this->pdf->cell(121,6, "","LR",1,"L");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(50,6, "","LR",0,"L");
$this->pdf->cell(121,6, "","LR",1,"L");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(50,6, "","LRB",0,"L");
$this->pdf->cell(121,6, "","LRB",1,"L");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(50,6, "Serial No. of Answer","LRT",0,"L");
$this->pdf->cell(40,6, "From","1",0,"C");
$this->pdf->cell(40,6, "To","1",0,"C");
$this->pdf->cell(41,6, "Total","1",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(50,6, "Books Issued to Invigilator","LRB",0,"L");
$this->pdf->SetFont('Times','',12);
$this->pdf->cell(40,6, "","1",0,"C");
$this->pdf->cell(40,6, "","1",0,"C");
$this->pdf->cell(41,6, "","1",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Register No. of Candidates who arrived late","LRB",0,"L");
$this->pdf->cell(81,6, "","1",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Register No. of Candidates who left the ","LRT",0,"L");
$this->pdf->cell(81,6, "","LR",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Hall temporarily ","LRB",0,"L");
$this->pdf->cell(81,6, "","LRB",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Register No. of Candidates Involved in Malpractice","LR",0,"L");
$this->pdf->cell(81,6, "","LR",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "","LRB",0,"L");
$this->pdf->cell(81,6, "","LRB",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Register No. of Absentees","LR",0,"L");
$this->pdf->cell(81,6, "","LR",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "","LRB",0,"L");
$this->pdf->cell(81,6, "","LRB",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Total No. of Absentees","LRB",0,"L");
$this->pdf->cell(81,6, "","1",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Total No. of Candidates Answer Books handed","LR",0,"L");
$this->pdf->cell(81,6, "","LR",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "over to Chief - Superintendent","LRB",0,"L");
$this->pdf->cell(81,6, "","LRB",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "Serial No. of Blank Answer Books returned ","LRT",0,"L");
$this->pdf->cell(81,6, "","LR",1,"C");
$this->pdf->cell(12,6, "","0",0,"L");
$this->pdf->cell(90,6, "to Chief-Superintendent ","LRB",0,"L");
$this->pdf->cell(81,6, "","LRB",1,"C");
}
else
{
//$this->pdf->Cell(1,7,"","0",1,"l");;
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->Cell(180,7,"End of Room No. {$hallk}, Total Students : {$t_s}","0",1,"L");
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
if($FUNIVCODE != '005')
$this->pdf->Cell(180,7,"Total no. of students present : _________ Total no of students absent : _________","0",1,"L");
$this->pdf->Ln(6);
$this->pdf->Cell(180,7,"Name & Signature of the Invigilator ","0",1,"R");
}
}
}
function SendOutput()
{
$this->pdf->Output("Invigilators Dairy.pdf","D");
}
}
function GenerateInvigilatorsDairy($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new ra_invigilators_dairy();
$class_obj->AliasNbPages();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->GetFullQry();
$class_obj->formcolldata();
$class_obj->formData();
$class_obj->SendOutput();
}
?>
|