 <?php
session_start();
@$userKey = $_SESSION['loginKey'];
include "control/activity.php";
$dd = new activity();
@$userKey = $_SESSION['loginKey'];

$game = $_REQUEST['game'];
$getFullLoop = $dd->fetch_multi("account_history"," where userKey='$userKey' AND gameNumber='$game' AND game_name='TRX' ORDER BY 1 DESC limit 10");
foreach($getFullLoop as $key){
    
    // if($key->lossorprofit < 1){
    //     $status = "failed";
    // }else{
    //     $status = "success";
    // }
    
    
    if($key->result_number < 5){
        $imgName = "small.png";
    }else{
        $imgName = "big.png";
    }
    
    
    if($key->status == "pending"){
        $stts = "Waiting";
        $amnt = $key->bet_amount;
    }else if($key->lossorprofit < 1){
        $stts = "failed";
        $amnt = $key->bet_amount;
    }else{
        $stts = "success";
        $amnt = $key->lossorprofit;
    }
    
?>
 
 
                                    <div class="item c-row">
                                        <div class="result">
                                            <div class="select select-small">
                                                 <div class="van-image">
                                                    <img src="./images/<?= $imgName; ?>" class="van-image__img">
                                                </div>
                                        </div>
                                        </div>
                                        <div class="c-row c-row-between info">
                                            <div class="period_id">
                                                <div data-v-a9660e98="" class="issueName">
                                                    <?= $key->periods; ?> 
                                                    <span data-v-a9660e98="" class="state red"><?= $stts; ?></span>
                                                </div>
                                                <div data-v-a9660e98="" class="tiem"><?= $key->action_date; ?></div>
                                            </div>
                                            <div class="money">
                                                <span data-v-a9660e98="" class="fail"><?= $amnt; ?></span>
                                            </div>
                                        </div>
                                    </div>
<?php } ?>