<?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
if (empty($_SESSION["valid_admin"])){
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> ] #######################
	*/
?>
<script type="text/javascript">
<!--
function confirmation(no) {
	var answer = confirm("Yakin akan menghapus data transaksi ini?")
	if (answer){
		//alert("Bye bye!")
		window.location = "?go=invest&page=delete&no=" + no;
		
	}
	
}
//-->
</script>

<h2><img src="images/icon-48-user.png" width="48" height="48" align="absmiddle" /> Invest Deposit</h2>
<?php
//---pagination----------------
$limit = '20'; // How many results should be shown at a time
$scroll = '0'; // Do you want the scroll function to be on (1 = YES, 2 = NO)
$scrollnumber = '20'; // How many elements to the record bar are shown at a time when the scroll function is on
//-------------pagination--------------
if (!isset ($_GET['show'])) {

	$display = 1;
	
} else {

	$display = $_GET['show'];
	
}
$start = (($display * $limit) - $limit);

$kat = $_GET['kat'];
$keywrd = $_POST["keywrd"];	
if(isset($_POST["Submit"]) == "CARI") {
	$filter = "username like '%$keywrd%'";
	$where = "username like '%$keywrd%'";
} 
//--------------------------------------
$numrows = $db->count_records("dataewalet3", "");

$db->select("id, kode, username, jumlah, uraian, tgl, status, plan, profit, cycle, kontrak", "dataewalet3", "", "tgl desc", "", "", "$start, $limit");

if(isset($kat) == "2") {
$db->select("id, kode, username, jumlah, uraian, tgl, status, plan, profit, cycle, kontrak", "dataewalet3", $where, "tgl desc", "", "", "$start, $limit");
}
?>

<form id="form2" name="form2" method="post" action="?go=invest&amp;kat=2" style="margin:0; padding:0">
          <label> Cari Member :
            <input name="keywrd" type="text" id="keywrd" />
            </label>
          <label>
            <input type="submit" name="Submit" value="CARI" />
            </label>
        </form>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#EEEEEE">
  <tr align="center"> 
    <td width="4%"><strong>No.</strong></td>
    <td width="13%"><strong>Tanggal</strong></td>
	<td width="8%"><strong>Kode</strong></td>
    <td width="8%"><strong>Username</strong></td>
	<td width="8%"><strong>Paket</strong></td>
	<td width="13%"><strong>Jumlah Deposit </strong></td>
	 <td width="6%"><strong>Status</strong></td>
	 <td width="5%"><strong>PDF</strong></td>
    <td width="4%"><strong>Del</strong></td>
  </tr>
  <?



