<?php 
require_once(__DIR__."/../xpanel/inc/vt.php");

$ara=$_GET['term'];


$urunler  =   $dbh->prepare("SELECT * FROM product where status=1 &&  product_name like ? ");
$urunler  -> execute(array("%".$ara."%"));
$urunler  =   $urunler  -> fetchAll(PDO::FETCH_ASSOC);

foreach ($urunler as $urun ) {


   $urun = cevir("product",$urun,$_SESSION["dil"]);
   $urun = (object) $urun;


   $kat  =   $dbh->prepare("SELECT * FROM product_categories where  id=? ");
   $kat  -> execute(array($urun->parent));
   $kat  =   $kat  -> fetch(PDO::FETCH_ASSOC);


   $kat = cevir("product_categories",$kat,$_SESSION["dil"]);
   $kat = (object) $kat;



   ?>
   <a href="urun-<?=$urun->seo_name?>">
    <div class="menu_search_product">
        <div class="menu_search_product_detail">
            <div class="menu_search_product_start">
                <div class="menu_search_product_img"><img src="img/<?=$urun->foto?>"></div>
                <div class="menu_search_product_title"><h2><?=$urun->product_name?> -<?=$urun->product_price?></h2>
                    <div class="menu_search_product_description"><?=$kat->categories_name?></div>
                </div>
            </div>
            <div class="menu_search_product_buttons">
                <div class="menu_search_product_buttons_cart"><img src="images/icons/plus.svg"></div>
            </div>
        </div>
    </div>
</a>
<?php } ?>
