<?php

/* 
 * Author       : Jai K
 * Purpose      : Main Header for Print
 * Created On   : 2016-09-20 18:16
 */
if(!empty($user_data)) {
	$user = $this->user_model->get_by_id($user_data['user_id']);
}
$today = date("d/m/Y");
$tel_html = ( !empty( $settings['contact_no'] ) ? 'Tel: '.$settings['contact_no'] : '' ).'&nbsp;&nbsp;'. (!empty( $settings['fax'] ) ? 'Fax: '.$settings['fax'] : '');

?>
   <?php if( !IS_SHORT && !$is_copy) : ?>
        <table width="<?php echo WIDTH; ?>" style="font-size:12px;">
            <tr>
                <td colspan="3" align="right">Printed On : <?php echo (!empty($user_data) ? $user->name : '') . ' - ' . date('d/m/Y H:i:s');?></td>
            </tr>
        </table>
    <?php endif;?>
    
    <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-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 height="5"></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 height="5"></tr>
                            <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:</strong> <?php echo $rec_no; ?></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 !empty($payment_date)? $payment_date : $today; ?></span></td>
                                        </tr>
                                        <tr height="5"></tr>-->
                                        <tr>
                                            <td align="left" valign="middle"><strong>Date</strong><span>: <?php echo !empty($payment_date)? $payment_date : $today; ?></span></td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                    </table>
                                <?php } ?>
                            </td>
                        </tr>
                    <?php endif; ?>    
                    
                </table>
                <table width="<?php echo WIDTH; ?>">
                    <tr>
                        <td>
                            <table border="0" width="100%" cellpadding="5">
                                <?php if(!IS_SHORT) : ?>
                                <tr height="10" class="auto-adj"></tr>
                                <tr>
                                    <td align="center" colspan="7" style="font-weight:bold; font-size:18px;"><?php echo $title; ?></td>
                                </tr>
                                <?php endif; ?>
                                <!--<tr height="5"></tr>-->
                                
                                
