<?php require 'ust.php';
?>
<?php
$uyeid = $_SESSION["uyeid"];
$uyesor = mysqli_query($db, "SELECT * FROM uyeler WHERE id = '$uyeid'");
$uyedetay = mysqli_fetch_array($uyesor);
$uyesay = mysqli_num_rows($uyesor);
if ($uyesay < 1) {
  echo '<script>window.location.href = "giris.php";</script>';
}
 ?>
<?php
$adi = $_GET["y"];
if(empty($adi)){
  echo '<script>window.location.href = "index.php";</script>';
}else{
  $yorumcusor = mysqli_query($db, "SELECT * FROM yorumcular WHERE ad_url = '$adi'");
  $yorumcusay = mysqli_num_rows($yorumcusor);
  $yorumcudetay = mysqli_fetch_array($yorumcusor);
  if ($yorumcusay < 1){
    echo '<script>window.location.href = "index.php";</script>';
}}
?>
<main id="main">
  <script src="https://code.jquery.com/jquery-1.12.4.js" integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU=" crossorigin="anonymous"></script>
  <section class="breadcrumbs">
    <div class="container">
      <div class="d-flex justify-content-between align-items-center">
        <h2>Tarot Falı Baktırma Sayfası</h2>
        <ol>
          <li><a href="index.php">Ana Sayfa</a></li>
          <li>Tarot Falı Baktırma Sayfası</li>
        </ol>
      </div>
    </div>
  </section>
  <section class="inner-page">
    <div class="container">
      <div class="col-lg-12">
        <div class="row">
          <div class="col-lg-3">
            <div class="col-lg-3 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 ($yorumcudetay["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 ($yorumcudetay["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 ($yorumcudetay["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 ($yorumcudetay["yildiz"] == 1){echo '<i style="color: white; position: absolute; top: 5px;  right: 5px;" class="bi bi-star-fill"></i>';} ?>
            <?php if ($yorumcudetay["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 ($yorumcudetay["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 ($yorumcudetay["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 ($yorumcudetay["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 $yorumcudetay['ad_url']; ?>"><img style="border-radius: 50%; height: 100px; width: 100px; object-fit: cover;" class="card-img-top" src="<?php echo $yorumcudetay['presim']; ?>" alt="profil-resmi"></a>
              <div class="card-body">
                <h5 class="card-title" style="color: white;"><?php echo $yorumcudetay["kadi"]; ?></h5><hr style="color:white;">
                <p class="card-text" style="color: white;"><?php echo $yorumcudetay["kisa_aciklama"]; ?><br><br><br>
                  <?php if($yorumcudetay["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($yorumcudetay["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($yorumcudetay["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 ($yorumcudetay["durum"] == 1) {?>
                <a href="yorumcu.php?a=<?php echo $yorumcudetay["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 $yorumcudetay["ad_url"];?>">  <button type="button" class="btn btn-outline-light" disabled> Çevrim Dışı </button></a>
              <?php } ?>
              </div>
            </center>
           </div>
          </div>
          <div class="col-lg-9">
            <form method="post" action="postlar/falgonder.php">
              <label> <b>Fal Açılımı</b> </label>
              <div class="row my-3">
                <div class="col-lg-2">
                  <label for="exampleFormControlSelect1">Genel Açılım</label>
                  <input onclick="gizle_g('iliskiacilimi');" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
                </div>
                <div class="col-lg-2">
                  <label for="exampleFormControlSelect1">İlişki Açılımı</label>
                  <input onclick="göster_g('iliskiacilimi');" type="radio" name="exampleRadios" id="exampleRadios2" value="option2">
                </div>
              </div>
              <div class="row">
                <label id="sayi10" style="display:block"><b>Lütfen 10 Adet Kart Seçiniz</b></label>
                <label id="sayi7" style="display:none"><b>Lütfen 7 Adet Kart Seçiniz</b></label>
                <div class="col-lg-12 col-md-6 col-sm-4 mx-2 my-2">
                  <?php require 'tarotfonksiyon.php';
                  foreach ($tarotkartisimleri as $kartismi)  {?>
                  <input name="kart[]" type="checkbox" class="form-check-input tarotfalkart" value="<?php echo $kartismi; ?>">
                <?php } ?>
                </div>
              </div>
              <style type="text/css">
                .form-check-input:checked[type=checkbox] {
                  background-image: url('assets/img/falkart.jpg');
                }

                .form-check-input[checked] {
                  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
                }

                .form-check-input:checked {
                  background-color: transparent;
                  border-color: rgba(0, 0, 0, .25);
                }

                .form-check-input[checked] {
                  background-color: #0d6efd;
                  border-color: #0d6efd;
                }

                .tarotfalkart { /* checkbox ları gizleyip arkaplana resim eklendi */
                  width: 70px;
                  height: 80px;
                  background: url('assets/img/falkart.jpg');
                  background-size: 70px 80px;
                  border-radius: 5px;
                  overflow: hidden;
                }
              </style>
              <script>
                let sayi = 0
                let tarotcards = document.querySelectorAll('.tarotfalkart')
                for (var i = 0; i < tarotcards.length; i++) {
                  tarotcards[i].addEventListener('click', function() {
                    if (this.getAttribute('checked') == null) {
                      if (sayi < 10) {
                        sayi++
                        this.toggleAttribute('checked')
                      }else {
                        swal("Uyarı!", "En Fazla 10 Adet Kart Seçebilirsiniz.", "warning");
                      }
                    } else {
                      sayi--
                      this.toggleAttribute('checked')
                    }
                    console.log(sayi)
                  })
                }
              </script>
              <div class="iliskiacilimi" id="iliskiacilimi" style="display:none">
              <label class="my-3"><b>Eşinizin ya da Partnerinizin Bilgilerini Giriniz</b></label>
              <div class="row">
                <div class="col-6">
                  <label for="exampleFormControlSelect1">Partnerinizin Adı</label>
                  <input name="partneradi" style="background:darkgray;" type="text" class="form-control" >
                </div>
                <div class="col-6">
                  <label for="exampleFormControlSelect1">Partnerinizin Burcu</label>
                  <select name="partnerburcu" style="background:darkgray;" class="form-control" id="exampleFormControlSelect1" >
                    <option value="" selected>Seçiniz</option>
                    <option value="Koç">Koç ( 21 Mart - 20 Nisan )</option>
                    <option value="Boğa">Boğa ( 20 Nisan - 21 Mayıs )</option>
                    <option value="İkizler">İkizler ( 22 Mayıs - 22 Haziran )</option>
                    <option value="Yengeç">Yengeç ( 23 Haziran - 22 Temmuz )</option>
                    <option value="Aslan">Aslan ( 23 Temmuz - 22 Ağustos )</option>
                    <option value="Başak">Başak ( 23 Ağustos - 22 Eylül )</option>
                    <option value="Terazi">Terazi ( 23 Eylül - 22 Ekim )</option>
                    <option value="Akrep">Akrep ( 23 Ekim - 21 Kasım )</option>
                    <option value="Yay">Yay ( 22 Kasım - 21 Aralık )</option>
                    <option value="Oğlak">Oğlak ( 22 Aralık - 21 Ocak )</option>
                    <option value="Kova">Kova ( 22 Ocak - 19 Şubat )</option>
                    <option value="Balık">Balık ( 20 Şubat - 20 Mart )</option>
                  </select>
                </div>
              </div>
              <div class="form-group my-4">
              <label for="exampleFormControlSelect1">Partnerinizin Anne Adı</label>
              <input name="partneranneadi" style="background:darkgray;" type="text" class="form-control" >
            </div>
              <div class="form-group my-4">
                <label for="exampleFormControlTextarea1">Partneriniz Hakkında</label>
                <textarea minlength="15" name="partnerhakkinda" style="background:darkgray;" class="form-control" id="fal_partner_hakkinda" rows="3"></textarea>
              </div>
              </div>
            <div class="form-group my-4">
              <label for="exampleFormControlTextarea1">Lütfen Sorularınızı Yazınız</label>
              <textarea minlength="15" name="fal_soru" onkeyup="checkChar()" onkeydown="checkChar()" class="form-control" id="aciklama" rows="3" required></textarea>
              <div id="sonuc" style="text-align:right;"></div>
            </div>
            <script type="text/javascript">
                function gizle_g(id) {
                   var e = document.getElementById(id);
                      e.style.display = 'none';
                }
                function göster_g(id) {
                   var e = document.getElementById(id);
                      e.style.display = 'block';
                }

            </script>
            <script type="text/javascript">
            $(document).ready(function(){
               $("#aciklama").keyup(function(){
           var EnUst=1000;
           $("#sonuc").text('Kalan Karakter : '+EnUst);
           $("#aciklama").focus();
           if(event)
               {
                   var KacRakamVar=$("#aciklama").val().length;
                   var KalanNeKadar=EnUst-KacRakamVar;
                   if(KalanNeKadar<0)
                   {
                       $("#aciklama").val($("#aciklama").val().substr(0,EnUst));
                   }
                   else
                       {
                           $("#sonuc").text('1000/'+KalanNeKadar);
                       }
               }
           });
           });
</script>
            <br><hr>
            <label for="exampleFormControlSelect1"><b>Bilgileriniz</b></label><br>
            <div class="form-group my-4">
              <label for="exampleFormControlInput1">Adınız</label>
              <input type="text" class="form-control" name="fal_ad" value="<?php echo $uyebilgi['ad']." ".$uyebilgi['soyad']; ?>" required>
              <input name="fal_yid" type="hidden" class="form-control" value="<?php echo $yorumcudetay["id"]; ?>">
              <input name="fal_kredi" type="hidden" class="form-control" value="<?php echo $yorumcudetay["fiyatyf"]; ?>">
            </div>
            <div class="form-group my-4">
              <label for="exampleFormControlSelect1">Mesleğiniz</label>
              <select name="fal_meslek" class="form-control" id="exampleFormControlSelect1" required>
                <option value="Diğer" selected>Diğer</option>
                <option value="Ticaret">Ticaret</option>
                <option value"İşsiz"> İşsiz </option>
                <option value"Kamu Sektörü"> Kamu Sektörü </option>
                <option value"Mimar"> Mimar </option>
                <option value"Öğretim Görevlisi/Asistan"> Öğretim Görevlisi/Asistan </option>
                <option value"Halkla İlişkiler"> Halkla İlişkiler </option>
                <option value"Mühendis"> Mühendis </option>
                <option value"Öğrenci"> Öğrenci </option>
                <option value"Sağlık Hizmetleri"> Sağlık Hizmetleri </option>
                <option value"Satış/Pazarlama"> Satış/Pazarlama </option>
                <option value"Sport"> Sport </option>
                <option value"Yöneticilik"> Yöneticilik </option>
                <option value"Hukukçu"> Hukukçu </option>
                <option value"İnsan Kaynakları"> İnsan Kaynakları </option>
                <option value"Müzik"> Müzik </option>
                <option value"Psikolog"> Psikolog </option>
                <option value"Sanatçı"> Sanatçı </option>
                <option value"Turizm"> Turizm </option>
                <option value"Danışmaklık"> Danışmaklık </option>
                <option value"Ev Hanımı"> Ev Hanımı </option>
                <option value"Basın-Yayın"> Basın-Yayın </option>
                <option value"Manken/Model"> Manken/Model </option>
                <option value"Muhasebe"> Muhasebe </option>
                <option value"Otomotiv"> Otomotiv </option>
                <option value"Öğretmen"> Öğretmen </option>
                <option value"Reklam"> Reklam </option>
                <option value"Sigortacı"> Sigortacı </option>
                <option value"Tekstil"> Tekstil </option>
                <option value"Belirtilmemiş"> Belirtilmemiş </option>
                <option value"Emekli"> Emekli </option>
                <option value"Doktor"> Doktor </option>
                <option value"Serbest Meslek"> Serbest Meslek </option>
                <option value"Sağlık Sektörü"> Sağlık Sektörü </option>
              </select>
            </div>
            <div class="form-group my-4">
              <label for="exampleFormControlSelect1">Cinsiyetiniz</label>
              <select name="fal_cinsiyet" class="form-control" id="exampleFormControlSelect1" required>
                <option>Erkek</option>
                <option>Kadın</option>
                <option>LGBT+</option>
              </select>
            </div>
            <div class="form-group my-4">
              <label for="exampleFormControlSelect1">İlişki Durumunuz</label>
              <select name="fal_iliski" class="form-control" id="exampleFormControlSelect1" required>
                <option value="İlişkisi Yok" selected>İlişkisi Yok</option>
                <option> İlişkisi Var </option>
                <option> Evli </option>
                <option> Boşanmış </option>
                <option> Karışık </option>
                <option> Ayrı Yaşıyor </option>
              </select>
            </div>
            <label for="exampleFormControlSelect1">Falınızın Nasıl Yorumlanmasını İstersiniz</label>
            <div class="row my-4">
              <div class="col-lg-2">
                <input name="fal_ysekli" type="radio" class="form-radio-input" value="Sesli">
                <label class="form-check-label" for="exampleCheck1">Sesli</label>
              </div>
              <div class="col-lg-2">
                <input name="fal_ysekli" type="radio" class="form-radio-input" value="Yazılı" checked>
                <label class="form-check-label" for="exampleCheck1">Yazılı</label>
              </div>
              <div class="col-lg-2">
                <input name="fal_ysekli" type="radio" class="form-radio-input" value="Telefonda">
                <label class="form-check-label" for="exampleCheck1">Telefonda</label>
              </div>
            </div>
            <div class="form-check">
              <input name="fal_havuz" type="checkbox" class="form-check-input" id="exampleCheck1" value="evet">
              <label class="form-check-label" for="exampleCheck1">Falınız Havuza Düşsün mü ?</label>
            </div>
            <div class="form-check">
              <input type="checkbox" class="form-check-input" id="exampleCheck1" required>
              <label class="form-check-label" for="exampleCheck1"><b>Kullanım Koşullarını</b> Okudum Kabul Ediyorum</label>
            </div>
            <br><button name="tarotfali" type="submit" class="btn btn-primary" id="gonder">Gönder</button>
          </form>
          </div>
        </div>
      </div>
    </div>
  </section>
  <script type="text/javascript">
    function showPreview1(event) {
      if (event.target.files.length > 0) {
        var src = URL.createObjectURL(event.target.files[0]);
        var preview = document.getElementById("file-ip-1-preview");
        preview.src = src;
        preview.style.display = "block";
      }
    }

    function showPreview2(event) {
      if (event.target.files.length > 0) {
        var src = URL.createObjectURL(event.target.files[0]);
        var preview = document.getElementById("file-ip-2-preview");
        preview.src = src;
        preview.style.display = "block";
      }
    }

    function showPreview3(event) {
      if (event.target.files.length > 0) {
        var src = URL.createObjectURL(event.target.files[0]);
        var preview = document.getElementById("file-ip-3-preview");
        preview.src = src;
        preview.style.display = "block";
      }
    }

    function showPreview4(event) {
      if (event.target.files.length > 0) {
        var src = URL.createObjectURL(event.target.files[0]);
        var preview = document.getElementById("file-ip-4-preview");
        preview.src = src;
        preview.style.display = "block";
      }
    }

    function showPreview5(event) {
      if (event.target.files.length > 0) {
        var src = URL.createObjectURL(event.target.files[0]);
        var preview = document.getElementById("file-ip-5-preview");
        preview.src = src;
        preview.style.display = "block";
      }
    }
  </script>
  <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>

</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>
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<?php require 'footer.php';
?>
