<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
            <h3>Occasion (<?php if(!empty($all_occasions)){ echo count($all_occasions); }else{ echo 0; } ?>) <a href="#add_new_occasion" 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>Occasion Name</th>
						<th>Status</th>
						<th>Action</th>
                    </tr>
                </thead>
                <tbody>
				<?php 
				  $i= 0;
				  if(!empty($all_occasions)){
				foreach($all_occasions  as $occasion){ ?>
					<tr>
						<td><?php echo ++$i; ?></td>
						<td><?php echo $occasion->occasion_name; ?></td>
						 
						<td>
							<label class="switch">
								<input id="ocasnstatus_<?php echo $occasion->occasion_id; ?>" onclick="update_ocassion_status(<?php echo $occasion->occasion_id; ?>);"   type="checkbox" value="" <?php if($occasion->occasion_status == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
							
						</td>
						 
						<td width="200">
							<a  class="btn" title="Edit" data-name="Business Statistics" onclick="edit_occasion(<?php echo $occasion->occasion_id; ?>,'<?php echo $occasion->occasion_name; ?>')"><i class="fa fa-pencil" aria-hidden="true"></i></a>
							 <a  href="<?php echo base_url().'admin/delete_occasion/'.$occasion->occasion_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 Category popup start -->
<div class="modal_box">
<div id="add_new_occasion" 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> Occasion</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_occasion_form">
                <div class="hs_input">
                    <label>Occasion Name</label>
                    <input type="text" class="form-control add_cate_form" placeholder="Name"  name="occasion_name" id="occasion_name" value="">
                </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_occasion" 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> Occasion</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_occasion_form">
                <div class="hs_input">
                    <label>Occasion Name</label>
                    <input type="text" class="form-control add_cate_form" placeholder="Name"  name="update_occaname" id="update_occaname" value="">
                </div>
				<div class="hs_input">
				  <input type="hidden" value="" name="old_occasid" id="old_occasid">
					 
					  <button type="submit" id="add"  class="btn">Update</button>
                </div>
            </div>
			</form>
        </div>
    </div>
</div>
</div>
<!-- update Category popup end -->	
 <!-- page body end -->
	
	
	