<?php
require 'assets/data.php';
require 'assets/config.php';
?>

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/blog-togel.css?v=<?php echo rand(0, 99); ?>">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
    <link rel="icon" type="image/png" href="images/ico.png" sizes="192x192">
    <link rel="apple-touch-icon" sizes="180x180" href="images/ico.png">

    <?php

            $sseo = "SELECT content_seo, halaman_seo FROM seo_web WHERE halaman_seo = 'paitopage'";
            $qseo = mysqli_query($data, $sseo);

            if(mysqli_num_rows($qseo) > 0) {
                $fseo = mysqli_fetch_assoc($qseo);
                $seo = $fseo['content_seo'];
                $halaman = $fseo['halaman_seo'];
                    echo $seo;

            }
    ?>

    <?php echo ftab("web_master", "web_setting", "web_master") ?>
    
    <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
</head>
<body>


<div class="row align-items-center">

        <div class="col-xl-12">
            <form>
                <select id="selectpaito" class="form-select form-select-lg mb-3" aria-label=".form-select-lg example">
                <option value="0" selected>Pilih Pasaran</option>
                <?php
                    $spasran = "SELECT nama_pasaranweb FROM pasaran_web";
                    $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 src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/blog-tgel.js"></script>
<?php echo ftab("content_script", "web_setting", "content_script")?>

<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>
</body>
</html>