<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
            <h3>Blogs Categories (<?php if(!empty($all_blogcate)){ echo count($all_blogcate); }else{ echo 0; } ?>) <a href="#add_new_blogcate" 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>Status</th>
						<th>Action</th>
                    </tr>
                </thead>
                <tbody>
				<?php 
				$i =0;
				if(!empty($all_blogcate)){
					foreach($all_blogcate as $blogcate){
				?>
				 <tr>
                        <td><?php echo ++$i; ?></td>
                        <td width="200">
                            <div class="hs_user">
                                <div class="user_name">
                                    <p><?php echo $blogcate->cate_name; ?></p>
                                </div>
                            </div>
                        </td>
                        
						<td>
							<label class="switch">
								<input id="bcstatus_<?php echo $blogcate->cate_id; ?>" onclick="change_blogcate_status(<?php echo $blogcate->cate_id; ?>);" type="checkbox" value="" <?php if($blogcate->cate_status == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
                            
                        </td>
						
                       <td width="200">
                            <a class="btn" title="Edit" onclick="edit_blogcategory(<?php echo $blogcate->cate_id; ?>,'<?php echo $blogcate->cate_name; ?>')"><i class="fa fa-pencil" aria-hidden="true"></i></a>
                       </td>
				</tr> 
            <?php 

				}
			}
            ?>				
                </tbody>
            </table>
        </div>
    </div>
</div>
<br>
<br>
<br>
<br>
<!-- Add New blog category popup start -->
<div class="modal_box">
<div id="add_new_blogcate" 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 Blog</span> Category</h4>
            </div>
            <div class="modal-body">
			<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
			 
                <div class="hs_input">
                    <label>Category Name</label>
                    <input type="text" class="form-control add_cate_form" placeholder="Name"  name="catename" id="category_name">
                </div>
                <div class="hs_input">
			        <button type="submit"  onclick="addblogcategory()" id="add"  class="btn">ADD</button>
                </div>
            </div>
			 
        </div>
    </div>
</div>
</div>
<!-- Add New blog category popup end -->

<!-- update blog category popup start -->
<div class="modal_box">
<div id="update_blogcate" 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 Blog</span> Category</h4>
            </div>
            <div class="modal-body">
			<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
		 
                <div class="hs_input">
                    <label>Category Name</label>
                    <input type="text" class="form-control add_cate_form" placeholder="Name"  name="update_bcate_name" id="update_bcate_name">
                </div>
                <div class="hs_input">
					<input type="hidden" value="0" name="old_bcateid" id="old_bcateid">
					<button type="submit"  onclick="update_blog_category()" id="add"  class="btn">Update</button>
                </div>
            </div>
			 
        </div>
    </div>
</div>
</div>
<!-- update blog category popup end-->      
    <!-- page body end -->


