<?php
include('session.php');

?>

<html lang="en">

<head>
    <title><?php echo $s0['instansi']; ?>: User Area</title>

    <!-- Meta -->
    <meta charset="utf-8">
    <!-- <meta content="width=device-width, initial-scale=1.0" name="viewport"> -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=0.65, maximum-scale=1, minimum-scale=0.65">
    <meta name="theme-color" content="#272b30">

    <!-- Favicon -->
    <link rel="icon" type="image/png" href="<?php echo $urlwebs; ?>/upload/favicon.png">

    <!-- CSS Global Compulsory -->

    <link rel="stylesheet" href="<?php echo $urlwebs; ?>/assets/home/bootstrap.web.min.css">
    <link href="https://fonts.googleapis.com/css?family=Abel" rel="stylesheet">
    <style>
        .blink_me {
            animation: blinker 1s step-start infinite;
        }

        @keyframes blinker {
            20% {
                opacity: 0.2;
            }
        }
    </style>
    <!-- JS Global Compulsory -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script src="<?php echo $urlwebs; ?>/js/4dv5.js"></script>
    <script>
        function secondtominute(d) {
            var m = Math.floor(d / (60));
            var s = d - (m * 60);
            if (s < 10) s = '0' + s;
            return m + ':' + s;
        }
    </script>

