<div class="row align-items-center">
        <div class="col-xl-8 text-light">
        </div>
  
        <div class="col-xl-4">
            <form>
                <select id="selectpaito" class="form-select form-select-sm mb-3" aria-label=".form-select-lg example">
                <option value="0" selected>Pilih Pasaran</option>
                <?php
                    require_once('../data.php');
                    require_once('../config.php');

                    $spasran = "SELECT nama_pasaranweb FROM pasaran_web WHERE nama_pasaranweb != 'totomacau-15-5d' AND nama_pasaranweb != 'totomacau-21-5d'";
                    $qpasran = mysqli_query($data, $spasran);
  
                    if(mysqli_num_rows($qpasran) > 0) {
                        while($fpasran = mysqli_fetch_assoc($qpasran)) {
                            $pasarn = $fpasran['nama_pasaranweb'];
  
                            echo '<option class="pasaranv" value="'.$pasarn.'">'.$pasarn.'</option>';
  
                        }
                    }
                    ?>
                </select>
            </form>
        </div>
  
    </div>
<hr/>
<div id="loading"><p>Mohon ditunggu...</p></div>
<div id="result-paito"></div>


<form class="d-flex justify-content-center my-3" id="formpaito">
<input maxlength="1" placeholder="As" class="cari form-control" type="text" id="asc" />
<input maxlength="1" placeholder="Kop" class="cari form-control" type="text" id="kopc" />
<input maxlength="1" placeholder="Kep" class="cari form-control" type="text" id="kepalac" />
<input maxlength="1" placeholder="Ekr" class="cari form-control" type="text" id="ekorc" />
<input maxlength="1" placeholder="Jml" class="cari form-control" type="text" id="jmlc" />
<input id="rb" type="button" class="btn btn-danger btn-sm" value="Hapus" onclick="hapusPaito()"/>
</form>

<script>
    $(function () {
    $("#jmlc").keyup(function () {
        $(".addi-paito").each(function () {
            if ($.trim($("#jmlc").val()).length) {
                var a = $(this).text(),
                    b = $("#jmlc").val();
                a == b && $(this).addClass("j" + $(this).text());
            } else $(this).removeClass("j" + $(this).text());
        });
    }),
        $("#ekorc").keyup(function () {
            $(".p-num:nth-child(5n+4)").each(function () {
                if ($.trim($("#ekorc").val()).length) {
                    var a = $(this).text(),
                        b = $("#ekorc").val();
                    a == b && $(this).addClass("e" + $(this).text());
                } else $(this).removeClass("e" + $(this).text());
            });
        }),
        $("#kepalac").keyup(function () {
            $(".p-num:nth-child(5n+3)").each(function () {
                if ($.trim($("#kepalac").val()).length) {
                    var a = $(this).text(),
                        b = $("#kepalac").val();
                    a == b && $(this).addClass("k" + $(this).text());
                } else $(this).removeClass("k" + $(this).text());
            });
        }),
        $("#kopc").keyup(function () {
            $(".p-num:nth-child(5n+2)").each(function () {
                if ($.trim($("#kopc").val()).length) {
                    var a = $(this).text(),
                        b = $("#kopc").val();
                    a == b && $(this).addClass("c" + $(this).text());
                } else $(this).removeClass("c" + $(this).text());
            });
        }),
        $("#asc").keyup(function () {
            $(".p-num:nth-child(5n+1)").each(function () {
                if ($.trim($("#asc").val()).length) {
                    var a = $(this).text(),
                        b = $("#asc").val();
                    a == b && $(this).addClass("a" + $(this).text());
                } else $(this).removeClass("a" + $(this).text());
            });
        });
});

function hapusPaito() {
        document.getElementById("formpaito").reset();
      }

      $(document).ready(function(){
        $("#rb").click(function(){
          $('td').removeClass('e1 e2 e3 e4 e5 e6 e7 e8 e9 e0 k1 k2 k3 k4 k5 k6 k7 k8 k9 k0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c0 a1 a2 a3 a4 a5 a6 a7 a8 a9 j0 j1 j2 j3 j4 j5 j6 j7 j8 j9 j0');
       
        });
      });
</script>