<?php if(!defined("Hacking")){die("404 Not Found"); } ?>

<div id="tour-11" class="header-content">
  <h2><i class="fa fa-globe"></i>Hizmet Ayar Paneli</h2>
</div>
<div class="body-content animated fadeIn">
  <div class="row">
    <div class="col-md-12">
      <div class="panel">
        <div class="panel-body no-padding">
          <div class="table-responsive">
            <table class="table table-bordered table-middle">
              <thead>
                <tr>
                  <th>Hizmet Adı</th>
                  <th>Sef-Link</th>
                  <th class="text-center">İcon / Resim</th>
                  <th>Gizle/Göster</th>
                  <th>Sıralama</th>
                  <th class="text-center" style="width: 11%;">İşlem</th>
                </tr>
              </thead>
              <tbody>
                <?php
                if(@$_GET["islev"] != ""){
                    $db->query("UPDATE sayfalar SET sira='0' WHERE sayfa_id='".$_GET["id"]."' AND sayfa_type=3");
                    if($_GET["islev"] == "asagi"){
                     $yeni_sira = $_GET["sira"] + 1;
                    }elseif($_GET["islev"] == "yukari"){
                      $yeni_sira = $_GET["sira"] - 1;
                    }
                    $db->query("UPDATE sayfalar SET sira='".$_GET["sira"]."' WHERE sira='".$yeni_sira."' AND sayfa_type=3");
                    $db->query("UPDATE sayfalar SET sira='".$yeni_sira."' WHERE sira='0' AND sayfa_type=3");
                }

                            //$hizmetler2 = $Sayfa->hizmetler_listele2();
                            $hizmetler2 = $Modul->sayfalamastart($kayitsayisi,'sayfalar',3);

                            foreach ($hizmetler2 as $key => $value){

                        ?>
                <tr class="border-danger">
                  <td><?php echo $value['sayfa_baslik']; ?></td>
                  <td><?php echo $value['sayfa_seflink']; ?></td>
                  <?php if(substr($value['hizmeticon'],0,1)=="{"){ ?>
                  <td align="center"><i class="fa <?=substr($value['hizmeticon'],1)?>" style="font-size:30px;" title="Kod:  (fa <?=substr($value['hizmeticon'],1)?>)"></i></td>
                <?php } else { ?>
                  <td align="center"><img src="../upload/images/<?=substr($value['hizmeticon'],1)?>" width="40" height="40"></td>
                <?php } ?>
                <td>
                  <label class="switch">

                    <input type="checkbox" id="toggle[<?=$value['sayfa_id']?>]" name="toggle" <?php if($value['aktifkontrol']=="aktif"){ print "checked"; } ?> onclick="aktifkontrol(<?=$value['sayfa_id']?>,'sayfalar');">
                    <span class="slider round"></span>
                  </label>
                </td>
                  <td align="center">
                    <?php if($value["sira"] != "1"){?><a href="index.php?do=hizmetler2&islev=yukari&id=<?=$value["sayfa_id"]?>&sira=<?=$value["sira"]?>"><i class="fa fa-arrow-up fa-2x" style="color:green;"></i></a> <?php } ?>
    &nbsp;  &nbsp; <?php if($value["sira"] != Count($hizmetler2)){?><a href="index.php?do=hizmetler2&islev=asagi&id=<?=$value["sayfa_id"]?>&sira=<?=$value["sira"]?>"><i class="fa fa-arrow-down fa-2x" style="color:red;"></i></a><?php } ?>
                  </td>
                  <td class="text-center"><a href="index.php?do=hizmetler2&duzenle=<?php echo $value['sayfa_id']; ?>" class="btn btn-success btn-s"> <i class="fa fa-edit"></i></a>
                                          <a href="#" onclick="itemsil(<?php echo $value['sayfa_id']?>,'','<?php echo $value['sayfa_baslik']?>','hizmetler2');" class="btn btn-danger btn-s"> <i class="fa fa-trash-o"></i></a></td>
                </tr>
                <?php } ?>
              </tbody>
            </table>
          </div>
        </div>
    </div>
  </div>
  </div>
  <?php
    $Modul->sayfalama('hizmetler2',"sayfalar",$kayitsayisi,3);
  ?>
</div>
