<?php if(!defined("Hacking")){die("404 Not Found"); } ?>
<?php
    $id = "1";
    error_reporting(0);
    if(isset($_POST['modulguncelle'])){
			$ekibimiz        	=	$_POST["ekibimiz"];
			$hizmetler	      =	$_POST["hizmetler"];
			$blog	            =	$_POST["blog"];
			$multimedya      	=	$_POST["multimedya"];
			$sss		         	=	$_POST["sss"];
			$anasayfamarkalar	=	$_POST["anasayfamarkalar"];
			$anasayfaurunler	=	$_POST["anasayfaurunler"];
			$referanslar	=	$_POST["referanslar"];
      $headerdurum	=	$_POST["headerdurum"];
      $headeryazi	=	$_POST["headeryazi"];
      $bodydurum	=	$_POST["bodydurum"];
      $bodyyazi	=	$_POST["bodyyazi"];
      $footerdurum	=	$_POST["footerdurum"];
      $footeryazi	=	$_POST["footeryazi"];
      $bakimmodudurum	=	$_POST["bakimmodudurum"];
      $bakimmoduyazi	=	$_POST["bakimmoduyazi"];
      $fiyatgoster	=	$_POST["fiyatgoster"];
      $fiyattext    =$_POST["fiyattext"];
      $calismasaatleri = $_POST["calismasaatleri"];
      $krokigoster = $_POST["krokigoster"];


      $sql = $db->prepare("SELECT * FROM modul_ayarlari WHERE id = ?");
      $sql->execute(array($id));
      $row=$sql->fetch(PDO::FETCH_ASSOC);

      if($fiyatgoster == "pasif")
      {
          if($fiyattext==null || $fiyattext=="")
            $fiyattext = $row["fiyattext"];
          else
            $fiyattext = $_POST["fiyattext"];
      }
      else {
          $fiyattext = $row["fiyattext"];
      }
          echo '<div class="alert alert-success">
              <strong>Tebrikler!</strong> Modül ayarlarınız güncellendi, Lütfen Bekleyin...
          </div>';
          echo "<meta http-equiv='refresh' content=0;URL='index.php?do=modul_ayarlari'>";

$sorgu = $db->prepare("UPDATE modul_ayarlari SET
  ekibimiz=:ekibimiz,
  hizmetler=:hizmetler,
  blog=:blog,
  multimedya=:multimedya,
  sss=:sss,
  anasayfamarkalar=:anasayfamarkalar,
  anasayfaurunler=:anasayfaurunler,
  referanslar=:referanslar,
  headerdurum=:headerdurum,
  headeryazi=:headeryazi,
  bodydurum=:bodydurum,
  bodyyazi=:bodyyazi,
  footerdurum=:footerdurum,
  footeryazi=:footeryazi,
  bakimmodudurum=:bakimmodudurum,
  bakimmoduyazi=:bakimmoduyazi,
  fiyatgoster=:fiyatgoster,
  fiyattext=:fiyattext,
  calismasaatleri=:calismasaatleri,
  krokigoster=:krokigoster
  Where id = ".$id." ");

$sorgu->execute(array(
  ':ekibimiz'=>$ekibimiz,
  ':hizmetler'=>$hizmetler,
  ':blog'=>$blog,
  ':multimedya'=>$multimedya,
  ':sss'=>$sss,
  ':anasayfamarkalar'=>$anasayfamarkalar,
  ':anasayfaurunler'=>$anasayfaurunler,
  ':referanslar'=>$referanslar,
  ':headerdurum'=>$headerdurum,
  ':headeryazi'=>$headeryazi,
  ':bodydurum'=>$bodydurum,
  ':bodyyazi'=>$bodyyazi,
  ':footerdurum'=>$footerdurum,
  ':footeryazi'=>$footeryazi,
  ':bakimmodudurum'=>$bakimmodudurum,
  ':fiyatgoster' => $fiyatgoster,
  ':fiyattext' => $fiyattext,
  ':calismasaatleri' => $calismasaatleri,
  ':krokigoster' => $krokigoster,
  ':bakimmoduyazi'=>$bakimmoduyazi ));

}
$sql = $db->prepare("SELECT * FROM modul_ayarlari WHERE id = ?");
$sql->execute(array($id));
$row=$sql->fetch(PDO::FETCH_ASSOC);
?>

<div id="tour-11" class="header-content">
  <h2><i class="fa fa-magic"></i>Modül Ayarları</h2>
</div>
<div class="body-content animated fadeIn">
<div class="row">
  <div class="col-md-12">
    <div class="panel rounded shadow">
      <div class="panel-body no-padding">
        <form action="" method="post" enctype="multipart/form-data">
          <!-- Start -->
  <div class="row">
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["ekibimiz"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Ekibimiz </strong><i class="fa fa-users"></i>
              </label>
              <select name="ekibimiz" class="form-control">
                <option value="aktif" <?php if($row['ekibimiz'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['ekibimiz'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["hizmetler"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Hizmetler </strong><i class="fa fa-globe"></i>
              </label>
              <select name="hizmetler" class="form-control">
                <option value="aktif" <?php if($row['hizmetler'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['hizmetler'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["blog"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Blog </strong><i class="fa fa-newspaper-o"></i>
              </label>
              <select name="blog" class="form-control">
                <option value="aktif" <?php if($row['blog'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['blog'] == "pasif"){ print "selected";} ?>>Sadece Ana Sayfada Pasifleştir</option>
                <option value="kapali" <?php if($row['blog'] == "kapali"){ print "selected";} ?>>Modülü Tamamen Kapat</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["multimedya"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Multimedya </strong><i class="fa fa-picture-o"></i>
              </label>
              <select name="multimedya" class="form-control">
                <option value="aktif" <?php if($row['multimedya'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="fotogaleriaktif" <?php if($row['multimedya'] == "fotogaleriaktif"){ print "selected";} ?>>Sadece Foto Galeri Aktifleştir</option>
                <option value="videogaleriaktif" <?php if($row['multimedya'] == "videogaleriaktif"){ print "selected";} ?>>Sadece Video Galeri Aktifleştir</option>
                <option value="kapali" <?php if($row['multimedya'] == "kapali"){ print "selected";} ?>>Modülü Tamamen Kapat</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
    </div>

    <div class="row">
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["sss"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Sıkça Sorulan Sorular </strong><i class="fa fa-question-circle"></i>
              </label>
              <select name="sss" class="form-control">
                <option value="aktif" <?php if($row['sss'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['sss'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["anasayfamarkalar"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Markalar </strong><i class="fa fa-camera"></i>
              </label>
              <select name="anasayfamarkalar" class="form-control">
                <option value="aktif" <?php if($row['anasayfamarkalar'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['anasayfamarkalar'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->

          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["anasayfaurunler"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Ürünler </strong><i class="fa fa-shopping-cart"></i>
              </label>
              <select name="anasayfaurunler" class="form-control">
                <option value="aktif" <?php if($row['anasayfaurunler'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="anasayfaaktif" <?php if($row['anasayfaurunler'] == "anasayfaaktif"){ print "selected";} ?>>Sadece Ana Sayfada Aktifleştir</option>
                <option value="anasayfapasif" <?php if($row['anasayfaurunler'] == "anasayfapasif"){ print "selected";} ?>>Sadece Ana Sayfada Pasifleştir</option>
                <option value="pasif" <?php if($row['anasayfaurunler'] == "pasif"){ print "selected";} ?>>Modülü Tamamen Kapat</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["referanslar"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Referanslar </strong><i class="fa fa-camera"></i>
              </label>
              <select name="referanslar" class="form-control">
                <option value="aktif" <?php if($row['referanslar'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['referanslar'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->

   </div>

    <div class="row">
      <!-- Start -->
      <div class="col-md-3 form-body">
        <div class="form-group">
          <label class="control-label">
          &nbsp;<li class="fa fa-sliders"></li>
          &nbsp; <?php if($row["calismasaatleri"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
            Çalışma Saatleri </strong><i class="fa fa-clock-o" aria-hidden="true"></i>
          </label>
          <select name="calismasaatleri" class="form-control">
            <option value="aktif" <?php if($row['calismasaatleri'] == "aktif"){ print "selected";} ?>>Aktif</option>
            <option value="pasif" <?php if($row['calismasaatleri'] == "pasif"){ print "selected";} ?>>Pasif</option>
          </select>
        </div>
      </div>
      <!-- Stop -->
      <!-- Start -->
      <div class="col-md-3 form-body">
        <div class="form-group">
          <label class="control-label">
          &nbsp;<li class="fa fa-sliders"></li>
          &nbsp; <?php if($row["krokigoster"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
            Harita </strong><i class="fa fa-map-marker" aria-hidden="true"></i>
          </label>
          <select name="krokigoster" class="form-control">
            <option value="aktif" <?php if($row['krokigoster'] == "aktif"){ print "selected";} ?>>Aktif</option>
            <option value="pasif" <?php if($row['krokigoster'] == "pasif"){ print "selected";} ?>>Pasif</option>
          </select>
        </div>
      </div>
      <!-- Stop -->
      <!-- Start -->
      <div class="col-md-3 form-body">
        <div class="form-group">
          <label class="control-label">
          &nbsp;<li class="fa fa-sliders"></li>
          &nbsp; <?php if($row["fiyatgoster"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
            Site Ürün Fiyatları </strong><i class="fa fa-try" aria-hidden="true"></i>
          </label>
          <select name="fiyatgoster" class="form-control">
            <option value="aktif" <?php if($row['fiyatgoster'] == "aktif"){ print "selected";} ?>>Aktif</option>
            <option value="pasif" <?php if($row['fiyatgoster'] == "pasif"){ print "selected";} ?>>Pasif</option>
          </select>
        </div>
      </div>
      <!-- Stop -->
      <!-- Start -->
	  <?php if($row['fiyatgoster'] == "pasif"){ ?>
      <div class="col-md-3 form-body">
        <div class="form-group">
          <label class="control-label">
          &nbsp;<li class="fa fa-sliders"></li>
          &nbsp;<strong style='color:green;'> <i class='fa fa-check'></i>
            Fiyat Yerinde Ne Yazılsın? </strong><i class="fa fa-pencil" aria-hidden="true"></i>
          </label>
          <input class="form-control" type="text" name="fiyattext" value="<?=$row['fiyattext']?>" placeholder="Örn: Fiyat Sorunuz">
        </div>
      </div>
	  <?php } ?>
      <!-- Stop -->
    </div>
</div>

          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["headerdurum"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Header </strong><i class="fa fa-level-up" aria-hidden="true"></i>
              </label>
              <textarea name="headeryazi" class="form-control" rows="17"><?php echo $row['headeryazi']; ?></textarea>
              <select name="headerdurum" class="form-control">
                <option value="aktif" <?php if($row['headerdurum'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['headerdurum'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["bodydurum"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Body </strong><i class="fa fa-arrows-h" aria-hidden="true"></i>
              </label>
              <textarea name="bodyyazi" class="form-control" rows="17"><?php echo $row['bodyyazi']; ?></textarea>
              <select name="bodydurum" class="form-control">
                <option value="aktif" <?php if($row['bodydurum'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['bodydurum'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["footerdurum"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Footer </strong><i class="fa fa-level-down" aria-hidden="true"></i>
              </label>
              <textarea name="footeryazi" class="form-control" rows="17"><?php echo $row['footeryazi']; ?></textarea>
              <select name="footerdurum" class="form-control">
                <option value="aktif" <?php if($row['footerdurum'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['footerdurum'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <!-- Start -->
          <div class="col-md-3 form-body">
            <div class="form-group">
              <label class="control-label">
              &nbsp;<li class="fa fa-sliders"></li>
              &nbsp;<?php if($row["bakimmodudurum"] == "aktif"){ print "<strong style='color:green;'> <i class='fa fa-check'></i>"; }else{ print "<strong style='color:red;'> <i class='fa fa-times'></i>"; } ?>
                Bakım Modu </strong><i class="fa fa-window-maximize" aria-hidden="true"></i>
              </label>
              <textarea class="ckeditor" id="editor1" name="bakimmoduyazi" class="form-control"><?php echo $row['bakimmoduyazi']; ?></textarea>
              <select name="bakimmodudurum" class="form-control">
                <option value="aktif" <?php if($row['bakimmodudurum'] == "aktif"){ print "selected";} ?>>Aktif</option>
                <option value="pasif" <?php if($row['bakimmodudurum'] == "pasif"){ print "selected";} ?>>Pasif</option>
              </select>
            </div>
          </div>
          <!-- Stop -->
          <div class="form-footer">
            <div class="pull-left">
              <button name="modulguncelle" class="btn btn-primary mr-5" type="submit">
              <li class="fa fa-floppy-o"></li>
              &nbsp;&nbsp;Ayarları Kaydet</button>
            </div>
            <div class="clearfix"></div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
