<?php 
ob_start();
session_start();
// print_r($_SESSION);exit();
if($_SESSION['userid']=="")
{header("location:login.php");exit();}?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php include'head.php' ?>
<link rel="stylesheet" href="assets/css/style.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="assets/css/dataTables.bootstrap.min.css" rel="stylesheet"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">


<style>
.modal{top:15%;}
.appHeader1 {
	background-color: #fff !important;
	border-color: #fff !important;
}
h2
{
    color: gray;
}
* {
  box-sizing: border-box;
}
/* Create two equal columns that floats next to each other */
.column1 {
    padding-left: 15px;
    padding-right: 15px;
    width: calc(100% / 3);
    float: left;
   /* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.row1:after {
  content: "";
  display: table;
  clear: both;
      margin-bottom: -0.50cm;
}
/* Create two equal columns that floats next to each other */
.column {
  float: center;
  width: calc(100% / 3);
   /* Should be removed. Only for demonstration */
}

/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}
.float{
	position:fixed;
	width:40px;
	height:40px;
	bottom:40px;
	right:0px;
	background-color: black;
	color:#FFFFFF;
	border-radius:50px;
	text-align:center;
  font-size:30px;
	box-shadow: 2px 2px 3px #999;
  z-index:100;

   top:70%;
}

.my-float{
    	color:#FFFFFF;
	margin-top:3px;
}
.mine_top {
   
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
    transition: .3s cubic-bezier(.25,.8,.5,1);
    background: #fff;

}
.mine_top .mine_info{
    width: 100%;
    background: #000000;
    border-radius: 2px;
    padding: 12px 8px 8px 8px;
    box-sizing: border-box;
    font-size:14px;
    font-weight:400;
    color:white;
}
.user-block img {
	width: 40px;
	height: 40px;
	float: left;
	margin-right:10px;
		margin-top:-10px;
	background:#333;
}
.img-circle {
	border-radius: 50%;
}
.accordion .btn-link {
	box-shadow:none;
	padding:3px !important;
	margin:0px 0px;
	color: #333 !important;
	font-size: 17px;
	font-weight: normal;
	border-top:solid 1px #ccc;
}
.accordion .collapsed {
	border:none;
}
.accordion .show {
	border-bottom:solid 1px #ccc;
}
.accordion .sub-link {
	box-shadow:none;
	padding:8px !important;
	color: #333 !important;
	font-size: 14px;
	font-weight: normal;
	display:block;
}
.accordion .sub-link:hover {
color:#000000 !important;
}
.accordion .btn-link:hover {
	background:#F5F5F5;
}
.accordion .btn-link {
	position: relative;
}
.btn3 {
   background-color: #FFD700;
    border-radius: 15px 15px 15px 15px;
    border: 1px solid white;
  padding-bottom: 4px;
  padding-top: 4px;
  padding-left: 25px;
  padding-right: 25px;
    transition: 0.5s;
    
}
 .accordion .btn-link::after {
 content: "\f107";
 color: #333;
 
 right: 9px;
 position: absolute;
 font-family: "FontAwesome";
 font-size:24px;
}
.btn1 {
    border-radius: 15px 0px 15px 0px;
    border: 2px solid white;
  padding-bottom: 4px;
  padding-top: 4px;
  padding-left: 25px;
  padding-right: 25px;
    transition: 0.5s;
    
}
.right{
    float:right;
}
.btn2 {
    border-radius: 5px 05px 5px 5px;
    border: 2px solid white;
  padding-bottom: 4px;
  padding-top: 4px;
  padding-left: 30px;
  padding-right: 30px;
    transition: 0.5s;
    
}

 .accordion .btn-link[aria-expanded="true"]::after {
 content: "\f106";
}
.light{
    height: 24px;
    padding: 0px 0px;
	margin: 5px 2px;
	border-radius: 20px;
width: 24px;}
.light1{
    height: 26px;
    padding: 0px 0px;
	margin: 5px 2px;
	border-radius: 20px;
width: 26px;}

 
 .user-block img {
      width: 40px;
      height: 40px;
      float: left;
      margin-right: 15px;
      margin-left:10px;
      background: #333;
      box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12)!important;
    }
             .fixed_kefu {
                position: fixed;
                right: 5px;
                top: 40%;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
                font-size: 12px;
                color: #009688;
                border-radius: 50%;
                background: #fff;
                border: 1px solid #009688;
                width: 60px;
                height: 60px;
                box-shadow: 0 0 5px #009688;
            }
            .fixed_kefu img {
                max-width: 32px;
                max-height: 32px;
                width:100%;
                height:100%;
            }
            .wrapper
            {
                background: #fff;
    padding: 15px;
    box-sizing: border-box;
    border-radius: 4px;
    width: 70%;
    box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
    transition: .3s cubic-bezier(.25,.8,.5,1);

                
            }
            .tz_close{
    display: flex;
    justify-content: flex-end;
    padding: 8px 5px 8px 15px;
    box-sizing: border-box;
}
.tz_close button {
    color: #00897b;
    font-size: 14px;
    padding: 5px 10px;
    border: 0;
    background: transparent;
    margin-left: 10px;
}
.tz_title{
    font-size: 24px;
    padding: 15px;
    font-weight:400;
    color:#000;
}
.signinInfo .signinfo{
    padding: 10px 0 10px 20px;
}
.fixed_kefu {
                position: fixed;
                right: 5px;
                top: 40%;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
                font-size: 12px;
                color: #009688;
                border-radius: 50%;
                background: #fff;
                border: 1px solid #009688;
                width: 60px;
                height: 60px;
                box-shadow: 0 0 5px #009688;
            }
            .fixed_kefu img {
                max-width: 32px;
                max-height: 32px;
                width:100%;
                height:100%;
            }

