

        <div id="page-wrapper">
            <div class="row" style="padding-top: 20px">

                <div class="col-lg-12">
                  
                    <table class="table table-condensed table-hover table-striped">
                     <thead>
                       <tr>
                          <th data-column-id="id" data-type="numeric">#</th>
                          <th data-column-id="name">Название проекта</th>
                          <th data-column-id="domain">Домен</th>
                          <th data-column-id="game">Игра</th>
                          <th data-column-id="balance">Баланс сайта</th>
                          <th data-column-id="status">Статус</th>
                          <th data-column-id="elements"></th>
                       </tr>
                     </thead>
                     <tbody>
                      <?php foreach($shopsall as $item): ?> 
                      <tr style="cursor: pointer;">
                       <td><?php echo $item['shop_id'] ?></td>
                       <td onclick="location.href = '/project/<?php echo $item['shop_id'] ?>'"><?php echo $item['shop_name'] ?></td>
                       <td><a href="http://<?php echo $item['shop_domain'] ?>" target="_blank"><?php echo $item['shop_domain'] ?></a></td>
                       <td><?php if($item['shop_game'] == 1): ?> 
                       <img src="http://api.server-mon.ru/icons/samp.gif">
                       <?php elseif($item['shop_game'] == 2): ?> 
                       <img src="http://api.server-mon.ru/icons/rust.gif">
                       <?php elseif($item['shop_game'] >= 3): ?> 
                       <img src="http://api.server-mon.ru/icons/cs.gif">
                       <?php endif; ?> </td>
                       <td><?php echo $item['shop_balance']?> руб.</td>
                       <td><?php if($item['shop_status'] == 0): ?> 
                       <span class="label label-warning">Ожидает модерации</span>
                       <?php elseif($item['shop_status'] == 1): ?> 
                       <span class="label label-success">Одобрен</span>
                       <?php elseif($item['shop_status'] >= 2): ?> 
                       <span class="label label-danger">Заблокирован</span>
                       <?php endif; ?> </td>
                       <td><?php echo $item['user_login'] ?></td>
                       <td><i class="fa fa-check okRequest" data-id="<?php echo $item['shop_id'] ?>" data-toggle="tooltip" data-placement="top" title="Одобрить"></i>
                       <i class="fa fa-remove aremoveRequestReason" data-id="<?php echo $item['shop_id'] ?>" data-toggle="tooltip" data-placement="top" title="Заблокировать"></i></td>
                      </tr>
                      <?php endforeach; ?> 
                     </tbody>
                    </table>
                </div>
            </div>
        <!-- /#page-wrapper -->

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">Причина блокировки</h4>
              </div>
              <div class="modal-body">
                <input type="hidden" id="shop_id" value="">
                <textarea id="reason" class="form-control" style="width: 100%" rows="2"></textarea>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-primary aremoveRequest">Отправить</button>
              </div>
            </div>
          </div>
        </div>

        <script>
          $(".okRequest").click(function(){
              $.ajax({
              
                url: location.pathname,
                type: "POST",
                data: {ajax: "okRequest", shop_id: $(this).attr("data-id")},
                success: function (data) {
                  console.log(data);
                  if(data == 1){
                    fly_p('1', 'Проект одобрен!');
                    location.href = location.pathname;
                  } else {
                    fly_p('2', 'Произошла ошибка, повторите попытку!');
                  }
                }
                
              })
          });

          $(".aremoveRequestReason").click(function(){
              $("#shop_id").val($(this).attr("data-id"));
              $("#myModal").modal("show");
          });

          $(".aremoveRequest").click(function(){
              $.ajax({
              
                url: location.pathname,
                type: "POST",
                data: {ajax: "aremoveRequest", shop_id: $("#shop_id").val(), reason: $("#reason").val()},
                success: function (data) {
                  console.log(data);
                  if(data == 1){
                    fly_p('1', 'Проект отклонен!');
                    location.href = location.pathname;
                  } else {
                    fly_p('2', 'Произошла ошибка, повторите попытку!');
                  }
                }
                
              })
          });
        </script>
<script>
	$("#grid-data").bootgrid({
	    formatters: {
	        statusMappings: {
	            1: "danger",
	            2: "success",
	            0: "warning",
	        }
	    }
	});
</script>