<!DOCTYPE html>

<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">

<head>

    <style>

    @media (min-width: 768px ) {

        #mobileMenu{display: none; }

        .mobileMenuButton{display: none;}

    }

    </style>

    <meta charset="UTF-8" />

   

    <title><?php echo $title; ?></title>

    <base href="<?php echo $base; ?>" />

    <?php if ($description) { ?>

    <meta name="description" content="<?php echo $description; ?>" />

    <?php } ?>

    <?php if ($keywords) { ?>

    <meta name="keywords" content="<?php echo $keywords; ?>" />

    <?php } ?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />



    

    <script type="text/javascript" src="//scripts.piyersoft.com/javascript/jquery/jquery-2.1.1.min.js"></script>



    





    <script type="text/javascript" src="//scripts.piyersoft.com/javascript/tableedit.js"></script>

    <script type="text/javascript" src="//scripts.piyersoft.com/javascript/jquery/jquery-ui/pagejquery-ui.js"></script>

	<script type="text/javascript" src="//scripts.piyersoft.com/javascript/bootstrap/js/bootstrap.min.js"></script>

    

    <link href="//scripts.piyersoft.com/stylesheet/bootstrap.css" type="text/css" rel="stylesheet" />



    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" type="text/css" rel="stylesheet" />



    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script>

    <!--<script src="//scripts.piyersoft.com/javascript/jquery/datetimepicker/moment.js" type="text/javascript"></script>-->



    <script src="//scripts.piyersoft.com/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>

    <link href="//scripts.piyersoft.com/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" media="screen" />



    <!-- 08.09.20 daterange add (ali.a) -->

    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>

    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />



    <link type="text/css" href="//scripts.piyersoft.com/stylesheet/stylesheet.css" rel="stylesheet" media="screen" />

    <!--Quick_Edit_JS_and_CSS_START-->

	<link type="text/css" href="//scripts.piyersoft.com/stylesheet/quick_edit.css" rel="stylesheet" media="screen" />

    <!--Quick_Edit_JS_and_CSS_END--> 

    <link rel="stylesheet" type="text/css" href="//scripts.piyersoft.com/stylesheet/tableedit.css" />

    <?php foreach ($styles as $style) { ?>

    <link type="text/css" href="<?php echo $style['href']; ?>" rel="<?php echo $style['rel']; ?>" media="<?php echo $style['media']; ?>" />

    <?php } ?>

    <?php foreach ($links as $link) { ?>

    <link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />

    <?php } ?>

    <script src="//scripts.piyersoft.com/javascript/common.js" type="text/javascript"></script>

    <?php foreach ($scripts as $script) { ?>

    <script type="text/javascript" src="<?php echo $script; ?>"></script>

    <?php } ?>

    <link type="text/css" href="//scripts.piyersoft.com/stylesheet/menuup.css" rel="stylesheet" media="screen" />  

    <link type="text/css" href="//scripts.piyersoft.com/mmenu/jquery.mmenu.all.css" rel="stylesheet" media="screen" /> 

    <script type="text/javascript" src="//scripts.piyersoft.com/mmenu/jquery.mmenu.all.js"></script> 

    <script>

    jQuery(document).ready(function( $ ) {

        $("#mobileMenu").mmenu({

            "extensions": [

                "theme-dark"

            ],

        });

    });

    </script> 

</head>

<body>



