<?php
session_start();
include_once "../config.php";
require_once '../database1.php';
require_once "../check_admin.php";

class ProductCategory extends database
{
    public function index()
    { 
		return $this->fetchAll('tb_filter', $where);
	}
}
$msg='';
if(isset($_GET['message']))
{
	$msg=$_GET['message'];
}

$obj = new ProductCategory();	
$filters = $obj->index();
include '../header.php';
?>
            <!-- MAIN CONTENT-->
            <div class="main-content">
                <div class="section__content section__content--p30">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="overview-wrap">
                                    <h2 class="title-1">All Filters</h2>
                                    
                                </div>
								
                            </div>
                        </div>
                        
                        <div class="row m-t-25 m-row col-sm-12">
							<div class="col-lg-12">
                                <a href="add" class="btn btn-success pull-right">Add Filter</a>
                                <div class="table-responsive table--no-card m-b-30 top-margin pull-left">
                                    <table class="table table-borderless table-data3 ACP_table" style="width: 100%">
                                        <thead>
                                            <tr>
                                                <th>Name</th>
												<th>Show Filter</th>
												<th data-priority="1">Actions</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                           <?php
											foreach($filters AS $filter)
											{
											?>
											<tr class="action-container">
												<td><?php echo htmlspecialchars($filter['cl_name']);?></td>
												<td><?php if($filter['cl_show_filter'] == 1){ echo 'Yes';}else{echo 'No';} ?></td>
												<td><a id="edit" href="edit.php?id=<?php  echo htmlspecialchars($filter['cl_id']); ?>" class="btn btn-primary"><i class="fa fa-edit"></i></a>
												
												<div class="error-input"></div> 
												</td>
											    
											</tr>
											<?php
											}
											?>
                                           
                                        </tbody>
                                    </table>
									
                                </div>
                            </div>
                            
                          
                        </div>
                        
                       <script>
						$(document).ready(function(){
							$('.active').removeClass('active');
							$('#customer-menu').addClass('active');
						}); 
						</script>               

  <?php
  include '../footer.php';
  ?>