<?php
// function __autoload($class)
// {
// include("classess/".$class.".php");
// }
spl_autoload_register(function($class) {
include("classess/".$class.".php");
});
$sqlfun = new sqlfunction();
$admin = new admin_login();
$admin->security_check();
$sid = $admin->call_session();
$getdate =$admin->getdates();
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>CK</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="css/font-awesome.min.css">
<!-- Ionicons -->
<!--<link rel="stylesheet" href="css/ionicons.min.css">-->
<!-- Theme style -->
<link rel="stylesheet" href="css/AdminLTE.min.css">
<link rel="stylesheet" href="css/_all-skins.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-datepicker.min.css">
<link rel="stylesheet" type="text/css" href="css/summernote.css">
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/bootstrap-datepicker.min.js"></script>
<script type="text/javascript" src="js/summernote.min.js"></script>
<!-- Google Font -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<?php include('header.php');?>
<?php include('sidebar.php');?>
<?php
$succ = "";
if(isset($_GET['delid'])){
$delid = base64_decode($_GET['delid']);
$cnd1 = " id='$delid'";
if($sqlfun->del_data("game",$cnd1))
{
$succ="<div class='alert alert-success hideee'><span><b>Success! </b>Deleted successfully</span><a href='#' class='close' data-dismiss='alert'>×</a></div>";
?>
<script>setTimeout(function(){ $('.hideee').hide(); }, 2000);</script>
<?php }
else
{
$succ = "<p style = 'color:green;'>Something went wrong</p>";
}
}
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<h1> Game </h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Game</li>
</ol>
</div>
<!-- Main content -->
<div class="content body">
<div class="row">
<div class="col-md-12">
<div class="box box-danger">
<div class="box-header with-border">
<?php
$customer_balance = $add_money = $withdraw_money = $total_bidding = $commission = $winning_amount = $profit = 0;
if(isset($_POST['start_date']))
{
$from_date=$_REQUEST['start_date'];
$from_dat = date('Y-m-d',strtotime($from_date));
$to_datee=$_REQUEST['end_date'];
$to_date = date('Y-m-d',strtotime($to_datee));
$da = date('Y-m-d',strtotime($from_date));
$da1 = date('Y-m-d',strtotime($to_date));
}
else
{
$from_date = date('d-m-Y');
$to_datee = date('d-m-Y');
$from_dat = date('Y-m-d',strtotime($from_date));
$to_date = date('Y-m-d',strtotime($to_datee));
$da = date('Y-m-d',strtotime($from_date));
$da1 = date('Y-m-d',strtotime($to_date));
// $end_date = date('Y-m-d',strtotime($from_date));
$t_balance_cnd = "";
}
?>
<form method="post">
<div class="form-row">
<div class="col-md-4">
<div class="form-group">
<label class="control-label">From Date</label>
<input class="form-control " id="datepicker" name="start_date" value="<?php echo $from_date; ?>" required type="text">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="control-label">To Date</label>
<input class="form-control " id="datepicker1" name="end_date" value="<?php echo $to_datee; ?>" required type="text" autocomplete="off">
</div>
</div>
<!-- <div class="col-md-4">
<div class="form-group">
<label class="control-label">Game</label>
<select class="form-control" name="game_type" required="">
<option value=""></option>
<?php
$cnd = "status = '1'";
$check = $sqlfun->fetchdata("game",$cnd);
while($row = $check->fetch(PDO::FETCH_OBJ))
{
?>
<option <?php if($game_type ==$row->g_id) { echo "selected";}?> value="<?php echo $row->g_id;?>"><?php echo $row->g_name;?></option>
<?php
}
?>
</select>
</div>
</div>-->
<div class="col-md-4">
<br>
<button style=" margin-top: 8px;" type="submit" name="submit" class="btn btn-outline-primary"><i class="feather icon-file mr-2"></i> Search Now</button>
</div>
</div>
</form>
</div><!-- /.box-header -->
<div class="box-body">
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col -->
</div>
<style>
@media (max-width:480px) {
.small-box h3{
font-size:17px;
}
}
</style>
<?php $d_data = array(); error_reporting(0);?>
<div class="row">
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<?php
$check = $sqlfun->fetchdata("player",$cnd);
while($row = $check->fetch(PDO::FETCH_OBJ))
{
$customer_balance+= $row->wallet;
}
?>
<h3>Rs. <?=$customer_balance?></h3>
<p>Customer Balance</p>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
<a href="#" class="small-box-footer">Total</a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<?php
$cnd104 ="status = 'Approved' && date BETWEEN '$da' AND '$da1'";
// $cnd104 = "type = 'Recharge' && date = '$from_dat'";
$check104 = $sqlfun->fetchdata("add_money_request",$cnd104);
while($row104 = $check104->fetch(PDO::FETCH_OBJ))
{
$add_money+= $row104->amount;
}
?>
<h3>Rs. <?=$add_money?></h3>
<p>Add Money</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
<a href="#" class="small-box-footer">Total </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<?php
$cnd105 = "date BETWEEN '$da' AND '$da1' && status = 'Paid'";
$check105 = $sqlfun->fetchdata("withdrawal",$cnd105);
while($row105 = $check105->fetch(PDO::FETCH_OBJ))
{
$withdraw_money+= $row105->amount;
}
?>
<h3>Rs. <?=$withdraw_money?></h3>
<p>Withdraw Money</p>
</div>
<div class="icon">
<i class="ion ion-thermometer"></i>
</div>
<a href="" class="small-box-footer">Total </a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<?php
$cnd111 = "status = '1'";
$check111 = $sqlfun->fetchdata("game",$cnd111);
while($row111 = $check111->fetch(PDO::FETCH_OBJ))
{
$game_idi = $row111->g_id;
$kya = $row111->result_date;
$open_time = $row111->open_time;
$close_time = $row111->close_time;
if($kya ==1){
$end_date = date('Y-m-d H:i:s', strtotime("+".$kya." day",strtotime($da1."".$close_time)));
$start_date = date('Y-m-d H:i:s', strtotime("+0 day",strtotime($da."".$open_time)));
}else{
$end_date = date('Y-m-d H:i:s', strtotime("+".$kya." day",strtotime($da1."".$close_time)));
$start_date = date('Y-m-d H:i:s', strtotime("+0 day",strtotime($da."".$open_time)));
}
$cnd106 = "play_datetime BETWEEN '$start_date'AND '$end_date' && game_id = '$game_idi'";
$check106 = $sqlfun->fetchdata("manage_game_id",$cnd106);
while($row106 = $check106->fetch(PDO::FETCH_OBJ))
{
$total_bidding+= $row106->amount;
}
}
?>
<h3>Rs. <?=$total_bidding?></h3>
<p>Total Bidding</p>
</div>
<div class="icon">
<i class="ion ion-thermometer"></i>
</div>
<a href="#" class="small-box-footer">Total</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<?php
$cnd107 = "date BETWEEN '$da' AND '$da1'";
$check107 = $sqlfun->fetchdata("comission",$cnd107);
while($row107 = $check107->fetch(PDO::FETCH_OBJ))
{
$commission+= $row107->c_amnt;
}
?>
<h3>Rs. <?=$commission?></h3>
<p>Commission</p>
</div>
<div class="icon">
<i class="ion ion-thermometer"></i>
</div>
<a href="#" class="small-box-footer">Total</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<?php
$cnd111 = "status = '1'";
$check111 = $sqlfun->fetchdata("game",$cnd111);
while($row111 = $check111->fetch(PDO::FETCH_OBJ))
{
$game_idi = $row111->g_id;
$kya = $row111->result_date;
$open_time = $row111->open_time;
$close_time = $row111->close_time;
if($kya ==1){
$end_date = date('Y-m-d H:i:s', strtotime("+".$kya." day",strtotime($da1."".$close_time)));
$start_date = date('Y-m-d H:i:s', strtotime("+0 day",strtotime($da."".$open_time)));
}else{
$end_date = date('Y-m-d H:i:s', strtotime("+".$kya." day",strtotime($da1."".$close_time)));
$start_date = date('Y-m-d H:i:s', strtotime("+0 day",strtotime($da."".$open_time)));
}
$cnd108 = "play_datetime BETWEEN '$start_date'AND '$end_date' && game_id = '$game_idi' && result_status = '1'";
$check108 = $sqlfun->fetchdata("manage_game_id",$cnd108);
while($row108 = $check108->fetch(PDO::FETCH_OBJ))
{
$winning_amount+= $row108->winning_amnt;
}
}
?>
<h3>Rs. <?=$winning_amount?></h3>
<p>Winning Amount</p>
</div>
<div class="icon">
<i class="ion ion-thermometer"></i>
</div>
<a href="#" class="small-box-footer">Total</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>Rs. <?=$profit = $total_bidding - ($commission + $winning_amount); ?></h3>
<p>Profit</p>
</div>
<div class="icon">
<i class="ion ion-thermometer"></i>
</div>
<a href="#" class="small-box-footer">Total</a>
</div>
</div>
<!-- ./col -->
<?php
$cnd2 = "";
$check2 = $sqlfun->fetchdata("game",$cnd2);
while($row2 = $check2->fetch(PDO::FETCH_OBJ)){
$g_id= $row2->g_id;
$kya = $row2->result_date;
$open_time = $row2->open_time;
$close_time = $row2->close_time;
if($kya ==1){
$end_date = date('Y-m-d H:i:s', strtotime("+".$kya." day",strtotime($da1."".$close_time)));
$start_date = date('Y-m-d H:i:s', strtotime("+0 day",strtotime($da."".$open_time)));
}else{
$end_date = date('Y-m-d H:i:s', strtotime("+".$kya." day",strtotime($da1."".$close_time)));
$start_date = date('Y-m-d H:i:s', strtotime("+0 day",strtotime($da."".$open_time)));
}
?>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<p><strong><?=$row2->g_name?></strong></p>
<?php
$total_bid = $t_winning_amnt = "0";
$cnd100 = "game_id = '$g_id' && play_datetime BETWEEN '$start_date'AND '$end_date'";
$check100 = $sqlfun->fetchdata("manage_game_id",$cnd100);
while($row100 = $check100->fetch(PDO::FETCH_OBJ))
{
$total_bid+= $row100->amount;
}
$cnd101 = "game_id = '$g_id' && play_datetime BETWEEN '$start_date'AND '$end_date' && result_status = '1'";
$check101 = $sqlfun->fetchdata("manage_game_id",$cnd101);
while($row101 = $check101->fetch(PDO::FETCH_OBJ))
{
$t_winning_amnt+= $row101->winning_amnt;
}
?>
<p>Bidding Rs:<strong><?=$total_bid?></strong></p>
<p> Winning Rs:<strong><?=$t_winning_amnt?></strong></p>
<p>Total Bal:<strong> <?=($total_bid - $t_winning_amnt)?></strong></p>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
<!--<a href="#" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>-->
</div>
</div>
<?php
}
?>
<!-- ./col -->
</div>
</div>
<!-- ============================================================= --> </div><!-- /.content-wrapper -->
<?php include('footer.php');?>
</div><!-- ./wrapper -->
<!-- jQuery 3 -->
<!-- Bootstrap 3.3.7 -->
<script src="js/bootstrap.min.js"></script>
<!-- FastClick -->
<!--<script src="js/fastclick.min.js"></script>-->
<!-- AdminLTE App -->
<!--<script src="js/adminlte.min.js"></script>-->
<!-- SlimScroll -->
<script src="js/jquery.slimscroll.min.js"></script>
<!--<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>-->
<!--<script src="js/docs.js"></script>-->
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/dataTables.bootstrap.min.js"></script>
<!-- FastClick -->
<script src="js/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="js/adminlte.min.js"></script>
<!--<script src="js/dashboard2.js"></script>-->
<!--<script src="js/demo.js"></script>-->
<script>
$(document).ready(function () {
$('.sidebar-menu').tree();
$('.datatable').DataTable();
$('#datatable1').DataTable();
$('#datatable2').DataTable();
$('#datatable3').DataTable();
$('#editor1').summernote({ height: 200 });
// $('#editor2').summernote({ height: 200 });
});
$(document).ready(function () {
$('#datepicker').datepicker({
autoclose: true,
format:'dd-mm-yyyy'
// startDate:'1990-20-08',
// endDate:'1993-20-08'
});
$('#datepicker1').datepicker({
autoclose: true,
format:'dd-mm-yyyy'
// startDate:'1990-20-08',
// endDate:'1993-20-08'
});
$('#datepicker_1').datepicker({ autoclose: true, format:'dd-mm-yyyy' });
$('#datepicker2').datepicker({ autoclose: true, format:'dd-mm-yyyy' });
});
</script>
</body>
</html>