<?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>Kullanıcı Paneli</h2>
        <ol>
          <li><a href="index.php">Ana Sayfa</a></li>
          <li>Kullanıcı Paneli</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">
          <?php require 'panelmenü.php'; ?>
        </div><br>
      <div class="col-lg-9">
            <div class="col-lg-12" data-aos="fade-up" data-aos-delay="100">
              <div class="card">
                  <div class="card-header" style="background: rgba(1, 4, 136, 0.9); text-align: center;">
                    <span style="text-align: center; color: #fff"> Bakılan Fallarınız </span>
                  </div>
                  <div class="card-body">
                    <div class="table-responsive">
                    <table class="table">
                      <thead>
                        <tr>
                          <th scope="col">Fal</th>
                          <th scope="col">Yorumcu</th>
                          <th scope="col">Durumu</th>
                          <th scope="col">Ücreti</th>
                          <th scope="col">Yorum</th>
                          <th scope="col">Sonuç</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                        $bfaluyeid = $_SESSION["uyeid"];
                        $bekleyenfalgetir = mysqli_query($db, "SELECT * FROM kahvefali WHERE uyeid = '$bfaluyeid' AND fal_durum = 'Bakıldı'");
                        while ($fallistele = mysqli_fetch_array($bekleyenfalgetir)) {
                          $yorumcuid = $fallistele["yorumcu_id"];
                        $ydetay =  mysqli_fetch_array(mysqli_query($db, "SELECT * FROM yorumcular WHERE id = '$yorumcuid'"));
                          ?>
                        <tr>
                          <th scope="row">Kahve Falı</th>
                          <td><?php echo $ydetay["ad_soyad"]; ?></td>
                          <td><?php echo $fallistele["fal_durum"]; ?></td>
                          <td><?php echo $fallistele["fal_kredi"]; ?> Kredi</td>
                          <td> <?php echo $fallistele["fal_ysekli"]; ?> </td>
                          <td> <a href="faldetay.php?ft=kahvefali&id=<?php echo $fallistele["id"];?>"><button type="button" class="btn btn-outline-success btn-sm">Detay</button></a> </td>
                        </tr>
                      <?php } ?>
                      <?php
                      $bfaluyeid = $_SESSION["uyeid"];
                      $bekleyenfalgetir = mysqli_query($db, "SELECT * FROM tarotfali WHERE uyeid = '$bfaluyeid' AND durum = 'Bakıldı'");
                      while ($fallistele = mysqli_fetch_array($bekleyenfalgetir)) {
                        $yorumcuid = $fallistele["yid"];
                      $ydetay =  mysqli_fetch_array(mysqli_query($db, "SELECT * FROM yorumcular WHERE id = '$yorumcuid'"));
                        ?>
                      <tr>
                        <th scope="row">Tarot Falı</th>
                        <td><?php echo $ydetay["ad_soyad"]; ?></td>
                        <td><?php echo $fallistele["durum"]; ?></td>
                        <td><?php echo $fallistele["fal_kredi"]; ?> Kredi</td>
                        <td> <?php echo $fallistele["ysekli"]; ?> </td>
                        <td> <a href="faldetay.php?ft=tarotfali&id=<?php echo $fallistele["id"];?>"><button type="button" class="btn btn-outline-success btn-sm">Detay</button></a> </td>
                      </tr>
                    <?php } ?>
                    <?php
                    $bfaluyeid = $_SESSION["uyeid"];
                    $bekleyenfalgetir = mysqli_query($db, "SELECT * FROM katinafali WHERE uyeid = '$bfaluyeid' AND durum = 'Bakıldı'");
                    while ($fallistele = mysqli_fetch_array($bekleyenfalgetir)) {
                      $yorumcuid = $fallistele["yid"];
                    $ydetay =  mysqli_fetch_array(mysqli_query($db, "SELECT * FROM yorumcular WHERE id = '$yorumcuid'"));
                      ?>
                    <tr>
                      <th scope="row">Katina Falı</th>
                      <td><?php echo $ydetay["ad_soyad"]; ?></td>
                      <td><?php echo $fallistele["durum"]; ?></td>
                      <td><?php echo $fallistele["fal_kredi"]; ?> Kredi</td>
                      <td> <?php echo $fallistele["ysekli"]; ?> </td>
                      <td> <a href="faldetay.php?ft=katinafali&id=<?php echo $fallistele["id"];?>"><button type="button" class="btn btn-outline-success btn-sm">Detay</button></a> </td>
                    </tr>
                  <?php } ?>
                  <?php
                  $bfaluyeid = $_SESSION["uyeid"];
                  $bekleyenfalgetir = mysqli_query($db, "SELECT * FROM sufali WHERE uyeid = '$bfaluyeid' AND fal_durum = 'Bakıldı'");
                  while ($fallistele = mysqli_fetch_array($bekleyenfalgetir)) {
                    $yorumcuid = $fallistele["yid"];
                  $ydetay =  mysqli_fetch_array(mysqli_query($db, "SELECT * FROM yorumcular WHERE id = '$yorumcuid'"));
                    ?>
                  <tr>
                    <th scope="row">Su Falı</th>
                    <td><?php echo $ydetay["ad_soyad"]; ?></td>
                    <td><?php echo $fallistele["fal_durum"]; ?></td>
                    <td><?php echo $fallistele["fal_kredi"]; ?> Kredi</td>
                    <td> <?php echo $fallistele["ysekli"]; ?> </td>
                    <td> <a href="faldetay.php?ft=sufali&id=<?php echo $fallistele["id"];?>"><button type="button" class="btn btn-outline-success btn-sm">Detay</button></a> </td>
                  </tr>
                <?php } ?>
                <?php
                $bfaluyeid = $_SESSION["uyeid"];
                $bekleyenfalgetir = mysqli_query($db, "SELECT * FROM yildiznamefali WHERE uyeid = '$bfaluyeid' AND fal_durum = 'Bakıldı'");
                while ($fallistele = mysqli_fetch_array($bekleyenfalgetir)) {
                  $yorumcuid = $fallistele["yid"];
                $ydetay =  mysqli_fetch_array(mysqli_query($db, "SELECT * FROM yorumcular WHERE id = '$yorumcuid'"));
                  ?>
                <tr>
                  <th scope="row">Yıldızname Falı</th>
                  <td><?php echo $ydetay["ad_soyad"]; ?></td>
                  <td><?php echo $fallistele["fal_durum"]; ?></td>
                  <td><?php echo $fallistele["fal_kredi"]; ?> Kredi</td>
                  <td> <?php echo $fallistele["ysekli"]; ?> </td>
                  <td> <a href="faldetay.php?ft=yildiznamefali&id=<?php echo $fallistele["id"];?>"><button type="button" class="btn btn-outline-success btn-sm">Detay</button></a> </td>
                </tr>
              <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  </div>
              </div>
            </div>
      </div>
      </div>
      </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'; ?>
