<?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('P', 'mm', array(58, 72));

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

$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(48, 5, 'MOFA NO.', 0, 0, 'C');

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

$pdf->SetFont('Arial', 'B', 12);
$pdf->SetXY("1", '15');
$pdf->Cell(0, 6, "$dmofa", 0, 0, 'C');

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

$pdf->SetXY("3", "24");
$pdf->Cell(48, 5, 'VISA NO.', 0, 0, 'C');
$pdf->Code128(5, 29, $mvisa, 42, 7);
//$pdf->Ln();

$pdf->SetXY("1", "36");
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(0, 6, "$mvisa", 0, 0, 'C');

$pdf->Output();
?>