<?php
$today = (!empty($created_on)) ? date("d/m/Y",strtotime($created_on)) : date("d/m/Y");
$tel_html = ( !empty( $settings['contact_no'] ) ? 'Tel: '.$settings['contact_no'] : '' ).'&nbsp;&nbsp;'. (!empty( $settings['fax'] ) ? 'Fax: '.$settings['fax'] : '');

?>
    <div class="page" style="<?php echo $status == "2" || IS_DEMO ? 'background: url('. BASE_URL .'assets/images/watermark'. ( IS_SHORT ? '-short' : '' ) . ( IS_DEMO ? '-demo' : '' ) .'.png) no-repeat center;' : ''; ?>" >
	<table width="<?php echo WIDTH; ?>" border="0" style="<?php echo IS_SHORT ? 'font-size:12px;' . ( $type != 5 ? ' border-bottom: 1px solid #999; ' : '' ) : 'font-size:14px;font-weight:bold;'; ?> font-family:Verdana, Geneva, sans-serif;">
        <tr>
            <td>
                <table width="<?php echo WIDTH; ?>">
                    
                    <?php if( IS_SHORT ) : ?>
                      <tr>
                            <td width="37.5%"></td>
                            <td width="37.5%"></td>
                            <td width="15%"></td>
                            <td width="10%"></td>
                        </tr>
                        
               
                        
                        <tr>
                                <td colspan="4" style="font-weight:bold; font-size:13px; font-family:Amudham; font-size:25px; text-shadow: 1px 0px #000;" align="center"><strong><?php echo $settings['tamil_name']; ?></strong></td>
                        </tr>
                        <tr>
                                <td colspan="4" style="font-weight:bold; text-transform:uppercase;" align="center"><?php echo $settings['temple_name']; ?></td>
                        </tr>
                        <?php     
                        /*
                        <tr>
                                <td colspan="4" align="center"><?php echo nl2br($settings['address']); ?></td>
                        </tr>
                        <tr>
                                <td colspan="4" align="center"><?php echo $tel_html; ?></td>
                        </tr>*/
                        
                        if( !empty( $title ) ) : 
                        ?>
                            
                            <tr>
                                <td colspan="4" style="font-weight:bold; text-transform:uppercase;" align="center"><?php echo $title; ?></td>
                            </tr>
                        <?php 
                        endif;
                        
                    else:
                        
                        // Large
                        $logo_url = !empty( $settings['logo'] ) && file_exists( DIR_COMPANY_LOGO . $settings['logo'] ) ?  DIR_COMPANY_LOGO . $settings['logo'] : 'assets/images/logo.png';
                    ?>    
                        <tr>
                            <td width="5%"><div style="min-width: 200px;">
							<img src="<?php  echo BASE_URL.$logo_url; ?>" style="max-width: 100%;" /> 
							</div></td>
                            <td width="70%">
                                <table border="0" width="100%">
                                    <tr>
                                        <td align="center">
										<strong><?php echo tamil($settings['tamil_name'], 'font-weight:bold; font-family:Amudham; font-size:25px; text-shadow: 1px 0px #000; border: none; width: 100%; text-align: center;'); ?></strong> 
										
										</td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="font-size:18px;">
										<?php  echo $settings['temple_name']; ?></td>
                                    </tr>
                                    <tr>
                                        <td align="center"><?php  echo nl2br($settings['address']); ?></td>
                                    </tr>
                                    <tr>
                                        <td align="center"><?php  echo $tel_html; ?></td>
                                    </tr>

                                    <?php  if( !empty( $settings['contact_email'] ) ) : ?>
                                        <tr>
                                            <td align="center"><?php  echo $settings['contact_email'] . ( !empty( $settings['website_url'] ) ? ' | ' . $settings['website_url'] : ' | www.srivkt.org' ); ?></td>
                                        </tr>
                                    <?php  endif; #if( !empty( $settings['website_url'] ) ) : ?>
                                        <!--<tr>
                                            <td align="center"><?php // echo $settings['website_url']; ?></td>
                                        </tr>-->
                                    <?php #endif; ?>
                                </table>
                           </td>


                           <td width="20%">
                                <?php if(!IS_KSK_CMS) {  ?>
                                    <table border="0" width="100%">
                                        <?php if(!empty($rec_no)) : ?>
                                        <tr>
                                            <td align="left" valign="middle"> <strong>Receipt No: <span style="font-weight:bold; font-size:20px;"> <?php echo $rec_no; ?> </span></strong></td>
                                        </tr>
                                        <tr height="5"></tr>

                                        <?php endif; // if( $is_copy ): ?>
                                        <!-- <tr>
                                            <td align="left" valign="middle" data-copy="Official's copy">Devotee's Copy</td>
                                        </tr>
                                        <tr height="5"></tr> -->
                                        <?php // endif; ?>

                                        <!--<tr>
                                            <td align="left" valign="middle" style="font-family:Amudham; font-size:15px;"><strong>தேதி</strong><span style="font-family:Verdana, Geneva, sans-serif; font-size:14px;">: <?php echo $today; ?></span></td>
                                        </tr>
                                        <tr height="5"></tr>-->
                                        <tr>
                                            <td align="left" valign="middle"><strong>Date: <span style="font-weight:bold; font-size:15px;"><?php echo $today; ?></strong></span></td>
                                        </tr>
										
										<tr height="5"></tr>
										
										<tr>
                                            <td align="left" valign="middle" style="white-space: nowrap;"><strong>GST Reg No: <span style="font-weight:bold; font-size:15px;">M90373384T</strong></span></td>
                                        </tr>
                                        <!-- <tr>
                                            <td>&nbsp;</td>
                                        </tr> -->
                                    </table>
                                <?php } ?>
                            </td>
                        </tr>
                    <?php endif; ?>    
                    
                </table>
				
				
				<?php if( $type=='11' ){ $hght = "600"; } else if($type=='10'){ $hght = "480"; } //560
				else if( $type=='13' or  $type=='15' or $type=='16' ) { $hght= "440"; } else if( $type=='1'){ $hght= "380"; } //430
				else if($type=='12'){ $hght = "430"; } else if($type=='9'){ $hght = "570"; } else if($type=='14' or $type=='17'){ $hght= "440"; }?>
				
                <table width="<?php echo WIDTH; ?>" height="<?php echo $hght; ?>" >
                    <tr style="vertical-align:top">
                        <td>
                            <table border="0" width="100%" cellpadding="5">
                                <?php if(!IS_SHORT) : ?>
                                <tr height="20" ><td></td></tr>  <!--class="auto-adj"-->
                                <tr>
                                    <td align="center" colspan="7" style="font-weight:bold; font-size:18px;"><?php echo $title; ?></td>
                                </tr>
                                <?php endif; ?>
                                <tr height="5"></tr>
                                
                                



