<td colspan="2" >
<p style="text-align: right; margin:0; padding-right: 10px; font-weight: 500; line-height: 2; padding-bottom: 0px; padding-top: 0px; color: black; font-size: 25px;">
	<?php echo $this->lang->line('module');?>
</p>
<p style="text-align:center; font-size:16px;"> 
	<span style=" font-weight:800;"><?php echo $companyInfo->companyName; ?></span> <span style="font-size:10px;"><?php echo "(".$companyInfo->companyNo.")";?></span><br />
	<span style="font-size:10px;"><?php echo "GST Registration No : ".$companyInfo->gstRegisteredNo; ?></span><br />
</p>
<p style="text-align:center; font-size:10px; line-height:1.4; padding:0 0 5px; margin:0; border-bottom:1px solid #eeeeee;">
	<?php if(!empty($companyInfo->line1)): ?><span><?php echo $companyInfo->line1; ?></span><br /><?php endif; ?>
    <?php if(!empty($companyInfo->line2) || !empty($companyInfo->line3)): ?><span><?php echo $companyInfo->line2.", ".$companyInfo->line3; ?></span><br /><?php endif; ?>
    <?php if(!empty($companyInfo->companyPostCode) || !empty($companyInfo->city)): ?><span><?php echo $companyInfo->companyPostCode . '  ' . $companyInfo->city; ?> </span><br /><?php endif; ?>
    <?php if(!empty($companyInfo->fldname) || !empty($companyInfo->fldcountry)): ?><span><?php echo $companyInfo->fldname . '  ' . $companyInfo->fldcountry; ?> </span><br /><?php endif; ?>
    <?php if(!empty($companyInfo->phoneNo) || !empty($companyInfo->faxNo)): ?><span><?php echo 'Phone : ' . $companyInfo->phoneNo . '  Fax : ' . $companyInfo->faxNo; ?> </span><?php endif; ?>
</p>
                            </td>
<table border="0" cellpadding="1" cellspacing="0" width="100%">
        <tr>
            <td align="right" colspan="9"><b><?php echo $this->lang->line('as').":"." ".date('d-m-Y'); ?></b></td>
        </tr>
        <tr>
        	<td></td>
        	<td></td>
            <td></td>
            <td></td>
        	<td></td>
        	<td></td>
            <td></td>
            <td></td>
            <td>&nbsp;</td>
        </tr>
        <tr>
        	<td colspan="9"><b><?php echo $this->lang->line('taxablePeriod').":"." ".date('d-m-Y', strtotime($startDateFrom))." ".$this->lang->line('to')." ".date('t-m-Y', strtotime($startDateTo)) ?></b></td>
        </tr>
        <tr>
        	<td></td>
        	<td></td>
            <td></td>
            <td></td>
        	<td></td>
        	<td></td>
            <td></td>
            <td></td>
            <td>&nbsp;</td>
        </tr>
