<div class="row">
        <div class="col-md-12">
                <div class="card border border-danger">
                    <form method="POST" action="config/add-result.php" class="form-horizontal">
                        <div class="card-body">
                            <h4 class="card-title"><i class="mdi mdi-plus-circle"></i> Tambah Manual Result/Paito</h4>
                            <div class="form-group row">

                                <label class="col-sm-3 text-right control-label col-form-label">Pilih Pasaran:</label>
                                <div class="col-sm-9">
                                        <select name="preresult" class="custom-select" required>
                                            <option value="">Belum Dipilih</option>
                                            <?php
                                                $spas = "SELECT * FROM pasaran_web";
                                                $qpas = mysqli_query($data, $spas);

                                                if(mysqli_num_rows($qpas) > 0) {
                                                    while($fpas = mysqli_fetch_assoc($qpas)) {
                                                        $pasran = $fpas['nama_pasaranweb'];
                                                        echo '<option class="text-capitalize" value="'.$pasran.'">'.$pasran.'</option>';
                                                    }
                                                }
                                            ?>
                                        </select>    
                                </div>

                            </div>

                            <div class="form-group row">
                                <label class="col-sm-3 text-right control-label col-form-label">Angka :</label>

                                    <div class="col-sm-3">
                                        <input type="text" name="angkaresult" placeholder="Masukkan Angka Result" maxlength="6" class="form-control" required>
                                    </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-3 text-right control-label col-form-label">Tanggal :</label>

                                    <div class="col-sm-3">
                                        <input type="text" name="jamresult" id="jamresult" placeholder="Masukkan Jam Result" class="form-control" required>
                                    </div>
                            </div>

                            
                            <div class="card-body my-3">
                                <button type="submit" class="btn float-right btn-primary"><i class="mdi mdi-plus-circle"></i> Tambahkan Result</button>
                            </div>
                    </form>
                </div>
        </div>

        <div class="col-xl-12">
        <div class="card border border-info">
        <div class="card-body">
                                <h5 class="card-title m-b-0"><i class="mdi mdi-dice-d20"></i> Semua Result</h5>
                            </div>
                            <table id="prediksi-block" class="table font-weight-bold">
                                  <thead>
                                    <tr>
                                      <th scope="col">#</th>
                                      <th scope="col">Pasaran</th>
                                      <th scope="col">Angka</th>
                                      <th scope="col">Tanggal</th>
                                      <th scope="col">Action</th>
                                    </tr>
                                  </thead>
                                  <tbody>

                                  <?php

                                    $spre = "SELECT * FROM result_lotto ORDER BY res_jam DESC";
                                    $qpre = mysqli_query($data, $spre);

                                        if(mysqli_num_rows($qpre) > 0) {
                                            $n = 1;
                                            while($fpre = mysqli_fetch_assoc($qpre)) {
                                                $pasaranpre = $fpre['res_pasaran'];
                                                $angkares = $fpre['res_angka'];
                                                $tglpre = $fpre['res_jam'];
                                                $idpre = $fpre['id'];

                                                echo '
                                                <tr>
                                                <th scope="row">'.$n++.'</th>
                                                <td class="text-uppercase"><img class="rounded" src="assets/images/icon-market/'.$pasaranpre.'.webp" width="50" /> '.$pasaranpre.'</td>
                                                <form method="post" action="config/update-resultlotto.php?row='.$idpre.'">
                                                <td class="text-capitalize"><input type="text" class="form-control" name="updangka" maxlength="6" value="'.$angkares.'" /></td>
                                                <td> '.date("d M Y | H:i:s", strtotime($tglpre)).'</td>
                                                <td><button type="submit" class="btn btn-primary"><i class="fas fa-check"></i> Edit</button> <a href="config/delresult.php?row='.$idpre.'" class="btn btn-danger"><i class="fas fa-times"></i> Hapus</a></td>
                                                </form>
                                                </tr>
                                                ';

                                            }

                                        } else {

                                        }

                                    ?>


                                    

                                  </tbody>
                            </table>

         </div>

         

         
</div>