<?php ob_start(); ?>
<?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();} 
?>
<?php
	/* 
	############################[  <about> ] #######################
		S Name   ::       Inv-X Primadesain
		Update   ::       2013 © Primadesain.Com
		Author   ::       Agus Susanto S.kom
		Website  ::		  http://primadesain.com
		Contact  ::		  <primapc57@gmail.com> // +62 85228657360
	
	Primadesain melayani pembuatan website MLM dan Investasi
	( dengan sistem binary, trinary atau matrix dan matahari )
	juga menerima pembuatan website Iklan Baris, Website Profile,
	Reseller, Hyip, dll.
	############################[ </about> ] #######################
	*/
?>

 <link href="../css/invoice.css" rel="stylesheet">
   <style>
   .table					{ margin:0 0 15px 0; padding:0px; width:100%; font-size:12px; font-weight:normal; border-collapse:collapse; }
.table th				{ padding:7px 10px; font-family:"Oswald", Tahoma; color:#7c5233; text-shadow:0 1px rgba(255,255,255,0.2);
						  text-transform: uppercase; font-weight:500; border:1px solid rgba(0,0,0,0.2); text-align:center; 
						  box-shadow:inset 0px 0px 0px 1px rgba(255,255,255,0.4); background:#dbb771; 
						  background:-moz-linear-gradient(top, #c59649,#fae3a4,#c59649);
						  background:-webkit-linear-gradient(top, #c59649,#fae3a4,#c59649);/**/ }
.table td				{ padding:7px 10px; border:1px solid rgba(0,0,0,0.1); font-weight:; }
.table tr					{ background:rgba(0,0,0,0.02); -moz-transition:0.2s; -webkit-transition:0.2s; transition:0.2s; }
.table tr:nth-of-type(even)	{ background:rgba(0,0,0,0.05); } 
.table tr:hover				{ background:rgba(255,255,255,0.1); color:#444; box-shadow:inset 0 1px rgba(255,255,255,0.5); }

.table td h3			{ margin-bottom:5px; font-size:14px; color:#666; }
.table td a				{ color:; }

@media only screen and (min-width: 0px) and (max-width: 767px) {
	.table, .table thead, .table tbody, .table th, .table td, .table tr { display: block; }
	.table thead tr 		{ position: absolute; top: -9999px; left: -9999px; } 
	.table tr				{ border: 1px solid rgba(0,0,0,0.1); border-bottom:0px; margin-bottom:5px; } 
	.table td				{ border: none; border-bottom: 1px solid rgba(0,0,0,0.1); position: relative; padding-left:45%; text-align:left; } 
	
	.table td:before		{ position: absolute; top:7px; left:10px; width:39%; padding-right: 10px; color:#555; white-space:nowrap;
							  font-weight:normal; }
	.table td:before		{ content: attr(data-title); }
	.table tr:hover td:before	{ color:#444; }
	
	
	.table.event_table td		{ padding-left:100px; } 
	
	.table.event_table td:before{ width:100px; font-weight:bold; }
}
  table.list{border:solid 1px #bbb;
border-collapse:collapse;}
table.list tr{}
table.list tr.odd td{background:#e8e8e8;}
table.list tr.even td{}table.list tr th{background:url(../images/list-header-bg.png) repeat-x;background-size:contain;color:white;border:solid 1px #ccc;padding:2px 4px;font-weight:normal;}
table.list tr td{background:white;border-left:solid 1px #ccc;padding:2px 4px;}
table.list tr:hover td{background:#E2F2FC;}
table.data-dark{border:solid 1px #ccc;}
table.data-dark tr td{padding:2px 16px;border-bottom:solid 1px #ccc;background:#eee;}
table.data-dark tr td:first-child{text-align:right;font-weight:bold;background:#555;color:#CCCCCC;}
#load{
position:absolute;
z-index:1;
font-size: 14px;
background-image:url(../images/loadingz.gif);
width:290px;
height:121px;
top:50%;
left:50%; 
margin-top: -104px;
  margin-left: -145px;
text-align:center;
line-height:300px;
font-family:"Trebuchet MS", verdana, arial,tahoma;
color:#FFF;
}
/*----------------------------------------------------------------------{ alert }--------------------------------------------------------------------------*/
.alert					{ margin:3px; padding:5px 10px 5px 35px; display:block; line-height:20px; font-family:Tahoma; background:#f5f5f5; border:1px solid; }
	.success			{ color:#00632e; border-color:#339933; background:#d1e8d2 url(../img/frontend/tick_circle.png) no-repeat 10px 7px; }
	.error				{ color:#820101; border-color:#dc1c1c; background:#facfcf url(../img/frontend/cross_circle.png) no-repeat 10px 7px; }
	.warning			{ color:#675100; border-color:#d4b64b; background:#fdefbd url(../img/frontend/exclamation.png) no-repeat 10px 7px; }
	.info				{ color:#00357b; border-color:#9dbfea; background:#d8e7fa url(../img/frontend/information.png) no-repeat 10px 7px; }
	.note				{ color:#4d4d4d; border-color:#bdbdbd; background:#f4f4f4 url(../img/frontend/notebook.png) no-repeat 10px 7px; }
.notification			{ cursor:pointer; }
/*-------------------------------------------------------------------{ Form }-----------------------------------------------------------------------*/
.form_style				{ line-height:normal; }
.form_style .row		{ margin:0; padding:10px; background:#fff; }
.form_style .row:nth-of-type(even)	{ background-color:#f8f8f9; }
.form_style .row label	{ display:block; float:left; margin:0; padding:0; width:40%; line-height:28px; font-weight:bold; }
.form_style .row span	{ display:block; float:left; position:relative; margin:0; padding:0; width:60%; line-height:20px; }
.form_style .row span select,
.form_style .row span textarea,
.form_style .row span input	{ margin:0; padding:5px; width:200px; color:#888; background:#fff; border:solid 1px #d4d8db;  }
.form_style .row span select:hover,
.form_style .row span textarea:hover,
.form_style .row span input:hover{ color:#9089a2; border:1px solid #c9c2d8; }
.form_style .row span select:focus,
.form_style .row span textarea:focus,
.form_style .row span input:focus{ background:#f5f3f9; color:#663399; border:1px solid #663399; box-shadow:inset 1px 1px 1px #ceccd1; }
.form_style .row span select	{ width:212px; }
.form_style .row span select option	{ padding:0 5px; }

.form_style .row input.submit	{ position:relative; margin:0 0 5px 0; padding:4px 10px; width:auto; color:#EFF4FA; text-shadow:1px 1px 1px #316395; text-align:center; 
								  font-family:Tahoma; font-size:12px; font-weight:bold; text-decoration:none; border:1px solid #316395; border-radius:3px; cursor:pointer;
								  background:#4684C1; box-shadow:inset 0px 0px 3px 1px #75A3D0, 0px 1px 2px 0px rgba(0,0,0,0.4); }
.form_style .row input.submit:hover	{ text-shadow:1px 1px 1px #3D79B6; border:1px solid #3C78B5; background:#6397CB; 
										  box-shadow:inset 0px 0px 3px 1px #8DB3D8, 0px 1px 2px 0px rgba(0,0,0,0.4); }
.form_style .row input.submit:active	{ color:#316395; text-shadow:1px 1px 1px #5991C8; border-color:#316395; 
										  box-shadow:inset 0px 0px 3px 1px #75A3D0, 0px 1px 2px 0px rgba(0,0,0,0.4); }
										  
										  
										  
										  
.form_style .row span.textError		{ left:215px; }
						  
/*-------------------------------------------------------------------{ Form table }-----------------------------------------------------------------------*/
.form_style						{ margin:20px 0; padding:0; width:100%; font-size:13px; }
.form_style fieldset			{ padding:0px; border:solid 1px #cac7cd; border-radius:3px; -moz-border-radius:3px;
								  -khtml-border-radius:3px; -webkit-border-bottom-radius:3px; }
.form_style fieldset legend 	{ color:#444444; border:solid 1px #cac7cd; margin-left:10px; padding:5px 15px; font-weight:bold; border-radius:3px; }

.form_style table				{ margin:0 auto; padding:0; width:100%; border:none; border-collapse:collapse; }
.form_style table tr.row2		{ background:#f4f4f5; }
.form_style table td			{ margin:0; padding:12px 5px; }
.form_style table td span		{ display:block; position:relative; }
.form_style table td label		{ padding:5px 0 0 0; display:block; font-weight:bold; }
.form_style table td input,
.form_style table td textarea, 
.form_style table td select		{ padding:3px 3px 4px 3px; width:190px; color:#888; background:#fff; border:solid 1px #d4d8db; }
.form_style table td input:hover,
.form_style table td textarea:hover, 
.form_style table td select:hover	{ color:#878a91; border:1px solid #878a91; }
.form_style table td input:focus,
.form_style table td textarea:focus, 
.form_style table td select:focus	{ background:#f5f3f9; color:#663399; border:1px solid #663399; box-shadow:inset 1px 1px 1px #ceccd1; }

.form_style table td input.submit	{ position:relative; margin:0 0 5px 0; padding:4px 10px; width:auto; color:#EFF4FA; text-shadow:1px 1px 1px #316395; text-align:center; 
									  font-family:Tahoma; font-size:12px; font-weight:bold; text-decoration:none; border:1px solid #316395; border-radius:3px; cursor:pointer;
									  background:#4684C1; box-shadow:inset 0px 0px 3px 1px #75A3D0, 0px 1px 2px 0px rgba(0,0,0,0.4); }
.form_style table td input.submit:hover	{ text-shadow:1px 1px 1px #3D79B6; border:1px solid #3C78B5; background:#6397CB; 
										  box-shadow:inset 0px 0px 3px 1px #8DB3D8, 0px 1px 2px 0px rgba(0,0,0,0.4); }
.form_style table td  input.submit:active	{ color:#316395; text-shadow:1px 1px 1px #5991C8; border-color:#316395; 
											  box-shadow:inset 0px 0px 3px 1px #75A3D0, 0px 1px 2px 0px rgba(0,0,0,0.4); }






.form_style table td textarea	{ width:300px; height:100px; }

.form_style span.textError		{ position:absolute; top:2px; left:200px; padding-left:7px; z-index:1; 
								  background:url(../img/frontend/span_error_bg2.png) no-repeat left center; }
.form_style span.textError p	{ margin:0; padding:3px 7px; line-height:normal; font-size:10px; color:#ccc; background:#000; 
								  background:rgba(0,0,0,0.9); border:1px solid #000; border-radius:3px; }
.form_style p					{ margin:0px; padding:0px; }
.notification					{ cursor:pointer; }
				
  </style>
<?php
if($db->dataku("status", $user_session) == 0 || $db->dataku("blokir", $user_session) == 1) {
echo "<div class='alert-box errors'><span>error : </span>Keanggotaan anda tidak aktif atau sedang di blokir!</div>";
echo "<div align='center'><a href='javascript:history.go(-1)'><button class='primaback'>Back</button></a><br /></div>";
}else{
?>

  <?php

if(isset($_GET["sc"])){ 
$sc = $_GET["sc"]; 

$query35 = "SELECT * FROM transaksiproduk WHERE stmpkode='$sc' and status='0'"; 
$result35 = mysql_query($query35);
$ceks1 = mysql_num_rows($result35);
$row35 = mysql_fetch_array($result35);
$id = $row35['id'];
$username = $row35['username'];
$nama = $row35['nama'];
$tglbayar = $row35['tglbayar'];
$tgl = $row35['tgl'];
$qty = $row35['qty'];
$kode = $row35['kode'];
$produk = $row35['produk'];
$status = $row35['status'];
$rp = $row35['rp'];
$rpku = $row35['rpku'];
$totalrp = $row35['totalrp'];
$komisi = $row35['komisi'];
$alamat = $row35['alamat'];
$phone = $row35['phone'];
$hp = $row35['hp'];
$email = $row35['email'];
$pesan = $row35['pesan'];
$stmpkode = $row35['stmpkode'];
$nota = $row35['nota'];
$invoice = $row35['invoice'];

$jumlahsatune = rupiah($rp);
$jumlah = $totalrp;
$tgle = date('d/m/Y', strtotime($tgl));
		$jumlahdepone = rupiah($jumlah);
		
		

             $itungane = $jumlah/$kurse_beli_idr; 	
             $dolare = round($itungane, 2);		

setcookie("Amounts",$dolare, time()+3600);
setcookie("Email",$email, time()+3600);
setcookie("Nama",$nama, time()+3600);


$ptt=base64_encode($stmpkode);

$query113 = "SELECT * FROM invoice WHERE kode='$sc'"; 
$result113 = mysql_query($query113);
$row113 = mysql_fetch_array($result113);
$file = $row113['file'];
$prodd=$produk;
  
}
  

  
  if(!$ceks1){
	  
	  echo "<script type=text/javascript>
              alert('Transaction Not Found!');
              window.close()
              </script>";		
	  
	exit;
} else {	
  
    
?>
<script>
		function confirmActionx2(){
      var confirmed = confirm("Your C-Walet and B-Walet balance is insufficient for payment.");
      return confirmed;
}
</script>
<div class="wrapper">


<table class="header"><tr><td width="50%" nowrap>

<p><img src="../images/banner/<?php echo $invlogos; ?>" title="<?php echo $bisnisname;?>" width="200px"/></p>
</td><td width="50%" align="center">

<br /><br />
<table width="200" border="0">
  <tr>
    <td align="center" ><font style="font-size:25px; color:#D70000; font-weight:bold;">UNPAID</font></td>
    </tr>
  <tr>
    <td align="center"></td>
  </tr>
  </table>
<p>&nbsp;</p>

</td></tr></table>



<table class="items"><tr><td width="50%">

<div class="addressbox">

<strong>Invoiced To</strong><br />
<?php echo $nama;?><br />
<?php echo $alamat;?><br />
Email: <?php echo $email;?>

</div>

</td><td width="50%">

<div class="addressbox">

<strong>Payment To</strong><br />
<?php echo $bisnisname;?><br />
<?php echo $alamat_bisnis;?><br />
Email: <?php echo $email_bisnis;?><br />
Website: www.<?php echo $domain;?>

</div>

</td></tr></table>

<div class="row">
<span class="title">Invoice No: <?= $kode; ?></span><br />
Invoice Date: <?php echo $tgle;?>
</div>

<table class="items">
    <tr class="title textcenter">
        <td width="60%">Description</td>
        <td width="10%">Item</td>
        <td width="30%">Amount</td>
    </tr>
    <tr>
        <td align="center"><?= $prodd; ?></td>
        <td align="center"><?= $qty; ?></td>
        <td class="textcenter"><?= $jumlahsatune; ?></td>
    </tr>
    <tr class="title">
        <td class="textright" colspan="2">Sub Total:</td>
        <td class="textcenter"><?= $jumlahdepone; ?></td>
    </tr>
            <tr class="title">
        <td class="textright" colspan="2">Credit:</td>
        <td class="textcenter"><?= rupiah(0); ?></td>
    </tr>
    <tr class="title">
        <td class="textright" colspan="2">Total:</td>
        <td class="textcenter"><?= $jumlahdepone; ?></td>
    </tr>
</table>


<div class="row">
<span class="subtitle">Payment</span>
</div>
<?php $db->bannerrek2a(); ?>





</div>

<p align="center"><a href='../invoice/<?php echo $file;?>.pdf' download='<?php echo $file;?>.pdf'><button type="button">Download</button></a><a href="javascript:window.close()"><button type="button">Close Window</button></a></p>

<?
}
}
?>
<?php ob_flush(); ?>