<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
            <h3>Chef Team (<?php if(!empty($all_chefteam)){ echo count($all_chefteam); }else{ echo 0; } ?>) <a href="<?= base_url('admin/addchefteam') ?>" 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>Designation</th>
                        <th>Image</th>
                        <th>Status</th>
			            <th>Action</th>
                    </tr>
                </thead>
                <tbody>
				<?php

                 $i= 0;
				if(!empty($all_chefteam)){ 
				   foreach($all_chefteam as $chefteam){
				?>
				 <tr>
                        <td><?php echo ++$i; ?></td>
                        <td width="200">
                            <div class="hs_user">
                                <div class="user_img">
                                    <span class="hs_user_initials"><?php 
									$chefname_arr = explode(" ", $chefteam->chef_name);
									$first_letter='';
									 foreach($chefname_arr as $cname){
									 $first_letter .= substr($cname, 0, 1);
                                     }	 
									  echo  $first_letter;	
									 ?></span>
                                </div>
                                <div class="user_name">
                                    <p><?php echo $chefteam->chef_name; ?></p>
                                     
                                </div>
                            </div>
                        </td>
                        <td><?php echo $chefteam->chef_desig; ?></td>
                        <td>
							<div class="chef_simg"><img src="<?php echo  base_url().$chefteam->chef_image; ?>" alt="chef"></div>
						</td>
						<td>
							<label class="switch">
								<input id="cheftatus_<?php echo $chefteam->chef_id; ?>" onclick="change_chefmember_status(<?php echo $chefteam->chef_id; ?>);"   type="checkbox" value="" <?php if($chefteam->chef_status == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
                            
                        </td>
						<td width="200">
                            <a href="<?php echo base_url().'admin/update_chefteam/'.$chefteam->chef_id;  ?>" class="btn" title="Edit"><i class="fa fa-pencil" aria-hidden="true"></i></a>
                            <a href="<?php echo base_url().'admin/delete_chefteam/'.$chefteam->chef_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>