<?php

/* 
 * Author       : Jai K
 * Purpose      : View for Print Format 1
 * Created On   : 2016-09-20 18:14
 */

// [mm] 210 x 297
// [px] 793.70 x 1122.52 (OR 1480)

// [mm] 148.5 x 210
// [px] 561.25 x 793.70

//$name = explode(',', is_array( $name ) ? $name[0] : $name);

// Name     => பெயர்
//  Tamil   => தமிழ்
// Conat    => தொடர்பு எண்
// Email    => மின்னஞ்சல்
// Address  => முகவரி
// Desc     => விவரம்

// Total    => மொத்த 
// Days     => நாட்கள்  // Natgal
// Weeks    => வாரம்

// Date     => தேதி     // Thethi
// Day      => நாள்  // Naal

// God      => கடவுள்
// Serial   => வரிசை

// Star     => நட்சத்திரம்
// Period   => காலம்
// Event    => நிகழ்ச்சி
// Type     => வகை
// Prasadam => பிரசாதம்
// Number   => எண்ணிக்கை
// Amt     => தொகை

$names = $data['name'];
$amount = !is_array($amount) ? array($amount) : $amount;
                 #echo $gst . '<pre>';print_r($data);die;
                foreach( $names as $n => $name ) :
                    $e = explode(",", $name);
                    if( empty( $e[0] ) ) :
                        continue;
                    endif;
                    
                    $incl_star = count($e) <= 2 ? FALSE : TRUE;
                    $e[1] = !$incl_star && !empty($e[1]) ? tamil($e[1], 'border: none; font-weight: bolder; font-size: 22px;') : $e[1]; 
                ?>
                    <tr>
                        <?php
                        if( $n == 0 ) :
                        ?>
                            <td class="lbl" width="18%">Name<?php echo $incl_star ? ' / Star' : ''; ?><div class="sub-lbl">பெயர்  <?php echo $incl_star ? ' / நட்சத்திரம்' : ''; ?></div></td>
                            <td width="1%">:</td>
                        <?php else : ?>
                            <td colspan="2">&nbsp;</td>
                        <?php endif; ?>
                            <td colspan="5" style="border-bottom:2px dotted #000;"><?php echo $e[0] . ( !empty( $e[1] ) ? $sepr . $e[1] : '') . ( !empty( $e[2] ) ? ' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="font-family: amudham;font-weight: bolder;font-size: 24px;">' . $e[2] . '</span>' . ( !empty($e[3]) ? $sepr . '<span style="color: #999;">'.$e[3].'</span>' : '' ) : ''  ); ?></td>
                    </tr>
                  <!--  <tr height="15"></tr>  -->
                <?php
                endforeach; 
                ?>
                
                
                <tr>
                    <td class="lbl">Contact No / Email<div class="sub-lbl">தொடர்பு எண் / மின்னஞ்சல்</div></td>
                    <td >:</td>
                    <td colspan="5" style="border-bottom:2px dotted #000;" colspan="4"><?php echo $data['contact_no'] . ( !empty($data['email']) ? $sepr.$data['email'] : '' ); ?></td>
                </tr>
                <tr height="15"></tr>
                <?php 
                    if( !empty($data['section']) ) : 
                        
                        foreach( $data['section'] as $ss => $vv ) :
                            $i = 0;
                            $splt = 2;
                            if( !is_array($vv) ) :
                                $splt = 1;
                                $vv = array($ss => $vv);
                            endif;
                            ?>
                            <tr>
                                <?php
                                $len = count($vv);
                                foreach( $vv as $s => $v ) :
                                    ?>
                                        <td class="lbl" width="24%" <?php echo $i % $splt != 0 ? 'align="right"' : '' ?> ><?php echo $s; ?></td>
                                        <td>:</td>
                                        <td width="24%" style="border-bottom:2px dotted #000;" colspan="<?php echo $splt == '1' ? 7 : 1; ?>"><?php echo $v; ?></td>
                                    <?php 
                                    echo ++$i % $splt == 0 ? (($i == $len) ? '</tr>' : '</tr><tr height="5"></tr><tr height="10" class="auto-adj"></tr><tr>') : '<td width="3%">&nbsp;</td>'; 
                                    
                                endforeach;
                                ?>
                            </tr>
							
							<!--<tr height="5"></tr> --> <!--<tr height="10" class="auto-adj"></tr>--> 
                            <?php
                        endforeach; 
                            
                    endif; 
                ?>
                
                <tr>
                    <td class="lbl">Address<div class="sub-lbl">முகவரி</div></td>
                    <td>:</td>
                    <td style="border-bottom:2px dotted #000;" colspan="5"><?php echo $data['address']; ?></td>
                </tr>
                <tr height="15"></tr>
                <tr>
                    <td class="lbl">Description<div class="sub-lbl">விவரம்</div></td>
                    <td>:</td>
                    <td style="border-bottom:2px dotted #000;" colspan="5"><?php echo $data['desc']; ?></td>
                </tr>
               <!-- <tr height="10"></tr>
                <tr height="5" class="auto-adj"></tr> -->
            </table>
        </td>
    </tr>
