Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (!$_SESSION["applicant"])
- {
- Header("Location:../login.php");
- }
- require('fpdf.php');
- include ("../dbConfig.php");
- $app=$_SESSION["applicant"];
- $all="SELECT name, roll_number, photo_name, status FROM candidate WHERE application_number= '$app'";
- $result = mysql_query($all);
- while($rows=mysql_fetch_array($result))
- {
- $name=$rows['name'];
- $roll_number= $rows['roll_number'];
- $status= $rows['status'];
- $photo= $rows['photo_name'];
- }
- class PDF extends FPDF
- {
- function Header()
- {
- $this->Image('../images/kuet_icon.png',6,6,0);
- $this->SetFont('Arial','B',20);
- $this->Cell(80);
- $this->Cell(45,10,"Khulna University of Engineering & Technology",0,0,'C');
- $this->Ln(10);
- $this->Cell(80);
- $this->Cell(45,10,"Admit Card",0,0,'C');
- $this->Ln(20);
- }
- function Footer()
- {
- $this->SetY(-15);
- $this->SetFont('Arial','I',8);
- $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
- }
- }
- $pdf = new PDF();
- $pdf->AliasNbPages();
- $pdf->AddPage();
- //////
- $pdf->SetFont( 'Arial', '', 10 );
- $pdf->SetDrawColor( 00, 00, 00 );
- $pdf->SetTextColor(00,00,00 );
- $pdf->SetFillColor( 255,255,255 );
- $image1 = "../uploads/".$photo;
- $pdf->Cell( 43, 9,"Candidate's name", 1, 0, 'C', true );
- $pdf->Cell( 33, 9,$name, 1, 0, 'C', true );
- $pdf->Cell( 48, 56, $pdf->Image($image1, $pdf->GetX()+50, $pdf->GetY()-10,48, 56), 0, 0, 'L', false );
- $pdf->Ln( 9);
- $pdf->Cell( 43, 9,'Application number', 1, 0, 'C', true );
- $pdf->SetFont( 'Arial', 'B', 12 );
- $pdf->Cell( 33, 9,$_SESSION["applicant"], 1, 0, 'C', true );
- $pdf->Ln( 9);
- $pdf->SetFont( 'Arial', '', 10 );
- $pdf->Cell( 43,10,'Admission Roll number', 1, 0, 'C', true );
- $pdf->SetFont( 'Arial', 'B', 12 );
- $pdf->Cell( 33,10,$roll_number, 1, 0, 'C', true );
- $pdf->Ln(30);
- if($status == "9"){
- $pdf->SetFont('Arial','B',60);
- $pdf->Cell(0,15,"P ",0,1,'R');
- }
- if($status == "10"){
- $pdf->SetFont('Arial','B',60);
- $pdf->Cell(0,15,"T ",0,1,'R');
- }
- $pdf->SetFont( 'Arial', '', 10 );
- $pdf->Cell(0,15,"N.B: You must have to bring your admit card in the examination hall otherwise you're not allowed to seat for examination",0,1,'C');
- $pdf->Image('signature.jpg',140,110);
- $pdf->SetFont('Times','',12);
- $pdf->Ln(20);
- $pdf->Cell(0,8,"Vice Chancellor ",0,1,'R');
- $pdf->Cell(0,8,"Khulna University of Engineering & Technology ",0,1,'R');
- $pdf->Cell(0,8,"Khulna, Bangladesh. ",0,1,'R');
- $pdf->Output();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement