<?php require 'ust.php'; ?>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<main id="main">
  <section class="breadcrumbs">
    <div class="container">
      <div class="d-flex justify-content-between align-items-center">
        <h2>Yorumcular</h2>
        <ol>
          <li><a href="index.php">Ana Sayfa</a></li>
          <li>Yorumcular</li>
        </ol>
      </div>
    </div>
  </section>
  <div class="col-lg-12">
    <div class="container px-4 py-4" style='background:#274778;'>
        <form method="get">
          <div class="row offset-md-2">
            <div class="col-lg-4 my-2">
                <label style="color:white;" for="exampleFormControlSelect1">Başarı Puanına Göre</label>
                  <select name="basari" class="form-control" id="exampleFormControlSelect1">
                    <option value="" selected>Sıralama</option>
                    <option value="dy">Düşükten Yükseğe</option>
                    <option value="yd">Yüksekten Düşüğe</option>
                  </select>
            </div>
            <div class="col-lg-8">
            <div class="row">
            <label style="color:white;">Yorumlama Şekline Göre</label>
            <div class="col-4 col-lg-2">
              <input value="ysses" name="ysses" style="width:30px; height: 30px;" type="checkbox" class="form-check-input" id="exampleCheck1"><br>
              <label style="color:white;" class="form-check-label" for="exampleCheck1">Sesli</label>
            </div>
            <div class="col-4 col-lg-2">
              <input value="ysyazi" name="ysyazi" style="width:30px; height: 30px;" type="checkbox" class="form-check-input" id="exampleCheck2"><br>
              <label style="color:white;" class="form-check-label" for="exampleCheck2">Yazılı</label>
            </div>
            <div class="col-4 col-lg-2">
              <input value="ystel" name="ystel" style="width:30px; height: 30px;" type="checkbox" class="form-check-input" id="exampleCheck3"><br>
              <label style="color:white;" class="form-check-label" for="exampleCheck3">Telefonda</label>
            </div>
            <div class="col-lg-2"><button style="width: 150px;" type="submit" class="btn btn-info">Sırala</button></div>
        </div>
        </div>
        </div>
        </form>
    </div>
    </div>
  <section class="inner-page">
    <div class="container">
      <div class="col-lg-12">
        <center>
          <div class="row mx-4">
