    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
    <!--data table--> 
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/pdfmake-0.1.18/dt-1.10.12/b-1.2.2/b-colvis-1.2.2/b-html5-1.2.2/b-print-1.2.2/r-2.1.0/datatables.min.css" /> 
    <script type="text/javascript" src="https://cdn.datatables.net/v/bs/pdfmake-0.1.18/dt-1.10.12/b-1.2.2/b-colvis-1.2.2/b-html5-1.2.2/b-print-1.2.2/r-2.1.0/datatables.min.js"></script> 
    <!--/.data table--> 

 <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>All New Orders</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active">All New Orders</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-12">
          <div class="card">
            <div class="card-header">
              <h3 class="card-title">All New Orders View On This Page You Can Complete Or Delete Orders From This Page</h3>
            </div>
                        <?php
              $success = $this->session->flashdata('success');
               if(isset($success)){  ?>
            <div class="alert alert-success">
              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              <?php echo $this->session->flashdata('success');?>
          </div>
          <?php } ?>

          <?php
              $same = $this->session->flashdata('same');
               if(isset($same)){  ?>
            <div class="alert alert-warning">
              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              <?php echo $this->session->flashdata('same');?>
          </div>
          <?php } ?>
          <?php
              $same = $this->session->flashdata('error');
               if(isset($same)){  ?>
            <div class="alert alert-danger">
              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              <?php echo $this->session->flashdata('error');?>
          </div>
          <?php } ?>
                        <div class="table-responsive">
                           <table id="mytable" class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <th>Customer Name</th>
                                        <th>Phone No</th>
                                        <th>Email</th>
                                        <th>City</th>
                                         <th>Address</th>
                                         <th>Quantity</th>
                                          <th>Product Name</th>
                                         <th>Delivery Charges</th>
                                         <th>Product Price</th>
                                         <th>Total Price</th>
                                         <th>Date/Time</th>
                                        <th>Action</th>
                                        
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    if($view_all != 0){
                                        $count = count($view_all);
                                        if($count != 0){
                                            foreach ($view_all as $row) {
                                                

                                    ?>
                                    <tr>
                                        <td><?php echo $row->fullname;?></td>
                                        <td><?php echo $row->phone;?></td>
                                        <td><?php echo $row->email;?></td>
                                          <td><?php echo $row->city;?></td>
                                        <td><?php echo $row->address;?></td>
                                        <td><?php echo $row->qnt; ?></td>
                                        <td>
                    <?php

                    $sl = $row->product_slug;
                            $this->db->where('slug', $sl);
                            $query = $this->db->get('product');
                            $res = $query->result();

                            echo $res[0]->name;
                    ?>
                      
                  </td>
                                        <td>RS: <?php echo $res[0]->dliveryfee;?></td>
										<td>RS: <?php echo $res[0]->sail_price;?></td>
										<td>RS: <?php echo $res[0]->sail_price *$row->qnt +$res[0]->dliveryfee;?></td>
                                        <td><?php echo $row->date; ?></td>
                                        
                                        <td>
                                            <a href="<?php echo base_url('admin/New_orders/mark/').$row->id; ?>" class="btn btn-info" title="Click When Your Order Is Completed"><span class="fa fa-pencil"></span> Mark As Completed</a>
                                            <a href="<?php echo base_url('admin/New_orders/delete/').$row->id; ?>" class="btn btn-danger" title="Click If You Want to Remove This Order"><span class="fa fa-trash"></span> DELETE</a>
                                        </td>
                                        
                                    </tr>
                                    <?php } } } ?>
                                    
                                </tbody>
                              
                           </table>
            </div>
            <!-- /.card-body -->
          </div>
		  </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>

<!-- Bootstrap 4 -->
 <script type="text/javascript"> 
        $(document).ready(function() { 
            $("#mytable").dataTable(); 
        }); 
    </script>