
<?php $__env->startSection('content'); ?>
<main id="main" class="main">

    <div class="pagetitle">
      <h1>Kritik & Saran</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a>Dashboard</a></li>
          <li class="breadcrumb-item active">Kritik & Saran</li>
        </ol>
      </nav>
    </div><!-- End Page Title -->

    <section class="section dashboard">
      <?php if(Session::get('msg')): ?>
      <div class="alert alert-success alert-dismissible fade show" role="alert">
          <i class="bi bi-check-circle me-1"></i>
                <?php echo e(Session::get('msg')); ?>

          <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
      </div>
      <?php endif; ?>

      <?php if(Session::get('user')->role == 3): ?>
      <div class="row">

        <div class="col-lg-6">

          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Kritik & Saran</h5>

              <!-- Vertical Form -->
              <form class="row g-3" method="POST" action="/dashboard/krisar/add">
                <?php echo csrf_field(); ?>

                <div class="col-md-6">
                  <div class="form-floating">
                    <input type="text" class="form-control" id="floatingName" placeholder="Nama Anda" name="name" >
                    <label for="floatingName">Masukkan Nama Anda</label>
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-check">
                    <input class="form-check-input" type="checkbox" id="anonymous" name="anonymous" value="1">
                    <label class="form-check-label" for="gridCheck1">
                        Rahasiakan nama anda
                    </label>
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-floating">
                    <textarea type="text" class="form-control" id="floatingPassword" placeholder="Tempat Lahir" name="krisar" style="height: 400%"></textarea>
                    <label for="floatingPassword">Masukkan Kritik & Saran anda</label>
                  </div>
                </div>
                <div>
                  <button type="submit" class="btn btn-primary" >Kirim</button>
                </div>
              </form><!-- Vertical Form -->

            </div>
          </div>

        </div>

      </div>
      <?php endif; ?>

      <?php if(Session::get('user')->role == 1): ?>
      <div class="row">
        <div class="col-lg-12">
          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Data Kritik & Saran</h5>
              <table class="table" id="table">
                <thead>
                  <tr>
                    <th scope="col">#</th>
                    <th scope="col">Nama</th>
                    <th scope="col">Kritik & Saran</th>
                    <th scope="col">Waktu</th>
                  </tr>
                </thead>
                <tbody>
                  <?php 
                    $i = 1;
                  ?>
                  <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $datas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr>
                    <td scope="row"><?php echo e($i++); ?></td>
                    <?php if($datas->anonymous == 1): ?>
                      <td><span class="badge bg-warning">Pengirim Merahasiakan Namanya</span></td>
                    <?php endif; ?>
                    <?php if($datas->anonymous == 2): ?>
                      <td><?php echo e($datas->name); ?></td>
                    <?php endif; ?>
                    <td><?php echo e($datas->krisar); ?></td>
                    <td><?php echo e($datas->created_at); ?></td>
                  </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>  
                </tbody>
              </table>
              <!-- End Default Table Example -->
            </div>
          </div>
        </div>
      </div>
      <?php endif; ?>
    </section>

  </main><!-- End #main -->
<?php $__env->stopSection(); ?>
<?php echo $__env->make('dashboard.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/tpsa4296/public_html/tpscmalang/resources/views/dashboard/krisar.blade.php ENDPATH**/ ?>