.top_item button{
    border-color: #b60000!important;
    padding: 0 8px;
    margin-top: 5px;
    width: 80px;
    font-size: 14px;
}
.one_btn{
    background: #b60000!important;
    color: #fff!important;
}
.ripple {
    position: relative;
    overflow: hidden;
}

.mine_top_items{
    display: flex;
    align-items: center;
    justify-content: space-around;
    color: #fff;
    font-size: 16px;
    padding: 20px 0;
}

.ripple:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle,#fff 10%,transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform .3s,opacity .5s;
}
.imggg{
    margin-left: -7px; width:22px; height: 22px;
}
</style>
</head>

<body>
    <!-- Page loading -->
  <?php include('loading.php'); ?>
  <!-- * Page loading -->
<?php
include("include/connection.php");
$userid=$_SESSION['userid'];
$selectruser=mysqli_query($con,"select * from `tbl_user` where `id`='".$userid."'");
$userresult=mysqli_fetch_array($selectruser);
$selectwallet=mysqli_query($con,"select * from `tbl_wallet` where `userid`='".$userid."'");
$walletResult=mysqli_fetch_array($selectwallet);

$userID = $userid;
$len = strlen($userID);
if($len == 1){
	$userID = "00".$userid;
}
if($len == 2){
	$userID = "0".$userid;
}
?>


<!-- App Header -->
<div class="mine_top">
  <div class="mine_info">
    <div class="row" style="margin-bottom:20px;">
        
          <div  class="col-12">  <a href="#notification" data-toggle="modal" class="pull-right" style="	margin-right:10px;background-color: white;
	color:#FFFFFF;
	border-radius:50px; 	width:35px;
	height:35px;	text-align:center;
  font-size:30px;
	box-shadow: 2px 2px 3px #999;">
