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.116.86.134
<?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);
$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->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,100);
$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,30,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,52,22,10);
}
$pdf->Cell(0,4,'',0,1,'C');
$pdf->SetFont('Times','',8);
$pdf->Cell(0,4,'' ,'0',1,'C');
$pdf->SetFont('Times','B',11);
$pdf->Ln(3);
$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,6,' Application No.','1',0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(122,6,''.$reg_v[APP_NO],'TBR',0,'L');$pdf->Cell(30,6,'','TR',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(27,6,' Candidate Name','1',0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(122,6,''.$reg_v[FFNAME],'TBR',0,'L'); $pdf->Cell(30,6,'','R',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(27,6,' Exam Date','1',0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(122,6,' Sunday, 5th July 2015','TBR',0,'L'); $pdf->Cell(30,6,'','R',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(27,6,' 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(25,6,' Application No.','0',0,'L'); $pdf->Cell(3,6,' : ',0,0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(20,6,''.$reg_v[APP_NO],'0',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(25,6,' Candidate Name','0',0,'L'); $pdf->Cell(3,6,' : ',0,0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(90,6,''.$reg_v[FFNAME],'0',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(25,$yHD,' Exam Date','0',0,'L'); $pdf->Cell(3,$yHD,' : ',0,0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell(20,$yHD,''.$reg_v[FEXAMDATE],'0',1,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(25,$yHD,' Exam Centre','0',0,'L'); $pdf->Cell(3,$yHD,' : ',0,0,'L');
$pdf->SetFont('Times','',9);
$pdf->MultiCell(90,6,' '. $reg_v[FCNTRNAME],'0','L');
*/
$pdf->Ln(2);
$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(80,6,$explode_arr[1].' '.$explode_arr[1],"1",0,"L");
$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,"Candidate reporting late will not be allowed for the exam.",0,"L");
$pdf->Cell(5,4,'2. ','0',0,'L');
$pdf->MultiCell(173,4,"Each candidate must show his Admit Card along with 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 carry the above mentioned Original photo identity proof, then he/ she will be not allowed to appear for 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 be disallowed.",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,'7. ','0',0,'L');
//$pdf->MultiCell(173,4,"Only bonafide candidates are allowed in the exam centre during the time slot allotted.",0,"L");
//$pdf->Cell(5,4,'8. ','0',0,'L');
//$pdf->MultiCell(173,4,"Personal belongings including mobile phones shall be kept outside the examination room at candidate's own risk. The candidates are advised not to bring valuables and any other personal belongings of high value while coming for the examinations and the examination center shall not be responsible in case the item is/ are lost or a theft occurs of such items which are brought to the examination centre.",0,"L");
$pdf->Cell(5,4,'6. ','0',0,'L');
$pdf->MultiCell(173,4,"Candidates are not allowed to access any unauthorized software/program 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 use only mouse during the examination.",0,"L");
//$pdf->Cell(5,4,'12. ','0',0,'L');
//$pdf->MultiCell(173,4,"Candidates should not attempt to download and/ or print the Question paper else it shall be treated as usage of unfair means.",0,"L");
//$pdf->Cell(5,4,'13. ','0',0,'L');
//$pdf->MultiCell(173,4,"Candidate should not impersonate others or allow others to impersonate him/her in the examination.",0,"L");
//$pdf->Cell(5,4,'14. ','0',0,'L');
//$pdf->MultiCell(173,4,"A candidate found using any unfair means including use of mobile phones or in possession of any incriminating material during the examination shall be expelled from the examination hall and his/her examination would be cancelled.",0,"L");
//$pdf->Cell(5,4,'15. ','0',0,'L');
//$pdf->MultiCell(173,4,"Candidates are not allowed to smoke or eat in the examination hall.",0,"L");
//$pdf->Cell(5,4,'16. ','0',0,'L');
//$pdf->MultiCell(173,4,"Rough sheet (if required) shall be provided to the candidates for carrying out rough workings during the examination. This sheet needs to be returned to the Invigilator before leaving the examination venue.",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,'18. ','0',0,'L');
//$pdf->MultiCell(173,4,"If any candidate wishes to take a bio break, he/she can do so after 30 minutes of commencement of the examination. However, the timer on the Exam Computer would continue to tick and the candidate would not be given any additional time to compensate for the time loss during the bio break. It is in their own interest that the candidates may limit their bio breaks to the minimum to avoid any loss of time.",0,"L");
//$pdf->Cell(5,4,'19. ','0',0,'L');
//$pdf->MultiCell(173,4,"Candidates shall bring their own pen, pencil and mathematical tables, as required and applicable.",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,'22. ','0',0,'L');
//$pdf->MultiCell(173,4,"Usage of calculators on Exam PCs will not be allowed.",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,'24. ','0',0,'L');
//$pdf->MultiCell(173,4,"The answer papers of the candidates, who change their allotted seats or any other documents at the Examination Hall, are liable to be cancelled.",0,"L");
//$pdf->Cell(5,4,'25. ','0',0,'L');
//$pdf->MultiCell(173,4,"Any candidate bringing any books, papers, notes etc. inside the Examination Hall (Except his/her Admit Slip. Identity Card and Time Table of examination) or using any other unfair means at the examination shall be expelled from the room by the Centre-In-Charge and such matter shall be reported to the Secretary, Examination Committee for further action which the Council may consider necessary.",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->Cell(5,4,'29. ','0',0,'L');
//$pdf->MultiCell(173,4,"Resorting to unfair means or trying to influence in any way for examination results shall be considered as a serious offence and any candidate found guilty of such offence on the report of any person duly authorized to conduct the examination, shall be liable to have his name removed from the list of candidates entered for the Examination and may also be further dealt with in such manner as the Council may deem fit.",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;
}
?>
|