
<div class="panel panel-default">

    <div class="panel-heading hidden-print">
        <h6 class="panel-title"><i class="fa fa-desktop"></i> Arrival NOC 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="panel-body">

        <form action="<?php echo site_url('everbright/arrivalnocreport'); ?>" method="post" class="validate hidden-print" role="form">
            <div class="row form-group"> 

                <label class="col-xs-1 col-xs-offset-2 control-label text-right">
                    <h5>From<span class="mandatory">*</span></h5>
                </label>
                <div class="col-xs-2">
                    <input type="text" placeholder="From Date" class="form-control required datepicker" name="from_date" >
                </div>

                <label class="col-xs-1 control-label text-right">
                    <h5>To<span class="mandatory">*</span>
                    </h5>
                </label>
                <div class="col-xs-2">
                    <input type="text" placeholder="To Date" class="form-control required datepicker" name="to_date" >
                </div>

                <div class="col-xs-2">
                    <button type="submit" name="search" value="Search" class="pull-left btn btn-circle btn-xs btn-default">
                        <i class="fa fa-search"></i> Search</button>
                </div>
            </div> 
            <hr />
        </form> 



        <?php if (isset($from_date) AND isset($to_date)): ?>

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


            <!-- Arrival_NOC -->
            <div class="row">
                <div class="col-xs-12">
                    <table class="page-setup_ table table-bordered">
                        <caption>
                            <p class="text-center" style="font-size: 13px;">
                                <strong>ARRIVAL NOC REPORT [From: <?php echo date('F d, Y', strtotime($from_date)); ?> - To: <?php echo date('F d, Y', strtotime($to_date)); ?>]</strong>
                            </p>
                        </caption>
                        <thead>
                            <tr>
                                <th>Date</th>
                                <th>Invoice No.</th>
                                <th>Delivery Order No.</th>
                                <th>MB/L No.</th>
                                <th>Against HBL No.</th>
                                <th>CNTR No.</th>
                                <th>CNEE.</th>
                                <th>FVSL & VOY No.</th>
                                <th>Import Rotation.</th>
                                <th>G.W.</th>
                                <th>Cargo Description.</th>
                                <th>HBL No.</th>
                                <th>Master B/L</th>
                                <th>VOL</th>
                                <th>L/C No.</th>
                                <th>Consignee Name</th>
                                <th>POL/POD</th>
                                <th>ETA</th>
                            </tr>
                        </thead>
                        <tbody> 
                            <?php
                            $this->db->where('date >=', $from_date);
                            $this->db->where('date <=', $to_date);
                            $query = $this->db->get('arrivalnoc')->result_array();
                            foreach ($query as $row):
                                $query_deliveryorder_info = $this->db->get_where('deliveryorder', array('deliveryorder_id' => $row['serial_no']))->result_array();
                                foreach ($query_deliveryorder_info as $deliveryorder_value):
                                    ?>                              
                                    <tr>
                                        <td><?php echo date('d.m.Y', strtotime($row['date'])); ?></td>                                 
                                        <td><?php echo $row['invoice_no']; ?></td> 
                                        <td><?php echo $deliveryorder_value['serial_no']; ?></td>
                                        <td><?php echo $deliveryorder_value['MBL_no']; ?></td>
                                        <td><?php echo $deliveryorder_value['againts_HBL_no']; ?></td>
                                        <td><?php echo $deliveryorder_value['CNTR_no']; ?></td>
                                        <td><?php echo $deliveryorder_value['CNEE']; ?></td>
                                        <td><?php echo $deliveryorder_value['FVSL_VOY_no']; ?></td>
                                        <td><?php echo $deliveryorder_value['import_rotation']; ?></td>
                                        <td><?php echo $deliveryorder_value['GW']; ?></td>
                                        <td><?php echo $deliveryorder_value['cargo_description']; ?></td>

                                        <td><?php echo $row['HBL_no']; ?></td>                                 
                                        <td><?php echo $row['master_bill']; ?></td>                                 
                                        <td><?php echo $row['VOL']; ?></td>                                 
                                        <td><?php echo $row['LC_no']; ?></td>                                 
                                        <td><?php echo $row['consignee_name']; ?></td>                                 
                                        <td><?php echo $row['POL_POD']; ?></td>                                 
                                        <td><?php echo $row['ETA']; ?></td> 
                                    </tr>
                                <?php endforeach; ?>  
                            <?php endforeach; ?>                            
                        </tbody>                            
                    </table> 
                </div>
            </div>
            <!-- /Arrival_NOC -->   

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


        <?php endif; ?>

    </div>

</div>
