<?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>
        Invoice
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="breadcrumb-item active">Invoice</li>
      </ol>
    </section>


    <section class="invoice printableArea">
 
<?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'>x</button>".$LANG["status0"]."</div>";
}else{
?>
<?php
if(!isset($_GET["sc"])){ 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>x</button>Data Transaksi (Invoice) Tidak ditemukan!</div>";
}else{
if(isset($_GET["sc"])); $sc = $_GET["sc"];
?>
<?php
$results = $_GET['result'];
if($results == "successpay") { 
echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>x</button>Invoice ".$_GET['co']." have been successfully paid using your wallet balance. Thank you for making a payment.</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "success") { 
echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>x</button>Buy ".$currencye." Balance Has been successfully submitted. Please make payment.</div>";
}
?>
<?
$query35 = "SELECT * FROM datacwalet2 WHERE  username='".$user_session."' and kode='".$sc."'"; 
$result35 = mysql_query($query35);
$ceks1 = mysql_num_rows($result35);
$row35 = mysql_fetch_array($result35);
$username = $row35['username'];
$tgl = $row35['tgl'];
$jumlah = $row35['jumlah'];
$status = $row35['status'];
$kode = $row35['kode'];
//$produk = $row35['produk'];
$tgle = date('d/m/Y', strtotime($tgl));
		$jumlahdepone = rupiah($jumlah);	
		$bayare = $jumlah;	
		$bayarex = $jumlah;	
		
$paybtcne=$jumlah*$ratepaybtc;
$paybtcne=sprintf("%.8f",$paybtcne);



$payidre=$jumlah*$kursidr;		

$paymyre=$jumlah*$kursmyr;	

$paybndne=$jumlah*$kursbnd;		

$paysgdne=$jumlah*$kurssgd;	
	
$payeure=$jumlah*$kurseur;	


$prodd="Buy ".$currencye." Balance";

	  $email = $db->dataku("email", $username);
		$nama = $db->dataku("nama", $username);
		$hp = $db->dataku("hp", $username);	
		$alamat = $db->dataku("alamat", $username);	
?>


    <!-- Main content -->
      <!-- title row -->
      <div class="row">
        <div class="col-12">
          <h2 class="page-header">
            INVOICE <span class="text-danger"><small class="font-weight-600">  <?php if($status == 1){?><span class="text-success"> (PAID)</span><?php } else { ?><span class="text-danger"> (UNPAID)</span><?php } ?></small></span>
            <small class="pull-right">Date: <?php echo $tgle;?></small>
          </h2>
        </div>
        <!-- /.col -->
      </div>
      <!-- info row -->
      <div class="row align-items-center invoice-info">
        <div class="col-md-3 invoice-col">
          From
          <address>
            <strong class="text-info"><?php echo $namaeadmin;?></strong><br>
            <?php echo $alamatadmin;?><br>
            Phone: <?php echo $hpadmin;?><br>
            Email: <?php echo $emailadmin;?>
          </address>
        </div>
        <!-- /.col -->
        <div class="col-md-3 invoice-col">
          To
          <address>
            <strong class="text-primary"><?php echo $nama;?> (<?php echo $user_session;?>)</strong><br>
            <?php echo $alamat;?><br>
            Phone: <?php echo $hp;?><br>
            Email: <?php echo $email;?>
          </address>
        </div>
        <!-- /.col -->
        <div class="col invoice-col">
			<div class="invoice-details row no-margin bg-dark">
			  <div class="col-md-6 col-lg-4"><b>Invoice </b>#<?php echo $kode;?></div>
			  <div class="col-md-6 col-lg-4"><b>Order Date:</b> <?php echo $tgle;?></div>
			  <div class="col-md-6 col-lg-4"><b>Account:</b> <?php echo $user_session;?></div>
			</div>
		</div>
      <!-- /.col -->
      </div>
      <!-- /.row -->

      <!-- Table row -->
      <div class="row">
              <div class="table-responsive">
          <table class="table table-bordered">
            <thead>
            <tr class="bg-pale-dark">
              <th>#</th>
              <th>Description</th>
              <th class="text-right">Quantity</th>
              <th class="text-right">Subtotal</th>
            </tr>
            </thead>
            <tbody>
            <tr>
              <td>1</td>
              <td><?= $prodd; ?></td>
              <td class="text-right"><?= $jumlahdepone; ?></td>
              <td class="text-right"><?= $jumlahdepone; ?></td>
            </tr>
           
            </tbody>
          </table>
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->




      <div class="row">
        <!-- accepted payments column -->
     
        
        
       
        
        
        
        
        
        
        
        
        
        
        <!-- /.col -->
        <div class="col-12 col-sm-12 text-right">
			
         	<div>
         		<p>Sub - Total amount  :  <?= $jumlahdepone; ?></p>
         		
         	</div>
         	<div class="total-payment">
         		<h3><b>Total :</b> <?= $jumlahdepone; ?></h3>
         	</div>
         
         
         
        
        
        
        
        
        
        
        
     
        
        
        
        
        
      </div>
      <!-- /.row -->
      
      
      
      
      
<?php if($status == 0){?>




<?php if($db->config("usdtpay") == 1){ ?>
      <div class="col-md-6">              
           <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Pay With USDT TRC20</h3>
            </div>
            <div class="box-body">     
            
        
                   <div class="col-md-12">
                   
                 <div align="center">
                   <img src='../themes/usdtpay.png' style="width:100%; max-width:400px;" title='Pay USDT'/>
                   </div>
                   <br />
                   <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>Send <?= rupiah($jumlah); ?><br />To USDT TRC20 Wallet Address Below :
        </div></div>   
                   
                <div class="input-group p-b-10" style="margin-bottom:30px;">
                    <input id="hxt_address" class="form-control" name="ref_url" type="text" value="<?php echo $db->config("usdtaddress"); ?>">
                    <span class="input-group-btn">
                        <button id="copy-hxt-address" class="btn btn-success" type="button" style="height:46px;">Copy</button>
                    </span>
                </div>
                </div>
     
                          
                          
                          
                     </div></div>  
                     
                     
        </div>                         
            <?php } ?>







  <?php if($db->config("btcne") == 1){ ?>               
                                            
    <div class="col-md-6">              
           <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Payment BTC</h3>
            </div>
            <div class="box-body">   
            
            
  <?php if($db->config("btcpays") == 1){ ?>     
             
              
         <div align="center" style="margin-top:10px;">
                        
                    <input type="image" src="../images/paybtc.png"  data-toggle='modal' data-target='#bitcoinpay' style="width:100%; max-width:300px;">  
                </div>
                    
                      <div class="modal fade" id="bitcoinpay" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-keyboard="false" data-backdrop="static">
								<div class="modal-dialog modal-lg">
									<div class="modal-content">
										<div class="modal-header">
											<h4 class="modal-title" id="myModalLabel">Payment <?php echo $kode; ?></h4>
                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
										</div>
										<div class="modal-body" style="height:550px; overflow:auto;overflow-y: hidden;" align="center">
                                       
										<iframe src="paybitcoin.php?sc=<?php echo $kode; ?>" style="width:600px; height:550px; overflow:auto;" frameborder="0" allowtransparency="true"></iframe>
										</div>
										
										</div>
										</div>
										</div>
                                        
        
              <?php } else { ?>      
                    
                    
                          <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>Send <?= btc($paybtcne); ?> (Rate <?= btc($ratepaybtc); ?>/<?php echo $currencye;?>)<br />
           To BTC Address Below :
        </div></div>      
                  
                   
                <div class="input-group p-b-10" style="margin-bottom:30px;">
                    <input id="hxt_address" class="form-control" name="ref_url" type="text" value="<?php echo $db->config("bitcoin_address"); ?>">
                    <span class="input-group-btn">
                        <button id="copy-hxt-address" class="btn btn-warning" type="button" style="height:46px;">Copy</button>
                    </span>
                </div>             
                    
                    <?php } ?>
                    
                    
                    
                    
                    
                    
                    </div></div>      
            
            
        </div>
            <?php } ?>
            




















        <?php if($rekbanke == 1){?>   
        
        
        

      <div class="col-md-6"> 
           <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Payment Bank (OMR)</h3>
            </div>
            <div class="box-body">  
            
         
      <?php if($currencye == "USD"){ ?>   
<?php if($exchangeidr == 1){ ?>   
            
            <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>Send <?= omr($payidre); ?> (Rate <?= omr($kursidr); ?>/<?php echo $currencye;?>)<br />
           To Bank Account Below :
        </div></div>     
        <?php } ?>
        

        <?php } else { ?>
         <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>Please make payment To Bank Account Below :
        </div></div>     
           
        <?php } ?>
        
         
            
                        
                        <?php $db->bannerrek2d(); ?>
                        
                        <div align="center">

<br /><br />
</div>
                        
                        
                     </div></div></div>
                     
                     
                     
                     <?php } ?>  
                     
                     
                     
                     
                     
                  <?php if($paymyr == 1){?>   
        
        
        

      <div class="col-md-6"> 
           <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Payment Bank (KWD)</h3>
            </div>
            <div class="box-body">  
            
         
      <?php if($currencye == "USD"){ ?>   
<?php if($exchangerm == 1){ ?>   
            
            <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>Send <?= kwd($paymyre); ?> (Rate <?= kwd($kursmyr); ?>/<?php echo $currencye;?>)<br />
           To Bank Account Below :
        </div></div>     
        <?php } ?>
        <?php } else { ?>
         <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>Please make payment To Bank Account Below :
        </div></div>     
           
        <?php } ?>
        
         
            
                        
                        <?php $db->bannerrek2a(); ?>
                        
                        <div align="center">

<br /><br />
</div>
                        
                        
                     </div></div></div>
                     
                     
                     
                     <?php } ?>       
                     
                     
                     
                       <?php if($paybnd == 1){?>   
        
        
        

      <div class="col-md-6"> 
           <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Payment Bank (SGD)</h3>
            </div>
            <div class="box-body">  
            
         
      <?php if($currencye == "USD"){ ?>   
<?php if($exchangebnd == 1){ ?>   
            
            <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>Send <?= sgd($pabndne); ?> (Rate <?= sgd($kursbnd); ?>/<?php echo $currencye;?>)<br />
           To Bank Account Below :
        </div></div>     
        <?php } ?>
        <?php } else { ?>
         <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>Please make payment To Bank Account Below :
        </div></div>     
           
        <?php } ?>
        
         
            
                        
                        <?php $db->bannerrek2c(); ?>
                        
                        <div align="center">

<br /><br />
</div>
                        
                        
                     </div></div></div>
                     
                     
                     
                     <?php } ?>       
                     
                     
                     
 <?php if($db->config("paysgd") == 1){ ?>
        
        

      <div class="col-md-6"> 
           <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Payment Bank (JOD)</h3>
            </div>
            <div class="box-body">  
            
         
      <?php if($currencye == "USD"){ ?>   
<?php if($exchangebnd == 1){ ?>   
            
            <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>Send <?= jod($paysgdne); ?> (Rate <?= jod($kurssgd); ?>/<?php echo $currencye;?>)<br />
           To Bank Account Below :
        </div></div>     
        <?php } ?>
        <?php } else { ?>
         <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>Please make payment To Bank Account Below :
        </div></div>     
           
        <?php } ?>
        
         
            
                        
                        <?php $db->bannerrek2b(); ?>
                        
                        <div align="center">

<br /><br />
</div>
                        
                        
                     </div></div></div>
                     
                     
                     
                     <?php } ?>       
                                      
                 
                     
          <?php if($db->config("payeur") == 1){ ?>
        
        

      <div class="col-md-6"> 
           <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Payment Bank (EUR)</h3>
            </div>
            <div class="box-body">  
            
         
      <?php if($currencye == "USD"){ ?>   
<?php if($exchangeeur == 1){ ?>   
            
            <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>Send <?= eur($payeure); ?> (Rate <?= eur($kurseur); ?>/<?php echo $currencye;?>)<br />
           To Bank Account Below :
        </div></div>     
        <?php } ?>
        <?php } else { ?>
         <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>Please make payment To Bank Account Below :
        </div></div>     
           
        <?php } ?>
        
         
            
                        
                        <?php $db->bannerrek2e(); ?>
                        
                        <div align="center">

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

      <!-- this row will not appear when printing -->
      <div class="row no-print" style="margin-left:15px;">
        <div class="col-12">
        <p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
           Please make confirm manualy if you already payment and system not automaticaly confirm your payment.<br /><br />
            <a href="index.php?go=confirmpayment&sc=<?php echo $kode; ?>&jn=3&jm=<?php echo $bayare;?>"><button id="print" type="button" class="btn btn-warning"> <span><i class="fa fa-envelope"></i>&nbsp;&nbsp;Confirmation</span></button></a>
          </p>
           </div>
      </div>
      
               
                     <?php } ?>   














<?php }} ?>
    </section>