</table>
<table width="<?php echo WIDTH; ?>" >
    <tr>
        <td>
            <table border="0" width="100%">
                <?php if(!empty($amount[0]) ) :  
                    
                        if( !empty( $amount[1] ) ) :  ?>
                        <tr>
                            <td style="font-weight:bold;" width="40%">Total Pledge Amount / <span class="sub-lbl">மொத்த உறுதி தொகை</span></td>
                            <td width="10%">: $<?php echo number_format($amount[0],2,'.',''); ?></td>
                            <td style="font-weight:bold;" width="30%">Paid Amount / <span class="sub-lbl">செலுத்திய தொகை</span></td>
                            <td >: $<?php echo number_format($amount[1],2,'.',''); ?></td>
                        </tr>
                        <tr>
                            <td style="font-weight:bold;" width="40%">Balance to be pay / <span class="sub-lbl">மீதமுள்ள தொகை</span></td>
                            <td >: $<?php echo !empty( $amount[3] ) ? number_format($amount[3],2,'.','') : number_format(($amount[0]-$amount[1]), 2, '.', ''); ?></td>
                        </tr>
						<tr colspan="5" height="15"></tr>
                        <!--<tr>
                            <td colspan="5" height="15" class="auto-adj"></td>
                        </tr>
                        <tr colspan="5" height="5"></tr> -->
                    <?php endif; ?>


                    <tr>
                        <td colspan="2" style="font-weight:bold;font-size:18px;">S$ <?php echo !empty( $amount[1] ) ? number_format($amount[2],2,'.','') : number_format($amount[0],2,'.',''); ?>/- <?php echo ($gst == 1 ? '<span style="font-size: 12px; color: #000; font-weight:bold;"></span>' : '') . $pay_mode_str;?></td>
                    </tr>
                   <!-- <tr height="5" class="auto-adj"></tr> -->
                    <tr>
                        <td width="20%" colspan="5"><span style="font-weight:bold;">Amount in Words (S$) :</span> &nbsp;<?php echo convert_amount_to_word( !empty( $amount[1] ) ? $amount[2] : $amount[0] ); ?><!--<span style="float:right;">Devotee's Copy</span>--></td>
                    </tr>
                   <!-- <tr height="20"></tr> 
                    <tr height="5" class="auto-adj"></tr> -->
                <?php endif; 
				?>
				
				<table><tr><td height="100px;">&nbsp;</td></tr></table>
				
			<?php

