<?php
if (basename($_SERVER['SCRIPT_FILENAME']) == basename(__FILE__)){
echo "<p align=center><br><br><br><br><br><br><font size=\"6\" color=\"#FF0000\">ILLEGAL ACCESS !!";
echo "<meta http-equiv=\"refresh\" content=\"2; url=../index.php\">";
exit();} 
?>
 <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
       Rewards
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="breadcrumb-item active">Rewards</li>
      </ol>
    </section>


    <section class="content">
<?php
if($db->dataku("status", $user_session) == 0 || $db->dataku("blokir", $user_session) == 1) {
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".$LANG["status0"]."</div>";
}else{
?>

 
 <?php
if (isset($_GET['page']) && $_GET['page'] == "detailwd") {
?>
<div class="row">
            	<div class="col-md-12">
                
                  <div class="box box-solid bg-dark">
            <div class="box-header with-border">
              <h3 class="box-title">Rewards</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
				<div class="table-responsive">
				  <table id="example" class="table table-bordered table-hover display nowrap margin-top-10 w-p100">            

              <thead>
                <tr>
                 <th>Date</th> 
                        <th>No</th> 
                        <th>Reward</th> 
                        <th>Poin</th> 
                        <th>Bonus</th> 
                        <th>Status</th>
                </tr>
              </thead>
              <tbody>
      <?

	$db->select("id, username, kode, jenis, reward, status, tgl, pointreward", "wd_reward", "username='$user_session'", "id desc");
	
		while($row=$db->fetch_row()) {
			
			
			if(is_odd($nom) == 0) {
				$class = "even";
			} else {
				$class = "odd";
			} 	
			
			$stats = $row[8];	
  

	
	
if($row[5] > 0) {
				$st = "<span class='btn btn-success btn-xs'>Done</span>";
			} else {
				$st = "<span class='btn btn-danger btn-xs'>Pending</span>";
			}		
			
	
	
		
?>				
                             
                    <tr> 
                            
                            <td><?php echo $row[6]; ?></td>
                            <td><?php echo $row[2]; ?></td>
                            <td><?php echo $row[3]; ?></td>
                            <td><?php echo rupiah($row[7]); ?></td>
                            <td><?php echo $row[4]; ?></td>
                            <td><?php echo $st; ?></td>
                          
                        </tr>
                        <?php } ?>
              </tbody>
            </table>
						</div>
							</div>
							</div>
							</div>
							</div>





<?php } else { ?>

 
 
 
 
 
 
  <?

if(isset($_POST['getreward'])){	

$reward = anti_injection($_POST['reward']);
$kodeproses = anti_injection($_POST['kodeproses']);

$rwww="SELECT peringkat2 FROM configuration"; 
$dtrwww=mysql_query($rwww);
$configrwww=mysql_fetch_array($dtrwww);
$batasrwd = explode("|", $configrwww['peringkat2']);
$rankrwd = explode("|", $configrwww['peringkat2']);
$rewardrwd = explode("|", $configrwww['peringkat2']);

$batasrw1 = $batasrwd[0]; 
$batasrw2 = $batasrwd[4]; 
$batasrw3 = $batasrwd[8]; 
$batasrw4 = $batasrwd[12]; 
$batasrw5 = $batasrwd[16];
$batasrw6 = $batasrwd[20];
$batasrw7 = $batasrwd[24];

$rankrwx1 = $rankrwd[1]; 
$rankrwx2 = $rankrwd[5]; 
$rankrwx3 = $rankrwd[9]; 
$rankrwx4 = $rankrwd[13]; 
$rankrwx5 = $rankrwd[17]; 
$rankrwx6 = $rankrwd[21]; 
$rankrwx7 = $rankrwd[25]; 

$rewardx1 = $rewardrwd[2]; 
$rewardx2 = $rewardrwd[6]; 
$rewardx3 = $rewardrwd[10]; 
$rewardx4 = $rewardrwd[14]; 
$rewardx5 = $rewardrwd[18]; 
$rewardx6 = $rewardrwd[22]; 
$rewardx7 = $rewardrwd[26]; 
 

if($reward == 1){
$rewardnyax = $rewardx1;
$pointnyax = $batasrw1;
$jenisnyax = $rankrwx1;
}else if($reward == 2){
$rewardnyax = $rewardx2;
$pointnyax = $batasrw2;
$jenisnyax = $rankrwx2;
}else if($reward == 3){
$rewardnyax = $rewardx3;
$pointnyax = $batasrw3;
$jenisnyax = $rankrwx3;
}else if($reward == 4){
$rewardnyax = $rewardx4;
$pointnyax = $batasrw4;
$jenisnyax = $rankrwx4;
}else if($reward == 5){
$rewardnyax = $rewardx5;
$pointnyax = $batasrw5;
$jenisnyax = $rankrwx5;
}else if($reward == 6){
$rewardnyax = $rewardx6;
$pointnyax = $batasrw6;
$jenisnyax = $rankrwx6;
}else if($reward == 7){
$rewardnyax = $rewardx7;
$pointnyax = $batasrw7;
$jenisnyax = $rankrwx7;
}else{
$rewardnyax = "";
$pointnyax = "";
$jenisnyax = "";
}

$typereward=$reward;

$smc = mysql_query("SELECT * FROM wd_reward WHERE kode='".$kodeproses."'");
$cekode = mysql_num_rows($smc);
if($cekode > 0) {
header("location: index.php?go=bonusrw&result=already_process");
	exit;
}else{
$db->insert("wd_reward", "", "'', '$kodeproses', '$user_session', '$jenisnyax', '$pointnyax', '$rewardnyax', '0', '$clientdate', '', '', '$reward'"); 

header("location: index.php?go=bonusrw&result=success&st=".$prosesreward."");
	exit;

}


}else{


$rwww="SELECT peringkat2 FROM configuration"; 
$dtrwww=mysql_query($rwww);
$configrwww=mysql_fetch_array($dtrwww);
$batasrwd = explode("|", $configrwww['peringkat2']);
$rankrwd = explode("|", $configrwww['peringkat2']);
$rewardrwd = explode("|", $configrwww['peringkat2']);

$batasrwx1 = $batasrwd[0]; 
$batasrwx2 = $batasrwd[4]; 
$batasrwx3 = $batasrwd[8]; 
$batasrwx4 = $batasrwd[12]; 
$batasrwx5 = $batasrwd[16];
$batasrwx6 = $batasrwd[20];
$batasrwx7 = $batasrwd[24];

$rankrwx1 = $rankrwd[1]; 
$rankrwx2 = $rankrwd[5]; 
$rankrwx3 = $rankrwd[9]; 
$rankrwx4 = $rankrwd[13]; 
$rankrwx5 = $rankrwd[17]; 
$rankrwx6 = $rankrwd[21]; 
$rankrwx7 = $rankrwd[25]; 

$rewardx1 = $rewardrwd[2]; 
$rewardx2 = $rewardrwd[6]; 
$rewardx3 = $rewardrwd[10]; 
$rewardx4 = $rewardrwd[14]; 
$rewardx5 = $rewardrwd[18]; 
$rewardx6 = $rewardrwd[22]; 
$rewardx7 = $rewardrwd[26]; 


$batasrwspon1 = $rewardrwd[3]; 
$batasrwspon2 = $rewardrwd[7]; 
$batasrwspon3 = $rewardrwd[11]; 
$batasrwspon4 = $rewardrwd[15]; 
$batasrwspon5 = $rewardrwd[19]; 
$batasrwspon6 = $rewardrwd[23]; 
$batasrwspon7 = $rewardrwd[27]; 

$sql_rwd1 = mysql_query("select SUM(pointreward) from wd_reward where username='".$user_session."' and jenisrw='1'");
$rowcrwd1 = mysql_fetch_array($sql_rwd1);
if($rowcrwd1[0] > 0){
$point1 = $rowcrwd1[0];
$status1="<img src='../images/tick.png' width='16' height='16' />";
} else {
$point1 = "";
$status1="<img src='../images/publish_x.png' width='16' height='16' />";
}

$sql_rwd2 = mysql_query("select SUM(pointreward) from wd_reward where username='".$user_session."' and jenisrw='2'");
$rowcrwd2 = mysql_fetch_array($sql_rwd2);
if($rowcrwd2[0] > 0){
$point2 = $rowcrwd2[0];
$status2="<img src='../images/tick.png' width='16' height='16' />";
} else {
$point2 = "";
$status2="<img src='../images/publish_x.png' width='16' height='16' />";
}

$sql_rwd3 = mysql_query("select SUM(pointreward) from wd_reward where username='".$user_session."' and jenisrw='3'");
$rowcrwd3 = mysql_fetch_array($sql_rwd3);
if($rowcrwd3[0] > 0){
$point3 = $rowcrwd3[0];
$status3="<img src='../images/tick.png' width='16' height='16' />";
} else {
$point3 = "";
$status3="<img src='../images/publish_x.png' width='16' height='16' />";
}

$sql_rwd4 = mysql_query("select SUM(pointreward) from wd_reward where username='".$user_session."' and jenisrw='4'");
$rowcrwd4 = mysql_fetch_array($sql_rwd4);
if($rowcrwd4[0] > 0){
$point4 = $rowcrwd4[0];
$status4="<img src='../images/tick.png' width='16' height='16' />";
} else {
$point4 = "";
$status4="<img src='../images/publish_x.png' width='16' height='16' />";
}

$sql_rwd5 = mysql_query("select SUM(pointreward) from wd_reward where username='".$user_session."' and jenisrw='5'");
$rowcrwd5 = mysql_fetch_array($sql_rwd5);
if($rowcrwd5[0] > 0){
$point5 = $rowcrwd5[0];
$status5="<img src='../images/tick.png' width='16' height='16' />";
} else {
$point5 = "";
$status5="<img src='../images/publish_x.png' width='16' height='16' />";
}
$sql_rwd6 = mysql_query("select SUM(pointreward) from wd_reward where username='".$user_session."' and jenisrw='6'");
$rowcrwd6 = mysql_fetch_array($sql_rwd6);
if($rowcrwd6[0] > 0){
$point6 = $rowcrwd6[0];
$status6="<img src='../images/tick.png' width='16' height='16' />";
} else {
$point6 = "";
$status6="<img src='../images/publish_x.png' width='16' height='16' />";
}
$sql_rwd7 = mysql_query("select SUM(pointreward) from wd_reward where username='".$user_session."' and jenisrw='7'");
$rowcrwd7 = mysql_fetch_array($sql_rwd7);
if($rowcrwd7[0] > 0){
$point7 = $rowcrwd7[0];
$status7="<img src='../images/tick.png' width='16' height='16' />";
} else {
$point7 = "";
$status7="<img src='../images/publish_x.png' width='16' height='16' />";
}

$pointnya = $point1+$point2+$point3+$point4+$point5+$point6+$point7;
//$memberix = omsetkiri($user_session);
//$membernanx = omsetkanan($user_session);
//$memberip = $memberix-$pointnya;
//$membernanp = $membernanx-$pointnya;
//$jmlhspone=total_spone($user_session);
$omsetassetsku = totalomset($user_session);
//$omsetassetspon = omset_assetspon($user_session);
?>
<script>
		function confirmActiongetrw(){
      var confirmed = confirm("Claim your reward bonus now?");
      return confirmed;
}
</script>
<?php      
$initiale = substr(str_shuffle(str_repeat("ABCEFGHIJKLMNPRSTUVWXYZ", 36)), 6, 2);
$stkode = strtotime(date("Y-m-d H:i:s"));
$kodecontribute = $initiale."".$stkode;


?>
 <?php
$results = $_GET['result'];
if($results == "err_ticket") { 
echo "<div style='margin-left:12px'><div class='errorx' style='width:390px;'><strong>You not have PIN Activation, to claim reward you must have 1 PIN Activation</strong></div></div>";
}
?>
 <?php
$results = $_GET['result'];
if($results == "already_process") { 
echo "<div style='margin-left:12px'><div class='errorx' style='width:390px;'><strong>This transaction already in process!</strong></div></div>";
}
?>
<?php
$results = $_GET['result'];
$ckne = $_GET['st'];
if($results == "success" && $ckne == 0) { 
echo "<div class='alert alert-success'>Claim reward was successful, Please wait for the admin approval to process your reward.</div>";
}
if($results == "success" && $ckne == 1) { 
echo "<div class='alert alert-success'>Claim reward was successful.</div>";
}
?> 









<div class="row fx-element-overlay">
     
       
	<?php if($batasrwx1 > 0){?>
         <?php
							$dirfoto = "../images/banner/".$fotoreward1."";
	if (!empty($fotoreward1) && (file_exists($dirfoto))){
		$gambar1 = "<img src='".$dirfoto."'>";
		$gambar1e = "".$dirfoto."";
		}
	else
		{
		$gambar1 = "<img src='../images/image-not-available.jpg'>";
		$gambar1e = "../images/image-not-available.jpg";
		} 	
		?>
         <div class="col-md-12 col-lg-4">
          <div class="box box-default pull-up">
            <div class="fx-card-item">
				<div class="fx-card-avatar fx-overlay-1"><?php echo $gambar1; ?>
					<div class="fx-overlay scrl-dwn">
						<ul class="fx-info">
							<li><a class="btn default btn-outline image-popup-vertical-fit" href="<?php echo $gambar1e; ?>"><i class="ion-search"></i></a></li>
						</ul>
					</div>
				</div>
				<div class="fx-card-content">
					<h3><?php echo $rankrwx1; ?></h3>
                    (<?php echo $rewardx1; ?>)
                    <p class="text">Qualifield Omset <?php echo rupiah($batasrwx1); ?>
              
              <hr />
              Total Omset: <?php if($omsetassetsku >= $batasrwx1){echo "".rupiah($omsetassetsku).""; }else{ echo "<font color='#FF0000'>".rupiah($omsetassetsku)."</font>"; }?></p>
               
                 <?php
							
							$cekadanerw1 = mysql_query("select * from wd_reward where username='$user_session' and jenisrw='1'");
$ada_adanerw1 = mysql_num_rows($cekadanerw1); 
$rewadarw1=mysql_fetch_array($cekadanerw1);
if(!$ada_adanerw1) { 
if($omsetassetsku >= $batasrwx1){
?>
							<form id="tab2" name="wallet_depo" method="post" action="">
							<input name="kodeproses" type="hidden" id="kodeproses" value="<?php echo $kodecontribute; ?>">
                            <input name="reward" type="hidden" id="reward" value="1">
							<button class='btn btn-success' name='getreward' type='submit' style='font-size:12px;' onclick='return confirmActiongetrw()'><i class='fa fa-check'></i>&nbsp;&nbsp;Get Reward</button>
                            </form>
                            <?php } else { ?>
                            <button class='btn btn-danger' type='button'><i class='fa fa-ban'></i>&nbsp;&nbsp;Not Qualifield</button>
                            <?php } ?> 
                            <?php } else { ?>
							<?php if($rewadarw1['status'] == 1){ ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-success' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Success</button></a>
                            <?php } else { ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-warning' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Claimed</button></a>
                            <?php } ?>
							<?php } ?> 
					<br> </div>
			</div>
          </div>
        </div>
		<?php } ?> 
        
      	<?php if($batasrwx2 > 0){?>
         <?php
							$dirfoto2 = "../images/banner/".$fotoreward2."";
	if (!empty($fotoreward2) && (file_exists($dirfoto2))){
		$gambar2 = "<img src='".$dirfoto2."'>";
		$gambar2e = "".$dirfoto2."";
		}
	else
		{
		$gambar2 = "<img src='../images/image-not-available.jpg'>";
		$gambar2e = "../images/image-not-available.jpg";
		} 	
		?>
         <div class="col-md-12 col-lg-4">
          <div class="box box-default pull-up">
            <div class="fx-card-item">
				<div class="fx-card-avatar fx-overlay-1"><?php echo $gambar2; ?>
					<div class="fx-overlay scrl-dwn">
						<ul class="fx-info">
							<li><a class="btn default btn-outline image-popup-vertical-fit" href="<?php echo $gambar2e; ?>"><i class="ion-search"></i></a></li>
						</ul>
					</div>
				</div>
				<div class="fx-card-content">
					<h3><?php echo $rankrwx2; ?></h3>
                    (<?php echo $rewardx2; ?>)
                    <p class="text">Qualifield Omset <?php echo rupiah($batasrwx2); ?>
              
              <hr />
             Total Omset: <?php if($omsetassetsku >= $batasrwx2){echo "".rupiah($omsetassetsku).""; }else{ echo "<font color='#FF0000'>".rupiah($omsetassetsku)."</font>"; }?></p>
               
                 <?php
							
							$cekadanerw2 = mysql_query("select * from wd_reward where username='$user_session' and jenisrw='2'");
$ada_adanerw2 = mysql_num_rows($cekadanerw2); 
$rewadarw2=mysql_fetch_array($cekadanerw2);
if(!$ada_adanerw2) { 
if($omsetassetsku >= $batasrwx2){
?>
							<form id="tab2" name="wallet_depo" method="post" action="">
							<input name="kodeproses" type="hidden" id="kodeproses" value="<?php echo $kodecontribute; ?>">
                            <input name="reward" type="hidden" id="reward" value="2">
							<button class='btn btn-success' name='getreward' type='submit' style='font-size:12px;' onclick='return confirmActiongetrw()'><i class='fa fa-check'></i>&nbsp;&nbsp;Get Reward</button>
                            </form>
                            <?php } else { ?>
                            <button class='btn btn-danger' type='button'><i class='fa fa-ban'></i>&nbsp;&nbsp;Not Qualifield</button>
                            <?php } ?> 
                            <?php } else { ?>
							<?php if($rewadarw2['status'] == 1){ ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-success' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Success</button></a>
                            <?php } else { ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-warning' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Claimed</button></a>
                            <?php } ?>
							<?php } ?> 
					<br> </div>
			</div>
          </div>
        </div>
		<?php } ?> 
        
       	<?php if($batasrwx3 > 0){?>
         <?php
							$dirfoto3 = "../images/banner/".$fotoreward3."";
	if (!empty($fotoreward3) && (file_exists($dirfoto3))){
		$gambar3 = "<img src='".$dirfoto3."'>";
		$gambar3e = "".$dirfoto3."";
		}
	else
		{
		$gambar3 = "<img src='../images/image-not-available.jpg'>";
		$gambar3e = "../images/image-not-available.jpg";
		} 	
		?>
         <div class="col-md-12 col-lg-4">
          <div class="box box-default pull-up">
            <div class="fx-card-item">
				<div class="fx-card-avatar fx-overlay-1"><?php echo $gambar3; ?>
					<div class="fx-overlay scrl-dwn">
						<ul class="fx-info">
							<li><a class="btn default btn-outline image-popup-vertical-fit" href="<?php echo $gambar3e; ?>"><i class="ion-search"></i></a></li>
						</ul>
					</div>
				</div>
					<div class="fx-card-content">
					<h3><?php echo $rankrwx3; ?></h3>
                    (<?php echo $rewardx3; ?>)
                    <p class="text">Qualifield Omset <?php echo rupiah($batasrwx3); ?>
              
              <hr />
               Total Omset: <?php if($omsetassetsku >= $batasrwx3){echo "".rupiah($omsetassetsku).""; }else{ echo "<font color='#FF0000'>".rupiah($omsetassetsku)."</font>"; }?></p>
                 
                 <?php
							
							$cekadanerw3 = mysql_query("select * from wd_reward where username='$user_session' and jenisrw='3'");
$ada_adanerw3 = mysql_num_rows($cekadanerw3); 
$rewadarw3=mysql_fetch_array($cekadanerw3);
if(!$ada_adanerw3) { 
if($omsetassetsku >= $batasrwx3){
?>
							<form id="tab2" name="wallet_depo" method="post" action="">
							<input name="kodeproses" type="hidden" id="kodeproses" value="<?php echo $kodecontribute; ?>">
                            <input name="reward" type="hidden" id="reward" value="3">
							<button class='btn btn-success' name='getreward' type='submit' style='font-size:12px;' onclick='return confirmActiongetrw()'><i class='fa fa-check'></i>&nbsp;&nbsp;Get Reward</button>
                            </form>
                            <?php } else { ?>
                            <button class='btn btn-danger' type='button'><i class='fa fa-ban'></i>&nbsp;&nbsp;Not Qualifield</button>
                            <?php } ?> 
                            <?php } else { ?>
							<?php if($rewadarw3['status'] == 1){ ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-success' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Success</button></a>
                            <?php } else { ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-warning' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Claimed</button></a>
                            <?php } ?>
							<?php } ?> 
					<br> </div>
			</div>
          </div>
        </div>
		<?php } ?>  
        
               	<?php if($batasrwx4 > 0){?>
         <?php
							$dirfoto4 = "../images/banner/".$fotoreward4."";
	if (!empty($fotoreward4) && (file_exists($dirfoto4))){
		$gambar4 = "<img src='".$dirfoto4."'>";
		$gambar4e = "".$dirfoto4."";
		}
	else
		{
		$gambar4 = "<img src='../images/image-not-available.jpg'>";
		$gambar4e = "../images/image-not-available.jpg";
		} 	
		?>
         <div class="col-md-12 col-lg-4">
          <div class="box box-default pull-up">
            <div class="fx-card-item">
				<div class="fx-card-avatar fx-overlay-1"><?php echo $gambar4; ?>
					<div class="fx-overlay scrl-dwn">
						<ul class="fx-info">
							<li><a class="btn default btn-outline image-popup-vertical-fit" href="<?php echo $gambar4e; ?>"><i class="ion-search"></i></a></li>
						</ul>
					</div>
				</div>
									<div class="fx-card-content">
					<h3><?php echo $rankrwx4; ?></h3>
                    (<?php echo $rewardx4; ?>)
                  
                    <p class="text">Qualifield Omset <?php echo rupiah($batasrwx4); ?>
              
              <hr />
              Total Omset: <?php if($omsetassetsku >= $batasrwx4){echo "".rupiah($omsetassetsku).""; }else{ echo "<font color='#FF0000'>".rupiah($omsetassetsku)."</font>"; }?></p>
                   
                 <?php
							
							$cekadanerw4 = mysql_query("select * from wd_reward where username='$user_session' and jenisrw='4'");
$ada_adanerw4 = mysql_num_rows($cekadanerw4); 
$rewadarw4=mysql_fetch_array($cekadanerw4);
if(!$ada_adanerw4) { 
if($omsetassetsku >= $batasrwx4){
?>
							<form id="tab2" name="wallet_depo" method="post" action="">
							<input name="kodeproses" type="hidden" id="kodeproses" value="<?php echo $kodecontribute; ?>">
                            <input name="reward" type="hidden" id="reward" value="4">
							<button class='btn btn-success' name='getreward' type='submit' style='font-size:12px;' onclick='return confirmActiongetrw()'><i class='fa fa-check'></i>&nbsp;&nbsp;Get Reward</button>
                            </form>
                            <?php } else { ?>
                            <button class='btn btn-danger' type='button'><i class='fa fa-ban'></i>&nbsp;&nbsp;Not Qualifield</button>
                            <?php } ?> 
                            <?php } else { ?>
							<?php if($rewadarw4['status'] == 1){ ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-success' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Success</button></a>
                            <?php } else { ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-warning' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Claimed</button></a>
                            <?php } ?>
							<?php } ?> 
					<br> </div>
			</div>
          </div>
        </div>
		<?php } ?>  
        	<?php if($batasrwx5 > 0){?>
         <?php
							$dirfoto5 = "../images/banner/".$fotoreward5."";
	if (!empty($fotoreward5) && (file_exists($dirfoto5))){
		$gambar5 = "<img src='".$dirfoto5."'>";
		$gambar5e = "".$dirfoto5."";
		}
	else
		{
		$gambar5 = "<img src='../images/image-not-available.jpg'>";
		$gambar5e = "../images/image-not-available.jpg";
		} 	
		?>
         <div class="col-md-12 col-lg-4">
          <div class="box box-default pull-up">
            <div class="fx-card-item">
				<div class="fx-card-avatar fx-overlay-1"><?php echo $gambar5; ?>
					<div class="fx-overlay scrl-dwn">
						<ul class="fx-info">
							<li><a class="btn default btn-outline image-popup-vertical-fit" href="<?php echo $gambar5e; ?>"><i class="ion-search"></i></a></li>
						</ul>
					</div>
				</div>
													<div class="fx-card-content">
					<h3><?php echo $rankrwx5; ?></h3>
                    (<?php echo $rewardx5; ?>)
                   
                    <p class="text">Qualifield Omset <?php echo rupiah($batasrwx5); ?>
              
              <hr />
              Total Omset: <?php if($omsetassetsku >= $batasrwx5){echo "".rupiah($omsetassetsku).""; }else{ echo "<font color='#FF0000'>".rupiah($omsetassetsku)."</font>"; }?></p>
               
                 <?php
							
							$cekadanerw5 = mysql_query("select * from wd_reward where username='$user_session' and jenisrw='5'");
$ada_adanerw5 = mysql_num_rows($cekadanerw5); 
$rewadarw5=mysql_fetch_array($cekadanerw5);
if(!$ada_adanerw5) { 
if($omsetassetsku >= $batasrwx5){
?>
							<form id="tab2" name="wallet_depo" method="post" action="">
							<input name="kodeproses" type="hidden" id="kodeproses" value="<?php echo $kodecontribute; ?>">
                            <input name="reward" type="hidden" id="reward" value="5">
							<button class='btn btn-success' name='getreward' type='submit' style='font-size:12px;' onclick='return confirmActiongetrw()'><i class='fa fa-check'></i>&nbsp;&nbsp;Get Reward</button>
                            </form>
                            <?php } else { ?>
                            <button class='btn btn-danger' type='button'><i class='fa fa-ban'></i>&nbsp;&nbsp;Not Qualifield</button>
                            <?php } ?> 
                            <?php } else { ?>
							<?php if($rewadarw5['status'] == 1){ ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-success' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Success</button></a>
                            <?php } else { ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-warning' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Claimed</button></a>
                            <?php } ?>
							<?php } ?> 
					<br> </div>
			</div>
          </div>
        </div>
		<?php } ?>   
        
                	<?php if($batasrwx6 > 0){?>
         <?php
							$dirfoto6 = "../images/banner/".$fotoreward6."";
	if (!empty($fotoreward6) && (file_exists($dirfoto6))){
		$gambar6 = "<img src='".$dirfoto6."'>";
		$gambar6e = "".$dirfoto6."";
		}
	else
		{
		$gambar6 = "<img src='../images/image-not-available.jpg'>";
		$gambar6e = "../images/image-not-available.jpg";
		} 	
		?>
         <div class="col-md-12 col-lg-4">
          <div class="box box-default pull-up">
            <div class="fx-card-item">
				<div class="fx-card-avatar fx-overlay-1"><?php echo $gambar6; ?>
					<div class="fx-overlay scrl-dwn">
						<ul class="fx-info">
							<li><a class="btn default btn-outline image-popup-vertical-fit" href="<?php echo $gambar6e; ?>"><i class="ion-search"></i></a></li>
						</ul>
					</div>
				</div>
															<div class="fx-card-content">
					<h3><?php echo $rankrwx6; ?></h3>
                    (<?php echo $rewardx6; ?>)
                 
                    <p class="text">Qualifield Omset <?php echo rupiah($batasrwx6); ?>
              
              <hr />
              Total Omset: <?php if($omsetassetsku >= $batasrwx6){echo "".rupiah($omsetassetsku).""; }else{ echo "<font color='#FF0000'>".rupiah($omsetassetsku)."</font>"; }?></p>
                   
                 <?php
							
							$cekadanerw6 = mysql_query("select * from wd_reward where username='$user_session' and jenisrw='6'");
$ada_adanerw6 = mysql_num_rows($cekadanerw6); 
$rewadarw6=mysql_fetch_array($cekadanerw6);
if(!$ada_adanerw6) { 
if($omsetassetsku >= $batasrwx6){
?>
							<form id="tab2" name="wallet_depo" method="post" action="">
							<input name="kodeproses" type="hidden" id="kodeproses" value="<?php echo $kodecontribute; ?>">
                            <input name="reward" type="hidden" id="reward" value="6">
							<button class='btn btn-success' name='getreward' type='submit' style='font-size:12px;' onclick='return confirmActiongetrw()'><i class='fa fa-check'></i>&nbsp;&nbsp;Get Reward</button>
                            </form>
                            <?php } else { ?>
                            <button class='btn btn-danger' type='button'><i class='fa fa-ban'></i>&nbsp;&nbsp;Not Qualifield</button>
                            <?php } ?> 
                            <?php } else { ?>
							<?php if($rewadarw6['status'] == 1){ ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-success' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Success</button></a>
                            <?php } else { ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-warning' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Claimed</button></a>
                            <?php } ?>
							<?php } ?> 
					<br> </div>
			</div>
          </div>
        </div>
		<?php } ?>   
        
        
        
        
        
        
        
        
        	<?php if($batasrwx7 > 0){?>
         <?php
							$dirfoto7 = "../images/banner/".$fotoreward7."";
	if (!empty($fotoreward7) && (file_exists($dirfoto7))){
		$gambar7 = "<img src='".$dirfoto7."'>";
		$gambar7e = "".$dirfoto7."";
		}
	else
		{
		$gambar7 = "<img src='../images/image-not-available.jpg'>";
		$gambar7e = "../images/image-not-available.jpg";
		} 	
		?>
         <div class="col-md-12 col-lg-4">
          <div class="box box-default pull-up">
            <div class="fx-card-item">
				<div class="fx-card-avatar fx-overlay-1"><?php echo $gambar7; ?>
					<div class="fx-overlay scrl-dwn">
						<ul class="fx-info">
							<li><a class="btn default btn-outline image-popup-vertical-fit" href="<?php echo $gambar7e; ?>"><i class="ion-search"></i></a></li>
						</ul>
					</div>
				</div>
															<div class="fx-card-content">
					<h3><?php echo $rankrwx7; ?></h3>
                    (<?php echo $rewardx7; ?>)
                 
                    <p class="text">Qualifield Omset <?php echo rupiah($batasrwx7); ?>
              
              <hr />
              Total Omset: <?php if($omsetassetsku >= $batasrwx7){echo "".rupiah($omsetassetsku).""; }else{ echo "<font color='#FF0000'>".rupiah($omsetassetsku)."</font>"; }?></p>
                   
                 <?php
							
							$cekadanerw7 = mysql_query("select * from wd_reward where username='$user_session' and jenisrw='7'");
$ada_adanerw7 = mysql_num_rows($cekadanerw7); 
$rewadarw7=mysql_fetch_array($cekadanerw7);
if(!$ada_adanerw7) { 
if($omsetassetsku >= $batasrwx7){
?>
							<form id="tab2" name="wallet_depo" method="post" action="">
							<input name="kodeproses" type="hidden" id="kodeproses" value="<?php echo $kodecontribute; ?>">
                            <input name="reward" type="hidden" id="reward" value="7">
							<button class='btn btn-success' name='getreward' type='submit' style='font-size:12px;' onclick='return confirmActiongetrw()'><i class='fa fa-check'></i>&nbsp;&nbsp;Get Reward</button>
                            </form>
                            <?php } else { ?>
                            <button class='btn btn-danger' type='button'><i class='fa fa-ban'></i>&nbsp;&nbsp;Not Qualifield</button>
                            <?php } ?> 
                            <?php } else { ?>
							<?php if($rewadarw7['status'] == 1){ ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-success' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Success</button></a>
                            <?php } else { ?>
                            <a href='index.php?go=bonusrw&page=detailwd' target='_blank'><button class='btn btn-warning' name='getreward' type='button'><i class='fa fa-check'></i>&nbsp;&nbsp;Claimed</button></a>
                            <?php } ?>
							<?php } ?> 
					<br> </div>
			</div>
          </div>
        </div>
		<?php } ?>   
        
        
        
        
        
        
        
        
      </div>












            <br />&nbsp;&nbsp;<img src="../images/nobalance.png" width="12" height="12" /> Not Qualifield
                        </div>
                    </div>
                </div>
			</div>
			</div>
			<!-- END PAGE CONTENT -->                       



                     
<?php } } } ?>
</section>