<?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);
?>



<!DOCTYPE html>
<html lang="en" translate="no">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/svg+xml" href="./images/h5setting_20230808033047vpbk.ico">
    <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 onclick="getToBack()" data-v-905dfe8c="" 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"> Transaction history </div></div>
                    
                </div>
            </div>
        </div>
        <!--NavBar-->
<script>
  function getToBack()
  {
     window.open('account.php','_self');
  }

</script>
        <!--TransAction-->
        <div class="transRecord__container">
            <div class="game_filter custom-select" >
                <select onchange="getSelectValue()" id="selectbox1">
                    <option value="">Filter</option>
                    <option value="win">Win</option>
                    <option value="bet">Bet</option>
                    <option value="deposit">Deposit</option>
                    <option value="withdraw">Withdraw</option>
                    <option value="deposit_gift">Deposit Gift</option>
                    <option value="referral_bonus">Referral Bonus</option>
                </select>
            </div>
            
<script>
    function getSelectValue()
    {
        var ttt = document.getElementById("selectbox1").value;
        if(ttt == "deposit"){
            window.open('RechargeHistory.php','_self');
        }else if(ttt == "withdraw")
        {
             window.open('WithdrawHistory.php','_self');
        }else{
           window.open('?ii='+ttt,'_self'); 
        }
        
        
    }
</script>            
            
            
            <div class="infiniteScroll">
                <div data-v-545f0565="" class="transRecord__container-content">

                   <?php
                   
                     if($_REQUEST['ii'] == "referral_bonus")
                     {
                        $clm = " AND game_name='ref'";   
                     }elseif($_REQUEST['ii'] == "win")
                     {
                         $clm = " AND lossorprofit > 0";
                     }elseif($_REQUEST['ii'] == "bet")
                     {
                         $clm = " AND gameNumber!=''";
                     }
                   
                    $table = "account_history";
                    $condition = " where userKey='$userKey' $clm ORDER BY 1 DESC";
                    $getFullTxnDetails = $dd->fetch_multi($table,$condition);
                    foreach($getFullTxnDetails as $key){
                        if($key->game_name == "k3")
                        {
                            $txnType = "K3 LOTTRY";
                        }

                        if($key->game_name == "Wingo")
                        {
                            $txnType = "Wingo";
                        }

                        if($key->game_name == "team")
                        {
                            $txnType = "Team Commission";
                        }

                        if($key->game_name == "ref")
                        {
                            $txnType = "Refral Commission";
                        }

                        if($key->game_name == "bet commission")
                        {
                            $bt = "Commission";
                        }
                   ?>

                    <div data-v-545f0565="" class="transRecord__container-content__item">
                        <div data-v-545f0565="" class="transRecord__container-content__card">
                            <div data-v-545f0565="" class="transRecord__container-content__card-top"><h3 data-v-545f0565="">Bet <?= $bt; ?></h3></div>
                            <div data-v-545f0565="" class="transRecord__container-content__card-mid">
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Detail</div>
                                    <div data-v-545f0565="" class="right"><?= $txnType; ?></div>
                                </div>
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Time</div>
                                    <div data-v-545f0565="" class="right"><?= $key->action_date; ?></div>
                                </div>
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Balance</div>
                                    <div data-v-545f0565="" class="right red" style="">₹<?= $key->amount; ?></div>
                                </div>
                            </div>
                            <div data-v-545f0565="" class="transRecord__container-content__card-bot"><textarea data-v-545f0565="" class="textarea" name="remark" cols="30" rows="10" readonly=""><?= $key->remark; ?></textarea></div>
                        </div>
                    </div>
                   <?php } ?>

                    <!-- <div data-v-545f0565="" class="transRecord__container-content__item">
                        <div data-v-545f0565="" class="transRecord__container-content__card">
                            <div data-v-545f0565="" class="transRecord__container-content__card-top"><h3 data-v-545f0565="">Bet</h3></div>
                            <div data-v-545f0565="" class="transRecord__container-content__card-mid">
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Detail</div>
                                    <div data-v-545f0565="" class="right">Bet</div>
                                </div>
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Time</div>
                                    <div data-v-545f0565="" class="right">2024-02-10 12:14:20</div>
                                </div>
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Balance</div>
                                    <div data-v-545f0565="" class="right red" style="">₹1.00</div>
                                </div>
                            </div>
                            <div data-v-545f0565="" class="transRecord__container-content__card-bot"><textarea data-v-545f0565="" class="textarea" name="remark" cols="30" rows="10" readonly=""></textarea></div>
                        </div>
                    </div> -->



                    <!-- <div data-v-545f0565="" class="transRecord__container-content__item">
                        <div data-v-545f0565="" class="transRecord__container-content__card">
                            <div data-v-545f0565="" class="transRecord__container-content__card-top"><h3 data-v-545f0565="">Game moved out</h3></div>
                            <div data-v-545f0565="" class="transRecord__container-content__card-mid">
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Detail</div>
                                    <div data-v-545f0565="" class="right">Game moved out</div>
                                </div>
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Time</div>
                                    <div data-v-545f0565="" class="right">2024-02-10 11:59:52</div>
                                </div>
                                <div data-v-545f0565="" class="line">
                                    <div data-v-545f0565="" class="left">Balance</div>
                                    <div data-v-545f0565="" class="right green" style="">₹95.25</div>
                                </div>
                            </div>
                            <div data-v-545f0565="" class="transRecord__container-content__card-bot"><textarea data-v-545f0565="" class="textarea" name="remark" cols="30" rows="10" readonly=""></textarea></div>
                        </div>
                    </div> -->


                </div>
                <div data-v-004096dd="" class="infiniteScroll__loading"><!----><div data-v-004096dd="">No more</div></div>
            </div>
        </div>
        <!--TransAction-->

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

</script>
</html>