Merhaba, şubeleri olan bir kafe sitesinde şubeler bölümüne gidince bütün şubelerin sayfasında aynı isim yazıyor. Ancak her şubenin kendi adı yazsın istiyorum. Kodları aşağıya bırakıyorum. Yardımcı olursanız sevinirim. Teşekkürler
<?php
session_start();
date_default_timezone_set('Europe/Istanbul');
define('KONTROL', 1);
include 'admin/ayarlar.php';
$durum = DB::getRow("SELECT * FROM db_kapali");
if (!$durum->durum) {
include("offline.php");
exit();
}
if (!isset($_SESSION['lang'])) {
$_SESSION['lang'] = 'tr';
}
$site = DB::getRow("SELECT * FROM db_site");
$seo = DB::getRow("SELECT * FROM db_seo");
$site = (array) $site;
$seo = (array) $seo;
$slider = DB::query("SELECT * FROM db_slide WHERE durum=1 ORDER BY sirala ASC")->fetchAll(PDO::FETCH_ASSOC);
$subeler = DB::query("SELECT * FROM db_subeler WHERE tur='ana' AND durum=1 ORDER BY sirala ASC")->fetchAll(PDO::FETCH_ASSOC);
$sube_id = 2;
if (!isset($_GET['sube'])) {
header('location:index.php');
} else {
$sube_id = escape($_GET['sube']);
}
$social = DB::query("SELECT * FROM db_sosyalmedya WHERE durum=1 AND konum=$sube_id ORDER BY sirala ASC")->fetchAll(PDO::FETCH_ASSOC);
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<?= $_SESSION['lang'] == 'tr' ? $seo['aciklama'] : $seo['aciklama_en'] ?>">
<meta name="keywords" content="<?= $_SESSION['lang'] == 'tr' ? $seo['anahtar'] : $seo['anahtar_en'] ?>">
<title><?= $_SESSION['lang'] == 'tr' ? $site['baslik'] : $site['baslik_en'] ?></title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/animate.css">
<link rel="stylesheet" href="/css/jquery.fancybox.css">
<link rel="stylesheet" href="/css/style.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
</head>
<body>
<!--popup-->
<div class="popup">
<div class="arkaplan"></div>
<div class="content animated fadeInDown">
</div>
</div>
<nav>
<div class="row">
<div class="col-sm-12 col-md-3 logo">
<a href="index.php"><img src="img/logo.png" alt="Logo"></a>
<div class="mini_menu_bar hidden-md hidden-lg"><i class="fa fa-bars"></i></div>
</div>
<div class="col-sm-12 col-md-9 hidden-sm hidden-xs">
<ul>
<li><a href="#home"><i class="fa fa-home"></i></a></li>
<li><a href="#about"><?= $_SESSION['lang'] == 'tr' ? 'HAKKIMIZDA' : 'ABOUT US' ?></a></li>
<li>
<a href="javascript:void(0)"><?= $_SESSION['lang'] == 'tr' ? 'ŞUBELER' : 'BRANCH OFFICE' ?></a>
<ul>
<li><a href="index.php"><?= $_SESSION['lang'] == 'tr' ? 'Kuruçeşme Kahvesi (Merkez)' : 'Kuruçeşme Kahvesi (Main)' ?></a></li>
<?php foreach ($subeler as $item) {
?>
<li><a href="sube.php?sube=<?= $item['id'] ?>"><?= $_SESSION['lang'] == 'tr' ? $item['baslik'] : $item['baslik_en'] ?></a></li>
<?php
}
?>
</ul>
</li>
<li><a href="#" id="ik"><?= $_SESSION['lang'] == 'tr' ? 'İNSAN KAYNAKLARI' : 'HUMAN RESOURCES' ?></a></li>
<li><a href="#" id="suggest"><?= $_SESSION['lang'] == 'tr' ? 'ÖNERİLERİNİZ' : 'SUGGESTIONS' ?></a></li>
<li><a href="#contact"><?= $_SESSION['lang'] == 'tr' ? 'İLETİŞİM' : 'CONTACT' ?></a></li>
<li class="active"><a href="secure.php?p=lang&lang=<?= $_SESSION['lang'] == 'tr' ? 'en' : 'tr' ?>&url=<?= $_SERVER['REQUEST_URI'] ?>"><?= $_SESSION['lang'] == 'tr' ? 'EN' : 'TR' ?></a></li>
</ul>
</div>
</div>
</nav>
<ul class="mini_menu hidden-md hidden-lg">
<li class="active"><a href="#home"><i class="fa fa-home"></i></a></li>
<li><a href="#about"><?= $_SESSION['lang'] == 'tr' ? 'HAKKIMIZDA' : 'ABOUT US' ?></a></li>
<li>
<a href="javascript:void(0)"><?= $_SESSION['lang'] == 'tr' ? 'ŞUBELER' : 'BRANCH OFFICE' ?></a>
<ul>
<li><a href="index.php"><?= $_SESSION['lang'] == 'tr' ? 'Kuruçeşme Kahvesi (Merkez)' : 'Kuruçeşme Kahvesi (Main)' ?></a></li>
<?php foreach ($subeler as $item) {
?>
<li><a href="sube.php?sube=<?= $item['id'] ?>"><?= $_SESSION['lang'] == 'tr' ? $item['baslik'] : $item['baslik_en'] ?></a></li>
<?php
}
?>
</ul>
</li>
<li><a href="#" id="ik"><?= $_SESSION['lang'] == 'tr' ? 'İNSAN KAYNAKLARI' : 'HUMAN RESOURCES' ?></a></li>
<li><a href="#" id="suggest"><?= $_SESSION['lang'] == 'tr' ? 'ÖNERİLERİNİZ' : 'SUGGESTIONS' ?></a></li>
<li><a href="#contact"><?= $_SESSION['lang'] == 'tr' ? 'İLETİŞİM' : 'CONTACT' ?></a></li>
<li><a href="secure.php?p=lang&lang=<?= $_SESSION['lang'] == 'tr' ? 'en' : 'tr' ?>&url=<?= $_SERVER['REQUEST_URI'] ?>"><?= $_SESSION['lang'] == 'tr' ? 'EN' : 'TR' ?></a></li>
</ul>
<section id="home" class="layout home">
<div id="slider">
<?php
$sNum = 0;
foreach ($slider as $item) {
$sNum++;
?>
<div class="item animated fadeIn<?= $sNum == 1 ? ' active' : '' ?>" style="background-image: url('/uploads/images/<?= $item['foto'] ?>');">
<?php
if ($item['mini_foto']) {
?>
<div class="logo text-center">
<img src="uploads/images/<?= $item['mini_foto'] ?>" class="img-responsive animated zoomIn" alt="<?= $item['mini_foto_alt'] ?>">
</div>
<?php
} else {
?>
<div class="description animated fadeInDown">
<div class="container">
<div class="title"><?= $_SESSION['lang'] == 'tr' ? $item['baslik'] : $item['baslik_en'] ?></div>
<div class="text"><?= $_SESSION['lang'] == 'tr' ? $item['aciklama'] : $item['aciklama_en'] ?></div>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
<div class="btn_continue"><a href="#about" class="wow slideInDown"></a></div>
<div class="navigator">
<ul>
<?php
$sLiNum = 0;
foreach ($slider as $item) {
$sLiNum++;
?>
<li<?= $sLiNum == 1 ? ' class="active"' : '' ?>> </li>
<?php
}
?>
</ul>
</div>
</section>
<section id="about" class="mini-layout about" style="padding-bottom: 50px;">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 wow bounceInRight title_h">
<div class="text-center"><?= $_SESSION['lang'] == 'tr' ? 'ATAŞEHİR (Şube)' : 'ATAŞEHİR (Branch Office)' ?></div>
</div>
<div class="col-sm-12 col-md-12 wow bounceInLeft content">
<div class="tab_content">
<?php
$pages = DB::query("SELECT * FROM db_subeler WHERE kid=$sube_id AND durum=1 ORDER BY sirala ASC")->fetchAll(PDO::FETCH_ASSOC);
$tNum = 0;
foreach ($pages as $item) {
$tNum++;
if ($item['baslik'] != 'Menü') {
?>
<div class="tab_panel<?= $tNum == 1 ? ' active' : '' ?>">
<div class="col-sm-12 col-md-6 text-left text">
<div class="title"><?= $_SESSION['lang'] == 'tr' ? $item['baslik'] : $item['baslik_en'] ?></div>
<?php
if(!empty($item['video'])) {
$url = $item['video'];
if(preg_match('@https://www.youtube.com/@i',$url)) {
parse_str(parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
$videoID = $my_array_of_vars['v'];
$media = '<iframe width="100%" height="240" src="https://www.youtube.com/embed/'.$videoID.'?rel=0" frameborder="0" allowfullscreen></iframe>';
} elseif(preg_match('@http://vimeo.com/@',$url)) {
$videoID = substr(parse_url($url, PHP_URL_PATH), 1);
$media = '<iframe src="//player.vimeo.com/video/'.$videoID.'?color=ffffff" width="100%" height="240" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
} else {
$media = '<video width="100%" height="240" controls><source src="uploads/video/'.$item['video'].'" type="video/mp4"></video>';
}
echo $media;
}
?>
<?php
$gallery = DB::query("SELECT * FROM db_subeler_resim WHERE kat_id=" . $item['id'])->fetchAll(PDO::FETCH_ASSOC);
if (count($gallery)) {
foreach ($gallery as $img) {
?>
<a href="<?= baseLINK . 'uploads/images/' . $img['resim'] ?>" class="fancybox" rel="galeri">
<span class="col-md-4 pgallery">
<img src="<?= baseLINK . 'uploads/images/' . $img['resim'] ?>" alt="" class="img-responsive">
</span>
</a>
<?php
}
} else {
echo $_SESSION['lang'] == 'tr' ? $item['aciklama'] : $item['aciklama_en'];
}
?>
</div>
<div class="hidden-sm hidden-xs col-md-offset-2 col-md-4 text-right">
<img src="uploads/images/<?= $item['foto'] ?>" class="img-responsive"
alt="<?= $item['foto_alt'] ?>">
</div>
</div>
<?php
}
}
?>
<div class="reset"></div>
<div class="col-sm-12 col-md-6">
<div class="row">
<ul class="tabs">
<?php
$tLiNum = 0;
foreach ($pages as $item) {
$tLiNum++;
if ($item['baslik'] == 'Menü') {
?>
<li id="menu"><a href="<?= baseLINK . 'uploads/dosya/' . $item['dosya'] ?>"><?= $item['baslik'] ?></a></li>
<?php
} else {
?>
<li<?= $tLiNum == 1 ? ' class="active"' : '' ?>><?= $item['baslik'] ?></li>
<?php
}
}
?>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="contact" class="mini-layout contact">
<?php
$iletisim_merkez = DB::getRow("SELECT * FROM db_iletisim WHERE id=1");
$iletisim_sube = DB::getRow("SELECT * FROM db_iletisim WHERE id=3");
$maps = DB::getRow("SELECT * FROM db_map WHERE id=1");
?>
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 title_h wow fadeInUp">
<div class="text-center"><?= $_SESSION['lang'] == 'tr' ? 'BİZE ULAŞIN' : 'CONTACT US' ?></div>
<div class="text"><?= $_SESSION['lang'] == 'tr' ? 'Her türlü soru, görüş, öneri ve şikayetleriniz için sosyal medya hesaplarımız veya websitemiz üzerinden iletebilirsiniz.' : 'Any questions, comments, suggestions, and can transmit through our website or our social media accounts for your complaint.' ?></div>
</div>
<div class="col-sm-12 col-md-12 wow bounceInDown">
<div class="content">
<div class="social_stats">
<?= $_SESSION['lang'] == 'tr' ? $iletisim_merkez->aciklama : $iletisim_merkez->aciklama_en ?>
</div>
<div class="info">
<div class="col-sm-12 col-md-6 wow fadeInLeft">
<div class="title">Kuruçeşme (<?= $_SESSION['lang'] == 'tr' ? 'Merkez' : 'Center' ?>)</div>
<div class="maps"><?= $maps->kod ?></div>
<div class="description">
<p><b><?= $_SESSION['lang'] == 'tr' ? 'Adres:' : 'Address:' ?></b> <?= $iletisim_merkez->adres ?></p>
<p><b><?= $_SESSION['lang'] == 'tr' ? 'Tel:' : 'Tel:' ?></b> <?= $iletisim_merkez->telefon ?></p>
<p><b><?= $_SESSION['lang'] == 'tr' ? 'Faks:' : 'Fax:' ?></b> <?= $iletisim_merkez->fax ?></p>
<p><b><?= $_SESSION['lang'] == 'tr' ? 'E-Posta:' : 'E-Mail:' ?></b> <?= $iletisim_merkez->eposta ?></p>
</div>
</div>
<div class="col-sm-12 col-md-6 wow fadeInRight">
<div class="title">Ataşehir (<?= $_SESSION['lang'] == 'tr' ? 'Şube' : 'Branch Office' ?>)</div>
<div class="maps"><?= $maps->sube ?></div>
<div class="description">
<p><b><?= $_SESSION['lang'] == 'tr' ? 'Adres:' : 'Address:' ?></b> <?= $iletisim_sube->adres ?></p>
<p><b><?= $_SESSION['lang'] == 'tr' ? 'Tel:' : 'Tel:' ?></b> <?= $iletisim_sube->telefon ?></p>
<p><b><?= $_SESSION['lang'] == 'tr' ? 'Faks:' : 'Fax:' ?></b> <?= $iletisim_sube->fax ?></p>
<p><b><?= $_SESSION['lang'] == 'tr' ? 'E-Posta:' : 'E-Mail:' ?></b> <?= $iletisim_sube->eposta ?></p>
</div>
</div>
<div class="reset"></div>
</div>
<div class="form_button text-center">
<a href="data.php?t=form"><?= $_SESSION['lang'] == 'tr' ? 'İLETİŞİM FORMU' : 'CONTACT FORM' ?></a>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid footer wow fadeInUp">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-2 logo text-center">
<img src="img/footer_logo.png" alt="Logo">
</div>
<div class="col-sm-12 col-md-10">
<div class="row">
<div class="col-sm-12 col-md-8 footerMenu">
<ul>
<li><a href="#about"><?= $_SESSION['lang'] == 'tr' ? 'Hakkımızda' : 'About us' ?></a></li>
<li><a href="" id="ik"><?= $_SESSION['lang'] == 'tr' ? 'İnsan Kaynakları' : 'Human Resources' ?></a></li>
<li><a href="" id="suggest"><?= $_SESSION['lang'] == 'tr' ? 'Önerileriniz' : 'Suggestions' ?></a></li>
<li><a href="#contact"><?= $_SESSION['lang'] == 'tr' ? 'İletişim' : 'Contact' ?></a></li>
</ul>
</div>
<div class="col-sm-12 col-md-4 social">
<ul>
<?php
foreach ($social as $item) {
echo '<li><a href="' . $item['link'] . '" target="_blank"><img src="' . baseLINK . 'uploads/images/' . $item['foto'] . '" /></a></li>';
}
?>
</ul>
</div>
</div>
<div class="row copyright">
<div class="col-sm-12 col-md-8">© Copyright 2016 Kuruçeşme Kahvesi</div>
<div class="col-sm-12 col-md-4 text-right">technology by <a href="http://www.creamum.com" target="_blank"><img src="img/creamum_logo.png"alt="Creamum"></a></div>
</div>
</div>
</div>
</div>
</div>
</section>
<!--scripts-->
<script src="/js/jquery-1.11.3.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.fancybox.pack.js"></script>
<script src="/js/wow.min.js"></script>
<script src="/js/template.js"></script>
</body>
</html>