<?php
// *************************************************************************
// *                                                                       *
// * DEPRIXA BASIC -  Freight Forwarding & Shipping Software Solutions     *
// * Copyright (c) JAOMWEB. All Rights Reserved                            *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * Email: support@jaom.info                                              *
// * Website: https://deprixa.link/documentation/                          *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * This software is furnished under a license and may be used and copied *
// * only  in  accordance  with  the  terms  of such  license and with the *
// * inclusion of the above copyright notice.                              *
// * If you Purchased from Codecanyon, Please read the full License from   *
// * here- http://codecanyon.net/licenses/standard                         *
// *                                                                       *
// *************************************************************************



require_once('helpers/querys.php');

if (isset($_GET['id'])) {
    $data = cdp_getChargePrint($_GET['id']);
}



$row = $data['data'];

$db->cdp_query("SELECT * FROM cdb_add_order WHERE order_id='" . $row->order_id . "'");
$row_order = $db->cdp_registro();


$db->cdp_query("SELECT * FROM cdb_users where id= '" . $row_order->sender_id . "'");
$sender_data = $db->cdp_registro();


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="theme-color" content="#ffffff">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <title><?php echo $lang['leftorder204'] ?> - #<?php echo $row->id_charge; ?></title>

    <!-- Web Fonts
    ======================= -->
    <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900' type='text/css'>

    <!-- Stylesheet
    ======================= -->
    <link rel="stylesheet" type="text/css" href="assets/vendor/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="assets/vendor/font-awesome/css/all.min.css" />
    <link rel="stylesheet" type="text/css" href="assets/dist/css/stylesheet.css" />
    <link rel="stylesheet" href="assets/dist/css/themify-icons.css">
    <!--[if lt IE 8]><!-->
    <link rel="stylesheet" href="assets/dist/css/ie7/ie7.css">
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            font: 14px/1.4 Helvetica, Arial, sans-serif;
        }

        #page-wrap {
            width: 800px;
            margin: 0 auto;
        }

        textarea {
            border: 0;
            font: 14px Helvetica, Arial, sans-serif;
            overflow: hidden;
            resize: none;
        }

        table {
            border-collapse: collapse;
        }

        table td,
        table th {
            border: 1px solid black;
            padding: 5px;
        }

        tr.noBorder td {
            border: 0;
        }

        td.Border td {
            border: 1px;
        }

        #header {
            height: 15px;
            width: 100%;
            margin: 20px 0;
            background: #222;
            text-align: center;
            color: white;
            font: bold 15px Helvetica, Sans-Serif;
            text-decoration: uppercase;
            letter-spacing: 20px;
            padding: 8px 0px;
        }

        #address {
            width: 250px;
            height: 150px;
            float: left;
        }

        #customer {
            overflow: hidden;
        }

        #logo {
            text-align: right;
            float: right;
            position: relative;
            margin-top: 18px;
            border: 1px solid #fff;
            max-width: 540px;
            overflow: hidden;
        }

        #customer-title {
            font-size: 16px;
            font-weight: bold;
            float: left;
        }

        #meta {
            margin-top: 0px;
            width: 100%;
            float: right;
        }

        #meta td {
            text-align: right;
        }

        #meta td.meta-head {
            text-align: left;
            background: #6c757d;
        }

        #meta tr.meta-head {
            height: 8px;
        }

        #meta td textarea {
            width: 100%;
            height: 10px;
            text-align: right;
        }

        #signing {
            margin-top: 0px;
            width: 100%;
            float: center;
        }

        #signing td {
            text-align: center;
        }

        #signing td.signing-head {
            text-align: center;
            background: #eee;
        }

        #signing td textarea {
            width: 100%;
            height: 20px;
            text-align: center;
        }

        #items {
            clear: both;
            width: 100%;
            margin: 0px 0 0 0;
            border: 1px solid black;
        }

        #items {
            margin-top: 7px;
            width: 100%;
            float: right;
        }

        #items th {
            background: #6c757d;
        }

        #items textarea {
            width: 80px;
            height: 50px;
        }

        #items tr.item-row td {
            vertical-align: top;
        }

        #items td.description {
            width: 300px;
        }

        #items td.item-name {
            width: 175px;
        }

        #items td.description textarea,
        #items td.item-name textarea {
            width: 100%;
        }

        #items td.total-line {
            border-right: 0;
            text-align: right;
        }

        #items td.total-value {
            border-left: 0;
            padding: 7px;
        }

        #items td.total-value textarea {
            height: 20px;
            background: none;
        }

        #items td.balance {
            background: #6c757d;
        }

        #items td.blank {
            border: 0;
        }

        #terms {
            text-align: center;
            margin: 10px 0 0 0;
        }

        #terms h5 {
            text-transform: uppercase;
            font: 13px Helvetica, Sans-Serif;
            letter-spacing: 10px;
            border-bottom: 1px solid black;
            padding: 0 0 8px 0;
            margin: 0 0 8px 0;
        }

        #terms textarea {
            width: 100%;
            text-align: center;
        }
    </style>

