<?php

/*
    if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === "off") {
    $location = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: ' . $location);
    exit;
}
*/

    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS');
    header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
    $main_color = setting()['main_color'];
    $hover_color = setting()['hover_color'];
    $logo=mainData()["image"];

    $_COOKIE['site_url'] = "http://aldahiyabh.com/";
    $site_url = $_COOKIE['site_url'];
    if (isset($_COOKIE['site_lang']) && $_COOKIE['site_lang'] == 'ar'){

        $title=mainData()["title"];   
        $home_title="الرئيسية";
        $about_title=" أتصل بنا ";
        $payment="طريقة الدفع";
        $cash="كاش";
        $benefit="بينيفيت ";
        $debit="ديبيت";
        $credit="كريديت";
        $place_order="تنفيذ الطلب ";
        
        $currency_name="دب";
        $add_to_order="أضف إلى السلة ";
        $special_inst="ملاحظات ";
        $special_inst.="(إختياري)";
        $your_order="طلبك ";
        
        $sub_total_name="المجموع";
        $discount_name="الخصم";
        $vat_name="الضريبة";
        $total_name="الإجمالي";
        $delivery_fee_name="رسوم التوصيل ";
        $order_summary="ملخص الطلب ";
        $contact_info_name=" بيانات الإتصال ";
        $continue_name="إستكمال";
        $place_order="تنفيذ الطلب ";
        $CHECKOUT="إستمرار";
        $Country="الدولة";
        $region_select=" إختر المنطقة";
         $saudia_arabia="المملكة العربية السعودية ";
        $block="المُجمع";
        $building="البناية";
        $road="الطريق";
        $notes="ملاحظات";
        $notes_form="ملاحظات";
       
        $name_title="الإسم بالكامل ";
        $phone_title="رقم الهاتف ";
        $email_title="البريد الإلكتروني";
        $address="عنوان التوصيل ";
        $payment="طريقة الدفع";
        $cash="كاش";
        $debit="ديبت كارد";
        $credit="كريدت كارد";
        
        $deliver_time="تاريخ الطلب ";
        $delivery_order="توصيل إلى المنزل ";
        $takeAway_order="إستلام من المحل ";
        $workingTime="9 صباحاً إلى 4 مساء , من 6 مساء إلى 12 بعد منتصف الليل ";
        $all_week=" طوال أيام الأسبوع ";
        $visit_location=" زيارة الموقع ";
        
        //About
        $about_us = "عنا";
        $shopping = "اذهب للتسوق";
    
        //Contact
        $contact_us = "اتصل بنا";
        $address = "العنوان";
        $phone = "التليفون";
        $mobile = "المحمول";
        $whats = "واتس اب";
        $email = "ايميل";
        $instagram = "انستجرام";
        $twitter = "تويتر";
        $facebook = "فيسبوك";
        $location = "الموقع على الخريطه";

    }else{
        $title=mainData()["title_en"];
        $all_week="All Week";
                $visit_location="Visit Location";
     
        $home_title="Home";
        $about_title="Contact Us ";
        $place_order="Place Order";
        $payment="Payment Method";
        $cash="Cash";
        $benefit="Benifit";
        $debit="Debit";
        $credit="Credit";
        
        $currency_name="BHD";
        $add_to_order="Add To Order";
        $special_inst="Special Notes";
        $your_order="Your Order";
        $sub_total_name="Sub Total";
        $discount_name="Discount";
        $vat_name="VAT";
        $total_name="Net Total";  
        $delivery_fee_name="Delivery Fees";
        $order_summary="Order Summary";
        $contact_info_name="Contact Info";
        $continue_name="Continue";
        $place_order="Place Order";
        $CHECKOUT="Checkout";
        $Country="Country";
        $region_select="Select Region";
        $saudia_arabia="Saudia Arabia";
        $block="Block";
        $building="Building";
        $road="Road";
        $notes_form="Notes";
        $name="Full Name";
        $phone="Phone Number";
         $name_title="Full Name ";
        $phone_title="Phone Number";
        
        $email_title="Email";
        $address="Delivery Address";
        $payment="Payment Method";
        $cash="Cash";
        $debit="Debit Card";
        $credit="Credit Card";
        $deliver_time="Date / Time  Delivery";
        $delivery_order="Delivery";
        $takeAway_order="Pick Up";
        $workingTime="9 AM : 4 PM , 6 PM - 12 AM";
           
         //About
        $about_us = "About Us";
        $shopping = "Go Shopping";
    
        //Contact
        $contact_us = "Contact Us";
        $address = "Address";
        $phone = "Phone";
        $mobile = "Mobile";
        $whats = "WhatsApp";
        $email = "Email";
        $instagram = "Instagram";
        $twitter = "Twitter";
        $facebook = "Facebook";
        $location = "Location on Map";
    }   