//$today = date("d/m/Y");
$tel_html = ( !empty( $settings['contact_no'] ) ? 'Tel: '.$settings['contact_no'] : '' ).'&nbsp;&nbsp;'. (!empty( $settings['fax'] ) ? 'Fax: '.$settings['fax'] : '');

?>
    <div class="page" style="<?php echo $status == "2" || IS_DEMO ? 'background: url('. BASE_URL .'assets/images/watermark'. ( IS_SHORT ? '-short' : '' ) . ( IS_DEMO ? '-demo' : '' ) .'.png) no-repeat center;' : ''; ?>" >
	<table width="<?php echo WIDTH; ?>" border="0" style="<?php echo IS_SHORT ? 'font-size:12px;' . ( $type != 5 ? ' border-bottom: 1px solid #999; ' : '' ) : 'font-size:14px;font-weight:bold;'; ?> font-family:Verdana, Geneva, sans-serif;">
        <tr>
            <td>
                <table width="<?php echo WIDTH; ?>">
                    
                    <?php if( IS_SHORT ) : ?>
                        <tr>
                            <td width="37.5%"></td>
                            <td width="37.5%"></td>
                            <td width="15%"></td>
                            <td width="10%"></td>
                        </tr>
                        
                        <tr>
                            <td colspan="2" width="75%"><?php echo !empty( $rec_no ) ? 'No: <strong>' . (is_array( $rec_no ) ? $rec_no[0] : $rec_no) . '</strong>' : '&nbsp;'; ?></td>
                            <td width="15%" rowspan="3" style="font-size:24px;" align="right"><?php echo $total_qty; ?></td>
                            <td width="10%">&nbsp;</td>
                        </tr>
                    
                        <tr>
                            <td colspan="2">Date: <strong><?php echo $today.($type != '5' ? ' '.date("h:i A") : ''); ?></strong></td>
                            <td>&nbsp;</td>
                        </tr>
						
						<tr>
                            <td colspan="2">GST Reg No: <strong>M90373384T</strong></td>
                            <td>&nbsp;</td>
                        </tr>
                        
                        <tr>
                                <td colspan="4" style="font-weight:bold; font-size:13px; font-family:Amudham; font-size:25px; text-shadow: 1px 0px #000;" align="center"><strong><?php echo $settings['tamil_name']; ?></strong></td>
                        </tr>
                        <tr>
                                <td colspan="4" style="font-weight:bold; text-transform:uppercase;" align="center"><?php echo $settings['temple_name']; ?></td>
                        </tr>
                        <?php     
                        /*
                        <tr>
                                <td colspan="4" align="center"><?php echo nl2br($settings['address']); ?></td>
                        </tr>
                        <tr>
                                <td colspan="4" align="center"><?php echo $tel_html; ?></td>
                        </tr>*/
                        
                        if( !empty( $title ) ) : 
                        ?>
                            
                            <tr>
                                <td colspan="4" style="font-weight:bold; text-transform:uppercase;" align="center"><?php echo $title; ?></td>
                            </tr>
                        <?php 
                        endif;
                        
                    else:
                        
                        // Large
                        $logo_url = !empty( $settings['logo'] ) && file_exists( DIR_COMPANY_LOGO . $settings['logo'] ) ?  DIR_COMPANY_LOGO . $settings['logo'] : 'assets/images/logo.png';
                    ?>    
                        <tr>
                            <td width="5%"><div style="min-width: 200px;">
							<img src="<?php echo BASE_URL.$logo_url; ?>" style="max-width: 100%;" />
							</div></td>
                            <td width="70%">
                                <table border="0" width="100%">
                                    <tr>
                                        <td align="center">
										<strong><?php echo tamil($settings['tamil_name'], 'font-weight:bold; font-family:Amudham; font-size:25px; text-shadow: 1px 0px #000; border: none; width: 100%; text-align: center;'); ?></strong> 
										
										</td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="font-size:18px;">
										<?php echo $settings['temple_name']; ?></td>
                                    </tr>
                                    <tr>
                                        <td align="center"><?php  echo nl2br($settings['address']); ?></td>
                                    </tr>
                                    <tr>
                                        <td align="center"><?php echo $tel_html; ?></td>
                                    </tr>

                                    <?php if( !empty( $settings['contact_email'] ) ) : ?>
                                        <tr>
                                            <td align="center"><?php  echo $settings['contact_email'] . ( !empty( $settings['website_url'] ) ? ' | ' . $settings['website_url'] : ' | www.srivkt.org' ); ?></td>
                                        </tr>
                                    <?php  endif; #if( !empty( $settings['website_url'] ) ) : ?>
                                        <!--<tr>
                                            <td align="center"><?php // echo $settings['website_url']; ?></td>
                                        </tr>-->
                                    <?php #endif; ?>
                                </table>
                           </td>


                           <td width="20%">
                                <?php if(!IS_KSK_CMS) {  ?>
                                    <table border="0" width="100%">
                                        <?php if(!empty($rec_no)) : ?>
                                        <tr>
                                            <td align="left" valign="middle"> <strong>Receipt No: <span style="font-weight:bold; font-size:20px;"> <?php echo $rec_no; ?> </span></strong></td>
                                        </tr>
                                        <tr height="5"></tr>

                                        <?php endif; // if( $is_copy ): ?>
                                        <!-- <tr>
                                            <td align="left" valign="middle" data-copy="Official's copy">Official's Copy</td>
                                        </tr>
                                        <tr height="5"></tr> -->
                                        <?php // endif; ?>

                                        <!--<tr>
                                            <td align="left" valign="middle" style="font-family:Amudham; font-size:15px;"><strong>தேதி</strong><span style="font-family:Verdana, Geneva, sans-serif; font-size:14px;">: <?php echo $today; ?></span></td>
                                        </tr>
                                        <tr height="5"></tr>-->
                                        <tr>
                                            <td align="left" valign="middle"><strong>Date: <span style="font-weight:bold; font-size:15px;"><?php echo $today; ?></strong></span></td>
                                        </tr>
										
										<tr height="5"></tr>
										
										<tr>
                                            <td align="left" valign="middle" style="white-space: nowrap;"><strong>GST Reg No: <span style="font-weight:bold; font-size:15px;">M90373384T</strong></span></td>
                                        </tr>
                                        <!-- <tr>
                                            <td>&nbsp;</td>
                                        </tr> -->
                                    </table>
                                <?php } ?>
                            </td>
                        </tr>
                    <?php endif; ?>    
                    
                </table>
				
				<?php if( $type=='11' ){ $hght = "600"; } else if($type=='10'){ $hght = "480"; } //560
				else if( $type=='13' or  $type=='15' or $type=='16' ) { $hght= "440"; } else if( $type=='1'){ $hght= "380"; } //430
				else if($type=='12'){ $hght = "430"; } else if($type=='9'){ $hght = "570"; } else if($type=='14' or $type=='17'){ $hght= "440"; }?>
				
                <table width="<?php echo WIDTH; ?>" height="<?php echo $hght; ?>" >
                    <tr style="vertical-align:top">
                        <td>
                            <table border="0" width="100%" cellpadding="5">
                                <?php if(!IS_SHORT) : ?>
                                <tr height="20" ><td></td></tr>  <!--class="auto-adj"-->
                                <tr>
                                    <td align="center" colspan="7" style="font-weight:bold; font-size:18px;"><?php echo $title; ?></td>
                                </tr>
                                <?php endif; ?>
                                <tr height="5"></tr>
                                
                                
				
				
				
		<?php		
			$names = $data['name'];
