<?php
// Path ke direktori TCPDF
define('K_PATH_MAIN', __DIR__ . '/tcpdf/');
define('K_PATH_URL', 'tcpdf/');

// Memasukkan TCPDF
require_once(K_PATH_MAIN . 'config/tcpdf_config.php');
require_once(K_PATH_MAIN . 'tcpdf.php');

// Konfigurasi TCPDF
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// Informasi Dokumen
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Your Name');
$pdf->SetTitle('Barcode Label');
$pdf->SetSubject('Output Production Barcode Label');
$pdf->SetKeywords('Barcode, Output, Production');

// Tambahkan halaman
$pdf->AddPage();

// Data contoh jadwal
$schedule = array(
    'no_order' => '001',
    'product_model' => 'Product A',
    'output' => 80,
    'delivery_date' => '2023-08-21'
);

// Tambahkan barcode label
$pdf->write1DBarcode($schedule['output'], 'C128', '', '', 50, 10, 0.4, array('position' => 'C'));

// Tambahkan informasi jadwal
$pdf->SetFont('helvetica', '', 12);
$pdf->SetXY(70, 60);
$pdf->Cell(0, 0, 'No Order: ' . $schedule['no_order']);
$pdf->SetXY(70, 70);
$pdf->Cell(0, 0, 'Product Model: ' . $schedule['product_model']);
$pdf->SetXY(70, 80);
$pdf->Cell(0, 0, 'Output: ' . $schedule['output']);
$pdf->SetXY(70, 90);
$pdf->Cell(0, 0, 'Delivery Date: ' . $schedule['delivery_date']);

// Output PDF ke browser atau file
$pdf->Output('barcode_label.pdf', 'I');
?>
