src/Troika/RealEstateBundle/Controller/LotController.php line 19

Open in your IDE?
  1. <?php
  2. namespace Troika\RealEstateBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  6. class LotController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
  7. {
  8.     private function _model($name)
  9.     {
  10.         return $this
  11.           ->container
  12.           ->get($name '.model');
  13.     }
  14.     public function cityAction($id)
  15.     {
  16.         $lot $this
  17.           ->_model('lot')
  18.           ->getByBid($id);
  19.         if ($lot) {
  20.             switch ($lot->getTypeLot()->getId()) {
  21.                 case 1:
  22.                     $url "/elit_kvartiry/";
  23.                     break;
  24.                 case 2:
  25.                     $url "/zagorodnaya_nedvizhimost/";
  26.                     break;
  27.                 case 3:
  28.                     $url "/commercial_nedvigimost/";
  29.                     break;
  30.                 case 4:
  31.                     $url "/zarubezhnaya_nedvizhimost/";
  32.                     break;
  33.             }
  34.             //if ($url) {
  35.             //    $url .= $lot->getId();
  36.             //    return $this->redirect($url, 301);
  37.             //}
  38.         }
  39.         $lot $this
  40.           ->_model('lot')
  41.           ->getForTypeById($id1);
  42.         if (empty($lot)) {
  43.             throw new NotFoundHttpException();
  44.         }
  45.         $similar $this
  46.           ->_model('lot')
  47.           ->getSimilar($lot);
  48.         $ogImg '#';
  49.         $photos $lot->getPhotos();
  50.         if (!empty($photos)) {
  51.             foreach ($photos as $photo) {
  52.                 if ($ogImg === '#') {
  53.                     $ogImg $photo->getWebPathImage();
  54.                     if ($photo->getIsMain()) {
  55.                         break;
  56.                     }
  57.                 } elseif ($photo->getIsMain()) {
  58.                     $ogImg $photo->getWebPathImage();
  59.                     break;
  60.                 }
  61.             }
  62.         }
  63.         $page $this->getDoctrine()->getRepository('TroikaMainBundle:MainPage')->find(2);
  64.         return $this->render(
  65.           'TroikaRealEstateBundle:EstateLot:city.html.twig',
  66.           [
  67.             'ogImg' => $ogImg,
  68.             'lot' => $lot,
  69.             'similar' => $similar,
  70.             'page'=>$page,
  71.             'islot' => true
  72.           ]
  73.         );
  74.     }
  75.     public function cityPdfAction($id)
  76.     {
  77.         $lot $this
  78.           ->_model('lot')
  79.           ->getForTypeById($id1);
  80.         if (!$lot) {
  81.             throw new NotFoundHttpException();
  82.         }
  83.         return $this->render('TroikaRealEstateBundle:EstateLot:city.pdf.twig', ['lot' => $lot]);
  84.     }
  85.     public function cityPdf_Action($id)
  86.     {
  87.         $lot $this
  88.           ->_model('lot')
  89.           ->getForTypeById($id1);
  90.         if (!$lot) {
  91.             throw new NotFoundHttpException();
  92.         }
  93.         return $this->render('TroikaRealEstateBundle:EstateLot:city_new.pdf.twig', ['lot' => $lot]);
  94.     }
  95.     public function commercialAction($id)
  96.     {
  97.         $lot $this
  98.           ->_model('lot')
  99.           ->getByBid($id);
  100.         if ($lot) {
  101.             switch ($lot->getTypeLot()->getId()) {
  102.                 case 1:
  103.                     $url "/elit_kvartiry/";
  104.                     break;
  105.                 case 2:
  106.                     $url "/zagorodnaya_nedvizhimost/";
  107.                     break;
  108.                 case 3:
  109.                     $url "/commercial_nedvigimost/";
  110.                     break;
  111.                 case 4:
  112.                     $url "/zarubezhnaya_nedvizhimost/";
  113.                     break;
  114.             }
  115.             //if ($url) {
  116.             //    $url .= $lot->getId();
  117.             //    return  $this->redirect($url, 301);
  118.             //}
  119.         }
  120.         $lot $this
  121.           ->_model('lot')
  122.           ->getForTypeById($id3);
  123.         if (!$lot) {
  124.             throw new NotFoundHttpException();
  125.         }
  126.         $similar $this
  127.           ->_model('lot')
  128.           ->getSimilarCom($lot);
  129.         $ogImg '';
  130.         foreach ($lot->getPhotos() as $photo) {
  131.             if ($photo->getIsMain()) {
  132.                 $ogImg $photo->getWebPathImage();
  133.             }
  134.         }
  135.         // var_dump($similar->lenght);
  136.         $page $this->getDoctrine()->getRepository('TroikaMainBundle:MainPage')->find(2);
  137.         return $this->render(
  138.           'TroikaRealEstateBundle:EstateLot:commercial.html.twig',
  139.           ['ogImg' => $ogImg'lot' => $lot'similar' => $similar,'page'=>$page,'islot' => true]
  140.         );
  141.     }
  142.     public function commercialPdfAction($id)
  143.     {
  144.         $lot $this
  145.           ->_model('lot')
  146.           ->getForTypeById($id3);
  147.         if (!$lot) {
  148.             throw new NotFoundHttpException();
  149.         }
  150.         return $this->render('TroikaRealEstateBundle:EstateLot:commercial.pdf.twig', ['lot' => $lot]);
  151.     }
  152.     public function commercialPdf_Action($id)
  153.     {
  154.         $lot $this
  155.           ->_model('lot')
  156.           ->getForTypeById($id3);
  157.         if (!$lot) {
  158.             throw new NotFoundHttpException();
  159.         }
  160.         return $this->render('TroikaRealEstateBundle:EstateLot:commercial_new.pdf.twig', ['lot' => $lot]);
  161.     }
  162.     public function favePdfAction(Request $request)
  163.     {
  164.         $lots $request->get('lots');
  165.         $lots $this->container->get('lot.model')->getFave($lots);
  166.         return $this->render('TroikaRealEstateBundle:EstateList:fave.pdf.twig', ['lots' => $lots]);
  167.     }
  168.     public function foreignAction($id)
  169.     {
  170.         $lot $this
  171.           ->_model('lot')
  172.           ->getByBid($id);
  173.         if ($lot) {
  174.             switch ($lot->getTypeLot()->getId()) {
  175.                 case 1:
  176.                     $url "/elit_kvartiry/";
  177.                     break;
  178.                 case 2:
  179.                     $url "/zagorodnaya_nedvizhimost/";
  180.                     break;
  181.                 case 3:
  182.                     $url "/commercial_nedvigimost/";
  183.                     break;
  184.                 case 4:
  185.                     $url "/zarubezhnaya_nedvizhimost/";
  186.                     break;
  187.             }
  188.             //if ($url) {
  189.             //    $url .= $lot->getId();
  190.             //    return $this->redirect($url, 301);
  191.             //}
  192.         }
  193.         $lot $this
  194.           ->_model('lot')
  195.           ->getForTypeById($id4);
  196.         if (!$lot) {
  197.             throw new NotFoundHttpException();
  198.         }
  199.         $similar $this
  200.           ->_model('lot')
  201.           ->getSimilar($lot);
  202.         $ogImg '';
  203.         foreach ($lot->getPhotos() as $photo) {
  204.             if ($photo->getIsMain()) {
  205.                 $ogImg $photo->getWebPathImage();
  206.             }
  207.         }
  208.         $page $this->getDoctrine()->getRepository('TroikaMainBundle:MainPage')->find(2);
  209.         return $this->render('TroikaRealEstateBundle:EstateLot:foreign.html.twig', ['ogImg' => $ogImg'lot' => $lot'similar' => $similar,'page'=>$page,'islot' => true]
  210.         );
  211.     }
  212.     public function foreignPdfAction($id)
  213.     {
  214.         $lot $this
  215.           ->_model('lot')
  216.           ->getForTypeById($id4);
  217.         if (!$lot) {
  218.             throw new NotFoundHttpException();
  219.         }
  220.         return $this->render('TroikaRealEstateBundle:EstateLot:foreign.pdf.twig', ['lot' => $lot]);
  221.     }
  222.     public function foreignPdf_Action($id)
  223.     {
  224.         $lot $this
  225.           ->_model('lot')
  226.           ->getForTypeById($id4);
  227.         if (!$lot) {
  228.             throw new NotFoundHttpException();
  229.         }
  230.         return $this->render('TroikaRealEstateBundle:EstateLot:foreign_new.pdf.twig', ['lot' => $lot]);
  231.     }
  232.     public function suburbanAction($id)
  233.     {
  234.         $lot $this
  235.           ->_model('lot')
  236.           ->getByBid($id);
  237.         if ($lot) {
  238.             switch ($lot->getTypeLot()->getId()) {
  239.                 case 1:
  240.                     $url "/elit_kvartiry/";
  241.                     break;
  242.                 case 2:
  243.                     $url "/zagorodnaya_nedvizhimost/";
  244.                     break;
  245.                 case 3:
  246.                     $url "/commercial_nedvigimost/";
  247.                     break;
  248.                 case 4:
  249.                     $url "/zarubezhnaya_nedvizhimost/";
  250.                     break;
  251.             }
  252.             //if ($url) {
  253.             //    $url .= $lot->getId();
  254.             //    return $this->redirect($url, 301);
  255.             //}
  256.         }
  257.         if ($id == 851) {
  258.             return $this->redirect("/zagorodnaya_nedvizhimost/1019/"301);
  259.         }
  260.         $lot $this
  261.           ->_model('lot')
  262.           ->getForTypeById($id2);
  263.         if (!$lot) {
  264.             throw new NotFoundHttpException();
  265.         }
  266.         $similar $this
  267.           ->_model('lot')
  268.           ->getSimilar($lot);
  269.         $ogImg '';
  270.         foreach ($lot->getPhotos() as $photo) {
  271.             if ($photo->getIsMain()) {
  272.                 $ogImg $photo->getWebPathImage();
  273.             }
  274.         }
  275.         $page $this->getDoctrine()->getRepository('TroikaMainBundle:MainPage')->find(2);
  276.         return $this->render(
  277.           'TroikaRealEstateBundle:EstateLot:suburban.html.twig',
  278.           ['ogImg' => $ogImg'lot' => $lot'similar' => $similar,'page'=>$page,'islot' => true]
  279.         );
  280.     }
  281.     public function suburbanPdfAction($id)
  282.     {
  283.         $lot $this
  284.           ->_model('lot')
  285.           ->getForTypeById($id2);
  286.         if (!$lot) {
  287.             throw new NotFoundHttpException();
  288.         }
  289.         return $this->render('TroikaRealEstateBundle:EstateLot:suburban.pdf.twig', ['lot' => $lot]);
  290.     }
  291.     public function suburbanPdf_Action($id)
  292.     {
  293.         $lot $this
  294.           ->_model('lot')
  295.           ->getForTypeById($id2);
  296.         if (!$lot) {
  297.             throw new NotFoundHttpException();
  298.         }
  299.         return $this->render('TroikaRealEstateBundle:EstateLot:suburban_new.pdf.twig', ['lot' => $lot]);
  300.     }
  301. }
