<?php
session_start();
@$userKey = $_SESSION['loginKey'];

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


include "control/activity.php";
$dd = new activity();


$table = "userdetails";
$condition = " where userKey='$userKey'";
$getuserdetails = $dd->single($table,$condition);
$table ="admin_calculation";
$condition="null";
$getAdminDetails=$dd->single($table,$condition);
$fevicon = $getAdminDetails['favicon'];
?>



<!DOCTYPE html>
<html lang="en" translate="no">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/svg+xml" href="temp_img/<?= $fevicon; ?>">
    <meta name="google" content="notranslate">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>Goaclub</title>
    <link rel="stylesheet" href="css/slick.css" />
    <link rel="stylesheet" href="css/modules.css" />
    <link rel="stylesheet" href="css/style.css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/slick.min.js" type="text/javascript"></script>
    <script src="js/main.js" type="text/javascript"></script>
</head>
<body>
    <div id="app">
       <div class="mian BetRecords">
         <!--NavBar-->
         <div class="navbar">
            <div class="navbar-fixed" style="background: linear-gradient(90deg, rgb(207, 3, 5) 0%, rgb(242, 63, 58) 100%);">
                <div class="navbar__content">
                <div data-v-905dfe8c="" onclick="backtoHome()" class="navbar__content-left"><img src="images/back.c3244ab0.png" alt="Back" class="back_img"></div>
                    <div data-v-905dfe8c="" class="navbar__content-center"><div data-v-905dfe8c="" class="navbar__content-title"> Bet history </div></div>
                    
                </div>
            </div>
        </div>
        <!--NavBar-->
<script>
  function backtoHome()
  {
     window.open('account.php','_self');
  }

