<?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"];
$mmofa2 = $_REQUEST["mofano2"];
//$mvisa = "7026581970";
//$mmofa = "E274342682";
$file = 'labelprint.php';

if (!empty($mmofa2)) {
    $dmofa = $mmofa2;
} else {
    $dmofa = $mmofa;
}

if ($mvisa != '' && $dmofa != '') {
    
} 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('L', 'mm', array(60, 55));

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

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

$pdf->SetFont('Arial', 'B', 6);
$pdf->Code128(5, 7, $dmofa, 38, 7);

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

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

$pdf->SetX("3");
$pdf->SetFont('Arial', 'B', 8);

$pdf->Cell(0, 24, 'VISA NO.', 0, 0, 'L');
$pdf->Code128(5, 21, $mvisa, 38, 6);
//$pdf->Ln();

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

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

$pdf->Output();
?>