<?php

/* 
 * Author       : Jai K
 * Purpose      : View for Print Format 3 (Hall Booking, Wedding Hall Booking)
 * Created On   : 2016-09-20 18:14
 */
//$name = explode(',', is_array( $name ) ? $name[0] : $name);
$is_wedding = count( $data['proof'] ) == 3  ? TRUE : FALSE;
$name = $data['name'];
?>                             <?php if ($is_wedding) : ?> <tr height="20"></tr> <?php endif;?>
                                <tr>
                                    <td width="18%" class="lbl">Contact Person<div class="sub-lbl">தொடர்பு நபர்</div></td>
                                    <td width="1%">:</td>
                                    <td width="36%" style="border-bottom:2px dotted #000;"><?php echo $name[0]; ?></td>
                                    <td width="18%" class="lbl">Contact Number<div class="sub-lbl">தொடர்பு எண்</div></td>
                                    <td width="1%">:</td>
                                    <td width="26%" style="border-bottom:2px dotted #000;"><?php echo $data['contact_no']; ?></td>
                                </tr>
                                
                                <?php if( $is_wedding ) : ?>
                                    <tr height="20"></tr>
                                    <tr>
                                        <td class="lbl">Groom's Name<div class="sub-lbl">மணமகன்  பெயர்</div></td>
                                        <td>:</td>
                                        <td style="border-bottom:2px dotted #000;"><?php echo $name[1]; ?></td>
                                        <td class="lbl">Bride's Name<div class="sub-lbl">மணப்பெண்  பெயர்</div></td>
                                        <td>:</td>
                                        <td style="border-bottom:2px dotted #000;"><?php echo $name[2]; ?></td>
                                    </tr>
                                <?php endif; ?>
                                    
                                <?php echo ($is_wedding) ?  '<tr height="20"></tr>' : '<tr height="5"></tr>';?>
                                <tr>
                                    <td class="lbl"><?php echo $is_wedding ? 'Wedding' : 'Event'; ?> Date<div class="sub-lbl"><?php echo $is_wedding ? 'திருமண' : 'நிகழ்ச்சி'; ?>  தேதி</div></td>
                                    <td>:</td>
                                    <td style="border-bottom:2px dotted #000;"><?php echo $data['date']; ?></td>
                                    <td class="lbl"><?php echo $is_wedding ? 'Wedding' : 'Event'; ?> Time<div class="sub-lbl"><?php echo $is_wedding ? 'திருமண' : 'நிகழ்ச்சி'; ?>  நேரம்</div></div></td>
                                    <td>:</td>
                                    <td style="border-bottom:2px dotted #000;"><?php echo $data['time']; ?></td>
                                </tr>
                                <?php echo ($is_wedding) ?  '<tr height="20"></tr>' : '<tr height="5"></tr>';?>
                                <tr>
                                    <td class="lbl">Email ID<div class="sub-lbl">மின்னஞ்சல்</div></td>
                                    <td>:</td>
                                    <td style="border-bottom:2px dotted #000;"><?php echo $data['email']; ?></td>
                                    <td class="lbl">Period<div class="sub-lbl">காலம்</div></td>
                                    <td>:</td>
                                    <td style="border-bottom:2px dotted #000;"><?php echo $data['period']; ?></td>
                                </tr>
                                
                                <?php if( !$is_wedding ) : ?>
                                    <tr height="5"></tr>
                                    <tr>
                                        <td class="lbl">Event Type<div class="sub-lbl">நிகழ்ச்சி வகை</div></td>
                                        <td>:</td>
                                        <td colspan="4" style="border-bottom:2px dotted #000;"><?php echo $data['event_type']; ?></td>
                                    </tr>
                                <?php endif; ?>
                                    
                                <?php echo ($is_wedding) ?  '<tr height="20"></tr>' : '<tr height="5"></tr>';?>
                                <tr>
                                    <td class="lbl">Address<div class="sub-lbl">முகவரி</div></td>
                                    <td>:</td>
                                    <td colspan="4" style="border-bottom:2px dotted #000;"><?php echo $data['address']; ?></td>
                                </tr>
                                <?php echo ($is_wedding) ?  '<tr height="20"></tr>' : '<tr height="5"></tr>';?>
                                <tr>
                                    <td class="lbl">Description<div class="sub-lbl">விவரம்</div></td>
                                    <td>:</td>
                                    <td colspan="4" style="border-bottom:2px dotted #000;"><?php echo $data['desc']; ?></td>
                                </tr>
                                <?php echo ($is_wedding) ?  '<tr height="20"></tr>' : '<tr height="5"></tr>';?>
                            </table>
                        </td>
                    </tr>
                </table>
                
                <?php if( $is_wedding ) : ?>
                    <table width="<?php echo WIDTH; ?>" border="1" style="border-collapse:collapse;" cellpadding="5">
                        <tr>
                            <th colspan="8" style="border:0px;" align="left">Documents Verified<span class="linear-lbl"> / சரிபார்க்கப்பட்ட ஆவணங்கள் </span></th>
                        </tr>
                        <tr>
                            <td colspan="8" height="15" style="border:0px;"></td>
                        </tr>
                        <tr>
                            <td width="5%" style="border:0px;" align="center"><input type="checkbox" <?php echo !empty( $data['proof'][0] ) ? 'checked' : ''; ?>/></td>
                            <td width="20%" style="border:0px; font-weight:bold;" align="left">Groom ID Proof<div class="sub-lbl">மணமகன் அடையாள அட்டை</div></td>
                            
                            <td width="10%" style="border:0px;">&nbsp;</td>
                            <td width="5%" style="border:0px;" align="center"><input type="checkbox" <?php echo !empty( $data['proof'][1] ) ? 'checked' : ''; ?>/></td>
                            <td width="20%" style="border:0px; font-weight:bold;">Bride ID Proof<div class="sub-lbl">மணப்பெண்  அடையாள அட்டை</div></td>
                            
                            <td width="10%" style="border:0px;">&nbsp;</td>
                            <td width="5%" style="border:0px;" align="center"><input type="checkbox" <?php echo !empty( $data['proof'][2] ) ? 'checked' : ''; ?>/></td>
                            <td width="20%" style="border:0px; font-weight:bold;" align="left">Wedding Invitation<div class="sub-lbl">திருமண அழைப்பிதழ்</div></td>
                            
                        </tr>
                        <tr>
                            <td colspan="8" height="20" style="border:0px;"></td>
                        </tr>
                    </table>
                <?php endif; ?>
                
                <table width="<?php echo WIDTH; ?>" border="0">
                    <tr>
                    	<?php echo ($is_wedding) ?  '<td colspan="5" height="25"></td>' : '<td colspan="5" height="20"></td>';?>
                    </tr>
                    <tr>
                        <td style="font-weight:bold;" width="40%">Total Amount / <span class="sub-lbl">மொத்த தொகை</span></td>
                        <td width="10%">: $<?php echo number_format($amount[0],2,'.',''); ?></td>
                        <td width="10%"></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 class="auto-adj">
                    	<?php echo ($is_wedding) ?  '<td colspan="4" height="20" style="border:0px;"></td>' : '<td colspan="4" height="10" style="border:0px;"></td>';?>
                    </tr>
                    <tr>
                        <td style="font-weight:bold;" width="40%">Balance to be pay / <span class="sub-lbl">மீதமுள்ள தொகை</span></td>
                        <td width="10%">: $<?php echo !empty( $amount[3] ) ? number_format($amount[3],2,'.','') : number_format(($amount[0]-$amount[1]), 2, '.', ''); ?></td>
                        <td width="10%"></td>
                        <!--<td style="font-weight:bold;" width="30%">Paid Amount / <span class="sub-lbl">செலுத்திய தொகை</span></td>
                        <td >: $<?php #echo $amount[2]; ?></td>-->
                        <td style="font-weight:bold;" width="30%"></td>
                        <td ></td>
                    </tr>
                    <tr  class="auto-adj">
                        <?php echo ($is_wedding) ?  '<td colspan="5" height="20" style="border:0px;"></td>' : '<td colspan="5" height="5" style="border:0px;"></td>';?>
                    </tr>
                </table>
                <table width="<?php echo WIDTH; ?>">
                    <tr>
                        <td>
                            <table border="0" width="100%">
                                <tr>
                                    <td colspan="2" style="font-weight:bold;">S$ <?php echo number_format($amount[2],2,'.',''); ?>/- <?php echo ($gst == 1 ? '<span style="font-size: 12px; color: #999;">(Inclusive of GST)</span>' : '')  . $pay_mode_str;?></td>
                                </tr>
                                <?php echo ($is_wedding) ?  '<tr height="20" class="auto-adj"></tr>' : '<tr height="5" class="auto-adj"></tr>';?>
                                <tr>
                                    <td style="font-weight:bold;" width="20%">Amount in Words (S$)</td>
                                    <td width="80%">: <?php echo convert_amount_to_word( $amount[2] ); ?></td>
                                </tr>
                                <?php echo ($is_wedding) ?  '<tr height="40"></tr>' : '<tr height="50"></tr>';?>