        <?php $cat = array("1" => "samp", "2" => "rust", "3" => "cs", "4" => "other", "5" => "mine");?>

        <div id="page-wrapper">
            <div class="row" style="padding-top: 20px">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-body shop-head" style="background-image: url('/images/<?=$cat[$shop['shop_game']]?>_header.png')">
                            <div class="game-name">
                                <?=$shop['shop_name']?>
                                <p><?=$shop['shop_domain']?></p>
                            </div>
                            <div class="site-balance">
                                Баланс сайта
                                <p><?=(float)$shop['shop_balance']?> <i class="fa fa-rub"></i></p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12">
                    <div class="panel panel-default nav-panel">
                        <div class="panel-body" style="text-align: center">
                            <ul id="site-nav" class="nav nav-pills">
                                <li class="active"><a href="/project/<?=$shop['shop_id']?>">Статистика</a></li>
                                <!-- <li><a href="/project/<?=$shop['shop_id']?>/template">Шаблон</a></li> -->
                                <!-- <li><a href="/project/<?=$shop['shop_id']?>/servers">Серверы</a></li> -->
                                <li><a href="/project/<?=$shop['shop_id']?>/items">Последние покупки</a></li>
                                <!-- <li><a href="/project/<?=$shop['shop_id']?>/players">Игроки</a></li> -->
                                <!-- <li><a href="/project/<?=$shop['shop_id']?>/news">Новости</a></li> -->
                                <li><a href="/project/<?=$shop['shop_id']?>/setting">Настройки</a></li>
                                <li><a href="/project/<?=$shop['shop_id']?>/form">Форма оплаты</a></li>
                                <li class="pull-right"><a href="#"><?php if($shop['shop_status'] == 0): ?> 
                               <span class="label label-warning">Ожидает модерации</span>
                               <?php elseif($shop['shop_status'] == 1): ?> 
                               <span class="label label-success">Одобрен</span>
                               <?php elseif($shop['shop_status'] >= 2): ?> 
                               <span class="label label-danger">Заблокирован</span>
                               <?php endif; ?></a></li>
                            </ul>
                        </div>
                    </div>
                </div>

                <div class="col-lg-3">
                    <div class="panel panel-default">
                        <div class="panel-body">
                        	<center>	
                        		<h1><?=(float)$stats[3][0]['sum']?> <i class="fa fa-rub"></i></h1>
                            	<p><small style="color: #6A6C6F;">за сегодня</small></p>
                        	</center>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="panel panel-default">
                        <div class="panel-body">
                        	<center>	
                        		<h1><?=(float)$stats[4][0]['sum']?> <i class="fa fa-rub"></i></h1>
                            	<p><small style="color: #6A6C6F;">за неделю</small></p>
                        	</center>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="panel panel-default">
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <script type="text/javascript">
						      google.load("visualization", "1", {packages:["corechart"]});
						      google.setOnLoadCallback(drawChart);
						      function drawChart() {
						        var data = google.visualization.arrayToDataTable([
						          ['Дата', 'Доход'],
                                  <?foreach($stats[2] as $item):?>
                                    ['<?php echo date("d", strtotime($item['DATE'])); echo $this->month[date("m", strtotime($item['DATE']))]; ?>',  <?=(float)$item['sum']?>],
                                  <?endforeach?>
                                  <?if(empty($stats[2])):?>
                                    ['<?=date("d"); echo " ".$this->month[date("m")]?>', 0],
                                  <?endif?>
						        ]);

						        var options = {
						          title: 'Статистика дохода за неделю',
						          vAxis: {minValue: 0}
						        };

						        var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
						        chart.draw(data, options);
						      }
						    </script>
                            <div id="chart_div" style="width: 100%; height: 99px"></div>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="panel panel-default">
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <script type="text/javascript">
                              google.load("visualization", "1", {packages:["corechart"]});
                              google.setOnLoadCallback(drawChart);
                              function drawChart() {
                                var data = google.visualization.arrayToDataTable([
                                  ['Дата', 'Покупок'],
                                  <?foreach($stats[1] as $item):?>
                                    ['<?php echo date("d", strtotime($item['DATE'])); echo $this->month[date("m", strtotime($item['DATE']))]; ?>',  <?=$item['stat']?>],
                                  <?endforeach?>
                                  <?if(empty($stats[1])):?>
                                    ['<?=date("d"); echo " ".$this->month[date("m")]?>', 0],
                                  <?endif?>
                                ]);

                                var options = {
                                  title: 'Статистика покупок за неделю',
                                  vAxis: {minValue: 0}
                                };

                                var chart = new google.visualization.AreaChart(document.getElementById('chart_div_second'));
                                chart.draw(data, options);
                              }
                            </script>
                            <div id="chart_div_second" style="width: 100%; height: 199px"></div>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <center>
                                <ul class="payments-list">
                                    <li <?if($shop['shop_webmoney'] == 0):?>class="disabled"<?endif?> id="turn_wm"><a href="#"><img src="/images/payment/payment-wm.gif" alt=""></a></li>
                                    <li <?if($shop['shop_zpayment'] == 0):?>class="disabled"<?endif?> id="turn_zp"><a href="#"><img src="https://gdonate.ru/images/payment/payment-payment.gif" alt=""></a></li>
                                    <li <?if($shop['shop_robokassa'] == 0):?>class="disabled"<?endif?> id="turn_rb"><a href="#"><img src="http://www.robokassa.ru/Images/logo.png" style="width: 150px"></a></li>
                                </ul>
                            </center>
                        </div>
                    </div>
                </div>
                
            </div>
        <!-- /#page-wrapper -->

        <script type="text/javascript">
            $("#turn_wm").click(function(){

                  $.ajax({
                  
                    url: location.pathname,
                    type: "POST",
                    data: {ajax: "turn_wm"},
                    success: function (data) {
                      if(data == 0){
                        fly_p('2', 'Произошла ошибка, повторите попытку!');
                      } else {
                        fly_p('1', data);
                        location.href = location.pathname;
                      }
                    }
                    
                  })
            });
            $("#turn_rb").click(function(){
                  $.ajax({
                  
                    url: location.pathname,
                    type: "POST",
                    data: {ajax: "turn_rb"},
                    success: function (data) {
                      if(data == 0){
                        fly_p('2', 'Произошла ошибка, повторите попытку!');
                      } else {
                        fly_p('1', data);
                        location.href = location.pathname;
                      }
                    }
                    
                  })
            });
            $("#turn_zp").click(function(){
                  $.ajax({
                  
                    url: location.pathname,
                    type: "POST",
                    data: {ajax: "turn_zp"},
                    success: function (data) {
                      if(data == 0){
                        fly_p('2', 'Произошла ошибка, повторите попытку!');
                      } else {
                        fly_p('1', data);
                        location.href = location.pathname;
                      }
                    }
                    
                  })
            });            
        </script>