<?php
/* 
 * Author       : Jai K
 * Purpose      : Main Header for Print
 * Created On   : 2016-09-20 18:16
 */
$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="2" 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="4" style="font-weight:bold; font-size:13px; font-family:Amudham; font-size:28px; 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: 115px;">
							<!--<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.holytreebalasubramaniar.com.sg' ); ?></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:18px;"> <?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>
                                            <td>&nbsp;</td>
                                        </tr> -->
                                    </table>
                                <?php } ?>
                            </td>
                        </tr>
                    <?php endif; ?>    
                    
                </table>
				
				<?php if( $type=='11' ){ $hght = "600"; } else if($type=='10'){ $hght = "580"; }
				else if($type=='1' or $type=='13' or $type=='14' or $type=='15' or $type=='16' or $type=='17') { $hght= "470"; } // else if( ){ $hght= "510"; } //430
				else if($type=='12'){ $hght = "430"; } else if($type=='9'){ $hght = "570"; }?>
				
                <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>
                                
                                
