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

include_once('tcpdf_proposal_fetch_5d2.php');

require_once('tcpdf_include.php');



$file_title="5digital.pk_invoice";
$doc_title="5 Digital.pk - Branding & Animation";
$inv_title=strtoupper($invoice_title);
$doc_keywords="branding";
$doc_sub="Design Services";

$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;



$unit="PKR";

//$package_price="9500";
//$tax_value=$amount*$tax_rate1;

$inv_header='<p>&nbsp;</p><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 style="color:#bb0303;">'. $inv_title .'</h2></td>
  </tr>
  <tr>
    <td align="right"><b>Tracking / Ref: '. $ref_no .'</b><br />
Invoice Date: '. $dated1 .'<br />
<span style="color:#bb0303;">Due Date: '. $dated2 .'</span></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>
    </ul></td>
    <td width="370" align="right">'.$bank.'<br /></td>
  </tr>
</table>

';

$html .='';

$html .='<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td width="290"><ul>
      <li>'.$package_title.' <br />
        <strong>('.$package_term.')</strong></li>
      <li>Domain : <strong>'. $domain_name .'</strong></li>
    </ul></td>
    <td width="370" align="right">'. $bank .'</td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td height="10"></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>
  
   '.$features1.'
	
	</tr>
	<tr>
    <td height="10" width="660" align="left">'.$line.'</td>
  </tr>
  <tr>
    <td width="413" height="10" align="center">Special Discount :</td>
    <td width="177" align="center">'.$discount_percentage.'%</td>
  </tr>
  
</table>

';


$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"><h3>Total Charges* :</h3></td>
    <td width="177" align="center"><h3>'.$unit.'&nbsp;'.number_format($discount_price).'*</h3></td>
  </tr>
</table>

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

  
</table>


<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>&nbsp;<br /></tr>
  
  <tr>
    <td width="413" height="10" align="left"><strong></strong></td>
    <td width="177" align="center"></td>
  </tr>
</table>

<table width="660" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td width="290" height="10" align="center" bgcolor="#bb0303"><span style="color:white;"><strong>Payment Schedule</strong></span></td>
    <td width="370" align="center" bgcolor="#bb0303"><span style="color:white;"></span></td>
  </tr>
</table>

'.$phase_text.'

<table width="660" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>&nbsp;<br /><br /><br /><br /></tr>
  <tr>
    <td width="355" height="10" align="left">'.$tax_note.'</td>
    <td width="235" align="right">Generated By : <br />
      5 Digital Accounts Department<br />
    <strong>accounts@5digital.pk</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_2.php');



?>