$j=$db->num_rows();
for($i=0;$i<$j;$i++) {
	$nom = $i + 1 + $start;
	$lid = $i - 1;
	if(is_odd($i) == 0) {
		$class = "tblrow_ganjil";
	} else {
		$class = "tblrow_genap";
	} 	

$kode = $db->result($i, "kode");	
$idne = $db->result($i, "id");	
$usr = $db->result($i, "username");	
$stats = $db->result($i, "status");	
$produk = $db->result($i, "plan");	
$myproduk = $db->result($i, "plan");	
if($stats == 0) {
	$stne = "<span class='badge badge-warning'>Pending</span>";
		$img = "<a href='?go=invest&page=publish&pub=1&no=$kode&mid=$usr' ><button class='primapc2' style='padding:0px 7px;font-size:11px;' onMouseover=\"ddrivetip('Click for processed')\" onMouseout='hideddrivetip()' onclick='return ray.ajax()'>Pending</button></a>";
	} else if($stats == 1) {
	$stne = "<span class='badge badge-success'>Aktif</span>";
		$img = "<a href='?go=invest&page=unpublish&pub=0&no=$kode&mid=$usr' ><button class='primapc' style='padding:0px 7px;font-size:11px;' onMouseover=\"ddrivetip('Click for cancel process')\" onMouseout='hideddrivetip()' onclick='return ray.ajax()'>Process</button></a>";
	} else {
		$img = "----";
		$stne = "<span class='badge badge-important'>Nonaktif</span>";
	}

$namaspon1 = "SELECT * FROM member WHERE username='$usr'"; 
        $resultnamaspon1 = mysql_query($namaspon1);
$rownamaspon1 = mysql_fetch_array($resultnamaspon1);
$namaspone1 = $rownamaspon1['nama'];	
	
?>
  <tr class="<?php echo $class; ?>"> 
    <td width="4%" align="center" > 
      <?php echo $nom; ?>    </td>
    <td width="13%" align="center"  > 
      <?php echo formatgl($db->result($i, "tgl")); ?>    </td>
    <td align="center" > 
      <?php echo $db->result($i, "kode"); ?>
    </td>
   <td align="center" > 
      <?php echo $db->result($i, "username"); ?>
    </td>
	
	<td align="center" > 
      <?php echo $myproduk; ?>
    </td>
	<td align="center" > 
      <?php echo rupiah($db->result($i, "jumlah")); ?>
    </td>
   
 <td  align="center" >
     <?php echo $img; ?>
    </td>
    <td  align="center" >
    <?php
	$ckd=$db->result($i, "kode");
	$query113 = "SELECT * FROM invoice WHERE kode='$ckd'"; 
$result113 = mysql_query($query113);
$row113 = mysql_fetch_array($result113);
$file = $row113['file'];
	if(!empty($file)){
	?>
	<a href='../invoice/<?php echo $file;?>.pdf' download='<?php echo $file;?>.pdf'><img src='../images/pdf.png' border='0' height="22" /></a>
    <?php } else { ?>
	--
	<?php } ?>
	</td>
     <td  align="center" >
      <a href="#" onClick="confirmation('<?php echo $kode; ?>', 'delete', 'delete')" style='cursor:hand'><img src="images/icon-32-delete_resize.png" width="17" height="22" border="0" title="Delete this Transaction" /></a>
    </td>
   
<?php
	}
?>
</table>

<br />
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td align="center">
     <?php

$paging = ceil ($numrows / $limit);

// Display the navigation
if ($display > 1) {
	
	$previous = $display - 1;
	
?>
  <a href="?go=invest&kat=<?php echo $kat; ?>&show=1" style="font-size:10px; color:#0000CC"><< Awal </a> | <a href="?go=invest&kat=<?php echo $kat; ?>&show=<?php echo $previous; ?>" style="font-size:10px; color:#0000CC">< Sebelumnya </a> |
  <?php

}

if ($numrows != $limit) {
	
	if ($scroll == 1) {
	
		if ($paging > $scrollnumber) {
			
			$first = $display;
			
			$last = ($scrollnumber - 1) + $display;
			
		}
	
	} else {
	
		$first = 1;
			
		$last = $paging;
			
	}
	
	if ($last > $paging ) {
			
		$first = $paging - ($scrollnumber - 1);
			
		$last = $paging;
			
	}
	
	for ($i = $first;$i <= $last;$i++){
		
		if ($display == $i) {
			
?>
[ <b>
<?php echo $i ?>
</b> ]
<?php
			
		} else {
			
?>
[ <a href="?go=invest&kat=<?php echo $kat; ?>&show=<?php echo $i; ?>" style="font-size:10px; color:#0000CC">
<?php echo $i; ?>
</a> ]
<?php
		
		}
	
	}

}

if ($display < $paging) {

	$next = $display + 1;
	
?>
| <a href="?go=invest&kat=<?php echo $kat; ?>&show=<?php echo $next; ?>" style="font-size:10px; color:#0000CC">Selanjutnya ></a> | <a href="?go=invest&kat=<?php echo $kat; ?>&show=<?php echo $paging; ?>" style="font-size:10px; color:#0000CC">Terakhir >></a>
<?php

}
//
?>

    </td>
  </tr>
