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.145.83.149
<?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 AdmissionTicket
{
public $aobj_context;
public $center_code;
public $center_name;
public $subject_code;
public $subject_name;
public $app_no;
public $std_arr;
public $subject_arr;
function __construct($aobj_context)
{
$this->aobj_context=$aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$bth_flag=0;
}
function getCandidateDetails()
{
$get_subject_appearing = "SELECT s.app_no, s.ffname, m.fcntrname AS fcntrname,m.fcntraddr,
s.photo_path,s.sign_path, fpaystatus FROM student s
LEFT OUTER JOIN mascntr m ON s.fcntrcodefinal = m.fcntrcode
WHERE app_no = '{$this->app_no}' and fpaystatus='success'";
$this->lobj_get_studetails = $this->aobj_context->mobj_db->GetRow($get_subject_appearing);
$query ="update student set fdownload ='T'
where app_no = '{$this->app_no}'";
$rst= $this->aobj_context->mobj_db->Execute($query);
$this->std_arr['APP_NO']=$this->lobj_get_studetails['app_no'];
$this->std_arr['FFNAME']=$this->lobj_get_studetails['ffname'];
$this->std_arr['FCNTRNAME']=$this->lobj_get_studetails['fcntrname'];
$this->std_arr['FCNTRADDR']=$this->lobj_get_studetails['fcntraddr'];
$this->std_arr['photo_path']=$this->lobj_get_studetails['photo_path'];
$this->std_arr['sign_path']=$this->lobj_get_studetails['sign_path'];
$this->std_arr['fpaystatus']=$this->lobj_get_studetails['fpaystatus'];
$this->std_arr['coesign_path']="img/coe.jpg";
}
}
function generateAdmissionTicket($aobj_context)
{
$class_obj=new AdmissionTicket($aobj_context);
ini_set("memory_limit",-1);
ini_set('max_execution_time',3300);
$class_obj->app_no = $aobj_context->mobj_data["app_no"];
$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
$main_src=$main_src_obj[1];
$pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
include($pdf_writer_class);
$pdf= new FPDF();
$pdf->SetMargins(15,10,15);
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'AdmissionTicket';
$pdf->SetFillColor(248, 248 ,255);
$pdf->SetFont('Times','',10);
$pdf->AddPage();
$adm_details=$class_obj->getCandidateDetails();
$reg_v = $class_obj->std_arr;
$pdf->Ln(3);
$pdf->SetLineWidth(0.01);
$pdf->SetFont('Times','B',14);
$logo_path=$aobj_context->main_src."img/logo.jpg";
if(file_exists($logo_path))
$pdf->Image($logo_path,15,10,120);
$img_path=$aobj_context->main_src.$reg_v['photo_path'];
if(!empty($reg_v['photo_path']) && file_exists($img_path))
{
$pdf->Image($img_path,168,33,22,22);
}
$img_path=$aobj_context->main_src.$reg_v['sign_path'];
if(!empty($reg_v['sign_path']) && file_exists($img_path))
{
$pdf->Image($img_path,168,55,22,10);
}
$pdf->Cell(0,4,'',0,1,'C');
$pdf->SetFont('Times','',8);
$pdf->Cell(0,4,'' ,'0',1,'C');
$pdf->Ln(5);
$pdf->SetFont('Times','B',14);
$pdf->Cell(0,5,'ADMIT CARD ' ,'0',1,'C');
$pdf->SetFont('Times','',10);
$pdf->Ln(1);
$pdf->SetFont('Times','',10);
$nbH =0;
$nbH=max($nbH,NbLines(122,$reg_v['FCNTRADDR'],$pdf));
$yHD = 4*$nbH;
$pdf->SetLineWidth(.35);
$pdf->SetFont('Times','B',9);
$pdf->Cell(27,7,' Application No.','1',0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(122,7,''.$reg_v['APP_NO'],'TBR',0,'L');$pdf->Cell(30,7,'','TR',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(27,7,' Candidate Name','1',0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(122,7,''.$reg_v['FFNAME'],'TBR',0,'L'); $pdf->Cell(30,7,'','R',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(27,7,' Exam Date','1',0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(122,7,' Sunday, 26th June 2016','TBR',0,'L'); $pdf->Cell(30,7,'','R',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(27,7,' Exam Centre','LR',0,'L');
$addr_arr=$reg_v['FCNTRADDR'];
$addr_arr=explode("~",$addr_arr);
$pdf->Cell(122,6,' '.$addr_arr[0],'LR',0,'L');
$pdf->Cell(30,6,'','LR',1,'L');
$pdf->SetFont('Times','',9);
//Draw the border
$pdf->Cell(27,$yHD,'','LR',0,'L');
$x=$pdf->GetX();
$y=$pdf->GetY();
$pdf->MultiCell(122,4,$addr_arr[1],0,'L');
$pdf->SetXY($x+122,$y);
$pdf->SetFont('Times','',9);
$pdf->Cell(30,$yHD,'','LR',1,'L');
$pdf->Cell(27,3,'','LRB',0,'L');
$pdf->Cell(122,3,'','LRB',0,'L');
$pdf->Cell(30,3,'Candidate Signature','LRB',1,'L');
$pdf->Ln(4);
$pdf->SetFont('Times','B',9);
$pdf->Cell(20,6,"Seat No.","1",0,"C");
$pdf->Cell(98,6,"Programmes","1",0,"L");
$pdf->Cell(31,6,"Session","1",0,"C");
$pdf->Cell(30,6,"Inv. Sign","1",1,"C");
$pdf->SetFont('Times','',9);
if($class_obj-> fpaystatus = 'success')
{
$sql_studSubject = "select sd.frollno, sd.fsubcode, s.fsession,s.fsubname from stud_det sd inner join subject s
where sd.app_no = '{$class_obj->app_no}' and ifnull(sd.frollno,'') <> '' and s.fsubcode = sd.fsubcode order by s.fsescode asc ";
$lobj_sql_studSubject = $aobj_context->mobj_db->GetAll($sql_studSubject);
foreach($lobj_sql_studSubject as $subkey => $subval)
{
$nb =0;
$nb=max($nb,NbLines(98,$subval['fsubname'],$pdf));
$yH = 6*$nb;
$pdf->Cell(20,$yH,$subval[frollno],"1",0,"C");
$x=$pdf->GetX();
$y=$pdf->GetY();
//Draw the border
$pdf->Rect($x,$y,98,$yH);
$pdf->MultiCell(98,6,$subval['fsubname'],0,'L');
$pdf->SetXY($x+98,$y);
$pdf->Cell(31,$yH,$subval['fsession'],"1",0,"C");
$pdf->Cell(30,$yH,'',"1",1,"C");
$sl_no++;
}
}
$pdf->ln(15);
$img_path=$aobj_context->main_src.$reg_v['coesign_path'];
$yAx = $pdf->GetY();
if(!empty($reg_v['coesign_path']) && file_exists($img_path))
{
$pdf->Image($img_path,150,$yAx-10,22,10);
}
$pdf->SetFont('Times','B',10);
$pdf->Cell(170,4,'Signature of Issuing Authority ','0',1,'R');
$pdf->ln(1);
$pdf->SetFont('Times','BU',10);
$pdf->Cell(25,6,'Instructions for Candidates','0',1,'L');
$pdf->ln(2);
$pdf->SetFont('Times','',10);
$pdf->Cell(5,4,'1. ','0',0,'L');
$pdf->MultiCell(173,4,"The candidates are required to be present at the examination venue at least one hour prior to the scheduled time of examination.",0,"L");
$pdf->Cell(5,4,'2. ','0',0,'L');
$pdf->MultiCell(173,4,"Each candidate must show his Admit Card along with any one of the following Original photo Identity Cards for admission to the Examination Hall and also shall produce these, on demand to the Centre-In-Charge or his authorized representative.",0,"L");
$pdf->Cell(12,4,'a) ','0',0,'R');
$pdf->Cell(5,4,'Passport','0',1,'L');
$pdf->Cell(12,4,'b) ','0',0,'R');
$pdf->Cell(5,4,'Driving License','0',1,'L');
$pdf->Cell(12,4,'c) ','0',0,'R');
$pdf->Cell(5,4,'Voter Identification card','0',1,'L');
$pdf->Cell(12,4,'d) ','0',0,'R');
$pdf->Cell(5,4,'Identity Card issued by the Institute where last / currently studying or studied','0',1,'L');
$pdf->Cell(5,4,'3. ','0',0,'L');
$pdf->MultiCell(173,4,"If any candidate fails to produce the above mentioned original photo identity proof, then he/ she will not be allowed to appear in the exam.",0,"L");
$pdf->Cell(5,4,'4. ','0',0,'L');
$pdf->MultiCell(173,4,"On arrival at the designated examination center on the examination date, the Invigilator would verify the admit card and the identity proof of the candidate and then allow access to examination terminal.",0,"L");
$pdf->Cell(5,4,'5. ','0',0,'L');
$pdf->MultiCell(173,4,"Candidates having identity mismatch will not be allowed.",0,"L");
$pdf->Cell(5,4,'6. ','0',0,'L');
$pdf->MultiCell(173,4,"Use as well as physical possession of Pager, Notes, Study Material, Mobile Phone, Digital Diary and other electronic gadgets/device, in any form is strictly prohibited. Any candidate found in possession of above gadgets during the exam will be dealt with under the clause 'resorting to adoption of unfair means in the examination' and the result of such candidates will be liable to be cancelled by the University.",0,"L");
$pdf->Cell(5,4,'6. ','0',0,'L');
$pdf->MultiCell(173,4,"Candidates are not allowed to access any unauthorized software/program on the computers during the examination.",0,"L");
$pdf->Cell(5,4,'7. ','0',0,'L');
$pdf->MultiCell(173,4,"Candidates to maintain complete silence during the examination & communication in any form between candidates or with outsiders is not permitted and it will be treated as malpractice.",0,"L");
$pdf->Cell(5,4,'8. ','0',0,'L');
$pdf->MultiCell(173,4,"Candidates are allowed to only use mouse during the examination.",0,"L");
$pdf->Cell(5,4,'9. ','0',0,'L');
$pdf->MultiCell(173,4,"No candidate shall be permitted to leave the Examination Hall/Room until the expiry of one hour from starting of the examination.",0,"L");
$pdf->Cell(5,4,'10. ','0',0,'L');
$pdf->MultiCell(173,4,"Candidates are allowed to use their own battery operated non-programmable calculators in the Examination Hall.",0,"L");
$pdf->Cell(5,4,'11. ','0',0,'L');
$pdf->MultiCell(173,4,"Candidates must sign the Attendance Log and for each paper in which they are appearing. The paper(s) without the candidate's signature in the Attendance Log shall be liable to cancellation.",0,"L");
$pdf->Cell(5,4,'12. ','0',0,'L');
$pdf->MultiCell(173,4,"ROUGH WORKS is to be done on the specified pages given by the Institute. Candidate should write his/her Seat No. on the page given for ROUGH WORKS. This sheets need to be returned to the invigilator before leaving the examination venue",0,"L");
$pdf->Cell(5,4,'13. ','0',0,'L');
$pdf->MultiCell(173,4,"Failure by candidate to observe any of the instructions mentioned herein or use of any unfair means during the continuance of his / her examination will render the candidate liable to disqualification from the examination or other penalty as determined by University authorities.",0,"L");
$pdf->Cell(5,4,'14. ','0',0,'L');
$pdf->MultiCell(173,4,"With regard to conduct of examination, the decision of Centre - In - Charge shall be final and binding.",0,"L");
$pdf->ln(4);
$pdf->SetFont('Times','BU',10);
$pdf->Cell(8,6,'Note','0',0,'L');
$pdf->SetFont('Times','',10);
$pdf->Cell(5,6,':','0',0,'L');
$pdf->Cell(120,6,'For detailed instructions, please visit CUG Admission Web page ','0',1,'L');
$pdf->ln(2);
$pdf->Output("report_adm_ticket.pdf","D");
}
function NbLines($w,$txt,$pdf)
{
//Computes the number of lines a MultiCell of width w will take
$cw=&$pdf->CurrentFont['cw'];
if($w==0)
$w=$pdf->w-$pdf->rMargin-$pdf->x;
$wmax=($w-2*$pdf->cMargin)*1000/$pdf->FontSize;
$s=str_replace("\r",'',$txt);
$nb=strlen($s);
if($nb>0 and $s[$nb-1]=="\n")
$nb--;
$sep=-1;
$i=0;
$j=0;
$l=0;
$nl=1;
while($i<$nb){
$c=$s[$i];
if($c=="\n"){
$i++;
$sep=-1;
$j=$i;
$l=0;
$nl++;
continue;
}
if($c==' ')
$sep=$i;
$l+=$cw[$c];
if($l>$wmax){
if($sep==-1){
if($i==$j)
$i++;
} else
$i=$sep+1;
$sep=-1;
$j=$i;
$l=0;
$nl++;
} else
$i++;
}
return $nl;
}
?>
|