src/Controller/SearchController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Rup;
  4. use App\Repository\JenisPengadaanRepository;
  5. use App\Repository\KlasifikasiUsahaRepository;
  6. use App\Repository\MetodePengadaanRepository;
  7. use App\Repository\RupRepository;
  8. use App\Repository\TenderPublishPokjaRepository;
  9. use App\Repository\TenderRepository;
  10. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. use Symfony\Component\Routing\Annotation\Route;
  14. class SearchController extends AbstractController
  15. {
  16.     #[Route('/search'name'app_search')]
  17.     public function index(
  18.         JenisPengadaanRepository $jenisPengadaanRepository,
  19.         TenderRepository $tenderRepository,
  20.         RupRepository $rupRepository,
  21.         MetodePengadaanRepository $metodePengadaanRepository,
  22.         KlasifikasiUsahaRepository $klasifikasiUsahaRepository,
  23.         TenderPublishPokjaRepository $publishRepository,
  24.         Request $request
  25.     ): Response {
  26.         $options $jenisPengadaanRepository->findAll();
  27.         $options2 $rupRepository->findAll();
  28.         $options3 $metodePengadaanRepository->findAll();
  29.         $options4 $klasifikasiUsahaRepository->findAll();
  30.         $publish $publishRepository->findAll();
  31.         $iscari $request->get('iscari');
  32.         $tenders null;
  33.         $params = [
  34.             'jenis_pengadaan' => $request->get('jenis_pengadaan'),
  35.             'metode_pengadaan' => $request->get('metode_pengadaan'),
  36.             'rup' => $request->get('RUP'),
  37.             'kualifikasi_usaha' => $request->get('kualifikasi_usaha'),
  38.             'nama_tender' => $request->get('nama_tender')
  39.         ];
  40.         if ($iscari == '1') {
  41.             $tenders $tenderRepository->findBySearchForm($params);
  42.         }
  43.         return $this->render('search/index.html.twig', [
  44.             'options' => $options,
  45.             'tenders' => $tenders,
  46.             'publish' => $publish,
  47.             'iscari'  => $iscari,
  48.             'options2' => $options2,
  49.             'options3' => $options3,
  50.             'options4' => $options4,
  51.             'params' => $params
  52.         ]);
  53.     }
  54. }