<?php
ob_start();
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>
        Confirmation
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="breadcrumb-item active">Confirmation</li>
      </ol>
    </section>
    
    <section class="content">
<?php // Your license key 
$server = $_SERVER['SERVER_NAME'];

$c = curl_init(); 
// Set the full url path to point to your verifyLicense.php on your server 
curl_setopt($c, CURLOPT_URL, "http://www.primadesain.com/verifydomains.php"); 
curl_setopt($c, CURLOPT_TIMEOUT, 30); 
curl_setopt($c, CURLOPT_POST, 1); 
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 

$postfields = 'svr='.$server; 
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(); }
?>

<?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'] == "go") {


$_SESSION["amount"] = anti_injection($_POST["amount"]);
$_SESSION["hash"] = anti_injection($_POST["hash"]);
$_SESSION["tujuan"] = anti_injection($_POST["tujuan"]);
$_SESSION["info"] = anti_injection($_POST["info"]);


$invoice = anti_injectionx($_POST['invoice']);	
$jn = anti_injectionx($_POST['jenis']);
$jm = anti_injectionx($_POST['amount']);

$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=confirmpayment&result=no_pin&sc=$invoice&jn=$jn&jm=$jm");
	exit;
} else {
if($usepins == 1 && !$pincods || $usepins == 1 && $pincods <> $pin) {
	header("location: index.php?go=confirmpayment&result=wrong_pin&sc=$invoice&jn=$jn&jm=$jm");
	exit;
} else {
if($usepins == 1 && $lock == 1) {
	header("location: index.php?go=confirmpayment&result=pin_lock&sc=$invoice&jn=$jn&jm=$jm");
exit;
	} else {
if($usepins == 1 && $sts == 0) {
	header("location: index.php?go=confirmpayment&result=pin_off&sc=$invoice&jn=$jn&jm=$jm");
	exit;
} else {	

$img = $_FILES['img1'];
	$allowed =  array('pdf','png','jpg','jpeg','PNG','gif','JPG');//allowed types
$filename = $_FILES['img1']['name'];//file name
$ext = pathinfo($filename, PATHINFO_EXTENSION);//extension checking
if(!empty($_FILES['img1']['name']) && !in_array($ext,$allowed) ){
	header("location: index.php?go=confirmpayment&result=file_error&sc=$invoice&jn=$jn&jm=$jm");
	exit;
}else{	
	$type = substr($img['name'], strrpos($img['name'], '.') + 1);
	if(!empty($_FILES['img1']['name']) && $img['size'] > 4000000) {
		header("location: index.php?go=confirmpayment&result=size_error&sc=$invoice&jn=$jn&jm=$jm");
	exit;
	} else {
		$time = date("Ymd_His");
        $sess = md5(substr(str_shuffle(str_repeat("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz", 64)), 0, 48));
		$namex = substr($img['name'], 0, strrpos($img['name'], '.'));	
		$special = "confirm";
		$new_file_name = str_replace($namex,'',$special);
		$name  = $new_file_name.'_'.$user_session.'_'.$time.'_'.$sess;
		$thumbName		= $name.'.'.$type;
        if($type == "gif"){
			$imgObj = imagecreatefromgif($img['tmp_name']);
		} else if($type == "png"){
			$imgObj = imagecreatefrompng($img['tmp_name']);
		} else if($type == "jpeg"){
			$imgObj = imagecreatefromjpeg($img['tmp_name']);
		} else if($type == "JPG"){
			$imgObj = imagecreatefromjpeg($img['tmp_name']);
		} else if($type == "PNG"){
			$imgObj = imagecreatefrompng($img['tmp_name']);
		} else {
			$imgObj = imagecreatefromjpeg($img['tmp_name']);
		}
		$width = imageSX($imgObj);
		$height = imageSY($imgObj);
		if(!empty($_FILES['img1']['name']) && !$width || !empty($_FILES['img1']['name']) && !$height) {
		header("location: index.php?go=confirmpayment&result=file_errors&sc=$invoice&jn=$jn&jm=$jm");
	    exit;
		}else{
		if($width > 1000) {
		 	$height = $height * (1000 / $width);
		 	$width = 1000;	
		}
		$thumbWidth = $width;
		$thumbHeight = $height;
		$newThumb = imagecreatetruecolor($thumbWidth, $thumbHeight);
		imagecopyresampled($newThumb, $imgObj, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imageSX($imgObj), imageSY($imgObj));
		if($type == "gif") {
			imagegif($newThumb, '../images/confirm/'.$thumbName);
		} else if($type == "png") {
			imagejpeg($newThumb, '../images/confirm/'.$thumbName);
		} else {
			imagejpeg($newThumb, '../images/confirm/'.$thumbName);
		}  
		imagedestroy($imgObj);
		imagedestroy($newThumb);

$username = anti_injection($_POST['user']);	
$kode = anti_injection($_POST['kode']);	
$hash = anti_injection($_POST['hash']);	
$amount = anti_injection($_POST['amount']);	
//$tujuan = anti_injection($_POST['rekeningtujuan']);	
$info = anti_injection($_POST['info']);	
$rekeningtujuan = anti_injection($_POST['rekeningtujuan']);	

if($jn == 1){
	$cekdatanya="dataewalet3";
	$typne="Add Investment";
	$typnce="kode";
}else if($jn == 2){
	$cekdatanya="ticket_order";
	$typne="Buy Ticket";
	$typnce="coed";
}else if($jn == 3){
	$cekdatanya="datacwalet2";
	$typne="Add Balance";
	$typnce="kode";
}else if($jn == 4){
	$cekdatanya="upgrade";
	$typne="Register";
	$typnce="kode";
}else if($jn == 5){
	$cekdatanya="dataawalet2";
	$typne="Buy USD Point Wallet Balance";
	$typnce="kode";
}else if($jn == 6){
	$cekdatanya="databwalet2";
	$typne="Buy ".$coiname." Wallet Balance";
	$typnce="kode";

}else{
	$cekdatanya="";
	$typne="";
	$typnce="";
} 
	
$sql_sp5 = mysql_query("select * from $cekdatanya where username='".$username."' and ".$typnce."='".$invoice."'");
$ada_sp5 = mysql_num_rows($sql_sp5);
if(!$ada_sp5){
header("location: index.php?go=confirmpayment&result=errinvoice&sc=$invoice&jn=$jn&jm=$jm");
		exit;
} else {
	
	
$sql_sp6 = mysql_query("select username from konfirmasipayment where username='".$username."' and invoice='".$invoice."'");
$ada_sp6 = mysql_num_rows($sql_sp6);
if($ada_sp6 > 0){
header("location: index.php?go=confirmpayment&result=errors&sc=$invoice&jn=$jn&jm=$jm");
		exit;
} else {	

$sql_sp3 = mysql_query("select username from konfirmasipayment where username='".$username."' and kode='".$kode."'");
$ada_sp3 = mysql_num_rows($sql_sp3);
if($ada_sp3){
header("location: index.php?go=confirmpayment&result=err&sc=$invoice&jn=$jn&jm=$jm");
		exit;
} else {
	
		$namaku = $db->dataku("nama", $username);
		$emailku = $db->dataku("email", $username);
		$hp = $db->dataku("hp", $username);
		$tgl = formatgl($clientdate);


$db->insert("konfirmasipayment", "", "'', '$kode', '$jn', '$namaku', '$username', '$emailku', '$amount', '$rekeningtujuan', '$clientdate', '$info', '".$_SERVER['REMOTE_ADDR']."', '$hp', '$invoice', '$thumbName'");	
		
unset($_SESSION['amount']);
unset($_SESSION['hash']);
		unset($_SESSION['tujuan']);
		unset($_SESSION['info']);

	
$isimail="<a href='http://".$domain."'><img src='".$logoinvoice."' style='display:inline;outline-style:none;text-decoration:none;' /></a><br><br><br>
<p>Helo ".$namaku." (".$username."),</p>
<p>You have sent confirmation.</p>
<p>No Trx: ".$kode."<br>
Invoice: ".$invoice."<br>
Type: ".$typne."<br>
Amount: ".rupiah($amount)."<br>
Transfer To: ".$rekeningtujuan."<br>
Info: ".$info."<br>
Date: ".$tgl."<br>
</p>
<p>Thank you, we will process your confirmation as soon as possible.</p>

<p><br><br><br>
Regards,<br>
<b>".$bisnisname."</b><br>
".$domain."<br>".$emailadmin."<br>".$hpadmin."</p>";
	   
	    $mail3 = new PHPMailer;
		//$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($emailku, $namaku);
	    $mail3->IsHTML(true);       
        $mail3->Subject = ''.$namaku.', Payment Confirmation';
        $mail3->msgHTML($isimail);
	    $mail3->AddAttachment("../images/confirm/".$thumbName."");      // attachment
        $mail3->send();	
		
		
		
	$isimail2="<a href='http://".$domain."'><img src='".$logoinvoice."' style='display:inline;outline-style:none;text-decoration:none;' /></a><br><br><br>
<p>Helo ".$bisnisname.",</p>
<p>Member have sent confirmation.</p>
<p>No Trx: ".$kode."<br>
Invoice: ".$invoice."<br>
Type: ".$typne."<br>
Amount: ".rupiah($amount)."<br>
Transfer To: ".$rekeningtujuan."<br>
Info: ".$info."<br>
Date: ".$tgl."<br>
</p>
<p>Member Details:<br>
Name: ".$namaku."<br>
Username: ".$username."<br>
Email: ".$emailku."<br>
Phone: ".$hp."<br>
</p>

<p><br><br><br>
Regards,<br>
<b>".$bisnisname."</b><br>
".$domain."<br>".$emailadmin."<br>".$hpadmin."</p>";
	   
	    $mail3b = new PHPMailer;
		//$mail3->IsSMTP(); // telling the class to use SMTP
        $mail3b->Host       = $smtphost; // SMTP server
        $mail3b->SMTPAuth   = true;                  // enable SMTP authentication
        $mail3b->Host       = $smtphost; // sets the SMTP server
        $mail3b->Port       = $smtport;                    // set the SMTP port for the GMAIL server
        $mail3b->Username   = $smtpuser; // SMTP account username
        $mail3b->Password   = $smtpass;        // SMTP account password
        $mail3b->setFrom($emailadmin, $bisnisname);
        $mail3b->addAddress($emailadmin, $bisnisname);
	    $mail3b->IsHTML(true);       
        $mail3b->Subject = ''.$bisnisname.', Payment Confirmation';
        $mail3b->msgHTML($isimail2);
	    $mail3b->AddAttachment("../images/confirm/".$thumbName."");      // attachment
        $mail3b->send();		
		

        header("location: index.php?go=confirmpayment&result=success&co=".$kode."&sc=$invoice&jn=$jn&jm=$jm");
	exit;
}
}
}
}
}
}
}
}
}
}
 }else{

if(isset($_GET["sc"])){ $sc = $_GET["sc"]; }	 
if(isset($_GET["jn"])){ $jn = $_GET["jn"]; }  
if(isset($_GET["jm"])){ $jm = $_GET["jm"]; } 
if(isset($_GET["cr"])){ $cr = $_GET["cr"]; } 
?>
   <div class="row">
                <div class="col-md-4">
                
                   <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Confirmation</h3>
            </div>
            <div class="box-body">    

       <?php
 if(isset($_GET['result'])&&$_GET['result']=="size_error"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Upload only 3MB file size!</div>";
}
?>              
  <?php
 if(isset($_GET['result'])&&$_GET['result']=="file_error"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Upload only jpg, png, gif file!</div>";
}
?>  
<?php
 if(isset($_GET['result'])&&$_GET['result']=="file_errors"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>File not allowed! Upload only jpg, png, gif file!</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>Maximum send confirmation is only 1 for 1 invoice. Confirmation for this invoice (".$_GET['sc'].") has been sent before</div>";
}
?>
 <?php
 if(isset($_GET['result'])&&$_GET['result']=="err"){
$mx = $_GET['mx'];
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>This confirmation has been sent before.</div>";
}
?>
<?php
 if(isset($_GET['result'])&&$_GET['result']=="errinvoice"){
$mx = $_GET['mx'];
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Invoice not found, make sure your confirmation type selection is correct.</div>";
}
?>
<?php
 if(isset($_GET['result'])&&$_GET['result']=="success"){
echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Confirmation for invoive ".$_GET['sc']." was sent successfully, (No ".$_GET['co']."), please wait we will process your confirmation as soon as possible.</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']=="wrong_captcha"){
echo "<div class='alert alert-danger'>Wrong Captcha!</div>";
}
?>	           
                 
                  
                                	
      <?php    
$initialex = substr(str_shuffle(str_repeat("ABEF123456789GHIJKLMNPR123456789KLEFGHILMNP123456789RRSTUVWXYZ", 46)), 22, 12);

	
?>  
<?php 
   $sql_spxx = mysql_query("select * from konfirmasipayment where invoice='".$sc."'");
$ada_spxx = mysql_num_rows($sql_spxx);
if($ada_spxx && !$_GET['result']){
echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Confirmation for invoive ".$sc." has been sent before, please wait we will process your confirmation as soon as possible.</div>";
} else {
   ?>         
<script language="JavaScript">
	<!--
	function roundNumber(number,decimals) {
	var newString;// The new rounded number
	decimals = Number(decimals);
	if (decimals < 1) {
		newString = (Math.round(number)).toString();
	} else {
		var numString = number.toString();
		if (numString.lastIndexOf(".") == -1) {
			numString += ".";
		}
		var cutoff = numString.lastIndexOf(".") + decimals;
		var d1 = Number(numString.substring(cutoff,cutoff+1));
		var d2 = Number(numString.substring(cutoff+1,cutoff+2));
		if (d2 >= 5) {
			if (d1 == 9 && cutoff > 0) {
				while (cutoff > 0 && (d1 == 9 || isNaN(d1))) {
					if (d1 != ".") {
						cutoff -= 1;
						d1 = Number(numString.substring(cutoff,cutoff+1));
					} else {
						cutoff -= 1;
					}
				}
			}
			d1 += 1;
		} 
		newString = numString.substring(0,cutoff) + d1.toString();
	}
	if (newString.lastIndexOf(".") == -1) {
		newString += ".";
	}
	var decs = (newString.substring(newString.lastIndexOf(".")+1)).length;
	for(var i=0;i<decimals-decs;i++) newString += "0";
	var newNumber = Number(newString);
	return newNumber;
}

function format_num(num){
		
		var res = "";
		num = num.toString();
		counter = 0;
		var c = num.indexOf('.');
		var end = num.length-1;
		if(c>-1) {
			res = ","+num.substring(c+1,c+3);
			end = c-1;
			if(res.length==2) res = res + "0";
		}
		
		
		for(var i=end;i>=0;i--){
			res = num.substring(i,i+1) + res;
			counter ++;
			if(counter%3 == 0 && i > 0)
				res = "." + res;
		}
		return res;
	}


function numbersonly(e){
		var unicode=e.charCode? e.charCode : e.keyCode
		
		if (unicode!=8 && unicode!=46){ //if the key isn't the backspace key (which we should allow)
			if (unicode<48||unicode>57) {
				var temp = document.getElementById('amount').value;
				var totalfound = 0;
				var titik = temp.indexOf('.');
				if(titik>-1){
					totalfound=1;
					var temp2 = temp.substring(temp.indexOf('.')+1,temp.length);
					if(temp2.indexOf('.')>-1) totalfound=2;
				}
				if(unicode!=46 && unicode!=37 && unicode!=39) return false; //disable key press
				if(unicode==46 && totalfound>0) return false;
			}
		}
	}

	function cekQ(){
		var temp = document.getElementById('amount').value;
		var totalfound = 0;
		var titik = temp.indexOf('.');
		if(titik>-1){
			totalfound=1;
			var temp2 = temp.substring(temp.indexOf('.')+1,temp.length);
			if(temp2.indexOf('.')>-1) totalfound=2;
		}
if(totalfound>1) temp = temp.substring(0,temp.length-1);
else if(totalfound==1 && titik==temp.length-1) temp = document.getElementById('amount').value;
		//if(totalfound>1) temp = parseFloat(document.getElementById('quant').value);
		//else if(totalfound==0) temp = parseFloat(document.getElementById('quant').value);
		//else if(totalfound==1 && titik==temp.length-1) temp = document.getElementById('quant').value;
		//else temp = parseFloat(document.getElementById('quant').value);
		//var q = parseFloat(document.getElementById('quant').value);
		var q = parseFloat(temp);
		
		var p = document.getElementById('price').value;
		if(isNaN(q)) {q = 0;temp=0;}
		if(q<0) {q = 0;temp=0;}
		document.getElementById('amount').value = temp;
		document.getElementById('total').value = format_num(roundNumber(q*p,2));
	}

	
	//-->
	</script>
         
                <form id="tab2" name="wallet_depo" method="post" action="?go=confirmpayment&page=go" enctype="multipart/form-data" onsubmit="return Validate(this);">
<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="jn" name="jn" value="<?php echo $jn; ?>"/>
<input type="hidden" id="jm" name="jm" value="<?php echo $jm; ?>"/>
<input type="hidden" id="jenis" name="jenis" value="<?php echo $jn; ?>"/>
<input type="hidden" id="invoice" name="invoice" value="<?php echo $sc; ?>"/>
<input type="hidden" id="amount" name="amount" value="<?php echo $jm; ?>"/>
                 

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

            <label>Amount</label>
            <input name="" id="" type="text" class="form-control" value="<?php echo rupiah($jm); ?>" disabled="disabled"/>

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

            <label>Payment To</label>
            <select name="rekeningtujuan" id="rekeningtujuan" class="form-control" required='required' >
          
            
            <option value=""> [ Select Payment ] </option>
         <?
		
		  if($db->config("usdtpay") == 1){
		echo " <option value='USDT Wallet Address: ".$db->config("usdtaddress")."'>USDT Wallet Address: ".$db->config("usdtaddress")."</option>";}
		
		  if($db->config("btcne") == 1){
		echo " <option value='BTC Wallet Address:".$db->config("bitcoin_address")."'>BTC Wallet Address:".$db->config("bitcoin_address")."</option>";}
		  if($db->config("rekbank") == 1){
	  if($bank6) { echo " <option value='".$bank6."'>".$bank6."</option>";}
	  if($bank7) { echo " <option value='".$bank7."'>".$bank7."</option>";}
		  }
	  if($db->config("paysgd") == 1){
	  if($bank) { echo " <option value='".$bank."'>".$bank."</option>";}
	  if($bank1) { echo " <option value='".$bank1."'>".$bank1."</option>";}
	  }
	  
	  if($db->config("paymyr") == 1){
	  
	  if($bank2) { echo " <option value='".$bank2."'>".$bank2."</option>";}
	  if($bank3) { echo " <option value='".$bank3."'>".$bank3."</option>";}
		 }
	  
	  if($db->config("paybnd") == 1){
	  
	  if($bank4) { echo " <option value='".$bank4."'>".$bank4."</option>";}
	  if($bank5) { echo " <option value='".$bank5."'>".$bank5."</option>";}
		 }
		?>
          
          
		  </select>
          </div>  
    
           <div class="controls-row" style=" margin-top:10px;">

            <label>Additional Information</label>
            <textarea name="info" class="form-control"><?php if($_SESSION["info"]){ echo $_SESSION["info"];} ?></textarea>

           </div>    
           <div class="controls-row" style="margin-top:15px;">
													<label>Upload</label>
         
													<input name="img1" type="file" id="img1">
													
		  </div>  
             <?php if($usepins == 1){ ?>    
          <div class="controls-row" style=" margin-top:10px;">

            <label>Secure PIN</label>

           <input type="password" class="form-control" placeholder="Enter Your Secure PIN" name="pincode" required='required'>
                                                          

          </div>
<?php } ?>
          
          
 <div>

           &nbsp;

          </div>
          <div>
        <button type='submit' class='btn btn-<?php echo $buttone; ?>' name="addbalance">Send Confirmation</button> 

  <?php if($demomode == 1){ ?>
        <button type='button' onclick='return confirmActiondemomode()' class='btn btn-<?php echo $buttone; ?>' name="addbalance">Send Confirmation</button> 
<?php } else { ?>
        <button type='submit' class='btn btn-<?php echo $buttone; ?>' name="addbalance">Send Confirmation</button> 

<?php } ?>
          </div>

        </form>
       <script type="text/javascript">
var _validFileExtensions = [".jpg", ".jpeg", ".gif", ".png", ".pdf"];

function Validate(oForm) {
    var arrInputs = oForm.getElementsByTagName("input");
    for (var i = 0; i < arrInputs.length; i++) {
        var oInput = arrInputs[i];
        if (oInput.type == "file") {
            var sFileName = oInput.value;
            if (sFileName.length > 0) {
                var blnValid = false;
                for (var j = 0; j < _validFileExtensions.length; j++) {
                    var sCurExtension = _validFileExtensions[j];
                    if (sFileName.substr(sFileName.length - sCurExtension.length, sCurExtension.length).toLowerCase() == sCurExtension.toLowerCase()) {
                        blnValid = true;
                        break;
                    }
                }

                if (!blnValid) {
                    alert("Sorry, " + sFileName + " Upload only file : " + _validFileExtensions.join(", "));
                    return false;
                }
            }
        }
    }

    return true;
}
</script>	
        <?php unset($_SESSION['hash']);
		unset($_SESSION['tujuan']);
		unset($_SESSION['info']);
unset($_SESSION['amount']); ?>
        <?php } ?>
               </div></div>
                </div><!--end .col-->
            <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 width="10%">Date</th>
							<th width="10%">Invoice</th>
							<th width="10%">Amount</th>
							<th width="30%">Payment To</th>
							<th width="30%">Info</th>
                                            </tr>
                                        </thead>
                                       
                                        <tbody>
                                           
                                               
                                        <?

	$db->select("kode, jenis, nama, username, jumlah, tgl, invoice, rektujuan, catatan", "konfirmasipayment", "username='$user_session'", "tgl desc");
	
		while($row=$db->fetch_row()) {
			
			if(is_odd($nom) == 0) {
				$class = "tblrow_ganjil";
			} else {
				$class = "tblrow_genap";
			} 	
			
	if($row[1] == 1) {
				$jnsee = "Add Investment";
			} else if($row[1] == 2) {
				$jnsee = "Buy Ticket";
			} else if($row[1] == 3) {
				$jnsee = "Add Balance";
			} else if($row[1] == 5) {
				$jnsee = "Buy ".$namecoins." Wallet Balance";
			} else {
				$jnsee = "";
			}
		
	 				
?>
     	<tr>
							<td align="center"><?= $row[5]; ?></td>
							<td align="center"><?= $row[6]; ?></td>
							<td align="center"><?= rupiah($row[4]); ?></td>
							<td align="center"><?= $row[7]; ?></td>
							<td align="center"><?= $row[8]; ?></td>
                            
            
						  </tr> 
	 
 

	<?
	
		}
	?>

                                                                                </tbody>
                                    </table>
                                    </div>
                                </div>
                          </div>
                       </div>
                    </div>                     
             
      <?php }  ?>
    <?php }  ?>

</section>
<?php ob_flush(); ?>