</head>

<body>

    <!-- Container -->
    <div id="page-wrap">
        <div class="container-fluid invoice-container">
            <!-- Header -->
            <header>
                <div class="row align-items-center">
                    <div class="col-sm-7 text-center text-sm-start mb-0 mb-sm-0">
                        <?php echo ($core->logo) ? '<img src="assets/' . $core->logo . '" alt="' . $core->site_name . '" width="' . $core->thumb_w . '" height="' . $core->thumb_h . '"/>' : $core->site_name; ?>
                    </div>
                    <div class="col-sm-5 text-center text-sm-end">
                        <img src='https://barcode.tec-it.com/barcode.ashx?data=<?php echo $row->id_charge; ?>&code=Code128&multiplebarcodes=false&translate-esc=false&unit=Fit&dpi=72&imagetype=Gif&rotation=0&color=%23000000&bgcolor=%23ffffff&qunit=Mm&quiet=0&modulewidth=50' alt='' />
                    </div>
                </div>
                <hr>
            </header>

            <!-- Main Content -->
            <main>
                <div class="row">
                    <div class="col-sm-6 mb-0 mb-sm-0"> <span class="text-black-50 text-uppercase"><?php echo $lang['leftorder205'] ?>:</span><br>
                        <span class="fw-500 text-3"><?php echo $sender_data->fname . " " . $sender_data->lname; ?></span>
                    </div>

                    <div class="col-sm-6"> <span class="text-black-50 text-uppercase"><?php echo $lang['billing12'] ?> </span><br>
                        <span class="fw-500 text-3"><?php echo $row->charge_date; ?> </span>
                    </div>
                </div>

                <hr class="my-4">

                <div class="row">
                    <div class="col-sm-6 mb-1 mb-sm-0"> <span class="text-black-50 text-uppercase"><?php echo $lang['leftorder207'] ?></span><br>
                        <span class="fw-500 text-3"></strong> <?php echo $lang['leftorder208'] ?> <b><?php echo $row_order->order_prefix . $row_order->order_no; ?></b></span>
                    </div>

                    <div class="col-sm-6"> <span class="text-black-50 text-uppercase"><?php echo $lang['left485'] ?></span><br>
                        <?php if ($row->note != null) { ?>
                            <span class="fw-500 text-3"><?php echo $row->note; ?></span>
                        <?php } ?>
                    </div>
                </div>
                <!-- Total Fare -->
                <p class="bg-light-4 p-3 text-end fw-500 text-4 rounded my-4"><?php echo $lang['leftorder206'] ?>: <span class="ps-2">$<?php echo number_format($row->total, 2, '.', ''); ?></span> </p>

            </main>

            <table id="signing">
                <tr class="noBorder">
                    <td align="center">
                        <h4></h4>
                    </td>
                    <td align="center">
                        <h4></h4>
                    </td>
                    <td align="center">
                        <h4></h4>
                    </td>
                </tr>
                <tr class="noBorder">
                    <td align="center"><?php echo $lang['leftorder210'] ?></td>
                    <td align="center"><?php echo $lang['leftorder211'] ?></td>
                    <td align="center"><?php echo $lang['leftorder212'] ?></td>
                </tr>


            </table>


            <!-- Footer -->
            <footer class="text-center">
                <hr>
                <p><strong><?php echo $core->site_name; ?>.</strong><br>
                    <?php echo $core->c_address; ?> - <?php echo $core->c_country; ?> - <?php echo $core->c_city; ?>,<br>
                    <?php echo $core->site_email; ?>, <?php echo $core->c_phone; ?>. </p>

                <div class="btn-group btn-group-sm d-print-none">

                    <button class="btn btn-light border text-black-50 shadow-none" onClick="window.print();" style="font-size:16px"><?php echo $lang['inv-shipping19'] ?>&nbsp;&nbsp; <i class="ti-printer"></i></button>
                </div>
            </footer>
        </div>
    </div>
</body>

</html>