<?php
@session_start();
include "control/activity.php";

 $dd = new activity();
 $loginStatus = $_SESSION['loginDetails'];


  if($loginStatus == null){
    echo "<script>window.open('login.php','_self')</script>";
  }



  $table = "admin_calculation";
  $condition = null;
  $getAdminDetails = $dd->single($table,$condition);
  

  @$iid = $_REQUEST['game'];
  $table = "wingo_game_runing";
  $condition = " where game_number='$iid'";
  $getK3Result = $dd->single($table,$condition);
  @$mResult = $getK3Result['manual_result'];
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title><?= $getAdminDetails['title']; ?></title>
</head>
<body>
<script>
    let gamnumber = 1;
</script>
    <div class="main" id="main">
		  <?php include "menu.php"; ?>
    <div class="right"> 
  <div class="tab-content">


   <?php include "headermenu.php"; ?>


        <!-- Overview -->
         <div id="overview" class="tab-pane active"  >
                <div class="content" >
                  
               <div class="content-wrapper">
                 <div class="container-fluid">

                      <!--======================================================  Content  ====================================================-->                                            
                          <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                              <a href="dashboard.php">CUSTOM RESULT</a>
                            </li>
                          </ol>

                          <div class="row">
                              <div class="col-xl-12 col-sm-12 mb-12">
                                  <input type="radio" id="gamesActivation1" onclick="getLottryActivity('1')" name="selectLottry"> Wingo Lottry
                                  <input type="radio" id="gamesActivation2" onclick="getLottryActivity('2')" name="selectLottry" style="margin-left:20px;"> K3 Lottry
                                  <input type="radio" id="gamesActivation3" onclick="getLottryActivity('3')" name="selectLottry" style="margin-left:20px;"> D5 Lottry
                                  <input type="radio" id="gamesActivation4" onclick="getLottryActivity('4')" name="selectLottry" style="margin-left:20px;"> TRX Result
                               </div>
                               <div class="col-xl-11 col-sm-11 mb-11">
                                  <table class="table table-bordered data-table" style="margin-top:30px; width:">
                                    <tr>
                                        <th><input id='game_number1' onkeyup="gettoupdatecustemnumber('game_number1','1')" class="form-control" oninput="this.value=this.value.replace(/\D/g, '')"  type="text" maxlength="1"  placeholder="Number"/> 
                                            <input type="radio" name="resultType1" checked/> Random  <input type="radio" name="resultType1"/> Minimum</th>
                                        <th><input id='game_number2' onkeyup="gettoupdatecustemnumber('game_number2','2')" class="form-control" oninput="this.value=this.value.replace(/\D/g, '')"  type="text" maxlength="1" max="1"  placeholder="Number"/> 
                                             <input type="radio" name="resultType2" checked/> Random  <input type="radio" name="resultType2"/> Minimum</th>
                                        <th><input id='game_number3' onkeyup="gettoupdatecustemnumber('game_number3','3')" class="form-control" oninput="this.value=this.value.replace(/\D/g, '')"  type="text" maxlength="1" max="1"  placeholder="Number"/> 
                                             <input type="radio" name="resultType3" checked/> Random  <input type="radio" name="resultType3"/> Minimum</th>
                                        <th><input id='game_number4' onkeyup="gettoupdatecustemnumber('game_number4','4')" class="form-control" oninput="this.value=this.value.replace(/\D/g, '')"  type="text" maxlength="1" max="1"  placeholder="Number"/> 
                                             <input type="radio" name="resultType4" checked/> Random  <input type="radio" name="resultType4"/> Minimum</th>
                                    </tr>
                                 </table>
                              </div>
<script>
    function gettoupdatecustemnumber(a,b)
    {
        var number = document.getElementById(a).value;
         const xhttp = new XMLHttpRequest();
        xhttp.onload = function() {
            var demo_show = this.responseText;
            const myArr = JSON.parse(demo_show);
            gamnumber = b;
            
        }
        xhttp.open("GET", "updateManualResult.php?gamenumber="+b+"&num="+number);
        xhttp.send();
        
    }
    
    
    function getLottryActivity(a){
        if(a == "4"){
            window.open("trx_result.php","_self");
        }
    }
</script>                              
                              
                              <div class="col-xl-11 col-sm-11 mb-11">
                                  
                                    <div id="content-container4"></div>

                                    <script>
                                        // Function to load the content
                                        function loadContent4() {
                                            $('#content-container4').load('refreshManualWingoResult.php?game='+gamnumber);
                                        }
                                
                                        // Initial load
                                        loadContent4();
                                
                                        // Refresh every 10 seconds
                                        setInterval(loadContent4, 3000); // 10000 milliseconds = 10 seconds
                                    </script>
                              </div>
                          </div>






      </div>
      <!-- /.container-fluid-->
       </div>  <!-- /content-wrapper-->


                </div>
                </div>
             </div><!--Right panel-->
</div><!--Main-->


</body>
</html>


<?php include "style.php" ?>