<?php
if($_GET){
$basari = $_GET["basari"];
$ysses = $_GET["ysses"];
$ystel = $_GET["ystel"];
$ysyazi = $_GET["ysyazi"];
$ys = $_GET["ys"];
$ys = $_GET["ys"];
if($basari == "dy"){
    $yorumcugetir = "SELECT * FROM yorumcular WHERE onay = '1' ORDER BY yildiz ASC ";
    $yildizsirala = "ORDER BY yildiz ASC";
}
if($basari == "yd"){
    $yorumcugetir = "SELECT * FROM yorumcular WHERE onay = '1' ORDER BY yildiz DESC ";
    $yildizsirala = "ORDER BY yildiz DESC";
}
if($ysses == "ysses"){
    $yorumcugetir = "SELECT * FROM yorumcular WHERE ysses = '1' AND onay = '1' '$yildizsirala'";
}
if($ystel == "ystel"){
    $yorumcugetir = "SELECT * FROM yorumcular WHERE ystel = '1' AND onay = '1' '$yildizsirala'";
}
if($ysyazi == "ysyazi"){
    $yorumcugetir = "SELECT * FROM yorumcular WHERE ysyazi = '1' AND onay = '1' '$yildizsirala'";
}

}else{
$yorumcugetir = "SELECT * FROM yorumcular WHERE onay = '1' ORDER BY RAND()";
}
$yorumcugetirsorgu = mysqli_query($db, $yorumcugetir);
while ($yorumculistele = mysqli_fetch_array($yorumcugetirsorgu)) {
 ?>
 <div class="col-lg-3 col-md-6 card mx-2 my-3" style='margin:auto !important ; margin-bottom: 20px !important; width: 18rem;border-style: solid: color: red; background-image: url("assets/img/ydivrsim.jpg");'><center><br>
     <?php if ($yorumculistele["durum"] == 1) {?>
   <div class="text-success" role="status" style="position: absolute; top: 5px;  left: 5px;"><div style="background:mediumseagreen; border-radius: 5px;">&nbsp; <font color="white"><b> Online </b></font> &nbsp;</div></div>
 <?php } if ($yorumculistele["durum"] == 0) {?>
   <div class="text-danger" role="status" style="position: absolute; top: 5px;  left: 5px;"><div style="background:orangered; border-radius: 5px;">&nbsp; <font color="white"><b> Çevrim Dışı </b></font> &nbsp;</div></div>
 <?php } if ($yorumculistele["durum"] == 2) {?>
   <div class="text-warning" role="status" style="position: absolute; top: 5px;  left: 5px;"><div style="background:orange; border-radius: 5px;">&nbsp; <font color="white"><b> Meşgul </b></font> &nbsp;</div></div>
 <?php } ?>
 <?php if ($yorumculistele["yildiz"] == 1){echo '<i style="color: white; position: absolute; top: 5px;  right: 5px;" class="bi bi-star-fill"></i>';} ?>
 <?php if ($yorumculistele["yildiz"] == 2){echo '<i style="color: white; position: absolute; top: 5px;  right: 5px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 21px;" class="bi bi-star-fill"></i>';} ?>
 <?php if ($yorumculistele["yildiz"] == 3){echo '<i style="color: white; position: absolute; top: 5px;  right: 5px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 21px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 37px;" class="bi bi-star-fill"></i>';} ?>
 <?php if ($yorumculistele["yildiz"] == 4){echo '<i style="color: white; position: absolute; top: 5px;  right: 5px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 21px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 37px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 53px;" class="bi bi-star-fill"></i>';} ?>
 <?php if ($yorumculistele["yildiz"] == 5){echo '<i style="color: white; position: absolute; top: 5px;  right: 5px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 21px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 37px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 53px;" class="bi bi-star-fill"></i><i style="color: white; position: absolute; top: 5px;  right: 69px;" class="bi bi-star-fill"></i>';} ?>
   <a href="yorumcu.php?a=<?php echo $yorumculistele['ad_url']; ?>"><img style="border-radius: 50%; height: 100px; width: 100px; object-fit: cover;" class="card-img-top" src="<?php echo $yorumculistele['presim']; ?>" alt="profil-resmi"></a>
   <div class="card-body">
     <h5 class="card-title" style="color: white;"><?php echo $yorumculistele["kadi"]; ?></h5><hr style="color:white;">
     <p class="card-text" style="color: white;"><?php echo $yorumculistele["kisa_aciklama"]; ?><br><br><br>
       <?php if($yorumculistele["ysses"] == 1) {?><button type="button" class="btn btn-outline-danger" data-toggle="popover" title="Falınız Sesli Kayıt Biçiminde Gönderilir"><i style="font-size: 20px;" class="bi bi-mic-fill"></i></button><?php }else{ ?>
         <button type="button" class="btn btn-outline-danger" data-toggle="popover" title="Falınız Sesli Kayıt Biçiminde Gönderilir" disabled><i style="font-size: 20px;" class="bi bi-mic-fill"></i></button><?php } ?>
       <?php if($yorumculistele["ysyazi"] == 1) {?><button type="button" class="btn btn-outline-warning" data-toggle="tooltip" title="Falınız Yazılı Metin Biçiminde Gönderilir"><i style="font-size: 20px;" class="bi bi-envelope-fill"></i></button><?php }else{ ?>
         <button type="button" class="btn btn-outline-warning" data-toggle="tooltip" title="Falınız Yazılı Metin Biçiminde Gönderilir" disabled><i style="font-size: 20px;" class="bi bi-envelope-fill"></i></button><?php } ?>
       <?php if($yorumculistele["ystel"] == 1) {?><button type="button" class="btn btn-outline-success" data-toggle="tooltip" title="Falınız Telefon Üzerinden Yorumlanır"><i style="font-size: 20px;" class="bi bi-telephone-fill"></i></button><?php }else{ ?>
         <button type="button" class="btn btn-outline-success" data-toggle="tooltip" title="Falınız Telefon Üzerinden Yorumlanır" disabled><i style="font-size: 20px;" class="bi bi-telephone-fill"></i></button><?php } ?>
     </p>
     <?php if ($yorumculistele["durum"] == 1) {?>
     <a href="yorumcu.php?a=<?php echo $yorumculistele["ad_url"];?>">  <button type="button" class="btn btn-outline-light" > Hemen Fal Baktır </button></a>
   <?php }else {?>
     <a href="yorumcu.php?a=<?php echo $yorumculistele["ad_url"];?>">  <button type="button" class="btn btn-outline-light" disabled> Çevrim Dışı </button></a>
   <?php } ?>
   </div>
 </center>
</div>
        <?php } ?>
          </div>
        </center>
      </div>
    </div>
  </section>
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
<?php require 'footer.php'; ?>
