<!-- Main content -->
<section class="content" style="zoom : 85%;">
  <div class="container-fluid">
    <div class="row">
      <div class="col-12">
        <div class="card">
          <div class="card-header">
            <div class="row">
              <div class="col-6">
                <h3 class="card-title">List Order</h3>
              </div>
              <div class="col-6">
                <ol class="float-sm-right mb-0">
                  <?php
                  if(in_array("Tambah", $json_array[18]['sub_menu'])){ ?>
                    <a href="?<?php echo encrypt_url('order_list_tambah'); ?>" type="button" class="btn btn-danger btn-sm">Tambah</a>
                  <?php } ?>
                </ol>
              </div>
            </div>
          </div>
          <!-- /.card-header -->
          <div class="card-body">
            <table id="example1" class="table table-bordered table-striped">
              <thead>
              <tr>
                <th>Order Time</th>
                <th>Nama</th>
                <th>Alamat</th>
                <th>Desa</th>
                <th>Koordinat</th>
                <th>Nomor WhatsApp</th>
                <th>Server</th>
                <th>Paket</th>
                <th>Dibuat Oleh</th>
                <th>Action</th>
              </tr>
              </thead>
              <tbody>
              <?php
                $aserver = mysqli_query($con,"SELECT * FROM v_order_list WHERE $SqlSvData status = 'order'");
                while ($server = mysqli_fetch_assoc($aserver)) 
                {
              ?>
              <tr>
                <td style="max-width: 100px;"><?php echo $server['time_start']; ?></td>
                <td><?php echo $server['nama']; ?></td>
                <td style="max-width: 200px;"><?php echo $server['alamat']; ?></td>
                <td><?php echo $server['nama_desa']; ?></td>
                <td><a href="https://www.google.com/maps/search/?api=1&query=<?php echo $server['latitude'].','.$server['longitude']; ?>" target="_blank"><?php echo $server['latitude'].', '.$server['longitude']; ?></a></td>
                <td><?php echo $server['nomor_whatsapp']; ?> <a href="https://wa.me/<?php echo $server['nomor_whatsapp']; ?>" target="_blank" style="border-radius: 20px; " class="btn btn-sm btn-success">Chat</a></td>
                <td><?php echo $server['nama_server']; ?></td>
                <td><?php echo $server['nama_paket']; ?></td>
                <td><?php echo $server['create_with']; ?></td>
                <td>
                  <form method="post">
                  <?php if(in_array("Survey", $json_array[18]['sub_menu'])){ ?>
                    <a href="?<?php echo encrypt_url('order_list_update|'.$server['id']); ?>" type="button" class="btn btn-primary btn-sm m-1">Proses Order</a>
                  <?php } if(in_array("Ubah", $json_array[18]['sub_menu'])){ ?>
                    <a href="?<?php echo encrypt_url('order_list_ubah|'.$server['id']); ?>" type="button" class="btn btn-secondary btn-sm m-1">Edit</a>
                  <?php } if(in_array("Hapus", $json_array[18]['sub_menu'])){ ?>
                    <input type="submit" name="hapus<?php echo $server['id'];?>" value="Hapus" class="btn btn-danger btn-sm ml-1" /> 
                  <?php } ?>
                  </form>
                </td>
              </tr>
            <?php
                  if (isset($_POST['hapus'.$server['id']]))
                    {
                      $iddata = $server['id'];
                      deleteAlert("order_list",$iddata );
                    }
             } ?>
              </tbody>
            </table>
          </div>
          <!-- /.card-body -->
        </div>
        <!-- /.card -->
      </div>
      <!-- /.col -->
    </div>
    <!-- /.row -->
  </div>
  <!-- /.container-fluid -->
</section>
<!-- /.content -->