<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
            <h3>Categories (<?php if(!empty($all_categories)){ echo count($all_categories); }else{   echo 0; } ?>) <a href="#add_new_category" class="btn" data-toggle="modal">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 Image</th>
						<th>Description</th>
                        <th>Status</th>
						<th>Featured</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
				<?php 
				  $i= 0;
				  if(!empty($all_categories)){
				foreach($all_categories  as $category){ ?>
					<tr>
						<td><?php echo ++$i; ?></td>
						<td><?php echo $category->category_name; ?></td>
						<td>
							<div class="hs_category_icon">
								 <img src="<?php echo base_url().$category->category_image; ?>" alt="icon">
							</div>                            
						</td>
						<td><?php echo $category->category_description; ?></td>
						<td>
							<label class="switch">
								<input id="catestatus_<?php echo $category->category_id; ?>" onclick="update_category_status(<?php echo $category->category_id; ?>);"   type="checkbox" value="" <?php if($category->category_status == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
							
						</td>
						 <td>
							<label class="switch">
								<input id="catefeatu_<?php echo $category->category_id; ?>" onclick="change_cate_featured(<?php echo $category->category_id; ?>);"   type="checkbox" value="" <?php if($category->category_featured == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
							
						</td>
						<td width="200">
							<a  class="btn" title="Edit" data-name="Business Statistics" onclick="edit_category(<?php echo $category->category_id; ?>)"><i class="fa fa-pencil" aria-hidden="true"></i></a>
						</td>
					</tr>
			    <?php
				 }
				} 
				?>	
				</tbody>
            </table>
        </div>
    </div>
</div>

<br>
<br>
<br>
<br>


 

<!-- Add New Category popup start -->
<div class="modal_box">
<div id="add_new_category" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title"><span>Add New</span> Category</h4>
            </div>
            <div class="modal-body">
			<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
			<form method="post" enctype="multipart/form-data" id="add_cate_form">
                <div class="hs_input">
                    <label>Category Name</label>
                    <input type="text" class="form-control add_cate_form" placeholder="Name"  name="catename" id="catename" value="">
                </div>
				<div class="hs_input">
                    <label>Category Description</label>
                    <textarea rows="4" class="form-control" placeholder="Description" name="cate_descri" id="catedescription"></textarea>
                </div>
				<div class="hs_input">
                    <label>Category Icon</label>
                    <input type="file" class="form-control " name="cateimage" id="cateimage">
                </div>
                <div class="hs_input">
				 
					  <button type="submit" id="add"  class="btn">ADD</button>
                </div>
            </div>
			</form>
        </div>
    </div>
</div>
</div>
<!-- Add New Category popup end -->    </div>
  
	 

<!-- update Category popup start -->
<div class="modal_box">
<div id="update_category" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title"><span>Update</span> Category</h4>
            </div>
            <div class="modal-body">
			<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
			<form method="post" enctype="multipart/form-data" id="update_cate_form">
                <div class="hs_input">
                    <label>Category Name</label>
                    <input type="text" class="form-control add_cate_form" placeholder="Name"  name="up_catename" id="update_catename" value="">
                </div>
				
				 <div class="hs_input">
                    <label>Category Description</label>
                    <textarea rows="4" class="form-control" placeholder="Description" name="up_catedescri" id="update_catedescri"></textarea>
                </div>
				<div class="hs_input">
                    <label>Category Icon</label>
                    <input type="file" class="form-control " name="up_cateimage" id="update_cateimage">
                </div>
                <div class="hs_input">
				  <input type="hidden" value="" name="old_cateid" id="old_cateid">
					 
					  <button type="submit" id="add"  class="btn">Update</button>
                </div>
            </div>
			</form>
        </div>
    </div>
</div>
</div>
<!-- update Category popup end -->	
 <!-- page body end -->
	
	
	