<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');     
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>  

<script>
var URL  = '<?php echo ROOTPATH;?>';  
function del_record(val)
{

    
	var r = confirm("Do you really want to update this record ?");
	if (r == true) {    
	$.ajax({
	type: 'POST',
	    url: URL+"/admin/ajax/default.php",
	//async: false,			 
	data: {xxxx:1,val:val},	  
	success: function(ajaxresult){	     
		location.reload();	 	
	},
	error: function(XMLHttpRequest, textStatus, errorThrown) { 
	alert('Error');
	}
	});
	
	}	
	
}

</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"><h3> Special 100 , Members </h3></div>
					
					<div align="right"> 
					     
					</div>
					
				</div>
				
  				<div class="panel-body">
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>Sr</th>  
								<th>Name</th>  
								<th>Id</th>  
								<th>Re Date</th>  
								<th>2Dy Scrach</th>  
								<th>Topup</th>  
								<th>Total Amount</th>    
								<th>Total Balance</th>   
							</tr>
						</thead>
						<tbody>
							<?php
                                    
                                    $stmt=$conn->prepare("select  * from UI__Rgst   where sp100=1 ");  
                                    //$stmt->bindValue(':Ttime', $InTime , PDO::PARAM_STR);
                                    $stmt->execute(); 
                                    $AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                     
                                  $sr = 1;     
								  foreach($AllUsers as $users)
								  {
								      
                                        $stmt=$conn->prepare("select *  from UI__Reward    where cuurentId=:cuurentId and Tdate=:Tdate  ");   
                                        $stmt->bindValue(':cuurentId', $users->cuurentId , PDO::PARAM_STR);  
                                        $stmt->bindValue(':Tdate',  date("d-M-Y"), PDO::PARAM_STR);  
                                        $stmt->execute(); 
                                        $scr = 0;
                                        if($stmt->rowCount()>0)  
                                            $scr = 1;
                                            
                                        $stmt=$conn->prepare("select *   from UI__DChstr where Rid=:sId  and typ=1");   
                                        $stmt->bindValue(':sId', $users->cuurentId  , PDO::PARAM_STR);  
                                        $stmt->execute(); 
                                        if($stmt->rowCount() > 0)
								        {
                                                $stmt=$conn->prepare("select *  from UI__DailyROIGene    where custId=:sId     ");   
                                                $stmt->bindValue(':sId',  $users->cuurentId  , PDO::PARAM_INT);  
                                                $stmt->execute(); 
                                                $XUI__DailyROIGene = $stmt->fetchAll(PDO::FETCH_OBJ);  
                                                
                                                $Tamnt = 0;
                                                foreach($XUI__DailyROIGene as $xx)
                                                {
                                                    $Tamnt +=$xx->amount;
                                                }
                                                
                                                $pp = number_format((float)((150000-($Tamnt+100000))), 2, '.', '');
								        }else
								              $pp = 0;
								              
                                        $stmt=$conn->prepare("select amount   from  UI__DailyROIGene where custId=:custId  and Tdate=:Tdate");
                                        $stmt->bindValue(':custId', $users->cuurentId  , PDO::PARAM_STR);  
                                        $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR);  
                                        $stmt->execute();  
                                        $UI__DailyROIGeneCt = $stmt->fetch(PDO::FETCH_OBJ);  
                                         
                                        
                                        $stmt=$conn->prepare("select reward   from  UI__Reward where cuurentId=:cuurentId  and Tdate=:Tdate");
                                        $stmt->bindValue(':cuurentId', $users->cuurentId  , PDO::PARAM_STR);  
                                        $stmt->bindValue(':Tdate', date("d-M-Y") , PDO::PARAM_STR);  
                                        $stmt->execute();  
                                        $UI__reward = $stmt->fetch(PDO::FETCH_OBJ);       
							?>
							
							<tr class="odd gradeX">
								<td><?php echo $sr++;?> </td>
								<td><?php echo $users->nm;?> </td>
								<td><?php echo $users->cuurentId;?> </td>
								<td><?php echo $users->RegOn;?> </td>
								<td><?php if($scr==1) echo "Scratch"; else echo "No Yet"; ?> </td>
								<td><?php if($pp>0) echo "YES"; else echo "NO"; ?> </td>
								
								<td><?php   echo ($UI__DailyROIGeneCt->amount+$UI__reward->reward); ?>  </td>  
								<td><?php echo $pp;?> </td>
								 
							</tr>  
							<?php     
								  }
						    ?>
						</tbody>
					</table>
  				</div>
  			</div>



		  </div>
		</div>
    </div>

<?php  include ABS_PATH.'/admin/footer.php';	?>    