<img  style="margin-top: 8px;" width="18" height="18" src="images/bell.png">
</a>
         <div class="user-block"> <img style="margin-top: 1px;" class="img-circle img-bordered-lg" src="images/avatar.svg"> </div>
  
        <a href="#" style="color:white; font-weight:400; font-size: 14px; ">User : 	91<?php echo substr(user($con,'mobile',$userid),0,-8);?>**<?php echo substr(user($con,'mobile',$userid), 4);?></a><br> <p  style="color:white; font-size: 14px;font-weight:400; padding-left: 5px;">ID: <?php echo $userID;?></p>
      </div>
        
   
      <div class="column top_item"><br>
      <center><span style="font-weight: 400; font-size:15px;">₹ <?php echo number_format(wallet($con,'amount',$userid), 2);?><br>Balance<br></span><button onclick="location.href='/recharge.php'" class="one_btn ripple" >Recharge</button></center></div>
      
  <div class="column top_item"><br>
      <center><span style="font-weight: 400; font-size:15px;">₹ <span id="bms"><?php $fetchref=mysqli_query($con,"select sum(amount) as total from `tbl_walletsummery` where userid = '".$userid."' and actiontype = 'refer_commission'");
	$link=mysqli_fetch_array($fetchref);
	$ready = $link['total']; echo round($ready,2);?></span><br>Commission<br></span><button onclick="location.href='/reward.php'" class="one_btn ripple" >See</button></center></div>
                    <div class="column top_item"><br>
      <center><span style="font-weight: 400; font-size:15px;">₹ <span id="bms"><?php  $total1 = mysqli_fetch_assoc(mysqli_query($con,"SELECT sum(amount) as total FROM `tbl_interest` WHERE userid = '".$userid."'"));
                echo round($total1['total'],2);?></span><br>Interest<br></span><button onclick="location.href='/view-interest.php'" class="one_btn ripple" >See</button></center></div>
      
      </div>
   
  </div>
    </div>   
     
  <!--  <div class="row1">
  <div class="column1 vcard"><br>
      <a href="recharge.php" style="color:black;" > <center><span style="font-size:14px;"><i style="color:darkgreen1;font-size:30px;" class="fa fa-credit-card"></i><br>Recharge<span></center></a></div>  
      
      <div class="column1 vcard"><br>
    <a href="withdrawal.php" style="color:black;">  <center><span style="font-size:14px;"> <i style="color:darkgreen1;font-size:30px;" class="icon ion-md-wallet"></i><br>Withdraw<span></center></a></div> 
    
    <div class="column1 vcard"><br>
      <a href="order.php" style="color:black;"><center><span style="font-size:14px;"> <i style="color:darkgreen1;font-size:30px;" class="fa fa-google-wallet"></i><br>All Orders<span></center></a></div></div>
 searchBox --> 

<!-- * searchBox --> 
<!-- * App Header --> 