</table>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery/jquery-2.0.0.min.js"></script>
        <script type="text/javascript">
			$(window).load(function(){      
				$(window).resize();
			});
        	$(window).resize(function(){ 
				if($('.image').length){
					$('.image').width($('.image').parents('thead').width());
					$('.image').height($('.image').parents('thead').find('tr:nth-child(2)').height());
				}
			});
        </script>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" style="">
						<?php
						$count = 0;
                        echo "<div class='content np table-sorting'>
                            <table cellpadding='0' cellspacing='0' width='100%' id='test' class='editable' style='position:relative;'>
                                <thead  class=\"thPrint\">
                                <tr>
                                    <th class='tac'>No.</th>
                                    <th class='tac'>".$this->lang->line('itemDesc')."</th>";
									for($i=0; $i<$periodDiff; $i++){
										if($periodDiff > 1){
												if($i == 0){	
													if(date("M", strtotime($i." months", strtotime($startDateFrom))) == "Dec"){
														echo "<th class='tac'>".date("M", strtotime($i." months", strtotime($startDateFrom)))."'".date("y", strtotime($count." years", strtotime($startDateFrom)))."</th>";
														//$count = 0;
														$count ++;
													}
													else{
														echo "<th class='tac'>".date("M", strtotime($i." months", strtotime($startDateFrom)))."'".date("y", strtotime($count." years", strtotime($startDateFrom)))."</th>";
													}
												}
												else{
													if(date("M", strtotime($i." months", strtotime($startDateFrom))) == "Dec"){
														echo "<th class='tac'>".date("M", strtotime($i." months", strtotime($startDateFrom)))."'".date("y", strtotime($count." years", strtotime($startDateFrom)))."</th>";
														$count ++;
													}
													else{
														echo "<th class='tac'>".date("M", strtotime($i." months", strtotime($startDateFrom)))."'".date("y", strtotime($count." years", strtotime($startDateFrom)))."</th>";
													}
												}
										}
										else{
											echo "<th class='tac'>".date("M", strtotime($startDateFrom))."'".date("y", strtotime($count." years", strtotime($startDateFrom)))."</th>";
										}
									}
									echo "<th class='tac'>".$this->lang->line('total')."</th>";
                                "</tr>
                                </thead>
								<tbody>";
								foreach($datatbls as $datatbl):
                                echo"<tr style=\"height:20px;\">
									<td class='tac'>5</td>
									<td>".$this->lang->line('outputTax')."</td>";
									foreach ($datatbl as $col => $val) {
										if (strtoupper(substr($col,0,8))=='MONTHB5A'){
											echo '<td></td>';
										}
									}
									echo"<td></td>
								</tr>";
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'></td>
									<td>".$this->lang->line('5a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHB5A'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'></td>
									<td>".$this->lang->line('5b')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHB5B'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								foreach($datatbls as $datatbl):
								echo"<tr style=\"height:20px;\">
									<td class='tac' height='10'></td>
									<td></td>";
									foreach ($datatbl as $col => $val) {
										if (strtoupper(substr($col,0,8))=='MONTHB6A'){
											echo '<td></td>';
										}
									}
									echo"<td></td>
								</tr>";
								endforeach;
								
								foreach($datatbls as $datatbl):
								echo"<tr style=\"height:20px;\">
									<td class='tac'>6</td>
									<td>".$this->lang->line('inputTax')."</td>";
									foreach ($datatbl as $col => $val) {
										if (strtoupper(substr($col,0,8))=='MONTHB6A'){
											echo '<td></td>';
										}
									}
									echo"<td></td>
								</tr>";
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'></td>
									<td>".$this->lang->line('6a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHB6A'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'></td>
									<td>".$this->lang->line('6b')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHB6B'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								foreach($datatbls as $datatbl):
								echo"<tr style=\"height:20px;\">
									<td class='tac' height='10'></td>
									<td></td>";
									foreach ($datatbl as $col => $val) {
										if (strtoupper(substr($col,0,7))=='MONTHB7'){
											echo '<td></td>';
										}
									}
									echo"<td></td>
								</tr>";
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>7</td>
									<td>".$this->lang->line('7a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,7))=='MONTHB7'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>8</td>
									<td>".$this->lang->line('8a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,7))=='MONTHB8'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								foreach($datatbls as $datatbl):
								echo"<tr style=\"height:20px;\">
									<td class='tac' height='10'></td>
									<td></td>";
									foreach ($datatbl as $col => $val) {
										if (strtoupper(substr($col,0,8))=='MONTHC10'){
											echo '<td></td>';
										}
									}
									echo"<td></td>
								</tr>";
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>10</td>
									<td>".$this->lang->line('10a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC10'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>11</td>
									<td>".$this->lang->line('11a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC11'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>12</td>
									<td>".$this->lang->line('12a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC12'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>13</td>
									<td>".$this->lang->line('13a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC13'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>14</td>
									<td>".$this->lang->line('14a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC14'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>15</td>
									<td>".$this->lang->line('15a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC15'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>16</td>
									<td>".$this->lang->line('16a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC16'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>17</td>
									<td>".$this->lang->line('17a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC17'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								$bil = 0;
								$totCol = array();
								foreach($datatbls as $datatbl):
								$bil++;
								echo"<tr style=\"height:20px;\">
									<td class='tac'>18</td>
									<td>".$this->lang->line('18a')."</td>";
									$total = 0;
									$i = 0;
									foreach ($datatbl as $col => $val) {
												if (strtoupper(substr($col,0,8))=='MONTHC18'){
													echo '<td align="right">'.number_format($val, 2, '.', ',').'</td>';
													$total += $val;
													if($bil == 1)
														$totCol[] += $val;
													else
														$totCol[$i] += $val;	
													$i++;
												}
											}
									echo '<td align="right"><b>'.number_format($total, 2, '.', ',').'</b></td>
								</tr>';
								endforeach;
								
								echo"</tbody>";        
                            echo"</table>
                        </div><!-- content -->";  ?>
            
            
	</table>