<?php
(@include ('../dt_page/lic.php')) or die("<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy;2009 - ".date("Y")." www.primadesain.com</p>");
$lic=$license;if(!$lic){echo "<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy;2009 - ".date("Y")." www.primadesain.com</p>";}$svr=$_SERVER['SERVER_NAME'];$c=curl_init();curl_setopt($c,CURLOPT_URL,"http://www.primadesain.com/verifylicenses.php");curl_setopt($c,CURLOPT_TIMEOUT,30);curl_setopt($c,CURLOPT_POST,1);curl_setopt($c,CURLOPT_RETURNTRANSFER,1);$postfields='svr='.$svr.'&lic='.$lic;curl_setopt($c,CURLOPT_POSTFIELDS,$postfields);$result=curl_exec($c);if($result=="fail"){echo "<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy;2009 - ".date("Y")." www.primadesain.com</p>";die();}
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>
       Investment
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="breadcrumb-item active">Investment</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'] == "cancel") {
if(isset($_GET["sc"])){$sc = anti_injection($_GET["sc"]);}


if($cancelinvest == 0){
header("location: index.php?go=deposit&page=details&result=disable&co=$sc");
	exit;
}else{	

$sqlc = mysql_query("SELECT * FROM deposit WHERE username='$user_session' and kode='$sc'");
$numc = mysql_num_rows($sqlc);
if (!$numc) {
header("location: index.php?go=deposit&page=details&result=error&co=$sc");
	exit;
}else{	

while($rowc = mysql_fetch_array($sqlc)){
$amount = $rowc['jml'];
$kode = $rowc['kode'];
$username = $rowc['username'];
$myproduk = $rowc['planame'];
}

//$bayareactivation=(50/100)*$amount;
//$bayarekeepfunds=(50/100)*$amount;


$feenya=($feecancel/100)*$amount;
$amountrefundact=$amount-$feenya;

$koderefund = $kode."reff";


$cekadane2 = mysql_query("select kode from datacwalet where kode='$koderefund'");
$ada_adane2 = mysql_num_rows($cekadane2); 
if(!$ada_adane2) {	
$db->insert("datacwalet", "", "'', '$koderefund', 'administrator', '$amountrefundact', 'Refund Investment ".$myproduk." ".rupiah($amount)." ".$kode." (Fee ".$feecancel."% ".rupiah($feenya).")', '$username', '$clientdate', 1, '$clientdate', '', ''");		
}

$db->update("deposit", "status='0', dy='1'", "kode='$kode'");
$db->update("dataewalet3", "cycle='1'", "kode='$kode'");

header("location: index.php?go=deposit&page=details&result=canceled&co=$sc");
	exit;
}
}
?>


