İşinize yarar mı bilemiyorum. İstediğiniz ilin tüm okullarını listeleyebilir, listede isme göre filtre yapabilir ve kadro detay bilgilerine ulaşabilirisiniz( detaylı kadro çekmeyi ve isimden türkiye geneli personel aramayı etik olmadığı ? için sildim)
Test: https://dijitalokulpanosu.com.tr/b/okul_ara.php?il=34
PHP kodu:
Test: https://dijitalokulpanosu.com.tr/b/okul_ara.php?il=34
PHP kodu:
Kod:
<?php
/**
* veri.php - SADELEŞTİRİLMİŞ OKUL ARAMA SİSTEMİ
*/
header('Content-Type: text/html; charset=utf-8');
// --- İLLER DİZİSİ (Orijinal Yapı) ---
$iller = [
1 => "Adana", 2 => "Adıyaman", 3 => "Afyonkarahisar", 4 => "Ağrı", 5 => "Amasya", 6 => "Ankara", 7 => "Antalya", 8 => "Artvin",
9 => "Aydın", 10 => "Balıkesir", 11 => "Bilecik", 12 => "Bingöl", 13 => "Bitlis", 14 => "Bolu", 15 => "Burdur", 16 => "Bursa",
17 => "Çanakkale", 18 => "Çankırı", 19 => "Çorum", 20 => "Denizli", 21 => "Diyarbakır", 22 => "Edirne", 23 => "Elazığ", 24 => "Erzincan",
25 => "Erzurum", 26 => "Eskişehir", 27 => "Gaziantep", 28 => "Giresun", 29 => "Gümüşhane", 30 => "Hakkari", 31 => "Hatay", 32 => "Isparta",
33 => "Mersin", 34 => "İstanbul", 35 => "İzmir", 36 => "Kars", 37 => "Kastamonu", 38 => "Kayseri", 39 => "Kırklareli", 40 => "Kırşehir",
41 => "Kocaeli", 42 => "Konya", 43 => "Kütahya", 44 => "Malatya", 45 => "Manisa", 46 => "Kahramanmaraş", 47 => "Mardin", 48 => "Muğla",
49 => "Muş", 50 => "Nevşehir", 51 => "Niğde", 52 => "Ordu", 53 => "Rize", 54 => "Sakarya", 55 => "Samsun", 56 => "Siirt",
57 => "Sinop", 58 => "Sivas", 59 => "Tekirdağ", 60 => "Tokat", 61 => "Trabzon", 62 => "Tunceli", 63 => "Şanlıurfa", 64 => "Uşak",
65 => "Van", 66 => "Yozgat", 67 => "Zonguldak", 68 => "Aksaray", 69 => "Bayburt", 70 => "Karaman", 71 => "Kırıkkale", 72 => "Batman",
73 => "Şırnak", 74 => "Bartın", 75 => "Ardahan", 76 => "Iğdır", 77 => "Yalova", 78 => "Karabük", 79 => "Kilis", 80 => "Osmaniye", 81 => "Düzce"
];
// --- VERİ ÇEKME FONKSİYONU (Orijinal Yapı) ---
function mebVeriCek($url, $post = false, $fields = []) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0');
if ($post) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
curl_setopt($ch, CURLOPT_REFERER, 'https://www.meb.gov.tr/baglantilar/okullar/index.php');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Requested-With: XMLHttpRequest']);
}
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
// LİSTELEME MANTIĞI
$ilKodu = isset($_GET['il']) ? (int)$_GET['il'] : 57;
$sehirAdi = $iller[$ilKodu] ?? "Bilinmiyor";
$resJson = mebVeriCek("https://www.meb.gov.tr/baglantilar/okullar/okullar_ajax.php", true, [
'il' => $ilKodu, 'ilce' => 0, 'draw' => 1, 'start' => 0, 'length' => 10000
]);
$resData = json_decode($resJson, true);
$liste = $resData['data'] ?? [];
$okulSayisi = count($liste);
$baslik = "İL: " . mb_strtoupper($sehirAdi, 'UTF-8') . " ($okulSayisi OKUL)";
?>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<style>
* { box-sizing: border-box; }
body, html { margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; background: #f8fafc; }
.container { max-width: 800px; margin: 20px auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; display: flex; flex-direction: column; height: 90vh; }
.header { padding: 20px; background: #1e293b; color: #fff; text-align: center; font-weight: bold; border-radius: 8px 8px 0 0; }
.search-container { padding: 15px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.il-input { width: 70px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; }
.submit-btn { padding: 2px 15px; background: #2563eb; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
.okul-search { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 14px; }
.scroll-area { flex: 1; overflow-y: auto; }
.item { padding:2px 20px; border-bottom: 1px solid #f1f5f9; text-decoration: none; display: block; color: #334155; transition: background 0.2s; }
.item:hover { background: #eff6ff; border-left: 4px solid #2563eb; }
.name { font-size: 14px; font-weight: 700; display: block; margin-bottom: 3px; }
.title { font-size: 12px; color: #64748b; }
</style>
</head>
<body>
<div class="container">
<div class="header" id="header-baslik"><?= mb_strtoupper($baslik, 'UTF-8') ?></div>
<div class="search-container">
<form onsubmit="return ilKontrol()" method="GET" style="display:flex; gap:8px; align-items:center;">
<label style="font-size:12px; font-weight:bold;">İL PLAKA:</label>
<input type="number" name="il" id="ilInput" value="<?= $ilKodu ?>" class="il-input">
<button type="submit" class="submit-btn">LİSTELE</button>
</form>
<input type="text" id="okulSüzgec" placeholder="Okul adı yazarak filtreleyin..." class="okul-search" onkeyup="okulAra()">
</div>
<div class="scroll-area" id="listeAlani">
<?php foreach($liste as $row): $u = "https://".$row['HOST'].".meb.k12.tr"; ?>
<a href="<?= $u ?>" target="_blank" class="item okul-item">
<span class="name"><?= htmlspecialchars($row['OKUL_ADI']) ?></span>
<span class="title"><?= $u ?></span>
</a>
<?php endforeach; ?>
</div>
</div>
<script>
function okulAra() {
const aranan = document.getElementById('okulSüzgec').value.toUpperCase();
const kartlar = document.getElementsByClassName('okul-item');
let sayac = 0;
for (let i = 0; i < kartlar.length; i++) {
const metin = kartlar[i].innerText.toUpperCase();
if (metin.indexOf(aranan) > -1) {
kartlar[i].style.display = "";
sayac++;
} else {
kartlar[i].style.display = "none";
}
}
const anaBaslik = "<?= mb_strtoupper($sehirAdi, 'UTF-8') ?>";
document.getElementById('header-baslik').innerText = "İL: " + anaBaslik + " (" + sayac + " OKUL BULUNDU)";
}
function ilKontrol() {
const kod = parseInt(document.getElementById('ilInput').value);
if (isNaN(kod) || kod < 1 || kod > 81) {
alert("LÜTFEN GEÇERLİ BİR İL KODU GİRİNİZ (1-81)");
return false;
}
return true;
}
</script>
</body>
</html>
Son düzenleme:

