<!-- product list start -->
<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
            <h3>Products (<?php if(!empty($all_products)){ echo count($all_products); }else{ echo 0; } ?>) <a href="<?= base_url('admin/add_new_products') ?>" class="btn">Add new</a></h3>
        </div>
        <div class="hs_datatable_wrapper">
            <table class="hs_datatable table table-bordered">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Name</th>
                        <th>Category</th>
						<th>Price</th>
						<th>Quantity</th>
						<th>Image</th>
						<th>Status</th>
						<th>Featured</th>
						<th>Action</th>
                    </tr>
                </thead>
                <tbody>
				<?php 
				  $i= 0;
				  if(!empty($all_products)){
				foreach($all_products as $product){ ?>
				    <tr>
                        <td><?php echo ++$i; ?></td>
                        <td width="200">
                            <div class="hs_user">
                                <div class="user_name">
                                    <p><?php echo $product->prod_name; ?></p>
                                    <span>Created at - <?php 
										echo date('d M Y', strtotime($product->prod_date)); ?></span>
                                </div>
                            </div>
                        </td>
                        <td>
						<?php 
						    if(!empty($all_category)){
								foreach($all_category as $cate){
									if($cate->category_id == $product->prod_cateid)
									{
										echo $cate->category_name;    
									}								
							    }
						    }
						?>
						</td>
                        <td><?php echo $product->prod_price; ?></td>
						<td><?php if($product->prod_quantity ==''){
										echo "Unlimited";
									}else{
										echo $product->prod_quantity;
									}	
							?>
						</td>
						<td>
							<div class="product_simg"><img src="<?php echo base_url().$product->prod_specialmenu_img; ?>" alt="icon"></div>
						</td>
						<td>
							<label class="switch">
								<input id="prodstatus_<?php echo $product->prod_id; ?>" onclick="change_product_status(<?php echo $product->prod_id; ?>);"   type="checkbox" value="" <?php if($product->prod_status == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
                        </td>
						<td>
							<label class="switch">
								<input id="prodfetur_<?php echo $product->prod_id; ?>" onclick="change_product_featured(<?php echo $product->prod_id; ?>);"   type="checkbox" value="" <?php if($product->prod_featured == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
                        </td>
						<td width="200">
                            <a href="<?php echo base_url().'admin/update_product/'.$product->prod_id;  ?>" class="btn" title="Edit"><i class="fa fa-pencil" aria-hidden="true"></i></a>
							<a href="<?php echo base_url().'admin/product_review/'.$product->prod_id;  ?>" class="btn" title="View Review"><i class="fa fa-comments" aria-hidden="true"></i></a>
                            <a href="<?php echo base_url().'admin/delete_product/'.$product->prod_id;  ?>" class="btn" title="Delete" onclick="return delete_confirmation()"><i class="fa fa-trash" aria-hidden="true"></i></a>
						</td>
				    </tr> 
                <?php
				  }
				 } 
				?>					
                </tbody>
            </table>
        </div>
    </div>
</div>


