<?php
$path = "../../";
include($path . "map.php");
$result = [];
if($_GET["ne"]=="uye" || $_GET["ne"]=="muhasebe"){
	$tbl="t5";
}else{
	$tbl=$_SESSION["lang"];
	$qry = "ne='".$_GET["ne"]."' and ";
}
$sql = mysqli_query($conn, "SELECT id, t1 FROM $tbl where $qry (t1 like '%".$_GET["q"]."%' or n17 like '%".$_GET["q"]."%')");
if ($sql) {
    while ($rs = mysqli_fetch_assoc($sql)) {
        $result[] = [
            'id'   => $rs['id'],
            't1' => $rs['t1'],
            'link' => "?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=" . $rs['id']  // Link veriyoruz
        ];
    }
}
echo json_encode($result);