<!-- App Capsule -->
<div style="margin-top: -20px;" class="appContent1 mb-5">
    
  <div class="contentBox long mb-1">
    <div class="contentBox-body card-body"> 
      
      <!-- listview -->
       
      <div class="accordion" id="accordionExample" style="margin-bottom:-20px;"> 
         
      <div  class="card-header">
            <h2 class="mb-0"> <a style="color: #757575;" href="#sign"data-toggle="modal" data-target="#signin" aria-haspopup="true" aria-expanded="false" class="btn btn-link collapsed"><img  class="imggg" src="images/signin.png">&nbsp;&nbsp;  Sign In </a> </h2>
          </div><br>
   <div  class="card-header">
            <h2 class="mb-0"> <a style="color: #757575;" href="order.php" class="btn btn-link collapsed"><img  class="imggg" src="images/order.png">&nbsp;&nbsp;  Orders </a> </h2>
          </div><br>
          <div class="card-header">
     <h2 class="mb-0"> <a  style="color: #757575;" href="promotion.php" class="btn btn-link collapsed"><img  class="imggg" src="images/promotion.png">&nbsp;&nbsp;  Promotion </a> </h2>
          </div><br>
              <?php $sql="select * from `tbl_user` where `id`='$userid'";
	$result=mysqli_query($con,$sql);
		$line=mysqli_fetch_assoc($result);
	if($line[lifafa] == '1'){

  echo ' <div class="card-header">
   <h2 class="mb-0"> <a style="color: #757575;" href="redenvelope.php" class="btn btn-link collapsed"><img  class="imggg" src="images/red.png">&nbsp;&nbsp;  Red Envelope </a> </h2>
          </div><br>  ';}?>
          
         
        
     
  <div class="card-header" id="headingThree">
          <h2 class="mb-0"> <a style="color: #757575;"  href="#" class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <img  class="imggg" src="images/wallet.png">
            &nbsp;&nbsp; Wallet  </a> </h2>
        </div><br>
        <div style="margin-top: -10px;" id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
           <a style="color: #757575; font-size: 16px; margin-top: 5px; margin-left: 10px" href="recharge.php" class="sub-link"> 
            &nbsp;&nbsp; Recharge  </a> 
          <a style="color: #757575; font-size: 16px; margin-top: 5px; margin-left: 10px" href="withdrawal.php" class="sub-link"> 
            &nbsp;&nbsp; Withdrawal  </a> 
       
        <a style="color: #757575; font-size: 16px; margin-top: 5px; margin-left: 10px" href="transactions.php" class="sub-link"> 
            &nbsp;&nbsp; Transactions  </a> <br> 
        </div>
       <div class="card-header">
          <h2 class="mb-0"> <a style="color: #757575;" href="manage_bankcard.php" class="btn btn-link collapsed"><img  class="imggg" src="images/bank.png">
            &nbsp;&nbsp; Bank Card </a> </h2>
          </div><br>
              <div class="card-header">
     <h2 class="mb-0"> <a  style="color: #757575;" href="address.php" class="btn btn-link collapsed"><img  class="imggg" src="images/address.png">&nbsp;&nbsp;  Address </a> </h2>
          </div><br>
        <div class="card-header" id="headingThree">
          <h2 class="mb-0"> <a href="#" class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapsefour" aria-expanded="false" aria-controls="collapsefour"> <img  class="imggg" src="images/security.png">
            &nbsp;&nbsp; Account Security </a> </h2>
        </div>
        <div style="padding-left: 15px;" id="collapsefour" class="collapse">
      <a style="color: #757575; font-size: 16px; margin-top: 5px; margin-left: 10px" href="resetpassword.php" class="sub-link"> Reset Password </a>
        </div><br>
        
      <!--  <div class="card-header" id="headingThree">-->
      <!--    <h2 class="mb-0"> <a href="#" class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#app" aria-expanded="false" aria-controls="app"> <img  class="imggg" src="images/download.png">-->
      <!--      &nbsp;&nbsp; App Download </a> </h2>-->
      <!--  </div>-->
      <!--  <div style="padding-left: 15px;" id="app" class="collapse">-->
      <!--<a style="color: #757575; font-size: 16px; margin-top: 5px; margin-left: 10px" href="winner_zone.apk" class="sub-link"> Android Download </a>-->
      <!--  </div><br>-->
        
           
           <div class="card-header">
            <h2 class="mb-0"> <a onclick="window.location.href='complaint.php'" class="btn btn-link collapsed"> <img  class="imggg" src="images/complain.png">
            &nbsp;&nbsp; Complaints &amp; Suggestions </a> </h2>
          </div><br>
      <div class="card-header" id="headingThree">
          <h2 class="mb-0"> <a style="color: #757575;" href="#" class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapsefive" aria-expanded="false" aria-controls="collapsefive"> <img  class="imggg" src="images/about.png">
            &nbsp;&nbsp; About us  </a> </h2>
           </div><br>
        <div style="margin-top: -10px;" id="collapsefive" class="collapse">
        <a style="color: #757575; font-size: 16px; margin-top: 5px; margin-left: 10px" href="privacy.php" class="sub-link"> 
            &nbsp;&nbsp; Privacy Policy  </a> 
        <a style="color: #757575; font-size: 16px; margin-top: 5px; margin-left: 10px" href="riskagreement.php" class="sub-link">
            &nbsp;&nbsp; Risk Disclosure Agreement  </a> <br>
        </div> 
         
      </div>
    </div>
  </div>
     <div class="text-center"> <a data-toggle="modal" href="#confirm" data-backdrop="static" data-keyboard="false" class="btn btn-sm btn-light" style="width:170px; height:35px; ">Logout</a> </div> </div> 
       <a href="https://telegram.dog/<?php $telegram=mysqli_query($con,"select * from `setting`");
	$link=mysqli_fetch_array($telegram);
	$ready = $link['telegram']; echo $ready;?>" target="_blank" class="fixed_kefu">
      <img src="./images/headphn.png">
     Online
    </a>

<?php include("include/footer.php");?>
<!-- Jquery --> 
<script>
	window.oncontextmenu = function () {
				return false;
			}
			$(document).keydown(function (event) {
				if (event.keyCode == 123) {
					return false;
				}
				else if ((event.ctrlKey && event.shiftKey && event.keyCode == 73) || (event.ctrlKey && event.shiftKey && event.keyCode == 74)) {
					return false;
				}
			});
</script>
<div id="notification" class="modal " role="dialog">
  <div class="modal-dialog modal-sm p-5">
    <div class="modal-content">
 
      <div class="modal-body responsive">
   <h5 class="tz_title">Notice</h5>
    <div class="signinInfo">
                <p class="signinfo">
  <?php $telegram=mysqli_query($con,"select * from `setting`");
	$link=mysqli_fetch_array($telegram);
	$ready = $link['note']; echo $ready;?></p></div>
   
   
       <div class="text-center pb-1">
              <div class="tz_close"><button   style="color: #009688" data-dismiss="modal">CLOSE</button>
           
              </div>
            </div>
      </div>
    
    </div>
  </div>
</div>


 <?php $getdata = mysqli_query($con, "SELECT * FROM `tbl_signin` WHERE `userid` = $userid  ORDER BY `id` DESC limit 1");
    $fetch = mysqli_fetch_assoc($getdata);
    $date = date("Y-m-d");

    if ($fetch['date'] == $date) {
      $singin = "Had signed in";
      $rebt = $fetch['rebates'];
    } else {
      $singin = "Signin Now";
      $rebt = 0;
    }

    $sum_1 = 0;
    $getdata2 = mysqli_query($con, "SELECT * FROM `tbl_signin` WHERE `userid` = $userid");
    $fetch_1 = mysqli_num_rows($getdata2);

    foreach ($getdata2 as $dt) {
      $sum_1 += $dt['rebates'];
    }

    ?>


    <div id="signin" class="modal  " role="dialog">
      <div class="modal-dialog modal-sm p-5" role="document">
        <div class="modal-content ">
          <div class="modal-body" id="alertmessage">
            <div class="">
              <h5 class="tz_title">Sign In</h5>
              <div class="signinInfo">
                <php class="signinfo">Total: <?php echo $fetch_1 ?> Days</p>
                  <p class="signinfo">Today Rebates: ₹ <?php echo   $rebt ?></p>
                  <p class="signinfo">Total Rebates: ₹ <?php echo  $sum_1 ?></p>
                  <p class="signinfo">
                    Status: <?php echo $singin ?>
                  </p>
                  <!---->
              </div>
              <input type="hidden" name="userid" value="<?php echo $userid ?>" id="signinform">
            </div>
            <div class="text-center pb-1">
              <div class="tz_close"><button   style="color: rgb(136, 136, 136);" data-dismiss="modal">CANCEL</button>
                <button id="signinbtn">SIGN IN</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

<div id="confirm" class="modal " role="dialog">
  <div class="modal-dialog modal-sm p-5" role="document">
    <div class="modal-content" style="padding:8px;">
       <div class="">
              <h5 class="tz_title">Confirm</h5>
       <div class="signinInfo">
                <p class="signinfo">Do you want to logout?</p>
                </div>
<input type="hidden" id="id" name="id" value="">
<input type="hidden" id="type" name="type" value="">
     <div class="text-center pb-1">
              <div class="tz_close layout"><button   style="color: rgb(136, 136, 136);" data-dismiss="modal">CANCEL</button>
                <a href="logout"><button onclick="logout">YES</button></a>
              </div>
            </div>
    </div>
  </div>
</div>
</div>
<script src="assets/js/lib/jquery-3.4.1.min.js"></script> 
<!-- Bootstrap--> 
<script src="assets/js/lib/popper.min.js"></script> 
<script src="assets/js/lib/bootstrap.min.js"></script> 
<!-- Owl Carousel --> 
<script src="assets/js/plugins/owl.carousel.min.js"></script> 
<!-- Main Js File --> 
<script src="assets/js/app.js"></script>
<script src="assets/js/jquery.validate.min.js"></script>
<script src="assets/js/bonus.js"></script>
<script src="assets/js/jquery.dataTables.min.js"></script>
</body>

<script>
  $("#signinbtn").click(function() {
    var data = $("#signinform").val();

    $.ajax({
      method: "POST",
      url: "dosigninin.php",
      data: {
        userid: data
      },
      success: function(response) {
        if (response == 1) {
          alert('Sign In Success');
          window.location.reload()
        } else if (response == 2) {
          alert('Something Went Wrong');
          window.location.reload()
        } else if (response == 3) {
          alert('Already Sign In');
          $('#signin').modal('hide');
        }
        else if (response == 4) {
          alert('You Need To Complete Betting of Amount ₹<?php      // $total_recharge = mysqli_query($con,"SELECT sum(amount) as total FROM `tbl_recharge` WHERE status = 1 AND userid = '".$userid."'"); 
    //	$wagar_recharge1=mysqli_fetch_array($total_recharge);
    	
    //	$wagar=mysqli_query($con,"select * from `tbl_paymentsetting`");
//	$wagaramount=mysqli_fetch_array($wagar);
//	$fixwagar = $wagaramount['wagar'];
// $wagar_recharge = $wagar_recharge1['total']*$fixwagar;
              @$date = date("Y-m-d");  
         $total_bet1 = mysqli_query($con,"SELECT sum(amount) as total1 FROM `tbl_betting` where userid = '".$userid."' and date(`createdate`)='".$date."' ");
                	$wagar_bet1=mysqli_fetch_array($total_bet1);
                $total_bet = 500-$wagar_bet1['total1'];
                
                
                
                // $wagar_check = $wagar_recharge-$total_bet;
                
                echo $total_bet;?> For Signin!');
          $('#signin').modal('hide');
        }
      }
    });
  })
</script>
</html>