<?php 
    if(!isset($_GET["id"]) || empty($_GET["id"])){
        header("Location: /admin/orders/list");
        exit();
    }
    $order_details       = $order->getOrder($_GET['id']);
    if(empty($order_details)) {
        header("Location: /admin/orders/list");
        exit();
    }
    $data = array();
?>
<html>
    <head>
        <title><?php echo $order_details['order_id']; ?> Hediye Notu</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Mali:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap" rel="stylesheet">
        <style>
            *{
                font-family: 'Mali', cursive;
                font-size: 13px;
                -webkit-print-color-adjust: exact;
                margin: 0;
                padding: 0;
                line-height: 1.5;
            }
            *, ::after, ::before {
                box-sizing: border-box;
            }
            html,
            body {
                height: 100%;
                padding: 0;
                margin: 0;
                font-family: 'Mali', cursive;
            }

            .container {
                width: 100%;
                margin-right: auto;
                margin-left: auto;
            }
            .row {
                display: -ms-flexbox;
                display: flex;
                -ms-flex-wrap: wrap;
                flex-wrap: wrap;
                margin-right: -10px;
                margin-left: -10px;
            }
            .col-6 {
                -ms-flex: 0 0 50%;
                flex: 0 0 50%;
                max-width: 50%;
                position: relative;
                width: 100%;
                padding-right: 15px;
                padding-left: 15px;
            }


            div.page {
                width: 50%;
                height: 40%;
                float: left;
                /*border: 1px solid #cccccc;*/
                background-image: url('https://www.mozerr.com/public/assets/images/gift-background.jpg');
                background-repeat: no-repeat;
                background-position: center;
                background-size: cover;
            }
            .text {
                margin: auto;
                height: calc(100% - 125px);
                display: flex;
                align-items: center;
                justify-content: center;
                text-align: center;
                font-size: 16px;
                font-style: italic;
                font-weight: 500;
                padding: 0 10px;
            }
            .footer {
                margin-top: 15px;
                margin-bottom: 10px;
                text-align: center;
                font-size: 14px;
                color: #565656;
            }
            .footer-line {
                height:5px;
                display: flex;
                opacity: 0.7;
            }
            .footer-line span{
                width: 50%;
                height: 100%;
            }
            .orange{
                background-color: #f57e20;
            }
            .blue{
                background-color: #243c84;
            }
        </style>
    </head>
    <body>
        <div class="page" style="">
            <div style="margin: 10px 10px 25px; text-align: center;">
                <img src="https://www.mozerr.com/public/assets/images/logo.webp" style="max-height: 40px; opacity: 0.7">
            </div>
            <div class="text">
                <?php echo $order_details['gift_note']; ?>
            </div>
            <div class="footer">
                www.mozerr.com
            </div>
            <div class="footer-line">
                <span class="orange"></span>
                <span class="blue"></span>
            </div>
        </div>
        <script>
            window.onafterprint = window.close;
            window.print();
        </script>
    </body>
</html>