<?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('L', 'mm', array(50,55));

$pdf = new PDF_Code128('P', 'mm', array(77,57));

$pdf->AddPage();
$pdf->SetXY("5", '7');

$pdf->SetFont('Arial', 'B', 9);
$pdf->Cell(35, 8, 'MOFA NO.', 0, 0, 'L');

$pdf->Code128(5, 13, $mmofa, 50, 10);

$pdf->SetFont('Arial', 'B', 10);
$pdf->SetXY("1", '16');
//$pdf->SetX("1");
$pdf->Cell(0, 18, "$mmofa", 0, 0, 'C');

//$pdf->SetX("3");
$pdf->SetXY("5","26");

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

$pdf->Cell(35, 5, 'VISA NO.', 0, 0, 'L');
//$pdf->Cell(0, 24, 'VISA NO.', 0, 0, 'L');
$pdf->Code128(5, 30, $mvisa, 50, 10);
//$pdf->Ln();

$pdf->SetXY("5","39");
//$pdf->SetX("5");
$pdf->SetFont('Arial', 'B', 10);

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

$pdf->Output();
?>