dobrowin | betleao | moverbet | winzada 777 | supremo | casadeapostas | dobrowin | betleao | moverbet | wazamba | fezbet | betsson | lvbet | dobrowin | betsul | pixbet | bwin | betobet | dobrowin | bet7 | betcris | blaze | 888 | betano | stake | stake | esportesdasorte | betmotion | rivalry | novibet | pinnacle | cbet | dobrowin | betleao | moverbet | gogowin | jogos win | campobet | mesk bet | infinity bet | betfury | doce | bet7k | jogowin | lobo888 | iribet | leao | dobrowin | allwin | aajogo | pgwin | greenbets | brapub | moverbet | onebra | flames | brdice | brwin | poplottery | queens | winbrl | omgbet | winbra | goinbet | codbet | betleao | fuwin | allwin568 | wingdus | juntosbet | today | talon777 | brlwin | fazobetai | pinup bet | bet sport | bet esporte | mrbet | premier bet | apostebet | spicy bet | prosport bet | bet nacional | luck | jogodeouro | heads bet | marjack bet | apostaganha | gbg bet | esoccer bet | esport bet | realbet | aposte e ganhe | aviator aposta | bet vitoria | imperador bet | realsbet | bet favorita | esportenet | flames bet | pague bet | betsury | doce888 | obabet | winzada | globalbet | bet77 | lottoland | 7gamesbet | dicasbet | esportivabet | tvbet | sportbet | misterjackbet | esportebet | nacionalbet | simplesbet | betestrela | batbet | Pk55 | Bet61 | Upsports Bet | roleta online | roleta | poker online | poker | blackjack online | bingo | 12bet | 33win | bet168 | bk8 | bong88 | bong99 | fcb8 | hb88 | hotlive | ibet888 | k8 | kubet77 | kubet | lode88 | mig8 | nbet | onebox63 | oxbet | s666 | sbobet | suncity | vwin | w88 | win2888 | zbet | xoso66 | zowin | sun | top88 | vnloto | 11bet | bet69 | 8xbet | Ceará | Paysandu | Juventude | Bahia | Sport | Cuiabá | Coritiba | Criciúma | Vitória | Fortaleza | Corinthians | São Paulo | Vasco | Grêmio | Fluminense | Cruzeiro | Botafogo | Flamengo | bingo slots | slots slots | hacker do slot | pg slot demo | slot win | pg slot soft | arne slot | riqueza slots | slots 777 | pg slot | 777 slot game | slot pg soft | hacker slot | 777 slots | slot-pg-soft | fortune ox demo grátis | demo fortune ox | fortune mouse demo | fortune ox demo | jogo fortune tiger | fortune tiger grátis | fortune tiger baixar | fortune tiger demo grátis | fortune tiger demo | fortune tiger 777 | 580bet | bet 7k | leao | luck 2 | john bet | 7755 bet | cbet | bet7 | pk55 | 8800 bet | doce | bet 4 | f12bet | bet7 | ggbet | bet77 | mrbet | bet61 | tvbet | pgwin | today | fuwin | brwin | bet7k | tv bet | allwin | stake | bwin 789 | lvbet | blaze | dj bet | umbet | b1bet | 20bet | bk bet | h2bet | 7kbet | fbbet | 9d bet | 9k bet | 73 bet | ktobet | 74 bet | betpix | betvip | batbet | onabet | f12bet | codbet | winbra | b2xbet | obabet | brlwin | onebra | winbrl | omgbet | queens | brdice | brapub | flames | betano | aajogo | iribet | pixbet | betsul | fezbet | curso beta | betway | bkbet | peixe beta | bet365 | pixbet | 4 play bet | 365bet | brxbet | 939 bet | seubet | cnc bet | gbg bet | 522bet | brl bet | pagbet | jonbet | jqk bet | 166bet | abc bet | bggbet | obabet | 136bet | mmabet | win bet | ir6 bet | 667bet | qqq bet | 193 bet | 3ss bet | 317 bet | kkk bet | 585 bet | 569 bet | vai bet | aaa bet | 969 bet | z11 bet | kw bet | 26 bet | mj bet | betio | 01 bet | ut bet | 9y bet | bet70 | f9 bet | hw bet | kg bet | 5e bet | bet br | hr bet | br bet | 75 bet | 03 bet | 6z bet | 6r bet | v6 bet | 78 bet | bt bet | 80 bet | 8g bet | 72 bet | xp bet | f12 bet | p9 bet | 5 bet | 4 bet | bet 4 | r7 bet | um bet | 29 bet | 5s bet | ck bet | pg bet | ea bet | 23 bet | bl bet | 3l bet | 2a bet | p7 bet | 888 bet | 707 bet | 361 bet | bet29 | 700 bet | 161 bet | bet777 | up bet | 58 bet | nn bet | 67 bet | 22 bet | 9g bet | 1x bet | bet10 | 70 bet | 2h bet | 9r bet | 16 bet | 81 bet | 7 bet | 5u bet | 6k bet | mg bet | b1 bet | 5h bet | je- bet | joya | hopa | nomini | ls bet | 1xbit | platin | ice bet | rant | bet us | bet go | 31 bet | slingo | flush | ice36 | weiss | bet9 | rabona | i bet | starda | dreams | bongo | snatch | 10 bet | daddy | metal | zep bet | drip | gama | drake | verde | shazam | wish | thor | exclusive | sol | highway | 500 casino | jazz | howl | supernova | sherbet | fresh | daddy | jet | wish | eclipse | inplay | drip | marvel | stake | scorpion | luxebet | drake | thor | puma | winzir | loki | shazam | rivalry | f1 casino | xgbet | sushi | bk8 | art casino | manga | pgasia | gemini | bingoplus | slot vip | help slot win | 8k8 slot | tadhana slot | jili slot | 55bmw slot | vip slot | nn777 slot | jili slot 777 | tg777 slot | w500 slot | phfun slot | bmw55 slot | sg777 slot | wj slot | slot free 100 | lucky cola slot | cc6 slot | taya777 slot | ph444 slot | slot games | fb777 slot | okebet slot | help slot | tg77 slot | phwin slot | vvjl slot | fc777 slot | slot vin | yy777 slot | define slot | define slot | inplay | 99bet | 60win | melbet | jollibet | jili slot | rich711 | tayabet | phl63 | unobet | 63jili | mwplay888 | gold99 | jolibet | ubet95 | nice88 | jili777 | nn777 | phlove | jiliko | 55bmw | phoenix game | 8k8 | cgebet | 7up gaming | diamond game | hellowin | win88 | big win | kabibe game | sabong bet | phcity | colorplay | tongits go | slotsgo | spinph | go perya | casino frenzy | aurora game | escala gaming | winning plus | bingo plus | ph dream | 747 live | niceph | lucky cola | pera play