<?php
 } else if (isset($_GET['page']) && $_GET['page'] == "details") {
if(isset($_GET["co"])){ $co = $_GET["co"]; }	

?>
<script>
		function confirmActionstopprograme(){
      var confirmed = confirm("You will STOP profit and get your capital to wallet balance (this will charge fee <?php echo $feecancel;?>% from your capital balance), are you sure?");
      return confirmed;
}
</script>  
<?php
 if(isset($_GET['result'])&&$_GET['result']=="error"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Investment ".$_GET['co']." not found.</div>";
}
?>
<?php
 if(isset($_GET['result'])&&$_GET['result']=="canceled"){
echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Investment ".$_GET['co']." has been successfully canceled.</div>";
}
?>

<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">Detail Investment <?php echo $co; ?></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>Date</th> 
                        <th>Package</th> 
                        <th>Profit</th> 
                        <th>Contract/ROI</th> 
                        <th>Get Profit</th> 
                       <?php if($cancelinvest == 1){ ?> <th>Cancel</th> <?php } ?>
                        <th>Status</th>
                </tr>
              </thead>
              <tbody>
     <?

	$db->select("id, username, kode, jml, status, tgldepo, tglend, planame, profit, kontrak, cashback, maxbonus, sc, dy", "deposit", "username='$user_session' and kode='$co'", "id desc");
	
		while($row=$db->fetch_row()) {
			
			
			if(is_odd($nom) == 0) {
				$class = "even";
			} else {
				$class = "odd";
			} 	
			
			$stats = $row[8];	
  
	$cccc=base64_encode($row[1]);
	
	if(!$row[11]) {
		$sts = "<span class='label label-warning'>Wait</span>";
	}else{
		$sts = $row[11];
	}
	
	if($row[13] == 1) {
				$st = "<span class='btn btn-danger btn-xs'>Canceled</span>";
				$stx = "";
				

				
	}else{
	
if($row[4] > 0) {
				$st = "<span class='btn btn-success btn-xs'>".$LANG["mbdepo_active"]."</span>";
				$cnclbtn = "<a href='index.php?go=deposit&page=cancel&sc=".$row[2]."' onclick='return confirmActionstopprograme()'><span class='btn btn-danger btn-xs'>Cancel</span></a>";
				$stx = "";
			} else {
				$st = "<span class='btn btn-danger btn-xs'>".$LANG["mbdepo_nactive"]."</span>";
				$cnclbtn = "---";
				$stx = "";
			}	
				}	
			
			$pkt_invs2 = "Package ".$row[7]."";
			$dinone = $row[5];
			$akhire = $row[6]; 
$days = ceil((strtotime("$akhire") - time())/(60*60*24));

$dinone = $days;
$dinone2 = $dinone." days";
if ($dinone <= 0) {
     $statuse = "<span class='btn btn-danger btn-xs'>".$LANG["mbdepo_stop"]."</span>";
     $tox = $row[6];
	 $dinone2 = "--";
				$style = "<font color='#F00000'>";

} else {
     $statuse = "<span class='btn btn-success btn-xs'>".$LANG["mbdepo_active"]."</span>";
     $tox = $row[6];
	  $dinone2 = $dinone2;
				$style = "<font>";
}
$total_depositex = total_deposit_member($user_session);
if($total_depositex > 0){
$total_deposite = rupiah($total_depositex);
}else{
$total_deposite = "0";
}

if($row[5] == "0000-00-00 00:00:00"){
$dtdepo = "----";
}else{
$dtdepo = formatgl($row[5]);
}

if($tox == "0000-00-00 00:00:00" || !$tox){
$dtexp = "----";
}else{
$dtexp = formatgl($tox);
}
$siklus=$row[12];	
	
	   if($siklus == "day"){
		   $pdd = "Daily";
		   $pddx = "Day";
	   }else if($siklus == "week"){
		   $pdd = "Weekly";
		   $pddx = "Week";
	   }else if($siklus == "month"){
		   $pdd = "Monthly";
		   $pddx = "Month";
	   }else{
		   $pdd = "Yearly";
		   $pddx = "Year";
	   }
	   
	
  $ttlprofite=($row[8]/100)*$row[3];
  $ttlroine=$ttlprofite*$row[9];   
		
?>				
                             
                    <tr> 
                            
                            <td><?php echo $dtdepo; ?></td>
                            <td><?php echo $pkt_invs2; ?> - <?php echo rupiah($row[3]); ?></td>
                            <td><?php echo $row[8]; ?>% <?php echo $pdd; ?> (<?php echo rupiah($ttlprofite); ?>)</td>
                           <td><?php echo $row[9]; ?> <?php echo $pddx; ?> (<?php echo rupiah($ttlroine); ?>)</td>
                            <td>
                         <?php 
   $proffffe=total_profit_member_kode($row[1], $row[2]);
   if($proffffe > 0){
	echo "<a href='index.php?go=profits&co=".$row[2]."' target='_blank' style='color:#FC0;'>".rupiah($proffffe)."</a>";
}else{
	echo "--";
}
    ?>
                            </td>
                             <?php if($cancelinvest == 1){ ?> <td><?php echo $cnclbtn; ?></td><?php } ?>
                            <td><?php echo $st; ?><?php echo $stsdt; ?></td>
                          
                        </tr>
                        <?php } ?>
              </tbody>
            </table>
						</div>
							</div>
							</div>
							</div>
							</div>





<?php } else { ?>













                                                

               
               
                    <?
if(isset($_POST['submitcheck'])){
	
	
$authgoogles=$db->dataku("authgoogle", $user_session);
$code    = anti_injection($_POST['one_time_password']);	  
$result  = $authenticator->verifyCode($secret,$code,$tolerance);
if($googleauntentic == 1 && $authgoogles == 1 && !$result){
header("location: index.php?go=deposit&result=wrong_auth");
exit;
} else {	  	
	
	

$username = anti_injection($_POST['user']);	
$kode = anti_injection($_POST['kode']);	
$produk = anti_injection($_POST['produk']);
$upgrade = anti_injection($_POST['upgrade']);
$lastdepo = anti_injection($_POST['lastdepo']);

$amount = anti_injection($_POST['amount']);
if($produk == 1){
$biaya = $biaya1;
$biayax = $biayax1;
$myproduk = $jenis1;
$profite = $invest_profits1;
$priode = $inv_kontrak1;
$siklus = $invest_priod1;
$cashback = $cashbcke1;
}else if($produk == 2){
$biaya = $biaya2;
$biayax = $biayax2;
$myproduk = $jenis2;
$profite = $invest_profits2;
$priode = $inv_kontrak2;
$siklus = $invest_priod2;
$cashback = $cashbcke2;
}else if($produk == 3){
$biaya = $biaya3;
$biayax = $biayax3;
$myproduk = $jenis3;
$profite = $invest_profits3;
$priode = $inv_kontrak3;
$siklus = $invest_priod3;
$cashback = $cashbcke3;
}else if($produk == 4){
$biaya = $biaya4;
$biayax = $biayax4;
$myproduk = $jenis4;
$profite = $invest_profits4;
$priode = $inv_kontrak4;
$siklus = $invest_priod4;
$cashback = $cashbcke4;
}else if($produk == 5){
$biaya = $biaya5;
$biayax = $biayax5;
$myproduk = $jenis5;
$profite = $invest_profits5;
$priode = $inv_kontrak5;
$siklus = $invest_priod5;
$cashback = $cashbcke5;
}else if($produk == 6){
$biaya = $biaya6;
$biayax = $biayax6;
$myproduk = $jenis6;
$profite = $invest_profits6;
$priode = $inv_kontrak6;
$siklus = $invest_priod6;
$cashback = $cashbcke6;
}else if($produk == 7){
$biaya = $biaya7;
$biayax = $biayax7;
$myproduk = $jenis7;
$profite = $invest_profits7;
$priode = $inv_kontrak7;
$siklus = $invest_priod7;
$cashback = $cashbcke7;
}else if($produk == 8){
$biaya = $biaya8;
$biayax = $biayax8;
$myproduk = $jenis8;
$profite = $invest_profits8;
$priode = $inv_kontrak8;
$siklus = $invest_priod8;
$cashback = $cashbcke8;
}else if($produk == 9){
$biaya = $biaya9;
$biayax = $biayax9;
$myproduk = $jenis9;
$profite = $invest_profits9;
$priode = $inv_kontrak9;
$siklus = $invest_priod9;
$cashback = $cashbcke9;
}else if($produk == 10){
$biaya = $biaya10;
$biayax = $biayax10;
$myproduk = $jenis10;
$profite = $invest_profits10;
$priode = $inv_kontrak10;
$siklus = $invest_priod10;
$cashback = $cashbcke10;
}else{
}

if($amount < $biaya){
header("location: index.php?go=deposit&result=min&pk=".base64_encode($myproduk)."&mn=".base64_encode($biaya)."");
exit;
} else {
	
if($amount > $biayax){
header("location: index.php?go=deposit&result=max&pk=".base64_encode($myproduk)."&mx=".base64_encode($biayax)."");
exit;
} else {

$pincods = md5($_POST['pincode']);	
$sqlc = mysql_query("SELECT * FROM pincode WHERE username='$user_session'");
$numc = mysql_num_rows($sqlc);
while($rowc = mysql_fetch_array($sqlc)){
$tgl = formatgl($rowc['tgl']);
$pin = $rowc['pin'];
$sts = $rowc['status'];
$lock = $rowc['locks'];
	}
	if($usepins == 1 && !$numc) {
	header("location: index.php?go=deposit&result=no_pin");
	exit;
} else {
if($usepins == 1 && !$pincods || $usepins == 1 && $pincods <> $pin) {
	header("location: index.php?go=deposit&result=wrong_pin");
	exit;
} else {
if($usepins == 1 && $lock == 1) {
	header("location: index.php?go=deposit&result=pin_lock");
exit;
	} else {
if($usepins == 1 && $sts == 0) {
	header("location: index.php?go=deposit&result=pin_off");
	exit;
} else {	
	
	
	
$sql_sp9d2w = mysql_query("select * from dataewalet3 where username='".$username."' and status=0");
$ada_sp9d2w = mysql_num_rows($sql_sp9d2w);
if($ada_sp9d2w){
header("location: index.php?go=deposit&result=errors1");
	exit;
} else {	


$sql_sp9d2e = mysql_query("select * from deposit where username='".$username."' and status=1");
$ada_sp9d2e = mysql_num_rows($sql_sp9d2e);
if($ada_sp9d2e >= $maksinvest){
header("location: index.php?go=deposit&result=errors2");
	exit;
} else {	
	

$sql_sp9d2 = mysql_query("select * from dataewalet3 where kode='$kode' and username='".$username."'");
$ada_sp9d2 = mysql_num_rows($sql_sp9d2);
if($ada_sp9d2){
header("location: index.php?go=deposit&result=errors");
	exit;
} else {	



$jumlahdepone = rupiahx($amount);
$prodd="Add Investment ".$myproduk."";
$nama = $db->dataku("nama", $username);
$hp = $db->dataku("hp", $username);
$email = $db->dataku("email", $username);
$accid = $db->dataku("accid", $username);
	
$tkk = date('dmYHis', strtotime($clientdate));
$tokens = substr(str_shuffle(str_repeat("4453B141119A06676420371112GEHDLPD8717497783C6255363423ABCYWTGEHDLPMBTEFWXVU96411241472162223777", 64)), 0, 48);

$invc = "REG_".strtoupper($username)."_".$tkk."_".$stmpkodene."_".$tokens;
$inv = "http://".$domain."/invoice/".$invc.".pdf";
//$db->insert("invoice", "", "'', '$username', '$kode', '$invc', '$clientdate'");   



	  if($siklus == "day"){
		   $pdd = "Daily";
		   $pddx = "Day";
	   }else if($siklus == "week"){
		   $pdd = "Weekly";
		   $pddx = "Week";
	   }else if($siklus == "year"){
		   $pdd = "Yearly";
		   $pddx = "Year";
	   }else{
		   $pdd = "Monthly";
		   $pddx = "Month";
	   }
	
  $ttlprofite=($profite/100)*$amount;
  $ttlroine=$ttlprofite*$priode;
?>  

<script>
  function confirmActionne(){
   swal('Oops...', 'Your Wallet Balance is not enough to pay this package! please add fund balance!', 'error').done();
 
}
</script> 
<div class="row">
                <div class="col-md-4">
                
                   <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Add Investment</h3>
            </div>
            <div class="box-body">    

               

                <form id="tab2" name="add_depo" class="add_depo" method="post" action="">

<input type="hidden" id="user" name="user" value="<?php echo $username; ?>"/> 
<input type="hidden" id="kode" name="kode" value="<?php echo $kode; ?>"/> 
<input type="hidden" id="produk" name="produk" value="<?php echo $produk; ?>"/> 
<input type="hidden" id="upgrade" name="upgrade" value="<?php echo $upgrade; ?>"/> 
<input type="hidden" id="lastdepo" name="lastdepo" value="<?php echo $lastdepo; ?>"/> 
<input type="hidden" id="amount" name="amount" value="<?php echo $amount; ?>"/> 
	

         
          <div class="controls-row" style="margin-top:10px;">

            <label>Wallet Balance (<a href='index.php?go=walletcash&page=buybalance'>Add Balance</a>)</label>
            <?php 
			 
			 $saldoawallete = $db->mycwalet($user_session);
			 $pendingawallete = $db->mycwaletpending($user_session);
			 $totalawalete = $saldoawallete-$pendingawallete;
			 if($totalawalete >= $amount){
			 ?>
            <input type="text" value="<?php echo rupiah($totalawalete); ?>" style='background-color:#009F50; color:#FFF;' class="form-control"/>
            <?php }else{ ?>
            <input type="text" value="<?php echo rupiah($totalawalete); ?>" style='background-color:#DF0000; color:#FFF;' class="form-control"/>
            <?php } ?>
          </div>
         
         
         <div class="controls-row" style="margin-top:10px;">

            <label><?php echo $upgne; ?>Package / Amount</label>

           <input type="text" class="form-control" name=""  id="" disabled="readonly" value="<?php echo $myproduk; ?> - <?php echo rupiah($amount); ?>" <?php echo $backgrnde; ?>>

          </div>
         
           
            <div class="controls-row" style="margin-top:10px;">
           
           <label>Profits</label>
                   
           <input type="text" class="form-control" name=""  id="" disabled="readonly" value="<?php echo $profite; ?>% (<?php echo $pdd; ?>) <?php echo rupiah($ttlprofite); ?>" <?php echo $backgrnde; ?>>
           </div>
           <div class="controls-row" style="margin-top:10px;">
           
           <label>Contract / ROI</label>
                   
           <input type="text" class="form-control" name=""  id="" disabled="readonly" value="<?php echo $priode; ?> <?php echo $pddx; ?> (<?php echo rupiah($ttlroine); ?>)" <?php echo $backgrnde; ?>>
           </div>
          
           
         <div class="controls-row" style="margin-top:10px;">
        <div class='alert alert-dark alert-dismissable'><i class="fa fa-info-circle"></i>&nbsp;<strong>Notice:</strong><br>this will charge from your wallet balance amount <?php echo rupiah($amount); ?>
        </div> </div>  
           
 <div>

           &nbsp;

          </div>
          
          <div>
        <a href="index.php?go=deposit"><button type="button" class="btn btn-danger"><i class="fa fa-undo"></i>&nbsp;Back</button></a>
             <?php  if($totalawalete < $amount) {?>
             <button type="button" class="btn btn-<?php echo $buttone; ?>" name="sendnow" onclick='return confirmActionne()'>Invest Now</button>
            <?php } else { ?>
             <button type="submit" class="btn btn-<?php echo $buttone; ?>" name="sendnow">Invest Now</button>
         <?php } ?> 
          </div>

        </form>
        
        
                </div></div> </div>   
                 <div class="col-md-8">
                  <div class="box box-solid bg-dark">
            <div class="box-header with-border">
              <h3 class="box-title">History</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>Date</th> 
                        <th>Package</th> 
                        <th>Status</th>
                        <th>Invoice</th>
                        <th>Status</th>
                        <th>Details</th>
                </tr>
              </thead>
              <tbody>
      <?

	$db->select("id, username, jumlah, tgl, status, plan, cashback, getamount, kode, cycle", "dataewalet3", "username='$user_session'", "id desc");
	
		while($row=$db->fetch_row()) {
			
			
			if(is_odd($nom) == 0) {
				$class = "even";
			} else {
				$class = "odd";
			} 	
			
			$stats = $row[8];	
  
	$cccc=base64_encode($row[1]);
	
	if($row[9] == 1) {
				$st = "<span class='btn btn-danger btn-xs'>Canceled</span>";
				$stx = "";
	}else{
	if($row[4] > 0) {
				$st = "<span class='btn btn-success btn-xs'>Done</span>";
			} else {
				$st = "<span class='btn btn-danger btn-xs'>Pending</span>";
			}		
			}	
			
			$pkt_invs2 = "Package ".$row[5]."";
	
	
			

if($row[5] == "0000-00-00 00:00:00"){
$dtdepo = "----";
}else{
$dtdepo = formatgl($row[5]);
}

if($tox == "0000-00-00 00:00:00" || !$tox){
$dtexp = "----";
}else{
$dtexp = formatgl($tox);
}
	
	
	
		
?>				
                             
                    <tr> 
                            
                          <td><?php echo $row[3]; ?></td>
                            <td><?php echo $pkt_invs2; ?> - <?php echo rupiah($row[2]); ?></td>
                            <td><?php echo $st; ?></td>
                            <td><a href="index.php?go=payment_invest&sc=<?php echo $row[8]; ?>" class='btn btn-info btn-xs'>Invoice</a></td>  
                            <td>
                            <?php
							if($row[9] == 1) { ?>
				<span class='btn btn-danger btn-xs'>Canceled</span>
                <?php }else {
							$sql_ckdepones = mysql_query("select * from deposit where username='".$user_session."' and kode='".$row[8]."' and status='1'");
$ada_ckdepones = mysql_num_rows($sql_ckdepones);
if($ada_ckdepones>0){ ?>
                            <span class='btn btn-success btn-xs'>Active</span>
                            <?php } else {?>
                            <span class='btn btn-danger btn-xs'>Not Active</span>

<?php }} ?>
                            </td>
                             <td>
                            <?php
							$sql_ckdepone = mysql_query("select * from deposit where username='".$user_session."' and kode='".$row[8]."'");
$ada_ckdepone = mysql_num_rows($sql_ckdepone);
if($ada_ckdepone>0){ ?>
                            <a href="index.php?go=deposit&page=details&co=<?php echo $row[8]; ?>"><span class='btn btn-primary btn-xs'>Details</span></a>
                            <?php } else { echo "---"; } ?>
                            </td>
                            
                        </tr>
                        <?php } ?>
              </tbody>
            </table>
                        </div>
                    </div>
                </div>
                </div>
			</div>
			<!-- END PAGE CONTENT -->                       

            
             
             
             
             
        <?php 
}
}
}
}
}
}
}
}
}
}

 ?>     
             
             
             
             
             
             
             
             
             
               <?
} else if(isset($_POST['sendnow'])){
	

$username = anti_injection($_POST['user']);	
$kode = anti_injection($_POST['kode']);	
$produk = anti_injection($_POST['produk']);
$upgrade = anti_injection($_POST['upgrade']);
$lastdepo = anti_injection($_POST['lastdepo']);

$amount = anti_injection($_POST['amount']);
if($produk == 1){
$biaya = $biaya1;
$biayax = $biayax1;
$myproduk = $jenis1;
$profite = $invest_profits1;
$priode = $inv_kontrak1;
$siklus = $invest_priod1;
$cashback = $cashbcke1;
}else if($produk == 2){
$biaya = $biaya2;
$biayax = $biayax2;
$myproduk = $jenis2;
$profite = $invest_profits2;
$priode = $inv_kontrak2;
$siklus = $invest_priod2;
$cashback = $cashbcke2;
}else if($produk == 3){
$biaya = $biaya3;
$biayax = $biayax3;
$myproduk = $jenis3;
$profite = $invest_profits3;
$priode = $inv_kontrak3;
$siklus = $invest_priod3;
$cashback = $cashbcke3;
}else if($produk == 4){
$biaya = $biaya4;
$biayax = $biayax4;
$myproduk = $jenis4;
$profite = $invest_profits4;
$priode = $inv_kontrak4;
$siklus = $invest_priod4;
$cashback = $cashbcke4;
}else if($produk == 5){
$biaya = $biaya5;
$biayax = $biayax5;
$myproduk = $jenis5;
$profite = $invest_profits5;
$priode = $inv_kontrak5;
$siklus = $invest_priod5;
$cashback = $cashbcke5;
}else if($produk == 6){
$biaya = $biaya6;
$biayax = $biayax6;
$myproduk = $jenis6;
$profite = $invest_profits6;
$priode = $inv_kontrak6;
$siklus = $invest_priod6;
$cashback = $cashbcke6;
}else if($produk == 7){
$biaya = $biaya7;
$biayax = $biayax7;
$myproduk = $jenis7;
$profite = $invest_profits7;
$priode = $inv_kontrak7;
$siklus = $invest_priod7;
$cashback = $cashbcke7;
}else if($produk == 8){
$biaya = $biaya8;
$biayax = $biayax8;
$myproduk = $jenis8;
$profite = $invest_profits8;
$priode = $inv_kontrak8;
$siklus = $invest_priod8;
$cashback = $cashbcke8;
}else if($produk == 9){
$biaya = $biaya9;
$biayax = $biayax9;
$myproduk = $jenis9;
$profite = $invest_profits9;
$priode = $inv_kontrak9;
$siklus = $invest_priod9;
$cashback = $cashbcke9;
}else if($produk == 10){
$biaya = $biaya10;
$biayax = $biayax10;
$myproduk = $jenis10;
$profite = $invest_profits10;
$priode = $inv_kontrak10;
$siklus = $invest_priod10;
$cashback = $cashbcke10;
}else{
}
//$amount = $biaya;


 $saldoawallete = $db->mycwalet($user_session);
			 $pendingawallete = $db->mycwaletpending($user_session);
			 $totalawalete = $saldoawallete-$pendingawallete;


if($totalawalete < $amount){
header("location: index.php?go=deposit&result=err_balance&pk=".$myproduk."&min=".$amount."");
exit;
}else{

if($amount < $biaya){
header("location: index.php?go=deposit&result=min&pk=".base64_encode($myproduk)."&mn=".base64_encode($biaya)."");
exit;
} else {
	
if($amount > $biayax){
header("location: index.php?go=deposit&result=max&pk=".base64_encode($myproduk)."&mx=".base64_encode($biayax)."");
exit;
} else {

$sql_sp9d2w = mysql_query("select * from dataewalet3 where username='".$username."' and status=0");
$ada_sp9d2w = mysql_num_rows($sql_sp9d2w);
if($ada_sp9d2w){
header("location: index.php?go=deposit&result=errors1");
	exit;
} else {	

	$sql_sp9d2e = mysql_query("select * from deposit where username='".$username."' and status=1");
$ada_sp9d2e = mysql_num_rows($sql_sp9d2e);
if($ada_sp9d2e >= $maksinvest){
header("location: index.php?go=deposit&result=errors2");
	exit;
} else {	

$sql_sp9d2 = mysql_query("select * from dataewalet3 where kode='$kode' and username='".$username."'");
$ada_sp9d2 = mysql_num_rows($sql_sp9d2);
if($ada_sp9d2){
header("location: index.php?go=deposit&result=errors");
	exit;
} else {	

$angkaunike = substr(str_shuffle(str_repeat("1234567898765432123456987458236521458795463215874568998765432123456987458236512345678987", 48)), 12, 3);
 // $ttlprofite=($priode/100)*$amount;

  $ttlprofite=($profite/100)*$amount;
  $ttlroine=$ttlprofite*$priode;

$expired = date('Y-m-d H:i:s', strtotime("+".$batastransfere." hour"));	
$expireddepo = date('Y-m-d H:i:s', strtotime("+".$priode." ".$siklus.""));		
$db->insert("dataewalet3", "", "'', '$kode', '$username', '$amount', '$angkaunike', '$clientdate', '$expired', '0', '$produk', '$myproduk', '$profite', '', '$priode', '$siklus', '$priode', '$ttlroine', '$ttlroine', '$priode', '$kode'");


$cekadane = mysql_query("select kode from datacwalet where kode='$kode' and username='$user_session'");
$ada_adane = mysql_num_rows($cekadane); 
if(!$ada_adane) {
$db->insert("datacwalet", "", "'', '$kode', '$user_session', '$amount', 'Payment investment ".$myproduk." $kode', 'administrator', '$clientdate', 1, '$clientdate', '', ''"); }	
}


$db->update("dataewalet3", "status='1', exp='$clientdate'", "kode='$kode'");	
$db->update("reinv", "status='1'", "username='$username'");
$db->update("member", "harga='$produk', stage='$myproduk', act='1', tglaktif='$clientdate'", "username='$username'");

$expired = date('Y-m-d H:i:s', strtotime("+".$priode." ".$siklus.""));

$cekadadepo = mysql_query("select * from deposit where kode='$kode'");
$ada_deponec = mysql_num_rows($cekadadepo); 
if(!$ada_deponec) {	
			
$db->insert("deposit", "", "'', '$username', '$kode', '$amount', '1', '$clientdate', '$expired', '$produk', '$myproduk', '$profite', '$priode', '', '$siklus', '$ttlroine', '', '$ttlroine', '$priode', ''"); 


	$sponsore = $db->dataku("sponsor", $username);
$sponsore2 = $db->dataku("sponsor", $sponsore);
$sponsore3 = $db->dataku("sponsor", $sponsore2);
$sponsore4 = $db->dataku("sponsor", $sponsore3);
$sponsore5 = $db->dataku("sponsor", $sponsore4);

$kmspons = explode("|", $db->config("komisi_sponsor"));	
			
			$komsponx = ($kmspons[0]/100)*$amount;
			$komsponx2 = ($kmspons[1]/100)*$amount;
			$komsponx3 = ($kmspons[2]/100)*$amount;
			$komsponx4 = ($kmspons[3]/100)*$amount;
			$komsponx5 = ($kmspons[4]/100)*$amount;
			
			if($sponsore && $komsponx > 0) { 
			$cekadakome = mysql_query("select * from komisi where jenis='komsponsor' and username='$sponsore' and dari='$username' and kode='".$kode."sp'");
$ada_komex = mysql_num_rows($cekadakome); 
if(!$ada_komex) {	
				$db->insert("komisi", "", "'', '$sponsore', '$komsponx', '$clientdate', '0', '', 'komsponsor', '$username', '".$kode."sp', '', ''");
				
				$db->insert("datacwalet", "", "'', '".$kode."sp', 'administrator', '$komsponx', 'Refferal Bonus Level 1 From $username', '$sponsore', '$clientdate', 1, '$clientdate', '', ''");
		        $db->update("member", "free='0'", "username='$sponsore'");
			//	$db->update("komisi", "gett='1'", "username='$sponsore' and kode='".$kode."sp'");
				}}
				
			if($sponsore2 && $komsponx2 > 0) { 
			$cekadakome2 = mysql_query("select * from komisi where jenis='komsponsor2' and username='$sponsore2' and dari='$username' and kode='".$kode."sp2'");
$ada_komex2 = mysql_num_rows($cekadakome2); 
if(!$ada_komex2) {	
				$db->insert("komisi", "", "'', '$sponsore2', '$komsponx2', '$clientdate', '0', '', 'komsponsor2', '$username', '".$kode."sp2', '', ''");
				
				$db->insert("datacwalet", "", "'', '".$kode."sp2', 'administrator', '$komsponx2', 'Refferal Bonus Level 2 From $username', '$sponsore2', '$clientdate', 1, '$clientdate', '', ''");
		        $db->update("member", "free='0'", "username='$sponsore2'");
			//	$db->update("komisi", "gett='1'", "username='$sponsore' and kode='".$kode."sp'");
				}}	
				
				if($sponsore3 && $komsponx3 > 0) { 
			$cekadakome3 = mysql_query("select * from komisi where jenis='komsponsor3' and username='$sponsore3' and dari='$username' and kode='".$kode."sp3'");
$ada_komex3 = mysql_num_rows($cekadakome3); 
if(!$ada_komex3) {	
				$db->insert("komisi", "", "'', '$sponsore3', '$komsponx3', '$clientdate', '0', '', 'komsponsor3', '$username', '".$kode."sp3', '', ''");
				
				$db->insert("datacwalet", "", "'', '".$kode."sp3', 'administrator', '$komsponx3', 'Refferal Bonus Level 3 From $username', '$sponsore3', '$clientdate', 1, '$clientdate', '', ''");
		        $db->update("member", "free='0'", "username='$sponsore3'");
			//	$db->update("komisi", "gett='1'", "username='$sponsore' and kode='".$kode."sp'");
				}}	
				
				if($sponsore4 && $komsponx4 > 0) { 
			$cekadakome4 = mysql_query("select * from komisi where jenis='komsponsor4' and username='$sponsore4' and dari='$username' and kode='".$kode."sp4'");
$ada_komex4 = mysql_num_rows($cekadakome4); 
if(!$ada_komex4) {	
				$db->insert("komisi", "", "'', '$sponsore4', '$komsponx4', '$clientdate', '0', '', 'komsponsor4', '$username', '".$kode."sp4', '', ''");
				
				$db->insert("datacwalet", "", "'', '".$kode."sp4', 'administrator', '$komsponx4', 'Refferal Bonus Level 4 From $username', '$sponsore4', '$clientdate', 1, '$clientdate', '', ''");
		        $db->update("member", "free='0'", "username='$sponsore4'");
			//	$db->update("komisi", "gett='1'", "username='$sponsore' and kode='".$kode."sp'");
				}}	
				
				if($sponsore5 && $komsponx5 > 0) { 
			$cekadakome5 = mysql_query("select * from komisi where jenis='komsponsor5' and username='$sponsore5' and dari='$username' and kode='".$kode."sp5'");
$ada_komex5 = mysql_num_rows($cekadakome5); 
if(!$ada_komex5) {	
				$db->insert("komisi", "", "'', '$sponsore5', '$komsponx5', '$clientdate', '0', '', 'komsponsor5', '$username', '".$kode."sp5', '', ''");
				
				$db->insert("datacwalet", "", "'', '".$kode."sp5', 'administrator', '$komsponx5', 'Refferal Bonus Level 5 From $username', '$sponsore5', '$clientdate', 1, '$clientdate', '', ''");
		        $db->update("member", "free='0'", "username='$sponsore5'");
			//	$db->update("komisi", "gett='1'", "username='$sponsore' and kode='".$kode."sp'");
				}}




$db->insert("notifikasi", "", "'', '$username', 'Add Investment', '', '', 'Your add investment, package ".$myproduk.", amount ".rupiah($amount)."', '$clientdate', 'label label-sm label-icon label-info', 'fa fa-info', '0', '$kode'");

	
$jumlahdepone = rupiah($amount);
$jumlahdeponec = rupiahwa($amount);
$jumlahbayare = rupiah($amountpay);
$prodd="Add Investment ".$myproduk."";
$nama = $db->dataku("nama", $username);
$hp = $db->dataku("hp", $username);
$email = $db->dataku("email", $username);
$accid = $db->dataku("accid", $username);
	
$tkk = date('dmYHis', strtotime($clientdate));
$tokens = substr(str_shuffle(str_repeat("4453B141119A06676420371112GEHDLPD8717497783C6255363423ABCYWTGEHDLPMBTEFWXVU96411241472162223777", 64)), 0, 48);

$invc = "REG_".strtoupper($username)."_".$tkk."_".$stmpkodene."_".$tokens;
$inv = "http://".$domain."/invoice/".$invc.".pdf";
//$db->insert("invoice", "", "'', '$username', '$kode', '$invc', '$clientdate'");   

 $bank = $db->config("bank");if($bank){ $banke = $bank."<br>"; }
 $bank1 = $db->config("bank1");if($bank1){ $banke1 = $bank1."<br>"; }
 $bank2 = $db->config("bank2");if($bank2){ $banke2 = $bank2."<br>"; }
 $bank3 = $db->config("bank3");if($bank3){ $banke3 = $bank3."<br>"; }
 $bank4 = $db->config("bank4");if($bank4){ $banke4 = $bank4."<br>"; }
 $bank5 = $db->config("bank5");if($bank5){ $banke5 = $bank5."<br>"; }
 $bank6 = $db->config("bank6");if($bank6){ $banke6 = $bank6.""; }
 
 if($bank){ $bankex = $bank.", "; }
 if($bank1){ $bankex1 = $bank1.", "; }
 if($bank2){ $bankex2 = $bank2.", "; }
 if($bank3){ $bankex3 = $bank3.", "; }
 if($bank4){ $bankex4 = $bank4.", "; }
 if($bank5){ $bankex5 = $bank5.", "; }
 if($bank6){ $bankex6 = $bank6.""; }
 
 $bankadmins=$banke."".$banke1."".$banke2."".$banke3."".$banke4."".$banke5."".$banke6;
 $bankadminsx=$bankex."".$bankex1."".$bankex2."".$bankex3."".$bankex4."".$bankex5."".$bankex6;


$isimail="<a href='http://".$domain."'><img src='".$logoinvoice."' style='display:inline;outline-style:none;text-decoration:none;' /></a><br><br><br>
<p>Hello ".$nama." (".$username."),</p>
<p>Your Add Investment.</p>
<p><strong>No: ".$kode."<br>
Package: ".$myproduk."<br>
Amount: ".$jumlahdepone."<br>
Date: ".$tgl."<br>
</p>

<p><br><br><br>
Regards,<br>
<b>".$bisnisname."</b><br>
".$domain."<br>".$emailadmin."<br>".$hpadmin."</p>";
	   
	    $mail3 = new PHPMailer;
		if($smaile == 1){	
$mail3->IsSMTP(); // telling the class to use SMTP
$mail3->Host       = $smtphost; // SMTP server
$mail3->SMTPAuth   = true;                  // enable SMTP authentication
$mail3->Host       = $smtphost; // sets the SMTP server
$mail3->Port       = $smtport;                    // set the SMTP port for the GMAIL server
$mail3->Username   = $smtpuser; // SMTP account username
$mail3->Password   = $smtpass;        // SMTP account password
}
        $mail3->setFrom($emailadmin, $bisnisname);
        $mail3->addAddress($email, $nama);
	    $mail3->IsHTML(true);       
        $mail3->Subject = ''.$nama.', Your Add Investment';
        $mail3->msgHTML($isimail);
	  //  $mail3->AddAttachment("../invoice/".$invc.".pdf");      // attachment
        $mail3->send();	



if($hp){
$isipesan = "Hello ".$nama.", your add investment, Package ".$myproduk.", No: ".$kode.", Amount: ".$jumlahdeponec.". please login and make payment";
	mysql_query("insert into outbox values('', '', '$username', '$hp', '$isipesan', '$clientdate', '1')") or die(mysql_error());
	if($smsgtw == 1 && $jsms == 1){
	$hpne = preg_replace('/\D+/', '', $hp);
	$sms = new smsreguler();
	$sms->username = $userkey;
		$sms->password = $passkey;
		$sms->apikey   = $apikey;
		$sms->setTo($hpne);
		$sms->setText($isipesan);
		$sms->smssend();
	}else if($smsgtw == 1 && $jsms == 2){
	$hpne = preg_replace('/\D+/', '', $hp);
	$sms = new smsmasking();
	$sms->username = $userkey;
		$sms->password = $passkey;
		$sms->apikey   = $apikey;
		$sms->setTo($hpne);
		$sms->setText($isipesan);
		$sms->smssend();
	}else if($smsgtw == 2){
	sendsms($hp, $isipesan) ;
	}else{}
sendwa($hp, $isipesan, $apikeywoowa);	

}

	header("location: index.php?go=payment_invest&sc=$kode");
	exit;
}
}
}
}
}
}

?>



<?php
}else{


?>







<div class="row">
                <div class="col-md-12">


<?php
 if(isset($_GET['result'])&&$_GET['result']=="success"){
if(isset($_GET["co"])){ $co = $_GET["co"]; }
echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Add Investment ".$_GET["pk"]." (".$co.") successfully created.</div>";
}
?>

<?php
 if(isset($_GET['result'])&&$_GET['result']=="no_pin"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_NO_PIN."</div>";
}
?>  
 <?php
 if(isset($_GET['result'])&&$_GET['result']=="wrong_pin"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_WRONG_PIN."</div>";
}
?>  
 <?php
 if(isset($_GET['result'])&&$_GET['result']=="pin_lock"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_BLOCK_PIN."</div>";
}
?>  

 <?php
 if(isset($_GET['result'])&&$_GET['result']=="pin_off"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_OFF_PIN."</div>";
}
?>
<?php
 if(isset($_GET['result'])&&$_GET['result']=="amount"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Amount Investment must be filled!</div>";
}
?>
<?php
 if(isset($_GET['result'])&&$_GET['result']=="errors"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>This transaction already submit before!</div>";
}
?>
<?php
 if(isset($_GET['result'])&&$_GET['result']=="no_pass"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Your membership is not valid, please contact administrator.</div>";
}
?>  
 <?php
 if(isset($_GET['result'])&&$_GET['result']=="wrong_pass"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Wrong password</div>";
}
?>


<?php
 if(isset($_GET['result'])&&$_GET['result']=="errors1"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>You have add investment and not yet processed! Wait for buy package previously processed to be able to buy package again.</div>";
}
?>
		<?php
if(isset($_GET['result'])&&$_GET['result']=="wrong_captcha"){
echo "<div class='alert alert-danger'>Wrong Captcha!</div>";
}
?>	

  <?php
$results = $_GET['result'];
if($results == "error") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".$LANG["tctnotfnd"]."</div>";
}
?>

         <?php
$results = $_GET['result'];
if($results == "wrong_auth") { 
echo "<div class='alert alert-danger'>You're enable two factor authentication at your account, Please enter your google authenticator six-digit code!</div>";
}
?>       
   <?php
if(isset($_GET['result'])&&$_GET['result']=="min"){
$pck = base64_decode($_GET['pk']);
$min = base64_decode($_GET['mn']);	
	
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>You choose package ".$pck.", Minimal investment for this package is ".rupiah($min).".</div>";
}
?>
<?php
if(isset($_GET['result'])&&$_GET['result']=="max"){
$pck = base64_decode($_GET['pk']);
$max = base64_decode($_GET['mx']);
	
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>You choose package ".$pck.", Max Investment for this package is ".rupiah($max).".</div>";
}
?>

<?php      
$initiale = substr(str_shuffle(str_repeat("ABCEFGHIJKLMNPRSTUVWXYZ", 36)), 6, 2);
$stkode = strtotime(date("Y-m-d H:i:s"));
$kodec = $initiale."".$stkode;
$initialex = substr(str_shuffle(str_repeat("ABEF123456789GHIJKLMNPR123456789KLEFGHILMNP123456789RRSTUVWXYZ", 46)), 22, 12);




?>
              
               
<script type="text/javascript">
 
        function isNumberKey(evt, obj) {
 
            var charCode = (evt.which) ? evt.which : event.keyCode
            var value = obj.value;
            var dotcontains = value.indexOf(".") != -1;
            if (dotcontains)
                if (charCode == 46) return false;
            if (charCode == 46) return true;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }
 
    </script>         
       




<div class="row no-gutters">




<?php 

//$ownplan=$db->datadeposit("plan", $user_session);
//if($ownplan){
//	$ownplane=$ownplan;
//	$upgradese="1";
//	$buttonsubmit="UPGRADE NOW";
//	$lastdepo=$db->datadeposit("jml", $user_session);
//}else{
//	$ownplane="0";
//	$upgradese="0";

//	$buttonsubmit="BUY NOW";
//	$lastdepo="";
//}

for($i=0;$i<$batas_paket;$i++) {	
 $ic = $i;
	 $icc = $i+1;
	 $produke = $lead[$ic];
	 $byay = $by[$ic];
	 $byayx = $byx[$ic];
	 $byaya = rupiahx($by[$ic]);
	 $byayax = rupiahx($byx[$ic]);
	 $proffte = $invest_pf[$ic];
	 $sharepro = $inv_kont[$ic];
	 $priddee = $priod_pf[$ic];
	 
//if($icc > $ownplane){	   
	   if($priddee == "day"){
		   $pdd = "Daily";
		   $pddx = "Day";
	   }else if($priddee == "week"){
		   $pdd = "Weekly";
		   $pddx = "Week";
	   }else if($priddee == "year"){
		   $pdd = "Yearly";
		   $pddx = "Year";
	   }else{
		   $pdd = "Monthly";
		   $pddx = "Month";
	   }
?>

    
    
    
      <div class="col-lg-3">
					<div class="box p-30">
					  <h3 class="text-info" align="center" style="font-weight:bold;"><?php echo $produke;?></h3>
                     
					  <br>
					  <p>
                      <ul>
                      <li>Min. Amount <?php echo $byaya;?></li>
                      <li>Max. Amount <?php echo $byayax;?></li>
                      <li>Profit <?php echo $proffte;?>% (<?php echo $pdd;?>)</li>
                      <li>Contract <?php echo $sharepro;?> <?php echo $pddx;?></li>
                      </ul>
                      </p>
					  <br>
					 
            <form id="tab2" name="add_depo" class="add_depo" method="post" action="">

<input type="hidden" id="kode" name="kode" value="<?php echo $initialex; ?>"/>
<input type="hidden" id="user" name="user" value="<?php echo $user_session; ?>"/> 
<input type="hidden" id="produk" name="produk" value="<?php echo $icc; ?>"/> 
<input type="hidden" id="upgrade" name="upgrade" value="<?php echo $upgradese; ?>"/> 
<input type="hidden" id="lastdepo" name="lastdepo" value="<?php echo $lastdepo; ?>"/> 
        
       
           
		  <div class="controls-row" style="margin-top:10px;">
           
           <div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><?php echo $currencye; ?>
</span>
           <input type="number" class="form-control" placeholder="Amount" id="amount" name="amount"  onkeypress="return isNumberKey(event,this)" required='required'>
           </div></div> 
		   
		   <?php if($usepins == 1){ ?>
          <div class="controls-row" style="margin-top:10px;">

           
<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-key" aria-hidden="true"></i>
</span>
           <input type="password" class="form-control" placeholder="Enter Secure PIN" name="pincode" required='required'>
                                                          

          </div>  </div>
          <?php } ?>
          <?php if($db->dataku("authgoogle", $user_session) == 1){ ?>

            <div class="controls-row" style="margin-top:10px;">

            
<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-qrcode fa-lg"></i>
</span>
           <input type="text" class="form-control" placeholder="Enter Google 2FA" name="one_time_password">
                                                          
  </div>  </div>
          <?php } ?>

					  <br>
					  
                    <button type="submit" class="btn btn-bold btn-block btn-round btn-<?php echo $buttone; ?>" name="submitcheck">Invest Now</button>  
                      
                
                  </form>      
                      
                      
					</div>
				  </div>
    
    
    
                  
                  
                  <?php } ?>

				


				</div>



				</div>
				</div>


 
<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">History</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>Date</th> 
                        <th>Package</th> 
                        <th>Status</th>
                        <th>Invoice</th>
                        <th>Status</th>
                        <th>Details</th>
                </tr>
              </thead>
              <tbody>
      <?

	$db->select("id, username, jumlah, tgl, status, plan, cashback, getamount, kode, cycle", "dataewalet3", "username='$user_session'", "id desc");
	
		while($row=$db->fetch_row()) {
			
			
			if(is_odd($nom) == 0) {
				$class = "even";
			} else {
				$class = "odd";
			} 	
			
			$stats = $row[8];	
  
	$cccc=base64_encode($row[1]);
	
	if($row[9] == 1) {
				$st = "<span class='btn btn-danger btn-xs'>Canceled</span>";
				$stx = "";
	}else{
	if($row[4] > 0) {
				$st = "<span class='btn btn-success btn-xs'>Done</span>";
			} else {
				$st = "<span class='btn btn-danger btn-xs'>Pending</span>";
			}		
			}
			$pkt_invs2 = "Package ".$row[5]."";
	
	
			

if($row[5] == "0000-00-00 00:00:00"){
$dtdepo = "----";
}else{
$dtdepo = formatgl($row[5]);
}

if($tox == "0000-00-00 00:00:00" || !$tox){
$dtexp = "----";
}else{
$dtexp = formatgl($tox);
}
	
	
	
		
?>				
                             
                    <tr> 
                            
                          <td><?php echo $row[3]; ?></td>
                            <td><?php echo $pkt_invs2; ?> - <?php echo rupiah($row[2]); ?></td>
                            <td><?php echo $st; ?></td>
                            <td><a href="index.php?go=payment_invest&sc=<?php echo $row[8]; ?>" class='btn btn-info btn-xs'>Invoice</a></td>  
                            <td>
                             <?php
							if($row[9] == 1) { ?>
				<span class='btn btn-danger btn-xs'>Canceled</span>
                <?php }else {
							$sql_ckdepones = mysql_query("select * from deposit where username='".$user_session."' and kode='".$row[8]."' and status='1'");
$ada_ckdepones = mysql_num_rows($sql_ckdepones);
if($ada_ckdepones>0){ ?>
                            <span class='btn btn-success btn-xs'>Active</span>
                            <?php } else {?>
                            <span class='btn btn-danger btn-xs'>Not Active</span>

<?php }} ?>
                            </td>
                             <td>
                            <?php
							$sql_ckdepone = mysql_query("select * from deposit where username='".$user_session."' and kode='".$row[8]."'");
$ada_ckdepone = mysql_num_rows($sql_ckdepone);
if($ada_ckdepone>0){ ?>
                            <a href="index.php?go=deposit&page=details&co=<?php echo $row[8]; ?>"><span class='btn btn-primary btn-xs'>Details</span></a>
                            <?php } else { echo "---"; } ?>
                            </td>
                            
                        </tr>
                        <?php } ?>
              </tbody>
            </table>
                        </div>
                    </div>
                </div>
                </div>
			</div>
			<!-- END PAGE CONTENT -->                 
                     
<?php } ?><?php } ?><?php } ?>
</section>