<?php
include_once "invoice_includes.php";
////////////////////// CORE FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////
////////////////////// CORE FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////
include_once('tcpdf_vars_blue.php');

include_once('tcpdf_proposal_fetch_blue.php');

require_once('tcpdf_include.php');



$file_title="i2d_web_invoice";
$doc_title="i2d Technologies - i2d Webmini Invoice";
$inv_title=strtoupper($invoice_title);
$doc_keywords="web development";
$doc_sub="i2d Webmini";

$rec_id = $id;
$refno = $rec_id;

include_once('tcpdf_bottom.php');



//$heading1="Service Name";
$heading1=$phase_title;
$service_title=strtolower($inv_title);
$service_title=ucwords($service_title);
$domain_header_type=$domain_title;


$domain_feature2=
'
<ul><li>Privacy Protection</li>
        <li>Theft Protection</li>
    </ul>    
';


$unit="PKR";


//$package_price="9500";
$tax_value=$amount*$tax_rate1;
$discount_value2=$amount*$discount_rate;
$discount_value=$amount-$discount_value2;
$price_with_tax=$discount_value+$tax_value;
$advance=$price_with_tax*0.70;
$balance=$price_with_tax*0.30;

$inv_header='<p>&nbsp;</p><p>&nbsp;</p>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td width="290" rowspan="2" align="left">ATTN : <br />
    '. $person_name .' <br />
    '. $company_name .'<br /> 
    '. $address .',<br /> 
    '. $city_name .' -
    '. $country .'.</td>
    <td width="370" align="right"><h2>'. $inv_title .'</h2></td>
  </tr>
  <tr>
    <td align="right"><b>Tracking / Ref: '. $ref_no .'</b><br />
Invoice Date: '. $dated1 .'<br />
<span style="color:red;">Due Date: '. $dated2 .'</span><br />
Sales Tax # '. $stn_number .'</td>
  </tr>
  
</table><br /><br />




<table width="660" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td width="290" height="10" align="center" bgcolor="#000000"><span style="color:white;"><strong>'.$heading1.'</strong></span></td>
    <td width="370" align="center" bgcolor="#000000"><span style="color:white;"><strong>Payment Details* (In case of Online / Cheque)</strong></span></td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>&nbsp;<br /></tr>
  <tr>
    <td width="290"><ul>
	<br />
      <li><strong> '.$service_title.'</strong></li>
      <li>Domain : <strong>'.$domain_name.'</strong></li>
    </ul></td>
    <td width="370" align="right">'.$bank.'<br /></td>
  </tr>
</table>

';




$package_feature1='
<!--table Starts-->
<table width="660" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td width="290" height="10" align="center" bgcolor="#000000"><span style="color:white;"><strong>Details / Description</strong></span></td>
    <td width="370" align="center" bgcolor="#000000"><span style="color:white;"><strong>Cost /Price</strong></span></td>
  </tr>
</table>


<table width="660" border="0" align="left" cellpadding="4" cellspacing="0">

  
  <tr>&nbsp;<br /></tr>
  <tr>
  
    <td width="244" align="left">- FREE! '.$unit.' for 1 Year*<br />
    - Static Banner <br />
    - About Section <br />
    - Services Section <br />
    - Upto 25 Photos Gallery <br />
    - Contact Page <br />
    - Google Map <br />
    - Whatsapp Chat Button <br />
    - Basic SEO <br />
    - All Device Compatible - Mobile Ready <br />
    - 1 Month After Sales Online Support 
    - *Annual Renewal Charges of PKR : 6,000 or above apply after first year.
    - *This project has built-in web storage and has no third-party access ftp,emails,webdisk etc.
    </td>
	<td width="194" align="left"></td>
    <td width="198" align="default"><br /><br /><br /><br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$unit.'&nbsp;'.number_format($amount).'</td>
	
	</tr>
  
</table>
<br /><br />
';


$costing='
<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td height="10" width="660" align="left">'.$line.'</td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>&nbsp;<br /></tr>
  
  <tr>
    <td width="413" height="10">Special Discount ('.$discount_rate1.' %)* :</td>
    <td width="177" align="center">'.$unit.'&nbsp;'.number_format($discount_value).'*</td>
  </tr>
</table>


<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>&nbsp;<br /></tr>
  
  <tr>
    <td width="413" height="10">General Sales Tax ('.$tax_rate.' %)* :</td>
    <td width="177" align="center">'.$unit.'&nbsp;'.number_format($tax_value).'*</td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td height="10" width="660" align="left">'.$line.'</td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>&nbsp;<br /></tr>
  <tr>
    <td width="413" height="10"><h3>Total Charges :</h3></td>
    <td width="177" align="center"><h3>'.$unit.'&nbsp;'.number_format($price_with_tax).'</h3></td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">

  <tr>
    <td height="10" width="660" align="left">'.$line.'</td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>&nbsp;<br /></tr>
  
  <tr>
    <td width="413" height="10">Payment Schedule (70% Advance / 30% After Delivery)</td>
    <td width="177" align="center"><strong><span style="color:red;">Advance : '.$unit.'&nbsp;'.number_format($advance).'</span></strong><br /><span style="color:blue;">Balance : '.$unit.'&nbsp;'.number_format($balance).'</span> </td>
  </tr>
</table>


<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>&nbsp;<br /></tr>
  <tr>
    <td width="355" height="10" align="left">'.$tax_note.'</td>
    <td width="235" align="right">Generated By : <br />
      i2d Billing &amp; Accounts Department<br />
    <strong>billing@i2dtechnologies.com</strong></td>
  </tr>
  <tr>
    <td height="10" align="left"></td>
    <td align="right">&nbsp;</td>
  </tr>
</table>';







/// PART 2

$html = ''.$inv_header.'';

$html .='
'.$package_feature1.'


<!--table Ends-->
';

$html .=''.$costing.'';




// output the HTML content
$pdf->writeHTML(utf8_encode($html), true, 0, true, 0);

include_once('tcpdf_bottom_blue.php');



?>