require_once '../functions.php';
require_once '../functions-2.php';
require_once '../functions-xml.php';
tep_db_connect();
define('FPDF_IMGPATH', DIR_WS_IMAGES . 'pdf/');
define('FPDF_FONTPATH', FPDF_IMGPATH . 'fonts/');
use_class('fpdf', DIR_WS_CLASSES);
use_class('minierp_logistic');
$class_ml = new minierp_logistic();
//if(isset($_GET['id']) && $_GET['id']!='') {
//$logistic_id = tep_db_prepare_input($_GET['id']);
if (isset($_POST['logistic_id']) && $_POST['logistic_id'] != '') {
    $logistic_id = tep_db_prepare_input($_POST['logistic_id']);
    $log_data = $class_ml->retrieveDetail($logistic_id);
    $log_header = $class_ml->retrieveData($logistic_id);
    $log_contents = $class_ml->retrieveContents($logistic_id);
    $log_date = strtotime($log_data['logistic_date']);
} else {
    exit;
}
class PDF extends FPDF
{
    var $left_margin;
    var $page_width;
    var $page_height;
    var $font_size;
    //Page header
    function Header()
    {
        $this->SetXY(0, $this->top_margin);
        $this->setFont('Arial', 'B', '18');