<?php
include('../inc/conf.php');
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
session_set_cookie_params(604800000, "/", SITE, false, false);
session_start();
if (!isset($_SESSION["uid"])){
echo "5";
exit;
}
$lgame = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT id,usr,win,log FROM t_games INNER JOIN t_users ON t_games.usr = t_users.uid ORDER BY id DESC LIMIT 1"));
?>
<div id="winner" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm center_modal">
<div class="modal-content">
<div class="modal-body with-padding">
<center>
<?php if ($lgame['usr'] == $uid) { echo "Вы выиграли $lgame[win] руб!"; } else { echo "Победитель: $lgame[log]. Выигрыш: $lgame[win] руб."; } ?>
</center>
</div>
</div>
</div>
</div>
<script>
$('#winner').modal('show');
</script>