</script>

        <!--BetRecords-->
        <div class="bet-container">
            <div class="bet-content__box">
                <div class="infiniteScroll">
                    <div class="bet-container-items">
                        <div class="bet-container-lottery">


                           <?php
                             $table = "account_history";
                             $condition = " where userKey='$userKey' AND game_name='k3' OR game_name='Wingo' ORDER BY 1 DESC";
                             $getHistory = $dd->fetch_multi($table,$condition);
                             foreach($getHistory as $key){
                                if($key->lossorprofit >= 1){
                                    $lossprofit = "Gain";
                                }
                                else{
                                    $lossprofit = "Loss";
                                }

                                if($key->game_name == "Wingo"){
                                    $gameType = "Win Go";
                                } 
                                
                                if($key->game_name == "k3"){
                                    $gameType = "K3 Lottry";
                                } 
                             ?>

                            <div class="bet-container-lottery-items">
                                <div class="bet-container-lottery-card">
                                    <div data-v-8de75a26="" class="bet-container-lottery-card-header ar-1px-b">
                                        <div data-v-8de75a26="" class="h1">
                                            <h2 data-v-8de75a26=""><?= $gameType; ?></h2>
                                            <span data-v-8de75a26="" class="colorE98613"><?= $lossprofit; ?></span>
                                        </div>
                                        <p data-v-8de75a26=""><?= $key->action_date; ?></p>
                                    </div>
                                    <div class="bet-container-lottery-card-info">
                                        <img data-v-8de75a26="" src="images/betInfoStep-7b7e5e57.png">
                                        <ul>
                                            <li data-v-8de75a26=""><h2 data-v-8de75a26="">Type</h2><span data-v-8de75a26=""><?= $gameType; ?></span></li>
                                            <li data-v-8de75a26=""><h2 data-v-8de75a26="">Period</h2><span data-v-8de75a26=""><?= $key->periods; ?></span></li>
                                            <li data-v-8de75a26=""><h2 data-v-8de75a26="">Order number</h2><span data-v-8de75a26=""><?= $key->refrence; ?></span></li>
                                            <li data-v-8de75a26=""><h2 data-v-8de75a26="">Total bet</h2><span data-v-8de75a26="">₹<?= $key->amount; ?></span></li>
                                        </ul>
                                    </div>  
                                </div>  
                                <!-- <img data-v-8de75a26="" src="images/moonBar-f80ac733.png">
                                <div class="bet-container-lottery-note">
                                    <div class="bet-container-lottery-note-result">
                                        <img data-v-8de75a26="" src="images/betResultStep-e17a42d5.png">
                                        <div data-v-8de75a26="">
                                            <h1 data-v-8de75a26="">Lottery results</h1>
                                            <h2 data-v-8de75a26="">
                                                <p data-v-8de75a26="">5</p>
                                                <span data-v-8de75a26="" class="bigClass">Big</span><span data-v-8de75a26="" class="green_violet">green white</span>
                                            </h2>
                                        </div>
                                    </div>
                                    <div class="bet-container-lottery-note-box">
                                        <div>
                                            <div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h3 data-v-8de75a26="">₹9.80</h3><span data-v-8de75a26="">Actual amount</span></div>
                                        </div>
                                        <div data-v-8de75a26=""><div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h3 data-v-8de75a26="">₹0.00</h3><span data-v-8de75a26="">Winnings</span></div></div>
                                        <div data-v-8de75a26=""><div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h3 data-v-8de75a26="">₹0.20</h3><span data-v-8de75a26="">Handling fee</span></div></div>
                                        <div data-v-8de75a26=""><div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h4 data-v-8de75a26="" class="h4_red">-₹10.00</h4><span data-v-8de75a26="">Profit/loss</span></div></div>
                                    </div>
                                </div> -->
                            </div>  
                            <?php }  ?>


                            <!-- <div class="bet-container-lottery-items">
                                <div class="bet-container-lottery-card">
                                    <div data-v-8de75a26="" class="bet-container-lottery-card-header ar-1px-b">
                                        <div data-v-8de75a26="" class="h1">
                                            <h2 data-v-8de75a26="">Win Go</h2>
                                            <span data-v-8de75a26="" class="colorE98613">Lose</span>
                                        </div>
                                        <p data-v-8de75a26="">2024-02-10 12:14:20</p>
                                    </div>
                                    <div class="bet-container-lottery-card-info">
                                        <img data-v-8de75a26="" src="images/betInfoStep-7b7e5e57.png">
                                        <ul data-v-8de75a26="">
                                            <li data-v-8de75a26="">
                                                <h2 data-v-8de75a26="">Type</h2>
                                                <span data-v-8de75a26="">Win Go 1Min</span>
                                            </li>
                                            <li data-v-8de75a26="">
                                                <h2 data-v-8de75a26="">Period</h2>
                                                <span data-v-8de75a26="">20240210010735</span>
                                            </li>
                                            <li data-v-8de75a26="">
                                                <h2 data-v-8de75a26="">Order number</h2>
                                                <span data-v-8de75a26="">WG2024021012142069801707e</span>
                                            </li>
                                            <li data-v-8de75a26="">
                                                <h2 data-v-8de75a26="">Select</h2>
                                                <p data-v-8de75a26="">9</p>
                                            </li>
                                            <li data-v-8de75a26="">
                                                <h2 data-v-8de75a26="">Total bet</h2>
                                                <span data-v-8de75a26="">₹1.00</span>
                                            </li>
                                        </ul>

                                    </div>  
                                </div>  
                                <img data-v-8de75a26="" src="images/moonBar-f80ac733.png">
                                <div class="bet-container-lottery-note">
                                    <div class="bet-container-lottery-note-result">
                                        <img data-v-8de75a26="" src="images/betResultStep-e17a42d5.png">
                                        <div>
                                            <h1 data-v-8de75a26="">Lottery results</h1>
                                            <h2 data-v-8de75a26=""><p data-v-8de75a26="">1</p><span data-v-8de75a26="" class="small">Small</span><span data-v-8de75a26="" class="green">Green</span></h2>
                                        </div>  
                                    </div>  
                                    <div class="bet-container-lottery-note-box">
                                    <div data-v-8de75a26=""><div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h3 data-v-8de75a26="">₹0.98</h3><span data-v-8de75a26="">Actual amount</span></div></div>
                                    <div data-v-8de75a26=""><div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h3 data-v-8de75a26="">₹0.00</h3><span data-v-8de75a26="">Winnings</span></div></div>
                                    <div data-v-8de75a26=""><div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h3 data-v-8de75a26="">₹0.02</h3><span data-v-8de75a26="">Handling fee</span></div></div>
                                    <div data-v-8de75a26=""><div data-v-8de75a26="" class="bet-container-lottery-note-box-para"><h4 data-v-8de75a26="" class="h4_red">-₹1.00</h4><span data-v-8de75a26="">Profit/loss</span></div></div>
                                    </div>  
                                </div>  
                            </div>   -->
                        </div>
                    </div>
                    <div data-v-004096dd="" class="infiniteScroll__loading"><!----><div data-v-004096dd="">No more</div></div>
                </div>
            </div>
        </div>
        <!--BetRecords-->

        </div>
       
    </div>
</body>

</html>