<?php
    $CI =& get_instance();
    $CI->load->model('company/company_info_model');
    $company = $CI->company_info_model->companyById(element('compID', $this->session->userdata('logged_in')));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <link  rel="stylesheet" type="text/css"  href="<?php echo base_url() ?>css/bootstrap/bootstrap.min.css" />
        <?php echo put_headers(); ?>
        <style>
            @media print {
                @charset "UTF-8";
                
                .tdPrint{
                    display:none;}
				.printTbl hr{
					margin:0 !important;
				}
				.thPrint th{
					background:url(<?php echo base_url() ?>img/rptPaymentAdvice.png) !important;
                	-webkit-print-color-adjust: exact; 
				}
            }
        </style>

        <script>
			$(document).ready(function(){
				$('.image').height($('.thPrint').height());
				$('.image').width($('.thPrint').width());
			});
        
            function do_print() {
                window.print();
            }

//             function getExcelFile() {
                var url = '<?php echo base_url(); echo isset($myUrl) ? $myUrl:''; echo '/'; echo isset($id)?$id:''; ?>"';
                //var url = "<?php echo base_url() ?>ApTransactionReport/printPaymentAdviceRptExel/<?php echo isset($id)?$id:''; ?>";
//                         window.location.href = url;
//                     }
            function downloadExcel(){
				var url = "<?php echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'/'.true; ?>";
				window.location.href = url;
            }
        </script>

    </head>

    <body>
        <table  style="width:80%; margin-top:20px; margin:auto;" class="printTbl">
            <tbody>
                        <tr>
                            <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 if(isset($rptTitle)) echo $rptTitle; ?>
                                </p>
                                <?php
                                if (isset($company)) {
                                    foreach ($company as $rowC) {
                                        ?>
                                        <p style="text-align:center; font-size:16px;"> 
                                            <span style=" font-weight:800;"><?php echo $rowC->companyName; ?></span> <br />
                                            <span><?php echo $rowC->companyNo." /".$rowC->gstRegisteredNo; ?></span><br />
                                        </p>
                                        <p style="text-align:center; line-height:1.4; padding:0 0 5px; margin:0; border-bottom:1px solid #eeeeee;">

                                            <span><?php echo $rowC->line1; ?></span><br />
                                            <span><?php echo $rowC->line2; ?></span><br />
                                            <span><?php echo $rowC->line3; ?></span><br />
                                            <span><?php echo $rowC->companyPostCode . '  ' . $rowC->city; ?> </span><br />
                                            <span><?php echo 'Phone : ' . $rowC->phoneNo . '  Fax : ' . $rowC->faxNo; ?> </span>
                                            <span><?php echo $rowC->fldname . '  ' . $rowC->fldcountry; ?> </span>
                                        </p>
                                    <?php }
                                }
                                ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <?php
                                if (isset($leftContentHeader)){
                                    echo "<p style='padding-left:10px; margin:0; font-size:15px; '>"
                                    . "<strong>".$leftContentHeader."</strong></p>";
                                }
                                 
                                 if (isset($leftContent)){
                                   echo '<p style="padding-left:10px; margin:0; line-height:1.4;">';
                                    foreach ($leftContent as $value) {
                                         echo "<span>".$value."</span><br />";
                                     }
                                  echo '</p>';
                                 }
                                
                                ?>
                            </td>
                                
                                <td style="float:right;" valign="top">
                                    <p style="line-height:1.4; text-align:left;">
                                        <?php
	                                        if (isset($rightContentHeader)){
	                                        	echo "<p style='padding-right:10px; margin:0; font-size:15px; '>"
	                                        			. "<strong>".$rightContentHeader."</strong></p>";
	                                        } 
                                            if (isset($rightContent)){
                                                 foreach ($rightContent as $value) {
                                                    echo "<span>".$value."</span><br />";
                                                }
                                            }
                                        ?>
                                    </p>
                                  </td>
                            </tr>