src/SiteBundle/Controller/SiteController.php line 168

Open in your IDE?
  1. <?php
  2. namespace SiteBundle\Controller;
  3. use PanelBundle\Controller\BaseController;
  4. use PanelBundle\Entity\FormKayit;
  5. use PanelBundle\Entity\Rezervasyon;
  6. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use Symfony\Component\HttpFoundation\Response;
  9. class SiteController extends BaseController
  10. {
  11.     public function indexAction($dil='')
  12.     {
  13.         $em $this->getDoctrine()->getManager();
  14.         if($dil==''){
  15.             $qb $em->createQueryBuilder();
  16.             $dill=$qb->select('d.id,d.kisa,d.uzun')
  17.                 ->from('PanelBundle:Dil''d')
  18.                 ->where('d.varsayilan=1 and d.aktif=1')
  19.                 ->orderBy('d.aktif','DESC')
  20.                 ->getQuery()
  21.                 ->getScalarResult();
  22.             $dil $dill[0]['id'];
  23.             $this->get('session')->set('dil',$dill[0]);
  24.         }else{
  25.             $qb $em->createQueryBuilder();
  26.             $dill=$qb->select('d.id,d.kisa,d.uzun')
  27.                 ->from('PanelBundle:Dil''d')
  28.                 ->where("d.kisa='$dil' and d.aktif=1")
  29.                 ->orderBy('d.aktif','DESC')
  30.                 ->getQuery()
  31.                 ->getScalarResult();
  32.             if(count($dill)>0){
  33.                 $dil $dill[0]['id'];
  34.                 $this->get('session')->set('dil',$dill[0]);
  35.             }else{
  36.                return $this->redirect($this->ayarlar('siteYolu'));
  37.             }
  38.         }
  39.         return $this->render('@Site/Sites/index.html.twig');
  40.     }
  41.     public function sayfaAction($dil='',$seo1,$seo2='',$seo3='',$seo4='',$seo5='',$seo6='',$seo7='',$seo8='',$seo9='',$seo10='',$seo11='',$seo12='',$seo13='',$seo14='',$seo15=''){
  42.         $em $this->getDoctrine()->getManager();
  43.         if($dil==''){
  44.             $qb $em->createQueryBuilder();
  45.             $dill=$qb->select('d.id,d.kisa,d.uzun')
  46.                 ->from('PanelBundle:Dil''d')
  47.                 ->where('d.varsayilan=1 and d.aktif=1')
  48.                 ->orderBy('d.aktif','DESC')
  49.                 ->getQuery()
  50.                 ->getScalarResult();
  51.             $dil $dill[0]['id'];
  52.             $this->get('session')->set('dil',$dill[0]);
  53.         }else{
  54.             $qb $em->createQueryBuilder();
  55.             $dill=$qb->select('d.id,d.kisa,d.uzun')
  56.                 ->from('PanelBundle:Dil''d')
  57.                 ->where("d.kisa='$dil' and d.aktif=1")
  58.                 ->orderBy('d.aktif','DESC')
  59.                 ->getQuery()
  60.                 ->getScalarResult();
  61.             if(count($dill)>0){
  62.                 $dil $dill[0]['id'];
  63.                 $this->get('session')->set('dil',$dill[0]);
  64.             }else{
  65.                 return $this->redirect($this->ayarlar('siteYolu'));
  66.             }
  67.         }
  68.         $suankiDil $this->get('session')->get('dil');
  69.        /* if($suankiDil['kisa']!=$dil){
  70.             return $this->redirect($this->ayarlar('siteYolu'));
  71.         }*/
  72.         $qb $em->createQueryBuilder();
  73.         $sayfa=$qb->select('s.id,s.adi,s.bannerDurum,s.bannerUrl,s.title,s.keywords,s.description,s.dilgrup,s.seo,s.kategori,s.tekVeri,s.icIcerik,m.tabloAdi,m.alan,s.description,m.adi as madi')
  74.             ->from('PanelBundle:Sayfa''s')
  75.             ->join('s.dil''d')
  76.             ->join('s.modul''m')
  77.             ->where("s.seo ='$seo1' and d.id=".$suankiDil['id'])
  78.             ->orderBy('s.sira','ASC')
  79.             ->getQuery()
  80.             ->getScalarResult();
  81.      /*   if(count($sayfa)==0){
  82.             return $this->redirect($this->ayarlar('siteYolu'));
  83.         }*/
  84.         $sayfa $sayfa[0];
  85.         $sayfaAlan explode(','$sayfa['alan']);
  86.         $icerikalani = [];
  87.         foreach ($sayfaAlan as $sA) {
  88.             $icerikalani[] = 't.'.$this->seo(str_replace(' '''$sA));
  89.         }
  90.         $view $this->seo(str_replace(' ','',$sayfa['madi']));
  91.         if(empty($seo2)){
  92.             $qb $em->createQueryBuilder();
  93.             $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  94.                 ->from('PanelBundle:VillaKategori''k')
  95.                 ->join('k.dil''d')
  96.                 ->where("k.seourl='$seo1' and k.ustid=0 and d.id=" $suankiDil['id'])
  97.                 ->orderBy('k.sira''ASC')
  98.                 ->getQuery()
  99.                 ->getScalarResult();
  100.             if(count($villa_kategoriler)>0){
  101.                 $qb $em->createQueryBuilder();
  102.                 $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  103.                     ->from('PanelBundle:VillaKategori''k')
  104.                     ->join('k.dil''d')
  105.                     ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  106.                     ->orderBy('k.sira''ASC')
  107.                     ->getQuery()
  108.                     ->getScalarResult();
  109.                 return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  110.             }else{
  111.                 $qb $em->createQueryBuilder();
  112.                 $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  113.                     ->from('PanelBundle:Villa''i')
  114.                     ->join('i.dil''d')
  115.                     ->where("i.seo='" .$seo1"' and d.id=" $suankiDil['id'])
  116.                     ->orderBy('i.id''DESC')
  117.                     ->getQuery()
  118.                     ->getScalarResult();
  119.                 if(count($ilan)>0) {
  120.                     return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  121.                 }
  122.             }
  123.             //Sayfa
  124.             if($sayfa['kategori']==0){
  125.                 $qb $em->createQueryBuilder();
  126.                 $icerikler $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  127.                     ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  128.                     ->join('t.dil''d')
  129.                     ->where("t.sayfaId='" .$sayfa['dilgrup']. "' and d.id=" $suankiDil['id'])
  130.                     ->addOrderBy('t.sira''ASC')
  131.                     ->addOrderBy('t.id''DESC')
  132.                     ->getQuery()
  133.                     ->getScalarResult();
  134.             }
  135.             else{
  136.                 $qb $em->createQueryBuilder();
  137.                 $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  138.                     ->from('PanelBundle:Kategori''k')
  139.                     ->join('k.dil''d')
  140.                     ->where("k.sayfaId='" .$sayfa['dilgrup']. "' and k.ustid=0 and d.id=" $suankiDil['id'])
  141.                     ->orderBy('k.sira''ASC')
  142.                     ->getQuery()
  143.                     ->getScalarResult();
  144.             }
  145.             return $this->render('@Site/Sites/'.$view.'.html.twig',array('sayfa'=>$sayfa,'kategoriler'=>$kategoriler,'icerikler'=>$icerikler));
  146.         }
  147.         else{
  148.             if(empty($seo3)){
  149.                 $qb $em->createQueryBuilder();
  150.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  151.                     ->from('PanelBundle:VillaKategori''k')
  152.                     ->join('k.dil''d')
  153.                     ->where("k.seourl='$seo2' and d.id=" $suankiDil['id'])
  154.                     ->orderBy('k.sira''ASC')
  155.                     ->getQuery()
  156.                     ->getScalarResult();
  157.                 if(count($villa_kategoriler)>0){
  158.                     $qb $em->createQueryBuilder();
  159.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  160.                         ->from('PanelBundle:VillaKategori''k')
  161.                         ->join('k.dil''d')
  162.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  163.                         ->orderBy('k.sira''ASC')
  164.                         ->getQuery()
  165.                         ->getScalarResult();
  166.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  167.                 }else{
  168.                     $qb $em->createQueryBuilder();
  169.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  170.                         ->from('PanelBundle:Villa''i')
  171.                         ->join('i.dil''d')
  172.                         ->where("i.seo='" .$seo2"' and d.id=" $suankiDil['id'])
  173.                         ->orderBy('i.id''DESC')
  174.                         ->getQuery()
  175.                         ->getScalarResult();
  176.                     if(count($ilan)>0) {
  177.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  178.                     }
  179.                 }
  180.                 if($sayfa['kategori']==0) {
  181.                     // Sayfa İçi
  182.                     $qb $em->createQueryBuilder();
  183.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  184.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  185.                         ->join('t.dil''d')
  186.                         ->where("t.seourl='" .$seo2"' and d.id=" $suankiDil['id'])
  187.                         ->addOrderBy('t.sira''ASC')
  188.                         ->addOrderBy('t.id''DESC')
  189.                         ->getQuery()
  190.                         ->getScalarResult();
  191.                     if(count($icerik)==0){
  192.                         return $this->redirect($this->ayarlar('siteYolu'));
  193.                     }
  194.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  195.                 }
  196.                 else{
  197.                     $qb $em->createQueryBuilder();
  198.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  199.                         ->from('PanelBundle:Kategori''k')
  200.                         ->join('k.dil''d')
  201.                         ->where("k.seourl='" .$seo2"' and d.id=" $suankiDil['id'])
  202.                         ->orderBy('k.sira''ASC')
  203.                         ->getQuery()
  204.                         ->getScalarResult();
  205.                     if(count($kategori)==0){
  206.                         $qb $em->createQueryBuilder();
  207.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  208.                             ->from('PanelBundle:Kategori''k')
  209.                             ->join('k.dil''d')
  210.                             ->where("k.seourl='" .$seo1"' and d.id=" $suankiDil['id'])
  211.                             ->orderBy('k.sira''ASC')
  212.                             ->getQuery()
  213.                             ->getScalarResult();
  214.                         $qb $em->createQueryBuilder();
  215.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  216.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  217.                             ->join('t.dil''d')
  218.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo2."' and d.id=" $suankiDil['id'])
  219.                             ->addOrderBy('t.sira''ASC')
  220.                             ->addOrderBy('t.id''DESC')
  221.                             ->getQuery()
  222.                             ->getScalarResult();
  223.                         if(count($kategori)<and count($icerik)<1){
  224.                             return $this->redirect($this->ayarlar('siteYolu'));
  225.                         }
  226.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  227.                     } else {
  228.                         $qb $em->createQueryBuilder();
  229.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  230.                             ->from('PanelBundle:Kategori''k')
  231.                             ->join('k.dil''d')
  232.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  233.                             ->orderBy('k.sira''ASC')
  234.                             ->getQuery()
  235.                             ->getScalarResult();
  236.                         $qb $em->createQueryBuilder();
  237.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  238.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  239.                             ->join('t.dil''d')
  240.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  241.                             ->addOrderBy('t.sira''ASC')
  242.                             ->addOrderBy('t.id''DESC')
  243.                             ->getQuery()
  244.                             ->getScalarResult();
  245.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  246.                     }
  247.                 }
  248.             }
  249.             elseif(empty($seo4)){
  250.                 $qb $em->createQueryBuilder();
  251.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  252.                     ->from('PanelBundle:VillaKategori''k')
  253.                     ->join('k.dil''d')
  254.                     ->where("k.seourl='$seo3' and d.id=" $suankiDil['id'])
  255.                     ->orderBy('k.sira''ASC')
  256.                     ->getQuery()
  257.                     ->getScalarResult();
  258.                 if(count($villa_kategoriler)>0){
  259.                     $qb $em->createQueryBuilder();
  260.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  261.                         ->from('PanelBundle:VillaKategori''k')
  262.                         ->join('k.dil''d')
  263.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  264.                         ->orderBy('k.sira''ASC')
  265.                         ->getQuery()
  266.                         ->getScalarResult();
  267.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  268.                 }else{
  269.                     $qb $em->createQueryBuilder();
  270.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  271.                         ->from('PanelBundle:Villa''i')
  272.                         ->join('i.dil''d')
  273.                         ->where("i.seo='" .$seo3"' and d.id=" $suankiDil['id'])
  274.                         ->orderBy('i.id''DESC')
  275.                         ->getQuery()
  276.                         ->getScalarResult();
  277.                     if(count($ilan)>0) {
  278.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  279.                     }
  280.                 }
  281.                 if($sayfa['kategori']==0) {
  282.                     // Sayfa İçi
  283.                     $qb $em->createQueryBuilder();
  284.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  285.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  286.                         ->join('t.dil''d')
  287.                         ->where("t.seourl='" .$seo3"' and d.id=" $suankiDil['id'])
  288.                         ->addOrderBy('t.sira''ASC')
  289.                         ->addOrderBy('t.id''DESC')
  290.                         ->getQuery()
  291.                         ->getScalarResult();
  292.                     if(count($icerik)==0){
  293.                         return $this->redirect($this->ayarlar('siteYolu'));
  294.                     }
  295.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  296.                 }
  297.                 else{
  298.                     $qb $em->createQueryBuilder();
  299.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  300.                         ->from('PanelBundle:Kategori''k')
  301.                         ->join('k.dil''d')
  302.                         ->where("k.seourl='" .$seo3"' and d.id=" $suankiDil['id'])
  303.                         ->orderBy('k.sira''ASC')
  304.                         ->getQuery()
  305.                         ->getScalarResult();
  306.                     if(count($kategori)==0){
  307.                         $qb $em->createQueryBuilder();
  308.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  309.                             ->from('PanelBundle:Kategori''k')
  310.                             ->join('k.dil''d')
  311.                             ->where("k.seourl='" .$seo2"' and d.id=" $suankiDil['id'])
  312.                             ->orderBy('k.sira''ASC')
  313.                             ->getQuery()
  314.                             ->getScalarResult();
  315.                         $qb $em->createQueryBuilder();
  316.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  317.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  318.                             ->join('t.dil''d')
  319.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo3."' and d.id=" $suankiDil['id'])
  320.                             ->addOrderBy('t.sira''ASC')
  321.                             ->addOrderBy('t.id''DESC')
  322.                             ->getQuery()
  323.                             ->getScalarResult();
  324.                         if(count($kategori)<and count($icerik)<1){
  325.                             return $this->redirect($this->ayarlar('siteYolu'));
  326.                         }
  327.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  328.                     } else {
  329.                         $qb $em->createQueryBuilder();
  330.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  331.                             ->from('PanelBundle:Kategori''k')
  332.                             ->join('k.dil''d')
  333.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  334.                             ->orderBy('k.sira''ASC')
  335.                             ->getQuery()
  336.                             ->getScalarResult();
  337.                         $qb $em->createQueryBuilder();
  338.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  339.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  340.                             ->join('t.dil''d')
  341.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  342.                             ->addOrderBy('t.sira''ASC')
  343.                             ->addOrderBy('t.id''DESC')
  344.                             ->getQuery()
  345.                             ->getScalarResult();
  346.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  347.                     }
  348.                 }
  349.             }
  350.             elseif(empty($seo5)){
  351.                 $qb $em->createQueryBuilder();
  352.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  353.                     ->from('PanelBundle:VillaKategori''k')
  354.                     ->join('k.dil''d')
  355.                     ->where("k.seourl='$seo4' and d.id=" $suankiDil['id'])
  356.                     ->orderBy('k.sira''ASC')
  357.                     ->getQuery()
  358.                     ->getScalarResult();
  359.                 if(count($villa_kategoriler)>0){
  360.                     $qb $em->createQueryBuilder();
  361.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  362.                         ->from('PanelBundle:VillaKategori''k')
  363.                         ->join('k.dil''d')
  364.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  365.                         ->orderBy('k.sira''ASC')
  366.                         ->getQuery()
  367.                         ->getScalarResult();
  368.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  369.                 }else{
  370.                     $qb $em->createQueryBuilder();
  371.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  372.                         ->from('PanelBundle:Villa''i')
  373.                         ->join('i.dil''d')
  374.                         ->where("i.seo='" .$seo4"' and d.id=" $suankiDil['id'])
  375.                         ->orderBy('i.id''DESC')
  376.                         ->getQuery()
  377.                         ->getScalarResult();
  378.                     if(count($ilan)>0) {
  379.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  380.                     }
  381.                 }
  382.                 if($sayfa['kategori']==0) {
  383.                     // Sayfa İçi
  384.                     $qb $em->createQueryBuilder();
  385.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  386.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  387.                         ->join('t.dil''d')
  388.                         ->where("t.seourl='" .$seo4"' and d.id=" $suankiDil['id'])
  389.                         ->addOrderBy('t.sira''ASC')
  390.                         ->addOrderBy('t.id''DESC')
  391.                         ->getQuery()
  392.                         ->getScalarResult();
  393.                     if(count($icerik)==0){
  394.                         return $this->redirect($this->ayarlar('siteYolu'));
  395.                     }
  396.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  397.                 }else{
  398.                     $qb $em->createQueryBuilder();
  399.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  400.                         ->from('PanelBundle:Kategori''k')
  401.                         ->join('k.dil''d')
  402.                         ->where("k.seourl='" .$seo4"' and d.id=" $suankiDil['id'])
  403.                         ->orderBy('k.sira''ASC')
  404.                         ->getQuery()
  405.                         ->getScalarResult();
  406.                     if(count($kategori)==0){
  407.                         $qb $em->createQueryBuilder();
  408.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  409.                             ->from('PanelBundle:Kategori''k')
  410.                             ->join('k.dil''d')
  411.                             ->where("k.seourl='" .$seo3"' and d.id=" $suankiDil['id'])
  412.                             ->orderBy('k.sira''ASC')
  413.                             ->getQuery()
  414.                             ->getScalarResult();
  415.                         $qb $em->createQueryBuilder();
  416.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  417.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  418.                             ->join('t.dil''d')
  419.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo4."' and d.id=" $suankiDil['id'])
  420.                             ->addOrderBy('t.sira''ASC')
  421.                             ->addOrderBy('t.id''DESC')
  422.                             ->getQuery()
  423.                             ->getScalarResult();
  424.                         if(count($kategori)<and count($icerik)<1){
  425.                             return $this->redirect($this->ayarlar('siteYolu'));
  426.                         }
  427.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  428.                     } else {
  429.                             $qb $em->createQueryBuilder();
  430.                             $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  431.                                 ->from('PanelBundle:Kategori''k')
  432.                                 ->join('k.dil''d')
  433.                                 ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  434.                                 ->orderBy('k.sira''ASC')
  435.                                 ->getQuery()
  436.                                 ->getScalarResult();
  437.                             $qb $em->createQueryBuilder();
  438.                             $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  439.                                 ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  440.                                 ->join('t.dil''d')
  441.                                 ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  442.                                 ->addOrderBy('t.sira''ASC')
  443.                                 ->addOrderBy('t.id''DESC')
  444.                                 ->getQuery()
  445.                                 ->getScalarResult();
  446.                             return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  447.                     }
  448.                 }
  449.             }
  450.             elseif(empty($seo6)){
  451.                 $qb $em->createQueryBuilder();
  452.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  453.                     ->from('PanelBundle:VillaKategori''k')
  454.                     ->join('k.dil''d')
  455.                     ->where("k.seourl='$seo5' and d.id=" $suankiDil['id'])
  456.                     ->orderBy('k.sira''ASC')
  457.                     ->getQuery()
  458.                     ->getScalarResult();
  459.                 if(count($villa_kategoriler)>0){
  460.                     $qb $em->createQueryBuilder();
  461.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  462.                         ->from('PanelBundle:VillaKategori''k')
  463.                         ->join('k.dil''d')
  464.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  465.                         ->orderBy('k.sira''ASC')
  466.                         ->getQuery()
  467.                         ->getScalarResult();
  468.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  469.                 }else{
  470.                     $qb $em->createQueryBuilder();
  471.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  472.                         ->from('PanelBundle:Villa''i')
  473.                         ->join('i.dil''d')
  474.                         ->where("i.seo='" .$seo5"' and d.id=" $suankiDil['id'])
  475.                         ->orderBy('i.id''DESC')
  476.                         ->getQuery()
  477.                         ->getScalarResult();
  478.                     if(count($ilan)>0) {
  479.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  480.                     }
  481.                 }
  482.                 if($sayfa['kategori']==0) {
  483.                     // Sayfa İçi
  484.                     $qb $em->createQueryBuilder();
  485.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  486.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  487.                         ->join('t.dil''d')
  488.                         ->where("t.seourl='" .$seo5"' and d.id=" $suankiDil['id'])
  489.                         ->addOrderBy('t.sira''ASC')
  490.                         ->addOrderBy('t.id''DESC')
  491.                         ->getQuery()
  492.                         ->getScalarResult();
  493.                     if(count($icerik)==0){
  494.                         return $this->redirect($this->ayarlar('siteYolu'));
  495.                     }
  496.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  497.                 }else{
  498.                     $qb $em->createQueryBuilder();
  499.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  500.                         ->from('PanelBundle:Kategori''k')
  501.                         ->join('k.dil''d')
  502.                         ->where("k.seourl='" .$seo5"' and d.id=" $suankiDil['id'])
  503.                         ->orderBy('k.sira''ASC')
  504.                         ->getQuery()
  505.                         ->getScalarResult();
  506.                     if(count($kategori)==0){
  507.                         $qb $em->createQueryBuilder();
  508.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  509.                             ->from('PanelBundle:Kategori''k')
  510.                             ->join('k.dil''d')
  511.                             ->where("k.seourl='" .$seo4"' and d.id=" $suankiDil['id'])
  512.                             ->orderBy('k.sira''ASC')
  513.                             ->getQuery()
  514.                             ->getScalarResult();
  515.                         $qb $em->createQueryBuilder();
  516.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  517.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  518.                             ->join('t.dil''d')
  519.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo5."' and d.id=" $suankiDil['id'])
  520.                             ->addOrderBy('t.sira''ASC')
  521.                             ->addOrderBy('t.id''DESC')
  522.                             ->getQuery()
  523.                             ->getScalarResult();
  524.                         if(count($kategori)<and count($icerik)<1){
  525.                             return $this->redirect($this->ayarlar('siteYolu'));
  526.                         }
  527.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  528.                     } else {
  529.                         $qb $em->createQueryBuilder();
  530.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  531.                             ->from('PanelBundle:Kategori''k')
  532.                             ->join('k.dil''d')
  533.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  534.                             ->orderBy('k.sira''ASC')
  535.                             ->getQuery()
  536.                             ->getScalarResult();
  537.                         $qb $em->createQueryBuilder();
  538.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  539.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  540.                             ->join('t.dil''d')
  541.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  542.                             ->addOrderBy('t.sira''ASC')
  543.                             ->addOrderBy('t.id''DESC')
  544.                             ->getQuery()
  545.                             ->getScalarResult();
  546.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  547.                     }
  548.                 }
  549.             }
  550.             elseif(empty($seo7)){
  551.                 $qb $em->createQueryBuilder();
  552.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  553.                     ->from('PanelBundle:VillaKategori''k')
  554.                     ->join('k.dil''d')
  555.                     ->where("k.seourl='$seo6' and d.id=" $suankiDil['id'])
  556.                     ->orderBy('k.sira''ASC')
  557.                     ->getQuery()
  558.                     ->getScalarResult();
  559.                 if(count($villa_kategoriler)>0){
  560.                     $qb $em->createQueryBuilder();
  561.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  562.                         ->from('PanelBundle:VillaKategori''k')
  563.                         ->join('k.dil''d')
  564.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  565.                         ->orderBy('k.sira''ASC')
  566.                         ->getQuery()
  567.                         ->getScalarResult();
  568.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  569.                 }else{
  570.                     $qb $em->createQueryBuilder();
  571.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  572.                         ->from('PanelBundle:Villa''i')
  573.                         ->join('i.dil''d')
  574.                         ->where("i.seo='" .$seo6"' and d.id=" $suankiDil['id'])
  575.                         ->orderBy('i.id''DESC')
  576.                         ->getQuery()
  577.                         ->getScalarResult();
  578.                     if(count($ilan)>0) {
  579.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  580.                     }
  581.                 }
  582.                 if($sayfa['kategori']==0) {
  583.                     // Sayfa İçi
  584.                     $qb $em->createQueryBuilder();
  585.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  586.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  587.                         ->join('t.dil''d')
  588.                         ->where("t.seourl='" .$seo6"' and d.id=" $suankiDil['id'])
  589.                         ->addOrderBy('t.sira''ASC')
  590.                         ->addOrderBy('t.id''DESC')
  591.                         ->getQuery()
  592.                         ->getScalarResult();
  593.                     if(count($icerik)==0){
  594.                         return $this->redirect($this->ayarlar('siteYolu'));
  595.                     }
  596.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  597.                 }else{
  598.                     $qb $em->createQueryBuilder();
  599.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  600.                         ->from('PanelBundle:Kategori''k')
  601.                         ->join('k.dil''d')
  602.                         ->where("k.seourl='" .$seo6"' and d.id=" $suankiDil['id'])
  603.                         ->orderBy('k.sira''ASC')
  604.                         ->getQuery()
  605.                         ->getScalarResult();
  606.                     if(count($kategori)==0){
  607.                         $qb $em->createQueryBuilder();
  608.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  609.                             ->from('PanelBundle:Kategori''k')
  610.                             ->join('k.dil''d')
  611.                             ->where("k.seourl='" .$seo5"' and d.id=" $suankiDil['id'])
  612.                             ->orderBy('k.sira''ASC')
  613.                             ->getQuery()
  614.                             ->getScalarResult();
  615.                         $qb $em->createQueryBuilder();
  616.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  617.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  618.                             ->join('t.dil''d')
  619.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo6."' and d.id=" $suankiDil['id'])
  620.                             ->addOrderBy('t.sira''ASC')
  621.                             ->addOrderBy('t.id''DESC')
  622.                             ->getQuery()
  623.                             ->getScalarResult();
  624.                         if(count($kategori)<and count($icerik)<1){
  625.                             return $this->redirect($this->ayarlar('siteYolu'));
  626.                         }
  627.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  628.                     } else {
  629.                         $qb $em->createQueryBuilder();
  630.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  631.                             ->from('PanelBundle:Kategori''k')
  632.                             ->join('k.dil''d')
  633.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  634.                             ->orderBy('k.sira''ASC')
  635.                             ->getQuery()
  636.                             ->getScalarResult();
  637.                         $qb $em->createQueryBuilder();
  638.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  639.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  640.                             ->join('t.dil''d')
  641.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  642.                             ->addOrderBy('t.sira''ASC')
  643.                             ->addOrderBy('t.id''DESC')
  644.                             ->getQuery()
  645.                             ->getScalarResult();
  646.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  647.                     }
  648.                 }
  649.             }
  650.             elseif(empty($seo8)){
  651.                 $qb $em->createQueryBuilder();
  652.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  653.                     ->from('PanelBundle:VillaKategori''k')
  654.                     ->join('k.dil''d')
  655.                     ->where("k.seourl='$seo7' and d.id=" $suankiDil['id'])
  656.                     ->orderBy('k.sira''ASC')
  657.                     ->getQuery()
  658.                     ->getScalarResult();
  659.                 if(count($villa_kategoriler)>0){
  660.                     $qb $em->createQueryBuilder();
  661.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  662.                         ->from('PanelBundle:VillaKategori''k')
  663.                         ->join('k.dil''d')
  664.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  665.                         ->orderBy('k.sira''ASC')
  666.                         ->getQuery()
  667.                         ->getScalarResult();
  668.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  669.                 }else{
  670.                     $qb $em->createQueryBuilder();
  671.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  672.                         ->from('PanelBundle:Villa''i')
  673.                         ->join('i.dil''d')
  674.                         ->where("i.seo='" .$seo7"' and d.id=" $suankiDil['id'])
  675.                         ->orderBy('i.id''DESC')
  676.                         ->getQuery()
  677.                         ->getScalarResult();
  678.                     if(count($ilan)>0) {
  679.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  680.                     }
  681.                 }
  682.                 if($sayfa['kategori']==0) {
  683.                     // Sayfa İçi
  684.                     $qb $em->createQueryBuilder();
  685.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  686.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  687.                         ->join('t.dil''d')
  688.                         ->where("t.seourl='" .$seo7"' and d.id=" $suankiDil['id'])
  689.                         ->addOrderBy('t.sira''ASC')
  690.                         ->addOrderBy('t.id''DESC')
  691.                         ->getQuery()
  692.                         ->getScalarResult();
  693.                     if(count($icerik)==0){
  694.                         return $this->redirect($this->ayarlar('siteYolu'));
  695.                     }
  696.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  697.                 }else{
  698.                     $qb $em->createQueryBuilder();
  699.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  700.                         ->from('PanelBundle:Kategori''k')
  701.                         ->join('k.dil''d')
  702.                         ->where("k.seourl='" .$seo7"' and d.id=" $suankiDil['id'])
  703.                         ->orderBy('k.sira''ASC')
  704.                         ->getQuery()
  705.                         ->getScalarResult();
  706.                     if(count($kategori)==0){
  707.                         $qb $em->createQueryBuilder();
  708.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  709.                             ->from('PanelBundle:Kategori''k')
  710.                             ->join('k.dil''d')
  711.                             ->where("k.seourl='" .$seo6"' and d.id=" $suankiDil['id'])
  712.                             ->orderBy('k.sira''ASC')
  713.                             ->getQuery()
  714.                             ->getScalarResult();
  715.                         $qb $em->createQueryBuilder();
  716.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  717.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  718.                             ->join('t.dil''d')
  719.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo7."' and d.id=" $suankiDil['id'])
  720.                             ->addOrderBy('t.sira''ASC')
  721.                             ->addOrderBy('t.id''DESC')
  722.                             ->getQuery()
  723.                             ->getScalarResult();
  724.                         if(count($kategori)<and count($icerik)<1){
  725.                             return $this->redirect($this->ayarlar('siteYolu'));
  726.                         }
  727.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  728.                     } else {
  729.                         $qb $em->createQueryBuilder();
  730.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  731.                             ->from('PanelBundle:Kategori''k')
  732.                             ->join('k.dil''d')
  733.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  734.                             ->orderBy('k.sira''ASC')
  735.                             ->getQuery()
  736.                             ->getScalarResult();
  737.                         $qb $em->createQueryBuilder();
  738.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  739.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  740.                             ->join('t.dil''d')
  741.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  742.                             ->addOrderBy('t.sira''ASC')
  743.                             ->addOrderBy('t.id''DESC')
  744.                             ->getQuery()
  745.                             ->getScalarResult();
  746.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  747.                     }
  748.                 }
  749.             }
  750.             elseif(empty($seo9)){
  751.                 $qb $em->createQueryBuilder();
  752.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  753.                     ->from('PanelBundle:VillaKategori''k')
  754.                     ->join('k.dil''d')
  755.                     ->where("k.seourl='$seo8' and d.id=" $suankiDil['id'])
  756.                     ->orderBy('k.sira''ASC')
  757.                     ->getQuery()
  758.                     ->getScalarResult();
  759.                 if(count($villa_kategoriler)>0){
  760.                     $qb $em->createQueryBuilder();
  761.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  762.                         ->from('PanelBundle:VillaKategori''k')
  763.                         ->join('k.dil''d')
  764.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  765.                         ->orderBy('k.sira''ASC')
  766.                         ->getQuery()
  767.                         ->getScalarResult();
  768.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  769.                 }else{
  770.                     $qb $em->createQueryBuilder();
  771.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  772.                         ->from('PanelBundle:Villa''i')
  773.                         ->join('i.dil''d')
  774.                         ->where("i.seo='" .$seo8"' and d.id=" $suankiDil['id'])
  775.                         ->orderBy('i.id''DESC')
  776.                         ->getQuery()
  777.                         ->getScalarResult();
  778.                     if(count($ilan)>0) {
  779.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  780.                     }
  781.                 }
  782.                 if($sayfa['kategori']==0) {
  783.                     // Sayfa İçi
  784.                     $qb $em->createQueryBuilder();
  785.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  786.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  787.                         ->join('t.dil''d')
  788.                         ->where("t.seourl='" .$seo8"' and d.id=" $suankiDil['id'])
  789.                         ->addOrderBy('t.sira''ASC')
  790.                         ->addOrderBy('t.id''DESC')
  791.                         ->getQuery()
  792.                         ->getScalarResult();
  793.                     if(count($icerik)==0){
  794.                         return $this->redirect($this->ayarlar('siteYolu'));
  795.                     }
  796.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  797.                 }else{
  798.                     $qb $em->createQueryBuilder();
  799.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  800.                         ->from('PanelBundle:Kategori''k')
  801.                         ->join('k.dil''d')
  802.                         ->where("k.seourl='" .$seo8"' and d.id=" $suankiDil['id'])
  803.                         ->orderBy('k.sira''ASC')
  804.                         ->getQuery()
  805.                         ->getScalarResult();
  806.                     if(count($kategori)==0){
  807.                         $qb $em->createQueryBuilder();
  808.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  809.                             ->from('PanelBundle:Kategori''k')
  810.                             ->join('k.dil''d')
  811.                             ->where("k.seourl='" .$seo7"' and d.id=" $suankiDil['id'])
  812.                             ->orderBy('k.sira''ASC')
  813.                             ->getQuery()
  814.                             ->getScalarResult();
  815.                         $qb $em->createQueryBuilder();
  816.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  817.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  818.                             ->join('t.dil''d')
  819.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo8."' and d.id=" $suankiDil['id'])
  820.                             ->addOrderBy('t.sira''ASC')
  821.                             ->addOrderBy('t.id''DESC')
  822.                             ->getQuery()
  823.                             ->getScalarResult();
  824.                         if(count($kategori)<and count($icerik)<1){
  825.                             return $this->redirect($this->ayarlar('siteYolu'));
  826.                         }
  827.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  828.                     } else {
  829.                         $qb $em->createQueryBuilder();
  830.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  831.                             ->from('PanelBundle:Kategori''k')
  832.                             ->join('k.dil''d')
  833.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  834.                             ->orderBy('k.sira''ASC')
  835.                             ->getQuery()
  836.                             ->getScalarResult();
  837.                         $qb $em->createQueryBuilder();
  838.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  839.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  840.                             ->join('t.dil''d')
  841.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  842.                             ->addOrderBy('t.sira''ASC')
  843.                             ->addOrderBy('t.id''DESC')
  844.                             ->getQuery()
  845.                             ->getScalarResult();
  846.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  847.                     }
  848.                 }
  849.             }
  850.             elseif(empty($seo10)){
  851.                 $qb $em->createQueryBuilder();
  852.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  853.                     ->from('PanelBundle:VillaKategori''k')
  854.                     ->join('k.dil''d')
  855.                     ->where("k.seourl='$seo9' and d.id=" $suankiDil['id'])
  856.                     ->orderBy('k.sira''ASC')
  857.                     ->getQuery()
  858.                     ->getScalarResult();
  859.                 if(count($villa_kategoriler)>0){
  860.                     $qb $em->createQueryBuilder();
  861.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  862.                         ->from('PanelBundle:VillaKategori''k')
  863.                         ->join('k.dil''d')
  864.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  865.                         ->orderBy('k.sira''ASC')
  866.                         ->getQuery()
  867.                         ->getScalarResult();
  868.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  869.                 }else{
  870.                     $qb $em->createQueryBuilder();
  871.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  872.                         ->from('PanelBundle:Villa''i')
  873.                         ->join('i.dil''d')
  874.                         ->where("i.seo='" .$seo9"' and d.id=" $suankiDil['id'])
  875.                         ->orderBy('i.id''DESC')
  876.                         ->getQuery()
  877.                         ->getScalarResult();
  878.                     if(count($ilan)>0) {
  879.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  880.                     }
  881.                 }
  882.                 if($sayfa['kategori']==0) {
  883.                     // Sayfa İçi
  884.                     $qb $em->createQueryBuilder();
  885.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  886.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  887.                         ->join('t.dil''d')
  888.                         ->where("t.seourl='" .$seo9"' and d.id=" $suankiDil['id'])
  889.                         ->addOrderBy('t.sira''ASC')
  890.                         ->addOrderBy('t.id''DESC')
  891.                         ->getQuery()
  892.                         ->getScalarResult();
  893.                     if(count($icerik)==0){
  894.                         return $this->redirect($this->ayarlar('siteYolu'));
  895.                     }
  896.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  897.                 }else{
  898.                     $qb $em->createQueryBuilder();
  899.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  900.                         ->from('PanelBundle:Kategori''k')
  901.                         ->join('k.dil''d')
  902.                         ->where("k.seourl='" .$seo9"' and d.id=" $suankiDil['id'])
  903.                         ->orderBy('k.sira''ASC')
  904.                         ->getQuery()
  905.                         ->getScalarResult();
  906.                     if(count($kategori)==0){
  907.                         $qb $em->createQueryBuilder();
  908.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  909.                             ->from('PanelBundle:Kategori''k')
  910.                             ->join('k.dil''d')
  911.                             ->where("k.seourl='" .$seo8"' and d.id=" $suankiDil['id'])
  912.                             ->orderBy('k.sira''ASC')
  913.                             ->getQuery()
  914.                             ->getScalarResult();
  915.                         $qb $em->createQueryBuilder();
  916.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  917.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  918.                             ->join('t.dil''d')
  919.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo9."' and d.id=" $suankiDil['id'])
  920.                             ->addOrderBy('t.sira''ASC')
  921.                             ->addOrderBy('t.id''DESC')
  922.                             ->getQuery()
  923.                             ->getScalarResult();
  924.                         if(count($kategori)<and count($icerik)<1){
  925.                             return $this->redirect($this->ayarlar('siteYolu'));
  926.                         }
  927.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  928.                     } else {
  929.                         $qb $em->createQueryBuilder();
  930.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  931.                             ->from('PanelBundle:Kategori''k')
  932.                             ->join('k.dil''d')
  933.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  934.                             ->orderBy('k.sira''ASC')
  935.                             ->getQuery()
  936.                             ->getScalarResult();
  937.                         $qb $em->createQueryBuilder();
  938.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  939.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  940.                             ->join('t.dil''d')
  941.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  942.                             ->addOrderBy('t.sira''ASC')
  943.                             ->addOrderBy('t.id''DESC')
  944.                             ->getQuery()
  945.                             ->getScalarResult();
  946.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  947.                     }
  948.                 }
  949.             }
  950.             elseif(empty($seo11)){
  951.                 $qb $em->createQueryBuilder();
  952.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  953.                     ->from('PanelBundle:VillaKategori''k')
  954.                     ->join('k.dil''d')
  955.                     ->where("k.seourl='$seo10' and d.id=" $suankiDil['id'])
  956.                     ->orderBy('k.sira''ASC')
  957.                     ->getQuery()
  958.                     ->getScalarResult();
  959.                 if(count($villa_kategoriler)>0){
  960.                     $qb $em->createQueryBuilder();
  961.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  962.                         ->from('PanelBundle:VillaKategori''k')
  963.                         ->join('k.dil''d')
  964.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  965.                         ->orderBy('k.sira''ASC')
  966.                         ->getQuery()
  967.                         ->getScalarResult();
  968.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  969.                 }else{
  970.                     $qb $em->createQueryBuilder();
  971.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  972.                         ->from('PanelBundle:Villa''i')
  973.                         ->join('i.dil''d')
  974.                         ->where("i.seo='" .$seo10"' and d.id=" $suankiDil['id'])
  975.                         ->orderBy('i.id''DESC')
  976.                         ->getQuery()
  977.                         ->getScalarResult();
  978.                     if(count($ilan)>0) {
  979.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  980.                     }
  981.                 }
  982.                 if($sayfa['kategori']==0) {
  983.                     // Sayfa İçi
  984.                     $qb $em->createQueryBuilder();
  985.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  986.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  987.                         ->join('t.dil''d')
  988.                         ->where("t.seourl='" .$seo10"' and d.id=" $suankiDil['id'])
  989.                         ->addOrderBy('t.sira''ASC')
  990.                         ->addOrderBy('t.id''DESC')
  991.                         ->getQuery()
  992.                         ->getScalarResult();
  993.                     if(count($icerik)==0){
  994.                         return $this->redirect($this->ayarlar('siteYolu'));
  995.                     }
  996.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  997.                 }else{
  998.                     $qb $em->createQueryBuilder();
  999.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1000.                         ->from('PanelBundle:Kategori''k')
  1001.                         ->join('k.dil''d')
  1002.                         ->where("k.seourl='" .$seo10"' and d.id=" $suankiDil['id'])
  1003.                         ->orderBy('k.sira''ASC')
  1004.                         ->getQuery()
  1005.                         ->getScalarResult();
  1006.                     if(count($kategori)==0){
  1007.                         $qb $em->createQueryBuilder();
  1008.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1009.                             ->from('PanelBundle:Kategori''k')
  1010.                             ->join('k.dil''d')
  1011.                             ->where("k.seourl='" .$seo9"' and d.id=" $suankiDil['id'])
  1012.                             ->orderBy('k.sira''ASC')
  1013.                             ->getQuery()
  1014.                             ->getScalarResult();
  1015.                         $qb $em->createQueryBuilder();
  1016.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1017.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1018.                             ->join('t.dil''d')
  1019.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo10."' and d.id=" $suankiDil['id'])
  1020.                             ->addOrderBy('t.sira''ASC')
  1021.                             ->addOrderBy('t.id''DESC')
  1022.                             ->getQuery()
  1023.                             ->getScalarResult();
  1024.                         if(count($kategori)<and count($icerik)<1){
  1025.                             return $this->redirect($this->ayarlar('siteYolu'));
  1026.                         }
  1027.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  1028.                     } else {
  1029.                         $qb $em->createQueryBuilder();
  1030.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1031.                             ->from('PanelBundle:Kategori''k')
  1032.                             ->join('k.dil''d')
  1033.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1034.                             ->orderBy('k.sira''ASC')
  1035.                             ->getQuery()
  1036.                             ->getScalarResult();
  1037.                         $qb $em->createQueryBuilder();
  1038.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1039.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1040.                             ->join('t.dil''d')
  1041.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1042.                             ->addOrderBy('t.sira''ASC')
  1043.                             ->addOrderBy('t.id''DESC')
  1044.                             ->getQuery()
  1045.                             ->getScalarResult();
  1046.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  1047.                     }
  1048.                 }
  1049.             }
  1050.             elseif(empty($seo12)){
  1051.                 $qb $em->createQueryBuilder();
  1052.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1053.                     ->from('PanelBundle:VillaKategori''k')
  1054.                     ->join('k.dil''d')
  1055.                     ->where("k.seourl='$seo11' and d.id=" $suankiDil['id'])
  1056.                     ->orderBy('k.sira''ASC')
  1057.                     ->getQuery()
  1058.                     ->getScalarResult();
  1059.                 if(count($villa_kategoriler)>0){
  1060.                     $qb $em->createQueryBuilder();
  1061.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1062.                         ->from('PanelBundle:VillaKategori''k')
  1063.                         ->join('k.dil''d')
  1064.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  1065.                         ->orderBy('k.sira''ASC')
  1066.                         ->getQuery()
  1067.                         ->getScalarResult();
  1068.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  1069.                 }else{
  1070.                     $qb $em->createQueryBuilder();
  1071.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  1072.                         ->from('PanelBundle:Villa''i')
  1073.                         ->join('i.dil''d')
  1074.                         ->where("i.seo='" .$seo11"' and d.id=" $suankiDil['id'])
  1075.                         ->orderBy('i.id''DESC')
  1076.                         ->getQuery()
  1077.                         ->getScalarResult();
  1078.                     if(count($ilan)>0) {
  1079.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  1080.                     }
  1081.                 }
  1082.                 if($sayfa['kategori']==0) {
  1083.                     // Sayfa İçi
  1084.                     $qb $em->createQueryBuilder();
  1085.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1086.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1087.                         ->join('t.dil''d')
  1088.                         ->where("t.seourl='" .$seo11"' and d.id=" $suankiDil['id'])
  1089.                         ->addOrderBy('t.sira''ASC')
  1090.                         ->addOrderBy('t.id''DESC')
  1091.                         ->getQuery()
  1092.                         ->getScalarResult();
  1093.                     if(count($icerik)==0){
  1094.                         return $this->redirect($this->ayarlar('siteYolu'));
  1095.                     }
  1096.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  1097.                 }else{
  1098.                     $qb $em->createQueryBuilder();
  1099.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1100.                         ->from('PanelBundle:Kategori''k')
  1101.                         ->join('k.dil''d')
  1102.                         ->where("k.seourl='" .$seo11"' and d.id=" $suankiDil['id'])
  1103.                         ->orderBy('k.sira''ASC')
  1104.                         ->getQuery()
  1105.                         ->getScalarResult();
  1106.                     if(count($kategori)==0){
  1107.                         $qb $em->createQueryBuilder();
  1108.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1109.                             ->from('PanelBundle:Kategori''k')
  1110.                             ->join('k.dil''d')
  1111.                             ->where("k.seourl='" .$seo10"' and d.id=" $suankiDil['id'])
  1112.                             ->orderBy('k.sira''ASC')
  1113.                             ->getQuery()
  1114.                             ->getScalarResult();
  1115.                         $qb $em->createQueryBuilder();
  1116.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1117.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1118.                             ->join('t.dil''d')
  1119.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo11."' and d.id=" $suankiDil['id'])
  1120.                             ->addOrderBy('t.sira''ASC')
  1121.                             ->addOrderBy('t.id''DESC')
  1122.                             ->getQuery()
  1123.                             ->getScalarResult();
  1124.                         if(count($kategori)<and count($icerik)<1){
  1125.                             return $this->redirect($this->ayarlar('siteYolu'));
  1126.                         }
  1127.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  1128.                     } else {
  1129.                         $qb $em->createQueryBuilder();
  1130.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1131.                             ->from('PanelBundle:Kategori''k')
  1132.                             ->join('k.dil''d')
  1133.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1134.                             ->orderBy('k.sira''ASC')
  1135.                             ->getQuery()
  1136.                             ->getScalarResult();
  1137.                         $qb $em->createQueryBuilder();
  1138.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1139.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1140.                             ->join('t.dil''d')
  1141.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1142.                             ->addOrderBy('t.sira''ASC')
  1143.                             ->addOrderBy('t.id''DESC')
  1144.                             ->getQuery()
  1145.                             ->getScalarResult();
  1146.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  1147.                     }
  1148.                 }
  1149.             }
  1150.             elseif(empty($seo13)){
  1151.                 $qb $em->createQueryBuilder();
  1152.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1153.                     ->from('PanelBundle:VillaKategori''k')
  1154.                     ->join('k.dil''d')
  1155.                     ->where("k.seourl='$seo12' and d.id=" $suankiDil['id'])
  1156.                     ->orderBy('k.sira''ASC')
  1157.                     ->getQuery()
  1158.                     ->getScalarResult();
  1159.                 if(count($villa_kategoriler)>0){
  1160.                     $qb $em->createQueryBuilder();
  1161.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1162.                         ->from('PanelBundle:VillaKategori''k')
  1163.                         ->join('k.dil''d')
  1164.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  1165.                         ->orderBy('k.sira''ASC')
  1166.                         ->getQuery()
  1167.                         ->getScalarResult();
  1168.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  1169.                 }else{
  1170.                     $qb $em->createQueryBuilder();
  1171.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  1172.                         ->from('PanelBundle:Villa''i')
  1173.                         ->join('i.dil''d')
  1174.                         ->where("i.seo='" .$seo12"' and d.id=" $suankiDil['id'])
  1175.                         ->orderBy('i.id''DESC')
  1176.                         ->getQuery()
  1177.                         ->getScalarResult();
  1178.                     if(count($ilan)>0) {
  1179.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  1180.                     }
  1181.                 }
  1182.                 if($sayfa['kategori']==0) {
  1183.                     // Sayfa İçi
  1184.                     $qb $em->createQueryBuilder();
  1185.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1186.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1187.                         ->join('t.dil''d')
  1188.                         ->where("t.seourl='" .$seo12"' and d.id=" $suankiDil['id'])
  1189.                         ->addOrderBy('t.sira''ASC')
  1190.                         ->addOrderBy('t.id''DESC')
  1191.                         ->getQuery()
  1192.                         ->getScalarResult();
  1193.                     if(count($icerik)==0){
  1194.                         return $this->redirect($this->ayarlar('siteYolu'));
  1195.                     }
  1196.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  1197.                 }else{
  1198.                     $qb $em->createQueryBuilder();
  1199.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1200.                         ->from('PanelBundle:Kategori''k')
  1201.                         ->join('k.dil''d')
  1202.                         ->where("k.seourl='" .$seo12"' and d.id=" $suankiDil['id'])
  1203.                         ->orderBy('k.sira''ASC')
  1204.                         ->getQuery()
  1205.                         ->getScalarResult();
  1206.                     if(count($kategori)==0){
  1207.                         $qb $em->createQueryBuilder();
  1208.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1209.                             ->from('PanelBundle:Kategori''k')
  1210.                             ->join('k.dil''d')
  1211.                             ->where("k.seourl='" .$seo11"' and d.id=" $suankiDil['id'])
  1212.                             ->orderBy('k.sira''ASC')
  1213.                             ->getQuery()
  1214.                             ->getScalarResult();
  1215.                         $qb $em->createQueryBuilder();
  1216.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1217.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1218.                             ->join('t.dil''d')
  1219.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo12."' and d.id=" $suankiDil['id'])
  1220.                             ->addOrderBy('t.sira''ASC')
  1221.                             ->addOrderBy('t.id''DESC')
  1222.                             ->getQuery()
  1223.                             ->getScalarResult();
  1224.                         if(count($kategori)<and count($icerik)<1){
  1225.                             return $this->redirect($this->ayarlar('siteYolu'));
  1226.                         }
  1227.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  1228.                     } else {
  1229.                         $qb $em->createQueryBuilder();
  1230.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1231.                             ->from('PanelBundle:Kategori''k')
  1232.                             ->join('k.dil''d')
  1233.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1234.                             ->orderBy('k.sira''ASC')
  1235.                             ->getQuery()
  1236.                             ->getScalarResult();
  1237.                         $qb $em->createQueryBuilder();
  1238.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1239.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1240.                             ->join('t.dil''d')
  1241.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1242.                             ->addOrderBy('t.sira''ASC')
  1243.                             ->addOrderBy('t.id''DESC')
  1244.                             ->getQuery()
  1245.                             ->getScalarResult();
  1246.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  1247.                     }
  1248.                 }
  1249.             }
  1250.             elseif(empty($seo14)){
  1251.                 $qb $em->createQueryBuilder();
  1252.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1253.                     ->from('PanelBundle:VillaKategori''k')
  1254.                     ->join('k.dil''d')
  1255.                     ->where("k.seourl='$seo13' and d.id=" $suankiDil['id'])
  1256.                     ->orderBy('k.sira''ASC')
  1257.                     ->getQuery()
  1258.                     ->getScalarResult();
  1259.                 if(count($villa_kategoriler)>0){
  1260.                     $qb $em->createQueryBuilder();
  1261.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1262.                         ->from('PanelBundle:VillaKategori''k')
  1263.                         ->join('k.dil''d')
  1264.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  1265.                         ->orderBy('k.sira''ASC')
  1266.                         ->getQuery()
  1267.                         ->getScalarResult();
  1268.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  1269.                 }else{
  1270.                     $qb $em->createQueryBuilder();
  1271.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  1272.                         ->from('PanelBundle:Villa''i')
  1273.                         ->join('i.dil''d')
  1274.                         ->where("i.seo='" .$seo13"' and d.id=" $suankiDil['id'])
  1275.                         ->orderBy('i.id''DESC')
  1276.                         ->getQuery()
  1277.                         ->getScalarResult();
  1278.                     if(count($ilan)>0) {
  1279.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  1280.                     }
  1281.                 }
  1282.                 if($sayfa['kategori']==0) {
  1283.                     // Sayfa İçi
  1284.                     $qb $em->createQueryBuilder();
  1285.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1286.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1287.                         ->join('t.dil''d')
  1288.                         ->where("t.seourl='" .$seo13"' and d.id=" $suankiDil['id'])
  1289.                         ->addOrderBy('t.sira''ASC')
  1290.                         ->addOrderBy('t.id''DESC')
  1291.                         ->getQuery()
  1292.                         ->getScalarResult();
  1293.                     if(count($icerik)==0){
  1294.                         return $this->redirect($this->ayarlar('siteYolu'));
  1295.                     }
  1296.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  1297.                 }else{
  1298.                     $qb $em->createQueryBuilder();
  1299.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1300.                         ->from('PanelBundle:Kategori''k')
  1301.                         ->join('k.dil''d')
  1302.                         ->where("k.seourl='" .$seo13"' and d.id=" $suankiDil['id'])
  1303.                         ->orderBy('k.sira''ASC')
  1304.                         ->getQuery()
  1305.                         ->getScalarResult();
  1306.                     if(count($kategori)==0){
  1307.                         $qb $em->createQueryBuilder();
  1308.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1309.                             ->from('PanelBundle:Kategori''k')
  1310.                             ->join('k.dil''d')
  1311.                             ->where("k.seourl='" .$seo12"' and d.id=" $suankiDil['id'])
  1312.                             ->orderBy('k.sira''ASC')
  1313.                             ->getQuery()
  1314.                             ->getScalarResult();
  1315.                         $qb $em->createQueryBuilder();
  1316.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1317.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1318.                             ->join('t.dil''d')
  1319.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo13."' and d.id=" $suankiDil['id'])
  1320.                             ->addOrderBy('t.sira''ASC')
  1321.                             ->addOrderBy('t.id''DESC')
  1322.                             ->getQuery()
  1323.                             ->getScalarResult();
  1324.                         if(count($kategori)<and count($icerik)<1){
  1325.                             return $this->redirect($this->ayarlar('siteYolu'));
  1326.                         }
  1327.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  1328.                     } else {
  1329.                         $qb $em->createQueryBuilder();
  1330.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1331.                             ->from('PanelBundle:Kategori''k')
  1332.                             ->join('k.dil''d')
  1333.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1334.                             ->orderBy('k.sira''ASC')
  1335.                             ->getQuery()
  1336.                             ->getScalarResult();
  1337.                         $qb $em->createQueryBuilder();
  1338.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1339.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1340.                             ->join('t.dil''d')
  1341.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1342.                             ->addOrderBy('t.sira''ASC')
  1343.                             ->addOrderBy('t.id''DESC')
  1344.                             ->getQuery()
  1345.                             ->getScalarResult();
  1346.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  1347.                     }
  1348.                 }
  1349.             }
  1350.             elseif(empty($seo15)){
  1351.                 $qb $em->createQueryBuilder();
  1352.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1353.                     ->from('PanelBundle:VillaKategori''k')
  1354.                     ->join('k.dil''d')
  1355.                     ->where("k.seourl='$seo14' and d.id=" $suankiDil['id'])
  1356.                     ->orderBy('k.sira''ASC')
  1357.                     ->getQuery()
  1358.                     ->getScalarResult();
  1359.                 if(count($villa_kategoriler)>0){
  1360.                     $qb $em->createQueryBuilder();
  1361.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1362.                         ->from('PanelBundle:VillaKategori''k')
  1363.                         ->join('k.dil''d')
  1364.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  1365.                         ->orderBy('k.sira''ASC')
  1366.                         ->getQuery()
  1367.                         ->getScalarResult();
  1368.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  1369.                 }else{
  1370.                     $qb $em->createQueryBuilder();
  1371.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  1372.                         ->from('PanelBundle:Villa''i')
  1373.                         ->join('i.dil''d')
  1374.                         ->where("i.seo='" .$seo14"' and d.id=" $suankiDil['id'])
  1375.                         ->orderBy('i.id''DESC')
  1376.                         ->getQuery()
  1377.                         ->getScalarResult();
  1378.                     if(count($ilan)>0) {
  1379.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  1380.                     }
  1381.                 }
  1382.                 if($sayfa['kategori']==0) {
  1383.                     // Sayfa İçi
  1384.                     $qb $em->createQueryBuilder();
  1385.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1386.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1387.                         ->join('t.dil''d')
  1388.                         ->where("t.seourl='" .$seo14"' and d.id=" $suankiDil['id'])
  1389.                         ->addOrderBy('t.sira''ASC')
  1390.                         ->addOrderBy('t.id''DESC')
  1391.                         ->getQuery()
  1392.                         ->getScalarResult();
  1393.                     if(count($icerik)==0){
  1394.                         return $this->redirect($this->ayarlar('siteYolu'));
  1395.                     }
  1396.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  1397.                 }else{
  1398.                     $qb $em->createQueryBuilder();
  1399.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1400.                         ->from('PanelBundle:Kategori''k')
  1401.                         ->join('k.dil''d')
  1402.                         ->where("k.seourl='" .$seo14"' and d.id=" $suankiDil['id'])
  1403.                         ->orderBy('k.sira''ASC')
  1404.                         ->getQuery()
  1405.                         ->getScalarResult();
  1406.                     if(count($kategori)==0){
  1407.                         $qb $em->createQueryBuilder();
  1408.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1409.                             ->from('PanelBundle:Kategori''k')
  1410.                             ->join('k.dil''d')
  1411.                             ->where("k.seourl='" .$seo13"' and d.id=" $suankiDil['id'])
  1412.                             ->orderBy('k.sira''ASC')
  1413.                             ->getQuery()
  1414.                             ->getScalarResult();
  1415.                         $qb $em->createQueryBuilder();
  1416.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1417.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1418.                             ->join('t.dil''d')
  1419.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo14."' and d.id=" $suankiDil['id'])
  1420.                             ->addOrderBy('t.sira''ASC')
  1421.                             ->addOrderBy('t.id''DESC')
  1422.                             ->getQuery()
  1423.                             ->getScalarResult();
  1424.                         if(count($kategori)<and count($icerik)<1){
  1425.                             return $this->redirect($this->ayarlar('siteYolu'));
  1426.                         }
  1427.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  1428.                     } else {
  1429.                         $qb $em->createQueryBuilder();
  1430.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1431.                             ->from('PanelBundle:Kategori''k')
  1432.                             ->join('k.dil''d')
  1433.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1434.                             ->orderBy('k.sira''ASC')
  1435.                             ->getQuery()
  1436.                             ->getScalarResult();
  1437.                         $qb $em->createQueryBuilder();
  1438.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1439.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1440.                             ->join('t.dil''d')
  1441.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1442.                             ->addOrderBy('t.sira''ASC')
  1443.                             ->addOrderBy('t.id''DESC')
  1444.                             ->getQuery()
  1445.                             ->getScalarResult();
  1446.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  1447.                     }
  1448.                 }
  1449.             }
  1450.             else{
  1451.                 $qb $em->createQueryBuilder();
  1452.                 $villa_kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1453.                     ->from('PanelBundle:VillaKategori''k')
  1454.                     ->join('k.dil''d')
  1455.                     ->where("k.seourl='$seo15' and d.id=" $suankiDil['id'])
  1456.                     ->orderBy('k.sira''ASC')
  1457.                     ->getQuery()
  1458.                     ->getScalarResult();
  1459.                 if(count($villa_kategoriler)>0){
  1460.                     $qb $em->createQueryBuilder();
  1461.                     $villa_kategorileri $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim')
  1462.                         ->from('PanelBundle:VillaKategori''k')
  1463.                         ->join('k.dil''d')
  1464.                         ->where("k.ustid='".$villa_kategoriler[0]['dilgrup']."' and d.id=" $suankiDil['id'])
  1465.                         ->orderBy('k.sira''ASC')
  1466.                         ->getQuery()
  1467.                         ->getScalarResult();
  1468.                     return $this->render('@Site/Sites/ilanKategori.html.twig',array('kategori'=>$villa_kategoriler[0],'kategoriler'=>$villa_kategorileri));
  1469.                 }else{
  1470.                     $qb $em->createQueryBuilder();
  1471.                     $ilan $qb->select('i.id,i.adi,i.title,i.seo,i.keywords,i.description,i.metin,i.girisTarihi,i.cikisTarihi,i.depozito,i.temizlik,i.havuzbahceBakim,i.konum,i.kisi,i.yatak,i.banyo,i.dilgrup,i.kategoriId,i.resimler,i.durum,i.ozellikler,i.yasaklar,i.il,i.ilce,i.semt')
  1472.                         ->from('PanelBundle:Villa''i')
  1473.                         ->join('i.dil''d')
  1474.                         ->where("i.seo='" .$seo15"' and d.id=" $suankiDil['id'])
  1475.                         ->orderBy('i.id''DESC')
  1476.                         ->getQuery()
  1477.                         ->getScalarResult();
  1478.                     if(count($ilan)>0) {
  1479.                         return $this->render('@Site/Sites/ilan.html.twig', array('ilan' => $ilan[0]));
  1480.                     }
  1481.                 }
  1482.                 if($sayfa['kategori']==0) {
  1483.                     // Sayfa İçi
  1484.                     $qb $em->createQueryBuilder();
  1485.                     $icerik $qb->select(implode(',',$icerikalani).',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1486.                         ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1487.                         ->join('t.dil''d')
  1488.                         ->where("t.seourl='" .$seo15"' and d.id=" $suankiDil['id'])
  1489.                         ->addOrderBy('t.sira''ASC')
  1490.                         ->addOrderBy('t.id''DESC')
  1491.                         ->getQuery()
  1492.                         ->getScalarResult();
  1493.                     if(count($icerik)==0){
  1494.                         return $this->redirect($this->ayarlar('siteYolu'));
  1495.                     }
  1496.                     return $this->render('@Site/Sites/'.$view.'_ic.html.twig',array('sayfa'=>$sayfa,'icerik'=>$icerik[0]));
  1497.                 }else{
  1498.                     $qb $em->createQueryBuilder();
  1499.                     $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1500.                         ->from('PanelBundle:Kategori''k')
  1501.                         ->join('k.dil''d')
  1502.                         ->where("k.seourl='" .$seo15"' and d.id=" $suankiDil['id'])
  1503.                         ->orderBy('k.sira''ASC')
  1504.                         ->getQuery()
  1505.                         ->getScalarResult();
  1506.                     if(count($kategori)==0){
  1507.                         $qb $em->createQueryBuilder();
  1508.                         $kategori $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1509.                             ->from('PanelBundle:Kategori''k')
  1510.                             ->join('k.dil''d')
  1511.                             ->where("k.seourl='" .$seo14"' and d.id=" $suankiDil['id'])
  1512.                             ->orderBy('k.sira''ASC')
  1513.                             ->getQuery()
  1514.                             ->getScalarResult();
  1515.                         $qb $em->createQueryBuilder();
  1516.                         $icerik $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1517.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1518.                             ->join('t.dil''d')
  1519.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and t.seourl='".$seo15."' and d.id=" $suankiDil['id'])
  1520.                             ->addOrderBy('t.sira''ASC')
  1521.                             ->addOrderBy('t.id''DESC')
  1522.                             ->getQuery()
  1523.                             ->getScalarResult();
  1524.                         if(count($kategori)<and count($icerik)<1){
  1525.                             return $this->redirect($this->ayarlar('siteYolu'));
  1526.                         }
  1527.                         return $this->render('@Site/Sites/' $view '_ic.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerik' => $icerik[0]));
  1528.                     } else {
  1529.                         $qb $em->createQueryBuilder();
  1530.                         $kategoriler $qb->select('k.dilgrup,k.adi,k.seourl,k.sayfabasligi,k.anahtarkelimeler,k.sayfaaciklamasi,k.ustid,k.resim,k.sayfaId')
  1531.                             ->from('PanelBundle:Kategori''k')
  1532.                             ->join('k.dil''d')
  1533.                             ->where("k.ustid=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1534.                             ->orderBy('k.sira''ASC')
  1535.                             ->getQuery()
  1536.                             ->getScalarResult();
  1537.                         $qb $em->createQueryBuilder();
  1538.                         $icerikler $qb->select(implode(','$icerikalani) . ',t.dilgrup,t.kategoriId,d.id as did,t.sayfaId')
  1539.                             ->from('PanelBundle:' $sayfa['tabloAdi'], 't')
  1540.                             ->join('t.dil''d')
  1541.                             ->where("t.kategoriId=" $kategori[0]['dilgrup'] . " and d.id=" $suankiDil['id'])
  1542.                             ->addOrderBy('t.sira''ASC')
  1543.                             ->addOrderBy('t.id''DESC')
  1544.                             ->getQuery()
  1545.                             ->getScalarResult();
  1546.                         return $this->render('@Site/Sites/' $view '_kategori.html.twig', array('sayfa' => $sayfa'kategori' => $kategori[0], 'icerikler' => $icerikler'kategoriler' => $kategoriler));
  1547.                     }
  1548.                 }
  1549.             }
  1550.         }
  1551.         return new Response('');
  1552.     }
  1553.     public function formKayitAction($dil='',Request $veri){
  1554.         $em $this->getDoctrine()->getManager();
  1555.         if($dil==''){
  1556.             $qb $em->createQueryBuilder();
  1557.             $dill=$qb->select('d.id,d.kisa,d.uzun')
  1558.                 ->from('PanelBundle:Dil''d')
  1559.                 ->where('d.varsayilan=1 and d.aktif=1')
  1560.                 ->orderBy('d.aktif','DESC')
  1561.                 ->getQuery()
  1562.                 ->getScalarResult();
  1563.             $dil $dill[0]['id'];
  1564.             $this->get('session')->set('dil',$dill[0]);
  1565.         }else{
  1566.             $qb $em->createQueryBuilder();
  1567.             $dill=$qb->select('d.id,d.kisa,d.uzun')
  1568.                 ->from('PanelBundle:Dil''d')
  1569.                 ->where("d.kisa='$dil' and d.aktif=1")
  1570.                 ->orderBy('d.aktif','DESC')
  1571.                 ->getQuery()
  1572.                 ->getScalarResult();
  1573.             if(count($dill)>0){
  1574.                 $dil $dill[0]['id'];
  1575.                 $this->get('session')->set('dil',$dill[0]);
  1576.             }else{
  1577.                 return $this->redirect($this->ayarlar('siteYolu'));
  1578.             }
  1579.         }
  1580.         $id $veri->request->get('id');
  1581.         $response=$veri->request->get("g-recaptcha-response");
  1582.         $secret="6LcPodIUAAAAALHNzkiwoFvECemw3Gu93EfgJFKD";
  1583.         $remoteip=$_SERVER["REMOTE_ADDR"];
  1584.         $ch curl_init();
  1585.         curl_setopt($chCURLOPT_URL"https://www.google.com/recaptcha/api/siteverify?secret=$secret&response=$response&remoteip=$remoteip");
  1586.         curl_setopt($chCURLOPT_RETURNTRANSFER1);
  1587.         $output curl_exec($ch);
  1588.         curl_close($ch);
  1589.         $result=json_decode($output);
  1590.         if($result->success==1)
  1591.         {
  1592.         $qb $em->createQueryBuilder();
  1593.         $form=$qb->select('f.adi,f.tip,f.veri,f.alan,f.zorunlu,f.eposta')
  1594.             ->from('PanelBundle:Form''f')
  1595.             ->where("f.id =".$id)
  1596.             ->getQuery()
  1597.             ->getScalarResult();
  1598.         $tipler explode('~',$form[0]['tip']);
  1599.         $alanlar explode('~',$form[0]['alan']);
  1600.         $kayit=[];
  1601.         $eposta_metin='';
  1602.         foreach ($tipler as $key=>$tip){
  1603.             if($tip=='input'){
  1604.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1605.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1606.             }
  1607.             elseif($tip=='inputPhone'){
  1608.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1609.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1610.             }
  1611.             elseif($tip=='inputEmail'){
  1612.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1613.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1614.             }
  1615.             elseif($tip=='inputNumeric'){
  1616.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1617.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1618.             }
  1619.             elseif($tip=='inputPrice'){
  1620.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1621.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1622.             }
  1623.             elseif($tip=='inputDate'){
  1624.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1625.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1626.             }
  1627.             elseif($tip=='textarea'){
  1628.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1629.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1630.             }
  1631.             elseif($tip=='select'){
  1632.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1633.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1634.             }
  1635.             elseif($tip=='checkbox'){
  1636.                 $kayit[] = implode(',',$veri->request->get($this->seo($alanlar[$key])));
  1637.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.implode(',',$veri->request->get($this->seo($alanlar[$key]))).'<br>';
  1638.             }
  1639.             elseif($tip=='radio'){
  1640.                 $kayit[] = $veri->request->get($this->seo($alanlar[$key]));
  1641.                 $eposta_metin .= '<b>'.$alanlar[$key].'</b>: '.$veri->request->get($this->seo($alanlar[$key])).'<br>';
  1642.             }
  1643.             elseif($tip=='file'){
  1644.                 if (!empty($_FILES[$this->seo($alanlar[$key])]['name'])) {
  1645.                     $dosya $this->seo($this->seo($alanlar[$key])) . '_' time() . '_' $this->uzantiBul($_FILES[$this->seo($alanlar[$key])]['type']);
  1646.                     move_uploaded_file($_FILES[$this->seo($alanlar[$key])]['tmp_name'], "uploads/" $dosya "");
  1647.                     $kayit[] = $dosya;
  1648.                     $eposta_metin .= '<b>'.$alanlar[$key].'</b>: <a target="_blank" href="'.$this->ayarlar('siteYolu').'uploads/'.$dosya.'"><img src="'.$this->ayarlar('siteYolu').'uploads/'.$dosya.'"></a><br>';
  1649.                 }else{
  1650.                     $kayit[] = '';
  1651.                     $eposta_metin .= '<b>'.$alanlar[$key].'</b>:';
  1652.                 }
  1653.             }
  1654.         }
  1655.         $ff $em->getReference('PanelBundle:Form',$id);
  1656.         $formKayit = new FormKayit();
  1657.         $formKayit->setForm($ff);
  1658.         $formKayit->setOkuma(0);
  1659.         $formKayit->setTarih(new \DateTime('now'));
  1660.         $formKayit->setKayit(implode('~',$kayit));
  1661.         $em->persist($formKayit);
  1662.         $em->flush();
  1663.             if ($form[0]['eposta']==1){
  1664.                 $message = \Swift_Message::newInstance()
  1665.                     ->setSubject($form[0]['adi'].' - '.$this->ayarlar('siteAdi'))
  1666.                     ->setFrom(array($this->ayarlar('sistemPosta')=>$this->ayarlar('siteAdi')))
  1667.                     ->setTo(array($this->iletisimBilgileri('eposta')=>$this->ayarlar('siteAdi')))
  1668.                     ->setBody($this->renderView('@Site/Base/formMail.html.twig', array('konu' => $form[0]['adi'],'icerik'=>$eposta_metin)), 'text/html');
  1669.                 $this->get('mailer')->send($message);
  1670.             }
  1671.             $status=1;
  1672.         }
  1673.         else {
  1674.             $status=0;
  1675.         }
  1676.         return $this->render('@Site/Base/formReturn.html.twig',array('status'=>$status,'referer'=>$_SERVER['HTTP_REFERER']));
  1677.     }
  1678.     public function ilanGetirAction($dil='',Request $request){
  1679.         $em $this->getDoctrine()->getManager();
  1680.         $dil $this->get('session')->get('dil');
  1681.         $siralama $request->request->get('siralama');
  1682.         $ozellik $request->request->get('ozellik');
  1683.         $minFiyat $request->request->get('minFiyat');
  1684.         $maxFiyat $request->request->get('maxFiyat');
  1685.         $kategori $request->request->get('kategori');
  1686.         $girisTarihi $request->request->get('girisTarihi');
  1687.         $cikisTarihi $request->request->get('cikisTarihi');
  1688.         $uc_gun $request->request->get('uc_gun');
  1689.         $kategoriler $kategori.$this->villa_kategoriIleri($kategori);
  1690.         $sql  =' and i.kategoriId in('.$kategoriler.')';
  1691.         $semt $request->request->get('semt');
  1692.         if(!empty($semt)){
  1693.             $sql.=' and i.semt='.$semt;
  1694.         }
  1695.         $yetiskinSayisi intval($request->request->get('yetiskinSayisi'));
  1696.         $cocukSayisi floor(intval($request->request->get('cocukSayisi'))/2);
  1697.         $kisiSayisi $yetiskinSayisi+$cocukSayisi;
  1698.         $sql.=' and i.kisi>='.$kisiSayisi;
  1699.         $qb $em->createQueryBuilder();
  1700.         $ilanlar $qb->select('i.adi,i.resimler,i.kisi,i.yatak,i.banyo,i.semt,i.ilce,i.il,i.kategoriId,i.seo,i.dilgrup,i.ozellikler')
  1701.             ->from('PanelBundle:Villa''i')
  1702.             ->join('i.dil''d')
  1703.             ->where('i.durum=1 and d.id=' $dil['id'].$sql)
  1704.             ->orderBy('i.id','DESC')
  1705.             ->getQuery()
  1706.             ->setResultCacheId('ilanGetirr')
  1707.             ->setResultCacheLifetime(60)
  1708.             ->getScalarResult();
  1709.         foreach ($ilanlar as $key=>$ilan){
  1710.             $f1 $this->ilan_fiyatBul($ilan['dilgrup'])[0];
  1711.             $f2 $this->ilan_fiyatBul($ilan['dilgrup'])[1];
  1712.             $ilanlar[$key]['fiyat1']=$f1;
  1713.             $ilanlar[$key]['fiyat2']=$f2;
  1714.             if ($siralama!='id') {
  1715.                 if ($siralama=='fasc' or $siralama=='fdesc'){
  1716.                     $degisken[$key] = $f1;
  1717.                 }else{
  1718.                     $degisken[$key] = $ilan['adi'];
  1719.                 }
  1720.             }
  1721.         }
  1722.         if ($siralama!='id'){
  1723.             if ($siralama=='idesc' or $siralama=='fdesc') {
  1724.                 array_multisort($degiskenSORT_DESC$ilanlar);
  1725.             }else{
  1726.                 array_multisort($degiskenSORT_ASC$ilanlar);
  1727.             }
  1728.         }
  1729.         return $this->render('@Site/Sites/ilanGetir.html.twig',array('ilanlar'=>$ilanlar,'minFiyat'=>doubleval($minFiyat),'maxFiyat'=>doubleval($maxFiyat),'ozellik'=>$ozellik,'girisTarihi'=>$girisTarihi,'cikisTarihi'=>$cikisTarihi,'uc_gun'=>$uc_gun));
  1730.     }
  1731.     public function rezSorgulaAction(Request $request){
  1732.         $em $this->getDoctrine()->getManager();
  1733.         $dil $this->get('session')->get('dil');
  1734.         $dilgrup $request->request->get('dilgrup');
  1735.         $girisTarihi = new \DateTime($request->request->get('girisTarihi').' 00:00:00');
  1736.         $cikisTarihi = new \DateTime($request->request->get('cikisTarihi').' 00:00:00');
  1737.         $fark date_diff($girisTarihi$cikisTarihi);
  1738.         $yetiskinSayisi intval($request->request->get('yetiskinSayisi'));
  1739.         $cocukSayisi floor(intval($request->request->get('cocukSayisi'))/2);
  1740.         $kisiSayisi $yetiskinSayisi+$cocukSayisi;
  1741.         /// rezervasyon sorgusu
  1742.         $qb $em->createQueryBuilder();
  1743.         $ilan $qb->select('i.kisi')
  1744.             ->from('PanelBundle:Villa''i')
  1745.             ->join('i.dil''d')
  1746.             ->where('i.durum=1 and d.id=' $dil['id'].' and i.dilgrup='.$dilgrup)
  1747.             ->orderBy('i.id','DESC')
  1748.             ->getQuery()
  1749.             ->setResultCacheId('rezSor2')
  1750.             ->setResultCacheLifetime(60)
  1751.             ->getScalarResult();
  1752.         if($kisiSayisi>$ilan[0]['kisi']){
  1753.             return new Response('<div class="alert alert-danger">Kişi sayısı çok fazla!</div>');
  1754.         }
  1755.         $qb $em->createQueryBuilder();
  1756.         $fiyatlar $qb->select('f.baslangicTarihi,f.bitisTarihi,f.minGece,f.fiyat')
  1757.             ->from('PanelBundle:Fiyat''f')
  1758.             ->where('f.ay='.$cikisTarihi->format('m').' and f.icerikId='.$dilgrup)
  1759.             ->orderBy('f.ay','ASC')
  1760.             ->getQuery()
  1761.             ->setResultCacheId('rezSor3')
  1762.             ->setResultCacheLifetime(60)
  1763.             ->getScalarResult();
  1764.        if(count($fiyatlar)==0){
  1765.            return new Response('<div class="alert alert-danger">Belirtilen giriş/çıkış ayında hiç fiyat belirlenmemiş. Kiralanamaz.</div>');
  1766.        }
  1767.        $fiyatt '';
  1768.        foreach ($fiyatlar as $fiyat){
  1769.           $baslangic=explode('/',$fiyat['baslangicTarihi']);
  1770.           $bitis=explode('/',$fiyat['bitisTarihi']);
  1771.            $baslangicTarihi=new \DateTime(date('Y').'-'.$baslangic[1].'-'.$baslangic[0].' 00:00:00');
  1772.            $bitisTarihi=new \DateTime(date('Y').'-'.$bitis[1].'-'.$bitis[0].' 00:00:00');
  1773.            if ($cikisTarihi->format('U') >= $baslangicTarihi->format('U') and $cikisTarihi->format('U') <= $bitisTarihi->format('U')){
  1774.                 $fiyatt $fiyat;
  1775.            }
  1776.        }
  1777.        if(!empty($fiyatt)){
  1778.            if ($fark->format('%a') < $fiyatt['minGece']){
  1779.                return new Response('<div class="alert alert-danger">Minimum '.$fiyatt['minGece'].' gece kiralanabilir.</div>');
  1780.            }
  1781.        }
  1782.         return $this->render('@Site/Sites/rezForm.html.twig',array('fiyat'=>$fiyatt,'gunluk'=>$fark->format('%a')));
  1783.     }
  1784.     public function talepGonderAction(Request $request)
  1785.     {
  1786.         $em $this->getDoctrine()->getManager();
  1787.         $dil $this->get('session')->get('dil');
  1788.         $ilan $request->request->get('ilan');
  1789.         $girisTarihi = new \DateTime($request->request->get('girisTarihi') . ' 00:00:00');
  1790.         $cikisTarihi = new \DateTime($request->request->get('cikisTarihi') . ' 00:00:00');
  1791.         $yetiskinSayisi intval($request->request->get('yetiskinSayisi'));
  1792.         $cocukSayisi intval($request->request->get('cocukSayisi'));
  1793.         $toplam $request->request->get('toplam');
  1794.         $kapora $request->request->get('kapora');
  1795.         $kalan $request->request->get('kalan');
  1796.         $adsoyad $request->request->get('adsoyad');
  1797.         $telefon $request->request->get('telefon');
  1798.         $eposta $request->request->get('eposta');
  1799.         $odemesekli $request->request->get('odemesekli');
  1800.         $gece $request->request->get('gece');
  1801.         $mesaj $request->request->get('mesaj');
  1802.         if (empty($mesaj)){ $mesaj=null; }
  1803.         $rez = new Rezervasyon();
  1804.         $rez->setIlanId($ilan);
  1805.         $rez->setGirisTarihi($girisTarihi);
  1806.         $rez->setCikisTarihi($cikisTarihi);
  1807.         $rez->setYetiskinSayisi($yetiskinSayisi);
  1808.         $rez->setCocukSayisi($cocukSayisi);
  1809.         $rez->setDurum(0);
  1810.         $rez->setAdsoyad($adsoyad);
  1811.         $rez->setEposta($eposta);
  1812.         $rez->setTelefon($telefon);
  1813.         $rez->setOdemeSekli($odemesekli);
  1814.         $rez->setMesaj($mesaj);
  1815.         $rez->setFiyat($toplam);
  1816.         $rez->setKapora($kapora);
  1817.         $rez->setKalan($kalan);
  1818.         $rez->setGece($gece);
  1819.         $em->persist($rez);
  1820.         $em->flush();
  1821.         return new Response('');
  1822.     }
  1823.     public function rezTakipAction(Request $request)
  1824.     {
  1825.         $em $this->getDoctrine()->getManager();
  1826.         $dil $this->get('session')->get('dil');
  1827.         $eposta $request->request->get('eposta');
  1828.         $onayKodu $request->request->get('onayKodu');
  1829.         $qb $em->createQueryBuilder();
  1830.         $rezervasyon=$qb->select('r.girisTarihi,r.cikisTarihi,r.yetiskinSayisi,r.cocukSayisi,r.durum,r.adsoyad,r.eposta,r.telefon,r.odemeSekli,r.mesaj,r.fiyat,r.kapora,r.gece,r.kalan,r.id,r.onayKodu,r.ilanId')
  1831.             ->from('PanelBundle:Rezervasyon''r')
  1832.             ->where("r.eposta='$eposta' and r.onayKodu='$onayKodu'")
  1833.             ->getQuery()
  1834.             ->getScalarResult();
  1835.         if (count($rezervasyon)==0){
  1836.             return new Response(1);
  1837.         }
  1838.         return $this->render('@Site/Sites/rezTakip.html.twig',array('rezervasyon'=>$rezervasyon[0]));
  1839.     }
  1840.     public function hizliAramaAction($dil='',Request $request)
  1841.     {
  1842.         $em $this->getDoctrine()->getManager();
  1843.         $dil $this->get('session')->get('dil');
  1844.         $arama = [];
  1845.         $arama['bolge'] = $request->request->get('bolge');
  1846.         $arama['girisTarihi'] = $request->request->get('girisTarihi');
  1847.         $arama['cikisTarihi'] = $request->request->get('cikisTarihi');
  1848.         $arama['yetiskinSayisi'] = $request->request->get('yetiskinSayisi');
  1849.         $this->get('session')->set('arama',$arama);
  1850.         return new Response('');
  1851.     }
  1852. }