</table>
<?php
if (isset($_GET['page']) && $_GET['page'] == "delete") {
if(isset($_GET["no"])){ $no = $_GET["no"]; }
		//echo "delete no $no";
		$db->delete("dataewalet3", "kode='$no'");
		$db->delete("deposit", "kode='$no'");
	echo "<meta http-equiv='refresh' content='0;URL=?go=invest'>";
?>
<?php
} if (isset($_GET['page']) && $_GET['page'] == "publish") {
if(isset($_GET["no"])){ $no = $_GET["no"]; }
if(isset($_GET["pub"])){ $pub = $_GET["pub"]; }
if(isset($_GET["mid"])){ $mid = $_GET["mid"]; }
		//echo "delete no $no";
			
		
$sblxx2=mysql_query("select kode, username, jumlah, uraian, tgl, status, paket, plan, profit, cycle, kontrak, siklus from dataewalet3 where kode='$no'");
	    while($rows=mysql_fetch_row($sblxx2)) {
		$trans_code = $rows[0];
		$usere = $rows[1];
		$jumlah = $rows[2];
		$uraian = $rows[3];
		$plan = $rows[6];
		$profite = $rows[8];
		$cyclee = $rows[9];
		$planpaket = $rows[7];
		$kontrake = $rows[10];
		$siklus = $rows[11];
		$tgle = $rows[4];
		}

$mid=$tujuan;

$expired = date('Y-m-d H:i:s', strtotime("+".$kontrake." ".$siklus.""));
$spnex = $db->dataku("sponsor", $usere);
		
			$db->update("dataewalet3", "status='1', tgl='$clientdate'", "kode='$trans_code'");
			
			
			$db->insert("deposit", "", "'', '$usere', '$trans_code', '$jumlah', '1', '$clientdate', '$expired', '$plan', '$planpaket', '$profite', '$kontrake', '', '$siklus'"); 
			
				
				
				
				
				$jumlahe=$jumlah;
				$users=$usere;
				
				
				
				
				$sponsore = $db->dataku("sponsor", $users);
$stssponsore = $db->dataku("status", $sponsore);
				
				if($stssponsore == 1){
					$sttts = "0";
				}else{
					$sttts = "2";
				}
				
			$k_spon = $db->config("komisi_sponsor");
			$komsponx = ($k_spon/100)*$jumlahe;
				
				//$duitex = $this->dataku("rupiah", $username);
				//$komsponx = ($k_spon[1]/100)*$duitex;
				if($sponsore && $komsponx > 0) {
					$db->insert("komisi", "", "'', '$sponsore', '$komsponx', '$clientdate', '0', '', 'komsponsor', '$users', '$trans_code', '$sttts'");
				
				$db->insert("dataewalet", "", "'', '$trans_code', 'admin', '$komsponx', 'Bonus Sponsor from $users', '$sponsore', '$clientdate', 1, '$clientdate'");
				
				}
			//	if($sponsore && $k_spon[1] > 0) {
					//$this->insert("komisi", "", "'', '$sponsore', '$komsponx', '$clientdate', '0', '', 'komdeposit', '$username'");
				//}
					$jsp=$db->jumlahsp($sponsore);
					$db->update("upline", "sp='$jsp'", "username='$sponsore'");
					
					
					
					
			$level = $db->dataupline("level", $users);
				
				if($level > 100){
				$levelx = 100;
				} else {
				$levelx = $level;
				}
				
				$kompas = $db->config("kompasangan");
				$pasange = ($kompas/100)*$jumlahe;
				$flusnya = "10000000000";
					
					
				for($i=0;$i<$level;$i++) {
					$upli = $db->dataupline("upline$i", $users);
					$matchnow=$db->match($upli);
					$match=$db->dataupline("kp", $upli);
				
					//--cek jml kompas--
					
					
					$tgl_skr = (date("Y-m-d"));
			$dtfrom = "$tgl_skr 00:00:00";
			$dtto = "$tgl_skr 23:59:59";
					
					$uql = mysql_query("select username from komisi where jenis='kompasangan' and username='$upli'"); 
					$matchkit = mysql_num_rows($uql); 
					
                 $sbl2gggg=mysql_query("select SUM(bayar) from komisi where jenis='kompasangan' and username='$upli' and (tglbayar between '$dtfrom' and '$dttox')");
	
	                 while($row2gggg=mysql_fetch_row($sbl2gggg)) {
		             $total2gggg = $row2gggg[0];
		             }

                 
                 if($matchnow == $matchkit + 1) {
                 if($total2gggg < $flusnya) {
					 
				
			    $db->insert("komisi", "", "'', '$upli', '$pasange', '$clientdate', '0', '', 'kompasangan', '$users', '$trans_code', '$sttts'");
			    $db->insert("dataewalet", "", "'', '$trans_code', 'admin', '$pasange', 'Bonus Pairing from $users', '$upli', '$clientdate', 1, '$clientdate'");
				
                $db->update("upline", "kp='$matchnow'", "username='$upli'");
              
                }	
                }	
                } //--end if match		
					
				
				
				
				
				
				
		$tgwal = formatgl($clientdate);
$tgend = formatgl($expired);

	

$nama = $db->dataku("nama", $usere);
		$email = $db->dataku("email", $usere);
		$hp = $db->dataku("hp", $usere);
		$alamat = $db->dataku("alamat", $usere);
		$paketnv = $planpaket;
		$pf = $profite;
		$tgl = formatgl($clientdate);
		$waktu = date("H:i:s");
		$jumlahdepone = rupiah($jumlah);
		$ket = $uraian;

$query113 = "SELECT * FROM invoice WHERE kode='$trans_code'"; 
$result113 = mysql_query($query113);
$row113 = mysql_fetch_array($result113);
$file = $row113['file'];
$kode = $row113['kode'];
$tl = $row113['tgl'];
$tgl_inv = date('d-m-Y', strtotime($tl));
$waktu_inv = date('H:i', strtotime($tl));
$tgl_paid = date('d-m-Y', strtotime($clientdate));

$tgldepo = formatgl($clientdate);
  $tglakhir = formatgl($expired);
$pkt_invs = "Paket ".$planpaket;

$pkt_invs2 = "Paket ".$planpaket."";
$prodd = "Paket ".$planpaket."";

$cyclekontrak = $kontrake." cycle";



unlink("../invoice/".$file.".pdf");	
		
$html="<!DOCTYPE html><html lang='en'><head><meta charset='utf-8'>
    <title>".$bisnisname." Invoice</title>
    <link rel='stylesheet' href='../css/style_invoice.css' media='all' />
  </head><body><header class='clearfix'>
      <div id='logo'>
      <a href='".$logourl."'><img src='".$logoinvoice."'></a>
      </div><div id='company'>
        <h2 class='name'><strong>".$bisnisname."</strong></h2>
        <div>".$alamatadmin."</div>
        <div>".$hpadmin."</div>
        <div><a href='mailto:".$emailadmin."'>".$emailadmin."</a></div>
      </div></div></header> <main>
      <div id='details' class='clearfix'><div id='client'>
          <div class='to'>INVOICE TO:</div>
          <h2 class='name'><strong>".$nama." (".$usere.")</strong></h2>
          <div class='address'>".$hp."</div>
          <div class='email'><a href='mailto:".$email."'>".$email."</a></div>
        </div> <div id='invoice'>
          <h1>INVOICE</h1>
          <div class='date'>Number : ".$trans_code."</div>
          <div class='date'>Date : ".formatgl($tgle)."</div>
        </div></div><table border='0' cellspacing='0' cellpadding='0'><thead>
          <tr>
            <th class='no'>#</th>
            <th class='desc'>DESCRIPTION</th>
            <th class='total'>TOTAL</th>
          </tr>
        </thead><tbody>
          <tr>
            <td class='no'>01</td>
            <td class='desc'><h3>".$prodd."</h3></td>
           
            <td class='total'>".$jumlahdepone."</td>
          </tr>
      
        </tbody>
        <tfoot>
          <tr>
            <td colspan='2'>SUBTOTAL</td>
            <td>".$jumlahdepone."</td>
          </tr>
          <tr>
           
            <td colspan='2'>FEE 0%</td>
            <td>-----</td>
          </tr>
          <tr>
            
            <td colspan='2'>GRAND TOTAL</td>
            <td>".$jumlahdepone."</td>
          </tr>
        </tfoot>
      </table>
      <div id='notices'>
        <div>NOTICE:</div>
        <div class='notice'>Invest Active Date From ".$tgwal." | End: ".$tgend."</div>
      </div>
    </main>
    <footer>
   <p style='margin-top:50px;'><hr color='#999999'>
			Copyright &copy; ".date("Y")." ".$domain."
		</p>
    </footer>
  </body>
</html>
";include("../dt_page/mpdf/mpdf.php");
$mpdf=new mPDF();

$mpdf->SetWatermarkText('PAID');
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->showWatermarkText = true;
$mpdf->WriteHTML($html);
$mpdf->Output('../invoice/'.$file.'.pdf','F');



$isipesan = "Halo ".$nama.", Paket investasi anda telah aktif, ".$prodd.", Nilai ".$jumlahdepone.", Tanggal selesai ".$tgend.".";
	mysql_query("insert into outbox values('', '', '$usere', '$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{}




if($mail_aktivasi_deposit_status == 1){
  $mail = new PHPMailer(); // defaults to using php "mail()"
$data = $mail_aktivasi_deposit_isi;
	$data = preg_replace("/{username}/", $usere, $data);	
    $data = preg_replace("/{tgl}/", $tgwal, $data);
    $data = preg_replace("/{waktu}/", $waktu, $data);
    $data = preg_replace("/{package}/", $prodd, $data);
    $data = preg_replace("/{spon_nama}/", $spon_nama, $data);	
    $data = preg_replace("/{kode}/", $trans_code, $data);	
    $data = preg_replace("/{nama}/", $nama, $data);
    $data = preg_replace("/{amount}/", $jumlahdepone, $data);		
    $data = preg_replace("/{ipne}/", $ipne, $data);		
    $data = preg_replace("/{cyclee}/", $cyclekontrak, $data);	
    $data = preg_replace("/{jumlahku}/", $jumlahdepone, $data);
	$data = preg_replace("/{hpadmin}/", $hpadmin, $data);			
    $data = preg_replace("/{alamatadmin}/", $alamatadmin, $data);
    $data = preg_replace("/{contactpage}/", $contactpage, $data);
    $data = preg_replace("/{login}/", $login, $data);
    $data = preg_replace("/{bisnisname}/", $bisnisname, $data);
    $data = preg_replace("/{logomail}/", $logomail, $data);
    $data = preg_replace("/{logourl}/", $logourl, $data);
    $data = preg_replace("/{emailadmin}/", $emailadmin, $data);
    $data = preg_replace("/{kode}/", $kode, $data);
    $data = preg_replace("/{expireds}/", $tgend, $data);
	$body = $data;
	
	$datax = $mail_aktivasi_deposit_subject;
	$datax = preg_replace("/{nama}/", $nama, $datax);	
	$subject_aktivasi_deposit = $datax;

if($mailset == 1){	
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = $smtphost; // SMTP server
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Host       = $smtphost; // sets the SMTP server
$mail->Port       = $smtport;                    // set the SMTP port for the GMAIL server
$mail->Username   = $smtpuser; // SMTP account username
$mail->Password   = $smtpass;        // SMTP account password
}
$mail->SetFrom(''.$emailadmin.'', ''.$bisnisname.'');
	$address = $email;
	$mail->AddAddress($address, "".$nama."");
	$mail->IsHTML(true);      
	$mail->Subject    = "".$subject_aktivasi_deposit."";
	$mail->AltBody    = "Pesan HTML, Untuk melihat pesan, silakan menggunakan peninjau HTML email yang kompatibel!"; // Alt Body
	$mail->MsgHTML($body);
	$mail->AddAttachment("../invoice/".$file.".pdf");      // attachment

$mail->Send();	
  }

		echo "<meta http-equiv='refresh' content='0;URL=index.php?go=invest'>";
?>
<?php
} if (isset($_GET['page']) && $_GET['page'] == "unpublish") {
if(isset($_GET["no"])){ $no = $_GET["no"]; }
if(isset($_GET["pub"])){ $pub = $_GET["pub"]; }
if(isset($_GET["mid"])){ $mid = $_GET["mid"]; }
		//echo "delete no $no";
$sblxx2=mysql_query("select kode, username, jumlah, uraian, tgl, status, paket, plan, profit, cycle, kontrak, siklus from dataewalet3 where kode='$no'");
	    while($rows=mysql_fetch_row($sblxx2)) {
		$trans_code = $rows[0];
		$usere = $rows[1];
		$jumlah = $rows[2];
		$uraian = $rows[3];
		$plan = $rows[6];
		$profite = $rows[8];
		$cyclee = $rows[9];
		$planpaket = $rows[7];
		$kontrake = $rows[10];
		$tgle = $rows[4];
		$siklus = $rows[11];
		}

$mid=$tujuan;


$spnex = $db->dataku("sponsor", $usere);
		
$db->update("dataewalet3", "status='0', tgl='$clientdate'", "kode='$trans_code'");
		$db->delete("deposit", "kode='$trans_code'");
		$db->delete("komisi", "kode='$trans_code'");
		$db->delete("dataewalet", "kode='$trans_code'");
			
	

$nama = $db->dataku("nama", $usere);
		$email = $db->dataku("email", $usere);
		$hp = $db->dataku("hp", $usere);
		$alamat = $db->dataku("alamat", $usere);
		$paketnv = $planpaket;
		$pf = $profite;
		$tgl = formatgl($clientdate);
		$waktu = date("H:i:s");
		$jumlahdepone = rupiah($jumlah);
		$ket = $uraian;

$query113 = "SELECT * FROM invoice WHERE kode='$trans_code'"; 
$result113 = mysql_query($query113);
$row113 = mysql_fetch_array($result113);
$file = $row113['file'];
$kode = $row113['kode'];
$tl = $row113['tgl'];
$tgl_inv = date('d-m-Y', strtotime($tl));
$waktu_inv = date('H:i', strtotime($tl));
$tgl_paid = date('d-m-Y', strtotime($clientdate));

$tgldepo = formatgl($clientdate);
  $tglakhir = formatgl($expired);
$pkt_invs = "Paket ".$planpaket;

$pkt_invs2 = "Paket ".$planpaket."";
$prodd = "Paket ".$planpaket."";



unlink("../invoice/".$file.".pdf");	
		
$html="<!DOCTYPE html><html lang='en'><head><meta charset='utf-8'>
    <title>".$bisnisname." Invoice</title>
    <link rel='stylesheet' href='../css/style_invoice.css' media='all' />
  </head><body><header class='clearfix'>
      <div id='logo'>
      <a href='".$logourl."'><img src='".$logoinvoice."'></a>
      </div><div id='company'>
        <h2 class='name'><strong>".$bisnisname."</strong></h2>
        <div>".$alamatadmin."</div>
        <div>".$hpadmin."</div>
        <div><a href='mailto:".$emailadmin."'>".$emailadmin."</a></div>
      </div></div></header> <main>
      <div id='details' class='clearfix'><div id='client'>
          <div class='to'>INVOICE TO:</div>
          <h2 class='name'><strong>".$nama." (".$usere.")</strong></h2>
          <div class='address'>".$hp."</div>
          <div class='email'><a href='mailto:".$email."'>".$email."</a></div>
        </div> <div id='invoice'>
          <h1>INVOICE</h1>
          <div class='date'>Number : ".$trans_code."</div>
          <div class='date'>Date : ".formatgl($tgle)."</div>
        </div></div><table border='0' cellspacing='0' cellpadding='0'><thead>
          <tr>
            <th class='no'>#</th>
            <th class='desc'>DESCRIPTION</th>
            <th class='total'>TOTAL</th>
          </tr>
        </thead><tbody>
          <tr>
            <td class='no'>01</td>
            <td class='desc'><h3>".$prodd."</h3></td>
           
            <td class='total'>".$jumlahdepone."</td>
          </tr>
      
        </tbody>
        <tfoot>
          <tr>
            <td colspan='2'>SUBTOTAL</td>
            <td>".$jumlahdepone."</td>
          </tr>
          <tr>
           
            <td colspan='2'>FEE 0%</td>
            <td>-----</td>
          </tr>
          <tr>
            
            <td colspan='2'>GRAND TOTAL</td>
            <td>".$jumlahdepone."</td>
          </tr>
        </tfoot>
      </table>
      <div id='notices'>
        <div>NOTICE:</div>
        <div class='notice'></div>
      </div>
    </main>
    <footer>
   <p style='margin-top:50px;'><hr color='#999999'>
			Copyright &copy; ".date("Y")." ".$domain."
		</p>
    </footer>
  </body>
</html>
";include("../dt_page/mpdf/mpdf.php");
$mpdf=new mPDF();

$mpdf->SetWatermarkText('UNPAID');
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->showWatermarkText = true;
$mpdf->WriteHTML($html);
$mpdf->Output('../invoice/'.$file.'.pdf','F');

		
			echo "<meta http-equiv='refresh' content='0;URL=index.php?go=invest'>";
		
	
?>
<?php
}
?>