src/ApplicationBundle/Modules/MarketPlace/Controller/MarketPlacePublicController.php line 145

Open in your IDE?
  1. <?php
  2. namespace ApplicationBundle\Modules\MarketPlace\Controller;
  3. use ApplicationBundle\Constants\EmployeeConstant;
  4. use ApplicationBundle\Constants\GeneralConstant;
  5. use ApplicationBundle\Controller\GenericController;
  6. use ApplicationBundle\Modules\Authentication\Constants\UserConstants; use ApplicationBundle\Modules\Api\Constants\ApiConstants;
  7. use ApplicationBundle\Modules\Buddybee\Buddybee;
  8. use ApplicationBundle\Modules\System\MiscActions;
  9. use ApplicationBundle\Modules\User\Company;
  10. use ApplicationBundle\Modules\Inventory\Inventory;
  11. use CompanyGroupBundle\Entity\EntityCreateTopic;
  12. use CompanyGroupBundle\Entity\EntityInvoice;
  13. use CompanyGroupBundle\Entity\EntityMeetingSession;
  14. use Endroid\QrCode\Builder\BuilderInterface;
  15. use Endroid\QrCodeBundle\Response\QrCodeResponse;
  16. use Ps\PdfBundle\Annotation\Pdf;
  17. use Symfony\Component\HttpFoundation\JsonResponse;
  18. use Symfony\Component\HttpFoundation\Request;
  19. use CompanyGroupBundle\Entity\EntityApplicantDetails;
  20. use Symfony\Component\Routing\Generator\UrlGenerator;
  21. class MarketPlacePublicController extends GenericController
  22. {
  23.     // home
  24.     public function HomeViewAction(Request $request$id 0)
  25.     {
  26.         $em $this->getDoctrine()->getManager();
  27.         $companyId $this->getLoggedUserCompanyId($request);
  28.         $company_data Company::getCompanyData($em$companyId);
  29.         $products $em->getRepository('ApplicationBundle\\Entity\\InvProducts')->findOneBy(
  30.             array(
  31.                 'id' => $id
  32.             )
  33.         );
  34.         $dataArray = array(
  35.             'page_title' => 'Home',
  36.             'company_data' => $company_data,
  37.             'products' => $products,
  38.             'brandList' => Inventory::GetBrandList($em$companyId),
  39.             'igList' => Inventory::ItemGroupList($em$companyId)
  40.         );
  41.         return $this->render('@MarketPlace/pages/views/market_place_home_view.html.twig'$dataArray
  42.         );
  43.     }
  44.     public function CompareProductViewAction(Request $request)
  45.     {
  46.         $em $this->getDoctrine()->getManager();
  47.         if ($request->get('returnJson'0) == 1) {
  48.             $pids $request->get('pIds', []);
  49.             $tempProductData $em->getRepository('ApplicationBundle\\Entity\\InvProducts')
  50.                 ->findBy(
  51.                     array(
  52.                         'id' => $pids
  53.                     )
  54.                 );
  55.             // For FIFO structure
  56.             $productDataObjects = [];
  57.             foreach ($pids as $pid) {
  58.                 foreach ($tempProductData as $tempProduct) {
  59.                     if ($tempProduct->getId() == $pid) {
  60.                         $productDataObjects[] = $tempProduct;
  61.                         break;
  62.                     }
  63.                 }
  64.             }
  65.             $data = [];
  66.             $specIds = [];
  67.             $specListById = [];
  68.             foreach ($productDataObjects as $productDataObject) {
  69.                 $specData = [];
  70.                 $tempSpecData json_decode($productDataObject->getSpecData(), true);
  71.                 if ($tempSpecData == null$tempSpecData = [];
  72.                 foreach ($tempSpecData as $indSpecData) {
  73.                     $specData[$indSpecData['id']] = [
  74.                         'id' => $indSpecData['id'],
  75.                         'value' => $indSpecData['value']
  76.                     ];
  77.                     if (!in_array($indSpecData['id'], $specIds))
  78.                         $specIds[] = $indSpecData['id'];
  79.                 }
  80.                 $d = array(
  81.                     'id' => $productDataObject->getId(),
  82.                     'name' => $productDataObject->getName(),
  83.                     'defaultImage' => $productDataObject->getDefaultImage(),
  84.                     'specData' => $specData,
  85.                 );
  86.                 $data[] = $d;
  87.             }
  88.             $specList $em->getRepository('ApplicationBundle\\Entity\\SpecType')
  89.                 ->findBy(
  90.                     array(
  91.                         'id' => $specIds
  92.                     )
  93.                 );
  94.             $specListById = [];
  95.             foreach ($specList as $specHere) {
  96.                 $specListById[$specHere->getId()] = $specHere->getName();
  97.             }
  98.             return new JsonResponse(array('data' => $data'specListById' => $specListById'specIds' => $specIds));
  99.             //            foreach ($specData as $specDatum){
  100.             //                $finSpecData[]=[
  101.             //                    'id' => $specDatum['id'],
  102.             //                    'name' => isset($specListById[$specDatum['id']])?$specListById[$specDatum['id']]:'',
  103.             //                    'value' => $specDatum['value']
  104.             //                ];
  105.             //            }
  106.         }
  107.         return $this->render('@MarketPlace/pages/views/market_place_compare_products.html.twig',
  108.             array(
  109.                 'page_title' => 'Compare Products',
  110.             ));
  111.     }
  112.     // about us
  113.     public function AboutUsViewAction()
  114.     {
  115.         return $this->render('@MarketPlace/pages/views/market_place_about_us.html.twig',
  116.             array(
  117.                 'page_title' => 'About Us',
  118.             ));
  119.     }
  120.     // our product
  121.     public function ProductListAction(Request $request$id 0)
  122.     {
  123.         $em $this->getDoctrine()->getManager();
  124.         $companyId $this->getLoggedUserCompanyId($request);
  125.         $company_data Company::getCompanyData($em$companyId);
  126.         $products $em->getRepository('ApplicationBundle\\Entity\\InvProducts')->findOneBy(
  127.             array(
  128.                 'id' => $id
  129.             )
  130.         );
  131.         $dataArray = array(
  132.             'page_title' => 'Our Product',
  133.             'company_data' => $company_data,
  134.             'products' => $products,
  135.             'brandList' => Inventory::GetBrandList($em$companyId),
  136.             'igList' => Inventory::ItemGroupList($em$companyId)
  137.         );
  138.         return $this->render('@MarketPlace/pages/list/market_place_product_list.html.twig'$dataArray
  139.         );
  140.     }
  141.     // our prpject
  142.     public function OurProjectAction()
  143.     {
  144.         return $this->render('@MarketPlace/pages/views/market_place_our_project.html.twig',
  145.             array(
  146.                 'page_title' => 'Our Project',
  147.             )
  148.         );
  149.     }
  150.     // single project
  151.     public function SingleProjectAction()
  152.     {
  153.         return $this->render('@MarketPlace/pages/views/market_place_single_project.html.twig',
  154.             array(
  155.                 'page_title' => 'Project Details',
  156.             )
  157.         );
  158.     }
  159.     // single product
  160.     public function ProductViewAction(Request $request$id 0)
  161.     {
  162.         $em $this->getDoctrine()->getManager();
  163.         $companyId $this->getLoggedUserCompanyId($request);
  164.         $company_data Company::getCompanyData($em$companyId);
  165.         $data = [];
  166.         $ex_id $id;
  167.         $specData = [];
  168.         $specIds = [];
  169.         $productData $em->getRepository('ApplicationBundle\\Entity\\InvProducts')
  170.             ->findOneBy(
  171.                 array(
  172.                     'id' => $id,
  173.                 )
  174.             );
  175.         if ($productData) {
  176.             $tempSpecData json_decode($productData->getSpecData(), true);
  177.             if ($tempSpecData == null) {
  178.                 $tempSpecData = [];
  179.             }
  180.             foreach ($tempSpecData as $indx) {
  181.                 $specData[] = [
  182.                     'id' => $indx['id'],
  183.                     'value' => $indx['value'],
  184.                 ];
  185.                 $specIds[] = $indx['id'];
  186.             }
  187.         }
  188.         $specList $em->getRepository('ApplicationBundle\\Entity\\SpecType')->findBy(
  189.             array(
  190.                 'id' => $specIds
  191.             )
  192.         );
  193.         $specListById = [];
  194.         foreach ($specList as $specDatum) {
  195.             $specListById[$specDatum->getId()] = $specDatum->getName();
  196.         }
  197.         $finSpecData = [];
  198.         foreach ($specData as $specDatum) {
  199.             $finSpecData[] = [
  200.                 'id' => $specDatum['id'],
  201.                 'name' => isset($specListById[$specDatum['id']]) ? $specListById[$specDatum['id']] : '',
  202.                 'value' => $specDatum['value'],
  203.             ];
  204.         }
  205.         $productFdm $productData->getProductFdm();
  206.         preg_match('/SZ(\d+)/'$productFdm$szMatch);
  207.         preg_match('/SO(\d+)/'$productFdm$soMatch);
  208.         preg_match('/ST(\d+)/'$productFdm$stMatch);
  209.         preg_match('/SH(\d+)/'$productFdm$shMatch);
  210.         $subCategoryZeroId $szMatch[1] ?? null;
  211.         $subCategoryOneId $soMatch[1] ?? null;
  212.         $subCategoryTwoId $stMatch[1] ?? null;
  213.         $subCategoryThreeId $shMatch[1] ?? null;
  214.         //        dump($subCategoryOneId);
  215.         $currInvList $em->getRepository('ApplicationBundle\\Entity\\InventoryStorage')
  216.             ->findBy(
  217.                 array(
  218.                     'productId' => $id
  219.                 )
  220.             );
  221.         $trans_history $em->getRepository('ApplicationBundle\\Entity\\InvItemTransaction')
  222.             ->findBy(
  223.                 array(
  224.                     'productId' => $id
  225.                 ), array(
  226.                     'transactionDate' => 'ASC',
  227.                     'id' => 'ASC'
  228.                 )
  229.             );
  230.         $igData $em->getRepository('ApplicationBundle\\Entity\\InvItemGroup')
  231.             ->findOneBy(array(
  232.                 'id' => $productData->getIgId(),
  233.             ));
  234.         $itemGroupList = [];
  235.         $categorizationData json_decode($igData->getCategorizationData(), true) ??
  236.             [
  237.                 ["alias" => "Category""en" => 1"inc" => "1"],
  238.                 ["alias" => "Sub Category""en" => 1"inc" => "1"],
  239.             ];
  240.         $subCategoryTypes $em->getRepository('ApplicationBundle\\Entity\\InvProductSubCategories')
  241.             ->findBy(array(
  242.                 'id' => [$subCategoryZeroId$subCategoryOneId$subCategoryTwoId$subCategoryThreeId],
  243.             ));
  244.         $subCategoryTypeList = [];
  245.         foreach ($subCategoryTypes as $sc) {
  246.             $subCategoryTypeList[$sc->getId()] = $sc->getName();
  247.         }
  248.         $productDataObj = array();
  249.         if ($request->isMethod('POST') && $request->request->has('returnJson')) {
  250.             $getters array_filter(get_class_methods($productData), function ($method) {
  251.                 return 'get' === substr($method03);
  252.             });
  253.             foreach ($getters as $getter) {
  254.                 if ($getter == 'getGlobalId')
  255.                     continue;
  256.                 $Fieldname str_replace('get'''$getter);
  257.                 $productDataObj[$Fieldname] = $productData->{$getter}(); // `foo!`
  258.             }
  259.             if ($request->request->has('genInfoOnly') && $request->request->get('genInfoOnly') == 1) {
  260.                 $dataArray = array(
  261.                     'success' => true,
  262.                     'page_title' => 'Product Details',
  263.                     'company_data' => $company_data,
  264.                     'ex_id' => $ex_id,
  265.                     'productData' => $productData,
  266.                     'productDataObj' => $productDataObj,
  267.                     'defaultImageAppendUrl' => '/uploads/Products/',
  268.                 );
  269.             } else {
  270.                 $dataArray = array(
  271.                     'success' => true,
  272.                     'page_title' => 'Product Details',
  273.                     'og_title' => $productDataObj->getName(),
  274.                     'og_image' => $productDataObj->getDefaultImage(),
  275.                     'company_data' => $company_data,
  276.                     'ex_id' => $ex_id,
  277.                     'productData' => $productData,
  278.                     'productDataObj' => $productDataObj,
  279.                     'finSpecData' => $finSpecData,
  280.                     'currInvList' => $currInvList,
  281.                     'trans_history' => $trans_history,
  282.                     'entityList' => GeneralConstant::$Entity_list_details,
  283.                     'itemGroupList' => $itemGroupList,
  284.                     'categorizationData' => $categorizationData,
  285.                     'products' => Inventory::ProductList($this->getDoctrine()->getManager()),
  286.                     'subCategoryList' => $subCategoryTypeList,
  287.                     'categoryList' => Inventory::ProductCategoryList($em$companyId),
  288.                     'igList' => Inventory::ItemGroupList($em$companyId),
  289.                     'unitList' => Inventory::UnitTypeList($em),
  290.                     'brandList' => Inventory::GetBrandList($em$companyId),
  291.                     'warehouse_action_list' => Inventory::warehouse_action_list($em$this->getLoggedUserCompanyId($request), 'object'),
  292.                     'warehouseList' => Inventory::WarehouseList($em),
  293.                     'defaultImageAppendUrl' => '/uploads/Products/',
  294.                 );
  295.             }
  296.             return new JsonResponse(
  297.                 $dataArray
  298.             );
  299.         }
  300.         $dataArray = array(
  301.             'page_title' => 'Product Details',
  302.             'company_data' => $company_data,
  303.             'ex_id' => $ex_id,
  304.             'productData' => $productData,
  305.             'finSpecData' => $finSpecData,
  306.             'currInvList' => $currInvList,
  307.             'trans_history' => $trans_history,
  308.             'entityList' => GeneralConstant::$Entity_list_details,
  309.             'productList' => Inventory::ProductList($em$companyId),
  310.             'itemGroupList' => $itemGroupList,
  311.             'categorizationData' => $categorizationData,
  312.             'subCategoryZeroId' => $subCategoryZeroId,
  313.             'subCategoryOneId' => $subCategoryOneId,
  314.             'subCategoryTwoId' => $subCategoryTwoId,
  315.             'subCategoryThreeId' => $subCategoryThreeId,
  316.             //'productList' => Inventory::ProductList($em, $companyId),
  317.             'products' => Inventory::ProductList($this->getDoctrine()->getManager()),
  318.             'subCategoryList' => $subCategoryTypeList,
  319.             'categoryList' => Inventory::ProductCategoryList($em$companyId),
  320.             'igList' => Inventory::ItemGroupList($em$companyId),
  321.             'unitList' => Inventory::UnitTypeList($em),
  322.             'spec_type' => Inventory::SpecTypeList($this->getDoctrine()->getManager()),
  323.             'brandList' => Inventory::GetBrandList($em$companyId),
  324.             'warehouse_action_list' => Inventory::warehouse_action_list($em$this->getLoggedUserCompanyId($request), 'object'),
  325.             'warehouseList' => Inventory::WarehouseList($em),
  326.         );
  327.         return $this->render('@MarketPlace/pages/views/market_place_product_view.html.twig'$dataArray
  328.         );
  329.     }
  330.     // ** list related page **
  331.     // customer plant
  332.     public function CustomerPlantViewAction()
  333.     {
  334.         return $this->render('@MarketPlace/pages/list/market_place_build_customer_plant_list.html.twig',
  335.             array(
  336.                 'page_title' => 'Build Customer plant',
  337.             ));
  338.     }
  339.     // *****sofia project started*****
  340.     // sign in page
  341.     public function SofiaSignIn()
  342.     {
  343.         return $this->render('@MarketPlace/pages/views/sofia_login.html.twig',
  344.             array(
  345.                 'page_title' => 'Sofia Login',
  346.             ));
  347.     }
  348.     // sign up page
  349.     public function SofiaSignUp()
  350.     {
  351.         return $this->render('@MarketPlace/pages/views/sofia_signup.html.twig',
  352.             array(
  353.                 'page_title' => 'Sofia Signup',
  354.             ));
  355.     }
  356.     // confirmation
  357.     public function SofiaConfirmation()
  358.     {
  359.         return $this->render('@MarketPlace/pages/views/sofia_confirmation.html.twig',
  360.             array(
  361.                 'page_title' => 'Sofia Confirmation',
  362.             ));
  363.     }
  364.     // create site
  365.     public function SofiaCreatesite()
  366.     {
  367.         return $this->render('@MarketPlace/pages/views/sofia_create_site.html.twig',
  368.             array(
  369.                 'page_title' => 'Create Site',
  370.             ));
  371.     }
  372.     // dashboard details
  373.     public function SofiaDashboardDetails()
  374.     {
  375.         return $this->render('@MarketPlace/pages/views/sofia_dashboard_details.html.twig',
  376.             array(
  377.                 'page_title' => 'Create Site',
  378.             ));
  379.     }
  380.     private function normalizeDashboardSiteType($site)
  381.     {
  382.         $siteType method_exists($site'getSiteType') ? strtoupper(trim((string)$site->getSiteType())) : '';
  383.         if ($siteType === '') {
  384.             return 'SOPHIA';
  385.         }
  386.         return in_array($siteType, array('SOPHIA''HYBRID_EMS''AGRI_PV'), true) ? $siteType 'SOPHIA';
  387.     }
  388.     private function dbDateTimeToTimestamp($value)
  389.     {
  390.         if (!$value) {
  391.             return 0;
  392.         }
  393.         try {
  394.             return (int)(new \DateTime((string)$value, new \DateTimeZone('UTC')))->format('U');
  395.         } catch (\Exception $exception) {
  396.             return 0;
  397.         }
  398.     }
  399.     private function fetchOneRow($conn$sql, array $params)
  400.     {
  401.         if (method_exists($conn'fetchAssociative')) {
  402.             return $conn->fetchAssociative($sql$params);
  403.         }
  404.         if (method_exists($conn'fetchAssoc')) {
  405.             return $conn->fetchAssoc($sql$params);
  406.         }
  407.         return false;
  408.     }
  409.     private function getLatestCloudHeartbeatTimestamp($em_goc$siteId)
  410.     {
  411.         try {
  412.             $row $this->fetchOneRow(
  413.                 $em_goc->getConnection(),
  414.                 'SELECT last_seen_at FROM cloud_site_heartbeat WHERE site_uid = :site_uid ORDER BY last_seen_at DESC LIMIT 1',
  415.                 array('site_uid' => (string)$siteId)
  416.             );
  417.             return $row $this->dbDateTimeToTimestamp($row['last_seen_at'] ?? null) : 0;
  418.         } catch (\Exception $exception) {
  419.             return 0;
  420.         }
  421.     }
  422.     private function getLatestCloudSyncTimestamp($em_goc$siteId)
  423.     {
  424.         try {
  425.             $row $this->fetchOneRow(
  426.                 $em_goc->getConnection(),
  427.                 'SELECT updated_at FROM cloud_site_bundle_import_ledger WHERE site_uid = :site_uid AND status = :status ORDER BY updated_at DESC LIMIT 1',
  428.                 array('site_uid' => (string)$siteId'status' => 'ok')
  429.             );
  430.             return $row $this->dbDateTimeToTimestamp($row['updated_at'] ?? null) : 0;
  431.         } catch (\Exception $exception) {
  432.             return 0;
  433.         }
  434.     }
  435.     private function buildSiteHeartbeatState($em_goc$site$lastDataSince)
  436.     {
  437.         $siteType $this->normalizeDashboardSiteType($site);
  438.         $heartbeatSince $this->getLatestCloudHeartbeatTimestamp($em_goc$site->getId());
  439.         $cloudSyncSince $this->getLatestCloudSyncTimestamp($em_goc$site->getId());
  440.         $sourceSince 0;
  441.         $source 'none';
  442.         $sourceLabel 'No heartbeat';
  443.         $threshold 120;
  444.         if ($heartbeatSince && $heartbeatSince >= $cloudSyncSince) {
  445.             $sourceSince $heartbeatSince;
  446.             $source 'controller_heartbeat';
  447.             $sourceLabel 'Controller heartbeat';
  448.             $threshold 600;
  449.         } elseif ($cloudSyncSince 0) {
  450.             $sourceSince $cloudSyncSince;
  451.             $source 'cloud_bundle_sync';
  452.             $sourceLabel 'Cloud bundle sync';
  453.             $threshold 1800;
  454.         } elseif ($siteType !== 'HYBRID_EMS' && (int)$lastDataSince 0) {
  455.             $sourceSince = (int)$lastDataSince;
  456.             $source 'telemetry_timestamp_fallback';
  457.             $sourceLabel 'Telemetry timestamp fallback';
  458.             $threshold 120;
  459.         }
  460.         $now time();
  461.         $online $sourceSince && $sourceSince <= ($now 60) && (($now $sourceSince) <= $threshold);
  462.         return array(
  463.             'siteType' => $siteType,
  464.             'heartbeatSince' => $sourceSince,
  465.             'heartbeatOnline' => $online,
  466.             'heartbeatSource' => $source,
  467.             'heartbeatSourceLabel' => $sourceLabel,
  468.             'heartbeatThreshold' => $threshold,
  469.             'controllerHeartbeatSince' => $heartbeatSince,
  470.             'cloudSyncSince' => $cloudSyncSince,
  471.         );
  472.     }
  473.     // dashboard admin
  474.     public function SofiaDashboardCheckSiteHeartbeat(Request $request$id 0)
  475.     {
  476.         $em_goc $this->getDoctrine()->getManager('company_group');
  477.         $sitesQry $em_goc
  478.             ->getRepository("CompanyGroupBundle\\Entity\\EmsSite")
  479.             ->findBy(array(
  480.                 'id' => $request->get('site_ids')
  481.             ));
  482.         $sites = [];
  483.         foreach ($sitesQry as $site) {
  484.             $siteDT = array(
  485.                 'siteId' => $site->getId(),
  486.                 'siteName' => $site->getSiteName(),
  487.                 'siteNote' => $site->getSiteNote(),
  488.                 'siteLocation' => $site->getSiteLocation(),
  489.                 'address' => $site->getAddress(),
  490.                 'siteActive' => 0,
  491.                 'lastDataSince' => 0,
  492.             );
  493.             $siteDataQry $em_goc
  494.                 ->getRepository("CompanyGroupBundle\\Entity\\DeviceSensorData")
  495.                 ->findOneBy(array(
  496.                     'siteId' => $site->getId(),
  497.                 ), array(
  498.                     'timestampTs' => 'DESC'
  499.                 ));
  500.             if ($siteDataQry) {
  501.                 $siteDT['lastDataSince'] = $siteDataQry->getTimestampTs();
  502.             }
  503.             $siteDT array_merge($siteDT$this->buildSiteHeartbeatState($em_goc$site$siteDT['lastDataSince']));
  504.             $sites[] = $siteDT;
  505.         }
  506.         return new JsonResponse(array(
  507.             'success' => true,
  508.             'sites' => $sites,
  509.             'siteIds' =>  $request->get('site_ids'),
  510.         ));
  511.     }
  512.     public function SofiaDashboardAdmin()
  513.     {
  514.         $em_goc $this->getDoctrine()->getManager('company_group');
  515.         $sitesQry $em_goc
  516.             ->getRepository("CompanyGroupBundle\\Entity\\EmsSite")
  517.             ->findBy(array());
  518.         $sites = [];
  519.         $siteIds = [];
  520.         foreach ($sitesQry as $site) {
  521.             $siteDT = array(
  522.                 'siteId' => $site->getId(),
  523.                 'siteName' => $site->getSiteName(),
  524.                 'siteNote' => $site->getSiteNote(),
  525.                 'siteLocation' => $site->getSiteLocation(),
  526.                 'address' => $site->getAddress(),
  527.                 'siteActive' => 0,
  528.                 'lastDataSince' => '',
  529.             );
  530.             $siteDataQry $em_goc
  531.                 ->getRepository("CompanyGroupBundle\\Entity\\DeviceSensorData")
  532.                 ->findOneBy(array(
  533.                     'siteId' => $site->getId(),
  534.                 ), array(
  535.                     'timestampTs' => 'DESC'
  536.                 ));
  537.             if ($siteDataQry) {
  538.                 $siteDT['lastDataSince'] = $siteDataQry->getTimestampTs();
  539.             }
  540.             $siteDT array_merge($siteDT$this->buildSiteHeartbeatState($em_goc$site$siteDT['lastDataSince']));
  541.             $sites[$site->getId()] = $siteDT;
  542.             $siteIds[] = 1*$site->getId();
  543.         }
  544.         return $this->render('@MarketPlace/pages/views/sofia_dashboard_admin.html.twig',
  545.             array(
  546.                 'page_title' => 'Dashboard Admin',
  547.                 'sites' => $sites,
  548.                 'siteIds' => $siteIds,
  549.             ));
  550.     }
  551.     // dashboard graph
  552.     public function SofiaDashboardGraph(Request $request$id 0)
  553.     {
  554.         return $this->render('@MarketPlace/pages/views/sofia_dashboard_graph.html.twig',
  555.             array(
  556.                 'page_title' => 'Dashboard Graph',
  557.                 'siteId' => $id,
  558.             ));
  559.     }
  560.     // dashboard profile
  561.     public function SofiaDashboardUserProfile()
  562.     {
  563.         return $this->render('@MarketPlace/pages/views/sofia_user_profile.html.twig',
  564.             array(
  565.                 'page_title' => 'User Profile',
  566.             ));
  567.     }
  568. }