function Footer() { parent::Footer(); //Position at 1.5 cm from bottom global $user; $date = date("F j, Y:H:i:s A"); $report_data = 'Generated On ' . $date . ' Report by: ' . strtoupper($user) . ' Powered by Wizglobal Kenya Limited'; $this->SetY(-20); //Arial italic 8 $this->SetFont('Arial', 'I', 8); //Reprt date $this->Cell(0); $this->Cell(-380, 10, $report_data, 0, 0, 'C', 0); $this->Cell(50); $this->Cell(0, 10, $this->PageNo(), 0, 0, 'R', 0); }
public function Print_Registration_Form_Proofreading_Groupwise() { // DebugBreak(); $Condition = $this->uri->segment(4); $this->load->library('session'); $Logged_In_Array = $this->session->all_userdata(); $user = $Logged_In_Array['logged_in']; $this->load->model('Registration_model'); if ($Condition == "1") { $grp_cd = $this->uri->segment(3); $fetch_data = array('Inst_cd' => $user['Inst_Id'], 'grp_cd' => $grp_cd); $result = array('data' => $this->Registration_model->Print_Form_Groupwise($fetch_data), 'inst_Name' => $user['inst_Name']); } else { if ($Condition == "2") { $start_formno = $this->uri->segment(3); $end_formno = $this->uri->segment(5); $fetch_data = array('Inst_cd' => $user['Inst_Id'], 'start_formno' => $start_formno, 'end_formno' => $end_formno); $result = array('data' => $this->Registration_model->Print_Form_Formnowise($fetch_data), 'inst_Name' => $user['inst_Name']); //Print_Form_Formnowise } } $this->load->library('PDF_Rotate'); $pdf = new PDF_Rotate('P', 'in', "A4"); // $this->load->library('PDFF'); // $pdf=new PDFF('P','in',"A4"); $pdf->SetMargins(0.5, 0.5, 0.5); $grp_cd = $this->uri->segment(3); $fontSize = 10; $marge = 0.4; // between barcode and hri in pixel $x = 7.5; // barcode center $y = 1.2; // barcode center $height = 0.35; // barcode height in 1D ; module size in 2D $width = 0.013; // barcode height in 1D ; not use in 2D $angle = 0; // rotation in degrees $type = 'code128'; $black = '000000'; // color in hex // DebugBreak(); $result = $result['data']; //if(!empty($result)): foreach ($result as $key => $data) { //First Page ---class instantiation //$pdf = new FPDF_BARCODE("P","in","A4"); $pdf->AddPage(); $Y = 0.5; // DebugBreak(); // $pdf->SetFillColor(0, 0, 0); $pdf->SetDrawColor(0, 0, 0); //$code = $data['formNo']; // barcode (CP852 encoding for Polish and other Central European languages) //$bardata = Barcode::fpdf($pdf, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height); //$len = $pdf->GetStringWidth("12345678"); //Barcode::rotate(-$len / 2, ($bardata['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt); // added charest conversion to enable correct display of text encoded in barcode //$pdf->Image($x + $xt, $y + $yt, "12345678", $angle,10,"JPG"); $temp = $data['formNo'] . '@09@2016@1'; $image = $this->set_barcode($temp); //$pdf->Image($x + $xt, $y + $yt, "12345678", $angle,10,"JPG"); $pdf->Image(base_url() . 'assets/pdfs/' . '/' . $image, 6.0, 1.2, 1.8, 0.2, "PNG"); // $pdf->Image(base_url().'assets/pdfs/'.'/'.$image,6.3,0.5, 1.8, 0.20, "PNG"); $pdf->SetFont('Arial', 'U', 16); $pdf->SetXY(1.2, 0.2); $pdf->Cell(0, 0.2, "Board Of Intermediate and Secondary Education,Gujranwala", 0.25, "C"); $pdf->Image(base_url() . "assets/img/logo.jpg", 0.05, 0.2, 0.75, 0.75, "JPG", "http://www.bisegrw.com"); $pdf->SetFont('Arial', '', 10); $pdf->SetXY(1.7, 0.4); $pdf->Cell(0, 0.25, " REGISTRATION FORM FOR SSC/MATRIC SESSION 2016-2018", 0.25, "C"); $pdf->Image(base_url() . 'assets/img/PROOF_READ.jpg', 1, 3.5, 6, 4, "JPG"); //--------------- Proof Read $ProofReed = "(PROOF READ) (Not for Board) "; $pdf->SetXY(3, 0.8); $pdf->SetFont("Arial", '', 12); $pdf->Cell(0, 0.25, $ProofReed, 0, 'C'); //--------------------------- Form No & Rno $pdf->SetXY(0.2, 0.5 + $Y); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Form No: _______________", 0, 'L'); $pdf->SetXY(0.8, 0.5 + $Y); $pdf->SetFont('Arial', 'IB', 12); $pdf->Cell(0.5, 0.5, $data['formNo'], 0, 'L'); //--------------------------- Institution Code and Name $user['Inst_Id']. "-". $user['inst_Name'] $pdf->SetXY(0.2, 0.85 + $Y); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Institution Code/Name:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.75, 0.85 + $Y); $pdf->Cell(0.5, 0.5, $user['Inst_Id'] . "-" . $user['inst_Name'], 0, 'L'); //------ Picture Box on Centre $pdf->SetXY(7, $Y + 1.75); $pdf->Cell(1.25, 1.4, '', 1, 0, 'C', 0); // $exists = is_file(UPLOADS.$user->inst_cd.'/'.$data["PicPath"]); // if($exists) { // $img = "uploads/".$user->inst_cd."/".$data["PicPath"]; // $ext = "JPG"; // }else{ // $img = "images/no_image.png"; // $ext = "PNG"; // } // $pdf->Image( $img,7, 1.75+ $Y, 1.25, 1.4, $ext); $pdf->Image(base_url() . 'assets/uploads/' . $data["Sch_cd"] . '/' . $data["PicPath"], 7, 1.75 + $Y, 1.25, 1.4, "JPG"); $pdf->SetFont('Arial', '', 10); //------------- Personal Infor Box //==================================================================================================================== $x = 0.55; $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(0.2, 1.28 + $Y); $pdf->SetFillColor(240, 240, 240); $pdf->Cell(8, 0.3, 'PERSONAL INFORMATION', 1, 0, 'L', 1); $Y = 0.3; //--------------------------- 1st line $pdf->SetFont('Arial', '', 10); $pdf->SetXY(0.5, 1.65 + $Y); $pdf->Cell(0.5, 0.5, "Name:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, 1.65 + $Y); $pdf->Cell(0.5, 0.5, strtoupper($data["name"]), 0, 'L'); //--------------------------- FATHER NAME $pdf->SetXY(3.5 + $x, 1.65 + $Y); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Father Name:.", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(4.5 + $x, 1.65 + $Y); $pdf->Cell(0.5, 0.5, strtoupper($data["Fname"]), 0, 'L'); //--------------------------- 3rd line $pdf->SetXY(0.5, $Y + 2); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Date Of Birth:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, 2 + $Y); $pdf->Cell(0.5, 0.5, $data["Dob"], 0, 'L'); // $pdf->Cell(0.5,0.5,$data["Rel"]==1?"Muslim":"Non-Muslim",0,'L'); $pdf->SetXY(3.5 + $x, 2 + $Y); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Gender:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(4.5 + $x, 2 + $Y); $pdf->Cell(0.5, 0.5, $data["sex"] == 1 ? "MALE" : "FEMALE", 0, 'L'); //--------------------------- BAY FORM NO line $pdf->SetXY(0.5, $Y + 2.35); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Bay Form No:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, $Y + 2.35); $pdf->Cell(0.5, 0.5, $data["BForm"], 0, 'L'); $pdf->SetXY(3.5 + $x, $Y + 2.35); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Father CNIC:", 0, 'R'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(4.5 + $x, $Y + 2.35); $pdf->Cell(0.5, 0.5, $data["FNIC"], 0, 'L'); //--------------------------- $pdf->SetXY(0.5, $Y + 2.7); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Speciality:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, $Y + 2.7); $pdf->Cell(0.5, 0.5, $data["spl_cd"], 0, 'L'); $pdf->SetXY(3.5 + $x, $Y + 2.7); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Locality:", 0, 'R'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(4.5 + $x, $Y + 2.7); $pdf->Cell(0.5, 0.5, $data["RuralORUrban"] == 0 ? "Urban" : "Rural", 0, 'L'); //--------------------------- Gender Nationality $pdf->SetXY(0.5, $Y + 3.05); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Medium:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, $Y + 3.05); $pdf->Cell(0.5, 0.5, $data["med"] == 1 ? "Urdu" : "English", 0, 'L'); $pdf->SetXY(3.5 + $x, $Y + 3.05); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Nationality:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(4.5 + $x, $Y + 3.05); $pdf->Cell(0.5, 0.5, $data["nat"] == 1 ? "PAKISTANI" : "NON-PAKISTANI", 0, 'R'); //--------------------------- id mark and Medium $pdf->SetXY(0.5, $Y + 3.4); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Ident Mark:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, $Y + 3.4); $pdf->Cell(0.5, 0.5, $data["markOfIden"], 0, 'L'); $pdf->SetXY(3.5 + $x, $Y + 3.4); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Religion:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(4.5 + $x, $Y + 3.4); $pdf->Cell(0.5, 0.5, $data["rel"] == 1 ? "Muslim" : "Non-Muslim", 0, 'L'); // $pdf->Cell(0.5,0.5, $data["MobNo"],0,'L'); //----- Contact No. $pdf->SetXY(0.5, $Y + 3.75); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Mobile No:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, $Y + 3.75); $pdf->Cell(0.5, 0.5, $data["CellNo"], 0, 'L'); $pdf->SetXY(0.5, $Y + 4.1); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Address:", 0, 'L'); $pdf->SetFont('Arial', 'b', 10); $pdf->SetXY(1.5, $Y + 4.1); $pdf->Cell(0.5, 0.5, strtoupper($data["addr"]), 0, 'L'); //======================================== Exam Info =============================================================================== $sY = -1.2; //0.5; $pdf->SetXY(0.2, 6.1 + $sY); $pdf->SetFillColor(240, 240, 240); $pdf->Cell(8, 0.3, 'SUBJECT INFORMATION', 1, 0, 'L', 1); //--------------------------- Subject Group $grp_name = $data["RegGrp"]; switch ($grp_name) { case '1': $grp_name = 'SCIENCE WITH BIOLOGY'; break; case '7': $grp_name = 'SCIENCE WITH COMPUTER SCIENCE'; break; case '8': $grp_name = 'SCIENCE WITH ELECTRICAL WIRING'; break; case '2': $grp_name = 'Humanities'; break; case '5': $grp_name = 'Deaf and Dumb'; break; default: $grp_name = "No Group Selected."; } $pdf->SetXY(0.5, 6.45 + $sY); $pdf->SetFont('Arial', '', 10); $pdf->Cell(0.5, 0.5, "Subject Group:", 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetXY(1.5, 6.45 + $sY); $pdf->Cell(0.5, 0.5, $grp_name, 0, 'L'); $y = $sY - 0.3; $x = 1; //--------------------------- Subjects $pdf->SetFont('Arial', '', 10); //DebugBreak(); //------------- sub 1 & 5 $pdf->SetXY(0.5, 7.05 + $y); $pdf->Cell(0.5, 0.5, '1. ' . $data['sub1_NAME'], 0, 'L'); $pdf->SetXY(3 + $x, 7.05 + $y); $pdf->Cell(0.5, 0.5, '5. ' . $data['sub5_NAME'], 0, 'L'); //------------- sub 2 & 6 $pdf->SetXY(0.5, 7.35 + $y); $pdf->Cell(0.5, 0.5, '2. ' . $data['sub2_NAME'], 0, 'L'); $pdf->SetXY(3 + $x, 7.35 + $y); $pdf->Cell(0.5, 0.5, '6. ' . $data['sub6_NAME'], 0, 'R'); //------------- sub 3 & 7 $pdf->SetXY(0.5, 7.7 + $y); $pdf->Cell(0.5, 0.5, '3. ' . $data['sub3_NAME'], 0, 'L'); $pdf->SetXY(3 + $x, 7.7 + $y); $pdf->Cell(0.5, 0.5, '7. ' . $data['sub7_NAME'], 0, 'R'); //------------- sub 4 & 8 $pdf->SetXY(0.5, 8.050000000000001 + $y); $pdf->Cell(0.5, 0.5, '4. ' . $data['sub4_NAME'], 0, 'L'); $pdf->SetXY(3 + $x, 8.050000000000001 + $y); $pdf->Cell(0.5, 0.5, '8. ' . $data['sub8_NAME'], 0, 'L'); $pdf->SetFont('Arial', 'UI', 10); $pdf->SetXY(5.6, 6.9); $date = time($data['edate']); $pdf->Cell(8, 0.24, 'Feeding Date: ' . date('d-m-Y H:i:s', $date), 0, 'L', ''); //date_format($$data['EDate'], 'd/m/Y H:i:s'); $pdf->SetXY(5.6, 7.2); $pdf->Cell(8, 0.24, 'Print Date: ' . date('d-m-Y H:i:s'), 0, 'L', ''); //====================================================================================== } //else: // echo "No Record Found For Processing..."; //endif; //echo 'Some thing is not ok '; die(); //$filename="Admission_Forms_". $inst_cd."_".GetInterGroup($grp).'_'. ($sex== 1?'MALE': 'FEMALE') . ".pdf"; //$filename="Reg_Forms_". ".pdf"; //$pdf->Output($filename,'D'); $pdf->Output(); }