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

require_once '../check_edit_page.php';


class edit extends database
{
    
    
    public function Getdata($id)
    {
        $where['cl_id']= $id;
        return $this->fetchRow('tb_product_category', $where);
    }
    
    public function getAllBanners($lang)
    {
        return $this->fetchAll('tb_product_category_banners', ['cl_language' => $lang]);
    }

   
}

$obj = new edit();

$data = $obj->Getdata($id);
$bannersEnglish = $obj->getAllBanners('en');
$bannersEstonina = $obj->getAllBanners('ee');
$bannersLithuanian = $obj->getAllBanners('lt');

$templateType = 'edit';
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">Edit Product Category</h2>
                                    
                                </div>
                                
                              
                            </div>
                        </div>
                        
                        <div class="row m-t-25 m-row">
                    
                            <div class="col-lg-10">
                                <div class="card">
                                    <ul class="nav nav-tabs">
  <li class="nav-item">
    <a class="nav-link active" href="edit.php?id=<?php echo $id ?>">Main</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="banners.php?id=<?php echo $id ?>">Banners</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="top_rated.php?id=<?php echo $id ?>">Top Rated</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="banners2.php?id=<?php echo $id ?>">Banners 2</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="brands.php?id=<?php echo $id ?>">Brands</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="custom_text.php?id=<?php echo $id ?>">Custom Texts</a>
  </li>
  
</ul>
                                   
                                    <div class="card-body card-block">
                                        <form method="post"  enctype="multipart/form-data" class="form" cluster-url="../ajax/product_category/edit_ajax?id=<?php echo $id;?>" cluster-redirect="list">
									       <?php include_once "template/category_form.php" ?>
                                       </form>
                                   </div>
                                </div>
                            </div>
                          
                        </div>
                        
                   <?php
				   include '../footer.php';
				  