?>
<html>
    <head>
        <meta   http-equiv="content-type  charset="UTF-8" content="text/html; >
        <base href="http://www.aldahiyabh.com/">
        <title><?php echo $title; ?> </title>
								<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
								<script src="assets/jquery/jquery-3.3.1.min.js" type="text/javascript"></script>
								<script src="assets/jquery/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
								<script src="assets/bootstrap/js/popper.min.js" type="text/javascript"></script>
								<script src="assets/bootstrap/js/bootstrap.js" type="text/javascript"></script>
								
								
								<script src="assets/jquery/jquery-extend.js" type="text/javascript"></script>
	                            <script src="assets/js/lazy/jquery.lazy.min.js" type="text/javascript"></script>
								<script src="assets/js/lazy/jquery.lazy.plugins.min.js" type="text/javascript"></script>
								
								 <script src="assets/js/website.js" type="text/javascript"></script>  
								
								
								<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
								
								<link href="assets/css/style.css" rel="stylesheet" type="text/css"/>
								<link href="<?php echo $logo; ?>" rel="shortcut icon">
        <?php if (isset($_COOKIE['site_lang']) && $_COOKIE['site_lang'] == 'ar') { ?>
                <link href="assets/css/rtl.css" rel="stylesheet" type="text/css"/>
                <?php
            }
            $style = "<style type='text/css'>
                :root{
                    --color-white:#FFFFFF;
                    --color-Black:#000000;
                    --danger:$main_color;/*main Color  */
                    --danger2:$hover_color;/*Hover Color */
                    --red:$main_color; /*main Color */
                    --sidebar:$main_color; /* main Color */
                    --borders:1px #707070 solid;
                    --box-shadow: 0px 0px 8px 0px #d0d0d0;
                    --box-shadow2: 0px 1px 1px #dedede;
                }
                a > i {
                color:$main_color;
                }
            </style>";
            echo $style;
        ?>
    </head>
    <body>
    
<?php
    $main_data = mainData(); // array one raw
    $parent_categories = parentCategory(); // array many row
    $setting = setting();
    $contact=contact();
    $logo=$main_data['image'];
?>    
								<div class="progress progress-page-load">
												<div class="progress-bar bg-info progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
								</div>

								<header class="top-header">

            <div class="container px-0">
            
	            <div class="row align-items-center" id="showSearchDiv">
	            
	            <div class="getForm">
	                    <form class="mb-0" method="POST" action="search.php" >
	                        <div class="getInput row py-4">
	                            <div class="">
	                                <input type="text" value="" name="name" required class="form-control p-0 rounded-0 border-left-0 border-right-0 border-top-0 border-bottom" placeholder="Write Here Item Name">
	                            </div>
	                        </div>
	                        <button type="submit"><i class="p-1 fa fa-search"></i></button>
	                              <a id="hideSearch"><i class="p-1 fa fa-close"></i> </a>
	                    </form>
	            </div>
	            
	            </div>
            
                <div class="logo-area row align-items-center" id="showLogoDiv">
                
                    <a class="col-1 text-center"><span class="p-1 show-side-bar" data-icon="&#xf0e8"></span></a>
                    
                    <a href="index.php" class="logo col"><img style="max-width:100%;height: 100%;margin: auto;display:block;float:right;" src="<?php echo $logo; ?>" /></a>

                    <div class="col-4" style="float:right;text-align: right;">
                    
                    <a href="#" class="text-center ChangeLang" target=""> <i class="p-1 fa fa-language"></i>  <?= ($_COOKIE['site_lang'] == 'ar') ? 'English' : 'العربية' ?> </a>
                    <a href="<?php echo $contact['facebook']; ?>" class="text-center" target="_blank"> <i class="p-1 fa fa-facebook"></i> </a>
                    <a href="<?php echo $contact['instagram']; ?>" class="text-center" target="_blank"> <i class="p-1 fa fa-instagram"></i> </a>
                    <a href="<?php echo $contact['twitter']; ?>" class="text-center" target="_blank"> <i class="p-1 fa fa-twitter"></i> </a>
                    <a href="<?php echo "https://wa.me/".$contact['whatsapp']; ?>" class="text-center" target="_blank"> <i class="p-1 fa fa-whatsapp"></i> </a>
                    <a id="showSearch" class="text-center"> <i class="p-1 fa fa-search"></i> </a>
                    
                    </div>
                    
                    <a class="col-2 text-center " onclick="showModalCartDetials()" href="#Cart" data-toggle="modal" data-target="#Cart">
                        <span id="cart-item-count" class="cart-count rounded-pill bg-danger text-white px-2">4</span>
                        <span class="text-secondary" data-icon="&#xf24f"></span>
                    </a>
                    
                </div>
            </div>


            <div class="side-bar hide">
                <div class="close d-block p-3 mb-3 text-white" data-icon="&#xe912"></div>
                <div class="list-group w-100 d-block mt-5 text-capitalize">
                    <br>
                    <a href="index.php" class="list-group-item list-group-item-action">
                        <span class="pr-1" data-icon="&#xe91c"></span> <?= $home_title ?>
                    </a>
                    
                    <a href="about_us.php" class="list-group-item list-group-item-action">
                        <span class="pr-1" data-icon="&#xf0d2"></span> <?= $about_us ?>
                    </a>

                    <a href="contact_us.php" class="list-group-item list-group-item-action">
                        <span class="pr-1" data-icon="&#xf095"></span> <?= $contact_us ?>
                    </a>
                    
                    <a  href="#" class="list-group-item list-group-item-action ChangeLang">
                        <span class="pr-1" data-icon="&#xf0d2"></span>
                        <?= ($_COOKIE['site_lang'] == 'ar') ? 'English' : 'العربية' ?>
                    </a>
                </div>
            </div>
								</header>

