<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

//require_once('library/fpdf/fpdf.php');
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$zroot = $_SESSION["zdir"];

$series = $_SESSION["series_" . $dbname];


$mvisa = $_REQUEST["visano"];
$mmofa = $_REQUEST["mofano"];
//$mvisa = "7026581970";
//$mmofa = "E274342682";
$file = 'labelprint.php';

if ($mvisa != '' && $mmofa != '') {
    
} else {
    browse('Visa No. / Mofa No. Cannot Be Empty');
    echo "<script>window.close();</script>";
    return;
}

if ($_GET["para"] == 3) {
    $mvouchdt = date("Y-m-d");
    $maindb = 'item';
    $trandb = '';
}
//set printing preference 
//width=35mm;
//height=38mm
//$getcomp = mysqli_query($conn, "SELECT custcare FROM $zroot.`company`") or die(mysqli_error($conn));
//$fetcomp = mysqli_fetch_array($getcomp);
//$custcare = $fetcomp['custcare'];

$ctr = 0;
$breaker = 1;
//set printer setting to 38mm width 41 mm height and scale 100
require ('library/fpdf/code128.php');
$pdf = new PDF_Code128('P', 'mm', array(40, 53));



$pdf->AddPage();
$pdf->SetXY("1", '3');


$pdf->SetFont('Arial', 'B', 5);

$pdf->Cell(35, 0, 'MOFA No.', 0, 0, 'L');
$pdf->SetFont('Arial', 'B', 5);
//        $pdf->Cell(0, 0, $fcomp->pname, 0);
//$pdf->Ln(2);
//$pdf->SetXY("1", '10');

$pdf->Code128(5, 4, $mmofa, 32, 6);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 8);
$pdf->SetX("1");

$pdf->Cell(0, 17, "$mmofa", 0, 0, 'C');

//$pdf->Ln();
$pdf->SetX("1");
$pdf->SetFont('Arial', 'B', 5);

$pdf->Cell(0, 22, 'VISA No.', 0, 0, 'L');
$pdf->Code128(5, 16, $mvisa, 32, 6);
//$pdf->Ln();
$pdf->SetXY("1","24");
$pdf->SetFont('Arial', 'B', 8);

$pdf->Cell(0, 0, "$mvisa", 0, 0, 'C');

$pdf->Output();
?>