<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
            <h3>Gallery (<?php if(!empty($all_portfolio)){ echo count($all_portfolio); }else{ echo 0; } ?>) <a href="#add_new_portfolio" class="btn" data-toggle="modal"  onclick="add_category()">Add new</a></h3>
        </div>
        <div class="hs_datatable_wrapper">
            <table class="hs_datatable table table-bordered">
                <thead>
                    <tr>
                        <th>#</th> 
                        <th>Gallery Image</th>
                        <th>Status</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
				<?php 
				$i=0;
				if(!empty($all_portfolio)){
					foreach($all_portfolio as $portfolio){ ?>
					<tr>
						<td><?php echo ++$i; ?></td>
						<td>
							<div class="portfolio_img">
								<img src=" <?php echo base_url().$portfolio->portfolio_image; ?>" alt="icon">
							</div>
						</td>
						<td>
							<label class="switch">
								<input id="portstatus_<?php echo $portfolio->portfolio_id; ?>" onclick="change_potfolio_status(<?php echo $portfolio->portfolio_id; ?>);"   type="checkbox" value="" <?php if($portfolio->portfolio_status == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
							
						</td>
						<td width="200">
							<a onclick="edit_portfolio(<?php echo $portfolio->portfolio_id; ?>,'<?php echo $portfolio->portfolio_image; ?>')" class="btn" title="Edit" data-name="Business Statistics"><i class="fa fa-pencil" aria-hidden="true"></i></a> 
							<a  href="<?php echo base_url().'admin/delete_portfolio_image/'.$portfolio->portfolio_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>
<br>
<br>
<br>
<br>

<!-- Add New portfolio popup start -->
<div class="modal_box">
<div id="add_new_portfolio" 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> Portfolio</h4>
            </div>
            <div class="modal-body">
			<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
			<form method="post" enctype="multipart/form-data" id="addportfolio">
                <div class="hs_input">
                    <label>Portfolio Image</label>
                    <input type="file" class="form-control" name="portfolio_image" id="portfolio_image_id">
                </div>
                <div class="hs_input">
				   <button type="submit" id="add"  class="btn">ADD</button>
                </div>
            </div>
			</form>
        </div>
    </div>
</div>
</div>
<!-- Add New portfolio popup end -->  

<!-- update portfolio popup start -->
<div class="modal_box">
<div id="update_portfolio_model" 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> Portfolio</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_portfolio">
                <div class="hs_input">
                    <label>Portfolio Image</label>
                    <input type="file" class="form-control" name="update_portfolio_img" id="update_portfolio_img">
                </div>
                <div class="hs_input">
					<input type="hidden" value="" name="old_portfolio_id" id="old_portfolio_id">
					<button type="submit" id="add"  class="btn">Update</button>
                </div>
            </div>
			</form>
        </div>
    </div>
</div>
</div>
<!-- update portfolio popup end --> 

  