</head>
<?php include('uptop.php'); ?>


    

        <div class="clearfix"></div>
        <link rel="stylesheet" href="<?php echo $urlwebs; ?>/assets/home/m.css">
        <!-- MAIN TAB -->

        <?php include('navtab.php'); ?>


        <div class="tab-content">




            <div id="toto_wrap" class="tab-pane fade in active">
                <div class="row" style="margin-top:0px; margin-bottom:10px;">
                    <div class="col-xs-4" style="padding-right:2px;">

                        <a class="btn btn-default btn-block active" href="<?php echo $urlwebs; ?>/m/togel.php"><span class="glyphicon glyphicon-calendar"></span>Pasaran</a>
                    </div>
                    <div class="col-xs-4" style="padding-right:2px; padding-left:0px">

                        <a class="btn btn-default btn-block " href="?keluaran"><span class="glyphicon glyphicon-bell"></span>Keluaran</a>
                    </div>

                    <div class="col-xs-4" style="padding-left:0px">
                        <a class="btn btn-default btn-block " href="?bukumimpi"><span class="glyphicon glyphicon-book"></span>Buku Mimpi</a>
                    </div>
                </div>

                <div class="dashboard pt-5 pb-5">
      <div class="container">
        <div class="row">
          
          <div class="col-sm-8">
            <?php
              $pid = $_GET['pid'];
              $getPasaran = mysqli_query($conn,"SELECT * FROM `tb_pasaran` WHERE cuid = '$pid'") or die(mysqli_error());
              $gp = mysqli_fetch_array($getPasaran);
            ?>
            <div class="card">
              <div class="card-body p-2">
                <div class="mt-2 mb-3 text-dark" style="background: #e4d00a; color: #000; padding: 20px 10px;">
                  <h5 class="text-dark mb-0">MARKET : <?php echo $gp['title']; ?><span class="float-right"><button type="button" data-toggle="modal" data-target="#modalPasaran" class="btn btn-primary" style="margin-top: -12px;">Change</button></span></h5>
                  <div class="modal fade" id="modalPasaran" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
                    <div class="modal-dialog modal-dialog-centered">
                      <div class="modal-content" style="background: #101010; border: 2px solid #e4d00a; border-radius: 0;">
                        <div class="modal-header">
                          <h5 class="modal-title" id="exampleModalLabel">Market</h5>
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                          </button>
                        </div>
                        <div class="modal-body">
                          <table class="table">
                            <thead>
                              <tr class="bg-warning text-dark">
                                <th class="text-center pt-2 pb-2">Market</th>
                                <th class="text-center pt-2 pb-2"></th>
                              </tr>
                            </thead>
                            <tbody>
                              <?php
                                $getPasarans = mysqli_query($conn,"SELECT * FROM `tb_pasaran` ORDER BY cuid ASC") or die(mysqli_error());
                                while($gps = mysqli_fetch_array($getPasarans)){
                              ?>
                              <tr>
                                <td style="border-top: 0; vertical-align: middle; color: #fff; width: 80%;"><?php echo $gps['title']; ?></td>
                                <td style="border-top: 0; vertical-align: middle; color: #fff;">
                                  <a href="<?php echo $urlweb; ?>/m/taruhan.php/?pid=<?php echo $gps['cuid']; ?>" class="btn btn-warning text-dark">Choose</a>
                                </td>
                              </tr>
                              <?php } ?>
                            </tbody>
                          </table>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <?php
                  $timeNow = date('H:i:s');
                  if($timeNow < $gp['close_result'] || $timeNow > $gp['time_result']) {
                ?>
                <div class="text-center">
                  <?php
                    $getGame = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 0 ORDER BY cuid ASC") or die(mysqli_error());
                    while($gg = mysqli_fetch_array($getGame)){
                      if(isset($_GET['gameid'])){
                        if($gg['cuid'] == $_GET['gameid']){
                          $tombol = 'btn-warning text-dark';
                        }
                        else {
                          $tombol = 'btn-outline-warning text-white';
                        }
                      }
                      else {
                        $tombol = 'btn-outline-warning text-white';
                      }
                      
                  ?>
                  <a href="<?php echo $urlweb; ?>/m/taruhan.php/?pid=<?php echo $gp['cuid']; ?>&gameid=<?php echo $gg['cuid']; ?>" class="btn <?php echo $tombol; ?> mb-2"><?php echo $gg['title']; ?></a>
                  <?php } ?>
                </div>
                <hr>
                <?php
                  if(isset($_GET['gameid'])){
                    if($_GET['gameid'] == 1){
                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhan4d.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning text-dark">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Angka Taruhan</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          for($i=1;$i<=5;$i++){
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;"><?php echo $i; ?></td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="tel" class="form-control" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0; border-radius: 0;" maxlength="4" name="angka[]" value="">
                            <span>4D = 4Angka, 3D = 3Angka, 2D = 2Angka</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" name="nominal[]" min="1000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;"  maxlength="7" value="">
                            <span>Minimal 1.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 5){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhancb.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">Angka</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          for($i=0;$i<10;$i++){
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $i; ?>
                            <input type="hidden" name="angka[]" value="<?php echo $i; ?>">
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 6){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhancb2d.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Angka Taruhan</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          for($i=1;$i<=5;$i++){
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;"><?php echo $i; ?></td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="tel" class="form-control" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="2" name="angka[]" value="">
                            <span>2Angka</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" name="nominal[]" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;"  maxlength="7" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 7){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhancn.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Angka Taruhan</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          for($i=1;$i<=5;$i++){
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;"><?php echo $i; ?></td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="tel" class="form-control" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="3" name="angka[]" value="">
                            <span>3Angka</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" name="nominal[]" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;"  maxlength="7" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 8){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhancj.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">Angka</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                          <th class="text-center pt-2 pb-2">AS/KOP/KEPALA/EKOR</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          for($i=0;$i<10;$i++){
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $i; ?>
                            <input type="hidden" name="angka[]" value="<?php echo $i; ?>">
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select name="posisi[]" class="form-control" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;">
                              <?php
                                $sql_21 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 8 ORDER BY cuid ASC") or die(mysqli_error());
                                while($s21 = mysqli_fetch_array($sql_21)){
                              ?>
                              <option value="<?php echo $s21['title']; ?>"><?php echo $s21['title']; ?></option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 9){
                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhantengah.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Kei (%)</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          for($i=1;$i<=10;$i++){
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $i; ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php
                              $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 9 ORDER BY cuid ASC") or die(mysqli_error());
                              $nos = 0;
                              while($gg1 = mysqli_fetch_array($getGame1)){
                                $nos++;
                            ?>
                            <div class="form-check form-check-inline">
                              <input class="form-check-input" type="radio" name="angka<?php echo $i; ?>" id="exampleRadios<?php echo $i.$nos; ?>" value="<?php echo $gg1['title']; ?>">
                              <label class="form-check-label text-white" for="exampleRadios<?php echo $i.$nos; ?>">
                                <?php echo $gg1['title']; ?>
                              </label>
                            </div>
                            <?php } ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 9 ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <?php echo $gg1['price']; ?>.00&nbsp;&nbsp; 
                              <?php } ?>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal<?php echo $i; ?>" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 13){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhandasar.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th colspan="4" class="text-left">DASAR GANJIL/GENAP</th>
                        </tr>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            1
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(14,15) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            2
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(14,15) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            3
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(14,15) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            4
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(14,15) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <hr>
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th colspan="4" class="text-left">DASAR BESAR/KECIL</th>
                        </tr>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            1
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(16,17) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            2
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(16,17) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            3
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(16,17) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            4
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 13 AND cuid IN(16,17) ORDER BY cuid ASC") or die(mysqli_error());
                                $nos = 0;
                                while($gg1 = mysqli_fetch_array($getGame1)){
                                  $nos++;
                              ?>
                              <option value="<?php echo $gg1['title']; ?>"><?php echo $gg1['title']; ?> ( <?php echo $gg1['price']; ?>% )</option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 22){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhanshio.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php for($a=1;$a<=5;$a++){ ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $a; ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <select class="form-control" name="angka[]" style="background: #fff; color: #000!important; border-radius: 0;">
                              <?php
                                for($i=1;$i<=12;$i++){
                                  if($i == 1){
                                    $shio = 'Kuda';
                                  }
                                  else if($i == 2){
                                    $shio = 'Ular';
                                  }
                                  else if($i == 3){
                                    $shio = 'Naga';
                                  }
                                  else if($i == 4){
                                    $shio = 'Kelinci';
                                  }
                                  else if($i == 5){
                                    $shio = 'Harimau';
                                  }
                                  else if($i == 6){
                                    $shio = 'Kerbau';
                                  }
                                  else if($i == 7){
                                    $shio = 'Tikus';
                                  }
                                  else if($i == 8){
                                    $shio = 'Babi';
                                  }
                                  else if($i == 9){
                                    $shio = 'Anjing';
                                  }
                                  else if($i == 10){
                                    $shio = 'Ayam';
                                  }
                                  else if($i == 11){
                                    $shio = 'Monyet';
                                  }
                                  else if($i == 12){
                                    $shio = 'Kambing';
                                  }
                              ?>
                              <option value="<?php echo $i.'_'.$shio; ?>"><?php echo $i.' '.$shio; ?></option>
                              <?php } ?>
                            </select>
                            <span>&nbsp;</span>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>

                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 23){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhansilang.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th colspan="4" class="text-left">SILANG</th>
                        </tr>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Kei (%)</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 23 AND cuid IN(24,25,26) ORDER BY cuid ASC") or die(mysqli_error());
                          $nosa = 0;
                          while($gg1 = mysqli_fetch_array($getGame1)){
                            $nosa++;
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $nosa; ?>
                          </td>
                          <td class="text-left" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="hidden" name="angka[]" value="<?php echo $gg1['title']; ?>">
                            <?php echo $gg1['title']; ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $gg1['price']; ?>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <hr>
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th colspan="4" class="text-left">HOMO</th>
                        </tr>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Kei (%)</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 23 AND cuid IN(27,28,29) ORDER BY cuid ASC") or die(mysqli_error());
                          $nosa = 0;
                          while($gg1 = mysqli_fetch_array($getGame1)){
                            $nosa++;
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $nosa; ?>
                          </td>
                          <td class="text-left" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="hidden" name="angka[]" value="<?php echo $gg1['title']; ?>">
                            <?php echo $gg1['title']; ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $gg1['price']; ?>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php
                    }
                    else if($_GET['gameid'] == 30){

                ?>
                <form role="form" action="<?php echo $urlweb; ?>/function/taruhankembang.php" method="POST">
                  <input type="hidden" name="pid" value="<?php echo $pid; ?>">
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th colspan="4" class="text-left">KEMBANG</th>
                        </tr>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Kei (%)</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 30 AND cuid IN(31,32,33) ORDER BY cuid ASC") or die(mysqli_error());
                          $nosa = 0;
                          while($gg1 = mysqli_fetch_array($getGame1)){
                            $nosa++;
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $nosa; ?>
                          </td>
                          <td class="text-left" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="hidden" name="angka[]" value="<?php echo $gg1['title']; ?>">
                            <?php echo $gg1['title']; ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $gg1['price']; ?>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <hr>
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th colspan="4" class="text-left">KEMPIS</th>
                        </tr>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Kei (%)</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 30 AND cuid IN(34,35,36) ORDER BY cuid ASC") or die(mysqli_error());
                          $nosa = 0;
                          while($gg1 = mysqli_fetch_array($getGame1)){
                            $nosa++;
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $nosa; ?>
                          </td>
                          <td class="text-left" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="hidden" name="angka[]" value="<?php echo $gg1['title']; ?>">
                            <?php echo $gg1['title']; ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $gg1['price']; ?>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <hr>
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr class="bg-warning">
                          <th colspan="4" class="text-left">KEMBAR</th>
                        </tr>
                        <tr class="bg-warning">
                          <th class="text-center pt-2 pb-2">No</th>
                          <th class="text-center pt-2 pb-2">Tebak</th>
                          <th class="text-center pt-2 pb-2">Kei (%)</th>
                          <th class="text-center pt-2 pb-2">Nominal (Rp)</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
                          $getGame1 = mysqli_query($conn,"SELECT * FROM `tb_game` WHERE parent = 30 AND cuid IN(37,38,39) ORDER BY cuid ASC") or die(mysqli_error());
                          $nosa = 0;
                          while($gg1 = mysqli_fetch_array($getGame1)){
                            $nosa++;
                        ?>
                        <tr>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $nosa; ?>
                          </td>
                          <td class="text-left" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="hidden" name="angka[]" value="<?php echo $gg1['title']; ?>">
                            <?php echo $gg1['title']; ?>
                          </td>
                          <td class="text-center" style="border-top: 0; vertical-align: middle; color: #fff;">
                            <?php echo $gg1['price']; ?>
                          </td>
                          <td style="border-top: 0; vertical-align: middle; color: #fff;">
                            <input type="number" class="form-control" min="10000" step="1000" max="1000000" style="background: #fff; color: #000!important; text-align: center!important; border-radius: 0;" maxlength="4" name="nominal[]" value="">
                            <span>Minimal 10.000</span>
                          </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <hr>
                  <button type="submit" name="submit" class="btn btn-warning text-dark mt-3">Pasang Taruhan</button>
                </form>
                <?php }} ?>
                

                <?php } else { ?>
                <h1 class="text-center mt-5 mb-5">Market Close Now!</h1>
                <?php } ?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div style="margin-top:20px">
        <div class="well well-sm" style="padding-top: 5px; padding-bottom:2px;">
        <marquee><span class="broadcast" style="color: #white; width: 100%"><?php echo $s0['news']; ?></span></marquee>
        </div>
        <div class="well well-sm bankOnline" style="margin-top:-10px; text-align:center"><span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>BCA</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>Mandiri</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>BNI</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>BRI</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>CIMB</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>PANIN</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>DANA</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>OVO</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>GOPAY</strong> : <span class="text-success">ONLINE</span></span>
            <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>LinkAja</strong> : <span class="text-success">ONLINE</span></span>
        </div>
        <div class="well well-sm" style="margin-top:-10px; padding-bottom:2px">
            <marquee><span class="listkeluaran" style="white-space:nowrap"> <span style="margin-left:30px;"><span style="color:#FC0 ">HK SIANG </span><span style="color:#CCC">23/05 </span><strong>2757</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">SG METRO </span><span style="color:#CCC">23/05 </span><strong>5708</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">SYDNEY </span><span style="color:#CCC">23/05 </span><strong>4454</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">HAIPHONG </span><span style="color:#CCC">23/05 </span><strong>7076</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">SINGAPORE </span><span style="color:#CCC">22/05 </span><strong>1263</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">MALAYSIA </span><span style="color:#CCC">23/05 </span><strong>7084</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">MACAU </span><span style="color:#CCC">23/05 </span><strong>5292</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">QATAR </span><span style="color:#CCC">07/05 </span><strong>2516</strong></span>
                    <span style="margin-left:30px;"><span style="color:#FC0 ">HONGKONG </span><span style="color:#CCC">23/05 </span><strong>6022</strong></span>
                    <div style="clear:both"></div>
                </span></marquee>
        </div>
    </div>



</div>



<div id="games_wrap" class="tab-pane fade in ">

</div>















</div>



</div>
<div class="well well-sm container-fluid text-center" style="margin:0px; padding:5px; border-radius:0px; padding-bottom: 55px">
© 2018 - 2023 Copyright <?php echo $s0['instansi']; ?>. All Rights Reserved.
</div>


<!--tampilan /m/ versi mobile bawah trakhir alias footer--><!--next halaman footer-->
<?php include('footer.php'); ?>




</body>

</html>
