<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
	 
            <h3>Tables (<?php if(!empty($all_tables)){ echo count($all_tables); }else{ echo 0; } ?>) <a href="<?= base_url('admin/add_new_table') ?>" 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>Table No</th>
                        <th>Capacity</th>
						<th>Image</th>
                        <th>Status</th>
						<th>Action</th>
                    </tr>
                </thead>
                <tbody>
				<?php 
				  $i= 0;
				  if(!empty($all_tables)){
					foreach($all_tables as $table){ ?>
					<tr>
                        <td><?php echo ++$i; ?></td>
                        <td width="200">
                            <div class="hs_user">
                                <div class="user_name">
                                    <p><?php echo $table->table_name; ?></p>
                                </div>
                            </div>
                        </td>
						<td> <?php echo $table->table_no; ?></td>
                        <td> <?php echo $table->table_capacity; ?></td>
						<td>
							<img src="<?php echo base_url().$table->table_image; ?>" alt="icon">
						</td>
                        <td>
							<label class="switch">
								<input id="tabstauts_<?php echo $table->table_id; ?>" onclick="change_tablestatus(<?php echo $table->table_id; ?>);"  type="checkbox" value="" <?php if($table->table_status == 1){ echo "checked"; } ?> >
								<span class="slider"></span>
							</label>
						</td>
						<td width="200">
                            <a href="<?php echo base_url().'admin/update_table_data/'.$table->table_id;  ?>" class="btn" title="Edit"><i class="fa fa-pencil" aria-hidden="true"></i></a>
                            <a href="<?php echo base_url().'admin/delete_tables/'.$table->table_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>