<?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();} 
?>
    <section class="content-header">
      <h1>
        Profits Trade
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="breadcrumb-item active">Profits Trade</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{
?>
<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">Profits [
 Total Profits : <?php
		$ttlbonusee = total_profittrade_member($user_session);
if($ttlbonusee>0) { echo rupiah($ttlbonusee); }else{ echo rupiah(0); }
?>]
</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 class="bg-primary-600">
                <tr>
                <th width="20%" align="center"><?php echo $LANG["prof_date"]?></th> 
                        <th width="19%" align="center">Trade</th> 
                        <th width="30%" align="center"><?php echo $LANG["prof_type"]?></th> 
                        <th width="22%" align="center"><?php echo $LANG["amount"]?></th>
                </tr>
              </thead>
              <tbody>
<?
if(isset($_GET["co"])){
	$db->select("id, username, bayar, tglbayar, status, total, jenis, dari, kode, gett", "komisi", "jenis='komtrade' and username='$user_session' and kode='".$_GET["co"]."'", "tglbayar desc");
}else{
	$db->select("id, username, bayar, tglbayar, status, total, jenis, dari, kode, gett", "komisi", "jenis='komtrade' and username='$user_session'", "tglbayar desc");
}
	
		while($row=$db->fetch_row()) {
			if(is_odd($nom) == 0) {
				$class = "even";
			} else {
				$class = "odd";
			} 	
		if($row[9] == 1) {
				$sts = "<span class='label label-primary'>To Wallet</span>";
			} 	else {
				$sts = "";
			}	
		$user=$row[7];
		$namaspon = "SELECT * FROM member WHERE username='$user'"; 
	 
        $resultnamaspon = mysql_query($namaspon);


$rownamaspon = mysql_fetch_array($resultnamaspon);
$namaspone = $rownamaspon['nama'];	

?>				
				
				
                             
                       <tr> 
                            <td align="center"><?php echo formatgl($row[3]); ?></td>
                            <td align="center"><?php echo $row[8]; ?></td>
                            <td align="center"><?php echo $row[7]; ?></td>
                            <td align="right"><?php echo rupiah($row[2]); ?></td>
                        </tr>
                                                                    
             <?
		}
	?>

              </tbody>
            </table>
                        </div>
                    </div>
                </div>
			</div></div>
			<!-- END PAGE CONTENT -->                       

          
                    
<?php } ?>
</section>