    <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--> 

    <!--/.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 Products</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 Products View On This Page You Can Edit Or Delete Products 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="card-body">
                           <table id="mytable" class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <th>Name</th>
                                        <th>Price</th>
                                        <th>Sale Price</th>
                                        <th>Action</th>
                                        
                                    </tr>
                                </thead>
                                <tbody>
                                     <?php
                                    if($view_all != 0){
                                        $count = count($view_all);
                                        if($count != 0){
                                            $i = 1;
                                            foreach ($view_all as $row) {


                                    ?>
                                    <tr>
                                        <td><?php echo $row->name;?></td>
                                        <td><?php echo $row->price;?></td>
                                        <td><?php echo $row->sail_price;?></td>
                                        <td><img src="<?php echo base_url('uploads/').$row->img;?>" alt="" style=" width: 250px; height: 250px; ">
                                        <td>
                                            <a href="<?php echo base_url('admin/Add_product/edit/').$row->id; ?>" class="btn btn-warning"onclick="return confirm('Are you sure to Edit?')">Edit</a>
                                            <a href="<?php echo base_url('admin/Add_product/delete/').$row->id; ?>" class="btn btn-danger"onclick="return confirm('Are you sure to Delete?')">Delete</a>
                                            <form method="post">
                          <input type="checkbox" <?php if($row->status == 1){echo "checked";}?> name="chk"
                                 class="chkbtn"
                                 id="chkid<?php echo $row->id;?>" value="<?php
                          echo
                          $row->id;?>">
                      </form>
                                        </td>
                                        
                                    </tr>
                                    <?php } } } ?>
                                    
                                </tbody>
                              
                           </table>
            </div>
            <!-- /.card-body -->
          </div>
		  </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>

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