<html>
    <head>
        <title>تحديث التصنيفات و المنتجات المعدلة</title>
        <meta charset="utf-8">
        <style>
            .center {
                display: block;
                margin-left: auto;
                margin-right: auto;
                width: 50%;
                text-align: center;
                color: #900026;
                font-weight: bold;
                direction: rtl;
            }
        </style>
    </head>
    <body>
        <!--<div class="row">
            <div class="container">
                <ol class="breadcrumb">
                    <li><a href="#">خصائص عامة</a></li>
                    <li><a href="programsettingsController.php">اعدادات المنجر اون لاين</a></li>
                    <li class="active">تعديل اعدادات المنجر اون لاين</li>
                </ol>
                <div class="panel panel-default panel-m">
                     Default panel contents
                    <div class="panel-heading">
                        <h3 class="panel-title">تعديل المنجر اون لاين</h3>
                    </div>
                    <div class="panel-body">


                    </div>
                </div>
            </div>
        </div>-->
        <div class="frame" style="height: 100%;">
            <img src="../views/default/images/upload/cart.gif" class="center" alt="" style="width: 25%;height: 35%;vertical-align: central"/>
            <p><span class="center">جارى ارسال المنتجات والتصنيفات المعدلة للمتجر الالكترونى</span></p>
            <p><span class="center">{$onlineStoreSetting_head->url}</span></p>
            <p><span class="center"> قاعدة البيانات الحالية :{$db}</span></p>
        </div>


        <input type="hidden" name="catprohour_head" id="catprohour_head" value="{$onlineStoreSetting_head->catprohour}"/>
        <input type="hidden" name="catprominute_head" id="catprominute_head" value="{$onlineStoreSetting_head->catprominute}"/>
        <input type="hidden" name="proquantityhour_head" id="proquantityhour_head" value="{$onlineStoreSetting_head->proquantityhour}"/>
        <input type="hidden" name="proquantityminute_head" id="proquantityminute_head" value="{$onlineStoreSetting_head->proquantityminute}"/>
        <input type="hidden" name="clientshour_head" id="clientshour_head" value="{$onlineStoreSetting_head->clientshour}"/>
        <input type="hidden" name="clientsminute_head" id="clientsminute_head" value="{$onlineStoreSetting_head->clientsminute}"/>
        <input type="hidden" name="ordershour_head" id="ordershour_head" value="{$onlineStoreSetting_head->ordershour}"/>
        <input type="hidden" name="ordersminute_head" id="ordersminute_head" value="{$onlineStoreSetting_head->ordersminute}"/>
        <input type="hidden" name="updatetype_head" id="updatetype_head" value="{$onlineStoreSetting_head->updatetype}"/>





        {literal}
        <script type="text/javascript" charset="utf-8" src="media/js/jquery.js"></script>
        <script>
            //shop2 ajax
            //$(document).ready(function () {
            var updatetype_head = Number($('#updatetype_head').val());
            if (updatetype_head == 1) {
                //1-sync CatsAndProductsOnline
                var catprohour = Number($('#catprohour_head').val()) * 60 * 60;//20000;  // 1000 = 1 second, 20000 = 20 seconds
                var catprominute = Number($('#catprominute_head').val()) * 60;
                var catproInterval = catprohour + catprominute;//in second
                catproInterval = catproInterval * 1000;
                function syncCatsAndProductsOnline() {
                    //console.log(interval);
                    $.ajax({
                        type: 'POST',
                        url: 'onlinestoresync.php?do=syncCatAndProducts',
                        async: false,
                        success: function (data) {
                            //alert(data);
                        },
                        complete: function (data) {
                            // Schedule the next********************************
                            setTimeout(syncCatsAndProductsOnline, catproInterval);
                        }
                    });
                }
                setTimeout(syncCatsAndProductsOnline, catproInterval);

            }
            //});
        </script>
        {/literal}
    </body>
</html>