$amount = !is_array($amount) ? array($amount) : $amount;
                 #echo $gst . '<pre>';print_r($data);die;
                foreach( $names as $n => $name ) :
                    $e = explode(",", $name);
                    if( empty( $e[0] ) ) :
                        continue;
                    endif;
                    
                    $incl_star = count($e) <= 2 ? FALSE : TRUE;
                    $e[1] = !$incl_star && !empty($e[1]) ? tamil($e[1], 'border: none; font-weight: bolder; font-size: 22px;') : $e[1]; 
                ?>
				
				<tr>
                        <?php
                        if( $n == 0 ) :
                        ?>
                            <td class="lbl" width="18%">Name<?php echo $incl_star ? ' / Star' : ''; ?><div class="sub-lbl">பெயர்  <?php echo $incl_star ? ' / நட்சத்திரம்' : ''; ?></div></td>
                            <td width="1%">:</td>
                        <?php else : ?>
                            <td colspan="2">&nbsp;</td>
                        <?php endif; ?>
                            <td colspan="5" style="border-bottom:2px dotted #000;"><?php echo $e[0] . ( !empty( $e[1] ) ? $sepr . $e[1] : '') . ( !empty( $e[2] ) ? ' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="font-family: amudham;font-weight: bolder;font-size: 24px;">' . $e[2] . '</span>' . ( !empty($e[3]) ? $sepr . '<span style="color: #999;">'.$e[3].'</span>' : '' ) : ''  ); ?></td>
                    </tr>
                  <!--  <tr height="15"></tr>  -->
                <?php
                endforeach; 
                ?>
                
                
                <tr>
                    <td class="lbl">Contact No / Email<div class="sub-lbl">தொடர்பு எண் / மின்னஞ்சல்</div></td>
                    <td >:</td>
                    <td colspan="5" style="border-bottom:2px dotted #000;" colspan="4"><?php echo $data['contact_no'] . ( !empty($data['email']) ? $sepr.$data['email'] : '' ); ?></td>
                </tr>
                <tr height="15"></tr>
                <?php 
                    if( !empty($data['section']) ) : 
                        
                        foreach( $data['section'] as $ss => $vv ) :
                            $i = 0;
                            $splt = 2;
                            if( !is_array($vv) ) :
                                $splt = 1;
                                $vv = array($ss => $vv);
                            endif;
                            ?>
                            <tr>
                                <?php
                                $len = count($vv);
                                foreach( $vv as $s => $v ) :
                                    ?>
                                        <td class="lbl" width="24%" <?php echo $i % $splt != 0 ? 'align="right"' : '' ?> ><?php echo $s; ?></td>
                                        <td>:</td>
                                        <td width="24%" style="border-bottom:2px dotted #000;" colspan="<?php echo $splt == '1' ? 7 : 1; ?>"><?php echo $v; ?></td>
                                    <?php 
                                    echo ++$i % $splt == 0 ? (($i == $len) ? '</tr>' : '</tr><tr height="5"></tr><tr height="10" class="auto-adj"></tr><tr>') : '<td width="3%">&nbsp;</td>'; 
                                    
                                endforeach;
                                ?>
                            </tr>
							
							<!--<tr height="5"></tr> --> <!--<tr height="10" class="auto-adj"></tr>--> 
                            <?php
                        endforeach; 
                            
                    endif; 
                ?>
                
                <tr>
                    <td class="lbl">Address<div class="sub-lbl">முகவரி</div></td>
                    <td>:</td>
                    <td style="border-bottom:2px dotted #000;" colspan="5"><?php echo $data['address']; ?></td>
                </tr>
                <tr height="15"></tr>
                <tr>
                    <td class="lbl">Description<div class="sub-lbl">விவரம்</div></td>
                    <td>:</td>
                    <td style="border-bottom:2px dotted #000;" colspan="5"><?php echo $data['desc']; ?></td>
                </tr>
               <!-- <tr height="10"></tr>
                <tr height="5" class="auto-adj"></tr> -->
            </table>
        </td>
    </tr>
