src/Utils/LandingCourse.php line 73

Open in your IDE?
  1. <?php
  2. namespace App\Utils;
  3. use App\Entity\Gos\Country;
  4. use App\Entity\Gos\Coupon;
  5. use App\Entity\Gos\PortalSettings;
  6. use App\Entity\Gos\ProductPack;
  7. use App\Entity\Gos\ProductVariant;
  8. use App\Entity\Gos\User;
  9. use App\Utils\Region\CountryService;
  10. use App\Entity\Gos\Uniqskills\Course;
  11. use App\Entity\Gos\Uniqskills\Landing\Landing;
  12. use App\Entity\Gos\Uniqskills\Landing\LandingModule;
  13. use App\Entity\Gos\Uniqskills\Landing\LandingModuleBoolean;
  14. use App\Entity\Gos\Uniqskills\Landing\LandingModuleFile;
  15. use App\Entity\Gos\Uniqskills\Landing\LandingModuleItem;
  16. use App\Entity\Gos\Uniqskills\Landing\LandingModuleJson;
  17. use App\Entity\Gos\Uniqskills\Landing\LandingModuleText;
  18. use Psr\Log\LoggerInterface;
  19. use DOMDocument;
  20. use Symfony\Component\Filesystem\Filesystem;
  21. use Doctrine\ORM\EntityManagerInterface;
  22. use Symfony\Component\HttpFoundation\Request;
  23. use Symfony\Component\HttpFoundation\RequestStack;
  24. use Symfony\Component\HttpKernel\KernelInterface;
  25. use Symfony\Component\Routing\RouterInterface;
  26. class LandingCourse
  27. {
  28.     protected EntityManagerInterface $em;
  29.     private ?Request $request;
  30.     private LoggerInterface $logger;
  31.     private RouterInterface $router;
  32.     private Geolocation $geolocation;
  33.     private CountryService $countryService;
  34.     private KernelInterface $kernel;
  35.     function __construct(
  36.         EntityManagerInterface $em,
  37.         RequestStack $requestStack,
  38.         LoggerInterface $logger,
  39.         RouterInterface $router,
  40.         Geolocation $geolocation,
  41.         CountryService $countryService,
  42.         KernelInterface $kernel
  43.     ) {
  44.         $this->em           $em;
  45.         $this->request      $requestStack->getCurrentRequest();
  46.         $this->logger       $logger;
  47.         $this->router       $router;
  48.         $this->geolocation  $geolocation;
  49.         $this->countryService $countryService;
  50.         $this->kernel       $kernel;
  51.     }
  52.     /**
  53.      * Prepare all data for displaying on landing page
  54.      */
  55.     public function prepareLandingData(Course $courseUser $user null): array
  56.     {
  57.         if (!$myCountryCode $this->request->getSession()->get('myCountryCode'))
  58.         {
  59.             $myCountryCode $this->geolocation->geolocation()['countryCode'];
  60.             $this->request->getSession()->set('myCountryCode'$myCountryCode);
  61.         }
  62.         $productVariants $this->em->getRepository(ProductVariant::class)->findAllByCourseAndCountryCode(
  63.             $course->getSlug(),
  64.             $myCountryCode
  65.         );
  66.         $productPacks   $this->em->getRepository(ProductPack::class)->findAllWithCourses();
  67.         $config         $this->em->getRepository(PortalSettings::class)->find($this->request->getSession()->get('domain'0));
  68.         if (empty($productVariants))
  69.         {
  70.             $this->logger->error(
  71.                 'NO_COUNTRY: Nie znaleziono wariantów dla kursu '
  72.                 $course->getSlug()
  73.                 . ' dla kraju '
  74.                 $myCountryCode
  75.                 ' ip:'
  76.                 $this->request->server->get('HTTP_X_FORWARDED_FOR')
  77.             );
  78.         }
  79.         if (empty($user) || empty($user->getCountry()))
  80.         {
  81.             $userCountry $this->countryService->getCountry($this->request);
  82.             if (!empty($userCountry))
  83.             {
  84.                 $userCountry $userCountry->getId();
  85.             }
  86.         }
  87.         else
  88.         {
  89.             $userCountry $user->getCountry()->getId();
  90.         }
  91.         if (!empty($productVariants))
  92.         {
  93.             $countryEntity $productVariants[0]->getCountry();
  94.         }
  95.         else
  96.         {
  97.             $countryEntity $this->em->getRepository(Country::class)->findOneBySlug('united-states');
  98.         }
  99.         $courseOrderLinkSub = [];
  100.         $courseGiftLinkSub  = [];
  101.         $productVariantInfo = [];
  102.         /** @var ProductVariant $productVariant */
  103.         foreach ($productVariants as $productVariant)
  104.         {
  105.             $locale $this->request->getSession()->get('userLocale''pl');
  106.             $courseOrderLinkSub[$productVariant->getProductVariantNoComplete()] = $this->router->generate('fmProductCartFrontendAdd', [
  107.                 'productVariantNoComplete' => $productVariant->getProductVariantNoComplete(),
  108.                 'returnCart'    => true,
  109.                 'source'        => 'uniqskills',
  110.                 '_locale'       => $locale
  111.             ]);
  112.             if ($productVariant->getIsGiftable())
  113.             {
  114.                 $courseGiftLinkSub[$productVariant->getProductVariantNoComplete()] = $this->router->generate('fmProductCartFrontendAdd', [
  115.                     'productVariantNoComplete' => $productVariant->getProductVariantNoComplete(),
  116.                     'returnCart'    => true,
  117.                     'source'        => 'uniqskills'
  118.                 ]);
  119.             }
  120.             $productVariantInfo[$productVariant->getId()]                = array();
  121.             $productVariantInfo[$productVariant->getId()]['net']         = $productVariant->getFullPrice('net');
  122.             $productVariantInfo[$productVariant->getId()]['gross']       = $productVariant->getFullPrice('gross');
  123.             $productVariantInfo[$productVariant->getId()]['country']     = $productVariant->getCountry()->getId();
  124.             $productVariantInfo[$productVariant->getId()]['currency']    = $productVariant->getCountry()->getCurrency()->getCode();
  125.             $productVariantInfo[$productVariant->getId()]['access']      = $productVariant->getCountry()->getId() == $userCountry;
  126.         }
  127.         return [
  128.             'config'                => $config,
  129.             'countryEntity'         => $countryEntity,
  130.             'productVariants'       => $productVariants,
  131.             'productPacks'          => $productPacks,
  132.             'courseOrderLinkSub'    => $courseOrderLinkSub,
  133.             'courseGiftLinkSub'     => $courseGiftLinkSub,
  134.             'productVariantInfo'    => $productVariantInfo
  135.         ];
  136.     }
  137.     private function getModuleClassIcon($moduleName): string
  138.     {
  139.         $icons = [
  140.             'basicDescription',
  141.             'description',
  142.             'courseContent',
  143.             'courseProgram',
  144.             'faq',
  145.             'finishCourse',
  146.             'payment',
  147.             'tutors',
  148.             'contact'
  149.         ];
  150.         if (in_array($moduleName$icons))
  151.         {
  152.             return 'bgs2-' $moduleName;
  153.         }
  154.         else
  155.         {
  156.             return '';
  157.         }
  158.     }
  159.     /**
  160.      * Build array with landing data for displaying in frontend
  161.      */
  162.     public function buildLandingData(Landing $landing): array
  163.     {
  164.         /** @var LandingModule $landingModule */
  165.         /** @var LandingModuleFile|LandingModuleJson|LandingModuleBoolean|LandingModuleText $landingModuleItem */
  166.         $landingData = [];
  167.         $landingData['landing'] = $landing;
  168.         //sort by landing module position
  169.         $landingModules = [];
  170.         foreach ($landing->getLandingModules() as $landingModule)
  171.         {
  172.             $landingModules[intval($landingModule->getPosition())] = $landingModule;
  173.         }
  174.         ksort($landingModules);
  175.         foreach ($landingModules as $key => $landingModule)
  176.         {
  177.             $type $landingModule->getLandingModuleType()->getName();
  178.             $landingData['modules'][$key]['showModule']     = $landingModule->getIsVisible();
  179.             $landingData['modules'][$key]['type']           = $type;
  180.             $landingData['modules'][$key]['inSecondMenu']   = $landingModule->getInSecondMenu();
  181.             $landingData['modules'][$key]['id']             = $landingModule->getId();
  182.             $landingData['modules'][$key]['linkIconClass']  = $this->getModuleClassIcon($type);
  183.             foreach ($landingModule->getLandingModuleItems() as $landingModuleItem)
  184.             {
  185.                 $variableName $landingModuleItem->getVariableName();
  186.                 $variableType $landingModuleItem->getVariableType();
  187.                 if ($variableType == 'file')
  188.                 {
  189.                     $landingData['modules'][$key][$variableName] = $landingModuleItem;
  190.                 }
  191.                 elseif ($variableType == 'json')
  192.                 {
  193.                     $landingData['modules'][$key][$variableName]  = $landingModuleItem->getVariableValueDecoded();
  194.                 }
  195.                 else
  196.                 {
  197.                     $landingData['modules'][$key][$variableName]  = $landingModuleItem->getVariableValue();
  198.                 }
  199.             }
  200.         }
  201.         return $landingData;
  202.     }
  203.     /**
  204.      * Generate landing page twig template from index.html
  205.      */
  206.     public function landingCourseGenerationTemplate($course): void
  207.     {
  208.         $path $this->kernel->getProjectDir() . '/public/landing/' $course->getCategory()->getLanguage()->getCode() . '/' $course->getSlug();
  209.         $doc  = new DOMDocument();
  210.         libxml_use_internal_errors(true);
  211.         $html file_get_contents($path '/index.html' );
  212.         // it's a fix to disable moving {{ codeHead }} into a <p> tag
  213.         $html str_replace('{{ codeHead|raw }}''<!-- {{ codeHead|raw }} -->'$html);
  214.         $doc->loadHTML($html);
  215.         $doc  $this->editUrlTags($doc$course'script''src');
  216.         $doc  $this->editUrlTags($doc$course'link''href');
  217.         $doc  $this->editUrlTags($doc$course'img''src');
  218.         $doc  $this->editCourseOrderLinkSub($doc$course);
  219.         $outputHtml $doc->saveHTML();
  220.         $outputHtml str_replace('<!-- {{ codeHead|raw }} -->''{{ codeHead|raw }}'$outputHtml);
  221.         $body rawurldecode($outputHtml);
  222.         $twigPage fopen($path '/index.html.twig'"w");
  223.         fwrite($twigPage$body);
  224.         fclose($twigPage);
  225.     }
  226.     private function editCourseOrderLinkSub($docCourse $course)
  227.     {
  228.         $exists = [];
  229.         foreach ($course->getProductVariants() as $prod)
  230.         {
  231.             $exists[] = $prod->getProductVariantNoComplete();
  232.         }
  233.         $scriptTags $doc->getElementsByTagName('a');
  234.         foreach ($scriptTags as $scriptTag)
  235.         {
  236.             if ($scriptTagSrc $scriptTag->getAttribute('href'))
  237.             {
  238.                 if (preg_match('/courseOrderLinkSub\./'$scriptTagSrc))
  239.                 {
  240.                     $element explode('.'str_replace(['{{''}}'' '], ''$scriptTagSrc));
  241.                     $index $element[1];
  242.                     $fromOldIndex $this->getSubscriptionFromOldUS($index);
  243.                     if ($fromOldIndex and in_array($fromOldIndex$exists))
  244.                     {
  245.                         $scriptTag->setAttribute('href''{{ courseOrderLinkSub[\'' $fromOldIndex '\'] }}');
  246.                     }
  247.                     else
  248.                     {
  249.                         $scriptTag->setAttribute('href''#');
  250.                     }
  251.                 }
  252.             }
  253.         }
  254.         return $doc;
  255.     }
  256.     /**
  257.      * Replace url in landing page
  258.      */
  259.     private function editUrlTags($doc$course$tagName$tagAttribute)
  260.     {
  261.         $scriptTags $doc->getElementsByTagName($tagName);
  262.         foreach ($scriptTags as $scriptTag)
  263.         {
  264.             if ($scriptTagSrc $scriptTag->getAttribute($tagAttribute))
  265.             {
  266.                 if (!preg_match_all('/^http/'$scriptTagSrc))
  267.                 {
  268.                     $scriptTagSrc trim($scriptTagSrc'/');
  269.                     $scriptTag->setAttribute($tagAttribute,
  270.                         'https://' $this->request->getHost() . '/landing/' $course->getCategory()->getLanguage()->getCode() . '/' $course->getSlug() . '/' $scriptTagSrc);
  271.                 }
  272.             }
  273.         }
  274.         return $doc;
  275.     }
  276.     /**
  277.      * Replace old variables price to new
  278.      */
  279.     public function replaceOldVariablesPriceToNew(Course $course): void
  280.     {
  281.         $projectDir     $this->kernel->getProjectDir();
  282.         $courseLanguage $course->getCategory()->getLanguage()->getCode();
  283.         $path           $projectDir '/public/landing/' $courseLanguage '/' $course->getSlug() . '/index.html.twig';
  284.         $body           file_get_contents($path);
  285.         $newPrice       '{% include \'/uniqskills/frontend/price.html.twig\' with {
  286.                                     \'price\': $2,
  287.                                     \'country\': countryEntity,
  288.                                     \'type\': 0} %}';
  289.         $body preg_replace('/(\$*)\{\{( (\(*)subscription.grossPrice(.*?) )\}\}/'$newPrice$body);
  290.         $body preg_replace('/(\$*)\{\{( (\(*)course.defaultPrice(.*?) )\}\}/'$newPrice$body);
  291.         (new Filesystem())->dumpFile($path$body);
  292.     }
  293.     public function appendScriptToBody(Course $course): void
  294.     {
  295.         $projectDir     $this->kernel->getProjectDir();
  296.         $courseLanguage $course->getCategory()->getLanguage()->getCode();
  297.         $path           $projectDir '/public/landing/' $courseLanguage '/' $course->getSlug() . '/index.html.twig';
  298.         $body           file_get_contents($path);
  299.         $content        '<script>window.dataLayer = window.dataLayer || [];
  300.                             window.dataLayer.push({
  301.                             \'course\': ' $course->getId() . '
  302.                             });</script></body>';
  303.         if (!strpos($body$content))
  304.         {
  305.             $body str_replace('</body>'$content$body);
  306.             (new Filesystem())->dumpFile($path$body);
  307.         }
  308.     }
  309.     /**
  310.      * Returns redirect data for course landing
  311.      */
  312.     public function landingRedirect(array $urlParamsCourse $course$locale)
  313.     {
  314.         $slug           $urlParams['slug'];
  315.         $categorySlug   $urlParams['categorySlug'];
  316.         $subCategory    $urlParams['subCategory'];
  317.         $keyword        $urlParams['keyword'];
  318.         if (($courseLocale $course->getCategory()->getLanguage()->getCode()) != $locale)
  319.         {
  320.             return [
  321.                 'route' => 'fmUniqskillsCourseLandingNoCategory',
  322.                 'parameters' => [
  323.                     'slug'      => $slug,
  324.                     '_locale'   => $courseLocale
  325.                 ]
  326.             ];
  327.         }
  328.         if ($course)
  329.         {
  330.             $parentCategory $course->getCategory()->getParent();
  331.             $category       $course->getCategory();
  332.             $mainKeyword    $course->getMainKeyword();
  333.             // hard to redirect it in a different way
  334.             // 301 redirect
  335.             if (
  336.                 (!($subCategory && $keyword) && $parentCategory && $mainKeyword) ||
  337.                 (($parentCategory && $category && $mainKeyword) &&
  338.                     ($categorySlug != $parentCategory->getCategorySlug() || $subCategory != $category->getCategorySlug() ||
  339.                         $keyword != $mainKeyword->getName())
  340.                 )
  341.             )
  342.             {
  343.                 $parameters = [
  344.                     'categorySlug'  => $parentCategory->getCategorySlug(),
  345.                     'subCategory'   => $category->getCategorySlug(),
  346.                     'keyword'       => $mainKeyword->getName(),
  347.                     'slug'          => $course->getSlug()
  348.                 ];
  349.                 //redirect to /main-category/sub-category/course-keyword/slug url format if all needed data is set for course
  350.                 return [
  351.                     'parameters'    => $parameters,
  352.                     'route'         => 'fmUniqskillsCourseLandingExpanded'
  353.                 ];
  354.             }
  355.             elseif
  356.             (
  357.                 (
  358.                     !$parentCategory
  359.                     || !$mainKeyword
  360.                 )
  361.                 && $categorySlug != $course->getCategory()->getCategorySlug()
  362.             )
  363.             {
  364.                 $parameters = [
  365.                     'categorySlug'  => $category->getCategorySlug(),
  366.                     'slug'          => $course->getSlug()
  367.                 ];
  368.                 return [
  369.                     'parameters'    => $parameters,
  370.                     'route'         => 'fmUniqskillsCourseLanding'
  371.                 ];
  372.             }
  373.         }
  374.         if (!$course)
  375.         {
  376.             if ($locale == 'pl')
  377.             {
  378.                 return [
  379.                     'route' => 'fmUniqskillsFrontendPlCourseCataloguePage',
  380.                     'parameters' => []
  381.                 ];
  382.             }
  383.             else
  384.             {
  385.                 return [
  386.                     'route' => 'fmUniqskillsFrontendCourseCataloguePage',
  387.                     'parameters' => []
  388.                 ];
  389.             }
  390.         }
  391.         elseif (!empty($course->getRedirectToUrl()))
  392.         {
  393.             return $course->getRedirectToUrl();
  394.         }
  395.         elseif (!empty($course->getNextCourse()))
  396.         {
  397.             $nextCourse $course->getNextCourse();
  398.             return [
  399.                 'parameters' => [
  400.                     'categorySlug' => $nextCourse->getCategory()->getCategorySlug(),
  401.                     'slug'         => $nextCourse->getSlug()
  402.                 ],
  403.                 'route' => 'fmUniqskillsCourseLanding'
  404.             ];
  405.         }
  406.         elseif (
  407.             !file_exists($this->kernel->getProjectDir() . '/public/landing/' .
  408.                 $course->getCategory()->getLanguage()->getCode() . '/' $course->getSlug() . '/index.html.twig')
  409.             && (
  410.                 $course->getNewLandingPage() === null
  411.                 || !$course->getNewLandingPage()->getIsActive()
  412.             )
  413.         )
  414.         {
  415.             // TODO: kiedyÅ› przenosiÅ‚o na formularz zamówienia ale teraz taki nie istnieje
  416.             return '404';
  417.         }
  418.         return false;
  419.     }
  420.     public function getPromotionBar(Course $course): ?string
  421.     {
  422.         $landing $course->getNewLandingPage();
  423.         $landingPackagePath $this->kernel->getProjectDir() . '/public/landing/' .
  424.             $course->getCategory()->getLanguage()->getCode() . '/' $course->getSlug() . '/index.html.twig';
  425.         if ($landing)
  426.         {
  427.             $promotionBar null;
  428.             foreach ($landing->getLandingModules() as $landingModule)
  429.             {
  430.                 /** @var LandingModule $landingModule */
  431.                 if ($landingModule->getLandingModuleType()->getName() == 'promotionBar')
  432.                 {
  433.                     foreach ($landingModule->getLandingModuleItems() as $landingModuleItem)
  434.                     {
  435.                         /** @var LandingModuleItem $landingModuleItem */
  436.                         if ($landingModuleItem->getVariableName() == 'text')
  437.                         {
  438.                             return $landingModuleItem->getVariableValue();
  439.                         }
  440.                     }
  441.                 }
  442.             }
  443.         }
  444.         elseif (file_exists($landingPackagePath))
  445.         {
  446.             try
  447.             {
  448.                 $dom = new DOMDocument();
  449.                 libxml_use_internal_errors(true);
  450.                 $dom->loadHTMLFile($landingPackagePath);
  451.                 $xpath   = new \DOMXPath($dom);
  452.                 $html    null;
  453.                 $element $xpath->query('//div[@class="promotionBar-content"]')->item(0);
  454.                 if ($element)
  455.                 {
  456.                     $html $element->textContent;
  457.                 }
  458.                 if ($html == '')
  459.                     return null;
  460.                 else
  461.                     return $html;
  462.             }
  463.             catch (\Exception $e)
  464.             {
  465.                 return null;
  466.             }
  467.         }
  468.         return null;
  469.     }
  470.     /**
  471.      * Remove all doms recursivly and returns pure text
  472.      */
  473.     private function packageDomPureText($node$dom)
  474.     {
  475.         $html '';
  476.         if ($node->childNodes)
  477.         {
  478.             foreach ($node->childNodes as $childNode)
  479.             {
  480.                 $html $this->packageDomPureText($childNode$dom);
  481.             }
  482.         }
  483.         else
  484.         {
  485.             $html $dom->saveXML($node);
  486.         }
  487.         return $html;
  488.     }
  489.     private function getSubscriptionFromOldUS($index)
  490.     {
  491.         $old = [
  492.             => '9101/2',
  493.             => '9101/1',
  494.             => '9301/1',
  495.             => '9302/1',
  496.             => '9303/1',
  497.             => '9304/1',
  498.             => '9306/1',
  499.             => '9307/1',
  500.             => '9305/1',
  501.             10 => '9308/1',
  502.             11 => '9103/1',
  503.             12 => '9103/9',
  504.             13 => '9103/5',
  505.             14 => '9103/12',
  506.             15 => '9301/2',
  507.             16 => '9302/2',
  508.             17 => '9304/2',
  509.             18 => '9303/2',
  510.             19 => '9308/2',
  511.             20 => '9306/2',
  512.             21 => '9307/2',
  513.             22 => '9305/2',
  514.             23 => '9309/1',
  515.             24 => '9310/1',
  516.             25 => '9311/1',
  517.             26 => '9312/1',
  518.             27 => '9313/1',
  519.             28 => '9314/1',
  520.             29 => '9315/1',
  521.             30 => '9316/1',
  522.             31 => '9317/1',
  523.             32 => '9318/1',
  524.             33 => '9319/1',
  525.             34 => '9320/4',
  526.             35 => '9321/4',
  527.             36 => '9322/4',
  528.             37 => '9401/2',
  529.             38 => '9402/2',
  530.             39 => '9403/2',
  531.             40 => '9404/2',
  532.             41 => '9405/2',
  533.             42 => '9406/2',
  534.             43 => '9407/2',
  535.             44 => '9408/2',
  536.             45 => '9301/3',
  537.             46 => '9302/3',
  538.             47 => '9304/3',
  539.             48 => '9303/3',
  540.             49 => '9313/2',
  541.             50 => '9314/2',
  542.             51 => '9315/2',
  543.             52 => '9316/2',
  544.             53 => '9317/2',
  545.             60 => '9308/3',
  546.             61 => '9306/3',
  547.             62 => '9307/3',
  548.             63 => '9305/3',
  549.             64 => '9318/2',
  550.             65 => '9319/2',
  551.             66 => '9320/2',
  552.             67 => '9321/2',
  553.             68 => '9322/2',
  554.             75 => '9201/1',
  555.             76 => '9201/2',
  556.             77 => '9409/1',
  557.             78 => '9410/1',
  558.             79 => '9411/1',
  559.             80 => '9412/1',
  560.             81 => '9413/1',
  561.             82 => '9414/1',
  562.             83 => '9415/1',
  563.             84 => '9416/1',
  564.             85 => '8671/1',
  565.             86 => '9105/1',
  566.             87 => '9305/4',
  567.             88 => '9306/4',
  568.             89 => '9307/4',
  569.             90 => '9308/4',
  570.             91 => '9318/3',
  571.             93 => '9320/3',
  572.             94 => '9321/3',
  573.             95 => '9322/3',
  574.             96 => '9301/4',
  575.             97 => '9302/4',
  576.             98 => '9304/4',
  577.             99 => '9303/4',
  578.             100 => '9313/3',
  579.             101 => '9314/3',
  580.             102 => '9315/3',
  581.             103 => '9316/3',
  582.             104 => '9317/3',
  583.             106 => '8673/1',
  584.             107 => '9502/1',
  585.             108 => '9501/1',
  586.             109 => '9507/1',
  587.             110 => '9509/1',
  588.             111 => '9505/1',
  589.             112 => '9106/1',
  590.             113 => '9504/1',
  591.             114 => '9503/1',
  592.             115 => '9105/3',
  593.             116 => '9319/3',
  594.             117 => '9508/1',
  595.             118 => '9323/1',
  596.             119 => '9324/1',
  597.             120 => '9325/1',
  598.             121 => '9326/1',
  599.             122 => '9327/1',
  600.             123 => '9328/1',
  601.             124 => '9329/1',
  602.             125 => '9330/1',
  603.             126 => '9331/1',
  604.             127 => '9350/1',
  605.             128 => '9351/1',
  606.             129 => '9352/1',
  607.             130 => '9353/1',
  608.             131 => '9354/1',
  609.             132 => '9355/1',
  610.             133 => '9356/1',
  611.             134 => '9357/1',
  612.             135 => '9358/1',
  613.             136 => '9417/1',
  614.             137 => '9418/1',
  615.             138 => '9419/1',
  616.             139 => '9420/1',
  617.             140 => '9421/1',
  618.             141 => '9422/1',
  619.             142 => '9423/1',
  620.             143 => '9424/1',
  621.             146 => '9341/1',
  622.             147 => '9342/1',
  623.             148 => '9343/1',
  624.             149 => '9344/1',
  625.             150 => '9345/1',
  626.             151 => '9346/1',
  627.             152 => '9347/1',
  628.             153 => '9348/1',
  629.             154 => '9349/1',
  630.             155 => '9107/1',
  631.             156 => '9506/1',
  632.             157 => '9332/1',
  633.             158 => '9333/1',
  634.             159 => '9334/1',
  635.             160 => '9335/1',
  636.             161 => '9336/1',
  637.             162 => '9337/1',
  638.             163 => '9338/1',
  639.             164 => '9339/1',
  640.             165 => '9340/1',
  641.             166 => '9301/5',
  642.             167 => '9302/5',
  643.             168 => '9303/5',
  644.             169 => '9304/5',
  645.             170 => '9313/4',
  646.             171 => '9314/4',
  647.             172 => '9315/4',
  648.             173 => '9316/4',
  649.             174 => '9317/4',
  650.             175 => '9401/2',
  651.             176 => '9402/2',
  652.             177 => '9403/2',
  653.             178 => '9404/2',
  654.             179 => '9405/2',
  655.             180 => '9435/1',
  656.             181 => '9407/2',
  657.             182 => '9408/2',
  658.             183 => '9432/1',
  659.             184 => '9431/1',
  660.             185 => '9406/2',
  661.             186 => '9434/1',
  662.             187 => '9436/1',
  663.             188 => '9429/1',
  664.             189 => '9428/1',
  665.             190 => '9427/1',
  666.             191 => '9426/1',
  667.             192 => '9425/1',
  668.             193 => '9430/1',
  669.             194 => '9510/1',
  670.             195 => '9107/9',
  671.             196 => '9106/9',
  672.             197 => '9105/9',
  673.             198 => '9512/1',
  674.             199 => '9320/4',
  675.             200 => '9305/5',
  676.             201 => '9322/4',
  677.             202 => '9321/4',
  678.             203 => '9318/4',
  679.             204 => '9308/5',
  680.             205 => '9307/5',
  681.             206 => '9306/5',
  682.             207 => '9319/4',
  683.             208 => '9511/1',
  684.             209 => '9513/1',
  685.             210 => '9433/1',
  686.             211 => '9410/2',
  687.             212 => '9411/2',
  688.             213 => '9412/2',
  689.             214 => '9413/2',
  690.             215 => '9415/2',
  691.             216 => '9416/2',
  692.             217 => '9409/2',
  693.             218 => '9414/2',
  694.             219 => '9514/1',
  695.             220 => '9515/1',
  696.             221 => '9109/1',
  697.             222 => '9109/2',
  698.             223 => '9111/1',
  699.             224 => '9111/2',
  700.             225 => '9516/1',
  701.             226 => '9108/1',
  702.             227 => '9108/2',
  703.             228 => '9110/1',
  704.             229 => '9110/2',
  705.             230 => '9359/1',
  706.             231 => '9360/1',
  707.             232 => '9361/1',
  708.             233 => '9362/1',
  709.             234 => '9363/1',
  710.             235 => '9364/1',
  711.             236 => '9365/1',
  712.             237 => '9366/1',
  713.             238 => '9367/1',
  714.             239 => '9517/1',
  715.             242 => '9518/1',
  716.             243 => '9377/1',
  717.             244 => '9378/1',
  718.             245 => '9379/1',
  719.             246 => '9380/1',
  720.             247 => '9381/1',
  721.             248 => '9382/1',
  722.             249 => '9383/1',
  723.             250 => '9384/1',
  724.             251 => '9385/1',
  725.             252 => '9368/1',
  726.             253 => '9369/1',
  727.             254 => '9370/1',
  728.             255 => '9371/1',
  729.             256 => '9372/1',
  730.             257 => '9373/1',
  731.             258 => '9374/1',
  732.             259 => '9375/1',
  733.             260 => '9376/1',
  734.             261 => '9120/1',
  735.             262 => '9120/2',
  736.             263 => '9120/3',
  737.             264 => '9114/1',
  738.             265 => '9114/2',
  739.             266 => '9114/5',
  740.             267 => '9437/1',
  741.             268 => '9438/1',
  742.             269 => '9439/1',
  743.             270 => '9440/1',
  744.             271 => '9441/1',
  745.             272 => '9445/1',
  746.             273 => '9442/1',
  747.             274 => '9443/1',
  748.             275 => '9444/1',
  749.             276 => '9112/1',
  750.             277 => '9112/2',
  751.             278 => '9114/6',
  752.             279 => '9115/1',
  753.             280 => '9115/2',
  754.             281 => '9521/1',
  755.             282 => '9446/1',
  756.             283 => '9447/1',
  757.             284 => '9448/1',
  758.             285 => '9449/1',
  759.             286 => '9450/1',
  760.             287 => '9451/1',
  761.             288 => '9452/1',
  762.             289 => '9453/1',
  763.             290 => '9454/1',
  764.             291 => '9519/1',
  765.             292 => '9118/1',
  766.             293 => '9118/2',
  767.             294 => '9116/1',
  768.             295 => '9116/2',
  769.             296 => '9386/1',
  770.             297 => '9387/1',
  771.             298 => '9388/1',
  772.             299 => '9389/1',
  773.             300 => '9390/1',
  774.             301 => '9391/1',
  775.             302 => '9392/1',
  776.             303 => '9393/1',
  777.             304 => '9394/1',
  778.             305 => '9522',
  779.             306 => '9523',
  780.             307 => '9395/1',
  781.             308 => '9396/1',
  782.             309 => '9397/1',
  783.             310 => '9398/1',
  784.             311 => '9399/1',
  785.             312 => '93100/1',
  786.             313 => '93101/1',
  787.             314 => '93102/1',
  788.             315 => '93103/1',
  789.             316 => '9524/1',
  790.             317 => '9117/1',
  791.             318 => '9117/2',
  792.             319 => '9123/2',
  793.             320 => '9123/3',
  794.             321 => '9123/4',
  795.             322 => '9122/1',
  796.             323 => '9122/2',
  797.             324 => '91120/1',
  798.             325 => '9119/1',
  799.             326 => '9119/2',
  800.             327 => '9127/1',
  801.             328 => '9127/2',
  802.             329 => '9128/1',
  803.             330 => '9128/2',
  804.             331 => '9415/1',
  805.             332 => '9129/1',
  806.             333 => '9129 /2',
  807.             334 => '9121/1',
  808.             335 => '9126/1',
  809.             336 => '9126/2',
  810.             337 => '9130/1',
  811.             338 => '9130/2',
  812.             339 => '9124/1',
  813.             340 => '9124/2',
  814.             343 => '9132/1',
  815.             344 => '9132',
  816.             345 => '9131/1',
  817.             346 => '9131/2',
  818.             347 => '9464/1',
  819.             348 => '9465/1',
  820.             349 => '9466/1',
  821.             350 => '9467/1',
  822.             351 => '9468/1',
  823.             352 => '9469/1',
  824.             353 => '9470/1',
  825.             354 => '9471/1',
  826.             355 => '9472/1',
  827.             356 => '9153/1',
  828.             357 => '9153/2',
  829.             358 => '9455/1',
  830.             359 => '9456/1',
  831.             360 => '9457/1',
  832.             361 => '9458/1',
  833.             362 => '9459/1',
  834.             363 => '9460/1',
  835.             364 => '9461/1',
  836.             365 => '9462/1',
  837.             366 => '9463/1',
  838.             367 => '9133/1',
  839.             368 => '9133/2',
  840.             371 => '9134/1',
  841.             372 => '9134/2',
  842.             373 => '9137/1',
  843.             374 => '9125/1',
  844.             375 => '9125/2',
  845.             376 => '9475/1',
  846.             377 => '9474/1',
  847.             378 => '9476/1',
  848.             379 => '9477/1',
  849.             380 => '9478/1',
  850.             381 => '9479/1',
  851.             382 => '9480/1',
  852.             383 => '9481/1',
  853.             384 => '9482/1',
  854.             385 => '9137/4',
  855.             386 => '9139/1',
  856.             387 => '9139/2',
  857.             389 => '93104/1',
  858.             390 => '93105/1',
  859.             391 => '93106/1',
  860.             392 => '93107/1',
  861.             393 => '93108/1',
  862.             394 => '93109/1',
  863.             395 => '93110/1',
  864.             396 => '93111/1',
  865.             397 => '93112/1',
  866.             398 => '96001/1',
  867.             399 => '96201/1',
  868.             400 => '96101/1',
  869.             401 => '96002/1',
  870.             402 => '96202/1',
  871.             403 => '96102/1',
  872.             404 => '96003/1',
  873.             405 => '96203/1',
  874.             406 => '96103/1',
  875.             407 => '9136/1',
  876.             408 => '9136/2',
  877.             409 => '9135/1',
  878.             410 => '9135/2',
  879.             411 => '9140/1',
  880.             412 => '9140/2',
  881.             413 => '9141/1',
  882.             414 => '9141/2',
  883.             416 => '9142/1',
  884.             417 => '9142/2',
  885.             418 => '9483/1',
  886.             419 => '9484/1',
  887.             420 => '9485/1',
  888.             421 => '9486/1',
  889.             422 => '9487/1',
  890.             423 => '9488/1',
  891.             424 => '9489/1',
  892.             425 => '9490/1',
  893.             426 => '9491/1',
  894.             427 => '9143/1',
  895.             428 => '9143/2',
  896.             429 => '9144/2',
  897.             430 => '9144/1',
  898.             431 => '9154/1',
  899.             432 => '9137/5',
  900.             435 => '96104',
  901.             436 => '9492/1',
  902.             437 => '9493/1',
  903.             438 => '9494/1',
  904.             439 => '9495/1',
  905.             440 => '9496/1',
  906.             441 => '9497/1',
  907.             442 => '9498/1',
  908.             443 => '9499/1',
  909.             444 => '94100/1',
  910.             445 => '9150/1',
  911.             446 => '9150/2',
  912.             447 => '9147/1',
  913.             448 => '9147/2',
  914.             449 => '9148/1',
  915.             450 => '9151',
  916.             451 => '93113/1',
  917.             452 => '93114/1',
  918.             453 => '93115/1',
  919.             454 => '93116/1',
  920.             455 => '93117/1',
  921.             456 => '93118/1',
  922.             457 => '93119/1',
  923.             458 => '93120/1',
  924.             459 => '93121/1',
  925.             460 => '9151/2',
  926.             461 => '9149/1',
  927.             462 => '9149/2',
  928.             463 => '9152/1',
  929.             464 => '93122/1',
  930.             465 => '93123/1',
  931.             466 => '93124/1',
  932.             467 => '93125/1',
  933.             468 => '93126/1',
  934.             469 => '93127/1',
  935.             470 => '93128/1',
  936.             471 => '93129/1',
  937.             472 => '93130/1',
  938.             473 => '9155/1',
  939.             474 => '9155/2',
  940.             475 => '7916',
  941.             476 => '1761/1',
  942.             477 => '1761/2',
  943.             478 => '93131/1',
  944.             479 => '93132/1',
  945.             480 => '93133/1',
  946.             481 => '93134/1',
  947.             482 => '93135/1',
  948.             483 => '93136/1',
  949.             484 => '93137/1',
  950.             485 => '93138/1',
  951.             487 => '93140/1',
  952.             488 => '93141/1',
  953.             489 => '93142/1',
  954.             490 => '93143/1',
  955.             491 => '93144/1',
  956.             492 => '93145/1',
  957.             493 => '93146/1',
  958.             494 => '93147/1',
  959.             495 => '93148/1',
  960.             496 => '93139/1',
  961.             497 => '9113/1',
  962.             498 => '9113/2',
  963.             499 => '9128/5',
  964.             500 => '93149/1',
  965.             501 => '93150/1',
  966.             502 => '93151/1',
  967.             503 => '93152/1',
  968.             504 => '93153/1',
  969.             505 => '93154/1',
  970.             506 => '93155/1',
  971.             507 => '93156/1',
  972.             508 => '93157/1',
  973.             509 => '9157/1',
  974.             510 => 'product/0',
  975.             511 => '9158/1',
  976.             512 => '9162/2',
  977.             513 => '9162/1',
  978.             514 => '93158/1',
  979.             515 => '93159/1',
  980.             516 => '93160/1',
  981.             517 => '93161/1',
  982.             518 => '93162/1',
  983.             519 => '93163/1',
  984.             520 => '93164/1',
  985.             521 => '93165/1',
  986.             522 => '93166/1',
  987.             525 => '9165/1',
  988.             526 => '9165/2',
  989.             527 => '9164/1',
  990.             528 => '9164/2',
  991.             529 => '9163/1',
  992.             530 => '9163/2',
  993.             531 => '9166/1',
  994.             532 => '9166/2',
  995.             533 => '9159/1',
  996.             534 => '9160/1',
  997.             535 => '9167/1',
  998.             536 => '9167/2',
  999.             537 => '9168111/1',
  1000.             538 => '9168111/2',
  1001.             539 => '9161/1',
  1002.             540 => '9161/2',
  1003.             541 => '9146/1',
  1004.             542 => '9171',
  1005.             543 => '9172/1',
  1006.             544 => '9173/1',
  1007.             545 => '9173/2',
  1008.             546 => '96004/1',
  1009.             547 => '96105/1',
  1010.             548 => '96204/1',
  1011.             549 => '96005/1',
  1012.             550 => '96205/1',
  1013.             551 => '96106/1',
  1014.             552 => '9174/1',
  1015.             553 => 'errrr',
  1016.             555 => '96006/1',
  1017.             556 => '96107/1',
  1018.             557 => '96206/1',
  1019.             558 => '96007/1',
  1020.             559 => '96108/1',
  1021.             560 => '96207',
  1022.             561 => '9170/1',
  1023.             562 => '9170/2',
  1024.             563 => '9176/1',
  1025.             564 => '93167/1',
  1026.             565 => '93168/1',
  1027.             566 => '93169/1',
  1028.             567 => '93170/1',
  1029.             568 => '93171/1',
  1030.             569 => '93172/1',
  1031.             570 => '93173/1',
  1032.             571 => '93174/1',
  1033.             572 => '93175/1',
  1034.             573 => '9179/1',
  1035.             574 => '9179/2',
  1036.             575 => '9175/1',
  1037.             576 => '93176/1',
  1038.             577 => '93177/1',
  1039.             578 => '93178/1',
  1040.             579 => '93179/1',
  1041.             580 => '93180/1',
  1042.             581 => '93181/1',
  1043.             582 => '93182/1',
  1044.             583 => '93183/1',
  1045.             584 => '93184/1',
  1046.             585 => '9182/1',
  1047.             586 => '9182/2',
  1048.             587 => '9181/1',
  1049.             588 => '9156/1',
  1050.             589 => '9156/2',
  1051.             590 => '9180/1',
  1052.             591 => '9180/2',
  1053.             592 => '96109',
  1054.             593 => '96008',
  1055.             594 => '96110',
  1056.             595 => '96009',
  1057.             596 => '96111',
  1058.             597 => '96010',
  1059.             598 => '9185/1',
  1060.             599 => '9185/3',
  1061.             600 => '9185/4',
  1062.             601 => '9185/5',
  1063.             602 => '9184/1',
  1064.             603 => '9184/2',
  1065.             605 => '9186/1',
  1066.             606 => '9187/1',
  1067.             608 => '9202/1',
  1068.             609 => '9202/2',
  1069.             610 => '9169/1',
  1070.             611 => '9203/1',
  1071.             612 => '9203/2',
  1072.             613 => '1766/2',
  1073.             614 => '9204/1',
  1074.             615 => '9204/2',
  1075.             616 => '1766/1',
  1076.             617 => '9205/1',
  1077.             618 => '9205/2',
  1078.             619 => '93185/1',
  1079.             620 => '93186/1',
  1080.             621 => '93187/1',
  1081.             622 => '93188/1',
  1082.             623 => '93189/1',
  1083.             624 => '93190/1',
  1084.             625 => '93191/1',
  1085.             626 => '93192/1',
  1086.             627 => '93193/1',
  1087.             628 => '91100/1',
  1088.             629 => '96112/1',
  1089.             630 => '96011',
  1090.             631 => '96012/1',
  1091.             632 => '96113/1',
  1092.             633 => '93203/1',
  1093.             634 => '93204/1',
  1094.             635 => '93205/1',
  1095.             636 => '93206/1',
  1096.             637 => '93207/1',
  1097.             638 => '93208/1',
  1098.             639 => '93209/1',
  1099.             640 => '93210/1',
  1100.             641 => '93211/1',
  1101.             642 => '96017/1',
  1102.             643 => '96118/1',
  1103.             644 => '93194/1',
  1104.             645 => '93195/1',
  1105.             646 => '93196/1',
  1106.             647 => '93197/1',
  1107.             648 => '93198/1',
  1108.             649 => '93199/1',
  1109.             650 => '93200/1',
  1110.             651 => '93201/1',
  1111.             652 => '93202/1',
  1112.             653 => '96013/1',
  1113.             654 => '96114/1',
  1114.             655 => '96015/1',
  1115.             656 => '96116',
  1116.             657 => '96016/1',
  1117.             658 => '96117/1',
  1118.             659 => '96014/1',
  1119.             660 => '96115/1',
  1120.             661 => '91101/1',
  1121.             662 => '9206/1',
  1122.             663 => '9206/2',
  1123.             664 => '93221/1',
  1124.             665 => '93222/1',
  1125.             666 => '93223/1',
  1126.             667 => '93224/1',
  1127.             668 => '93225/1',
  1128.             669 => '93226/1',
  1129.             670 => '93227/1',
  1130.             671 => '93228/1',
  1131.             672 => '93229/1',
  1132.             673 => '91131/1',
  1133.             674 => '91131/2',
  1134.             675 => '9207/1',
  1135.             676 => '9207/2',
  1136.             677 => '9188/1',
  1137.             678 => '9188/2',
  1138.             679 => '9190/1',
  1139.             680 => '9190/2',
  1140.             681 => '91102/1',
  1141.             682 => '9138/2',
  1142.             683 => '9138/1',
  1143.             684 => '93239/1',
  1144.             685 => '93240/1',
  1145.             686 => '93241/1',
  1146.             687 => '93242/1',
  1147.             688 => '93243/1',
  1148.             689 => '93244/1',
  1149.             690 => '93245/1',
  1150.             691 => '93246/1',
  1151.             692 => '93247/1',
  1152.             693 => '9999/1',
  1153.             694 => '9191/1',
  1154.             695 => '9191/2',
  1155.             698 => '91132/1',
  1156.             699 => '91132/2',
  1157.             700 => '9189/1',
  1158.             701 => '9189/2',
  1159.             702 => '9185/2',
  1160.             703 => '91133/1',
  1161.             704 => '91133/2',
  1162.             705 => '91135/1',
  1163.             706 => '91135/2',
  1164.             707 => '91103/1',
  1165.             708 => '9193/1',
  1166.             709 => '9193/2',
  1167.             710 => '93248/1',
  1168.             711 => '93249/1',
  1169.             712 => '93250/1',
  1170.             713 => '93251/1',
  1171.             714 => '93252/1',
  1172.             715 => '93253/1',
  1173.             716 => '93254/1',
  1174.             717 => '93255/1',
  1175.             718 => '93256/1',
  1176.             719 => '93212/1',
  1177.             720 => '93213/1',
  1178.             721 => '93214/1',
  1179.             722 => '93215/1',
  1180.             723 => '93216/1',
  1181.             724 => '93217/1',
  1182.             725 => '93218/1',
  1183.             726 => '93219/1',
  1184.             727 => '93220/1',
  1185.             728 => '91137/1',
  1186.             729 => '91137/2',
  1187.             730 => '91136/1',
  1188.             731 => '91136/2',
  1189.             732 => '91138/1',
  1190.             733 => '91138/2',
  1191.             734 => '9401',
  1192.             735 => '9188/5',
  1193.             736 => '9188/6',
  1194.             737 => '9188/7',
  1195.             738 => '9188/8',
  1196.             739 => '9188/9',
  1197.             740 => '93257/1',
  1198.             741 => '93258/1',
  1199.             742 => '93259/1',
  1200.             743 => '93260/1',
  1201.             744 => '93261/1',
  1202.             745 => '93262/1',
  1203.             746 => '93263/1',
  1204.             747 => '93264/1',
  1205.             748 => '93265/1',
  1206.             749 => '93212',
  1207.             750 => '93213',
  1208.             751 => '93214',
  1209.             752 => '93215',
  1210.             753 => '93216',
  1211.             754 => '93217',
  1212.             755 => '93218',
  1213.             756 => '93219',
  1214.             757 => '93220',
  1215.             758 => '9192/1',
  1216.             759 => '9192/2',
  1217.             760 => '91140/1',
  1218.             761 => '91140/2',
  1219.             762 => '91139/1',
  1220.             763 => '91139/2',
  1221.             764 => '9195/1',
  1222.             765 => '91144/1',
  1223.             766 => '91144/2',
  1224.             767 => '9208/1',
  1225.             768 => '9208/2',
  1226.             769 => '96301/1',
  1227.             770 => '96401/1',
  1228.             771 => '96501/1',
  1229.             772 => '96601/1',
  1230.             773 => '96701/1',
  1231.             774 => '96801/1',
  1232.             775 => '96901/1',
  1233.             776 => '96302/1',
  1234.             777 => '96402/1',
  1235.             778 => '96502/1',
  1236.             779 => '96602/1',
  1237.             780 => '96702/1',
  1238.             781 => '96802/1',
  1239.             782 => '96902/1',
  1240.             783 => '91141/1',
  1241.             784 => '9196/1',
  1242.             785 => '9196/2',
  1243.             786 => '91104/1',
  1244.             787 => '91143/1',
  1245.             788 => '91143/2',
  1246.             789 => '91142/1',
  1247.             790 => '91142/2',
  1248.             791 => '96303/1',
  1249.             792 => '96403/1',
  1250.             793 => '96503/1',
  1251.             794 => '96603/1',
  1252.             795 => '96703/1',
  1253.             796 => '96803/1',
  1254.             797 => '96903/1',
  1255.             798 => '93275/1',
  1256.             799 => '93276/1',
  1257.             800 => '93277/1',
  1258.             801 => '93278/1',
  1259.             802 => '93279/1',
  1260.             803 => '93280/1',
  1261.             804 => '93281/1',
  1262.             805 => '93282/1',
  1263.             806 => '93283/1',
  1264.             807 => '93266/1',
  1265.             808 => '93267/1',
  1266.             809 => '93268/1',
  1267.             810 => '93269/1',
  1268.             811 => '93270/1',
  1269.             812 => '93271/1',
  1270.             813 => '93272/1',
  1271.             814 => '93273/1',
  1272.             815 => '93274/1',
  1273.             816 => '9197/1',
  1274.             817 => '96702/1',
  1275.             818 => '97102',
  1276.             819 => '97003/1',
  1277.             820 => '97103',
  1278.             821 => '97001/1',
  1279.             822 => '97101/1',
  1280.             823 => '93293/1',
  1281.             824 => '93294/1',
  1282.             825 => '93295/1',
  1283.             826 => '93296/1',
  1284.             827 => '93297/1',
  1285.             828 => '93298/1',
  1286.             829 => '93299/1',
  1287.             830 => '93300/1',
  1288.             831 => '93301/1',
  1289.             832 => '9209/1',
  1290.             833 => '9209/2',
  1291.             834 => '91105/1',
  1292.             835 => '91145/5',
  1293.             836 => '91145/6',
  1294.             837 => '91146/1',
  1295.             838 => '91146/2',
  1296.             839 => '7921',
  1297.             840 => '91147/1',
  1298.             841 => '91147/2',
  1299.             842 => '91148/1',
  1300.             843 => '91148/2',
  1301.             844 => '91170/1',
  1302.             845 => '9210/1',
  1303.             846 => '9210/2',
  1304.             847 => '91150/1',
  1305.             848 => '91150/2',
  1306.             849 => '91106/1',
  1307.             850 => '93284/1',
  1308.             851 => '93285/1',
  1309.             852 => '93286/1',
  1310.             853 => '93287/1',
  1311.             854 => '93288/1',
  1312.             855 => '93289/1',
  1313.             856 => '93290/1',
  1314.             857 => '93291/1',
  1315.             858 => '93292/1',
  1316.             859 => '91153/1',
  1317.             860 => '91153/2',
  1318.             861 => '91107/1',
  1319.             862 => '91108/1',
  1320.             863 => '91108/2',
  1321.             864 => '91149/1',
  1322.             865 => '91149/2',
  1323.             866 => '93302/1',
  1324.             867 => '93303/1',
  1325.             868 => '93304/1',
  1326.             869 => '93305/1',
  1327.             870 => '93306/1',
  1328.             871 => '93307/1',
  1329.             872 => '93308/1',
  1330.             873 => '93309/1',
  1331.             874 => '93310/1',
  1332.             875 => '9211/1',
  1333.             876 => '9211/2',
  1334.             877 => '91154/1',
  1335.             878 => '91154/2',
  1336.             879 => '96906/1',
  1337.             880 => '97006/1',
  1338.             881 => '97106/1',
  1339.             882 => '93311/1',
  1340.             883 => '93312/1',
  1341.             884 => '93313/1',
  1342.             885 => '93314/1',
  1343.             886 => '93315/1',
  1344.             887 => '93316/1',
  1345.             888 => '93317/1',
  1346.             889 => '93318/1',
  1347.             890 => '93319/1',
  1348.             891 => '96904/1',
  1349.             892 => '97004/1',
  1350.             893 => '97104/1',
  1351.             894 => '96909/1',
  1352.             895 => '97009/1',
  1353.             896 => '97109/1',
  1354.             897 => '96905/1',
  1355.             898 => '97005/1',
  1356.             899 => '97105/1',
  1357.             900 => '9212/1',
  1358.             901 => '9212/2',
  1359.             902 => '9213/1',
  1360.             903 => '9213/2',
  1361.             904 => '9214/1',
  1362.             905 => '9214/2',
  1363.             906 => '1768',
  1364.             907 => '1771',
  1365.             908 => '91110/1',
  1366.             909 => '91151/1',
  1367.             910 => '91151/2',
  1368.             911 => '91165/1',
  1369.             912 => '91165/2',
  1370.             913 => '97205/1',
  1371.             914 => '93320/1',
  1372.             915 => '93321/1',
  1373.             916 => '93322/1',
  1374.             917 => '93323/1',
  1375.             918 => '93324/1',
  1376.             919 => '93325/1',
  1377.             920 => '93326/1',
  1378.             921 => '93327/1',
  1379.             922 => '93328/1',
  1380.             923 => '91155/1',
  1381.             924 => '91155/2',
  1382.             925 => '97107/1',
  1383.             926 => '91112/1',
  1384.             927 => '97201/1',
  1385.             928 => '91111/1',
  1386.             929 => '91111/2',
  1387.             930 => '7926',
  1388.             931 => '91156/1',
  1389.             932 => '91156/2',
  1390.             933 => '91113/1',
  1391.             934 => '91157/1',
  1392.             935 => '91157/2',
  1393.             936 => '97202',
  1394.             937 => '97203',
  1395.             938 => '97204',
  1396.             939 => '97205',
  1397.             940 => '97206',
  1398.             941 => '97207',
  1399.             942 => '97208',
  1400.             943 => '97209',
  1401.             944 => '97210',
  1402.             945 => '97211',
  1403.             946 => '97212',
  1404.             947 => '97213',
  1405.             948 => '97214',
  1406.             949 => '97215',
  1407.             950 => '97216',
  1408.             951 => '97217',
  1409.             952 => '97218',
  1410.             953 => '97219',
  1411.             954 => '97220',
  1412.             955 => '97221',
  1413.             956 => '97222',
  1414.             957 => '97223',
  1415.             958 => '97103/2',
  1416.             959 => '93329/1',
  1417.             960 => '93330/1',
  1418.             961 => '93331/1',
  1419.             962 => '93332/1',
  1420.             963 => '93333/1',
  1421.             964 => '93334/1',
  1422.             965 => '93335/1',
  1423.             966 => '93336/1',
  1424.             967 => '93337/1',
  1425.             968 => '97224',
  1426.             969 => '6300',
  1427.             970 => '91116/1',
  1428.             971 => '1767/1',
  1429.             972 => '93338/1',
  1430.             973 => '93339/1',
  1431.             974 => '93340/1',
  1432.             975 => '93341/1',
  1433.             976 => '93342/1',
  1434.             977 => '93343/1',
  1435.             978 => '93344/1',
  1436.             979 => '93345/1',
  1437.             980 => '93346/1',
  1438.             981 => '1772/1',
  1439.             982 => '1772/2',
  1440.             983 => '7927',
  1441.             984 => '93347/1',
  1442.             985 => '93348/1',
  1443.             986 => '93349/1',
  1444.             987 => '93350/1',
  1445.             988 => '93351/1',
  1446.             989 => '93352/1',
  1447.             990 => '93353/1',
  1448.             991 => '93354/1',
  1449.             992 => '93355/1',
  1450.             993 => '91117/1',
  1451.             994 => '91166/1',
  1452.             995 => '91166/2',
  1453.             996 => '91167/1',
  1454.             997 => '91167/2',
  1455.             998 => '91114/1',
  1456.             999 => '91118/1',
  1457.             1000 => '91171/1',
  1458.             1001 => '91171/2',
  1459.             1002 => '91168/1',
  1460.             1003 => '91168/2',
  1461.             1004 => '7923',
  1462.             1005 => '9168/1',
  1463.             1006 => '9168/2',
  1464.             1007 => '91169/1',
  1465.             1008 => '91169/2',
  1466.             1009 => '91192/1',
  1467.             1010 => '91192/2',
  1468.             1011 => '91195/1',
  1469.             1012 => '91195/2',
  1470.             1013 => '91194/1',
  1471.             1014 => '91194/2',
  1472.             1015 => '91198/1',
  1473.             1016 => '91198/2',
  1474.             1017 => '91193/1',
  1475.             1018 => '91193/2',
  1476.             1019 => '91199/1',
  1477.             1020 => '91199/2',
  1478.             1021 => '97225/1',
  1479.             1022 => '91196/1',
  1480.             1023 => '91196/2',
  1481.             1024 => '91191/1',
  1482.             1025 => '1770/1',
  1483.             1026 => '1770/3',
  1484.             1027 => '1770/2',
  1485.             1028 => '91115/1',
  1486.             1029 => '91197/1',
  1487.             1030 => '91197/2',
  1488.             1031 => '6301',
  1489.             1032 => '6301\\2',
  1490.             1033 => '91163/1',
  1491.             1034 => '91163/2',
  1492.             1035 => '91152/1',
  1493.             1036 => '91152/2',
  1494.             1037 => '97402/1',
  1495.             1038 => '91158/1',
  1496.             1039 => '91158/2',
  1497.             1040 => '91159/1',
  1498.             1041 => '91159/2',
  1499.             1042 => '97401/1',
  1500.             1043 => '97405/1',
  1501.             1044 => '97403/1',
  1502.             1045 => '97404/1',
  1503.             1046 => '97406/1',
  1504.             1047 => '97409/1',
  1505.             1048 => '91119/1',
  1506.             1049 => '91119/2',
  1507.             1050 => '9199/1',
  1508.             1051 => '9199/2',
  1509.             1052 => '91201/1',
  1510.             1053 => '97407/1',
  1511.             1054 => '97408/1',
  1512.             1055 => '9198/1',
  1513.             1056 => '9198/2',
  1514.             1057 => '97410/1',
  1515.             1058 => '9122/6',
  1516.             1059 => '9122/7',
  1517.             1060 => '9215/1',
  1518.             1061 => '9215/2',
  1519.             1062 => '91172/1',
  1520.             1063 => '91172/2',
  1521.             1064 => '9128/6',
  1522.             1065 => '9128/7',
  1523.             1066 => '91203/1',
  1524.             1067 => '91203/2',
  1525.             1068 => '93356/1',
  1526.             1069 => '93357/1',
  1527.             1070 => '93358/1',
  1528.             1071 => '93359/1',
  1529.             1072 => '93360/1',
  1530.             1073 => '93361/1',
  1531.             1074 => '93362/1',
  1532.             1075 => '93363/1',
  1533.             1076 => '93364/1',
  1534.             1077 => '9164/1',
  1535.             1078 => '9164/2',
  1536.             1079 => '9165/1',
  1537.             1080 => '9165/2',
  1538.             1081 => '91205/1',
  1539.             1082 => '91205/2',
  1540.             1083 => '97403/2',
  1541.             1084 => '9153/5',
  1542.             1085 => '9153/6',
  1543.             1086 => '91192/6',
  1544.             1087 => '91192/5',
  1545.             1088 => '91195/7',
  1546.             1089 => '91195/6',
  1547.             1090 => '91211/1',
  1548.             1091 => '91211/2',
  1549.             1095 => '91148/6',
  1550.             1096 => '91148/5',
  1551.             1097 => '91208/1',
  1552.             1098 => '91208/2',
  1553.             1099 => '91149/6',
  1554.             1100 => '91149/5',
  1555.             1101 => '91151/6',
  1556.             1102 => '91151/5',
  1557.             1103 => '91159/6',
  1558.             1104 => '91159/5',
  1559.             1105 => '91206/6',
  1560.             1106 => '91206/7',
  1561.             1107 => '9163/5',
  1562.             1108 => '9163/6',
  1563.             1109 => '9167/4',
  1564.             1110 => '9167/5',
  1565.             1111 => '9179/5',
  1566.             1112 => '9179/6',
  1567.             1113 => '91111/5',
  1568.             1114 => '91111/6',
  1569.             1115 => '91152/5',
  1570.             1116 => '91152/6',
  1571.             1117 => '91165/5',
  1572.             1118 => '91165/6',
  1573.             1119 => '91166/5',
  1574.             1120 => '91166/6',
  1575.             1121 => '91169/5',
  1576.             1122 => '91169/6',
  1577.             1124 => '91212/1',
  1578.             1125 => '91212/2',
  1579.             1126 => '91173/1',
  1580.             1127 => '91173/2',
  1581.             1128 => '97411/1',
  1582.             1129 => '97401/1',
  1583.             1130 => '9216/1',
  1584.             1131 => '9216/2',
  1585.             1132 => '91121/1',
  1586.             1133 => '91121/2',
  1587.             1134 => '91198/6',
  1588.             1135 => '91198/7',
  1589.             1136 => '97226',
  1590.             1137 => '91175/1',
  1591.             1138 => '91175/2',
  1592.             1139 => '91164/5',
  1593.             1140 => '91164/6',
  1594.             1141 => '97227',
  1595.             1142 => '91161/1',
  1596.             1143 => '91161/2',
  1597.             1144 => '91162/1',
  1598.             1145 => '91162/2',
  1599.             1146 => '91213/1',
  1600.             1147 => '91213/2',
  1601.             1148 => '91160/1',
  1602.             1149 => '91160/2',
  1603.             1150 => '91214/1',
  1604.             1151 => '91214/2',
  1605.             1152 => '91177/1',
  1606.             1153 => '91177/2',
  1607.             1154 => '91215/1',
  1608.             1155 => '91215/2',
  1609.             1156 => '91216/1',
  1610.             1157 => '91216/2',
  1611.             1158 => '91217/1',
  1612.             1159 => '91217/2',
  1613.             1160 => '93365/1',
  1614.             1161 => '93366/1',
  1615.             1162 => '93367/1',
  1616.             1163 => '93368/1',
  1617.             1164 => '93369/1',
  1618.             1165 => '93370/1',
  1619.             1166 => '93371/1',
  1620.             1167 => '93372/1',
  1621.             1168 => '93373/1',
  1622.             1169 => '91180/1',
  1623.             1170 => '91180/2',
  1624.             1171 => '6302/1',
  1625.             1172 => '6302/2',
  1626.             1173 => '91179/1',
  1627.             1174 => '91179/2',
  1628.             1175 => '91122/1',
  1629.             1176 => '93369/1',
  1630.             1177 => '91221/1',
  1631.             1178 => '91221/2',
  1632.             1179 => '91223/1',
  1633.             1180 => '91223/2',
  1634.             1181 => '93374/1',
  1635.             1182 => '93375/1',
  1636.             1183 => '93376/1',
  1637.             1184 => '93377/1',
  1638.             1185 => '93378/1',
  1639.             1186 => '93379/1',
  1640.             1187 => '93380/1',
  1641.             1188 => '93381/1',
  1642.             1189 => '93382/1',
  1643.             1190 => '91222/1',
  1644.             1191 => '91222/2',
  1645.             1192 => '97229/1',
  1646.             1193 => '97228/1',
  1647.             1194 => '1769',
  1648.             1195 => '91224/1',
  1649.             1196 => '1111',
  1650.             1197 => '93363/1',
  1651.             1198 => '97231/1',
  1652.             1199 => '93342/1',
  1653.             1200 => '7931',
  1654.             1201 => '91178/1',
  1655.             1202 => '91178/2',
  1656.             1203 => '91250/1',
  1657.             1204 => '91250/2',
  1658.             1205 => '91251/1',
  1659.             1206 => '91251/2',
  1660.             1207 => '91182/1',
  1661.             1208 => '91182/2',
  1662.             1209 => '91219/1',
  1663.             1210 => '91219/2',
  1664.             1211 => '7928',
  1665.             1212 => '91181/1',
  1666.             1213 => '91181/2',
  1667.             1214 => '91220/1',
  1668.             1215 => '91220/2',
  1669.             1216 => '91123/1',
  1670.             1217 => '91183/1',
  1671.             1218 => '91183/2',
  1672.             1219 => '9217/1',
  1673.             1220 => '9217/2',
  1674.             1221 => '91225/1',
  1675.             1222 => '91225/2',
  1676.             1223 => '91225/2',
  1677.             1224 => '91125/1',
  1678.             1225 => '91250/6',
  1679.             1226 => '91250/7',
  1680.             1227 => '91251/7',
  1681.             1228 => '91251/6',
  1682.             1229 => '91182/7',
  1683.             1230 => '91182/6',
  1684.             1231 => '91226/1',
  1685.             1232 => '91226/2',
  1686.             1233 => '97230/1',
  1687.             1234 => '93383/1',
  1688.             1235 => '93384/1',
  1689.             1236 => '93385/1',
  1690.             1237 => '93386/1',
  1691.             1238 => '93387/1',
  1692.             1239 => '93388/1',
  1693.             1240 => '93389/1',
  1694.             1241 => '93390/1',
  1695.             1242 => '93391/1',
  1696.             1243 => '97234/1'
  1697.         ];
  1698.         if(isset($old[$index]))
  1699.         {
  1700.             return $old[$index];
  1701.         }
  1702.         return false;
  1703.     }
  1704.     public function calcDateDiff(?\DateTimeInterface $date1, ?\DateTimeInterface $date2)
  1705.     {
  1706.         if ($date1 === null || $date2 === null)
  1707.         {
  1708.             return false;
  1709.         }
  1710.         return $date1->getTimestamp() - $date2->getTimestamp();
  1711.     }
  1712.     public function dateInBetween(\DateTimeInterface $date\DateTimeInterface $startDate\DateTimeInterface $endDate): bool
  1713.     {
  1714.         return ($this->calcDateDiff($date$startDate) > 0) && ($this->calcDateDiff($endDate$date) > 0);
  1715.     }
  1716.     public function getFreeLessonsInCourse($modules): array
  1717.     {
  1718.         $freeLessonsInCourse = [];
  1719.         foreach ($modules as $module)
  1720.         {
  1721.             if (isset($module['list']))
  1722.             {
  1723.                 foreach ($module['list'] as $list)
  1724.                 {
  1725.                     if (isset($list['list']))
  1726.                     {
  1727.                         foreach ($list['list'] as $item)
  1728.                         {
  1729.                             if (isset($item['free']))
  1730.                             {
  1731.                                 $freeLessonsInCourse[] = [
  1732.                                     'link' => $item['free'],
  1733.                                     'title' => $item['title'],
  1734.                                     'isVimeo' => (strpos($item['free'], 'vimeo.com') === false) ? false true,
  1735.                                     'isBbVideo' => !((strpos($item['free'], 'bbvms.com') === false)),
  1736.                                 ];
  1737.                             }
  1738.                         }
  1739.                     }
  1740.                 }
  1741.             }
  1742.         }
  1743.         return $freeLessonsInCourse;
  1744.     }
  1745.     public function getCouponDataStartFromCourse(ProductVariant $productVariantCourse $course)
  1746.     {
  1747.         $dateTo null;
  1748.         $subscriptionInfoFromLanding $this->em->getRepository(LandingModuleItem::class)
  1749.             ->findOneByCourseAndVariableName($course,'subscriptions''payment');
  1750.         if (isset($subscriptionInfoFromLanding['variableValue']) && !empty($subscriptionInfoFromLanding['variableValue']))
  1751.         {
  1752.             $data json_decode($subscriptionInfoFromLanding['variableValue'], true);
  1753.             foreach ($data as $item)
  1754.             {
  1755.                 if (isset($item['subscription']) && $item['subscription'] == $productVariant->getId())
  1756.                 {
  1757.                     if (isset($item['discountCode']) && !empty($item['discountCode']))
  1758.                     {
  1759.                         $coupon $this->em->getRepository(Coupon::class)->find($item['discountCode']);
  1760.                         if ($coupon$dateTo = clone $coupon->getDateFrom();
  1761.                     }
  1762.                     break;
  1763.                 }
  1764.             }
  1765.         }
  1766.         return $dateTo;
  1767.     }
  1768. }