<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title class="hidden-print"><?php //echo $page_title; ?> | <?php echo $this->main_model->company_name(); ?></title>
        <!-- Header -->
        <?php $this->load->view('header'); ?>            
    </head>
    <body>

        <div class="panel panel-default">
            <?php
            error_reporting(0);
            $query = $this->main_model->deliveryorder_info($deliveryorder_id);
            foreach ($query as $row):
                ?>
                <div class="panel-heading hidden-print">
                    <h6 class="panel-title">
                        <i class="fa fa-desktop"></i> C-3 Information</h6> 
                    <a onclick="window.print();" style="cursor:pointer;" class="pull-right btn btn-circle btn-xs btn-default hidden-print"><i class="fa fa-print"></i> Print</a> 					
                </div>

                <div class="page-setup panel-body">

                    <p class="text-center hidden-print">
                        <strong style="font-size: 16px;">
                            <?php echo $this->main_model->company_name(); ?>
                        </strong><br /></p> 

                    <br/>
                    <p class="text-center hidden-print">
                        <strong style="font-size: 15px;">
                            <u>Master Bill Surrender</u>
                        </strong>
                    </p>
                    <br />

                    <p>Date: <?php echo date('F d, Y', strtotime($row['date'])); ?><br />
                    </p>

                    <br />
                    <?php
//                    $query_deliveryorder_info = $this->db->get_where('deliveryorder', array('deliveryorder_id' => $row['serial_no']))->result_array();
//                    foreach ($query_deliveryorder_info as $row):
                        //To get the delivery information
                        ?>
                        <p>To,<br />
                            <?php
                            $customer_id = $row['customer_id'];
                            $query = $this->db->get_where('customer', array('customer_id' => $customer_id))->result_array();
                            foreach ($query as $row_customer) {
                                echo '<strong>'.$row_customer['name'].'</strong>'.'</br>';
                                 echo $row_customer['address'];
                            }
                            ?>
                        </p>

                        <br/>

                        <p>Subject: Issuance of delivery order.</p>

                        <br/>

                        <?php if (!empty($row['MBL_no'])): ?>
                            <div class="row">
                                <div class="col-xs-2">MB/L No.: </div>
                                <div class="col-xs-10"><?php echo $row['MBL_no']; ?></div>
                            </div> 
                        <?php endif; ?>  
                        <?php if (!empty($row['againts_HBL_no'])): ?>
                            <div class="row">
                                <div class="col-xs-2">Againts HBL No: </div>
                                <div class="col-xs-10"><?php echo $row['againts_HBL_no']; ?></div>
                            </div> 
                        <?php endif; ?>

                        <?php if (!empty($row['CNTR_no'])): ?>
                            <div class="row">
                                <div class="col-xs-2">CNTR No: </div>
                                <div class="col-xs-10"><?php echo $row['CNTR_no']; ?></div>
                            </div> 
                        <?php endif; ?>

                        <!-- <?php if (!empty($row['PLTS'])): ?>
                                                         <div class="row">
                                                             <div class="col-xs-2">PLTS: </div>
                                                             <div class="col-xs-10"><?php echo $row['PLTS']; ?></div>
                                                         </div> 
                        <?php endif; ?>-->

                        <?php if (!empty($row['CNEE'])): ?>
                            <div class="row">
                                <div class="col-xs-2">CNEE: </div>
                                <div class="col-xs-10"><?php echo $row['CNEE']; ?></div>
                            </div> 
                        <?php endif; ?>

                        <?php if (!empty($row['FVSL_VOY_no'])): ?>
                            <div class="row">
                                <div class="col-xs-2">FVSL & VOY No: </div>
                                <div class="col-xs-10"><?php echo $row['FVSL_VOY_no']; ?></div>
                            </div> 
                        <?php endif; ?>

                        <?php if (!empty($row['import_rotation'])): ?>
                            <div class="row">
                                <div class="col-xs-2">Import Rotation: </div>
                                <div class="col-xs-10"><?php echo $row['import_rotation']; ?></div>
                            </div> 
                        <?php endif; ?>

                        <?php if (!empty($row['GW'])): ?>
                            <div class="row"><div class="col-xs-2">GW: </div>
                                <div class="col-xs-10"><strong><?php echo $row['GW']; ?></strong></div></div> 
                        <?php endif; ?>

                        <?php if (!empty($row['cargo_description'])): ?>
                            <div class="row"><div class="col-xs-2">Cargo Description: </div>
                                <div class="col-xs-10"><?php echo $row['cargo_description']; ?></div></div> 
                        <?php endif; ?>

                        <br/>

                    <?php // endforeach; //Delivery iformation   ?>

                    <br />
                    <p>Dear Sir,<br/>
                        Enclosed here is the original MB/L copy for your record.</br>
                        Thinking you for your kind cooperation & necessary action.    
                        </br>
                        Sincerely yours,</br></br>
                        As Agent
                    </p>

                    <br/><br/><br/><br/><br/>
                    <div class="hidden-print">
                        <p class="text-center"><?php echo $this->main_model->company_address(); ?></p>
                    </div>
                </div>

            <?php endforeach; ?>
        </div>
    </body>
</html>
