<?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.php');

require_once('tcpdf_include.php');



$file_title="i2d_hosting_invoice";
$doc_title="i2d Technologies - Client Hosting Invoice";
$inv_title=strtoupper($invoice_title);
$doc_keywords="web hosting";
$doc_sub="Cloud Linux - Hosting Services";

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

include_once('tcpdf_bottom.php');

$domain_feature1=
'
<ul><li><strong>'.$domain_term.' </strong></li>
      <li>Digital Security Code (DSC)</li></ul>
';

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


$heading1="Subscription Name";
if($domain_price!=0){
}
else{
$domain_feature1='<span align="center">No Domain Charges</span>';	
$domain_feature2="";	
}

$domain_term=$package_term;
$domain_header_type=$domain_title;

$hosting_price=number_format($package_price);
$hosting_price_total=number_format($package_price+$domain_price);
$hosting_header_type="Package / Plan : ".$package_title;


$hosting_features1=
'
<ul>
      <li><strong>Cloud Linux '.$package_space.'</strong></li>
      <li>POP3 / IMAP Email User(s)</li>
      <li>'.$package_email.'</li>
      <li>Web Mail Manager</li>
      <li>Data Base Support</li>
      <li>Hosting Control Panel </li>
    </ul>        
';

$hosting_features2=
'
<ul>
      <li>File Manager / FTP</li>
      <li>Virus Protection</li>
      <li> Backup Manager</li>
      <li><strong>'.$package_term.'</strong></li>
      <li><strong>'.$package_support.'</strong></li>
    </ul>
';

$unit="PKR";

//$package_price="9500";
$tax_value=($package_price+$domain_price)*$tax_rate1;
$price_with_tax=$package_price+$domain_price+$tax_value;


$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>'. $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>
      <li>'.$package_title.' <br />
        <strong>'.$package_term.'</strong></li>
      <li>Domain : <strong>'.$domain_name.'</strong></li>
    </ul></td>
    <td width="370" align="right">'.$bank.'<br /></td>
  </tr>
</table>

';

//$html .=''.$package_feature0.'';
$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_feature0='<table width="660" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td width="370" height="10" align="center" bgcolor="#000000"><span style="color:white;"><strong>Hosting Plan  &amp; Domain</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>';

$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>
    <td colspan="2" bgcolor="#E6E6E6"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$domain_title.'</strong></td>
    <td width="220" align="left" bgcolor="#E6E6E6">&nbsp;</td>
  </tr>
  <tr>&nbsp;<br /></tr>
  <tr>
  
    <td width="244">'.$domain_feature1.'</td>
    <td width="194" align="left">'.$domain_feature2.'
	</td>
    <td width="198" align="default"></td>
	
	</tr>
  
</table>
<br /><br />
';

$package_feature2='
<table width="660" border="0" align="left" cellpadding="4" cellspacing="0">
  
  <tr>
    <td colspan="2" bgcolor="#E6E6E6"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$hosting_header_type.'</strong> </td>
    <td width="220" align="center" bgcolor="#E6E6E6">&nbsp;</td>
  </tr>
  <tr>&nbsp;<br /></tr>
  <tr>
    <td width="215">'.$hosting_features1.'</td>
    <td width="171">'.$hosting_features2.'</td>
    <td width="174" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$unit.'&nbsp;'.$hosting_price_total.'</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">Package Charges :</td>
    <td width="177" align="center">'.$unit.' '.number_format($package_price+$domain_price).'</td>
  </tr>
  <tr>
    <td height="10">General Sales Tax ('.$tax_rate.' %)* :</td>
    <td align="center">'.$unit.'&nbsp;'.$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="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.''.$package_feature2.'


<!--table Ends-->
';

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




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

include_once('tcpdf_bottom_2.php');



?>