src/Framework/FrontBundle/Controller/TunnelController.php line 1893

Open in your IDE?
  1. <?php
  2. namespace App\Framework\FrontBundle\Controller;
  3. use App\Framework\AppBundle\Entity\Mail;
  4. use App\Framework\AppBundle\Repository\PlacesRepository;
  5. use App\Framework\AppBundle\Repository\VenueRepository;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. use Symfony\Component\Serializer\Encoder\JsonEncoder;
  11. use Symfony\Component\Serializer\Encoder\XmlEncoder;
  12. use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
  13. use Symfony\Component\Serializer\Serializer;
  14. use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
  15. use App\Security\LoginFormAuthenticator;
  16. use Symfony\Component\Security\Guard\GuardAuthenticatorHandler;
  17. use App\Framework\AppBundle\Entity\User;
  18. use App\Framework\AppBundle\Entity\Booking;
  19. use App\Framework\AppBundle\Entity\Order;
  20. use App\Framework\AppBundle\Entity\Places;
  21. use Symfony\Component\Mailer\MailerInterface;
  22. use Symfony\Component\Mime\Email;
  23. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  24. class TunnelController extends AbstractController
  25. {
  26.   private $urlGenerator;
  27.   public function __construct(UrlGeneratorInterface $urlGenerator)
  28.   {
  29.       $this->urlGenerator $urlGenerator;
  30.   }
  31.   // SEASON 2024
  32.   const labels = [
  33.     'individuel' => 'Individuel',
  34.     'groupe' => 'Groupe',
  35.     'avecrepas' => 'Repas + Spectacle + Lounge Club',
  36.     'no-avecrepas' => 'Goûter animé + spectacle',
  37.     'ok-avecrepas' => 'Repas + Lounge Club',
  38.     'sansrepas' => 'Spectacle + Lounge Club',
  39.     'no-sansrepas' => 'Spectacle seul',
  40.     'ok-sansrepas' => 'Lounge Club',
  41.     'co-avecrepas' => 'Repas + Place de concert',
  42.     'co-sansrepas' => 'Place(s) de concert',
  43.     'ss-avecrepas' => 'Dîner dansant + Spectacle + Lounge Club',
  44.     'ss-sansrepas' => 'Spectacle + Lounge Club',
  45.     'ss-majestic' => 'Animations assurées par l’orchestre «Connection d\'enfer» (6 musiciens) et attraction.',
  46.     'ss-versailles' => 'Animations assurées par «Francesco», les chanteurs des restaurants et attraction.',
  47.     'mj-m1' => 'Menu(s) Plaisir',
  48.     'mj-m2' => 'Menu(s) Festival',
  49.       'mj-m3' => 'Menu(s) Végétarien avec poisson',
  50.       'mj-m4' => 'Menu(s) Végétarien sans poisson',
  51.     'mj-me' => 'Menu(s) Enfant',
  52.     've-m1' => 'Menu(s) Élégance',
  53.     've-m2' => 'Menu(s) Royal',
  54.     've-m3' => 'Menu(s) Végétarien avec poisson',
  55.     've-m4' => 'Menu(s) Végétarien sans poisson',
  56.     've-me' => 'Menu(s) Enfant',
  57.     'sp1'   => 'Tarte(s) flambée(s)',
  58.     'sp2'   => 'Fromages',
  59.     'in-b1' => 'Forfait(s) Duo',
  60.     'in-b2' => 'Forfait(s) Prestigo',
  61.     'gr-b1' => 'Forfait(s) n°1',
  62.     'gr-b2' => 'Forfait(s) n°2',
  63.     'gr-b3' => 'Forfait(s) n°3',
  64.     'gr-b4' => 'Forfait(s) n°4',
  65.     'gr-b5' => 'Forfait(s) n°5',
  66.     'tk5'   => 'Ticket(s) boisson 5€',
  67.     'tk8'   => 'Ticket(s) boisson 8€',
  68.     'tk10'  => 'Ticket(s) boisson 10€',
  69.     'pn' => 'Place(s) normale(s)',
  70.     'ph' => 'Place(s) d\'honneur',
  71.     'vip' => 'Place(s) VIP',
  72.     'ms' => 'Mini-suite(s)',
  73.     'no' => 'Place(s)',
  74.     'okm' => 'Menu(s) spécial(s)',
  75.     'hhm' => 'Menu(s) spécial(s)',
  76.     'pam' => 'Menu(s) de Pâques',
  77.     'ok'  => 'Entrée(s)',
  78.     'af'  => 'Entrée(s)',
  79.     'gift' => 'Emballage cadeau',
  80.   ];
  81.   const labelsDe = [
  82.     'individuel' => 'Einzelperson',
  83.     'groupe' => 'Gruppe',
  84.     'avecrepas' => 'Mahlzeit + Show + Lounge Club',
  85.     'no-avecrepas' => 'Nachmittagssnack + spectacle',
  86.     'ok-avecrepas' => 'Mahlzeit + Lounge Club',
  87.     'sansrepas' => 'Show + Lounge Club',
  88.     'no-sansrepas' => 'Nur Show',
  89.     'ok-sansrepas' => 'Lounge Club',
  90.     'co-avecrepas' => 'Mahlzeit + Konzertplatz',
  91.     'co-sansrepas' => 'Konzertkarte(n)',
  92.     'ss-avecrepas' => 'Dinner mit Tanz + Show + Lounge Club',
  93.     'ss-sansrepas' => 'Show + Lounge Club',
  94.     'ss-majestic' => 'Unterhaltung durch das Orchester "Connection d\'enfer" (6 Musiker) und Attraktion.',
  95.     'ss-versailles' => 'Unterhaltung durch "Francesco", die Sänger der Restaurants und Attraktion.',
  96.     'mj-m1' => 'Menü(s) Plaisir',
  97.     'mj-m2' => 'Menü(s) Festival',
  98.       'mj-m3' => 'Menü(s) Vegetarisch mit Fisch',
  99.       'mj-m4' => 'Menü(s) Vegetarisch ohne Fisch',
  100.     'mj-me' => 'Menü(s) Enfant',
  101.     've-m1' => 'Menü(s) Élégance',
  102.     've-m2' => 'Menü(s) Royal',
  103.       've-m3' => 'Menü(s) Vegetarisch mit Fisch',
  104.       've-m4' => 'Menü(s) Vegetarisch ohne Fisch',
  105.     've-me' => 'Menü(s) Enfant',
  106.     'sp1'   => 'Flammkuchen',
  107.     'sp2'   => 'Käse',
  108.     'in-b1' => 'Vorschlag Duo',
  109.     'in-b2' => 'Vorschlag Prestigo',
  110.     'gr-b1' => 'Vorschlag n°1',
  111.     'gr-b2' => 'Vorschlag n°2',
  112.     'gr-b3' => 'Vorschlag n°3',
  113.     'gr-b4' => 'Vorschlag n°4',
  114.     'gr-b5' => 'Vorschlag n°5',
  115.     'tk5'   => 'Getränketicket(s) 5€',
  116.     'tk8'   => 'Getränketicket(s) 8€',
  117.     'tk10'  => 'Getränketicket(s) 10€',
  118.     'pn' => 'Normale Plätz(e)',
  119.     'ph' => 'Ehrenplätz(e)',
  120.     'vip' => 'Place(s) VIP',
  121.     'ms' => 'Mini-suite(s)',
  122.     'no' => 'Plätz(e)',
  123.     'hhm' => 'Spezialmenü(s)',
  124.     'okm' => 'Spezialmenü(s)',
  125.     'pam' => 'Ostermenü(s)',
  126.     'ok'  => 'Plätz(e)',
  127.     'af'  => 'Plätz(e)',
  128.     'gift' => 'Geschenkverpackung',
  129.   ];
  130.   const labelsEn = [
  131.     'individuel' => 'Individual',
  132.     'groupe' => 'Group',
  133.     'avecrepas' => 'Meal + Show + Lounge Club',
  134.     'no-avecrepas' => 'Snack + Show',
  135.     'ok-avecrepas' => 'Meal + Lounge Club',
  136.     'sansrepas' => 'Show + Lounge Club',
  137.     'no-sansrepas' => 'Show only',
  138.     'ok-sansrepas' => 'Lounge Club',
  139.     'co-avecrepas' => 'Meals + Concert tickets',
  140.     'co-sansrepas' => 'Concert ticket(s)',
  141.     'ss-avecrepas' => 'Dinner Dance + Show + Lounge Club',
  142.     'ss-sansrepas' => 'Show + Lounge Club',
  143.     'ss-majestic' => 'Entertainment provided by the "Connection D\'Enfer" orchestra (6 musicians) and attraction.',
  144.     'ss-versailles' => 'Entertainment provided by "Francesco", restaurant singers and attraction.',
  145.     'mj-m1' => 'Menu(s) Plaisir',
  146.     'mj-m2' => 'Menu(s) Festival',
  147.       'mj-m3' => 'Vegetarian menu with fish',
  148.       'mj-m4' => 'Vegetarian menu without fish',
  149.     'mj-me' => 'Menu(s) Child',
  150.     've-m1' => 'Menu(s) Élégance',
  151.     've-m2' => 'Menu(s) Royal',
  152.       've-m3' => 'Vegetarian menu with fish',
  153.       've-m4' => 'Vegetarian menu without fish',
  154.     've-me' => 'Menu(s) Child',
  155.     'sp1'   => 'Tarte(s) flambée(s)',
  156.     'sp2'   => 'Cheeses',
  157.     'in-b1' => 'Package(s) Duo',
  158.     'in-b2' => 'Package(s) Prestigo',
  159.     'gr-b1' => 'Package(s) n°1',
  160.     'gr-b2' => 'Package(s) n°2',
  161.     'gr-b3' => 'Package(s) n°3',
  162.     'gr-b4' => 'Package(s) n°4',
  163.     'gr-b5' => 'Package(s) n°5',
  164.     'tk5'   => 'Drink ticket(s) 5€',
  165.     'tk8'   => 'Drink ticket(s) 8€',
  166.     'tk10'  => 'Drink ticket(s) 10€',
  167.     'pn' => 'Regular seat(s-)',
  168.     'ph' => 'Pace(s) of honor',
  169.     'vip' => 'Place(s) VIP',
  170.     'ms' => 'Mini-suite(s)',
  171.     'no' => 'Place(s)',
  172.     'hhm' => 'Special menu(s)',
  173.     'okm' => 'Special menu(s)',
  174.     'pam' => 'Easter Menu(s)',
  175.     'ok'  => 'Entry ticket(s)',
  176.     'af'  => 'Entry ticket(s)',
  177.     'gift' => 'Gift wrapping',
  178.   ];
  179.   const foodPrices = [
  180.     'd1' => [ // jour 1
  181.       'mj' => [ // majestic
  182.         'm1' => [ // menu 1
  183.           'in' => [ // individuel
  184.             'price' => 50,
  185.           ],
  186.           'gr' => [ // groupe
  187.             'price' => 47,
  188.           ],
  189.         ],
  190.         'm2' => [ // menu 2
  191.           'in' => [ // individuel
  192.             'price' => 60,
  193.           ],
  194.           'gr' => [ // groupe
  195.             'price' => 57,
  196.           ],
  197.         ],
  198.         'm3' => [ // menu 3
  199.           'in' => [ // individuel
  200.             'price' => 52,
  201.           ],
  202.           'gr' => [ // groupe
  203.             'price' => 52,
  204.           ],
  205.         ],
  206.         'm4' => [ // menu 3 sans poisson
  207.           'in' => [ // individuel
  208.             'price' => 47,
  209.           ],
  210.           'gr' => [ // groupe
  211.             'price' => 47,
  212.           ],
  213.         ],
  214.       ],
  215.       've' => [ // versaille
  216.         'm1' => [ // menu 1
  217.           'in' => [ // individuel
  218.             'price' => 68,
  219.           ],
  220.           'gr' => [ // groupe
  221.             'price' => 65,
  222.           ],
  223.         ],
  224.         'm2' => [ // menu 2
  225.           'in' => [ // individuel
  226.             'price' => 76,
  227.           ],
  228.           'gr' => [ // groupe
  229.             'price' => 73,
  230.           ],
  231.         ],
  232.         'm3' => [ // menu 3
  233.           'in' => [ // individuel
  234.             'price' => 57,
  235.           ],
  236.           'gr' => [ // groupe
  237.             'price' => 57,
  238.           ],
  239.         ],
  240.         'm4' => [ // menu 3 sans poisson
  241.           'in' => [ // individuel
  242.             'price' => 52,
  243.           ],
  244.           'gr' => [ // groupe
  245.             'price' => 52,
  246.           ],
  247.         ],
  248.       ],
  249.     ],
  250.     'd2' => [ // jour 2
  251.       'mj' => [ // majestic
  252.         'm1' => [ // menu 1
  253.           'in' => [ // individuel
  254.             'price' => 56,
  255.           ],
  256.           'gr' => [ // groupe
  257.             'price' => 53,
  258.           ],
  259.         ],
  260.         'm2' => [ // menu 2
  261.           'in' => [ // individuel
  262.             'price' => 64,
  263.           ],
  264.           'gr' => [ // groupe
  265.             'price' => 61,
  266.           ],
  267.         ],
  268.           'm3' => [ // menu 3
  269.               'in' => [ // individuel
  270.                   'price' => 52,
  271.               ],
  272.               'gr' => [ // groupe
  273.                   'price' => 52,
  274.               ],
  275.           ],
  276.           'm4' => [ // menu 3 sans poisson
  277.               'in' => [ // individuel
  278.                   'price' => 47,
  279.               ],
  280.               'gr' => [ // groupe
  281.                   'price' => 47,
  282.               ],
  283.           ],
  284.       ],
  285.       've' => [ // versaille
  286.         'm1' => [ // menu 1
  287.           'in' => [ // individuel
  288.             'price' => 72,
  289.           ],
  290.           'gr' => [ // groupe
  291.             'price' => 69,
  292.           ],
  293.         ],
  294.         'm2' => [ // menu 2
  295.           'in' => [ // individuel
  296.             'price' => 80,
  297.           ],
  298.           'gr' => [ // groupe
  299.             'price' => 77,
  300.           ],
  301.         ],
  302.           'm3' => [ // menu 3
  303.               'in' => [ // individuel
  304.                   'price' => 57,
  305.               ],
  306.               'gr' => [ // groupe
  307.                   'price' => 57,
  308.               ],
  309.           ],
  310.           'm4' => [ // menu 3 sans poisson
  311.               'in' => [ // individuel
  312.                   'price' => 52,
  313.               ],
  314.               'gr' => [ // groupe
  315.                   'price' => 52,
  316.               ],
  317.           ],
  318.       ],
  319.     ],
  320.     'd3' => [ // jour 3
  321.       'mj' => [ // majestic
  322.         'm1' => [ // menu 1
  323.           'in' => [ // individuel
  324.             'price' => 54,
  325.           ],
  326.           'gr' => [ // groupe
  327.             'price' => 51,
  328.           ],
  329.         ],
  330.         'm2' => [ // menu 2
  331.           'in' => [ // individuel
  332.             'price' => 62,
  333.           ],
  334.           'gr' => [ // groupe
  335.             'price' => 59,
  336.           ],
  337.         ],
  338.           'm3' => [ // menu 3
  339.               'in' => [ // individuel
  340.                   'price' => 52,
  341.               ],
  342.               'gr' => [ // groupe
  343.                   'price' => 52,
  344.               ],
  345.           ],
  346.           'm4' => [ // menu 3 sans poisson
  347.               'in' => [ // individuel
  348.                   'price' => 47,
  349.               ],
  350.               'gr' => [ // groupe
  351.                   'price' => 47,
  352.               ],
  353.           ],
  354.       ],
  355.       've' => [ // versaille
  356.         'm1' => [ // menu 1
  357.           'in' => [ // individuel
  358.             'price' => 70,
  359.           ],
  360.           'gr' => [ // groupe
  361.             'price' => 67,
  362.           ],
  363.         ],
  364.         'm2' => [ // menu 2
  365.           'in' => [ // individuel
  366.             'price' => 78,
  367.           ],
  368.           'gr' => [ // groupe
  369.             'price' => 75,
  370.           ],
  371.         ],
  372.           'm3' => [ // menu 3
  373.               'in' => [ // individuel
  374.                   'price' => 57,
  375.               ],
  376.               'gr' => [ // groupe
  377.                   'price' => 57,
  378.               ],
  379.           ],
  380.           'm4' => [ // menu 3 sans poisson
  381.               'in' => [ // individuel
  382.                   'price' => 52,
  383.               ],
  384.               'gr' => [ // groupe
  385.                   'price' => 52,
  386.               ],
  387.           ],
  388.       ],
  389.     ],
  390.     'd4' => [ // jour 4
  391.         'mj' => [ // majestic
  392.             'm1' => [ // menu 1
  393.                 'in' => [ // individuel
  394.                     'price' => 56,
  395.                 ],
  396.                 'gr' => [ // groupe
  397.                     'price' => 53,
  398.                 ],
  399.             ],
  400.             'm2' => [ // menu 2
  401.                 'in' => [ // individuel
  402.                     'price' => 64,
  403.                 ],
  404.                 'gr' => [ // groupe
  405.                     'price' => 61,
  406.                 ],
  407.             ],
  408.             'm3' => [ // menu 3
  409.                 'in' => [ // individuel
  410.                     'price' => 52,
  411.                 ],
  412.                 'gr' => [ // groupe
  413.                     'price' => 52,
  414.                 ],
  415.             ],
  416.             'm4' => [ // menu 3 sans poisson
  417.                 'in' => [ // individuel
  418.                     'price' => 47,
  419.                 ],
  420.                 'gr' => [ // groupe
  421.                     'price' => 47,
  422.                 ],
  423.             ],
  424.         ],
  425.         've' => [ // versaille
  426.             'm1' => [ // menu 1
  427.                 'in' => [ // individuel
  428.                     'price' => 72,
  429.                 ],
  430.                 'gr' => [ // groupe
  431.                     'price' => 69,
  432.                 ],
  433.             ],
  434.             'm2' => [ // menu 2
  435.                 'in' => [ // individuel
  436.                     'price' => 80,
  437.                 ],
  438.                 'gr' => [ // groupe
  439.                     'price' => 77,
  440.                 ],
  441.             ],
  442.             'm3' => [ // menu 3
  443.                 'in' => [ // individuel
  444.                     'price' => 57,
  445.                 ],
  446.                 'gr' => [ // groupe
  447.                     'price' => 57,
  448.                 ],
  449.             ],
  450.             'm4' => [ // menu 3 sans poisson
  451.                 'in' => [ // individuel
  452.                     'price' => 52,
  453.                 ],
  454.                 'gr' => [ // groupe
  455.                     'price' => 52,
  456.                 ],
  457.             ],
  458.       ],
  459.     ],
  460.     'd5' => [ // jour 5
  461.         'mj' => [ // majestic
  462.             'm1' => [ // menu 1
  463.                 'in' => [ // individuel
  464.                     'price' => 54,
  465.                 ],
  466.                 'gr' => [ // groupe
  467.                     'price' => 51,
  468.                 ],
  469.             ],
  470.             'm2' => [ // menu 2
  471.                 'in' => [ // individuel
  472.                     'price' => 62,
  473.                 ],
  474.                 'gr' => [ // groupe
  475.                     'price' => 59,
  476.                 ],
  477.             ],
  478.             'm3' => [ // menu 3
  479.                 'in' => [ // individuel
  480.                     'price' => 52,
  481.                 ],
  482.                 'gr' => [ // groupe
  483.                     'price' => 52,
  484.                 ],
  485.             ],
  486.             'm4' => [ // menu 3 sans poisson
  487.                 'in' => [ // individuel
  488.                     'price' => 47,
  489.                 ],
  490.                 'gr' => [ // groupe
  491.                     'price' => 47,
  492.                 ],
  493.             ],
  494.         ],
  495.         've' => [ // versaille
  496.             'm1' => [ // menu 1
  497.                 'in' => [ // individuel
  498.                     'price' => 70,
  499.                 ],
  500.                 'gr' => [ // groupe
  501.                     'price' => 67,
  502.                 ],
  503.             ],
  504.             'm2' => [ // menu 2
  505.                 'in' => [ // individuel
  506.                     'price' => 78,
  507.                 ],
  508.                 'gr' => [ // groupe
  509.                     'price' => 75,
  510.                 ],
  511.             ],
  512.             'm3' => [ // menu 3
  513.                 'in' => [ // individuel
  514.                     'price' => 57,
  515.                 ],
  516.                 'gr' => [ // groupe
  517.                     'price' => 57,
  518.                 ],
  519.             ],
  520.             'm4' => [ // menu 3 sans poisson
  521.                 'in' => [ // individuel
  522.                     'price' => 52,
  523.                 ],
  524.                 'gr' => [ // groupe
  525.                     'price' => 52,
  526.                 ],
  527.             ],
  528.       ],
  529.     ],
  530.   ];
  531.   const foodPricesFixed = [
  532.     'me' => [
  533.       'price' => 27,
  534.     ],
  535.     'sp1' => [
  536.       'price' => 6,
  537.     ],
  538.     'sp2' => [
  539.       'price' => 8,
  540.     ],
  541.     'ev' => [
  542.       'price' => 20,
  543.     ],
  544.     'okm' => [
  545.       'price' => 27,
  546.     ],
  547.     'pam' => [
  548.       'price' => 52,
  549.     ],
  550.       'hhm' => [
  551.           'price' => 27,
  552.       ],
  553.   ];
  554.   const drinkPrices = [
  555.     'in' => [
  556.       'b1' => [
  557.         'price' => 29,
  558.       ],
  559.       'b2' => [
  560.         'price' => 41,
  561.       ],
  562.     ],
  563.     'gr' => [
  564.       'b1' => [
  565.         'price' => 9,
  566.       ],
  567.       'b2' => [
  568.         'price' => 12,
  569.       ],
  570.       'b3' => [
  571.         'price' => 13,
  572.       ],
  573.       'b4' => [
  574.         'price' => 18,
  575.       ],
  576.       'b5' => [
  577.         'price' => 0,
  578.       ],
  579.     ],
  580.   ];
  581.   const venuePrices = [
  582.     'd1' => [ //MERCREDI / JEUDI MIDI
  583.       'avecrepas' => [ // FOOD
  584.         'pn' => [ // PLACE NORMALE
  585.           'in' => [ // individuel
  586.             'price' => 38,
  587.           ],
  588.           'gr' => [ // groupe
  589.             'price' => 35,
  590.           ],
  591.         ],
  592.         'ph' => [ // PLACE D’HONNEUR45
  593.           'in' => [ // individuel
  594.             'price' => 45,
  595.           ],
  596.           'gr' => [ // groupe
  597.             'price' => 45,
  598.           ],
  599.         ],
  600.         'vip' => [ // LOGE VIP
  601.           'price' => 254,
  602.         ],
  603.       ],
  604.       'sansrepas' => [ // NO FOOD
  605.         'pn' => [ // PLACE NORMALE
  606.           'in' => [ // individuel
  607.             'price' => 48,
  608.           ],
  609.           'gr' => [ // groupe
  610.             'price' => 45,
  611.           ],
  612.         ],
  613.         'ph' => [ // PLACE D’HONNEUR45
  614.           'in' => [ // individuel
  615.             'price' => 55,
  616.           ],
  617.           'gr' => [ // groupe
  618.             'price' => 55,
  619.           ],
  620.         ],
  621.         'vip' => [ // LOGE VIP
  622.           'price' => 294,
  623.         ],
  624.       ],
  625.     ],
  626.     'd2' => [ //VENDREDI SOIR
  627.       'avecrepas' => [ // FOOD
  628.         'pn' => [ // PLACE NORMALE
  629.           'in' => [ // individuel
  630.             'price' => 48,
  631.           ],
  632.           'gr' => [ // groupe
  633.             'price' => 45,
  634.           ],
  635.         ],
  636.         'ph' => [ // PLACE D’HONNEUR45
  637.           'in' => [ // individuel
  638.             'price' => 58,
  639.           ],
  640.           'gr' => [ // groupe
  641.             'price' => 58,
  642.           ],
  643.         ],
  644.         'vip' => [ // LOGE VIP
  645.           'price' => 354,
  646.         ],
  647.       ],
  648.       'sansrepas' => [ // NO FOOD
  649.         'pn' => [ // PLACE NORMALE
  650.           'in' => [ // individuel
  651.             'price' => 58,
  652.           ],
  653.           'gr' => [ // groupe
  654.             'price' => 55,
  655.           ],
  656.         ],
  657.         'ph' => [ // PLACE D’HONNEUR45
  658.           'in' => [ // individuel
  659.             'price' => 68,
  660.           ],
  661.           'gr' => [ // groupe
  662.             'price' => 68,
  663.           ],
  664.         ],
  665.         'vip' => [ // LOGE VIP
  666.           'price' => 394,
  667.         ],
  668.       ],
  669.     ],
  670.     'd3' => [ //SAMEDI MIDI
  671.       'avecrepas' => [ // FOOD
  672.         'pn' => [ // PLACE NORMALE
  673.           'in' => [ // individuel
  674.             'price' => 43,
  675.           ],
  676.           'gr' => [ // groupe
  677.             'price' => 40,
  678.           ],
  679.         ],
  680.         'ph' => [ // PLACE D’HONNEUR45
  681.           'in' => [ // individuel
  682.             'price' => 53,
  683.           ],
  684.           'gr' => [ // groupe
  685.             'price' => 53,
  686.           ],
  687.         ],
  688.         'vip' => [ // LOGE VIP
  689.           'price' => 334,
  690.         ],
  691.       ],
  692.       'sansrepas' => [ // NO FOOD
  693.         'pn' => [ // PLACE NORMALE
  694.           'in' => [ // individuel
  695.             'price' => 53,
  696.           ],
  697.           'gr' => [ // groupe
  698.             'price' => 50,
  699.           ],
  700.         ],
  701.         'ph' => [ // PLACE D’HONNEUR45
  702.           'in' => [ // individuel
  703.             'price' => 63,
  704.           ],
  705.           'gr' => [ // groupe
  706.             'price' => 63,
  707.           ],
  708.         ],
  709.         'vip' => [ // LOGE VIP
  710.           'price' => 374,
  711.         ],
  712.       ],
  713.     ],
  714.     'd4' => [ //SAMEDI SOIR
  715.       'avecrepas' => [ // FOOD
  716.         'pn' => [ // PLACE NORMALE
  717.           'in' => [ // individuel
  718.             'price' => 48,
  719.           ],
  720.           'gr' => [ // groupe
  721.             'price' => 45,
  722.           ],
  723.         ],
  724.         'ph' => [ // PLACE D’HONNEUR45
  725.           'in' => [ // individuel
  726.             'price' => 58,
  727.           ],
  728.           'gr' => [ // groupe
  729.             'price' => 58,
  730.           ],
  731.         ],
  732.         'vip' => [ // LOGE VIP
  733.           'price' => 354,
  734.         ],
  735.       ],
  736.       'sansrepas' => [ // NO FOOD
  737.         'pn' => [ // PLACE NORMALE
  738.           'in' => [ // individuel
  739.             'price' => 58,
  740.           ],
  741.           'gr' => [ // groupe
  742.             'price' => 55,
  743.           ],
  744.         ],
  745.         'ph' => [ // PLACE D’HONNEUR45
  746.           'in' => [ // individuel
  747.             'price' => 68,
  748.           ],
  749.           'gr' => [ // groupe
  750.             'price' => 68,
  751.           ],
  752.         ],
  753.         'vip' => [ // LOGE VIP
  754.           'price' => 394,
  755.         ],
  756.       ],
  757.     ],
  758.     'd5' => [ //DIMANCHE MIDI
  759.       'avecrepas' => [ // FOOD
  760.         'pn' => [ // PLACE NORMALE
  761.           'in' => [ // individuel
  762.             'price' => 43,
  763.           ],
  764.           'gr' => [ // groupe
  765.             'price' => 40,
  766.           ],
  767.         ],
  768.         'ph' => [ // PLACE D’HONNEUR45
  769.           'in' => [ // individuel
  770.             'price' => 53,
  771.           ],
  772.           'gr' => [ // groupe
  773.             'price' => 53,
  774.           ],
  775.         ],
  776.         'vip' => [ // LOGE VIP
  777.           'price' => 334,
  778.         ],
  779.       ],
  780.       'sansrepas' => [ // NO FOOD
  781.         'pn' => [ // PLACE NORMALE
  782.           'in' => [ // individuel
  783.             'price' => 53,
  784.           ],
  785.           'gr' => [ // groupe
  786.             'price' => 50,
  787.           ],
  788.         ],
  789.         'ph' => [ // PLACE D’HONNEUR45
  790.           'in' => [ // individuel
  791.             'price' => 63,
  792.           ],
  793.           'gr' => [ // groupe
  794.             'price' => 63,
  795.           ],
  796.         ],
  797.         'vip' => [ // LOGE VIP
  798.           'price' => 374,
  799.         ],
  800.       ],
  801.     ],
  802.   ];
  803.   const venuePricesFixed = [
  804.     'af' => [
  805.       'price' => 25,
  806.     ],
  807.       'ok' => [
  808.           'price' => 47,
  809.           'price_am' => 27,
  810.           'price_rs' => 20,
  811.       ],
  812.     'no' => [
  813.       'avecrepas' => [
  814.         'in' => [ // individuel
  815.           'price' => 52,
  816.         ],
  817.         'gr' => [ // groupe
  818.           'price' => 50,
  819.         ],
  820.       ],
  821.       'sansrepas' => [
  822.         'in' => [ // individuel
  823.           'price' => 27,
  824.         ],
  825.         'gr' => [ // groupe
  826.           'price' => 25,
  827.         ],
  828.       ],
  829.     ],
  830.     'ss' => [
  831.       'avecrepas' => [
  832.         'in' => [ // individuel
  833.           'price' => 293,
  834.           'price_am' => 223,
  835.           'price_rs' => 70,
  836.         ],
  837.         'gr' => [ // groupe
  838.           'price' => 293,
  839.           'price_am' => 223,
  840.           'price_rs' => 70,
  841.         ],
  842.       ],
  843.       'sansrepas' => [
  844.         'in' => [ // individuel
  845.           'price' => 156,
  846.           'price_am' => 96,
  847.           'price_rs' => 60,
  848.         ],
  849.         'gr' => [ // groupe
  850.           'price' => 156,
  851.           'price_am' => 96,
  852.           'price_rs' => 60,
  853.         ],
  854.       ],
  855.     ],
  856.   ];
  857.   const roomPrices = [
  858.     'd1' => [
  859.       'price' => 120,
  860.     ],
  861.     'd2' => [
  862.       'price' => 160,
  863.     ],
  864.     'd3' => [
  865.       'price' => 160,
  866.     ],
  867.     'd4' => [
  868.       'price' => 160,
  869.     ],
  870.     'd5' => [
  871.       'price' => 120,
  872.     ],
  873.     'ss' => [
  874.       'price' => 240,
  875.     ],
  876.   ];
  877.   // SECOND SEASON 2023
  878.   const labelsSecond = [
  879.     'individuel' => 'Individuel',
  880.     'groupe' => 'Groupe',
  881.     'avecrepas' => 'Repas + Spectacle + Lounge Club',
  882.     'no-avecrepas' => 'Goûter animé + spectacle',
  883.     'ok-avecrepas' => 'Repas + Lounge Club',
  884.     'sansrepas' => 'Spectacle + Lounge Club',
  885.     'no-sansrepas' => 'Spectacle seul',
  886.     'ok-sansrepas' => 'Lounge Club',
  887.     'co-avecrepas' => 'Repas + Place de concert',
  888.     'co-sansrepas' => 'Place(s) de concert',
  889.     'ss-avecrepas' => 'Dîner dansant à 19 h 30 + Spectacle Parfum d\'Etoiles à 1 h du matin + Après le show, retour au restaurant pour le dessert puis danse avec orchestre jusqu\'à l\'aube ou possibilité d\'accéder au lounge club avec ambiance DJ',
  890.     'ss-sansrepas' => '21 h : spectacle Parfum d\'Etoiles + 22 h 45 : accès au lounge club avec ambiance DJ (jusqu\'à l\'aube), animations par nos danseuses et numéro d\'attraction + service de gourmandises salées et sucrées ainsi qu\'1 bouteille de Champagne pour 2 (eau minérale à discrétion)',
  891.     'ss-majestic' => 'Animations assurées par l’orchestre «Connection D\'enfer» (6 musiciens) et attraction.',
  892.     'ss-versailles' => 'Animations assurées par «Francesco», les chanteurs des restaurants et attraction.',
  893.     'mj-m1' => 'Menu(s) Plaisir',
  894.     'mj-m2' => 'Menu(s) Festival',
  895.     'mj-m3' => 'Menu(s) Végétarien avec poisson',
  896.     'mj-m4' => 'Menu(s) Végétarien sans poisson',
  897.     'mj-me' => 'Menu(s) Enfant',
  898.     've-m1' => 'Menu(s) Élégance',
  899.     've-m2' => 'Menu(s) Royal',
  900.     've-m3' => 'Menu(s) Végétarien avec poisson',
  901.     've-m4' => 'Menu(s) Végétarien sans poisson',
  902.     've-me' => 'Menu(s) Enfant',
  903.     'sp1'   => 'Tarte(s) flambée(s)',
  904.     'sp2'   => 'Fromages',
  905.     'in-b1' => 'Forfait(s) Duo',
  906.     'in-b2' => 'Forfait(s) Prestigo',
  907.     'gr-b1' => 'Forfait(s) n°1',
  908.     'gr-b2' => 'Forfait(s) n°2',
  909.     'gr-b3' => 'Forfait(s) n°3',
  910.     'gr-b4' => 'Forfait(s) n°4',
  911.     'gr-b5' => 'Forfait(s) n°5',
  912.     'tk5'   => 'Ticket(s) boisson 5€',
  913.     'tk8'   => 'Ticket(s) boisson 8€',
  914.     'tk10'  => 'Ticket(s) boisson 10€',
  915.     'pn' => 'Place(s) normale(s)',
  916.     'ph' => 'Place(s) d\'honneur',
  917.     'vip' => 'Place(s) VIP',
  918.     'ms' => 'Mini-suite(s)',
  919.     'no' => 'Place(s)',
  920.     'okm' => 'Menu(s) spécial(s)',
  921.     'hhm' => 'Menu(s) spécial(s)',
  922.     'pam' => 'Menu(s) de Pâques',
  923.     'ok'  => 'Entrée(s)',
  924.     'af'  => 'Entrée(s)',
  925.     'gift' => 'Emballage cadeau',
  926.   ];
  927.   const labelsSecondDe = [
  928.     'individuel' => 'Einzelperson',
  929.     'groupe' => 'Gruppe',
  930.     'avecrepas' => 'Mahlzeit + Show + Lounge Club',
  931.     'no-avecrepas' => 'Nachmittagssnack + spectacle',
  932.     'ok-avecrepas' => 'Mahlzeit + Lounge Club',
  933.     'sansrepas' => 'Show + Lounge Club',
  934.     'no-sansrepas' => 'Nur Show',
  935.     'ok-sansrepas' => 'Lounge Club',
  936.     'co-avecrepas' => 'Mahlzeit + Konzertplatz',
  937.     'co-sansrepas' => 'Konzertkarte(n)',
  938.       'ss-avecrepas' => 'Dinner mit Tanz um 19:30 Uhr + Show "Parfum d\'Étoiles" um 1:00 Uhr morgens + Nach der Show Rückkehr ins Restaurant für das Dessert, anschließend Tanz mit Live-Orchester bis zum Morgengrauen oder Zugang zur Lounge mit DJ-Atmosphäre',
  939.       'ss-sansrepas' => '21:00 Uhr: Show "Parfum d\'Étoiles" + 22:45 Uhr: Zugang zur Lounge mit DJ-Atmosphäre (bis zum Morgengrauen), Animation durch unsere Tänzerinnen und Show-Act + Service mit salzigen und süßen Köstlichkeiten sowie 1 Flasche Champagner für 2 Personen (Mineralwasser inklusive)',
  940.     'ss-majestic' => 'Unterhaltung durch das Orchester "Connection D\'enfer" (6 Musiker) und Attraktion.',
  941.     'ss-versailles' => 'Unterhaltung durch "Francesco", die Sänger der Restaurants und Attraktion.',
  942.     'mj-m1' => 'Menü(s) Plaisir',
  943.     'mj-m2' => 'Menü(s) Festival',
  944.     'mj-m3' => 'Menü(s) Vegetarisch mit Fisch',
  945.     'mj-m4' => 'Menü(s) Vegetarisch ohne Fisch',
  946.     'mj-me' => 'Menü(s) Enfant',
  947.     've-m1' => 'Menü(s) Élégance',
  948.     've-m2' => 'Menü(s) Royal',
  949.     've-m3' => 'Menü(s) Vegetarisch mit Fisch',
  950.     've-m4' => 'Menü(s) Vegetarisch ohne Fisch',
  951.     've-me' => 'Menü(s) Enfant',
  952.     'sp1'   => 'Flammkuchen',
  953.     'sp2'   => 'Käse',
  954.     'in-b1' => 'Vorschlag Duo',
  955.     'in-b2' => 'Vorschlag Prestigo',
  956.     'gr-b1' => 'Vorschlag n°1',
  957.     'gr-b2' => 'Vorschlag n°2',
  958.     'gr-b3' => 'Vorschlag n°3',
  959.     'gr-b4' => 'Vorschlag n°4',
  960.     'gr-b5' => 'Vorschlag n°5',
  961.     'tk5'   => 'Getränketicket(s) 5€',
  962.     'tk8'   => 'Getränketicket(s) 8€',
  963.     'tk10'  => 'Getränketicket(s) 10€',
  964.     'pn' => 'Normale Plätz(e)',
  965.     'ph' => 'Ehrenplätz(e)',
  966.     'vip' => 'Place(s) VIP',
  967.     'ms' => 'Mini-suite(s)',
  968.     'no' => 'Plätz(e)',
  969.     'okm' => 'Spezialmenü(s)',
  970.     'hhm' => 'Spezialmenü(s)',
  971.     'pam' => 'Ostermenü(s)',
  972.     'ok'  => 'Plätz(e)',
  973.     'af'  => 'Plätz(e)',
  974.     'gift' => 'Geschenkverpackung',
  975.   ];
  976.   const labelsSecondEn = [
  977.     'individuel' => 'Individual',
  978.     'groupe' => 'Group',
  979.     'avecrepas' => 'Meal + Show + Lounge Club',
  980.     'no-avecrepas' => 'Snack + Show',
  981.     'ok-avecrepas' => 'Meal + Lounge Club',
  982.     'sansrepas' => 'Show + Lounge Club',
  983.     'no-sansrepas' => 'Show only',
  984.     'ok-sansrepas' => 'Lounge Club',
  985.     'co-avecrepas' => 'Meals + Concert tickets',
  986.     'co-sansrepas' => 'Concert ticket(s)',
  987.       'ss-avecrepas' => 'Dinner & dance at 7:30 PM + "Parfum d\'Étoiles" show at 1:00 AM + After the show, return to the restaurant for dessert, then dance with live orchestra until dawn or access to the lounge club with DJ atmosphere',
  988.       'ss-sansrepas' => '9:00 PM: "Parfum d\'Étoiles" show + 10:45 PM: access to the lounge club with DJ atmosphere (until dawn), entertainment by our dancers and a special act + service of sweet and savory treats, plus 1 bottle of Champagne for 2 (mineral water included)',
  989.     'ss-majestic' => 'Entertainment provided by the "Connection D\'enfer" orchestra (6 musicians) and attraction.',
  990.     'ss-versailles' => 'Entertainment provided by "Francesco", restaurant singers and attraction.',
  991.     'mj-m1' => 'Menu(s) Plaisir',
  992.     'mj-m2' => 'Menu(s) Festival',
  993.     'mj-m3' => 'Vegetarian menu with fish',
  994.     'mj-m4' => 'Vegetarian menu without fish',
  995.     'mj-me' => 'Menu(s) Child',
  996.     've-m1' => 'Menu(s) Élégance',
  997.     've-m2' => 'Menu(s) Royal',
  998.     've-m3' => 'Vegetarian menu with fish',
  999.     've-m4' => 'Vegetarian menu without fish',
  1000.     've-me' => 'Menu(s) Child',
  1001.     'sp1'   => 'Tarte(s) flambée(s)',
  1002.     'sp2'   => 'Cheeses',
  1003.     'in-b1' => 'Package(s) Duo',
  1004.     'in-b2' => 'Package(s) Prestigo',
  1005.     'gr-b1' => 'Package(s) n°1',
  1006.     'gr-b2' => 'Package(s) n°2',
  1007.     'gr-b3' => 'Package(s) n°3',
  1008.     'gr-b4' => 'Package(s) n°4',
  1009.     'gr-b5' => 'Package(s) n°5',
  1010.     'tk5'   => 'Drink ticket(s) 5€',
  1011.     'tk8'   => 'Drink ticket(s) 8€',
  1012.     'tk10'  => 'Drink ticket(s) 10€',
  1013.     'pn' => 'Regular seat(s-)',
  1014.     'ph' => 'Pace(s) of honor',
  1015.     'vip' => 'Place(s) VIP',
  1016.     'ms' => 'Mini-suite(s)',
  1017.     'no' => 'Place(s)',
  1018.     'hhm' => 'Special menu(s)',
  1019.     'okm' => 'Special menu(s)',
  1020.     'pam' => 'Easter Menu(s)',
  1021.     'ok'  => 'Entry ticket(s)',
  1022.     'af'  => 'Entry ticket(s)',
  1023.     'gift' => 'Gift wrapping',
  1024.   ];
  1025.   const foodPricesSecond = [
  1026.       'd1' => [ // jour 1
  1027.           'mj' => [ // majestic
  1028.               'm1' => [ // menu 1
  1029.                   'in' => [ // individuel
  1030.                       'price' => 52,
  1031.                   ],
  1032.                   'gr' => [ // groupe
  1033.                       'price' => 49,
  1034.                   ],
  1035.               ],
  1036.               'm2' => [ // menu 2
  1037.                   'in' => [ // individuel
  1038.                       'price' => 62,
  1039.                   ],
  1040.                   'gr' => [ // groupe
  1041.                       'price' => 59,
  1042.                   ],
  1043.               ],
  1044.               'm3' => [ // menu 3
  1045.                   'in' => [ // individuel
  1046.                       'price' => 54,
  1047.                   ],
  1048.                   'gr' => [ // groupe
  1049.                       'price' => 54,
  1050.                   ],
  1051.               ],
  1052.               'm4' => [ // menu 3 sans poisson
  1053.                   'in' => [ // individuel
  1054.                       'price' => 49,
  1055.                   ],
  1056.                   'gr' => [ // groupe
  1057.                       'price' => 49,
  1058.                   ],
  1059.               ],
  1060.           ],
  1061.           've' => [ // versaille
  1062.               'm1' => [ // menu 1
  1063.                   'in' => [ // individuel
  1064.                       'price' => 67,
  1065.                   ],
  1066.                   'gr' => [ // groupe
  1067.                       'price' => 64,
  1068.                   ],
  1069.               ],
  1070.               'm2' => [ // menu 2
  1071.                   'in' => [ // individuel
  1072.                       'price' => 75,
  1073.                   ],
  1074.                   'gr' => [ // groupe
  1075.                       'price' => 72,
  1076.                   ],
  1077.               ],
  1078.               'm3' => [ // menu 3
  1079.                   'in' => [ // individuel
  1080.                       'price' => 57,
  1081.                   ],
  1082.                   'gr' => [ // groupe
  1083.                       'price' => 57,
  1084.                   ],
  1085.               ],
  1086.               'm4' => [ // menu 3 sans poisson
  1087.                   'in' => [ // individuel
  1088.                       'price' => 52,
  1089.                   ],
  1090.                   'gr' => [ // groupe
  1091.                       'price' => 52,
  1092.                   ],
  1093.               ],
  1094.           ],
  1095.       ],
  1096.       'd2' => [ // jour 2
  1097.           'mj' => [ // majestic
  1098.               'm1' => [ // menu 1
  1099.                   'in' => [ // individuel
  1100.                       'price' => 58,
  1101.                   ],
  1102.                   'gr' => [ // groupe
  1103.                       'price' => 55,
  1104.                   ],
  1105.               ],
  1106.               'm2' => [ // menu 2
  1107.                   'in' => [ // individuel
  1108.                       'price' => 66,
  1109.                   ],
  1110.                   'gr' => [ // groupe
  1111.                       'price' => 63,
  1112.                   ],
  1113.               ],
  1114.               'm3' => [ // menu 3
  1115.                   'in' => [ // individuel
  1116.                       'price' => 54,
  1117.                   ],
  1118.                   'gr' => [ // groupe
  1119.                       'price' => 54,
  1120.                   ],
  1121.               ],
  1122.               'm4' => [ // menu 3 sans poisson
  1123.                   'in' => [ // individuel
  1124.                       'price' => 49,
  1125.                   ],
  1126.                   'gr' => [ // groupe
  1127.                       'price' => 49,
  1128.                   ],
  1129.               ],
  1130.           ],
  1131.           've' => [ // versaille
  1132.               'm1' => [ // menu 1
  1133.                   'in' => [ // individuel
  1134.                       'price' => 71,
  1135.                   ],
  1136.                   'gr' => [ // groupe
  1137.                       'price' => 68,
  1138.                   ],
  1139.               ],
  1140.               'm2' => [ // menu 2
  1141.                   'in' => [ // individuel
  1142.                       'price' => 79,
  1143.                   ],
  1144.                   'gr' => [ // groupe
  1145.                       'price' => 76,
  1146.                   ],
  1147.               ],
  1148.               'm3' => [ // menu 3
  1149.                   'in' => [ // individuel
  1150.                       'price' => 57,
  1151.                   ],
  1152.                   'gr' => [ // groupe
  1153.                       'price' => 57,
  1154.                   ],
  1155.               ],
  1156.               'm4' => [ // menu 3 sans poisson
  1157.                   'in' => [ // individuel
  1158.                       'price' => 52,
  1159.                   ],
  1160.                   'gr' => [ // groupe
  1161.                       'price' => 52,
  1162.                   ],
  1163.               ],
  1164.           ],
  1165.       ],
  1166.       'd3' => [ // jour 3
  1167.           'mj' => [ // majestic
  1168.               'm1' => [ // menu 1
  1169.                   'in' => [ // individuel
  1170.                       'price' => 56,
  1171.                   ],
  1172.                   'gr' => [ // groupe
  1173.                       'price' => 53,
  1174.                   ],
  1175.               ],
  1176.               'm2' => [ // menu 2
  1177.                   'in' => [ // individuel
  1178.                       'price' => 64,
  1179.                   ],
  1180.                   'gr' => [ // groupe
  1181.                       'price' => 61,
  1182.                   ],
  1183.               ],
  1184.               'm3' => [ // menu 3
  1185.                   'in' => [ // individuel
  1186.                       'price' => 54,
  1187.                   ],
  1188.                   'gr' => [ // groupe
  1189.                       'price' => 54,
  1190.                   ],
  1191.               ],
  1192.               'm4' => [ // menu 3 sans poisson
  1193.                   'in' => [ // individuel
  1194.                       'price' => 49,
  1195.                   ],
  1196.                   'gr' => [ // groupe
  1197.                       'price' => 49,
  1198.                   ],
  1199.               ],
  1200.           ],
  1201.           've' => [ // versaille
  1202.               'm1' => [ // menu 1
  1203.                   'in' => [ // individuel
  1204.                       'price' => 69,
  1205.                   ],
  1206.                   'gr' => [ // groupe
  1207.                       'price' => 66,
  1208.                   ],
  1209.               ],
  1210.               'm2' => [ // menu 2
  1211.                   'in' => [ // individuel
  1212.                       'price' => 77,
  1213.                   ],
  1214.                   'gr' => [ // groupe
  1215.                       'price' => 74,
  1216.                   ],
  1217.               ],
  1218.               'm3' => [ // menu 3
  1219.                   'in' => [ // individuel
  1220.                       'price' => 57,
  1221.                   ],
  1222.                   'gr' => [ // groupe
  1223.                       'price' => 57,
  1224.                   ],
  1225.               ],
  1226.               'm4' => [ // menu 3 sans poisson
  1227.                   'in' => [ // individuel
  1228.                       'price' => 52,
  1229.                   ],
  1230.                   'gr' => [ // groupe
  1231.                       'price' => 52,
  1232.                   ],
  1233.               ],
  1234.           ],
  1235.       ],
  1236.       'd4' => [ // jour 4
  1237.           'mj' => [ // majestic
  1238.               'm1' => [ // menu 1
  1239.                   'in' => [ // individuel
  1240.                       'price' => 58,
  1241.                   ],
  1242.                   'gr' => [ // groupe
  1243.                       'price' => 55,
  1244.                   ],
  1245.               ],
  1246.               'm2' => [ // menu 2
  1247.                   'in' => [ // individuel
  1248.                       'price' => 66,
  1249.                   ],
  1250.                   'gr' => [ // groupe
  1251.                       'price' => 63,
  1252.                   ],
  1253.               ],
  1254.               'm3' => [ // menu 3
  1255.                   'in' => [ // individuel
  1256.                       'price' => 54,
  1257.                   ],
  1258.                   'gr' => [ // groupe
  1259.                       'price' => 54,
  1260.                   ],
  1261.               ],
  1262.               'm4' => [ // menu 3 sans poisson
  1263.                   'in' => [ // individuel
  1264.                       'price' => 49,
  1265.                   ],
  1266.                   'gr' => [ // groupe
  1267.                       'price' => 49,
  1268.                   ],
  1269.               ],
  1270.           ],
  1271.           've' => [ // versaille
  1272.               'm1' => [ // menu 1
  1273.                   'in' => [ // individuel
  1274.                       'price' => 71,
  1275.                   ],
  1276.                   'gr' => [ // groupe
  1277.                       'price' => 68,
  1278.                   ],
  1279.               ],
  1280.               'm2' => [ // menu 2
  1281.                   'in' => [ // individuel
  1282.                       'price' => 79,
  1283.                   ],
  1284.                   'gr' => [ // groupe
  1285.                       'price' => 76,
  1286.                   ],
  1287.               ],
  1288.               'm3' => [ // menu 3
  1289.                   'in' => [ // individuel
  1290.                       'price' => 57,
  1291.                   ],
  1292.                   'gr' => [ // groupe
  1293.                       'price' => 57,
  1294.                   ],
  1295.               ],
  1296.               'm4' => [ // menu 3 sans poisson
  1297.                   'in' => [ // individuel
  1298.                       'price' => 52,
  1299.                   ],
  1300.                   'gr' => [ // groupe
  1301.                       'price' => 52,
  1302.                   ],
  1303.               ],
  1304.           ],
  1305.       ],
  1306.       'd5' => [ // jour 5
  1307.           'mj' => [ // majestic
  1308.               'm1' => [ // menu 1
  1309.                   'in' => [ // individuel
  1310.                       'price' => 56,
  1311.                   ],
  1312.                   'gr' => [ // groupe
  1313.                       'price' => 53,
  1314.                   ],
  1315.               ],
  1316.               'm2' => [ // menu 2
  1317.                   'in' => [ // individuel
  1318.                       'price' => 64,
  1319.                   ],
  1320.                   'gr' => [ // groupe
  1321.                       'price' => 61,
  1322.                   ],
  1323.               ],
  1324.               'm3' => [ // menu 3
  1325.                   'in' => [ // individuel
  1326.                       'price' => 54,
  1327.                   ],
  1328.                   'gr' => [ // groupe
  1329.                       'price' => 54,
  1330.                   ],
  1331.               ],
  1332.               'm4' => [ // menu 3 sans poisson
  1333.                   'in' => [ // individuel
  1334.                       'price' => 49,
  1335.                   ],
  1336.                   'gr' => [ // groupe
  1337.                       'price' => 49,
  1338.                   ],
  1339.               ],
  1340.           ],
  1341.           've' => [ // versaille
  1342.               'm1' => [ // menu 1
  1343.                   'in' => [ // individuel
  1344.                       'price' => 69,
  1345.                   ],
  1346.                   'gr' => [ // groupe
  1347.                       'price' => 66,
  1348.                   ],
  1349.               ],
  1350.               'm2' => [ // menu 2
  1351.                   'in' => [ // individuel
  1352.                       'price' => 77,
  1353.                   ],
  1354.                   'gr' => [ // groupe
  1355.                       'price' => 74,
  1356.                   ],
  1357.               ],
  1358.               'm3' => [ // menu 3
  1359.                   'in' => [ // individuel
  1360.                       'price' => 57,
  1361.                   ],
  1362.                   'gr' => [ // groupe
  1363.                       'price' => 57,
  1364.                   ],
  1365.               ],
  1366.               'm4' => [ // menu 3 sans poisson
  1367.                   'in' => [ // individuel
  1368.                       'price' => 52,
  1369.                   ],
  1370.                   'gr' => [ // groupe
  1371.                       'price' => 52,
  1372.                   ],
  1373.               ],
  1374.           ],
  1375.       ],
  1376.   ];
  1377.     const foodPricesFixedSecond = [
  1378.         'me' => [
  1379.             'price' => 27,
  1380.         ],
  1381.         'sp1' => [
  1382.             'price' => 6,
  1383.         ],
  1384.         'sp2' => [
  1385.             'price' => 8,
  1386.         ],
  1387.         'ev' => [
  1388.             'price' => 20,
  1389.         ],
  1390.         'okm' => [
  1391.             'price' => 27,
  1392.         ],
  1393.         'pam' => [
  1394.             'price' => 52,
  1395.         ],
  1396.         'hhm' => [
  1397.             'price' => 27,
  1398.         ],
  1399.     ];
  1400.     const drinkPricesSecond = [
  1401.         'in' => [
  1402.             'b1' => [
  1403.                 'price' => 29,
  1404.             ],
  1405.             'b2' => [
  1406.                 'price' => 41,
  1407.             ],
  1408.         ],
  1409.         'gr' => [
  1410.             'b1' => [
  1411.                 'price' => 9,
  1412.             ],
  1413.             'b2' => [
  1414.                 'price' => 12,
  1415.             ],
  1416.             'b3' => [
  1417.                 'price' => 13,
  1418.             ],
  1419.             'b4' => [
  1420.                 'price' => 18,
  1421.             ],
  1422.             'b5' => [
  1423.                 'price' => 0,
  1424.             ],
  1425.         ],
  1426.     ];
  1427.     const venuePricesSecond = [
  1428.         'd1' => [ //MERCREDI / JEUDI MIDI
  1429.             'avecrepas' => [ // FOOD
  1430.                 'pn' => [ // PLACE NORMALE
  1431.                     'in' => [ // individuel
  1432.                         'price' => 43,
  1433.                     ],
  1434.                     'gr' => [ // groupe
  1435.                         'price' => 40,
  1436.                     ],
  1437.                 ],
  1438.                 'ph' => [ // PLACE D’HONNEUR45
  1439.                     'in' => [ // individuel
  1440.                         'price' => 50,
  1441.                     ],
  1442.                     'gr' => [ // groupe
  1443.                         'price' => 50,
  1444.                     ],
  1445.                 ],
  1446.                 'vip' => [ // LOGE VIP
  1447.                     'price' => 254,
  1448.                 ],
  1449.             ],
  1450.             'sansrepas' => [ // NO FOOD
  1451.                 'pn' => [ // PLACE NORMALE
  1452.                     'in' => [ // individuel
  1453.                         'price' => 55,
  1454.                     ],
  1455.                     'gr' => [ // groupe
  1456.                         'price' => 52,
  1457.                     ],
  1458.                 ],
  1459.                 'ph' => [ // PLACE D’HONNEUR45
  1460.                     'in' => [ // individuel
  1461.                         'price' => 62,
  1462.                     ],
  1463.                     'gr' => [ // groupe
  1464.                         'price' => 62,
  1465.                     ],
  1466.                 ],
  1467.                 'vip' => [ // LOGE VIP
  1468.                     'price' => 294,
  1469.                 ],
  1470.             ],
  1471.         ],
  1472.         'd2' => [ //VENDREDI SOIR
  1473.             'avecrepas' => [ // FOOD
  1474.                 'pn' => [ // PLACE NORMALE
  1475.                     'in' => [ // individuel
  1476.                         'price' => 53,
  1477.                     ],
  1478.                     'gr' => [ // groupe
  1479.                         'price' => 50,
  1480.                     ],
  1481.                 ],
  1482.                 'ph' => [ // PLACE D’HONNEUR45
  1483.                     'in' => [ // individuel
  1484.                         'price' => 63,
  1485.                     ],
  1486.                     'gr' => [ // groupe
  1487.                         'price' => 63,
  1488.                     ],
  1489.                 ],
  1490.                 'vip' => [ // LOGE VIP
  1491.                     'price' => 354,
  1492.                 ],
  1493.             ],
  1494.             'sansrepas' => [ // NO FOOD
  1495.                 'pn' => [ // PLACE NORMALE
  1496.                     'in' => [ // individuel
  1497.                         'price' => 65,
  1498.                     ],
  1499.                     'gr' => [ // groupe
  1500.                         'price' => 62,
  1501.                     ],
  1502.                 ],
  1503.                 'ph' => [ // PLACE D’HONNEUR45
  1504.                     'in' => [ // individuel
  1505.                         'price' => 75,
  1506.                     ],
  1507.                     'gr' => [ // groupe
  1508.                         'price' => 75,
  1509.                     ],
  1510.                 ],
  1511.                 'vip' => [ // LOGE VIP
  1512.                     'price' => 394,
  1513.                 ],
  1514.             ],
  1515.         ],
  1516.         'd3' => [ //SAMEDI MIDI
  1517.             'avecrepas' => [ // FOOD
  1518.                 'pn' => [ // PLACE NORMALE
  1519.                     'in' => [ // individuel
  1520.                         'price' => 48,
  1521.                     ],
  1522.                     'gr' => [ // groupe
  1523.                         'price' => 45,
  1524.                     ],
  1525.                 ],
  1526.                 'ph' => [ // PLACE D’HONNEUR45
  1527.                     'in' => [ // individuel
  1528.                         'price' => 58,
  1529.                     ],
  1530.                     'gr' => [ // groupe
  1531.                         'price' => 58,
  1532.                     ],
  1533.                 ],
  1534.                 'vip' => [ // LOGE VIP
  1535.                     'price' => 334,
  1536.                 ],
  1537.             ],
  1538.             'sansrepas' => [ // NO FOOD
  1539.                 'pn' => [ // PLACE NORMALE
  1540.                     'in' => [ // individuel
  1541.                         'price' => 60,
  1542.                     ],
  1543.                     'gr' => [ // groupe
  1544.                         'price' => 57,
  1545.                     ],
  1546.                 ],
  1547.                 'ph' => [ // PLACE D’HONNEUR45
  1548.                     'in' => [ // individuel
  1549.                         'price' => 70,
  1550.                     ],
  1551.                     'gr' => [ // groupe
  1552.                         'price' => 70,
  1553.                     ],
  1554.                 ],
  1555.                 'vip' => [ // LOGE VIP
  1556.                     'price' => 374,
  1557.                 ],
  1558.             ],
  1559.         ],
  1560.         'd4' => [ //SAMEDI SOIR
  1561.             'avecrepas' => [ // FOOD
  1562.                 'pn' => [ // PLACE NORMALE
  1563.                     'in' => [ // individuel
  1564.                         'price' => 53,
  1565.                     ],
  1566.                     'gr' => [ // groupe
  1567.                         'price' => 50,
  1568.                     ],
  1569.                 ],
  1570.                 'ph' => [ // PLACE D’HONNEUR45
  1571.                     'in' => [ // individuel
  1572.                         'price' => 63,
  1573.                     ],
  1574.                     'gr' => [ // groupe
  1575.                         'price' => 63,
  1576.                     ],
  1577.                 ],
  1578.                 'vip' => [ // LOGE VIP
  1579.                     'price' => 354,
  1580.                 ],
  1581.             ],
  1582.             'sansrepas' => [ // NO FOOD
  1583.                 'pn' => [ // PLACE NORMALE
  1584.                     'in' => [ // individuel
  1585.                         'price' => 65,
  1586.                     ],
  1587.                     'gr' => [ // groupe
  1588.                         'price' => 62,
  1589.                     ],
  1590.                 ],
  1591.                 'ph' => [ // PLACE D’HONNEUR45
  1592.                     'in' => [ // individuel
  1593.                         'price' => 75,
  1594.                     ],
  1595.                     'gr' => [ // groupe
  1596.                         'price' => 75,
  1597.                     ],
  1598.                 ],
  1599.                 'vip' => [ // LOGE VIP
  1600.                     'price' => 394,
  1601.                 ],
  1602.             ],
  1603.         ],
  1604.         'd5' => [ //DIMANCHE MIDI
  1605.             'avecrepas' => [ // FOOD
  1606.                 'pn' => [ // PLACE NORMALE
  1607.                     'in' => [ // individuel
  1608.                         'price' => 48,
  1609.                     ],
  1610.                     'gr' => [ // groupe
  1611.                         'price' => 45,
  1612.                     ],
  1613.                 ],
  1614.                 'ph' => [ // PLACE D’HONNEUR45
  1615.                     'in' => [ // individuel
  1616.                         'price' => 58,
  1617.                     ],
  1618.                     'gr' => [ // groupe
  1619.                         'price' => 58,
  1620.                     ],
  1621.                 ],
  1622.                 'vip' => [ // LOGE VIP
  1623.                     'price' => 334,
  1624.                 ],
  1625.             ],
  1626.             'sansrepas' => [ // NO FOOD
  1627.                 'pn' => [ // PLACE NORMALE
  1628.                     'in' => [ // individuel
  1629.                         'price' => 60,
  1630.                     ],
  1631.                     'gr' => [ // groupe
  1632.                         'price' => 57,
  1633.                     ],
  1634.                 ],
  1635.                 'ph' => [ // PLACE D’HONNEUR45
  1636.                     'in' => [ // individuel
  1637.                         'price' => 70,
  1638.                     ],
  1639.                     'gr' => [ // groupe
  1640.                         'price' => 70,
  1641.                     ],
  1642.                 ],
  1643.                 'vip' => [ // LOGE VIP
  1644.                     'price' => 374,
  1645.                 ],
  1646.             ],
  1647.         ],
  1648.     ];
  1649.     const venuePricesFixedSecond = [
  1650.         'af' => [
  1651.             'price' => 25,
  1652.         ],
  1653.         'ok' => [
  1654.             'price' => 47,
  1655.             'price_am' => 27,
  1656.             'price_rs' => 20,
  1657.         ],
  1658.         'no' => [
  1659.             'avecrepas' => [
  1660.                 'in' => [ // individuel
  1661.                     'price' => 53,
  1662.                 ],
  1663.                 'gr' => [ // groupe
  1664.                     'price' => 51,
  1665.                 ],
  1666.             ],
  1667.             'sansrepas' => [
  1668.                 'in' => [ // individuel
  1669.                     'price' => 28,
  1670.                 ],
  1671.                 'gr' => [ // groupe
  1672.                     'price' => 26,
  1673.                 ],
  1674.             ],
  1675.         ],
  1676.         'ss' => [
  1677.             'avecrepas' => [
  1678.                 'in' => [ // individuel
  1679.                     'price' => 293,
  1680.                     'price_am' => 223,
  1681.                     'price_rs' => 70,
  1682.                 ],
  1683.                 'gr' => [ // groupe
  1684.                     'price' => 293,
  1685.                     'price_am' => 223,
  1686.                     'price_rs' => 70,
  1687.                 ],
  1688.             ],
  1689.             'sansrepas' => [
  1690.                 'in' => [ // individuel
  1691.                     'price' => 156,
  1692.                     'price_am' => 96,
  1693.                     'price_rs' => 60,
  1694.                 ],
  1695.                 'gr' => [ // groupe
  1696.                     'price' => 156,
  1697.                     'price_am' => 96,
  1698.                     'price_rs' => 60,
  1699.                 ],
  1700.             ],
  1701.         ],
  1702.     ];
  1703.     const roomPricesSecond = [
  1704.         'd1' => [
  1705.             'price' => 140,
  1706.         ],
  1707.         'd2' => [
  1708.             'price' => 180,
  1709.         ],
  1710.         'd3' => [
  1711.             'price' => 180,
  1712.         ],
  1713.         'd4' => [
  1714.             'price' => 180,
  1715.         ],
  1716.         'd5' => [
  1717.             'price' => 140,
  1718.         ],
  1719.         'ss' => [
  1720.             'price' => 240,
  1721.         ],
  1722.     ];
  1723.   const giftPrice 4;
  1724.   const bonsOptions = [
  1725.             [
  1726.                 'id' => 1,
  1727.                 'name' => 'Forfait boisson Duo',
  1728.                 'price' => 29,
  1729.                 'lounge' => false,
  1730.                 'sub' => 'Pour deux personnes',
  1731.                 'restaurant' => true,
  1732.                 'boutique' => false,
  1733.                 'desc' => '<strong>Valable pour deux personnes</strong><br><br>
  1734.           1⁄2 bt de Pinot Blanc Dussourt<br>***<br>
  1735.           1⁄2 bt Bordeaux Château Goumin<br>***<br>
  1736.           2 cafés',
  1737.             ],
  1738.             [
  1739.                 'id' => 2,
  1740.                 'name' => 'Forfait boisson Prestigo',
  1741.                 'price' => 41,
  1742.                 'lounge' => false,
  1743.                 'sub' => 'Pour deux personnes',
  1744.                 'restaurant' => true,
  1745.                 'boutique' => false,
  1746.                 'desc' => '<strong>Valable pour deux personnes</strong><br><br>
  1747.           1⁄2 bt de Pinot Gris Signature Domaine Ville de Colmar<br>***<br>
  1748.           1⁄2 bt Saint-Emilion Cheval Noir Mähler-Besser<br>***<br>
  1749.           2 cafés',
  1750.             ],
  1751.             [
  1752.                 'id' => 3,
  1753.                 'name' => 'Ticket boisson 5€',
  1754.                 'price' => 5,
  1755.                 'sub' => '',
  1756.                 'restaurant' => false,
  1757.                 'boutique' => false,
  1758.                 'lounge' => true,
  1759.                 'desc' => '',
  1760.             ],
  1761.             [
  1762.                 'id' => 4,
  1763.                 'name' => 'Ticket boisson 8€',
  1764.                 'price' => 8,
  1765.                 'sub' => '',
  1766.                 'restaurant' => false,
  1767.                 'boutique' => false,
  1768.                 'lounge' => true,
  1769.                 'desc' => '',
  1770.             ],
  1771.             [
  1772.                 'id' => 5,
  1773.                 'name' => 'Ticket boisson 10€',
  1774.                 'price' => 10,
  1775.                 'sub' => '',
  1776.                 'restaurant' => false,
  1777.                 'boutique' => false,
  1778.                 'lounge' => true,
  1779.                 'desc' => '',
  1780.             ],
  1781.             [
  1782.                 'id' => 6,
  1783.                 'name' => 'Bouteille de Champagne',
  1784.                 'price' => 65,
  1785.                 'sub' => '',
  1786.                 'restaurant' => false,
  1787.                 'boutique' => false,
  1788.                 'lounge' => true,
  1789.                 'desc' => '',
  1790.             ],
  1791.             [
  1792.                 'id' => 7,
  1793.                 'name' => 'Bon d’achat boutique 10€',
  1794.                 'price' => 10,
  1795.                 'sub' => '',
  1796.                 'restaurant' => false,
  1797.                 'boutique' => true,
  1798.                 'lounge' => false,
  1799.                 'desc' => '',
  1800.             ],
  1801.             [
  1802.                 'id' => 8,
  1803.                 'name' => 'Bon d’achat boutique 20€',
  1804.                 'price' => 20,
  1805.                 'sub' => '',
  1806.                 'restaurant' => false,
  1807.                 'boutique' => true,
  1808.                 'lounge' => false,
  1809.                 'desc' => '',
  1810.             ],
  1811.             [
  1812.                 'id' => 9,
  1813.                 'name' => 'Assortiment de fromages',
  1814.                 'price' => 8,
  1815.                 'sub' => '',
  1816.                 'restaurant' => true,
  1817.                 'boutique' => false,
  1818.                 'lounge' => false,
  1819.                 'desc' => '',
  1820.             ],
  1821.         ];
  1822.   /**
  1823.   * @Route("/{locale}/reservation/tunnel", name="framework_front_reservation", requirements={"locale" = "([a-z\-0-9]+)"})
  1824.   */
  1825.     public function reservationTunnelAction(Request $requestVenueRepository $venueRepository,PlacesRepository $placesRepository$locale NULL)
  1826.     {
  1827.         $request->setLocale($locale);
  1828.         $em $this->getDoctrine()->getManager();
  1829.         // Convertir la date sélectionnée en objet DateTime
  1830.         $content $request->get('show_id');
  1831.         // Récupérer la disponibilité pour la date sélectionnée
  1832.         $disponibility $venueRepository->findOneBy(['id' => $content]);
  1833.         // Initialiser les indicateurs
  1834.         // $places = [
  1835.         //     '$isMajesicFull' => false,
  1836.         //     '$isVersaillFull' => false,
  1837.         //     '$isNormalFull' => false,
  1838.         //     '$isHonneurFull' => false,
  1839.         //     '$isVipFull' => false,
  1840.         //     '$isMiniSuiteFull' => false,
  1841.         // ];
  1842.         $places = new Places();
  1843.         $places->setIsMajesicFull(0);
  1844.         $places->setIsVersaillesFull(0);
  1845.         $places->setIsPlaceNormal(0);
  1846.         $places->setIsPlaceHonneur(0);
  1847.         $places->setIsPlaceVip(0);
  1848.         $places->setIsMiniSuiteFull(0);
  1849.         if ($disponibility != null) {
  1850.            // $places_tmp = $disponibility->getPlaces()->toArray()[0];
  1851.             if(isset($disponibility->getPlaces()->toArray()[0])) {
  1852.               $places $disponibility->getPlaces()->toArray()[0];
  1853.                 // foreach ($places as $place) {
  1854.                 //     // Mettre à jour les indicateurs avec les valeurs actuelles
  1855.                 //     $isMajesicFull = $place->isIsMajesicFull();
  1856.                 //     $isVersaillFull = $place->isIsVersaillesFull();
  1857.                 //     $isNormalFull = $place->isIsPlaceNormal();
  1858.                 //     $isHonneurFull = $place->isIsPlaceHonneur();
  1859.                 //     $isVipFull = $place->isIsPlaceVip();
  1860.                 //     $isMiniSuiteFull = $place->isIsMiniSuiteFull();
  1861.                 // }
  1862.             }
  1863.         }
  1864.         // Parcourir la collection de places
  1865.         $globals $this->get("twig")->getGlobals();
  1866.         $locales explode('|'$globals["app_locales"]);
  1867.         $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'reservation-tunnel''locale' => $locale]);
  1868.         return $this->render('FrontBundle/Page/reservation-tunnel.html.twig', [
  1869.             'page' => $page,
  1870.             'body' => '',
  1871.             'places' => $places,
  1872.             'de_url' => 'reservation/tunnel',
  1873.             'en_url' => 'reservation/tunnel',
  1874.             'fr_url' => 'reservation/tunnel',
  1875.             // 'labels' => self::labels,
  1876.         ]);
  1877.     }
  1878.   /**
  1879.   * @Route("/{locale}/reservation/confirmation", name="framework_front_reservation_confirm", requirements={"locale" = "([a-z\-0-9]+)"})
  1880.   */
  1881.   public function reservationConfirmAction(Request $request$locale NULL)
  1882.   {
  1883.     $request->setLocale($locale);
  1884.     $em $this->getDoctrine()->getManager();
  1885.     $globals $this->get("twig")->getGlobals();
  1886.     $locales explode('|'$globals["app_locales"]);
  1887.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'reservation-confirm''locale' => $locale]);
  1888.     return $this->render('FrontBundle/Page/reservation-confirm.html.twig', [
  1889.       'page' => $page,
  1890.       'body' => '',
  1891.     ]);
  1892.   }
  1893.   /**
  1894.   * @Route("/tunnel/consts", name="tunnel_consts_ajax")
  1895.   * @Route("/tunnel/consts/{locale}", name="tunnel_consts_ajax_locale", requirements={"locale" = "([a-z\-0-9]+)"})
  1896.   */
  1897.   public function constsAction(Request $request$locale NULL)
  1898.   {
  1899.     $isAjax $request->isXMLHttpRequest();
  1900.     if ($isAjax) {   
  1901.       $em $this->getDoctrine()->getManager();
  1902.       // $encoders = [new XmlEncoder(), new JsonEncoder()];
  1903.       // $normalizers = [new ObjectNormalizer()];
  1904.       // $serializer = new Serializer($normalizers, $encoders);
  1905.       $venue $em->getRepository('FrameworkAppBundle:Venue')->findOneById($request->get('venue_id'));
  1906.       $labels self::labels;
  1907.       if($locale == 'de'){
  1908.         $labels self::labelsDe;
  1909.       }
  1910.       if($locale == 'en'){
  1911.         $labels self::labelsEn;
  1912.       }
  1913.       $labelsSecond self::labelsSecond;
  1914.       if($locale == 'de'){
  1915.         $labelsSecond self::labelsSecondDe;
  1916.       }
  1917.       if($locale == 'en'){
  1918.         $labelsSecond self::labelsSecondEn;
  1919.       }
  1920.       $jsonContent = [
  1921.         'labels' => $labels,
  1922.         'foodPrices' => self::foodPrices,
  1923.         'foodPricesFixed' => self::foodPricesFixed,
  1924.         'drinkPrices' => self::drinkPrices,
  1925.         'venuePrices' => self::venuePrices,
  1926.         'venuePricesFixed' => self::venuePricesFixed,
  1927.         'roomPrices' => self::roomPrices,
  1928.         'labelsFirst' => $labels,
  1929.         'foodPricesFirst' => self::foodPrices,
  1930.         'foodPricesFixedFirst' => self::foodPricesFixed,
  1931.         'drinkPricesFirst' => self::drinkPrices,
  1932.         'venuePricesFirst' => self::venuePrices,
  1933.         'venuePricesFixedFirst' => self::venuePricesFixed,
  1934.         'roomPricesFirst' => self::roomPrices,
  1935.         'labelsSecond' => $labelsSecond,
  1936.         'foodPricesSecond' => self::foodPricesSecond,
  1937.         'foodPricesFixedSecond' => self::foodPricesFixedSecond,
  1938.         'drinkPricesSecond' => self::drinkPricesSecond,
  1939.         'venuePricesSecond' => self::venuePricesSecond,
  1940.         'venuePricesFixedSecond' => self::venuePricesFixedSecond,
  1941.         'roomPricesSecond' => self::roomPricesSecond,
  1942.       ];
  1943.       //PRIX NOUVELLE SAISON
  1944.       if( $venue && $venue->getVenueType()->getSeason() == 2025 ){
  1945.         $labels self::labels;
  1946.         if($locale == 'de'){
  1947.           $labels self::labelsDe;
  1948.         }
  1949.         if($locale == 'en'){
  1950.           $labels self::labelsEn;
  1951.         }
  1952.         $labelsSecond self::labelsSecond;
  1953.         if($locale == 'de'){
  1954.           $labelsSecond self::labelsSecondDe;
  1955.         }
  1956.         if($locale == 'en'){
  1957.           $labelsSecond self::labelsSecondEn;
  1958.         }
  1959.         $jsonContent = [
  1960.           'labels' => $labelsSecond,
  1961.           'foodPrices' => self::foodPricesSecond,
  1962.           'foodPricesFixed' => self::foodPricesFixedSecond,
  1963.           'drinkPrices' => self::drinkPricesSecond,
  1964.           'venuePrices' => self::venuePricesSecond,
  1965.           'venuePricesFixed' => self::venuePricesFixedSecond,
  1966.           'roomPrices' => self::roomPricesSecond,
  1967.           'labelsFirst' => $labels,
  1968.           'foodPricesFirst' => self::foodPrices,
  1969.           'foodPricesFixedFirst' => self::foodPricesFixed,
  1970.           'drinkPricesFirst' => self::drinkPrices,
  1971.           'venuePricesFirst' => self::venuePrices,
  1972.           'venuePricesFixedFirst' => self::venuePricesFixed,
  1973.           'roomPricesFirst' => self::roomPrices,
  1974.           'labelsSecond' => $labelsSecond,
  1975.           'foodPricesSecond' => self::foodPricesSecond,
  1976.           'foodPricesFixedSecond' => self::foodPricesFixedSecond,
  1977.           'drinkPricesSecond' => self::drinkPricesSecond,
  1978.           'venuePricesSecond' => self::venuePricesSecond,
  1979.           'venuePricesFixedSecond' => self::venuePricesFixedSecond,
  1980.           'roomPricesSecond' => self::roomPricesSecond,
  1981.         ];
  1982.       }
  1983.       $response = new Response(json_encode($jsonContent));
  1984.       $response->headers->set('Content-Type''application/json');
  1985.       return $response;
  1986.     } else {
  1987.       return $this->redirectToRoute('framework_front_page_index');
  1988.     }
  1989.   }
  1990.   /**
  1991.   * @Route("/tunnel/amount", name="tunnel_amount_ajax")
  1992.   */
  1993.   public function amountAction(Request $request)
  1994.   {
  1995.     $isAjax $request->isXMLHttpRequest();
  1996.     if ($isAjax) {   
  1997.       $em $this->getDoctrine()->getManager();
  1998.       $encoders = [new XmlEncoder(), new JsonEncoder()];
  1999.       $normalizers = [new ObjectNormalizer()];
  2000.       $serializer = new Serializer($normalizers$encoders);
  2001.       $resa $request->get('resa');
  2002.       $venue $em->getRepository('FrameworkAppBundle:Venue')->findOneById($resa['show']['id']);
  2003.       $amount $this->getAmount($resa$venue);
  2004. // dump($amount);exit;
  2005.       $jsonContent json_encode($amount['amount']);
  2006.       $response = new Response($jsonContent);
  2007.       $response->headers->set('Content-Type''application/json');
  2008.       return $response;
  2009.     } else {
  2010.       return $this->redirectToRoute('framework_front_page_index');
  2011.     }
  2012.   }
  2013.   function getAmount($resa$venue){
  2014.     $amount 0;
  2015.     $amount_adam 0;
  2016.     $amount_show 0;
  2017.     $foodPrices self::foodPrices;
  2018.     $foodPricesFixed self::foodPricesFixed;
  2019.     $drinkPrices self::drinkPrices;
  2020.     $roomPrices self::roomPrices;
  2021.     $venuePrices self::venuePrices;
  2022.     $venuePricesFixed self::venuePricesFixed;
  2023.     $giftPrice self::giftPrice;
  2024.     //PRIX NOUVELLE SAISON
  2025.     if( $venue->getVenueType()->getSeason() == 2025 ){
  2026.       $foodPrices self::foodPricesSecond;
  2027.       $foodPricesFixed self::foodPricesFixedSecond;
  2028.       $drinkPrices self::drinkPricesSecond;
  2029.       $roomPrices self::roomPricesSecond;
  2030.       $venuePrices self::venuePricesSecond;
  2031.       $venuePricesFixed self::venuePricesFixedSecond;
  2032.     }
  2033.     $day $resa['show']['day'];
  2034.     $resto = ( $resa['step2']['resto'] == 'majestic') ? 'mj' 've';
  2035.     $group = ( $resa['step1']['group'] == 'individuel') ? 'in' 'gr';
  2036.     $formula $resa['step1']['formula'];
  2037.   
  2038.     if(isset($resa['step2']['selection'])){
  2039.       foreach ($resa['step2']['selection'] as $key => $value) {
  2040.         $ref $value['ref'];
  2041.         if(strpos($ref'-') !== false){
  2042.           $ref explode('-'$ref)[1];
  2043.         }
  2044.         if( $formula == 'avecrepas' ){
  2045.           //REPAS
  2046.           if( isset($foodPrices[$day][$resto][$ref]) ){
  2047.             if( $ref == 'm3' && $value['option'] ){
  2048.               $amount $amount + ($foodPrices[$day][$resto]['m4'][$group]['price'] * $value['qty']);
  2049.             } else {
  2050.               $amount $amount + ($foodPrices[$day][$resto][$ref][$group]['price'] * $value['qty']);
  2051.             }
  2052.           }
  2053.           //REPAS FIXE
  2054.           if( isset($foodPricesFixed[$ref]) ){
  2055.             $amount $amount + ($foodPricesFixed[$ref]['price'] * $value['qty']);
  2056.           }
  2057.           //BOISSONS
  2058.           if( isset($drinkPrices[$group][$ref]) ){
  2059.             $amount $amount + ($drinkPrices[$group][$ref]['price'] * $value['qty']);
  2060.           }
  2061.           //TICKETS BOISSONS
  2062.           if( substr($ref02) == 'tk' ){
  2063.             $tk explode('tk'$ref);
  2064.             $amount $amount $tk[1] * $value['qty'];
  2065.           }
  2066.         } else { //SANS REPAS
  2067.           //REPAS OKTOBER
  2068.           if( isset($foodPricesFixed[$ref]) ){
  2069.             $amount $amount + ($foodPricesFixed[$ref]['price'] * $value['qty']);
  2070.           }
  2071.         }
  2072.         //MINISUITES
  2073.         if($venue->getId() == 335){ //CUSTOM VENUE
  2074.           if( $ref == 'ms' ){
  2075.             $amount $amount + ($roomPrices['d1']['price'] * $value['qty']);
  2076.           }
  2077.         } elseif($venue->getId() >= 245 && $venue->getId() <= 249){ //CUSTOM VENUE
  2078.           if( $ref == 'ms' ){
  2079.             $amount $amount + ($roomPrices['d1']['price'] * $value['qty']);
  2080.           }
  2081.         } else {
  2082.           if( $ref == 'ms' ){
  2083.             $amount $amount + ($roomPrices[$day]['price'] * $value['qty']);
  2084.           }
  2085.         }
  2086.         //END MINISUITES
  2087.       }
  2088.     }
  2089.     // //GIFT
  2090.     // if( isset($resa['step1']['gift']) && $resa['step1']['gift'] == 'true' ){
  2091.     //   $amount = $amount + $giftPrice;
  2092.     // }
  2093.     //save prix des repas
  2094.     $amount_adam $amount;
  2095.     //SHOW
  2096.     if( $venue->getVenueType()->getSlug() == 'co' ){ // IF CONCERT
  2097.       if( $resa['step3']['pn'] > ){
  2098.         $amount $amount + (floatval($venue->getConcert()->getInfo('pn')) * $resa['step3']['pn']);
  2099.       }
  2100.       if( $resa['step3']['ph'] > ){
  2101.         $amount $amount + (floatval($venue->getConcert()->getInfo('ph')) * $resa['step3']['ph']);
  2102.       }
  2103.       if( $resa['step3']['vip'] > ){
  2104.         $amount $amount + (floatval($venue->getConcert()->getInfo('vip')));
  2105.       }
  2106.     } elseif( $resa['show']['type'] == 'ss' ){ // IF SAINT SYLVESTRE
  2107.       if( $resa['step3']['pn'] > ){
  2108.         $amount $amount + ($venuePricesFixed['ss'][$formula][$group]['price'] * $resa['step3']['pn']);
  2109.       }
  2110.     } else {
  2111.       if( $resa['step3']['pn'] > ){
  2112.         $amount $amount + ($venuePrices[$day][$formula]['pn'][$group]['price'] * $resa['step3']['pn']);
  2113.       }
  2114.       if( $resa['step3']['ph'] > ){
  2115.         $amount $amount + ($venuePrices[$day][$formula]['ph'][$group]['price'] * $resa['step3']['ph']);
  2116.       }
  2117.       if( $resa['step3']['vip'] > ){
  2118.         $amount $amount + ($venuePrices[$day][$formula]['vip']['price']);
  2119.       }
  2120.     }
  2121.     //NOEL DES ENFANTS
  2122.     if( $resa['show']['type'] == 'no' ){
  2123.       if(isset($resa['step2']['selection'])){
  2124.         foreach ($resa['step2']['selection'] as $key => $value) {
  2125.           $ref $value['ref'];
  2126.           if( isset($venuePricesFixed[$ref]) ){
  2127.             $amount $amount + ($venuePricesFixed[$ref][$formula][$group]['price'] * $value['qty']);
  2128.           }
  2129.         }
  2130.       }
  2131.     }
  2132.     //OKTOBERFEST
  2133.     if( $resa['show']['type'] == 'ok' ){
  2134.         //NEW OVERRIDE
  2135.         //$amount = $amount_adam = $amount_show = 0;
  2136.         if( $resa['step1']['participants'] > ){
  2137.             $amount_adam $amount_adam + ($venuePricesFixed['ok']['price_am'] * $resa['step1']['participants']);
  2138.             $amount_show $amount_show + ($venuePricesFixed['ok']['price_rs'] * $resa['step1']['participants']);
  2139.         }
  2140. /*      if(isset($resa['step2']['selection'])){
  2141.         foreach ($resa['step2']['selection'] as $key => $value) {
  2142.           $ref = $value['ref'];
  2143.           if( isset($venuePricesFixed[$ref]) ){
  2144.             $amount = $amount + ($venuePricesFixed[$ref]['price'] * $value['qty']);
  2145.           }
  2146.         }
  2147.       }*/
  2148.       $amount $amount_adam $amount_show;
  2149.         //END NEW OVERRIDE
  2150.     }
  2151.     //AFTERWORK
  2152.     if( $resa['show']['type'] == 'af' ){
  2153.       if(isset($resa['step2']['selection'])){
  2154.         foreach ($resa['step2']['selection'] as $key => $value) {
  2155.           $ref $value['ref'];
  2156.           if( isset($venuePricesFixed[$ref]) ){
  2157.             $amount $amount + ($venuePricesFixed[$ref]['price'] * $value['qty']);
  2158.           }
  2159.         }
  2160.       }
  2161.     }
  2162.     $amount_show $amount $amount_adam;
  2163.     //SAINT SYLVESTRE
  2164.     if( $resa['show']['type'] == 'ss' ){
  2165.       $amount $amount_adam $amount_show;
  2166.       $amount_adam $amount;
  2167.       $amount_show 0;
  2168.       //NEW OVERRIDE
  2169.       $amount $amount_adam $amount_show 0;
  2170.       if( $resa['step3']['pn'] > ){
  2171.         $amount_adam = ($venuePricesFixed['ss'][$formula][$group]['price_am'] * $resa['step3']['pn']);
  2172.         $amount_show = ($venuePricesFixed['ss'][$formula][$group]['price_rs'] * $resa['step3']['pn']);
  2173.         
  2174.       }
  2175.       if(isset($resa['step2']['selection'])){
  2176.         foreach ($resa['step2']['selection'] as $key => $value) {
  2177.           $ref $value['ref'];
  2178.           if(strpos($ref'-') !== false){
  2179.             $ref explode('-'$ref)[1];
  2180.           }
  2181.           if( $ref == 'ms' ){
  2182.             $amount_adam $amount_adam + ($roomPrices['ss']['price'] * $value['qty']);
  2183.           }
  2184.         }
  2185.       }
  2186.       $amount $amount_adam $amount_show;
  2187.       //END NEW OVERRIDE
  2188.     }
  2189.     //GIFT NEW TO ROYAL SHOW
  2190.     if( isset($resa['step1']['gift']) && $resa['step1']['gift'] == 'true' ){
  2191.       $amount $amount $giftPrice;
  2192.       $amount_show $amount_show $giftPrice;
  2193.     }
  2194.     return [
  2195.       'amount' => $amount,
  2196.       'amount_adam' => $amount_adam,
  2197.       'amount_show' => $amount_show,
  2198.     ];
  2199.   }
  2200.   /**
  2201.   * @Route("/tunnel/calendar/load", name="tunnel_calendar_load_ajax")
  2202.   */
  2203.   public function loadAction(Request $request)
  2204.   {
  2205.     $em $this->getDoctrine()->getManager();
  2206.     $isAjax $request->isXMLHttpRequest();
  2207.     if (!$isAjax) {         
  2208.       return $this->redirectToRoute('palace_manager_calendar_index');
  2209.     }
  2210.     $success false;
  2211.     $error $slug '';
  2212.     $venue $em->getRepository('FrameworkAppBundle:Venue')->findOneById($request->get('id'));
  2213.     if(!$venue){
  2214.       $error 'Erreur de chargement';
  2215.     } else {
  2216.       $success true;
  2217.     }
  2218.     $form = [];
  2219.     if($success){
  2220.       if($request->get('lang')){
  2221.         $lang $request->get('lang');
  2222.       } else {
  2223.         $lang $request->getLocale();
  2224.       }
  2225.       
  2226.       $form['id'] = $venue->getId();
  2227.       $form['title'] = $venue->getTitle();
  2228.       $form['concert'] = $venue->getConcert();
  2229.       $form['description'] = $venue->getVenueType()->getDescriptionTr($lang);
  2230.       $form['description_venue'] = $venue->getDescriptionTr($lang);
  2231.       $form['thumbnail'] = $venue->getVenueType()->getThumbnail();
  2232.       $form['type'] = $venue->getVenueType()->getId();
  2233.       $form['typeSlug'] = $venue->getVenueType()->getSlug();
  2234.       $form['season'] = $venue->getVenueType()->getSeason();
  2235.       $form['food'] = ($venue->getVenueType()->getFood()) ? 'true' 'false';
  2236.       $form['start'] = date_format($venue->getStart(), 'd/m/Y H:i');
  2237.       $form['date'] = date_format($venue->getStart(), 'Y-m-d');
  2238.       $form['hour'] = date_format($venue->getStart(), 'H:i');
  2239.       $form['pn'] = 0;
  2240.       $form['ph'] = 0;
  2241.       $form['vip'] = 0;
  2242.       $form['full'] = $venue->getIsfull();
  2243.       $form['places'] = array_map(function($place) {
  2244.                     return [
  2245.                         'is_versailles_full' => $place->isIsVersaillesFull(),
  2246.                         'is_majesic_full' => $place->isIsMajesicFull(),
  2247.                         'is_vip_full' => $place->isIsPlaceVip(),
  2248.                         'is_normal_full' => $place->isIsPlaceNormal(),
  2249.                         'is_honneur_full' => $place->isIsPlaceHonneur(),
  2250.                         'is_mini_suite_full' => $place->isIsMiniSuiteFull(),
  2251.                     ];
  2252.                 }, $venue->getPlaces()->toArray());
  2253.       // setlocale(LC_TIME, "fr_FR");
  2254.       // $dateStr = ucfirst( strftime("%A %d %B %G %Hh%M", strtotime(date_format($venue->getStart(), 'Y-m-d H:i:s'))) );
  2255.       // $form['dateStr'] = $dateStr;
  2256.       if($request->get('lang') == 'de'){
  2257.         $form['dateStr'] = $venue->getStrStartDe();
  2258.       } elseif($request->get('lang') == 'en'){
  2259.         $form['dateStr'] = $venue->getStrStartEn();
  2260.       } else {
  2261.         $form['dateStr'] = $venue->getStrStart();
  2262.       }
  2263.       if( $venue->getVenueType()->getSeason() == 2023 ){ //OVERIDE DES JOURS REGROUPES POUR 2025
  2264.         switch ( intval(strftime("%w"strtotime(date_format($venue->getStart(), 'Y-m-d H:i:s')))) ) {
  2265.           case 3//Mer
  2266.             $day 'd1';
  2267.             break;
  2268.           case 4//Jeu
  2269.             $day 'd1';
  2270.             break;
  2271.           case 5//Ven
  2272.             $day 'd4';
  2273.             break;
  2274.           case 6//Sam
  2275.             $day 'd3';
  2276.             if( intval(strftime("%k"strtotime(date_format($venue->getStart(), 'Y-m-d H:i:s')))) > 15 ){ //SI SAMEDI SOIR
  2277.               $day 'd4';
  2278.             }
  2279.             break;
  2280.           case 0//Dim
  2281.             $day 'd5';
  2282.             break;
  2283.           default:
  2284.             $day 'd1';
  2285.             break;
  2286.         }
  2287.       } else {
  2288.         switch ( intval(strftime("%w"strtotime(date_format($venue->getStart(), 'Y-m-d H:i:s')))) ) {
  2289.           case 3//Mer
  2290.             $day 'd1';
  2291.             break;
  2292.           case 4//Jeu
  2293.             $day 'd1';
  2294.             break;
  2295.           case 5//Ven
  2296.             $day 'd2';
  2297.             break;
  2298.           case 6//Sam
  2299.             $day 'd3';
  2300.             if( intval(strftime("%k"strtotime(date_format($venue->getStart(), 'Y-m-d H:i:s')))) > 15 ){ //SI SAMEDI SOIR
  2301.               $day 'd4';
  2302.             }
  2303.             break;
  2304.           case 0//Dim
  2305.             $day 'd5';
  2306.             break;
  2307.           default:
  2308.             $day 'd1';
  2309.             break;
  2310.         }
  2311.       }
  2312.       if( $venue->getForceDay() != null && strlen($venue->getForceDay()) > ){
  2313.         $day $venue->getForceDay();
  2314.       }
  2315.       $form['day'] = $day;
  2316.     }
  2317.     //concerts
  2318.     if( $venue->getVenueType()->getSlug() == 'co' ){
  2319.       $form['description'] = $venue->getConcert()->getDescription($lang);
  2320.       $form['thumbnail'] = $venue->getConcert()->getThumbnail();
  2321.       $form['pn'] = $venue->getConcert()->getInfo('pn');
  2322.       $form['ph'] = $venue->getConcert()->getInfo('ph');
  2323.       $form['vip'] = $venue->getConcert()->getInfo('vip');
  2324.     }
  2325.     $data = [
  2326.       'error' => $error,
  2327.       'success' => $success,
  2328.       'form' => $form,
  2329.     ];
  2330. // dump($data);
  2331. // exit;
  2332.     $response = new Response(json_encode($data));
  2333.     $response->headers->set('Content-Type''application/json');
  2334.     return $response;
  2335.   }
  2336.   /**
  2337.   * @Route("/tunnel/credentials/check", name="tunnel_credentials_check_ajax")
  2338.   * @Route("/tunnel/credentials/check/{locale}", name="tunnel_credentials_check_ajax_locale", requirements={"locale" = "([a-z\-0-9]+)"})
  2339.   */
  2340.   public function credentialsCheckAction(Request $requestUserPasswordEncoderInterface $passwordEncoderLoginFormAuthenticator $loginGuardAuthenticatorHandler $guard$locale NULL)
  2341.   {
  2342.     if($locale){
  2343.       $request->setLocale($locale);
  2344.     }
  2345.     $success $check false;
  2346.     $error '';
  2347.     $userArr = [];
  2348.     $em $this->getDoctrine()->getManager();
  2349.     $tr $this->loadTranslation($locale);
  2350.     $user $em->getRepository('FrameworkAppBundle:User')->findOneBy(['email' => $request->get('email')]);
  2351.     if( $request->get('email') == '' || $request->get('password') == ''){
  2352.       $error $tr['contact_error2'];
  2353.     } else {
  2354.       if(!$user){
  2355.         $error $tr['login_error1'];
  2356.       } else {
  2357.         $check $passwordEncoder->isPasswordValid($user$request->get('password'));
  2358.         if(!$check){
  2359.           $error $tr['login_error2'];
  2360.         } else {
  2361.           $guard->authenticateUserAndHandleSuccess($user,$request,$login,'main');
  2362.           $success true;
  2363.           $infos = [
  2364.             'lastname' => $user->getInfo('lastname'),
  2365.             'firstname' => $user->getInfo('firstname'),
  2366.             'company' => $user->getInfo('company'),
  2367.             'phone' => $user->getInfo('phone'),
  2368.             'email' => $user->getInfo('email'),
  2369.             'lastname' => $user->getInfo('lastname'),
  2370.             'address' => $user->getInfo('address1'),
  2371.             'zipcode' => $user->getInfo('zipcode'),
  2372.             'city' => $user->getInfo('city'),
  2373.             'country_code' => $user->getInfo('country_code'),
  2374.             'country' => $user->getInfo('country'),
  2375.           ];
  2376.           $userArr = [
  2377.             'email' => $user->getEmail(),
  2378.             'infos' => $infos,
  2379.           ];
  2380.         }
  2381.       }
  2382.     }
  2383.     
  2384. // dump($check);
  2385. //     exit;
  2386.     $data = [
  2387.       'error' => $error,
  2388.       'success' => $success,
  2389.       'user' => $userArr,
  2390.     ];
  2391.     $response = new Response(json_encode($data));
  2392.     $response->headers->set('Content-Type''application/json');
  2393.     return $response;
  2394.   }
  2395.   /**
  2396.   * @Route("/tunnel/booking/send", name="tunnel_booking_send_ajax")
  2397.   * @Route("/tunnel/booking/send/{locale}", name="tunnel_booking_send_ajax_locale", requirements={"locale" = "([a-z\-0-9]+)"})
  2398.   */
  2399.   public function bookingSendAction(Request $requestUserPasswordEncoderInterface $passwordEncoderLoginFormAuthenticator $loginGuardAuthenticatorHandler $guardMailerInterface $mailer$locale NULL)
  2400.   {
  2401.     if($locale){
  2402.       $request->setLocale($locale);
  2403.     }
  2404.     $tr $this->loadTranslation($locale);
  2405.     require_once dirname(__FILE__).'/../../plugins/stripe-php-10.12.1/init.php';
  2406.     $success true;
  2407.     $error '';
  2408.     $em $this->getDoctrine()->getManager();
  2409.     $globals $this->get("twig")->getGlobals();
  2410.     $resa $request->get('palace_resa');
  2411.     $infos $request->get('infos');
  2412.     $venue $em->getRepository('FrameworkAppBundle:Venue')->findOneById($resa['show']['id']);
  2413.     $user $this->getUser();
  2414.     if($infos['firstname'] == '' || $infos['lastname'] == '' || $infos['phone'] == '' || $infos['address'] == '' || $infos['zipcode'] == '' || $infos['city'] == '' || $infos['country_code'] == '') {
  2415.         $error $tr['contact_error2'];
  2416.         $success false;
  2417.     } 
  2418.     if( $infos['form_mode'] == 'register' ){
  2419.       if( $em->getRepository('FrameworkAppBundle:User')->findOneBy(['email' => $infos['email']]) ){
  2420.           $error $tr['signup_error1'];
  2421.           $success false;
  2422.       } elseif($infos['email'] == '' || $infos['password'] == '' || $infos['confirm'] == '') {
  2423.           $error $tr['contact_error2'];
  2424.           $success false;
  2425.       } elseif(strlen($infos['password']) < 8) {
  2426.           $error $tr['signup_error2'];
  2427.           $success false;
  2428.       } elseif($infos['password'] != $infos['confirm']) {
  2429.           $error $tr['signup_error3'];
  2430.           $success false;
  2431.       } elseif($infos['agree'] == 'false') {
  2432.           $error $tr['signup_error4'];
  2433.           $success false;
  2434.       }
  2435.     }
  2436.     if( $infos['form_mode'] == 'logged' && $user == null ){
  2437.       $error $tr['signup_error5'];
  2438.       $success false;
  2439.     }
  2440.     if( $infos['gift'] == 'true' && strlen($infos['gift_user']) < ){
  2441.       $error $tr['booking_error1'];
  2442.       $success false;
  2443.     }
  2444.     if( !$venue ){
  2445.       $error $tr['booking_error2'];
  2446.       $success false;
  2447.     } elseif ( $venue->getStart()->getTimestamp() < time() ){
  2448.       $error $tr['booking_error2'];
  2449.       $success false;
  2450.     }
  2451.     if($success){
  2452.       
  2453.       if($user == null && $infos['form_mode'] == 'register'){
  2454.         //REGISTER USER
  2455. if(trim($infos['email']) == 'sample@email.tst'){
  2456. exit;
  2457. }
  2458.             $user = new User();
  2459.             $user->setUsername(strtolower(trim($infos['email'])));
  2460.             $user->setEmail(strtolower(trim($infos['email'])));
  2461.             $user->setPassword(
  2462.                 $passwordEncoder->encodePassword(
  2463.                   $user,
  2464.                   $infos['password']
  2465.                 )
  2466.             );
  2467.             $user->setDeleted(0);
  2468.             $user->setRoles(["ROLE_USER"]);
  2469.               $stripe = new \Stripe\StripeClient(
  2470.                 $globals['stripe_secret_key']
  2471.               );
  2472.               $customer $stripe->customers->create([
  2473.                 'email' => strtolower(trim($infos['email'])),
  2474.                 'name' => ucwords(strtolower(trim($infos['firstname']))).' '.strtoupper(trim($infos['lastname'])),
  2475.                 'address' => [
  2476.                   'city' => trim($infos['city']),
  2477.                   'country' => $infos['country_code'],
  2478.                   'line1' => trim($infos['address']),
  2479.                   'postal_code' => trim($infos['zipcode']),
  2480.                 ],
  2481.                 'metadata' => ['user_id' => $user->getId()],
  2482.               ]);
  2483.             $user->setInfos(json_encode(['stripe_id' => $customer->id]));
  2484.             $em->persist($user);
  2485.             $em->flush();
  2486.             //FORCE LOG IN
  2487.             $guard->authenticateUserAndHandleSuccess($user,$request,$login,'main');
  2488.       }
  2489.       //RECORD RESA
  2490.       $amount $this->getAmount($resa$venue);
  2491.       $lastBooking =  $em->getRepository('FrameworkAppBundle:Booking')->findOneBy([], ['baseId' => 'DESC']);
  2492.       if($lastBooking){
  2493.         $lastId $lastBooking->getBaseId();
  2494.       } else {
  2495.         $lastId 57530;
  2496.       }
  2497.       $date = new \DateTimeImmutable();
  2498.       $milli = (int)$date->format('Uv');
  2499.       $infos['ip']=$_SERVER['REMOTE_ADDR'];
  2500.       $booking = new Booking();
  2501.       $booking->setBaseId($lastId 1);
  2502.       $booking->setVenue($venue);
  2503.       $booking->setUser($user);
  2504.       $booking->setToken($milli);
  2505.       $booking->setInfos(json_encode($infos));
  2506.       $booking->setCart(json_encode($resa));
  2507.       $booking->setStatus('new');
  2508.       $booking->setState(0);
  2509.       $booking->setAmount(floatval($amount['amount_adam']));
  2510.       $booking->setAmountShow(floatval($amount['amount_show']));
  2511.       $booking->setOptions($booking->getRecap(true));
  2512.       $booking->setLang($locale);
  2513.       $booking->setIsFlash(NULL);
  2514.       $em->persist($booking);
  2515.       $em->flush();
  2516.             
  2517.             $subject '['.$booking->getBaseId().'] Votre réservation Royal Palace';
  2518.         $title 'Votre réservation Royal Palace';
  2519.             $content '<p>Bonjour,</p>
  2520.                                       <p>Votre demande de réservation <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> à bien été prise en compte. Nos équipes vérifient la disponibilité des prestations souhaitées et reviendrons vers vous par email sous 24 heures (hors dimanches et jours fériés). Un lien de paiement vous sera envoyé par mail et sera également disponible dans votre espace <a href="'.$globals['app_email_domain'].'login">"Mon Compte"</a> de notre site web.</p>
  2521.                                       <p><br>A bientôt au <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  2522.           if($locale == 'de'){
  2523.             $subject '['.$booking->getBaseId().'] Ihre Buchung Royal Palace';
  2524.               $title 'Ihre Buchung Royal Palace';
  2525.             $content '<p>Hallo,</p>
  2526.                                       <p>Ihre Buchungsanfrage <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> wurde erfolgreich bearbeitet. Unsere Mitarbeiter überprüfen die Verfügbarkeit der gewünschten Leistungen und melden sich innerhalb von 24 Stunden (außer an Sonn- und Feiertagen) per E-Mail bei Ihnen zurück. Ein Zahlungslink wird Ihnen per E-Mail zugeschickt und ist auch in Ihrem Bereich <a href="'.$globals['app_email_domain'].'login">"Mein Konto"</a> auf unserer Website verfügbar.</p>
  2527.                                       <p><br>Bis bald im <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  2528.           }
  2529.           if($locale == 'en'){
  2530.             $subject '['.$booking->getBaseId().'] Your reservation at Royal Palace';
  2531.               $title 'Your reservation at Royal Palace';
  2532.             $content '<p>Hello,</p>
  2533.                                       <p>Your reservation request <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> has been processed. Our teams will check the availability of the services you require and get back to you by email within 24 hours (excluding Sundays and public holidays). A payment link will be sent to you by email and will also be available in your <a href="'.$globals['app_email_domain'].'login">"My Account"</a> area of our website.</p>
  2534.                                       <p><br>See you soon at <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  2535.           }
  2536.             //ENVOI EMAIL
  2537.             $from $globals['app_email_noreply'];
  2538.             $to $user->getEmail();
  2539.             $contact $globals['app_email_contact'];
  2540.             $email = (new Email())
  2541.                 ->from($from)
  2542.                 ->to($user->getEmail())
  2543.                 //->cc('cc@example.com')
  2544.                 //->bcc('bcc@example.com')
  2545.                 ->replyTo($contact)
  2546.                 //->priority(Email::PRIORITY_HIGH)
  2547.                 ->subject($subject)
  2548.                 // ->text(nl2br('Votre demande de réservation <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> à bien été prise en compte. Nos équipes vérifient la disponibilité des prestations souhaitées et reviendrons vers vous par email sous 24 heures (hors dimanches et jours fériés). Un lien de paiement vous sera envoyé par mail et sera également disponible dans votre espace "Mon Compte" de notre site web.').nl2br('A bientôt au Royal Palace'))
  2549.                 ->html($this->renderView(
  2550.                             'FrontBundle/Emails/general.html.twig', array(
  2551.                                     'title'   => $title,
  2552.                                     'content' => $content
  2553.                                 )
  2554.                          ));
  2555.             $mailer->send($email);
  2556.             //FIN ENVOI EMAIL
  2557.         // ENREGISTREMENT LOG MAIL
  2558.         $mail = New Mail();
  2559.         $mail->setBooking($booking);
  2560.         $mail->setEmailTitle($title);
  2561.         $mail->setEmailContent($content);
  2562.         $em->persist($mail);
  2563.         $em->flush();
  2564.         // FIN ENREGISTREMENT LOG MAIL
  2565.             // //DESACTIVé SUR DEMANDE DU CLIENT
  2566.             // //ENVOI EMAIL ADMIN ROYAL PALACE
  2567.             // $from = $globals['app_email_noreply'];
  2568.             // $to = $globals['app_email_address'];
  2569.             // $contact = $globals['app_email_contact'];
  2570.             // $email = (new Email())
  2571.             //     ->from($from)
  2572.             //     ->to($to)
  2573.             //     //->cc('cc@example.com')
  2574.             //     //->bcc('bcc@example.com')
  2575.             //     ->replyTo($contact)
  2576.             //     //->priority(Email::PRIORITY_HIGH)
  2577.             //     ->subject('Nouvelle demande de réservation Site Web')
  2578.             //     ->text(nl2br('Nouvelle demande de réservation Site Web'))
  2579.             //     ->html($this->renderView(
  2580.             //                 'FrontBundle/Emails/general.html.twig', array(
  2581.             //                         'title'   => 'Nouvelle demande de réservation Site Web #'.$booking->getBaseId(),
  2582.             //                         'content' => '<p>
  2583.             //                         <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong><br>
  2584.             //                         '.ucwords(strtolower(trim($infos['firstname']))).' '.strtoupper(trim($infos['lastname'])).'<br>
  2585.             //                         '.$infos['phone'].'<br>
  2586.             //                         '.$infos['email'].'<br>
  2587.             //                         '.trim($infos['address']).' '.trim($infos['zipcode']).' '.trim($infos['city']).' '.trim($infos['country']).'<br>
  2588.             //                         TOTAL : '.$booking->getAmountTotal().'€<br>
  2589.             //                         <a href="'.$globals['app_email_domain'].'backoffrp/resa/'.$booking->getId().'">VOIR LA RESERVATION</a>
  2590.             //                         </p>
  2591.             //                         '
  2592.             //                     )
  2593.             //              ));
  2594.             // $mailer->send($email);
  2595.             // //FIN ENVOI EMAIL ADMIN ROYAL PALACE
  2596.     }
  2597.     $data = [
  2598.       'error' => $error,
  2599.       'success' => $success,
  2600.     ];
  2601.     $response = new Response(json_encode($data));
  2602.     $response->headers->set('Content-Type''application/json');
  2603.     return $response;
  2604.   }
  2605.   /**
  2606.   * @Route("/{locale}/mon-compte/paiement/{token}", name="framework_front_reservation_payment", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  2607.   */
  2608.   public function reservationPaymentAction(Request $request$locale NULL$token NULL)
  2609.   {
  2610.       $blocked false;
  2611.     if($locale){
  2612.       $request->setLocale($locale);
  2613.     }
  2614.     $tr $this->loadTranslation($locale);
  2615.     require_once dirname(__FILE__).'/../../plugins/stripe-php-10.12.1/init.php';
  2616.     $em $this->getDoctrine()->getManager();
  2617.     $globals $this->get("twig")->getGlobals();
  2618.     $booking $em->getRepository('FrameworkAppBundle:Booking')->findOneBy(['token' => $token]);
  2619.     if(!$token || !$booking || $booking->getState() != 1){
  2620.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  2621.     }
  2622.     $start $booking->getVenue()->getStart()->getTimestamp();
  2623.     $future strtotime('+4 day');
  2624.     if( $future $start ){
  2625.       $manualPayment true;
  2626.     } else {
  2627.       $manualPayment false//PAS DE CHEQUE ET VIREMENT
  2628.     }
  2629.     if( strtotime("now") > $start || $booking->getVenue()->getDeleted() ){
  2630.         $blocked true;
  2631.     }
  2632.     // MISS ALSACE
  2633.     if($booking->getVenue()->getVenueType()->getSlug() == 'ma'){
  2634.       $manualPayment false//PAS DE CHEQUE ET VIREMENT
  2635.     }
  2636.     $block_tickets false;
  2637.     $orders $em->getRepository('FrameworkAppBundle:Booking')->findBy(['state' => 6'venue' => 1951], ['id' => 'DESC']);
  2638.     $orders_2 $em->getRepository('FrameworkAppBundle:Booking')->findBy(['state' => 2'venue' => 1951], ['id' => 'DESC']);
  2639.     $selled 0;
  2640.     $total 0;
  2641.     foreach ($orders as $key => $order) {
  2642.       // $selled = $selled + intval($order->getCart()->step1->participants);
  2643.       $total $total + ((intval($order->getAmount()) + intval($order->getAmountShow())) / 85);
  2644.     }
  2645.     foreach ($orders_2 as $key => $order) {
  2646.       // $selled = $selled + intval($order->getCart()->step1->participants);
  2647.       $total $total + ((intval($order->getAmount()) + intval($order->getAmountShow())) / 85);
  2648.     }
  2649.     if($booking->getVenue()->getVenueType()->getSlug() == 'ma'){
  2650.       if($total >= 1000){
  2651.         $block_tickets true;
  2652.       }
  2653.     }
  2654.     $tmp_cart json_decode($booking->getCartJson(), true);
  2655.     if(isset($tmp_cart['step1']['forceTickets'])){
  2656.       $block_tickets false;
  2657.     }
  2658.     // END MISS ALSACE
  2659.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'reservation-payment''locale' => $locale]);
  2660.     // dump($this->getUser()->getInfo('stripe_id'));exit;
  2661.     // dump($booking->getAmount());
  2662.     // dump($booking->getAmountShow());
  2663.     $amount intVal(($booking->getAmount() + $booking->getAmountShow()) * 100);
  2664.     $stripe = new \Stripe\StripeClient(
  2665.       $globals['stripe_secret_key']
  2666.     );
  2667.     $username ucwords(strtolower($booking->getInfo('firstname'))).' '.strtoupper($booking->getInfo('lastname'));
  2668.     $stripe_show_account_id $globals['stripe_show_account_id'];
  2669. if( intVal($booking->getAmountShow()) > ){
  2670.     $intent $stripe->paymentIntents->create([
  2671.       'customer' => $booking->getUser()->getInfo('stripe_id'),
  2672.       // 'setup_future_usage' => 'off_session',
  2673.       'amount' => $amount,
  2674.       'currency' => 'eur',
  2675.       'payment_method_types' => [
  2676.         'card',
  2677.         'klarna',
  2678.         'paypal',
  2679.       ],
  2680.       'metadata' => [
  2681.         'type' => 'reservation',
  2682.         'user_name' => $username,
  2683.         'user_email' => $booking->getUser()->getEmail(),
  2684.         'user_phone' => $booking->getInfo('phone'),
  2685.         'user_id' => $booking->getUser()->getId(),
  2686.         'booking_id' => $booking->getBaseId(),
  2687.         'booking_detail' => substr($booking->getOptions(), 0449),
  2688.         'booking_date' => $booking->getVenueTitle(),
  2689.         'amount' => intVal($booking->getAmount() * 100),
  2690.         'amount_show' => intVal($booking->getAmountShow() * 100),
  2691.         'amount_eur' => intVal($booking->getAmount()),
  2692.         'amount_show_eur' => intVal($booking->getAmountShow()),
  2693.         'amount_total_eur' => intVal($booking->getAmount()) + intVal($booking->getAmountShow()),
  2694.       ],
  2695.       'description' => $booking->getBaseId().' | '.$booking->getVenueTitle().' | '.$username,
  2696.       'transfer_group' => 'BOOKING_'.$booking->getBaseId(),
  2697.       'transfer_data' => [
  2698.         'destination' => $stripe_show_account_id,
  2699.         'amount' => intVal($booking->getAmountShow() * 100), //ROYAL SHOW PART
  2700.       ],
  2701.     ]);
  2702. } else {
  2703.     $intent $stripe->paymentIntents->create([
  2704.       'customer' => $booking->getUser()->getInfo('stripe_id'),
  2705.       // 'setup_future_usage' => 'off_session',
  2706.       'amount' => $amount,
  2707.       'currency' => 'eur',
  2708.       'payment_method_types' => [
  2709.         'card',
  2710.         'klarna',
  2711.         'paypal',
  2712.       ],
  2713.       'metadata' => [
  2714.         'type' => 'reservation',
  2715.         'user_name' => $username,
  2716.         'user_email' => $booking->getUser()->getEmail(),
  2717.         'user_phone' => $booking->getInfo('phone'),
  2718.         'user_id' => $booking->getUser()->getId(),
  2719.         'booking_id' => $booking->getBaseId(),
  2720.         'booking_detail' => substr($booking->getOptions(), 0449),
  2721.         'booking_date' => $booking->getVenueTitle(),
  2722.         'amount' => intVal($booking->getAmount() * 100),
  2723.         'amount_show' => intVal($booking->getAmountShow() * 100),
  2724.         'amount_eur' => intVal($booking->getAmount()),
  2725.         'amount_show_eur' => intVal($booking->getAmountShow()),
  2726.         'amount_total_eur' => intVal($booking->getAmount()) + intVal($booking->getAmountShow()),
  2727.       ],
  2728.       'description' => $booking->getBaseId().' | '.$booking->getVenueTitle().' | '.$username,
  2729.     ]);
  2730. }
  2731.     $client_secret $intent->client_secret;
  2732.     return $this->render('FrontBundle/Page/reservation-payment.html.twig', [
  2733.       'booking' => $booking,
  2734.       'client_secret' => $client_secret,
  2735.       'page' => $page,
  2736.       'manualPayment' => $manualPayment,
  2737.       'body' => '',
  2738.       'de_url' => 'mon-compte/paiement/'.$token,
  2739.       'en_url' => 'mon-compte/paiement/'.$token,
  2740.       'fr_url' => 'mon-compte/paiement/'.$token,
  2741.       'block_tickets' => $block_tickets,
  2742.       'total' => $total,
  2743.         'blocked' => $blocked
  2744.     ]);
  2745.   }
  2746.   /**
  2747.   * @Route("/{locale}/mon-compte/paiement/{token}/complete", name="framework_front_reservation_payment_complete", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  2748.   */
  2749.   public function reservationPaymentCompleteAction(Request $request$locale NULL$token NULLMailerInterface $mailer//PAIEMENT VALIDé PAR CARTE
  2750.   {
  2751.     if($locale){
  2752.       $request->setLocale($locale);
  2753.     }
  2754.     $tr $this->loadTranslation($locale);
  2755.     require_once dirname(__FILE__).'/../../plugins/stripe-php-10.12.1/init.php';
  2756.     $em $this->getDoctrine()->getManager();
  2757.     $globals $this->get("twig")->getGlobals();
  2758.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'reservation-payment''locale' => $locale]);
  2759.     $booking $em->getRepository('FrameworkAppBundle:Booking')->findOneBy(['token' => $token]);
  2760.     if(!$token || !$booking){
  2761.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  2762.     }
  2763.     $payment_intent $request->get('payment_intent');
  2764. // //A SUPPRIMER !!!!!!!!!!
  2765. // $payment_intent = "pi_3N8VA8D5gSqLmI0L1dWocqJv";
  2766. // $payment_intent = "pi_3NClgzD5gSqLmI0L0cDsgUf1";
  2767. // //A SUPPRIMER !!!!!!!!!!
  2768.     $stripe = new \Stripe\StripeClient(
  2769.       $globals['stripe_secret_key']
  2770.     );
  2771.     $intent $stripe->paymentIntents->retrieve(
  2772.       $payment_intent,
  2773.       []
  2774.     );
  2775.     $method $stripe->paymentMethods->retrieve(
  2776.       $intent->payment_method,
  2777.       []
  2778.     );
  2779.     $payment_type $method['type'];
  2780.     $booking->setStatus($intent->status);
  2781.     $em->persist($booking);
  2782.     $em->flush();
  2783.     if($intent->status == 'succeeded'){
  2784.       $booking->setState(2); //Réservation confirmée
  2785.       $booking->setPaymentType($payment_type);
  2786.       $booking->setResult(json_encode($intent));
  2787.       $em->persist($booking);
  2788.       $em->flush();
  2789. //       // TRANSFERT VERS ROYAL SHOW PROD
  2790. //       if( $booking->getTransfered() != 1 ){
  2791. //         echo 'trasfert';
  2792. //         $stripe_show_account_id = $globals['stripe_show_account_id'];
  2793. //         $transfert = $stripe->transfers->create([
  2794. //           'amount' => intVal($booking->getAmountShow() * 100),
  2795. //           'currency' => 'eur',
  2796. //           'destination' => $stripe_show_account_id,
  2797. //           // 'source_transaction' => '',
  2798. //           'transfer_group' => 'BOOKING_'.$booking->getId(),
  2799. //           'metadata' => [
  2800. //             'user_id' => $booking->getUser()->getId(),
  2801. //             'booking_id' => $booking->getId(),
  2802. //             'amount' => intVal($booking->getAmount() * 100),
  2803. //             'amount_show' => intVal($booking->getAmountShow() * 100),
  2804. //           ],
  2805. //           'description' => $booking->getOptions(),
  2806. //         ]);
  2807. // dump($transfert);
  2808. //         exit;
  2809. //       }
  2810.       //ENVOI EMAIL
  2811.       if( $booking->getMailed() != ){
  2812. $start $booking->getVenue()->getStart()->getTimestamp();
  2813. $future strtotime('+8 day');
  2814. //FIX LOUNGECLUB HORAIRE
  2815. $moment '2h30';
  2816. if( $booking->getVenue()->getStart()->format('H') < 16 ){
  2817.   $moment '18h00';
  2818. }
  2819. $subject '['.$booking->getBaseId().'] Votre réservation au Royal Palace est confirmée !';
  2820. $title 'Votre réservation au Royal Palace est confirmée !';
  2821. $content_lounge 'Après le spectacle, animations au Lounge Club jusqu\'à '.$moment.'<br>
  2822. L\'accès y est gratuit, seules les consommations sont payantes.<br><br>';
  2823. if( $future $start ){
  2824.   $content_tikets 'La confirmation avec les billets vous parviendront par voie postale sous quelques jours.<br><br>';
  2825. } else {
  2826.   $content_tikets 'Les billets de spectacle sont à retirer à votre arrivée, au comptoir de l\'accueil.<br>(ces billets ne sont ni repris, ni échangés)<br><br>';
  2827. }
  2828. if( $booking->getIsflash() ){
  2829.   $content_tikets 'Les billets de spectacle sont à retirer à votre arrivée, au comptoir de l\'accueil.<br>(ces billets ne sont ni repris, ni échangés)<br><br>';
  2830.   $content_lounge '';
  2831. }
  2832. if( in_array$booking->getVenue()->getVenueType()->getSlug(), ['rl''no']) ){
  2833.   $content_tikets '<p>Merci ! Votre réservation <strong>'.$booking->getVenueTitle().'</strong> sera confirmée à la réception de votre paiement.<br><br><strong>Les billets de spectacle vous seront envoyés par voie postale sous quinze jours.</strong><br><br>';
  2834. }
  2835. if( $booking->getVenue()->getVenueType()->getSlug() != 'main' ){
  2836.   $content_lounge '';
  2837. }
  2838. $content '<p style="line-height:initial;">Chers clients,<br><br>
  2839. Nous vous remercions pour votre règlement qui valide votre réservation pour :<br>
  2840. '.$booking->getVenueTitle().'<br><br>
  2841. (Il est conseillé à notre aimable clientèle de se présenter environ 20 minutes avant)<br>
  2842. Un grand parking gratuit se trouve juste à côté.<br><br>
  2843. '.$content_lounge.'
  2844. '.$content_tikets.'
  2845. <i>Attention à l\'orthographe de KIRRWILLER lorsque vous programmez votre GPS (il existe un autre KIRVILLER dans le département du 57)<br>
  2846. Depuis Strasbourg A4 sortie 46 Hochfelden direction Bouxwiller<br>
  2847. Depuis Paris A4 sortie 45 Saverne direction Hochfelden</i><br><br>
  2848. Pour préparer au mieux votre venue au Royal Palace, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">cliquez ici</a> pour télécharger la fiche <strong>"Déroulement d\'un évènement".</strong><br><br>
  2849. Au plaisir de vous accueillir,<br>
  2850. Recevez, nos cordiales salutations,<br>
  2851. <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a>
  2852. </p>';
  2853. if($locale == 'de'){
  2854.     //FIX LOUNGECLUB HORAIRE
  2855.     $moment '2.30';
  2856.     if( $booking->getVenue()->getStart()->format('H') < 16 ){
  2857.         $moment '18.00';
  2858.     }
  2859.   $subject '['.$booking->getBaseId().'] Ihre Buchung im Royal Palace ist bestätigt!';
  2860.     $title 'Ihre Buchung im Royal Palace ist bestätigt!';
  2861.   
  2862.   $content_lounge 'Nach der Show gibt es bis '.$moment.' Uhr Unterhaltung im Lounge Club.<br>
  2863.   Der Eintritt ist frei, nur die Getränke sind kostenpflichtig.<br><br>';
  2864.   if( $future $start ){
  2865.     $content_tikets 'Die Bestätigung mit den Tickets wird Ihnen innerhalb weniger Tage per Post zugestellt.<br><br>';
  2866.   } else {
  2867.     $content_tikets 'Die Eintrittskarten sind bei Ihrer Ankunft am Empfangstresen abzuholen.<br>(Diese Karten werden weder zurückgenommen noch umgetauscht)<br><br>';
  2868.   }
  2869.   if( $booking->getIsflash() ){
  2870.     $content_tikets 'Die Eintrittskarten sind bei Ihrer Ankunft am Empfangstresen abzuholen.<br>(Diese Karten werden weder zurückgenommen noch umgetauscht)<br><br>';
  2871.     $content_lounge '';
  2872.   }
  2873.     if( in_array$booking->getVenue()->getVenueType()->getSlug(), ['rl''no']) ){
  2874.         $content_tikets '<p>Vielen Dank! Ihre Buchung <strong>'.$booking->getVenueTitle().'</strong> wird bestätigt, sobald Ihre Zahlung eingegangen ist.<br><br><strong>Die Eintrittskarten für die Aufführung werden Ihnen innerhalb von zwei Wochen per Post zugesandt.</strong><br><br>';
  2875.     }
  2876.   if( $booking->getVenue()->getVenueType()->getSlug() != 'main' ){
  2877.     $content_lounge '';
  2878.   }
  2879.   $content '<p style="line-height:initial;">Liebe Gäste,<br><br>
  2880.    Wir danken Ihnen für Ihre Zahlung, die Ihre Buchung für :<br>
  2881.   '.$booking->getVenueTitle().'<br><br>
  2882.   (Unserer freundlichen Kundschaft wird empfohlen, sich etwa 20 Minuten vorher einzufinden)<br>
  2883.   Ein großer kostenloser Parkplatz befindet sich direkt nebenan.<br><br>
  2884.   '.$content_lounge.'
  2885.   '.$content_tikets.'
  2886.   <i>Achten Sie auf die Schreibweise von KIRRWILLER, wenn Sie Ihr GPS programmieren (es gibt noch ein weiteres KIRVILLER im Département 57)<br>
  2887.   Aus Straßburg A4 Ausfahrt 46 Hochfelden Richtung Bouxwiller<br>
  2888.   Von Paris A4 Ausfahrt 45 Saverne Richtung Hochfelden</i><br><br>
  2889.   Um Ihren Besuch im Royal Palace optimal vorzubereiten, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">klicken Sie hier</a>, um das Arbeitsblatt <strong>"Ablauf einer Veranstaltung"</strong> herunterzuladen.<br><br>
  2890.   Wir freuen uns, Sie begrüßen zu dürfen,<br>
  2891.   Herzliche Grüße,<br>
  2892.   <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a>
  2893.   </p>';
  2894. }
  2895. if($locale == 'en'){
  2896.     //FIX LOUNGECLUB HORAIRE
  2897.     $moment '2:30 am';
  2898.     if( $booking->getVenue()->getStart()->format('H') < 16 ){
  2899.         $moment '06:00 pm';
  2900.     }
  2901.   $subject '['.$booking->getBaseId().'] Your reservation at the Royal Palace is confirmed!';
  2902.     $title 'Your reservation at the Royal Palace is confirmed!';
  2903.   $content_lounge 'After the show, entertainment in the Lounge Club until '.$moment.'.<br>
  2904.   Access is free, with a charge for drinks only.<br><br>';
  2905.   if( $future $start ){
  2906.     $content_tikets 'Confirmation and tickets will be sent to you by post within a few days.<br><br>';
  2907.   } else {
  2908.     $content_tikets 'Tickets can be picked up on arrival at the reception desk.<br>(no refunds or exchanges)<br><br>';
  2909.   }
  2910.   if( $booking->getIsflash() ){
  2911.     $content_tikets 'Tickets can be picked up on arrival at the reception desk.<br>(no refunds or exchanges)<br><br>';
  2912.     $content_lounge '';
  2913.   }
  2914.     if( in_array$booking->getVenue()->getVenueType()->getSlug(), ['rl''no']) ){
  2915.         $content_tikets '<p>Thank you! Your reservation <strong>'.$booking->getVenueTitle().'</strong> will be confirmed upon receipt of your payment.<br><br><strong>Tickets will be sent to you by post within two weeks.</strong><br><br>';
  2916.     }
  2917.   if( $booking->getVenue()->getVenueType()->getSlug() != 'main' ){
  2918.     $content_lounge '';
  2919.   }
  2920.   $content '<p style="line-height:initial;">Dear customers,<br><br>
  2921.   Thank you for your payment which validates your reservation for :<br>
  2922.   '.$booking->getVenueTitle().'<br><br>
  2923.     (Our customers are advised to arrive about 20 minutes beforehand)<br>
  2924.   There\'s a large free parking lot right next door.<br><br>
  2925.   '.$content_lounge.'
  2926.   '.$content_tikets.'
  2927.   <i>Pay attention to the spelling of KIRRWILLER when programming your GPS (there is another KIRVILLER in the 57 department).<br>
  2928.     From Strasbourg A4 exit 46 Hochfelden direction Bouxwiller<br>
  2929.   From Paris A4 exit 45 Saverne direction Hochfelden</i><br><br>
  2930.   To help you prepare for your visit to the Royal Palace, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">click here</a> to download the <strong>"How an event unfolds"</strong> sheet.<br><br>
  2931.   Looking forward to welcoming you,<br>
  2932.   Yours sincerely,<br>
  2933.   <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a>
  2934.   </p>';
  2935. }
  2936. // MAIL MISS ALSACE
  2937. if($booking->getVenue()->getVenueType()->getSlug() == 'ma'){
  2938.   $subject '['.$booking->getBaseId().'] Votre réservation au Royal Palace est confirmée !';
  2939.     $title 'Votre réservation au Royal Palace est confirmée !';
  2940.   $content_tikets 'La confirmation avec les billets vous parviendront par voie postale sous quelques jours.<br><br>';
  2941.   $content '<p style="line-height:initial;">Chers clients,<br><br>
  2942.   Nous vous remercions pour votre règlement qui valide votre réservation pour :<br>
  2943.   Election '.$booking->getVenueTitle().'<br><br>
  2944.   Ouverture des portes à 17h15h.<br><br>
  2945.   
  2946.   En présence d\'Angélique Angarni-Filipon France 2025, d\'Isabella Hebert Miss Alsace 2024 ainsi que de nombreuses Miss Alsace.
  2947. L\'ambassadrice élue sera notre représentante lors de l\'élection de Miss France 2026 en décembre prochain !
  2948. 12 candidates se produiront sur scène lors d\'un show incroyable pour tenter de décrocher la couronne et devenir notre ambassadrice de l\'Alsace.
  2949. <br><br>
  2950.   (Il est conseillé à notre aimable clientèle de se présenter environ 20 minutes avant)<br>
  2951.   Un grand parking gratuit se trouve juste à côté. Tenue de soirée obligatoire. <br><br>
  2952.   '.$content_tikets.'
  2953.   <i>Attention à l\'orthographe de KIRRWILLER lorsque vous programmez votre GPS (il existe un autre KIRVILLER dans le département du 57)<br>
  2954.   Depuis Strasbourg A4 sortie 46 Hochfelden direction Bouxwiller<br>
  2955.   Depuis Paris A4 sortie 45 Saverne direction Hochfelden</i><br><br>
  2956.   Au plaisir de vous accueillir,<br>
  2957.   Recevez, nos cordiales salutations,<br>
  2958.   <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a>
  2959.   </p>';
  2960.   if($locale == 'de'){
  2961.     $subject '['.$booking->getBaseId().'] Ihre Buchung im Royal Palace ist bestätigt!';
  2962.     $title 'Ihre Buchung im Royal Palace ist bestätigt!';
  2963.     $content_tikets 'Die Bestätigung mit den Tickets wird Ihnen innerhalb weniger Tage per Post zugestellt.<br><br>';
  2964.     $content '<p style="line-height:initial;">Liebe Gäste,<br><br>
  2965.      Wir danken Ihnen für Ihre Zahlung, die Ihre Buchung für :<br>
  2966.      Wahl zur '.$booking->getVenueTitle().'<br><br>
  2967.     Öffnung der Türen um 17.45 Uhr.<br><br>
  2968.     
  2969.     In Anwesenheit von Angélique Angarni-Filipon, Miss France 2025, Isabella Hebert, Miss Alsace 2024 sowie zahlreicher ehemaliger Miss Alsace.<br>
  2970. Die gewählte Botschafterin wird uns bei der Wahl zur Miss France 2026 im kommenden Dezember vertreten!<br>
  2971. Zwölf Kandidatinnen treten in einer unglaublichen Show auf die Bühne, um die Krone zu erringen und Botschafterin des Elsass zu werden.<br><br>
  2972.     (Unserer freundlichen Kundschaft wird empfohlen, sich etwa 20 Minuten vorher einzufinden)<br>
  2973.     Ein großer kostenloser Parkplatz befindet sich direkt nebenan. Abendgarderobe erforderlich.<br><br>
  2974.     '.$content_tikets.'
  2975.     <i>Achten Sie auf die Schreibweise von KIRRWILLER, wenn Sie Ihr GPS programmieren (es gibt noch ein weiteres KIRVILLER im Département 57)<br>
  2976.     Aus Straßburg A4 Ausfahrt 46 Hochfelden Richtung Bouxwiller<br>
  2977.     Von Paris A4 Ausfahrt 45 Saverne Richtung Hochfelden</i><br><br>
  2978.     Wir freuen uns, Sie begrüßen zu dürfen,<br>
  2979.     Herzliche Grüße,<br>
  2980.     <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a>
  2981.     </p>';
  2982.   }
  2983.   if($locale == 'en'){
  2984.     $subject '['.$booking->getBaseId().'] Your reservation at the Royal Palace is confirmed!';
  2985.     $title 'Your reservation at the Royal Palace is confirmed!';
  2986.     $content_tikets 'Confirmation and tickets will be sent to you by post within a few days.<br><br>';
  2987.     $content '<p style="line-height:initial;">Dear customers,<br><br>
  2988.     Thank you for your payment which validates your reservation for :<br>
  2989.     '.$booking->getVenueTitle().' election<br><br>
  2990.     Doors open at 7.45pm.<br><br>
  2991.     
  2992.     In the presence of Angélique Angarni-Filipon, Miss France 2025, Isabella Hebert, Miss Alsace 2024, as well as many former Miss Alsace winners.<br>
  2993. The elected ambassador will represent us at the Miss France 2026 election next December!<br>
  2994. Twelve candidates will perform on stage in an incredible show, competing for the crown and the title of Alsace ambassador.<br><br>
  2995.       (Our customers are advised to arrive about 20 minutes beforehand)<br>
  2996.     There\'s a large free parking lot right next door. Evening attire required.<br><br>
  2997.     '.$content_tikets.'
  2998.     <i>Pay attention to the spelling of KIRRWILLER when programming your GPS (there is another KIRVILLER in the 57 department).<br>
  2999.       From Strasbourg A4 exit 46 Hochfelden direction Bouxwiller<br>
  3000.     From Paris A4 exit 45 Saverne direction Hochfelden</i><br><br>
  3001.     Looking forward to welcoming you,<br>
  3002.     Yours sincerely,<br>
  3003.     <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a>
  3004.     </p>';
  3005.   }
  3006. }
  3007. // FIN MAIL MISS ALSACE
  3008.             //ENVOI EMAIL
  3009.             $from $globals['app_email_noreply'];
  3010.             $to $booking->getUser()->getEmail();
  3011.             $contact $globals['app_email_contact'];
  3012.             $email = (new Email())
  3013.                 ->from($from)
  3014.                 ->to($to)
  3015.                 //->cc('cc@example.com')
  3016.                 //->bcc('bcc@example.com')
  3017.                 ->replyTo($contact)
  3018.                 //->priority(Email::PRIORITY_HIGH)
  3019.                 ->subject($subject)
  3020.                 ->html($this->renderView(
  3021.                             'FrontBundle/Emails/general.html.twig', array(
  3022.                                     'title'   => $title,
  3023.                                     'content' => $content
  3024.                                 )
  3025.                          ));
  3026.             $mailer->send($email);
  3027.             //FIN ENVOI EMAIL
  3028.           // ENREGISTREMENT LOG MAIL
  3029.           $mail = New Mail();
  3030.           $mail->setBooking($booking);
  3031.           $mail->setEmailTitle($title);
  3032.           $mail->setEmailContent($content);
  3033.           $em->persist($mail);
  3034.           $em->flush();
  3035.           // FIN ENREGISTREMENT LOG MAIL
  3036.         $booking->setMailed(1);
  3037.         $em->persist($booking);
  3038.         $em->flush();
  3039.       }
  3040.     } else {
  3041.       $booking->setState(3); //Erreur de paiement
  3042.       $booking->setResult(json_encode($intent));
  3043.       $em->persist($booking);
  3044.       $em->flush();
  3045.     }
  3046.     return $this->render('FrontBundle/Page/reservation-payment-complete.html.twig', [
  3047.       'booking' => $booking,
  3048.       'status' => $intent->status,
  3049.       'page' => $page,
  3050.       'body' => '',
  3051.     ]);
  3052.   }
  3053.   /**
  3054.   * @Route("/{locale}/mon-compte/paiement/{token}/manual", name="framework_front_reservation_payment_manual", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  3055.   */
  3056.   public function reservationPaymentManualAction(Request $request$locale NULL$token NULLMailerInterface $mailer)
  3057.   {
  3058.     $success true;
  3059.     $error '';
  3060.     $em $this->getDoctrine()->getManager();
  3061.     $globals $this->get("twig")->getGlobals();
  3062.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'reservation-payment''locale' => $locale]);
  3063.     $booking $em->getRepository('FrameworkAppBundle:Booking')->findOneBy(['token' => $token]);
  3064.     if(!$token || !$booking || $booking->getState() != 1){
  3065.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  3066.     }
  3067.       $booking->setStatus('manual');
  3068.       $booking->setState(5); //Validée : En attente de règlement
  3069.       $booking->setPaymentType($request->get('payment_type'));
  3070.       $em->persist($booking);
  3071.       $em->flush();
  3072.       //ENVOI EMAIL
  3073.       if( $booking->getMailed() != ){
  3074.             $subject '['.$booking->getBaseId().'] Votre réservation au Royal Palace';
  3075.             $title 'Votre réservation au Royal Palace sera confirmée à la réception de votre paiement.';
  3076.             $content '<p>Merci ! Votre réservation <strong>'.$booking->getVenueTitle().'</strong> sera confirmée à la réception de votre paiement.<br><br>';
  3077. if( $booking->getIsflash() ){
  3078.   $content .= '<strong>Les billets de spectacle sont à retirer à votre arrivée, au comptoir de l\'accueil.<br>(ces billets ne sont ni repris, ni échangés)</strong><br><br>';
  3079. }
  3080. if( $booking->getVenue()->getVenueType()->getSlug() != 'main' ){
  3081.   $content_lounge '';
  3082. }
  3083. if( in_array$booking->getVenue()->getVenueType()->getSlug(), ['rl''no']) ){
  3084.     $content '<p>Merci ! Votre réservation <strong>'.$booking->getVenueTitle().'</strong> sera confirmée à la réception de votre paiement.<br><br><strong>Les billets de spectacle vous seront envoyés par voie postale sous quinze jours.</strong><br><br>';
  3085. }
  3086. $content .= 'TOTAL : <strong>'.$booking->getAmountTotal().'€</strong><br>
  3087. Précisez le numéro de commande suivant lors de votre paiement : <strong>#'.$booking->getBaseId().'</strong><br><br>
  3088. - Soit par chèques à l\'adresse suivante :<br>
  3089. <strong>ROYAL PALACE - 20 RUE DE HOCHFELDEN - 67330 KIRRWILLER </strong><br>';
  3090. if($booking->getAmount() > 0){
  3091. $content .= '1 chèque à l\'ordre d\'<strong>ADAM MEYER SAS</strong> d\'un montant de <strong>'.$booking->getAmount().'€</strong><br>';
  3092. }
  3093. if($booking->getAmountShow() > 0){
  3094. $content .= '1 chèque à l\'ordre de <strong>ROYAL SHOW PRODUCTIONS SAS</strong> d\'un montant de <strong>'.$booking->getAmountShow().'€</strong><br>';
  3095. }
  3096. $content .= '<br>
  3097. - Soit par virements bancaires (CCM DE BOUXWILLER) :<br>';
  3098. if($booking->getAmount() > 0){
  3099. $content .= '1 virement d\'un montant de <strong>'.$booking->getAmount().'€</strong> (ADAM MEYER SAS)<br>
  3100. <strong>IBAN : FR76 10278 01670 00013429645 56 - BIC CMCIFR2A</strong><br>';
  3101. }
  3102. if($booking->getAmountShow() > 0){
  3103. $content .= '1 virement d\'un montant de <strong>'.$booking->getAmountShow().'€</strong> (ROYAL SHOW PRODUCTIONS SAS)<br>';
  3104. }
  3105. $content .= '<strong>IBAN : FR76 10278 01670 00014697745 96 - BIC CMCIFR2A</strong><br>
  3106. <br>
  3107. Pour préparer au mieux votre venue au Royal Palace, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">cliquez ici</a> pour télécharger la fiche <strong>"Déroulement d\'un évènement".</strong></p><br>
  3108. Le récapitulatif est disponnible dans votre espace <a href="'.$globals['app_email_domain'].'login">"Mon Compte"</a> de notre site web.<br>
  3109. <p>A bientôt au <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>
  3110. ';
  3111. if($locale == 'de'){
  3112.             $subject '['.$booking->getBaseId().'] Ihre Buchung im Royal Palace';
  3113.             $title 'Ihre Buchung im Royal Palace wird bestätigt, sobald Ihre Zahlung eingegangen ist.';
  3114.             $content '<p>Vielen Dank! Ihre Buchung <strong>'.$booking->getVenueTitle().'</strong> wird bestätigt, sobald Ihre Zahlung eingegangen ist.<br><br>';
  3115. if( $booking->getIsflash() ){
  3116.   $content .= '<strong>Die Eintrittskarten sind bei Ihrer Ankunft am Empfangstresen abzuholen.<br>(Diese Karten werden weder zurückgenommen noch umgetauscht)</strong><br><br>';
  3117. }
  3118. if( $booking->getVenue()->getVenueType()->getSlug() != 'main' ){
  3119.   $content_lounge '';
  3120. }
  3121.     if( in_array$booking->getVenue()->getVenueType()->getSlug(), ['rl''no']) ){
  3122.         $content '<p>Vielen Dank! Ihre Buchung <strong>'.$booking->getVenueTitle().'</strong> wird bestätigt, sobald Ihre Zahlung eingegangen ist.<br><br><strong>Die Eintrittskarten für die Aufführung werden Ihnen innerhalb von zwei Wochen per Post zugesandt.</strong><br><br>';
  3123.     }
  3124. $content .= 'TOTAL : <strong>'.$booking->getAmountTotal().'€</strong><br>
  3125. Geben Sie bei der Zahlung die folgende Bestellnummer an : <strong>#'.$booking->getBaseId().'</strong><br><br>
  3126. - Oder per Scheck an die folgende Adresse :<br>
  3127. <strong>ROYAL PALACE - 20 RUE DE HOCHFELDEN - 67330 KIRRWILLER </strong><br>';
  3128. if($booking->getAmount() > 0){
  3129. $content .= '1 Scheck ausgestellt auf <strong>ADAM MEYER SAS</strong> n Höhe von <strong>'.$booking->getAmount().'€</strong><br>';
  3130. }
  3131. if($booking->getAmountShow() > 0){
  3132. $content .= '1 Scheck ausgestellt auf <strong>ROYAL SHOW PRODUCTIONS SAS</strong> n Höhe von <strong>'.$booking->getAmountShow().'€</strong><br>';
  3133. }
  3134. $content .= '<br>
  3135. - Entweder per Banküberweisung (CCM DE BOUXWILLER) :<br>';
  3136. if($booking->getAmount() > 0){
  3137. $content .= '1 Überweisung in Höhe von <strong>'.$booking->getAmount().'€</strong> (ADAM MEYER SAS)<br>
  3138. <strong>IBAN : FR76 10278 01670 00013429645 56 - BIC CMCIFR2A</strong><br>';
  3139. }
  3140. if($booking->getAmountShow() > 0){
  3141. $content .= '1 Überweisung in Höhe von <strong>'.$booking->getAmountShow().'€</strong> (ROYAL SHOW PRODUCTIONS SAS)<br>';
  3142. }
  3143. $content .= '<strong>IBAN : FR76 10278 01670 00014697745 96 - BIC CMCIFR2A</strong><br>
  3144. <br>
  3145. Um Ihren Besuch im Royal Palace optimal vorzubereiten, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">klicken Sie hier</a> um das Merkblatt herunterzuladen <strong>"Ablauf einer Veranstaltung".</strong></p><br>
  3146.   Die Zusammenfassung ist in Ihrem Bereich <a href="'.$globals['app_email_domain'].'login">"Mein Konto"</a> auf unserer Website verfügbar.<br>
  3147.   <p>Bis bald im <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>
  3148. ';
  3149. }
  3150. if($locale == 'en'){
  3151.   
  3152.             $subject '['.$booking->getBaseId().'] Your reservation at the Royal Palace';
  3153.             $title 'Your reservation at the Royal Palace will be confirmed upon receipt of your payment.';
  3154.             $content '<p>Thank you! Your reservation <strong>'.$booking->getVenueTitle().'</strong> will be confirmed upon receipt of your payment.<br><br>';
  3155. if( $booking->getIsflash() ){
  3156.   $content .= '<strong>Tickets can be picked up on arrival at the reception desk.<br>(no refunds or exchanges)</strong><br><br>';
  3157. }
  3158. if( $booking->getVenue()->getVenueType()->getSlug() != 'main' ){
  3159.   $content_lounge '';
  3160. }
  3161.     if( in_array$booking->getVenue()->getVenueType()->getSlug(), ['rl''no']) ){
  3162.         $content '<p>Thank you! Your reservation <strong>'.$booking->getVenueTitle().'</strong> will be confirmed upon receipt of your payment.<br><br><strong>Tickets will be sent to you by post within two weeks.</strong><br><br>';
  3163.     }
  3164. $content .= 'TOTAL : <strong>'.$booking->getAmountTotal().'€</strong><br>
  3165. Please quote the following order number when making your payment: <strong>#'.$booking->getBaseId().'</strong><br><br>
  3166. - By cheque to the following address:<br>
  3167. <strong>ROYAL PALACE - 20 RUE DE HOCHFELDEN - 67330 KIRRWILLER </strong><br>';
  3168. if($booking->getAmount() > 0){
  3169. $content .= '1 cheque payable to <strong>ADAM MEYER SAS</strong> for <strong>'.$booking->getAmount().'€</strong><br>';
  3170. }
  3171. if($booking->getAmountShow() > 0){
  3172. $content .= '1 cheque payable to <strong>ROYAL SHOW PRODUCTIONS SAS</strong> for <strong>'.$booking->getAmountShow().'€</strong><br>';
  3173. }
  3174. $content .= '<br>
  3175. - Or by bank transfer (CCM DE BOUXWILLER) :<br>';
  3176. if($booking->getAmount() > 0){
  3177. $content .= '1 transfer of <strong>'.$booking->getAmount().'€</strong> (ADAM MEYER SAS)<br>
  3178. <strong>IBAN : FR76 10278 01670 00013429645 56 - BIC CMCIFR2A</strong><br>';
  3179. }
  3180. if($booking->getAmountShow() > 0){
  3181. $content .= '1 transfer of <strong>'.$booking->getAmountShow().'€</strong> (ROYAL SHOW PRODUCTIONS SAS)<br>';
  3182. }
  3183. $content .= '<strong>IBAN : FR76 10278 01670 00014697745 96 - BIC CMCIFR2A</strong><br>
  3184. <br>
  3185. To help you prepare for your visit to the Royal Palace <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">click here</a> to download the "How an event unfolds" sheet.</strong></p><br>
  3186. The summary is available in your <a href="'.$globals['app_email_domain'].'login">"My Account"</a> area of our website.<br>
  3187. <p>See you soon at <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>
  3188. ';
  3189. }
  3190.             //ENVOI EMAIL
  3191.             $from $globals['app_email_noreply'];
  3192.             $to $booking->getUser()->getEmail();
  3193.             $contact $globals['app_email_contact'];
  3194.             $email = (new Email())
  3195.                 ->from($from)
  3196.                 ->to($to)
  3197.                 //->cc('cc@example.com')
  3198.                 //->bcc('bcc@example.com')
  3199.                 ->replyTo($contact)
  3200.                 //->priority(Email::PRIORITY_HIGH)
  3201.                 ->subject($subject)
  3202.                 ->html($this->renderView(
  3203.                             'FrontBundle/Emails/general.html.twig', array(
  3204.                                     'title'   => $title,
  3205.                                     'content' => $content
  3206.                                 )
  3207.                          ));
  3208.             $mailer->send($email);
  3209.             //FIN ENVOI EMAIL
  3210.           // ENREGISTREMENT LOG MAIL
  3211.           $mail = New Mail();
  3212.           $mail->setBooking($booking);
  3213.           $mail->setEmailTitle($title);
  3214.           $mail->setEmailContent($content);
  3215.           $em->persist($mail);
  3216.           $em->flush();
  3217.           // FIN ENREGISTREMENT LOG MAIL
  3218.             // //DESACTIVé SUR DEMANDE DU CLIENT
  3219.             // //ENVOI EMAIL ADMIN ROYAL PALACE
  3220.             // $from = $globals['app_email_noreply'];
  3221.             // $to = $globals['app_email_address'];
  3222.             // $contact = $globals['app_email_contact'];
  3223.             // $email = (new Email())
  3224.             //     ->from($from)
  3225.             //     ->to($to)
  3226.             //     //->cc('cc@example.com')
  3227.             //     //->bcc('bcc@example.com')
  3228.             //     ->replyTo($contact)
  3229.             //     //->priority(Email::PRIORITY_HIGH)
  3230.             //     ->subject('Nouvelle demande de réservation Site Web')
  3231.             //     ->text(nl2br('Nouvelle demande de réservation Site Web'))
  3232.             //     ->html($this->renderView(
  3233.             //                 'FrontBundle/Emails/general.html.twig', array(
  3234.             //                         'title'   => 'Nouvelle demande de réservation Site Web #'.$booking->getBaseId(),
  3235.             //                         'content' => '<p>
  3236.             //                         <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong><br>
  3237.             //                         '.ucwords(strtolower(trim($infos['firstname']))).' '.strtoupper(trim($infos['lastname'])).'<br>
  3238.             //                         '.$infos['phone'].'<br>
  3239.             //                         '.$infos['email'].'<br>
  3240.             //                         '.trim($infos['address']).' '.trim($infos['zipcode']).' '.trim($infos['city']).' '.trim($infos['country']).'<br>
  3241.             //                         TOTAL : '.$booking->getAmountTotal().'€<br>
  3242.             //                         Type de paiement : '.$booking->getPaymentTypeTr('fr').'<br><br>
  3243.             //                         <a href="'.$globals['app_email_domain'].'backoffrp/resa/'.$booking->getId().'">VOIR LA RESERVATION</a>
  3244.             //                         </p>
  3245.             //                         '
  3246.             //                     )
  3247.             //              ));
  3248.             // $mailer->send($email);
  3249.             // //FIN ENVOI EMAIL ADMIN ROYAL PALACE
  3250.         $booking->setMailed(1);
  3251.         $em->persist($booking);
  3252.         $em->flush();
  3253.       }
  3254.     $data = [
  3255.       'error' => $error,
  3256.       'success' => $success,
  3257.     ];
  3258.     $response = new Response(json_encode($data));
  3259.     $response->headers->set('Content-Type''application/json');
  3260.     return $response;
  3261.   }
  3262.   /**
  3263.   * @Route("/{locale}/mon-compte/paiement/manual/confirm/{token}", name="framework_front_reservation_payment_manual_confirm", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  3264.   */
  3265.   public function reservationPaymentManualConfirmAction(Request $request$locale NULL$token NULL)
  3266.   {
  3267.     if($locale){
  3268.       $request->setLocale($locale);
  3269.     }
  3270.     $em $this->getDoctrine()->getManager();
  3271.     $globals $this->get("twig")->getGlobals();
  3272.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'cart-payment''locale' => $locale]);
  3273.     $booking $em->getRepository('FrameworkAppBundle:Booking')->findOneBy(['token' => $token]);
  3274.     if(!$token || !$booking){
  3275.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  3276.     }
  3277.     return $this->render('FrontBundle/Page/reservation-payment-manual-confirm.html.twig', [
  3278.       'baseId' => $booking->getBaseId(),
  3279.       'booking' => $booking,
  3280.       'page' => $page,
  3281.       'body' => '',
  3282.     ]);
  3283.   }
  3284. /* BOUTIQUE */
  3285.   /**
  3286.   * @Route("/{locale}/boutique/articles", name="framework_front_shop_all", requirements={"locale" = "([a-z\-0-9]+)"})
  3287.   * @Route("/{locale}/shop/articles", name="framework_front_shop_all_de", requirements={"locale" = "([a-z\-0-9]+)"})
  3288.   * @Route("/{locale}/boutique/articles/{category_slug}", name="framework_front_shop_cat", requirements={"category_slug" = "([a-z\-0-9]+)"})
  3289.   * @Route("/{locale}/shop/articles/{category_slug}", name="framework_front_shop_cat_de", requirements={"category_slug" = "([a-z\-0-9]+)"})
  3290.   */
  3291.   public function shopAction(Request $request$locale NULL$category_slug NULL)
  3292.   {
  3293.     // $request->setLocale($locale);
  3294.     // $em = $this->getDoctrine()->getManager();
  3295.     // $globals = $this->get("twig")->getGlobals();
  3296.     // $locales = explode('|', $globals["app_locales"]);
  3297.     // $categoryName = 'Bons cadeaux';
  3298.     // $filter = 'all';
  3299.     // if( $request->get('f') != null ){
  3300.     //   $filter = $request->get('f');
  3301.     // }
  3302.     // $page = $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'boutique-articles', 'locale' => $locale]);
  3303.     // $categories = $em->getRepository('FrameworkShopBundle:Category')->findBy([], ['position' => 'ASC']);
  3304.     // $category = $em->getRepository('FrameworkShopBundle:Category')->findOneBy(['slug' => $category_slug]);
  3305.     // if( $category_slug ){
  3306.     //   $categoryTmp = $em->getRepository('FrameworkAppBundle:Category')->findOneBy(['slug' => $category_slug]);
  3307.     //   if( $categoryTmp ){
  3308.     //     $categoryName = $categoryTmp->getTitle();
  3309.     //   }
  3310.     // }
  3311.     // $bons = $em->getRepository('FrameworkShopBundle:Product')->findBy(['category' => 5], ['position' => 'ASC']);
  3312.     // $bookmarks = $em->getRepository('FrameworkShopBundle:Bookmark')->findBy(['user' => $this->getUser(), 'product' => $bons]);
  3313.     // return $this->render('FrontBundle/Page/shop.html.twig', [
  3314.     //   'page' => $page,
  3315.     //   'categories' => $categories,
  3316.     //   'category' => $category,
  3317.     //   'category_slug' => $category_slug,
  3318.     //   'categoryName' => $categoryName,
  3319.     //   'body' => '',
  3320.     //   'filter' => $filter,
  3321.     //   'bons' => $bons,
  3322.     //   'bookmarks' => $bookmarks,
  3323.     //   'de_url' => 'shop/articles',
  3324.     //   'en_url' => 'shop/articles',
  3325.     //   'fr_url' => 'boutique/articles',
  3326.     // ]);
  3327.     $request->setLocale($locale);
  3328.     $em $this->getDoctrine()->getManager();
  3329.     $globals $this->get("twig")->getGlobals();
  3330.     $locales explode('|'$globals["app_locales"]);
  3331.     $categoryName 'Bons cadeaux';
  3332.     $filter 'all';
  3333.     if( $request->get('f') != null ){
  3334.       $filter $request->get('f');
  3335.     }
  3336.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'boutique-articles''locale' => $locale]);
  3337.     $categories $em->getRepository('FrameworkShopBundle:Category')->findBy([], ['position' => 'ASC']);
  3338.     $category $em->getRepository('FrameworkShopBundle:Category')->findOneBy(['slug' => $category_slug]);
  3339.     if( $category_slug ){
  3340.       $categoryTmp $em->getRepository('FrameworkAppBundle:Category')->findOneBy(['slug' => $category_slug]);
  3341.       if( $categoryTmp ){
  3342.         $categoryName $categoryTmp->getTitle();
  3343.       }
  3344.     }
  3345.     $bons $em->getRepository('FrameworkShopBundle:Product')->findBy(['category' => 5], ['position' => 'ASC']);
  3346.     $bookmarks $em->getRepository('FrameworkShopBundle:Bookmark')->findBy(['user' => $this->getUser(), 'product' => $bons]);
  3347.     return $this->render('FrontBundle/Page/shop2.html.twig', [
  3348.       'page' => $page,
  3349.       'categories' => $categories,
  3350.       'category' => $category,
  3351.       'category_slug' => $category_slug,
  3352.       'categoryName' => $categoryName,
  3353.       'body' => '',
  3354.       'filter' => $filter,
  3355.       'bons' => $bons,
  3356.       'bookmarks' => $bookmarks,
  3357.       'de_url' => 'shop/articles',
  3358.       'en_url' => 'shop/articles',
  3359.       'fr_url' => 'boutique/articles',
  3360.       'options' => $this->getBonsOptions($locale),
  3361.     ]);
  3362.     
  3363.   }
  3364.   /**
  3365.   * @Route("/{locale}/boutique/panier", name="framework_front_shop_cart", requirements={"locale" = "([a-z\-0-9]+)"})
  3366.   */
  3367.   public function cartAction(Request $request$locale NULL)
  3368.   {
  3369.     $request->setLocale($locale);
  3370.     $em $this->getDoctrine()->getManager();
  3371.     $globals $this->get("twig")->getGlobals();
  3372.     $locales explode('|'$globals["app_locales"]);
  3373.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'boutique-panier''locale' => $locale]);
  3374.     return $this->render('FrontBundle/Page/shop-cart.html.twig', [
  3375.       'page' => $page,
  3376.       'body' => '',
  3377.       'de_url' => 'boutique/panier',
  3378.       'en_url' => 'boutique/panier',
  3379.       'fr_url' => 'boutique/panier',
  3380.     ]);
  3381.   }
  3382.   /**
  3383.   * @Route("/{locale}/boutique/produit/{slug}", name="framework_front_shop_product", requirements={"slug" = "([a-z\-0-9]+)", "locale" = "([a-z\-0-9]+)"})
  3384.   * @Route("/{locale}/shop/produit/{slug}", name="framework_front_shop_product_de", requirements={"slug" = "([a-z\-0-9]+)", "locale" = "([a-z\-0-9]+)"})
  3385.   */
  3386.   public function productAction(Request $request$locale NULL$slug NULL)
  3387.   {
  3388.     $request->setLocale($locale);
  3389.     $em $this->getDoctrine()->getManager();
  3390.     $globals $this->get("twig")->getGlobals();
  3391.     $locales explode('|'$globals["app_locales"]);
  3392.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'boutique-produit''locale' => $locale]);
  3393.     $product $em->getRepository('FrameworkShopBundle:Product')->findOneBy(['slug' => $slug]);
  3394.     if($product->getPublished() != 1){
  3395.         return $this->redirectToRoute('framework_front_shop_all', ['locale' => $locale]);
  3396.     }
  3397.     if(is_null($product)){
  3398.       return $this->redirectToRoute('framework_front_page_404', ['locale' => $locale]);
  3399.     }
  3400.     $similar $em->getRepository('FrameworkShopBundle:Product')->sameTags($product->getTags());
  3401.     $saved false;
  3402.     if( $this->getUser()){
  3403.       $bookmark $em->getRepository('FrameworkShopBundle:Bookmark')->findOneBy(['user' => $this->getUser(), 'product' => $product]);
  3404.       if( $bookmark ){
  3405.         $saved true;
  3406.       }
  3407.     }
  3408.     return $this->render('FrontBundle/Page/shop-product.html.twig', [
  3409.       'page' => $page,
  3410.       'body' => '',
  3411.       'product' => $product,
  3412.       'similar' => $similar,
  3413.       'saved' => $saved,
  3414.       'options' => $this->getBonsOptions($locale),
  3415.       'de_url' => 'shop/produit/'.$slug,
  3416.       'en_url' => 'shop/produit/'.$slug,
  3417.       'fr_url' => 'boutique/produit/'.$slug,
  3418.     ]);
  3419.   }
  3420.   /**
  3421.   * @Route("/tunnel/cart/send", name="tunnel_cart_send_ajax")
  3422.   * @Route("/tunnel/cart/send/{locale}", name="tunnel_cart_send_ajax_locale", requirements={"locale" = "([a-z\-0-9]+)"})
  3423.   */
  3424.   public function cartSendAction(Request $requestUserPasswordEncoderInterface $passwordEncoderLoginFormAuthenticator $loginGuardAuthenticatorHandler $guardMailerInterface $mailer$locale NULL)
  3425.   {
  3426.     if($locale){
  3427.       $request->setLocale($locale);
  3428.     }
  3429.     $tr $this->loadTranslation($locale);
  3430.     require_once dirname(__FILE__).'/../../plugins/stripe-php-10.12.1/init.php';
  3431.     $success true;
  3432.     $error '';
  3433.     $redirect null;
  3434.     $em $this->getDoctrine()->getManager();
  3435.     $globals $this->get("twig")->getGlobals();
  3436.     $cart $request->get('palace_cart');
  3437.     $infos $request->get('infos');
  3438.     $user $this->getUser();
  3439.     if($infos['firstname'] == '' || $infos['lastname'] == '' || $infos['phone'] == '' || $infos['address'] == '' || $infos['zipcode'] == '' || $infos['city'] == '' || $infos['country_code'] == '') {
  3440.         $error $tr['contact_error2'];
  3441.         $success false;
  3442.     } 
  3443.     if( $infos['form_mode'] == 'register' ){
  3444.       if( $em->getRepository('FrameworkAppBundle:User')->findOneBy(['email' => $infos['email']]) ){
  3445.           $error $tr['signup_error1'];
  3446.           $success false;
  3447.       } elseif($infos['email'] == '' || $infos['password'] == '' || $infos['confirm'] == '') {
  3448.           $error $tr['contact_error2'];
  3449.           $success false;
  3450.       } elseif(strlen($infos['password']) < 8) {
  3451.           $error $tr['signup_error2'];
  3452.           $success false;
  3453.       } elseif($infos['password'] != $infos['confirm']) {
  3454.           $error $tr['signup_error3'];
  3455.           $success false;
  3456.       } elseif($infos['agree'] == 'false') {
  3457.           $error $tr['signup_error4'];
  3458.           $success false;
  3459.       }
  3460.     }
  3461.     if( $infos['form_mode'] == 'logged' && $user == null ){
  3462.       $error $tr['signup_error5'];
  3463.       $success false;
  3464.     }
  3465.     if($success){
  3466.       
  3467.       if($user == null && $infos['form_mode'] == 'register'){
  3468.         //REGISTER USER
  3469. if(trim($infos['email']) == 'sample@email.tst'){
  3470. exit;
  3471. }
  3472.             $user = new User();
  3473.             $user->setUsername(strtolower(trim($infos['email'])));
  3474.             $user->setEmail(strtolower(trim($infos['email'])));
  3475.             $user->setPassword(
  3476.                 $passwordEncoder->encodePassword(
  3477.                   $user,
  3478.                   $infos['password']
  3479.                 )
  3480.             );
  3481.             $user->setDeleted(0);
  3482.             $user->setRoles(["ROLE_USER"]);
  3483.               $stripe = new \Stripe\StripeClient(
  3484.                 $globals['stripe_secret_key']
  3485.               );
  3486.               $customer $stripe->customers->create([
  3487.                 'email' => strtolower(trim($infos['email'])),
  3488.                 'name' => ucwords(strtolower(trim($infos['firstname']))).' '.strtoupper(trim($infos['lastname'])),
  3489.                 'address' => [
  3490.                   'city' => trim($infos['city']),
  3491.                   'country' => $infos['country_code'],
  3492.                   'line1' => trim($infos['address']),
  3493.                   'postal_code' => trim($infos['zipcode']),
  3494.                 ],
  3495.                 'metadata' => ['user_id' => $user->getId()],
  3496.               ]);
  3497.             $user->setInfos(json_encode(['stripe_id' => $customer->id]));
  3498.             $em->persist($user);
  3499.             $em->flush();
  3500.             //FORCE LOG IN
  3501.             $guard->authenticateUserAndHandleSuccess($user,$request,$login,'main');
  3502.       }
  3503.       //RECORD CART
  3504.       $amount $this->getCartAmount($cart);
  3505.       $lastOrder =  $em->getRepository('FrameworkAppBundle:Order')->findOneBy([], ['baseId' => 'DESC']);
  3506.       if($lastOrder){
  3507.         $lastId $lastOrder->getBaseId();
  3508.       } else {
  3509.         $lastId 1000;
  3510.       }
  3511.       $date = new \DateTimeImmutable();
  3512.       $milli = (int)$date->format('Uv');
  3513.       $order = new Order();
  3514.       $order->setBaseId($lastId 1);
  3515.       $order->setUser($user);
  3516.       $order->setToken($milli);
  3517.       $order->setInfos(json_encode($infos));
  3518.       $order->setCart(json_encode($cart));
  3519.       $order->setStatus('new');
  3520.       $order->setState(1);
  3521.       $order->setAmount(floatval($amount['amount_adam']));
  3522.       $order->setAmountShow(floatval($amount['amount_show']));
  3523.       $order->setLang($locale);
  3524.       $em->persist($order);
  3525.       $em->flush();
  3526.       $redirect $this->urlGenerator->generate('tunnel_cart_payment', ['token' => $order->getToken(), 'locale' => $request->getLocale()]);
  3527.     }
  3528.     $data = [
  3529.       'error' => $error,
  3530.       'success' => $success,
  3531.       'redirect' => $redirect,
  3532.     ];
  3533.     $response = new Response(json_encode($data));
  3534.     $response->headers->set('Content-Type''application/json');
  3535.     return $response;
  3536.   }
  3537.   /**
  3538.   * @Route("/{locale}/cart/payment/{token}", name="tunnel_cart_payment", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  3539.   */
  3540.   public function cartPaymentAction(Request $request$locale NULL$token NULL)
  3541.   {
  3542.     $request->setLocale($locale);
  3543.     require_once dirname(__FILE__).'/../../plugins/stripe-php-10.12.1/init.php';
  3544.     $em $this->getDoctrine()->getManager();
  3545.     $globals $this->get("twig")->getGlobals();
  3546.     $order $em->getRepository('FrameworkAppBundle:Order')->findOneBy(['token' => $token]);
  3547.     if(!$token || !$order || $order->getState() != 1){
  3548.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  3549.     }
  3550.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'cart-payment''locale' => $locale]);
  3551.     $amount intVal(($order->getAmount() + $order->getAmountShow()) * 100);
  3552.     $stripe = new \Stripe\StripeClient(
  3553.       $globals['stripe_secret_key']
  3554.     );
  3555.     $username ucwords(strtolower($order->getInfo('firstname'))).' '.strtoupper($order->getInfo('lastname'));
  3556.     $stripe_show_account_id $globals['stripe_show_account_id'];
  3557. if( intVal($order->getAmountShow()) > ){
  3558.     $intent $stripe->paymentIntents->create([
  3559.       'customer' => $order->getUser()->getInfo('stripe_id'),
  3560.       // 'setup_future_usage' => 'off_session',
  3561.       'amount' => $amount,
  3562.       'currency' => 'eur',
  3563.       'payment_method_types' => [
  3564.         'card',
  3565.         'klarna',
  3566.         'paypal',
  3567.       ],
  3568.       'metadata' => [
  3569.         'type' => 'article',
  3570.         'user_name' => $username,
  3571.         'user_email' => $order->getUser()->getEmail(),
  3572.         'user_phone' => $order->getInfo('phone'),
  3573.         'user_id' => $order->getUser()->getId(),
  3574.         'order_id' => $order->getBaseId(),
  3575.         'order_detail' => $order->getRecap(true),
  3576.         'amount' => intVal($order->getAmount() * 100),
  3577.         'amount_show' => intVal($order->getAmountShow() * 100),
  3578.         'amount_eur' => intVal($order->getAmount()),
  3579.         'amount_show_eur' => intVal($order->getAmountShow()),
  3580.         'amount_total_eur' => intVal($order->getAmount()) + intVal($order->getAmountShow()),
  3581.       ],
  3582.       'description' => $order->getRecap('title'),
  3583.       'transfer_group' => 'ORDER_'.$order->getBaseId(),
  3584.       // 'application_fee_amount' => intVal($booking->getAmount() * 100), //ADAM MEYER PART
  3585.       'transfer_data' => [
  3586.         'destination' => $stripe_show_account_id,
  3587.         'amount' => intVal($order->getAmountShow() * 100), //ROYAL SHOW PART
  3588.       ],
  3589.     ]);
  3590. } else {
  3591.     $intent $stripe->paymentIntents->create([
  3592.       'customer' => $order->getUser()->getInfo('stripe_id'),
  3593.       // 'setup_future_usage' => 'off_session',
  3594.       'amount' => $amount,
  3595.       'currency' => 'eur',
  3596.       'payment_method_types' => [
  3597.         'card',
  3598.         'klarna',
  3599.         'paypal'
  3600.       ],
  3601.       'metadata' => [
  3602.         'type' => 'article',
  3603.         'user_name' => $username,
  3604.         'user_email' => $order->getUser()->getEmail(),
  3605.         'user_phone' => $order->getInfo('phone'),
  3606.         'user_id' => $order->getUser()->getId(),
  3607.         'order_id' => $order->getBaseId(),
  3608.         'order_detail' => $order->getRecap(true),
  3609.         'amount' => intVal($order->getAmount() * 100),
  3610.         'amount_show' => intVal($order->getAmountShow() * 100),
  3611.         'amount_eur' => intVal($order->getAmount()),
  3612.         'amount_show_eur' => intVal($order->getAmountShow()),
  3613.         'amount_total_eur' => intVal($order->getAmount()) + intVal($order->getAmountShow()),
  3614.       ],
  3615.       'description' => $order->getRecap('title'),
  3616.     ]);
  3617. }
  3618.     // $intent = $stripe->paymentIntents->create([
  3619.     //   'customer' => $this->getUser()->getInfo('stripe_id'),
  3620.     //   'setup_future_usage' => 'off_session',
  3621.     //   'amount' => $amount,
  3622.     //   'currency' => 'eur',
  3623.     //   'payment_method_types' => [
  3624.     //     'card',
  3625.     //   ],
  3626.     //   'metadata' => [
  3627.     //     'type' => 'reservation',
  3628.     //     'user_name' => $username,
  3629.     //     'user_email' => $booking->getUser()->getEmail(),
  3630.     //     'user_phone' => $booking->getUser()->getInfo('phone'),
  3631.     //     'user_id' => $booking->getUser()->getId(),
  3632.     //     'booking_id' => $booking->getBaseId(),
  3633.     //     'booking_detail' => $booking->getOptions(),
  3634.     //     'booking_date' => $booking->getVenueTitle(),
  3635.     //     'amount' => intVal($booking->getAmount() * 100),
  3636.     //     'amount_show' => intVal($booking->getAmountShow() * 100),
  3637.     //     'amount_eur' => intVal($booking->getAmount()),
  3638.     //     'amount_show_eur' => intVal($booking->getAmountShow()),
  3639.     //     'amount_total_eur' => intVal($booking->getAmount()) + intVal($booking->getAmountShow()),
  3640.     //   ],
  3641.     //   'description' => $booking->getBaseId().' | '.$booking->getVenueTitle().' | '.$username,
  3642.     //   'transfer_group' => 'BOOKING_'.$booking->getBaseId(),
  3643.     //   // 'application_fee_amount' => intVal($booking->getAmount() * 100), //ADAM MEYER PART
  3644.     //   'transfer_data' => [
  3645.     //     'destination' => $stripe_show_account_id,
  3646.     //     'amount' => intVal($booking->getAmountShow() * 100), //ROYAL SHOW PART
  3647.     //   ],
  3648.     // ]);
  3649.     $client_secret $intent->client_secret;
  3650.     return $this->render('FrontBundle/Page/cart-payment.html.twig', [
  3651.       'order' => $order,
  3652.       'client_secret' => $client_secret,
  3653.       'page' => $page,
  3654.       'body' => '',
  3655.       'de_url' => 'cart/payment/'.$token,
  3656.       'en_url' => 'cart/payment/'.$token,
  3657.       'fr_url' => 'cart/payment/'.$token,
  3658.     ]);
  3659.   }
  3660.   /**
  3661.   * @Route("/{locale}/cart/paiement/{token}/complete", name="tunnel_cart_payment_complete", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  3662.   */
  3663.   public function cartPaymentCompleteAction(Request $request$locale NULL$token NULLMailerInterface $mailer)
  3664.   {
  3665.     $request->setLocale($locale);
  3666.     require_once dirname(__FILE__).'/../../plugins/stripe-php-10.12.1/init.php';
  3667.     $em $this->getDoctrine()->getManager();
  3668.     $globals $this->get("twig")->getGlobals();
  3669.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'reservation-payment''locale' => $locale]);
  3670.     $order $em->getRepository('FrameworkAppBundle:Order')->findOneBy(['token' => $token]);
  3671.     if(!$token || !$order){
  3672.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  3673.     }
  3674.     $payment_intent $request->get('payment_intent');
  3675.     $stripe = new \Stripe\StripeClient(
  3676.       $globals['stripe_secret_key']
  3677.     );
  3678.     $intent $stripe->paymentIntents->retrieve(
  3679.       $payment_intent,
  3680.       []
  3681.     );
  3682.     $method $stripe->paymentMethods->retrieve(
  3683.       $intent->payment_method,
  3684.       []
  3685.     );
  3686.     $payment_type $method['type'];
  3687.     $order->setStatus($intent->status);
  3688.     $em->persist($order);
  3689.     $em->flush();
  3690.     if($intent->status == 'succeeded'){
  3691.       $order->setState(2); //Commande confirmée
  3692.       $order->setPaymentType($payment_type);
  3693.       $order->setResult(json_encode($intent));
  3694.       $em->persist($order);
  3695.       $em->flush();
  3696.       //ENVOI EMAIL
  3697.       if( $order->getMailed() != ){
  3698.         $subject 'Royal Palace : Merci pour votre commande !';
  3699.         $title 'Royal Palace : Merci pour votre commande !';
  3700.         $content '<p>Merci, votre commande <strong>#'.$order->getBaseId().'</strong> est maintenant confirmée.<br>
  3701.                                       Le récapitulatif est disponible dans votre espace <a href="'.$globals['app_email_domain'].'login">"Mon Compte"</a> de notre site web.<br>
  3702.                                       <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">Cliquez ici</a> pour télécharger la fiche <strong>"Déroulement d\'un évènement".</strong></p>
  3703.                                       <p>A bientôt au <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  3704.       
  3705.       if($locale == 'de'){
  3706.         $subject 'Royal Palace: Vielen Dank für Ihre Bestellung!';
  3707.         $title 'Royal Palace: Vielen Dank für Ihre Bestellung!';
  3708.         $content '<p>Vielen Dank, Ihre Bestellung <strong>#'.$order->getBaseId().'</strong> ist nun bestätigt.<br>
  3709.                                       Die Zusammenfassung finden Sie in Ihrem Bereich <a href="'.$globals['app_email_domain'].'login">"Mein Konto"</a> auf unserer Website.<br>
  3710.                                       <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">Klicken Sie hier</a>, um das Arbeitsblatt <strong>"Ablauf einer Veranstaltung"</strong> herunterzuladen.</p>
  3711.                                       <p>Bis bald im <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  3712.       }
  3713.       
  3714.       if($locale == 'en'){
  3715.         $subject 'Royal Palace : Merci pour votre commande !';
  3716.         $title 'Royal Palace : Merci pour votre commande !';
  3717.         $content '<p>Thank you, your order <strong>#'.$order->getBaseId().'</strong> is now confirmed.<br>
  3718.                                       The summary is available in your <a href="'.$globals['app_email_domain'].'login">"My Account"</a> area of our website.<br>
  3719.                                       <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">Click here</a> to download the <strong>"Event procedure"</strong> sheet.</p>
  3720.                                       <p>See you soon at <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  3721.       }
  3722.             //ENVOI EMAIL
  3723.             $from $globals['app_email_noreply'];
  3724.             $to $order->getUser()->getEmail();
  3725.             $contact $globals['app_email_contact'];
  3726.             $email = (new Email())
  3727.                 ->from($from)
  3728.                 ->to($to)
  3729.                 //->cc('cc@example.com')
  3730.                 //->bcc('bcc@example.com')
  3731.                 ->replyTo($contact)
  3732.                 //->priority(Email::PRIORITY_HIGH)
  3733.                 ->subject($subject)
  3734.                 // ->text(nl2br('Merci, votre commande #<strong>'.$order->getBaseId().'</strong> est maintenant confirmée.').nl2br('A bientôt au Royal Palace'))
  3735.                 ->html($this->renderView(
  3736.                             'FrontBundle/Emails/general.html.twig', array(
  3737.                                     'title'   => $title,
  3738.                                     'content' => $content
  3739.                                 )
  3740.                          ));
  3741.             $mailer->send($email);
  3742.             //FIN ENVOI EMAIL
  3743.             // //DESACTIVé SUR DEMANDE DU CLIENT
  3744.             // //ENVOI EMAIL ADMIN ROYAL PALACE
  3745.             // $from = $globals['app_email_noreply'];
  3746.             // $to = $globals['app_email_address'];
  3747.             // $contact = $globals['app_email_contact'];
  3748.             // $infos = $order->getInfosArr();
  3749.             // $cart = $order->getCartArr();
  3750.             // $email = (new Email())
  3751.             //     ->from($from)
  3752.             //     ->to($to)
  3753.             //     //->cc('cc@example.com')
  3754.             //     //->bcc('bcc@example.com')
  3755.             //     ->replyTo($contact)
  3756.             //     //->priority(Email::PRIORITY_HIGH)
  3757.             //     ->subject('Nouvelle commande Site Web')
  3758.             //     ->text(nl2br('Nouvelle commande Site Web'))
  3759.             //     ->html($this->renderView(
  3760.             //                 'FrontBundle/Emails/general.html.twig', array(
  3761.             //                         'title'   => 'Nouvelle commande Site Web #'.$order->getBaseId(),
  3762.             //                         'content' => '<p>
  3763.             //                         '.ucwords(strtolower(trim($infos['firstname']))).' '.strtoupper(trim($infos['lastname'])).'<br>
  3764.             //                         '.$infos['phone'].'<br>
  3765.             //                         '.$infos['email'].'<br>
  3766.             //                         '.trim($infos['address']).' '.trim($infos['zipcode']).' '.trim($infos['city']).' '.trim($infos['country']).'<br>
  3767.             //                         TOTAL : '.$order->getAmountTotal().'€<br>
  3768.             //                         Type de paiement : '.$order->getPaymentTypeTr('fr').'<br><br>
  3769.             //                         <a href="'.$globals['app_email_domain'].'backoffrp/order/'.$order->getId().'">VOIR LA COMMANDE</a>
  3770.             //                         </p>
  3771.             //                         '
  3772.             //                     )
  3773.             //              ));
  3774.             // $mailer->send($email);
  3775.             // //FIN ENVOI EMAIL ADMIN ROYAL PALACE
  3776.     
  3777.         $order->setMailed(1);
  3778.         $em->persist($order);
  3779.         $em->flush();
  3780.       }
  3781.     } else {
  3782.       $order->setState(3); //Erreur de paiement
  3783.       $order->setResult(json_encode($intent));
  3784.       $em->persist($order);
  3785.       $em->flush();
  3786.     }
  3787.     return $this->render('FrontBundle/Page/cart-payment-complete.html.twig', [
  3788.       'order' => $order,
  3789.       'status' => $intent->status,
  3790.       'page' => $page,
  3791.       'body' => '',
  3792.     ]);
  3793.   }
  3794.   /**
  3795.   * @Route("/{locale}/mon-compte/paiement/{token}/manual-cart", name="framework_front_reservation_payment_manual_cart", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  3796.   */
  3797.   public function reservationPaymentManualCartAction(Request $request$locale NULL$token NULLMailerInterface $mailer)
  3798.   {
  3799.     $request->setLocale($locale);
  3800.     $success true;
  3801.     $error '';
  3802.     $em $this->getDoctrine()->getManager();
  3803.     $globals $this->get("twig")->getGlobals();
  3804.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'reservation-payment''locale' => $locale]);
  3805.     $order $em->getRepository('FrameworkAppBundle:Order')->findOneBy(['token' => $token]);
  3806.     if(!$token || !$order || $order->getState() != 1){
  3807.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  3808.     }
  3809.       $order->setStatus('manual');
  3810.       $order->setState(5); //Validée : En attente de règlement
  3811.       $order->setPaymentType($request->get('payment_type'));
  3812.       $em->persist($order);
  3813.       $em->flush();
  3814.       //ENVOI EMAIL
  3815.       if( $order->getMailed() != ){
  3816.             $subject 'Royal Palace : Merci pour votre commande !';
  3817.             $title 'Votre commande sera confirmée à la réception de votre paiement.';
  3818.             $content '<p>Merci ! Votre commande <strong>#'.$order->getBaseId().'</strong> sera confirmée à la réception de votre paiement.<br><br>
  3819.                                     TOTAL : <strong>'.$order->getAmountTotal().'€</strong><br>
  3820.                                     Précisez le numéro de commande suivant lors de votre paiement : <strong>#'.$order->getBaseId().'</strong><br><br>
  3821. - Soit par chèques à l\'adresse suivante :<br>
  3822.  <strong>ROYAL PALACE - 20 RUE DE HOCHFELDEN - 67330 KIRRWILLER </strong><br>
  3823. 1 chèque à l\'ordre d\'<strong>ADAM MEYER SAS</strong> d\'un montant de <strong>'.$order->getAmount().'€</strong><br>';
  3824. if($order->getAmountShow() > 0){
  3825.   $content .= '1 chèque à l\'ordre de <strong>ROYAL SHOW PRODUCTIONS SAS</strong> d\'un montant de <strong>'.$order->getAmountShow().'€</strong><br>';
  3826. }
  3827.  $content .= '<br>
  3828. - Soit par virements bancaires (CCM DE BOUXWILLER) :<br>
  3829. 1 virement d\'un montant de <strong>'.$order->getAmount().'€</strong> (ADAM MEYER SAS)<br>
  3830. <strong>IBAN : FR76 10278 01670 00013429645 56 - BIC CMCIFR2A</strong><br>';
  3831. if($order->getAmountShow() > 0){
  3832.   $content .= '1 virement d\'un montant de <strong>'.$order->getAmountShow().'€</strong> (ROYAL SHOW PRODUCTIONS SAS)<br>';
  3833. }
  3834. $content .= '<strong>IBAN : FR76 10278 01670 00014697745 96 - BIC CMCIFR2A</strong><br>
  3835. <br>
  3836. Pour préparer au mieux votre venue au Royal Palace, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">cliquez ici</a> pour télécharger la fiche <strong>"Déroulement d\'un évènement".</strong></p><br>
  3837.   Le récapitulatif est disponible dans votre espace <a href="'.$globals['app_email_domain'].'login">"Mon Compte"</a> de notre site web.<br>
  3838.   <p>A bientôt au <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>
  3839. ';
  3840.   if($locale == 'de'){
  3841.             $subject 'Royal Palace : Vielen Dank für Ihre Bestellung!';
  3842.             $title 'Ihre Bestellung wird bestätigt, sobald Ihre Zahlung eingegangen ist.';
  3843.             $content '<p>Vielen Dank! Ihre Bestellung <strong>#'.$order->getBaseId().'</strong> wird bestätigt, sobald Ihre Zahlung eingegangen ist.<br><br>
  3844.                                     TOTAL : <strong>'.$order->getAmountTotal().'€</strong><br>
  3845.                                     Geben Sie bei der Zahlung die folgende Bestellnummer an : <strong>#'.$order->getBaseId().'</strong><br><br>
  3846. - Oder per Scheck an die folgende Adresse :<br>
  3847.  <strong>ROYAL PALACE - 20 RUE DE HOCHFELDEN - 67330 KIRRWILLER </strong><br>
  3848. 1 Scheck ausgestellt auf <strong>ADAM MEYER SAS</strong> in Höhe von <strong>'.$order->getAmount().'€</strong><br>';
  3849. if($order->getAmountShow() > 0){
  3850.   $content .= '1 Scheck ausgestellt auf <strong>ROYAL SHOW PRODUCTIONS SAS</strong> in Höhe von <strong>'.$order->getAmountShow().'€</strong><br>';
  3851. }
  3852.  $content .= '<br>
  3853. - Entweder per Banküberweisung (CCM DE BOUXWILLER) :<br>
  3854. 1 Überweisung in Höhe von <strong>'.$order->getAmount().'€</strong> (ADAM MEYER SAS)<br>
  3855. <strong>IBAN : FR76 10278 01670 00013429645 56 - BIC CMCIFR2A</strong><br>';
  3856. if($order->getAmountShow() > 0){
  3857.   $content .= '1 Überweisung in Höhe von <strong>'.$order->getAmountShow().'€</strong> (ROYAL SHOW PRODUCTIONS SAS)<br>';
  3858. }
  3859. $content .= '<strong>IBAN : FR76 10278 01670 00014697745 96 - BIC CMCIFR2A</strong><br>
  3860. <br>
  3861. Um Ihren Besuch im Royal Palace optimal vorzubereiten, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">klicken Sie hier</a> um das Merkblatt herunterzuladen <strong>"Ablauf einer Veranstaltung".</strong></p><br>
  3862.   Die Zusammenfassung ist in Ihrem Bereich <a href="'.$globals['app_email_domain'].'login">"Mein Konto"</a> auf unserer Website verfügbar.<br>
  3863.   <p>Bis bald im <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>
  3864. ';
  3865.   }
  3866.   if($locale == 'en'){
  3867.             $subject 'Royal Palace : Thank you for your order!';
  3868.             $title 'Your order will be confirmed upon receipt of your payment.';
  3869.             $content '<p>Thank you! Your order <strong>#'.$order->getBaseId().'</strong> will be confirmed upon receipt of your payment.<br><br>
  3870.                                     TOTAL : <strong>'.$order->getAmountTotal().'€</strong><br>
  3871.                                     Specify the following order number when making your payment: <strong>#'.$order->getBaseId().'</strong><br><br>
  3872. - By cheque to the following address :<br>
  3873.  <strong>ROYAL PALACE - 20 RUE DE HOCHFELDEN - 67330 KIRRWILLER </strong><br>
  3874. 1 cheque to the order of <strong>ADAM MEYER SAS</strong> in the amount of <strong>'.$order->getAmount().'€</strong><br>';
  3875. if($order->getAmountShow() > 0){
  3876.   $content .= '1 cheque to the order of <strong>ROYAL SHOW PRODUCTIONS SAS</strong> in the amount of <strong>'.$order->getAmountShow().'€</strong><br>';
  3877. }
  3878.  $content .= '<br>
  3879. - Or by bank transfer (CCM DE BOUXWILLER) :<br>
  3880. 1 transfer in the amount of <strong>'.$order->getAmount().'€</strong> (ADAM MEYER SAS)<br>
  3881. <strong>IBAN : FR76 10278 01670 00013429645 56 - BIC CMCIFR2A</strong><br>';
  3882. if($order->getAmountShow() > 0){
  3883.   $content .= '1 transfer in the amount of <strong>'.$order->getAmountShow().'€</strong> (ROYAL SHOW PRODUCTIONS SAS)<br>';
  3884. }
  3885. $content .= '<strong>IBAN : FR76 10278 01670 00014697745 96 - BIC CMCIFR2A</strong><br>
  3886. <br>
  3887. To best prepare your visit to the Royal Palace, <a href="'.$globals['app_email_domain'].'front/déroulement-spectacle.pdf">click here</a> to download the data sheet <strong>"How an event unfolds".</strong></p><br>
  3888.   The summary is available in your space <a href="'.$globals['app_email_domain'].'login">"My Account"</a> of our website.<br>
  3889.   <p>See you soon at <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>
  3890. ';
  3891.   }
  3892.             //ENVOI EMAIL
  3893.             $from $globals['app_email_noreply'];
  3894.             $to $order->getUser()->getEmail();
  3895.             $contact $globals['app_email_contact'];
  3896.             $email = (new Email())
  3897.                 ->from($from)
  3898.                 ->to($to)
  3899.                 //->cc('cc@example.com')
  3900.                 //->bcc('bcc@example.com')
  3901.                 ->replyTo($contact)
  3902.                 //->priority(Email::PRIORITY_HIGH)
  3903.                 ->subject($subject)
  3904.                 // ->text(nl2br('Merci ! Votre commande <strong>'.$order->getBaseId().'</strong> est maintenant confirmée.').nl2br('A bientôt au Royal Palace'))
  3905.                 ->html($this->renderView(
  3906.                             'FrontBundle/Emails/general.html.twig', array(
  3907.                                     'title'   => $title,
  3908.                                     'content' => $content
  3909.                                 )
  3910.                          ));
  3911.             $mailer->send($email);
  3912.             //FIN ENVOI EMAIL
  3913.             // //DESACTIVé SUR DEMANDE DU CLIENT
  3914.             // //ENVOI EMAIL ADMIN ROYAL PALACE
  3915.             // $from = $globals['app_email_noreply'];
  3916.             // $to = $globals['app_email_address'];
  3917.             // $contact = $globals['app_email_contact'];
  3918.             // $infos = $order->getInfosArr();
  3919.             // $cart = $order->getCartArr();
  3920.             // $email = (new Email())
  3921.             //     ->from($from)
  3922.             //     ->to($to)
  3923.             //     //->cc('cc@example.com')
  3924.             //     //->bcc('bcc@example.com')
  3925.             //     ->replyTo($contact)
  3926.             //     //->priority(Email::PRIORITY_HIGH)
  3927.             //     ->subject('Nouvelle commande Site Web')
  3928.             //     ->text(nl2br('Nouvelle commande Site Web'))
  3929.             //     ->html($this->renderView(
  3930.             //                 'FrontBundle/Emails/general.html.twig', array(
  3931.             //                         'title'   => 'Nouvelle commande Site Web #'.$order->getBaseId(),
  3932.             //                         'content' => '<p>
  3933.             //                         '.ucwords(strtolower(trim($infos['firstname']))).' '.strtoupper(trim($infos['lastname'])).'<br>'.$infos['phone'].'<br>
  3934.             //                         '.$infos['email'].'<br>
  3935.             //                         '.trim($infos['address']).' '.trim($infos['zipcode']).' '.trim($infos['city']).' '.trim($infos['country']).'<br>
  3936.             //                         TOTAL : '.$order->getAmountTotal().'€<br>
  3937.             //                         Type de paiement : '.$order->getPaymentTypeTr('fr').'<br><br>
  3938.             //                         <a href="'.$globals['app_email_domain'].'backoffrp/order/'.$order->getId().'">VOIR LA COMMANDE</a>
  3939.             //                         </p>
  3940.             //                         '
  3941.             //                     )
  3942.             //              ));
  3943.             // $mailer->send($email);
  3944.             // //FIN ENVOI EMAIL ADMIN ROYAL PALACE
  3945.         $order->setMailed(1);
  3946.         $em->persist($order);
  3947.         $em->flush();
  3948.       }
  3949.     $data = [
  3950.       'error' => $error,
  3951.       'success' => $success,
  3952.     ];
  3953.     $response = new Response(json_encode($data));
  3954.     $response->headers->set('Content-Type''application/json');
  3955.     return $response;
  3956.   }
  3957.   /**
  3958.   * @Route("/{locale}/mon-compte/paiement/manual-cart/confirm/{token}", name="framework_front_reservation_payment_manual_cart_confirm", requirements={"locale" = "([a-z\-0-9]+)", "token" = "([0-9]+)"})
  3959.   */
  3960.   public function reservationPaymentManualCartConfirmAction(Request $request$locale NULL$token NULL)
  3961.   {
  3962.     $request->setLocale($locale);
  3963.     $em $this->getDoctrine()->getManager();
  3964.     $globals $this->get("twig")->getGlobals();
  3965.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'cart-payment''locale' => $locale]);
  3966.     $order $em->getRepository('FrameworkAppBundle:Order')->findOneBy(['token' => $token]);
  3967.     if(!$token || !$order){
  3968.       return $this->redirectToRoute('framework_front_account_infos', ['locale' => $locale]);
  3969.     }
  3970.     return $this->render('FrontBundle/Page/cart-payment-manual-confirm.html.twig', [
  3971.       'baseId' => $order->getBaseId(),
  3972.       'order' => $order,
  3973.       'page' => $page,
  3974.       'body' => '',
  3975.     ]);
  3976.   }
  3977.   function getCartAmount($cart){
  3978.     $em $this->getDoctrine()->getManager();
  3979.     $globals $this->get("twig")->getGlobals();
  3980.     $options self::bonsOptions;
  3981.     $amount 0;
  3982.     $amount_adam 0;
  3983.     $amount_show 0;
  3984.     $amount_gifts 0;
  3985.     $giftPrice self::giftPrice;
  3986.     foreach ($cart as $key => $item) {
  3987.       $product $em->getRepository('FrameworkShopBundle:Product')->findOneBy(['slug' => $item['slug']]);
  3988.       if( $item['slug'] == 'bon-cadeau-10' || $item['slug'] == 'bon-cadeau-21' ){//SILVER PRIX VARIABLE
  3989.         $amount $amount + ( floatval($item['price']) * intval($item['quantity']) );
  3990.         if( $item['gift'] == 'true' ){
  3991.           $amount_gifts $amount_gifts + ( $giftPrice ); //NOUVEAU CALCUL
  3992.         }
  3993.       } else {
  3994.         $amount $amount + ( floatval($product->getPrice()) * intval($item['quantity']) );
  3995.         $amount_show $amount_show + ( $product->getAmountShow() * intval($item['quantity']) );
  3996.           if( $item['gift'] == 'true' ){
  3997.           // $amount_gifts = $amount_gifts + ( $giftPrice * intval($item['quantity']) );
  3998.           $amount_gifts $amount_gifts + ( $giftPrice ); //NOUVEAU CALCUL
  3999.         }
  4000.         if(isset($item['options']) && $item['options'] != ""){
  4001.           foreach ($item['options'] as $key2 => $value) {
  4002.             foreach ($options as $key3 => $option) {
  4003.               if($option['id'] == $value['id']){
  4004.                 // $amount = $amount + ( $option['price'] * intval($value['qty']) * intval($item['quantity']) );
  4005.                 $amount $amount + ( $option['price'] * intval($value['qty']) );  //NOUVEAU CALCUL
  4006.               }
  4007.             }
  4008.           }
  4009.         }
  4010.       }
  4011.     }
  4012.     $amount_adam $amount $amount_show;
  4013.     $amount_show $amount_show $amount_gifts;
  4014.     $amount $amount $amount_gifts;
  4015. // dump([
  4016. //       'amount' => $amount,
  4017. //       'amount_adam' => $amount_adam,
  4018. //       'amount_show' => $amount_show,
  4019. //     ]);
  4020. // exit;
  4021.     return [
  4022.       'amount' => $amount,
  4023.       'amount_adam' => $amount_adam,
  4024.       'amount_show' => $amount_show,
  4025.     ];
  4026.   }
  4027.   public function getBonsOptions($locale){
  4028.     if($locale == 'de'){
  4029.     return [
  4030.             [
  4031.               'id' => 1,
  4032.               'name' => 'Vorschlag Duo',
  4033.               'price' => 29,
  4034.               'lounge' => false,
  4035.                 'sub'=> 'Für 2 Personen',
  4036.                 'boutique' => false,
  4037.                 'restaurant' => true,
  4038.               'desc' => '<strong>Gültig für zwei Personen</strong><br><br>
  4039.           1⁄2 bt Pinot Blanc Dussourt<br>***<br>
  4040.           1⁄2 bt Bordeaux Château Goumin<br>***<br>
  4041.           2 Kaffee',
  4042.             ],
  4043.             [
  4044.               'id' => 2,
  4045.               'name' => 'Vorschlag Prestigo',
  4046.               'price' => 41,
  4047.               'lounge' => false,
  4048.                 'sub'=> 'Für 2 Personen',
  4049.                 'restaurant' => true,
  4050.                 'boutique' => false,
  4051.               'desc' => '<strong>Gültig für zwei Personen</strong><br><br>
  4052.           1⁄2 bt Pinot Gris Signature Domaine Ville de Colmar<br>***<br>
  4053.           1⁄2 bt Saint-Emilion Cheval Noir Mähler-Besser<br>***<br>
  4054.           2 Kaffee',
  4055.             ],
  4056.             [
  4057.               'id' => 3,
  4058.               'name' => 'Getränketicket 5€',
  4059.               'price' => 5,
  4060.                 'sub'=> '',
  4061.                 'restaurant' => false,
  4062.                 'boutique' => false,
  4063.               'lounge' => true,
  4064.               'desc' => '',
  4065.             ],
  4066.             [
  4067.               'id' => 4,
  4068.               'name' => 'Getränketicket 8€',
  4069.               'price' => 8,
  4070.                 'sub'=> '',
  4071.                 'restaurant' => false,
  4072.                 'boutique' => false,
  4073.               'lounge' => true,
  4074.               'desc' => '',
  4075.             ],
  4076.             [
  4077.               'id' => 5,
  4078.               'name' => 'Getränketicket 10€',
  4079.               'price' => 10,
  4080.                 'sub'=> '',
  4081.                 'restaurant' => false,
  4082.                 'boutique' => false,
  4083.               'lounge' => true,
  4084.               'desc' => '',
  4085.             ],
  4086.             [
  4087.               'id' => 6,
  4088.               'name' => 'Champagner-Flasche',
  4089.               'price' => 65,
  4090.                 'sub'=> '',
  4091.                 'restaurant' => false,
  4092.                 'boutique' => false,
  4093.               'lounge' => true,
  4094.               'desc' => '',
  4095.             ],
  4096.             [
  4097.               'id' => 7,
  4098.               'name' => 'Gutschein Shop 10€',
  4099.               'price' => 10,
  4100.                 'sub'=> '',
  4101.                 'restaurant' => false,
  4102.                 'boutique' => true,
  4103.               'lounge' => false,
  4104.               'desc' => '',
  4105.             ],
  4106.             [
  4107.               'id' => 8,
  4108.               'name' => 'Gutschein Shop 20€',
  4109.               'price' => 20,
  4110.                 'sub'=> '',
  4111.                 'restaurant' => false,
  4112.                 'boutique' => true,
  4113.               'lounge' => false,
  4114.               'desc' => '',
  4115.             ],
  4116.         [
  4117.             'id' => 9,
  4118.             'name' => 'Käsesortiment',
  4119.             'price' => 8,
  4120.             'sub' => '',
  4121.             'restaurant' => true,
  4122.             'boutique' => false,
  4123.             'lounge' => false,
  4124.             'desc' => '',
  4125.         ],
  4126.           ];
  4127.     } elseif($locale == 'en'){
  4128.     return [
  4129.             [
  4130.               'id' => 1,
  4131.               'name' => 'Package Duo',
  4132.               'price' => 29,
  4133.               'lounge' => false,
  4134.                 'sub' => 'For two people',
  4135.                 'restaurant' => true,
  4136.                 'boutique' => false,
  4137.               'desc' => '<strong>Valid for two people</strong><br><br>
  4138.           1⁄2 bt Pinot Blanc Dussourt<br>***<br>
  4139.           1⁄2 bt Bordeaux Château Goumin<br>***<br>
  4140.           2 cafés',
  4141.             ],
  4142.             [
  4143.               'id' => 2,
  4144.               'name' => 'Package Prestigo',
  4145.               'price' => 41,
  4146.               'lounge' => false,
  4147.                 'sub' => 'For two people',
  4148.                 'restaurant' => true,
  4149.                 'boutique' => false,
  4150.               'desc' => '<strong>Valid for two people</strong><br><br>
  4151.           1⁄2 bt Pinot Gris Signature Domaine Ville de Colmar<br>***<br>
  4152.           1⁄2 bt Saint-Emilion Cheval Noir Mähler-Besser<br>***<br>
  4153.           2 cafés',
  4154.             ],
  4155.             [
  4156.               'id' => 3,
  4157.               'name' => 'Drinks ticket 5€',
  4158.               'price' => 5,
  4159.               'lounge' => true,
  4160.                 'sub' => '',
  4161.                 'restaurant' => false,
  4162.                 'boutique' => false,
  4163.               'desc' => '',
  4164.             ],
  4165.             [
  4166.               'id' => 4,
  4167.               'name' => 'Drinks ticket 8€',
  4168.               'price' => 8,
  4169.                 'sub' => '',
  4170.               'lounge' => true,
  4171.                 'restaurant' => false,
  4172.                 'boutique' => false,
  4173.               'desc' => '',
  4174.             ],
  4175.             [
  4176.               'id' => 5,
  4177.               'name' => 'Drinks ticket 10€',
  4178.               'price' => 10,
  4179.                 'sub' => '',
  4180.               'lounge' => true,
  4181.                 'restaurant' => false,
  4182.                 'boutique' => false,
  4183.               'desc' => '',
  4184.             ],
  4185.             [
  4186.               'id' => 6,
  4187.               'name' => 'Bottle of Champagne',
  4188.               'price' => 65,
  4189.                 'sub' => '',
  4190.               'lounge' => true,
  4191.                 'restaurant' => false,
  4192.                 'boutique' => false,
  4193.               'desc' => '',
  4194.             ],
  4195.             [
  4196.               'id' => 7,
  4197.               'name' => 'Store voucher 10€',
  4198.               'price' => 10,
  4199.                 'sub' => '',
  4200.               'lounge' => false,
  4201.                 'boutique' => true,
  4202.                 'restaurant' => false,
  4203.               'desc' => '',
  4204.             ],
  4205.             [
  4206.               'id' => 8,
  4207.               'name' => 'Store voucher 20€',
  4208.               'price' => 20,
  4209.                 'sub' => '',
  4210.               'lounge' => false,
  4211.                 'restaurant' => false,
  4212.                 'boutique' => true,
  4213.               'desc' => '',
  4214.             ],
  4215.         [
  4216.             'id' => 9,
  4217.             'name' => 'Assorted cheeses',
  4218.             'price' => 8,
  4219.             'sub' => '',
  4220.             'restaurant' => true,
  4221.             'boutique' => false,
  4222.             'lounge' => false,
  4223.             'desc' => '',
  4224.         ],
  4225.           ];
  4226.     } else {
  4227.     return [
  4228.             [
  4229.               'id' => 1,
  4230.               'name' => 'Forfait boisson Duo',
  4231.               'price' => 29,
  4232.               'lounge' => false,
  4233.                 'sub' => 'Pour deux personnes',
  4234.                 'restaurant' => true,
  4235.                 'boutique' => false,
  4236.               'desc' => '<strong>Valable pour deux personnes</strong><br><br>
  4237.           1⁄2 bt de Pinot Blanc Dussourt<br>***<br>
  4238.           1⁄2 bt Bordeaux Château Goumin<br>***<br>
  4239.           2 cafés',
  4240.             ],
  4241.             [
  4242.               'id' => 2,
  4243.               'name' => 'Forfait boisson Prestigo',
  4244.               'price' => 41,
  4245.               'lounge' => false,
  4246.                 'sub' => 'Pour deux personnes',
  4247.                 'restaurant' => true,
  4248.                 'boutique' => false,
  4249.               'desc' => '<strong>Valable pour deux personnes</strong><br><br>
  4250.           1⁄2 bt de Pinot Gris Signature Domaine Ville de Colmar<br>***<br>
  4251.           1⁄2 bt Saint-Emilion Cheval Noir Mähler-Besser<br>***<br>
  4252.           2 cafés',
  4253.             ],
  4254.             [
  4255.               'id' => 3,
  4256.               'name' => 'Ticket boisson 5€',
  4257.               'price' => 5,
  4258.                 'sub' => '',
  4259.                 'restaurant' => false,
  4260.                 'boutique' => false,
  4261.               'lounge' => true,
  4262.               'desc' => '',
  4263.             ],
  4264.             [
  4265.               'id' => 4,
  4266.               'name' => 'Ticket boisson 8€',
  4267.               'price' => 8,
  4268.                 'sub' => '',
  4269.                 'restaurant' => false,
  4270.                 'boutique' => false,
  4271.               'lounge' => true,
  4272.               'desc' => '',
  4273.             ],
  4274.             [
  4275.               'id' => 5,
  4276.               'name' => 'Ticket boisson 10€',
  4277.               'price' => 10,
  4278.                 'sub' => '',
  4279.                 'restaurant' => false,
  4280.                 'boutique' => false,
  4281.               'lounge' => true,
  4282.               'desc' => '',
  4283.             ],
  4284.             [
  4285.               'id' => 6,
  4286.               'name' => 'Bouteille de Champagne',
  4287.               'price' => 65,
  4288.                 'sub' => '',
  4289.                 'restaurant' => false,
  4290.                 'boutique' => false,
  4291.               'lounge' => true,
  4292.               'desc' => '',
  4293.             ],
  4294.             [
  4295.               'id' => 7,
  4296.               'name' => 'Bon d’achat boutique 10€',
  4297.               'price' => 10,
  4298.                 'sub' => '',
  4299.                 'restaurant' => false,
  4300.                 'boutique' => true,
  4301.               'lounge' => false,
  4302.               'desc' => '',
  4303.             ],
  4304.             [
  4305.               'id' => 8,
  4306.               'name' => 'Bon d’achat boutique 20€',
  4307.               'price' => 20,
  4308.                 'sub' => '',
  4309.                 'restaurant' => false,
  4310.                 'boutique' => true,
  4311.               'lounge' => false,
  4312.               'desc' => '',
  4313.             ],
  4314.             [
  4315.                 'id' => 9,
  4316.                 'name' => 'Assortiment de fromages',
  4317.                 'price' => 8,
  4318.                 'sub' => '',
  4319.                 'restaurant' => true,
  4320.                 'boutique' => false,
  4321.                 'lounge' => false,
  4322.                 'desc' => '',
  4323.             ],
  4324.           ];
  4325. }
  4326.   }
  4327.   public function loadTranslation($locale){
  4328.       $arr = [];
  4329.       $em $this->getDoctrine()->getManager();
  4330.       $translations $em->getRepository('FrameworkAppBundle:Translation')->findAll();
  4331.       foreach ($translations as $key => $translation) {
  4332.           $content $translation->getContent();
  4333.           if(isset($content[$locale])){
  4334.               $arr[$translation->getSlug()] = $content[$locale];
  4335.           } else {
  4336.               $arr[$translation->getSlug()] = $translation->getSlug();
  4337.           }
  4338.       }
  4339.       return $arr;
  4340.   }
  4341.   /**
  4342.   * @Route("/tunnel/venue/infos/{id}", name="framework_front_tunnel_venue_info", requirements={"id" = "([0-9]+)"})
  4343.   */
  4344.   public function venueInfoAction(Request $request$id NULL)
  4345.   {
  4346.     $em $this->getDoctrine()->getManager();
  4347.     $globals $this->get("twig")->getGlobals();
  4348.     $venue $em->getRepository('FrameworkAppBundle:Venue')->findOneBy(['id' => $request->get('id')]);
  4349.     if($venue){
  4350.         $data = [
  4351.           'error' => '',
  4352.           'success' => true,
  4353.           'venueId' => $venue->getId(),
  4354.           'isFull' => $venue->getIsfull(),
  4355.         ];
  4356.       } else {
  4357.         $data = [
  4358.           'error' => 'No venue',
  4359.           'success' => false,
  4360.           'venueId' => null,
  4361.           'isFull' => null,
  4362.         ];
  4363.       }
  4364.     $response = new Response(json_encode($data));
  4365.     $response->headers->set('Content-Type''application/json');
  4366.     return $response;
  4367.   }
  4368. // NEW ARTICLES SHOP
  4369.   /**
  4370.   * @Route("/{locale}/boutique/articles2", name="framework_front_shop_all_2", requirements={"locale" = "([a-z\-0-9]+)"})
  4371.   */
  4372.   public function shop2Action(Request $request$locale NULL$category_slug NULL)
  4373.   {
  4374.     $request->setLocale($locale);
  4375.     $em $this->getDoctrine()->getManager();
  4376.     $globals $this->get("twig")->getGlobals();
  4377.     $locales explode('|'$globals["app_locales"]);
  4378.     $categoryName 'Bons cadeaux';
  4379.     $filter 'all';
  4380.     if( $request->get('f') != null ){
  4381.       $filter $request->get('f');
  4382.     }
  4383.     $page $em->getRepository('FrameworkAppBundle:Page')->findOneBy(['slug' => 'boutique-articles''locale' => $locale]);
  4384.     $categories $em->getRepository('FrameworkShopBundle:Category')->findBy([], ['position' => 'ASC']);
  4385.     $category $em->getRepository('FrameworkShopBundle:Category')->findOneBy(['slug' => $category_slug]);
  4386.     if( $category_slug ){
  4387.       $categoryTmp $em->getRepository('FrameworkAppBundle:Category')->findOneBy(['slug' => $category_slug]);
  4388.       if( $categoryTmp ){
  4389.         $categoryName $categoryTmp->getTitle();
  4390.       }
  4391.     }
  4392.     $bons $em->getRepository('FrameworkShopBundle:Product')->findBy(['category' => 5], ['position' => 'ASC']);
  4393.     $bookmarks $em->getRepository('FrameworkShopBundle:Bookmark')->findBy(['user' => $this->getUser(), 'product' => $bons]);
  4394.     return $this->render('FrontBundle/Page/shop2.html.twig', [
  4395.       'page' => $page,
  4396.       'categories' => $categories,
  4397.       'category' => $category,
  4398.       'category_slug' => $category_slug,
  4399.       'categoryName' => $categoryName,
  4400.       'body' => '',
  4401.       'filter' => $filter,
  4402.       'bons' => $bons,
  4403.       'bookmarks' => $bookmarks,
  4404.       'de_url' => 'shop/articles',
  4405.       'en_url' => 'shop/articles',
  4406.       'fr_url' => 'boutique/articles',
  4407.     ]);
  4408.   }
  4409. // EDIT EXISTING BOOKING
  4410.   
  4411.   /**
  4412.   * @Route("/tunnel/booking/resend", name="tunnel_booking_resend_ajax")
  4413.   * @Route("/tunnel/booking/resend/{locale}", name="tunnel_booking_resend_ajax_locale", requirements={"locale" = "([a-z\-0-9]+)"})
  4414.   */
  4415.   public function bookingResendAction(Request $requestMailerInterface $mailer$locale NULL)
  4416.   {
  4417.     if($locale){
  4418.       $request->setLocale($locale);
  4419.     }
  4420.     $tr $this->loadTranslation($locale);
  4421.     require_once dirname(__FILE__).'/../../plugins/stripe-php-10.12.1/init.php';
  4422.     $success true;
  4423.     $error '';
  4424.     $em $this->getDoctrine()->getManager();
  4425.     $globals $this->get("twig")->getGlobals();
  4426.     $resa $request->get('palace_resa');
  4427.     $infos $request->get('infos');
  4428.     $venue $em->getRepository('FrameworkAppBundle:Venue')->findOneById($resa['show']['id']);
  4429.     $user $this->getUser();
  4430.     if($infos['firstname'] == '' || $infos['lastname'] == '' || $infos['phone'] == '' || $infos['address'] == '' || $infos['zipcode'] == '' || $infos['city'] == '' || $infos['country_code'] == '') {
  4431.         $error $tr['contact_error2'];
  4432.         $success false;
  4433.     } 
  4434.     if( $infos['form_mode'] == 'register' ){
  4435.       if( $em->getRepository('FrameworkAppBundle:User')->findOneBy(['email' => $infos['email']]) ){
  4436.           $error $tr['signup_error1'];
  4437.           $success false;
  4438.       } elseif($infos['email'] == '' || $infos['password'] == '' || $infos['confirm'] == '') {
  4439.           $error $tr['contact_error2'];
  4440.           $success false;
  4441.       } elseif(strlen($infos['password']) < 8) {
  4442.           $error $tr['signup_error2'];
  4443.           $success false;
  4444.       } elseif($infos['password'] != $infos['confirm']) {
  4445.           $error $tr['signup_error3'];
  4446.           $success false;
  4447.       } elseif($infos['agree'] == 'false') {
  4448.           $error $tr['signup_error4'];
  4449.           $success false;
  4450.       }
  4451.     }
  4452.     if( $infos['form_mode'] == 'logged' && $user == null ){
  4453.       $error $tr['signup_error5'];
  4454.       $success false;
  4455.     }
  4456.     if( $infos['gift'] == 'true' && strlen($infos['gift_user']) < ){
  4457.       $error $tr['booking_error1'];
  4458.       $success false;
  4459.     }
  4460.     if( !$venue ){
  4461.       $error $tr['booking_error2'];
  4462.       $success false;
  4463.     } elseif ( $venue->getStart()->getTimestamp() < time() ){
  4464.       $error $tr['booking_error2'];
  4465.       $success false;
  4466.     }
  4467.     $booking $em->getRepository('FrameworkAppBundle:Booking')->findOneById($request->get('booking_id'));
  4468.     if(!$booking){
  4469.      $error 'Réservation invalide';
  4470.      $success false;
  4471.     }
  4472.     if($this->getUser()->getId() != $booking->getUser()->getId()){
  4473.      $error 'Réservation invalide';
  4474.      $success false;
  4475.     }
  4476.     if($success){
  4477.       
  4478.       //RECORD RESA
  4479.       $amount $this->getAmount($resa$venue);
  4480.       $lastBooking =  $em->getRepository('FrameworkAppBundle:Booking')->findOneBy([], ['baseId' => 'DESC']);
  4481.       if($lastBooking){
  4482.         $lastId $lastBooking->getBaseId();
  4483.       } else {
  4484.         $lastId 57530;
  4485.       }
  4486.       $date = new \DateTimeImmutable();
  4487.       $milli = (int)$date->format('Uv');
  4488.       $infos['ip']=$_SERVER['REMOTE_ADDR'];
  4489.       // $booking = new Booking();
  4490.       // $booking->setBaseId($lastId + 1);
  4491.       // $booking->setVenue($venue);
  4492.       // $booking->setUser($user);
  4493.       // $booking->setToken($milli);
  4494.       $booking->setInfos(json_encode($infos));
  4495.       $booking->setCart(json_encode($resa));
  4496.       $booking->setStatus('new');
  4497.       $booking->setState(0);
  4498.       $booking->setAmount(floatval($amount['amount_adam']));
  4499.       $booking->setAmountShow(floatval($amount['amount_show']));
  4500.       $booking->setOptions($booking->getRecap(true));
  4501.       $booking->setLang($locale);
  4502.       $booking->setIsFlash(NULL);
  4503.       $em->persist($booking);
  4504.       $booking->setAction(1);
  4505.       $booking->setAlerting(1);
  4506.       $em->flush();
  4507.             
  4508.             $subject '['.$booking->getBaseId().'] Votre réservation Royal Palace';
  4509.             $title 'Votre réservation Royal Palace';
  4510.             $content '<p>Bonjour,</p>
  4511.                                       <p>Votre demande de réservation <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> à bien été prise en compte. Nos équipes vérifient la disponibilité des prestations souhaitées et reviendrons vers vous par email sous 24 heures (hors dimanches et jours fériés). Un lien de paiement vous sera envoyé par mail et sera également disponible dans votre espace <a href="'.$globals['app_email_domain'].'login">"Mon Compte"</a> de notre site web.</p>
  4512.                                       <p><br>A bientôt au <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  4513.           if($locale == 'de'){
  4514.             $subject '['.$booking->getBaseId().'] Ihre Buchung Royal Palace';
  4515.             $title 'Ihre Buchung Royal Palace';
  4516.             $content '<p>Hallo,</p>
  4517.                                       <p>Ihre Buchungsanfrage <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> wurde erfolgreich bearbeitet. Unsere Mitarbeiter überprüfen die Verfügbarkeit der gewünschten Leistungen und melden sich innerhalb von 24 Stunden (außer an Sonn- und Feiertagen) per E-Mail bei Ihnen zurück. Ein Zahlungslink wird Ihnen per E-Mail zugeschickt und ist auch in Ihrem Bereich <a href="'.$globals['app_email_domain'].'login">"Mein Konto"</a> auf unserer Website verfügbar.</p>
  4518.                                       <p><br>Bis bald im <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  4519.           }
  4520.           if($locale == 'en'){
  4521.             $subject '['.$booking->getBaseId().'] Your reservation at Royal Palace';
  4522.             $title 'Your reservation at Royal Palace';
  4523.             $content '<p>Hello,</p>
  4524.                                       <p>Your reservation request <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> has been processed. Our teams will check the availability of the services you require and get back to you by email within 24 hours (excluding Sundays and public holidays). A payment link will be sent to you by email and will also be available in your <a href="'.$globals['app_email_domain'].'login">"My Account"</a> area of our website.</p>
  4525.                                       <p><br>See you soon at <a href="'.$globals['app_email_domain'].'"><strong>Royal Palace</strong></a></p>';
  4526.           }
  4527.             //ENVOI EMAIL
  4528.             $from $globals['app_email_noreply'];
  4529.             $to $user->getEmail();
  4530.             $contact $globals['app_email_contact'];
  4531.             $email = (new Email())
  4532.                 ->from($from)
  4533.                 ->to($user->getEmail())
  4534.                 //->cc('cc@example.com')
  4535.                 //->bcc('bcc@example.com')
  4536.                 ->replyTo($contact)
  4537.                 //->priority(Email::PRIORITY_HIGH)
  4538.                 ->subject($subject)
  4539.                 // ->text(nl2br('Votre demande de réservation <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong> à bien été prise en compte. Nos équipes vérifient la disponibilité des prestations souhaitées et reviendrons vers vous par email sous 24 heures (hors dimanches et jours fériés). Un lien de paiement vous sera envoyé par mail et sera également disponible dans votre espace "Mon Compte" de notre site web.').nl2br('A bientôt au Royal Palace'))
  4540.                 ->html($this->renderView(
  4541.                             'FrontBundle/Emails/general.html.twig', array(
  4542.                                     'title'   => $title,
  4543.                                     'content' => $content
  4544.                                 )
  4545.                          ));
  4546.             $mailer->send($email);
  4547.             //FIN ENVOI EMAIL
  4548.             // //DESACTIVé SUR DEMANDE DU CLIENT
  4549.             // //ENVOI EMAIL ADMIN ROYAL PALACE
  4550.             // $from = $globals['app_email_noreply'];
  4551.             // $to = $globals['app_email_address'];
  4552.             // $contact = $globals['app_email_contact'];
  4553.             // $email = (new Email())
  4554.             //     ->from($from)
  4555.             //     ->to($to)
  4556.             //     //->cc('cc@example.com')
  4557.             //     //->bcc('bcc@example.com')
  4558.             //     ->replyTo($contact)
  4559.             //     //->priority(Email::PRIORITY_HIGH)
  4560.             //     ->subject('Nouvelle demande de réservation Site Web')
  4561.             //     ->text(nl2br('Nouvelle demande de réservation Site Web'))
  4562.             //     ->html($this->renderView(
  4563.             //                 'FrontBundle/Emails/general.html.twig', array(
  4564.             //                         'title'   => 'Nouvelle demande de réservation Site Web #'.$booking->getBaseId(),
  4565.             //                         'content' => '<p>
  4566.             //                         <strong>'.$resa['show']['title'].' : '.$resa['show']['dateStr'].'</strong><br>
  4567.             //                         '.ucwords(strtolower(trim($infos['firstname']))).' '.strtoupper(trim($infos['lastname'])).'<br>
  4568.             //                         '.$infos['phone'].'<br>
  4569.             //                         '.$infos['email'].'<br>
  4570.             //                         '.trim($infos['address']).' '.trim($infos['zipcode']).' '.trim($infos['city']).' '.trim($infos['country']).'<br>
  4571.             //                         TOTAL : '.$booking->getAmountTotal().'€<br>
  4572.             //                         <a href="'.$globals['app_email_domain'].'backoffrp/resa/'.$booking->getId().'">VOIR LA RESERVATION</a>
  4573.             //                         </p>
  4574.             //                         '
  4575.             //                     )
  4576.             //              ));
  4577.             // $mailer->send($email);
  4578.             // //FIN ENVOI EMAIL ADMIN ROYAL PALACE
  4579.     }
  4580.     $data = [
  4581.       'error' => $error,
  4582.       'success' => $success,
  4583.     ];
  4584.     $response = new Response(json_encode($data));
  4585.     $response->headers->set('Content-Type''application/json');
  4586.     return $response;
  4587.   }
  4588. }