<div id="container">

    <header id="header" class="navbar navbar-static-top">

        <div class="navbar-header">

            <!--<?php if ($logged) { ?>

            <a type="button" id="button-menu" class="pull-left"><i class="fa fa-chevron-circle-right fa-lg"></i></a>

            <?php } ?>-->

            <li class="dropdown mobileMenuButton"><a href="#mobileMenu" target="_blank" title="Siteye Git"><i style="margin-left:5px;"class="fa fa-bars fa-bars"></i></a></li>

            <a href="<?php echo $home; ?>" class="navbar-brand" style="padding: 13.5px 15px;"><img src="<?php echo $logo; ?>" alt="PiyerSoft Yönetim Paneli" title="Piyer Soft Yönetim Paneli" /></a></div>

        <?php if ($logged) { ?>

        <ul class="nav pull-right">

             <?php if ($has_access) { ?>
               <? /*
                <li>
                <a href="/puan_islemleri/index.php" target="_blank" style=" border: 2px solid; color: #424954;margin-right: 20px;background:white;padding: 0px 17px;border-radius: 25px;">
                    <span class="" title="Yeni ürün eklendikten sonra puan güncellemesi için çalıştırılır.(Perakende Müşteriler)">Puan Güncelle</span> <i class="fa fa-refresh fa-lg"></i>
                </a>
            </li>  
            
            */ ?>

                
           <!-- <li>

                <a href="https://www.deercase.com/index.php?route=tool/yurtici_cron" target="_blank" style=" border: 2px solid; color: #424954;margin-right: 20px;background:white;padding: 0px 17px;border-radius: 25px;">

                    <span class="">Yurtiçi Kargo Bilgileri Güncelle</span> <i class="fa fa-truck fa-lg"></i>

                </a>

            </li>-->

            <li class="hidden">

                <a id="clear_chache" onclick="getCacheFilesData()" style=" border: 2px solid; color: #424954;margin-right: 20px;background:white;padding: 0px 17px;border-radius: 25px;">

                    <span class="">Önbelleği Temizle</span> <i class="fa fa-refresh fa-lg"></i>

                </a>

            </li>

        	<?php if($version_status > 0) { ?>    

									 <li class="dropdown hidden">

									 		<a class="dropdown-toggle" data-toggle="dropdown">

													<span class="label label-danger pull-left"><?php echo $version_status; ?></span> <i class="fa fa-upload fa-lg"></i>

											</a>

									 

	   										<ul class="dropdown-menu dropdown-menu-right alerts-dropdown">

	    										<li class="dropdown-header"><?php echo $error_version ?>

												<a href='<?php echo $version_update_link ?>'><?php echo $iyzico_update_button ?></a><?php echo $iyzico_or_text ?></li>

	   										</ul>

	   

									</li>

             					<?php } ?> 

             <li class="dropdown hidden"><a class="dropdown-toggle" data-toggle="dropdown"><?php if($alerts > 0) { ?><span class="label label-danger pull-left"><?php echo   $processing_status_total; ?></span><?php } ?> <i class="fa fa-shopping-cart fa-lg"></i></a>

                <ul class="dropdown-menu dropdown-menu-right alerts-dropdown">

                    <li class="dropdown-header"><?php echo $text_order; ?></li>

                    <li><a href="<?php echo $processing_status; ?>" style="display: block; overflow: auto;"><span class="label label-warning pull-right"><?php echo $processing_status_total; ?></span><?php echo $text_processing_status; ?></a></li>

                    <li><a href="<?php echo $complete_status; ?>"><span class="label label-success pull-right"><?php echo $complete_status_total; ?></span><?php echo $text_complete_status; ?></a></li>

                </ul>

            </li>

            <li class="dropdown hidden"><a class="dropdown-toggle" data-toggle="dropdown"><?php if($alerts > 0) { ?><span class="label label-danger pull-left"><?php echo $return_total; ?></span><?php } ?> <i class="fa fa-undo fa-lg"></i></a>

                <ul class="dropdown-menu dropdown-menu-right alerts-dropdown">

                    <li class="dropdown-header">İadeler</li>

                    <li><a href="<?php echo $return; ?>"><span class="label label-danger pull-right"><?php echo $return_total; ?></span><?php echo $text_return; ?></a></li>

                </ul>

            </li>

            <li class="dropdown hidden"><a class="dropdown-toggle" data-toggle="dropdown"><?php if($alerts > 0) { ?><span class="label label-danger pull-left"><?php echo $product_total + $review_total; ?></span><?php } ?> <i class="fa fa-tags fa-lg"></i></a>

                <ul class="dropdown-menu dropdown-menu-right alerts-dropdown">    

                    <li class="dropdown-header"><?php echo $text_product; ?></li>

                    <li><a href="<?php echo $product; ?>"><span class="label label-danger pull-right"><?php echo $product_total; ?></span><?php echo $text_stock; ?></a></li>

                    <li><a href="<?php echo $review; ?>"><span class="label label-danger pull-right"><?php echo $review_total; ?></span><?php echo $text_review; ?></a></li>

                  

                </ul>

            </li>





            <li class="dropdown hidden"><a href="javascript:;" target="_blank" onclick="openFileManager(this)" title="Dosya Yöneticisi">Dosya Yöneticisi <i style="margin-left:5px;"class="fa fa-file fa-lg"></i></a>



            <li class="dropdown"><a href="<?php echo $stores[0]['href']; ?>" target="_blank" title="Siteye Git">Siteyi Görüntüle <i style="margin-left:5px;"class="fa fa-desktop fa-lg"></i></a>

                

            </li>

            <?php

            }

            ?>

           

            <li><a href="<?php echo $logout; ?>"><span class="hidden-xs hidden-sm hidden-md"><?php echo $text_logout; ?></span> <i class="fa fa-sign-out fa-lg"></i></a></li>

        </ul>

        <?php } ?>



    </header>

    <style>

            .lodaer_class{position:fixed;display:none;top:0;right:0;width:100%;height:100%;background-color:#FFF;background-repeat:no-repeat;background-position:center;z-index:10000000;filter: alpha(opacity=40);opacity:.8;transition:all .3s ease-out 0s}.loadinggif{position:fixed;top:50%;left:50%;z-index:101;width:110px;height:110px;transform:translate(-50%,-50%)}.err_msg{background:#c00;margin-top:20px}.err_msg p{text-align:center;color:#fff!important;padding:15px}

			#ScrollToTop

			{

			    left: 24px !important;

			}

        </style>

        <div id="img_loader" class="lodaer_class">

  <img src="<?= $http_catalog."image/loader.gif"?>" class="loadinggif" >

</div>

 <div class="modal" id="cache_files_modal" data-backdrop="false"  tabindex="-1" role="dialog">

  <div class="modal-dialog" >

    <div class="modal-content">

      <div class="modal-header">

        <h5 class="modal-title">Önbellek Dosyaları</h5>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">

          <span aria-hidden="true">&times;</span>

        </button>

      </div>

      <div class="modal-body">

          

          <div class='col-md-12 checkbox'><label> <input type='checkbox' id='all_cache_files'> Hepsini seç</label> </div>

          

              <div class="row form-group all_files"></div>

      </div>

      <div class="modal-footer">

        <button type="button" class="btn btn-danger delete_cache" >Dosyaları sil</button>

        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>

      </div>

    </div>

  </div>

</div>



<script type="text/javascript">



    function openFileManager($button) {



        $.ajax({

            url: 'index.php?route=common/filemanager&token=' + getURLVar('token'),

            dataType: 'html',

            success: function(html) {

                $('body').append('<div id="modal-image" class="modal">' + html + '</div>');

                $('#modal-image').modal('show');

                $('#modal-image').find ('a.thumbnail').each (function (Index, Item) {

                    $(Item).attr ('href', 'javascript:;').attr ('onclick', '$(this).siblings ("label").find ("input").trigger ("click");');

                });

            }

        });

    }



</script>

<script>

                 $('.delete_cache').on('click', function () {

                        var cachefiles = [];

                    $('[name="cache_files[]"]:checked').each (function () {

                      cachefiles.push ($(this).val ());

                   });



                   if (cachefiles.length>0)

                   {

                     $('#img_loader').show();

                       $.ajax({

                            url: '<?= $http_catalog; ?>index.php?route=common/header/clearCache',

                            type: 'POST',

                           data: {cachefiles: cachefiles},

                            success: function (res) {

                                getCacheFilesData();

                                $('#img_loader').hide();

                            }

                        });

                    }

                     else window.alert ("Lütfen En Az 1 Dosya Seçin");



                });

               



            </script>

            <script>

            $('#all_cache_files').on('click', function () {

               $('input[name*=\'cache_files[]\']').prop('checked', this.checked);

            });

            </script>

            

            <script>

                function getCacheFilesData(){

                    $('#img_loader').show();

                   $.ajax({

                            url: '<?= $http_catalog; ?>index.php?route=common/header/getCacheData',

                            type: 'GET',

                            success: function (res) {

                                $('.all_files').html(res);

                                $('#all_cache_files').prop('checked', false);

                               $('#cache_files_modal').modal('show');

                               $('#img_loader').hide();

                            }

                        }); 

                }

            </script>

    