</table>
<table width="<?php echo WIDTH; ?>" >
    <tr>
        <td>
            <table border="0" width="100%">
                <?php if(!empty($amount[0]) ) :  
                    
                        if( !empty( $amount[1] ) ) :  ?>
                        <tr>
                            <td style="font-weight:bold;" width="40%">Total Pledge Amount / <span class="sub-lbl">மொத்த உறுதி தொகை</span></td>
                            <td width="10%">: $<?php echo number_format($amount[0],2,'.',''); ?></td>
                            <td style="font-weight:bold;" width="30%">Paid Amount / <span class="sub-lbl">செலுத்திய தொகை</span></td>
                            <td >: $<?php echo number_format($amount[1],2,'.',''); ?></td>
                        </tr>
                        <tr>
                            <td style="font-weight:bold;" width="40%">Balance to be pay / <span class="sub-lbl">மீதமுள்ள தொகை</span></td>
                            <td >: $<?php echo !empty( $amount[3] ) ? number_format($amount[3],2,'.','') : number_format(($amount[0]-$amount[1]), 2, '.', ''); ?></td>
                        </tr>
						<tr colspan="5" height="15"></tr>
                        <!--<tr>
                            <td colspan="5" height="15" class="auto-adj"></td>
                        </tr>
                        <tr colspan="5" height="5"></tr> -->
                    <?php endif; ?>


                    <tr>
                        <td colspan="2" style="font-weight:bold;font-size:18px;">S$ <?php echo !empty( $amount[1] ) ? number_format($amount[2],2,'.','') : number_format($amount[0],2,'.',''); ?>/- <?php echo ($gst == 1 ? '<span style="font-size: 12px; color: #000; font-weight:bold;"> </span>' : '') . $pay_mode_str;?></td>
                    </tr>
                   <!-- <tr height="5" class="auto-adj"></tr> -->
                    <tr>
                        <td width="20%" colspan="5"><span style="font-weight:bold;">Amount in Words (S$) :</span> &nbsp;<?php echo convert_amount_to_word( !empty( $amount[1] ) ? $amount[2] : $amount[0] ); ?><!--<span style="float:right;">Official's Copy</span>--></td>
                    </tr>
                   <!-- <tr height="20"></tr> 
                    <tr height="5" class="auto-adj"></tr> -->
                <?php endif;  ?>