src/ApplicationBundle/Controller/PublicPagesController.php line 274

Open in your IDE?
  1. <?php
  2. namespace ApplicationBundle\Controller;
  3. use ApplicationBundle\Constants\EmployeeConstant;
  4. use ApplicationBundle\Constants\GeneralConstant;
  5. use ApplicationBundle\Constants\HumanResourceConstant;
  6. use ApplicationBundle\Entity\ApplicantDetails;
  7. use ApplicationBundle\Entity\Employee;
  8. use ApplicationBundle\Entity\EmployeeDetails;
  9. use ApplicationBundle\Entity\SysDepartment;
  10. use ApplicationBundle\Entity\SysUser;
  11. use ApplicationBundle\Interfaces\LoginInterface;
  12. use ApplicationBundle\Modules\Authentication\Constants\UserConstants;
  13. use ApplicationBundle\Modules\HumanResource\HumanResource;
  14. use ApplicationBundle\Modules\System\MiscActions;
  15. use ApplicationBundle\Modules\System\System;
  16. use ApplicationBundle\Modules\User\Company;
  17. use ApplicationBundle\Modules\User\Position;
  18. use ApplicationBundle\Modules\User\Users;
  19. use CompanyGroupBundle\Entity\EmsSite;
  20. use CompanyGroupBundle\Entity\EntityApplicantDetails;
  21. use CompanyGroupBundle\Modules\UserEntity\EntityUserM;
  22. use Endroid\QrCode\Builder\BuilderInterface;
  23. use Endroid\QrCodeBundle\Response\QrCodeResponse;
  24. use Google_Client;
  25. use Google_Service_Oauth2;
  26. use Symfony\Component\HttpFoundation\JsonResponse;
  27. use Symfony\Component\HttpFoundation\Request;
  28. use Symfony\Component\HttpFoundation\Response;
  29. use Symfony\Component\Routing\Generator\UrlGenerator;
  30. // honeyBee web routing controller
  31. class PublicPagesController extends GenericController implements LoginInterface
  32. {
  33.     // HoneybeeWeb upto this
  34.     public function ReturnJsonForListenerAction(Request $request$dataStr '')
  35.     {
  36.         $session $request->getSession();
  37.         $dataStrFromSess $session->get('jsonStrForListenerData');
  38.         $dataJson json_decode($dataStrFromSesstrue);
  39.         $session->set('jsonStrForListenerData'null);
  40.         if ($dataJson == null$dataJson = [];
  41.         return new JsonResponse($dataJson);
  42.     }
  43.     public function ZktEcoHandshakeAction(Request $request): Response
  44.     {
  45.         // ZKTeco sends heartbeat GET without POST body
  46.         ob_clean();
  47.         // Get device
  48.         $deviceSN $request->get('SN''');
  49.         if ($request->getMethod() === "GET") {
  50.         } else {
  51.             $em_goc $this->getDoctrine()->getManager('company_group');
  52.             $em $this->getDoctrine()->getManager();
  53.             $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  54.             $device $em_goc->getRepository('CompanyGroupBundle:Device')->findOneBy([
  55.                 'deviceSerial' => $deviceSN
  56.             ]);
  57.             // ZKTeco sends logs via POST
  58.             $content $request->getContent();
  59.             // Example: OP=ATTLOG&PIN=25&Time=2025-11-27%2012%3A20%3A33&...
  60.             parse_str($content$data); // Convert POST body to array
  61.             if ($request->get('table''') === 'ATTLOG') {
  62.                 if ($device) {
  63.                     $app $em_goc->getRepository('CompanyGroupBundle:CompanyGroup')->findOneBy([
  64.                         'appId' => $device->getAppId()
  65.                     ]);
  66.                     if ($app)   //can go local
  67.                     {
  68.                         $goc = [
  69.                             'dbName' => $app->getDbName(),
  70.                             'dbUser' => $app->getDbUser(),
  71.                             'dbPass' => $app->getDbPass(),
  72.                             'dbHost' => $app->getDbHost(),
  73.                             'serverAddress' => $app->getCompanyGroupServerAddress(),
  74.                             'port' => $app->getCompanyGroupServerPort() ?: 80,
  75.                             'appId' => $app->getAppId(),
  76. //                                 'serverId' => $entry->getServerId(),
  77.                         ];
  78.                         $connector $this->container->get('application_connector');
  79.                         $connector->resetConnection(
  80.                             'default',
  81.                             $goc['dbName'],
  82.                             $goc['dbUser'],
  83.                             $goc['dbPass'],
  84.                             $goc['dbHost'],
  85.                             $reset true
  86.                         );
  87.                         $em $this->getDoctrine()->getManager();
  88.                         $options = array(
  89.                             'notification_enabled' => $this->container->getParameter('notification_enabled'),
  90.                             'notification_server' => $this->container->getParameter('notification_server'),
  91.                         );
  92. //                    if($device->getDeviceMarker()=='_ZKTECO_GEN_')
  93.                         if (1) {
  94.                             $raw trim($request->getContent());
  95.                             // Multiple lines? split them
  96.                             $lines preg_split('/\r\n|\r|\n/'$raw);
  97.                             foreach ($lines as $line) {
  98.                                 $line trim($line);
  99.                                 if ($line === "") continue;
  100.                                 // Split on ANY whitespace
  101.                                 $parts preg_split('/\s+/'$line);
  102.                                 if (count($parts) < 3) {
  103.                                     continue; // invalid line
  104.                                 }
  105.                                 $pin $parts[0];
  106.                                 $date $parts[1];
  107.                                 $time $parts[2];
  108.                                 $verify $parts[3] ?? null;
  109.                                 $status $parts[4] ?? null;
  110.                                 $workcode $parts[5] ?? null;
  111.                                 $timestamp = new \DateTime("$date $time ".$device->getTimezoneStr());
  112.                                 $empId $pin;
  113.                                 $userId 0;
  114.                                 $today = new \DateTime();
  115. //                                $dtTs = $today->format('U');
  116.                             $dtTs $timestamp->format('U');
  117.                                 $appId $app->getAppId();
  118.                                 $statusToMarker = array(
  119.                                     => HumanResourceConstant::ATTENDANCE_MARKER_CLOCK_IN,
  120.                                     => HumanResourceConstant::ATTENDANCE_MARKER_CLOCK_OUT,
  121.                                     => HumanResourceConstant::ATTENDANCE_MARKER_GENERAL_TRACKING,
  122.                                     => HumanResourceConstant::ATTENDANCE_MARKER_GENERAL_TRACKING,
  123.                                     => HumanResourceConstant::ATTENDANCE_MARKER_CLOCK_OUT,
  124.                                     => HumanResourceConstant::ATTENDANCE_MARKER_CLOCK_OUT,
  125.                                 );
  126.                                 $employee $em->getRepository(Employee::class)->createQueryBuilder('A')
  127.                                     ->where("  A.idsByDevice like '" $device->getDeviceSerial() . "_" $pin "' or " .
  128.                                         "  A.idsByDevice like '%," $device->getDeviceSerial() . "_" $pin ",%' or " .
  129.                                         "  A.idsByDevice like '" $device->getDeviceSerial() . "_" $pin ",%' or " .
  130.                                         "  A.idsByDevice like '%," $device->getDeviceSerial() . "_" $pin "'"
  131.                                     )
  132.                                     ->getQuery()
  133.                                     ->setMaxResults(1)
  134.                                     ->getResult();
  135.                                 if (!empty($employee))
  136.                                     $empId $employee[0]->getEmployeeId();
  137.                                 if ($device->getClockInDetection() == 1)
  138.                                     $markerId $statusToMarker[$status];
  139.                                 else
  140.                                     $markerId HumanResourceConstant::ATTENDANCE_MARKER_START_WORKING_FORCED;
  141.                                 $response MiscActions::autoAttendanceGeneral($em$empId$userId$appId$dtTs$options0$markerId);
  142.                             }
  143.                         }
  144.                     } else if ($systemType == '_CENTRAL_') {
  145.                     } else {
  146.                     }
  147. //                    return new Response('OK', 200, [
  148. //                        "Content-Type" => "text/plain; charset=ascii"
  149. //                    ]);
  150.                 }
  151. //            MiscActions::ProcessQrData($em_goc, $em, $data);
  152.                 /// get the app id
  153.                 ///  if in same server then connect to that app dbase and find employee id
  154.                 // Save attendance log
  155.                 // $data['PIN']
  156.                 // $data['Time']
  157.                 // $data['WorkCode'] (optional)
  158.                 // Example saving logic here…
  159.             }
  160.             return new Response("OK"200, [
  161.                 "Content-Type" => "text/plain; charset=ascii"
  162.             ]);
  163.         }
  164.         // Define the desired TimeZone (360 minutes for UTC+06:00)
  165.         $timeZoneMinutes "+06:00";
  166. // Get the current time on your server and format it for the device
  167.         $currentTime date('Y-m-dTH:i:s');
  168.         if ($request->get('options''') == 'all')
  169.             $r "GET OPTION FROM: $deviceSN\r\n" .
  170.                 "Stamp=9999\r\n" .
  171.                 "OpStamp=" time() . "\r\n" .
  172.                 "ErrorDelay=60\r\n" .
  173.                 "Delay=30\r\n" .
  174.                 "ResLogDay=18250\r\n" .
  175.                 "ResLogDelCount=10000\r\n" .
  176.                 "ResLogCount=50000\r\n" .
  177.                 "TransTimes=00:00;14:05\r\n" .
  178.                 "TransInterval=1\r\n" .
  179.                 "TransFlag=1111000000\r\n" .
  180. //            "Time=$currentTime\r\n" .
  181.                 "TimeZone=$timeZoneMinutes\r\n" .
  182.                 "Realtime=1\r\n" .
  183.                 "Encrypt=0";
  184. //        return $r;
  185.         else if ($request->get('type''') == 'time') {
  186.             $r "Time=" $currentTime $timeZoneMinutes;
  187.         } else
  188.             $r "OK\r\n";
  189. //        $r .= "C:SET OPTION TimeZone $timeZoneMinutes\r\n";
  190. //        $r .= "C:SET TIME " . $currentTime . "\r\n";
  191.         return new Response($r200, [
  192.             "Content-Type" => "text/plain; charset=ascii"
  193.         ]);
  194. //        return new Response('OK', 200, [
  195. //            "Content-Type" => "text/plain; charset=ascii"
  196. //        ]);
  197.         /*        $xml = '<?xml version="1.0" encoding="UTF-8"?><Response><Status>OK</Status></Response>';*/
  198. //
  199. //        return new Response(
  200. //            $xml,
  201. //            Response::HTTP_OK,
  202. //            [
  203. //                'Content-Type' => 'application/xml; charset=UTF-8'
  204. //            ]
  205. //        );
  206.     }
  207.     public function ZktEcoGetRequestAction(Request $request): Response
  208.     {
  209.         ob_clean();
  210.         return new Response('OK'200, [
  211.             "Content-Type" => "text/plain; charset=ascii"
  212.         ]);
  213.         $deviceSN $request->get('SN''');
  214.         $em_goc $this->getDoctrine()->getManager('company_group');
  215.         $em $this->getDoctrine()->getManager();
  216.         $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  217.         $device $em_goc->getRepository('CompanyGroupBundle:Device')->findOneBy([
  218.             'deviceSerial' => $deviceSN
  219.         ]);
  220.         // Default timezone (fallback)
  221.         $tzString 'UTC';
  222.         if ($device && $device->getTimezoneStr()) {
  223.             $tzString $device->getTimezoneStr();
  224.         }
  225.         // Format correct time
  226.         $tz = new \DateTimeZone($tzString);
  227.         $now = new \DateTime('now'$tz);
  228.         $formatted $now->format('Y-m-d H:i:s');
  229.         // Define the desired TimeZone (360 minutes for UTC+06:00)
  230.         $timeZoneMinutes 360;
  231. // Get the current time on your server and format it for the device
  232.         $currentTime $now->format('U');
  233. //        $now->modify('-5 days');
  234.         $r "";
  235. //        $r = "OK\r\n";
  236. //        $r .= "C:SET OPTION TimeZone $timeZoneMinutes\r\n";
  237. //        $r .= "C:SET TIME " . $currentTime . "\r\n";
  238.         $r .= "C:401:SET OPTIONS " .
  239.             "DateTime=" $now->format('U') .
  240. //         "DateTime=1764929449" .
  241. //            "\r\n".
  242. //            ",".
  243. //            "ServerTZ=" . $tzString.
  244.             "\r\n";
  245.         return new Response($r200, [
  246.             "Content-Type" => "text/plain; charset=ascii"
  247.         ]);
  248.         // ZKTeco TIME sync command
  249.         $cmd "SET TIME=" $formatted "\n";
  250.         $cmd "CMD=SET OPTIONS&DateTime=" $now->format('U') . '&TZ=' $tzString;
  251.         return new Response('OK'200, [
  252.             "Content-Type" => "text/plain; charset=ascii"
  253.         ]);
  254. //        return new Response($cmd, 200, [
  255. //            "Content-Type" => "text/plain; charset=ascii"
  256. //        ]);
  257. //        return new Response('', 200, [
  258. //            "Content-Type" => "text/plain; charset=ascii"
  259. //        ]);
  260.     }
  261.     public function ZktEcoDeviceCmdAction(Request $request): Response
  262.     {
  263.         ob_clean();
  264.         // Device is asking for commands â†’ return OK only
  265.         $responseString "OK";
  266.         $response = new Response($responseString);
  267.         return $response;
  268.     }
  269.     public function ZktEcoRtDataAction(Request $request): Response
  270.     {
  271.         $type $request->query->get('type');
  272.         $sn $request->query->get('SN');
  273.         // If device is asking for time
  274. //        if ($type === 'time')
  275.         if (0) {
  276.             // Example: Bangladesh time
  277.             ob_clean();
  278.             $deviceSN $request->get('SN''');
  279.             $em_goc $this->getDoctrine()->getManager('company_group');
  280.             $em $this->getDoctrine()->getManager();
  281.             $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  282.             $device $em_goc->getRepository('CompanyGroupBundle:Device')->findOneBy([
  283.                 'deviceSerial' => $deviceSN
  284.             ]);
  285.             // Default timezone (fallback)
  286.             $tzString 'UTC';
  287.             if ($device && $device->getTimezoneStr()) {
  288.                 $tzString $device->getTimezoneStr();
  289.             }
  290.             // Format correct time
  291.             $tz = new \DateTimeZone($tzString);
  292.             $now = new \DateTime('now'$tz);
  293.             $formatted $now->format('Y-m-d H:i:s');
  294.             // Define the desired TimeZone (360 minutes for UTC+06:00)
  295.             $timeZoneMinutes 360;
  296. // Get the current time on your server and format it for the device
  297.             $currentTime $now->format('U');
  298.             $r "";
  299. //        $r = "OK\r\n";
  300. //        $r .= "C:SET OPTION TimeZone $timeZoneMinutes\r\n";
  301. //        $r .= "C:SET TIME " . $currentTime . "\r\n";
  302.             $r .= "DateTime=" $now->format('U') .
  303. //         "DateTime=1764929449" .
  304. //            "\r\n".
  305. //                ",".
  306. //                "ServerTZ=" . $tzString.
  307.                 "";
  308.             return new Response($r200, [
  309.                 "Content-Type" => "text/plain; charset=ascii"
  310.             ]);
  311.         }
  312.         // Default fallback for other rtdata
  313.         return new Response('OK'200, ['Content-Type' => 'text/plain']);
  314.     }
  315.     public function ScanQrAction(Request $request$version '')
  316.     {
  317.         $session $request->getSession();
  318.         $firstData $request->getContent();
  319.         $data json_decode($firstDatatrue);
  320.         $appId = [];
  321.         if (json_last_error() === JSON_ERROR_NONE) {
  322.             // JSON is valid
  323.             if (isset($data['appId']))
  324.                 $appId $data['appId'];
  325.         } else
  326.             $data $firstData;
  327.         $em_goc $this->getDoctrine()->getManager('company_group');
  328.         $em $this->getDoctrine()->getManager();
  329.         if ($appId != 0) {
  330.             $companies $em_goc->getRepository('CompanyGroupBundle:CompanyGroup')->findBy([
  331.                 'appId' => $appId
  332.             ]);
  333.             foreach ($companies as $entry) {
  334.                 $goc = [
  335.                     'dbName' => $entry->getDbName(),
  336.                     'dbUser' => $entry->getDbUser(),
  337.                     'dbPass' => $entry->getDbPass(),
  338.                     'dbHost' => $entry->getDbHost(),
  339.                     'serverAddress' => $entry->getCompanyGroupServerAddress(),
  340.                     'port' => $entry->getCompanyGroupServerPort() ?: 80,
  341.                     'appId' => $entry->getAppId(),
  342. //                                 'serverId' => $entry->getServerId(),
  343.                 ];
  344.                 $connector $this->container->get('application_connector');
  345.                 $connector->resetConnection(
  346.                     'default',
  347.                     $goc['dbName'],
  348.                     $goc['dbUser'],
  349.                     $goc['dbPass'],
  350.                     $goc['dbHost'],
  351.                     $reset true
  352.                 );
  353.                 $em $this->getDoctrine()->getManager();
  354.             }
  355.         }
  356.         MiscActions::ProcessQrData($em_goc$em$data);
  357.         return new JsonResponse(
  358.             array(
  359.                 'postData' => $request->request->all(),
  360.                 'getData' => $request->query->all(),
  361.                 'contentData' => $request->getContent(),
  362.             )
  363.         );
  364.     }
  365.     public function GetGlobalIdFromEmployeeIdAction(Request $request$version '')
  366.     {
  367.         $session $request->getSession();
  368.         $appId $request->request->get('appId'0);
  369.         $empId $request->request->get('employeeId'0);
  370.         $em_goc $this->getDoctrine()->getManager('company_group');
  371.         $em $this->getDoctrine()->getManager();
  372.         if ($appId != 0) {
  373.             $entry $em_goc->getRepository('CompanyGroupBundle:CompanyGroup')->findOneBy([
  374.                 'appId' => $appId
  375.             ]);
  376.             $goc = [
  377.                 'dbName' => $entry->getDbName(),
  378.                 'dbUser' => $entry->getDbUser(),
  379.                 'dbPass' => $entry->getDbPass(),
  380.                 'dbHost' => $entry->getDbHost(),
  381.                 'serverAddress' => $entry->getCompanyGroupServerAddress(),
  382.                 'port' => $entry->getCompanyGroupServerPort() ?: 80,
  383.                 'appId' => $entry->getAppId(),
  384. //                                 'serverId' => $entry->getServerId(),
  385.             ];
  386.             $connector $this->container->get('application_connector');
  387.             $connector->resetConnection(
  388.                 'default',
  389.                 $goc['dbName'],
  390.                 $goc['dbUser'],
  391.                 $goc['dbPass'],
  392.                 $goc['dbHost'],
  393.                 $reset true
  394.             );
  395.             $em $this->getDoctrine()->getManager();
  396.             $employee $this->getDoctrine()->getManager()
  397.                 ->getRepository("ApplicationBundle:Employee")
  398.                 ->findOneBy(array(
  399.                     'employeeId' => $empId
  400.                 ));
  401.             if ($employee) {
  402.                 $user $this->getDoctrine()->getManager()
  403.                     ->getRepository("ApplicationBundle:SysUser")
  404.                     ->findOneBy(array(
  405.                         'userId' => $employee->getUserId()
  406.                     ));
  407.                 if ($user)
  408.                     return new JsonResponse(array('globalId' => $user->getGlobalId()));
  409.             }
  410.         }
  411.         return new JsonResponse(array('globalId' => 0));
  412.     }
  413.     public function VerifyEmailForAppAction(Request $request$encData ''$remoteVerify 0)
  414.     {
  415.         //        $userCategory=$request->request->has('userCategory');
  416.         $encryptedData = [];
  417.         $errorField '';
  418.         $message '';
  419.         $userType '';
  420.         $otpExpireSecond 180;
  421.         $otpExpireTs 0;
  422.         $otp '';
  423.         $otpActionId $request->request->get('otpAction'UserConstants::OTP_ACTION_CONFIRM_EMAIL);
  424.         if ($encData != '')
  425.             $encryptedData json_decode($this->get('url_encryptor')->decrypt($encData), true);
  426.         //        $encryptedData = $this->get('url_encryptor')->decrypt($encData);
  427.         $userCategory '_BUDDYBEE_USER_';
  428.         if (isset($encryptedData['userCategory']))
  429.             $userCategory $encryptedData['userCategory'];
  430.         else
  431.             $userCategory $request->request->get('userCategory''_BUDDYBEE_USER_');
  432.         $em $this->getDoctrine()->getManager('company_group');
  433.         $em_goc $this->getDoctrine()->getManager('company_group');
  434.         $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  435.         $ownServerId $this->container->hasParameter('server_id') ? $this->container->getParameter('server_id') : '_NONE_';
  436.         $twig_file '@Authentication/pages/views/find_account_buddybee.html.twig';
  437.         $twigData = [];
  438.         $email_twig_file 'ApplicationBundle:pages/email:find_account_buddybee.html.twig';
  439.         $email_address $request->request->get('email''');
  440.         $email_twig_data = [];
  441.         $appendCode $request->request->get('appendCode'$request->query->get('appendCode'''));
  442.         if ($request->isMethod('POST')) {
  443.             //set an otp and its expire and send mail
  444.             $email_address $request->request->get('email');
  445.             $userObj null;
  446.             $userData = [];
  447.             {
  448.                 $userType UserConstants::USER_TYPE_APPLICANT;
  449.                 $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  450.                     array(
  451.                         'email' => $email_address
  452.                     )
  453.                 );
  454.                 if ($userObj) {
  455.                 } else {
  456.                     $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  457.                         array(
  458.                             'oAuthEmail' => $email_address
  459.                         )
  460.                     );
  461.                     if ($userObj) {
  462.                     } else {
  463.                         $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  464.                             array(
  465.                                 'username' => $email_address
  466.                             )
  467.                         );
  468.                     }
  469.                 }
  470.                 if ($userObj) {
  471.                     $email_address $userObj->getEmail();
  472.                     if ($email_address == null || $email_address == '')
  473.                         $email_address $userObj->getOAuthEmail();
  474.                     //                    triggerResetPassword:
  475. //                    type: integer
  476. //                          nullable: true
  477.                     $otpData MiscActions::GenerateOtp($otpExpireSecond);
  478.                     $otp $otpData['otp'];
  479.                     $otpExpireTs $otpData['expireTs'];
  480.                     $userObj->setOtp($otpData['otp']);
  481.                     $userObj->setOtpActionId($otpActionId);
  482.                     $userObj->setOtpExpireTs($otpData['expireTs']);
  483.                     $em_goc->flush();
  484.                     $userData = array(
  485.                         'id' => $userObj->getApplicantId(),
  486.                         'email' => $email_address,
  487.                         'appId' => 0,
  488.                         'image' => $userObj->getImage(),
  489.                         'firstName' => $userObj->getFirstname(),
  490.                         'lastName' => $userObj->getLastname(),
  491.                         'phone' => $userObj->getPhone(),
  492. //                        'appId'=>$userObj->getUserAppId(),
  493.                     );
  494.                     $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  495.                     $email_twig_data = [
  496.                         'page_title' => 'Find Account',
  497.                         'encryptedData' => $encryptedData,
  498.                         'message' => $message,
  499.                         'userType' => $userType,
  500.                         'errorField' => $errorField,
  501.                         'otp' => $otpData['otp'],
  502.                         'otpExpireSecond' => $otpExpireSecond,
  503.                         'otpActionId' => $otpActionId,
  504.                         'otpActionTitle' => UserConstants::$OTP_ACTION_DATA[$otpActionId]['actionTitle'],
  505.                         'otpActionDescForMail' => UserConstants::$OTP_ACTION_DATA[$otpActionId]['actionDescForMail'],
  506.                         'otpExpireTs' => $otpData['expireTs'],
  507.                         'systemType' => $systemType,
  508.                         'userCategory' => $userCategory,
  509.                         'userData' => $userData
  510.                     ];
  511.                     $email_twig_data['success'] = true;
  512.                 } else {
  513.                     $message "Oops! Could not find your account";
  514.                     $email_twig_data['success'] = false;
  515.                 }
  516.             }
  517.             if ($email_twig_data['success'] == true && GeneralConstant::EMAIL_ENABLED == 1) {
  518.                 $bodyHtml '';
  519.                 $bodyTemplate $email_twig_file;
  520.                 $bodyData $email_twig_data;
  521.                 $attachments = [];
  522.                 $forwardToMailAddress $email_address;
  523. //                    $upl_dir = $this->container->getParameter('kernel.root_dir') . '/../web/uploads/temp/' . 'ledger' . '.pdf'
  524.                 $new_mail $this->get('mail_module');
  525.                 $new_mail->sendMyMail(array(
  526.                     'senderHash' => '_CUSTOM_',
  527.                     //                        'senderHash'=>'_CUSTOM_',
  528.                     'forwardToMailAddress' => $forwardToMailAddress,
  529.                     'subject' => 'Account Verification',
  530. //                        'fileName' => 'Order#' . str_pad($id, 8, '0', STR_PAD_LEFT) . '.pdf',
  531.                     'attachments' => $attachments,
  532.                     'toAddress' => $forwardToMailAddress,
  533.                     'fromAddress' => 'no-reply@ourhoneybee.eu',
  534.                     'userName' => 'no-reply@ourhoneybee.eu',
  535.                     'password' => 'Honeybee@0112',
  536.                     'smtpServer' => 'smtp.hostinger.com',
  537.                     'smtpPort' => 465,
  538. //                            'emailBody' => $bodyHtml,
  539.                     'mailTemplate' => $bodyTemplate,
  540.                     'templateData' => $bodyData,
  541. //                        'embedCompanyImage' => 1,
  542. //                        'companyId' => $companyId,
  543. //                        'companyImagePath' => $company_data->getImage()
  544.                 ));
  545.             }
  546.             if ($email_twig_data['success'] == true && GeneralConstant::NOTIFICATION_ENABLED == && $userData['phone'] != '' && $userData['phone'] != null) {
  547.                 if ($systemType == '_BUDDYBEE_') {
  548.                     $searchVal = ['_OTP_''_EXPIRE_MINUTES_''_APPEND_CODE_'];
  549.                     $replaceVal = [$otpfloor($otpExpireSecond 60), $appendCode];
  550.                     $msg 'Use OTP _OTP_ for BuddyBee. Your OTP will expire in _EXPIRE_MINUTES_ minutes
  551.                      _APPEND_CODE_';
  552.                     $msg str_replace($searchVal$replaceVal$msg);
  553.                     $emitMarker '_SEND_TEXT_TO_MOBILE_';
  554.                     $sendType 'all';
  555.                     $socketUserIds = [];
  556.                     System::SendSmsBySocket($this->container->getParameter('notification_enabled'), $msg$userData['phone'], $emitMarker$sendType$socketUserIds);
  557.                 } else {
  558.                 }
  559.             }
  560.             $encData = array(
  561.                 "userType" => $userType,
  562.                 "otp" => '',
  563. //                "otp"=>$otp,
  564.                 "otpExpireTs" => $otpExpireTs,
  565.                 "otpActionId" => $otpActionId,
  566.                 "userCategory" => $userCategory,
  567.                 "userId" => $userData['id'],
  568.                 "systemType" => $systemType,
  569.                 "email" => $email_address,
  570.             );
  571.             $encDataStr $this->get('url_encryptor')->encrypt(json_encode($encData));
  572.             $response = new JsonResponse(array(
  573.                     'templateData' => $twigData,
  574.                     'message' => $message,
  575.                     "otp" => '',
  576. //                        "otp" => $otp,
  577.                     "encData" => $encDataStr,
  578.                     "otpExpireTs" => $otpExpireTs,
  579. //                        'actionData' => $email_twig_data,
  580.                     'success' => isset($email_twig_data['success']) ? $email_twig_data['success'] : false,
  581.                 )
  582.             );
  583.             $response->headers->set('Access-Control-Allow-Origin''*');
  584.             return $response;
  585.         }
  586.     }
  587.     public function EmployeeAddUsingQrCodeErpServerAction(Request $request)
  588.     {
  589.         $em_goc $this->getDoctrine()->getManager('company_group');
  590.         $app $em_goc->getRepository("CompanyGroupBundle:CompanyGroup")
  591.             ->findOneBy(
  592.                 array(
  593.                     'appId' => $request->request->get('appId'),
  594.                 )
  595.             );
  596.         $connector $this->container->get('application_connector');
  597.         $connector->resetConnection(
  598.             'default',
  599.             $app->getDbName(),
  600.             $app->getDbUser(),
  601.             $app->getDbPass(),
  602.             $app->getDbHost(),
  603.             true
  604.         );
  605.         $em $this->getDoctrine()->getManager();
  606.         $user $em->getRepository('ApplicationBundle:SysUser')
  607.             ->findOneBy(
  608.                 array(
  609.                     'globalId' => $request->request->get('globalId'),
  610.                 )
  611.             );
  612.         if (!$user)
  613.             $user = new SysUser();
  614.         $user->setGlobalId($request->request->get('globalId'));
  615.         $user->setUsername($request->request->get('username'));
  616.         $user->setEmail($request->request->get('email'));
  617.         $user->setName($request->request->get('firstname'));
  618.         $user->setUserType($request->request->get('userType'));
  619.         $user->setUserAppId($request->request->get('appId'));
  620.         $user->setUserCompanyId(1);
  621.         $user->setStatus(1);
  622.         $user->setDefaultRoute('');
  623.         $em->persist($user);
  624.         $em->flush();
  625.         $employee $em->getRepository('ApplicationBundle:Employee')
  626.             ->findOneBy(
  627.                 array(
  628.                     'userId' => $user->getUserId(),
  629.                 )
  630.             );
  631.         if (!$employee) {
  632.             $employee = new Employee();
  633.             if ($request->request->get('email') && $request->request->get('firstname') && $request->request->get('lastname')) {
  634.                 $employee->setEmail($request->request->get('email'));
  635.                 $employee->setFirstName($request->request->get('firstname'));
  636.                 $employee->setLastName($request->request->get('lastname'));
  637.                 $employee->setCompanyId($request->request->get('companyId'));
  638.                 $employee->setStatus(1);
  639.                 $employee->setUserId($user->getUserId());
  640.                 $em->persist($employee);
  641.                 $em->flush();
  642.             } else {
  643.                 return new JsonResponse([
  644.                     'status' => 'error',
  645.                     'message' => 'Missing employee data',
  646.                 ]);
  647.             }
  648.         }
  649.         $employeeDetails $em->getRepository('ApplicationBundle:EmployeeDetails')
  650.             ->findOneBy(
  651.                 array(
  652.                     'userId' => $user->getUserId(),
  653.                 )
  654.             );
  655.         if (!$employeeDetails) {
  656.             $employeeDetails = new EmployeeDetails();
  657.             if ($request->request->get('email') && $request->request->get('firstname') && $request->request->get('lastname')) {
  658.                 $employeeDetails->setId($employee->getEmployeeId());
  659.                 $employeeDetails->setEmail($request->request->get('email'));
  660.                 $employeeDetails->setFirstname($request->request->get('firstname'));
  661.                 $employeeDetails->setLastname($request->request->get('lastname'));
  662.                 $employeeDetails->setUsername($request->request->get('username'));
  663.                 $employeeDetails->setUserId($employee->getUserId());
  664.                 $employeeDetails->setEmpStatus(1);
  665.                 $em->persist($employeeDetails);
  666.                 $em->flush();
  667.             } else {
  668.                 return new JsonResponse([
  669.                     'status' => 'error',
  670.                     'message' => 'Missing employee data',
  671.                 ]);
  672.             }
  673.         }
  674.         return new JsonResponse([
  675.             'status' => 'success',
  676.             'message' => 'Employee Added Successfully',
  677.         ]);
  678.     }
  679.     public function GetEmployeeDataByAppAction(Request $request$id 0)
  680.     {
  681.         $session $request->getSession();
  682.         $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  683.         $globalId $request->get('globalId'0);
  684.         $appId $request->get('appId'0);
  685.         $userId $request->get('userId'0);
  686.         $employeeId 0;
  687.         $gocDataList = [];
  688.         $gocDataListByAppId = [];
  689.         $appIds $request->get('appIds'$appId);
  690.         $userIds $request->get('userIds'$userId);
  691.         $em $this->getDoctrine()->getManager('company_group');
  692.         $em->getConnection()->connect();
  693.         $connected $em->getConnection()->isConnected();
  694.         $returnData = [];
  695.         if ($connected) {
  696.             $findByQuery = array(
  697.                 'active' => 1
  698.             );
  699.             if ($appIds !== '_UNSET_')
  700.                 $findByQuery['appId'] = $appIds;
  701.             $gocList $this->getDoctrine()->getManager('company_group')
  702.                 ->getRepository("CompanyGroupBundle:CompanyGroup")
  703.                 ->findBy($findByQuery);
  704.             foreach ($gocList as $entry) {
  705.                 $d = array(
  706.                     'name' => $entry->getName(),
  707.                     'id' => $entry->getId(),
  708.                     'image' => $entry->getImage(),
  709.                     'companyGroupHash' => $entry->getCompanyGroupHash(),
  710.                     'dbName' => $entry->getDbName(),
  711.                     'dbUser' => $entry->getDbUser(),
  712.                     'dbPass' => $entry->getDbPass(),
  713.                     'dbHost' => $entry->getDbHost(),
  714.                     'appId' => $entry->getAppId(),
  715.                     'companyRemaining' => $entry->getCompanyRemaining(),
  716.                     'companyAllowed' => $entry->getCompanyAllowed(),
  717.                 );
  718.                 $gocDataList[$entry->getId()] = $d;
  719.                 $gocDataListByAppId[$entry->getAppId()] = $d;
  720.             }
  721.             $connector $this->container->get('application_connector');
  722.             $connector->resetConnection(
  723.                 'default',
  724.                 $gocDataListByAppId[$appId]['dbName'],
  725.                 $gocDataListByAppId[$appId]['dbUser'],
  726.                 $gocDataListByAppId[$appId]['dbPass'],
  727.                 $gocDataListByAppId[$appId]['dbHost'],
  728.                 $reset true);
  729.             $em $this->getDoctrine()->getManager();
  730.             $user $em
  731.                 ->getRepository('ApplicationBundle:SysUser')
  732.                 ->findOneBy(
  733.                     array(
  734.                         'globalId' => $globalId
  735.                     )
  736.                 );
  737.             if ($user) {
  738.                 $employee $em
  739.                     ->getRepository('ApplicationBundle:Employee')
  740.                     ->findOneBy(
  741.                         array(
  742.                             'userId' => $user->getUserId()
  743.                         )
  744.                     );
  745.                 if ($employee) {
  746.                     $employeeDetails $em
  747.                         ->getRepository('ApplicationBundle:EmployeeDetails')
  748.                         ->findOneBy(
  749.                             array(
  750.                                 'id' => $employee->getEmployeeId()
  751.                             )
  752.                         );
  753.                     if ($employeeDetails) {
  754.                         $department $em->getRepository('ApplicationBundle:SysDepartment')->findOneBy(
  755.                             array(
  756.                                 'departmentId' => $employee->getDepartmentId()
  757.                             )
  758.                         );
  759.                         if ($department)
  760.                             $returnData['department'] = $department->getDepartmentName();
  761.                         else
  762.                             $returnData['department'] = '';
  763.                         $position $em->getRepository('ApplicationBundle:SysDepartmentPosition')->findOneBy(
  764.                             array(
  765.                                 'positionId' => $employee->getPositionId()
  766.                             )
  767.                         );
  768.                         if ($position)
  769.                             $returnData['position'] = $position->getPositionName();
  770.                         else
  771.                             $returnData['position'] = '';
  772.                         $branch $em->getRepository('ApplicationBundle:Branch')->findOneBy(
  773.                             array(
  774.                                 'branchId' => $employee->getBranchId()
  775.                             )
  776.                         );
  777.                         if ($branch)
  778.                             $returnData['branch'] = $branch->getName();
  779.                         else
  780.                             $returnData['branch'] = '';
  781.                         $supervisor $em->getRepository('ApplicationBundle:SysUser')->findOneBy(
  782.                             array(
  783.                                 'userId' => $employee->getSupervisorId()
  784.                             )
  785.                         );
  786.                         if ($supervisor)
  787.                             $returnData['supervisor'] = $supervisor->getName();
  788.                         else
  789.                             $returnData['supervisor'] = '';
  790.                         $returnData['joiningDate'] = $employeeDetails->getJoiningDate()->format('F d, Y');
  791.                         $returnData['employeeId'] = 'E' str_pad($appId5'0'STR_PAD_LEFT) . str_pad($employee->getEmployeeId(), 8'0'STR_PAD_LEFT);
  792.                         $returnData['employeeCode'] = $employeeDetails->getEmpCode() ?? '';
  793.                         $returnData['employmentType'] = EmployeeConstant::$employeeType[$employeeDetails->getEmpType()] ?? '';
  794.                         $returnData['appId'] = $appId;
  795.                         $returnData['appName'] = $gocDataListByAppId[$appId]['name'];
  796.                         $returnData['appImage'] = $gocDataListByAppId[$appId]['image'];
  797.                     }
  798.                 }
  799.             }
  800.         }
  801.         return new JsonResponse(array(
  802.             'success' => !empty($returnData),
  803.             'returnData' => $returnData,
  804.         ));
  805.     }
  806.     public function PublicProfilePageAction(Request $request$id 0)
  807.     {
  808.         $em $this->getDoctrine()->getManager();
  809.         $session $request->getSession();
  810.         $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  811.         $globalId 0;
  812.         $appId 0;
  813.         $employeeId 0;
  814.         if ($systemType == '_CENTRAL_') {
  815.             if (strpos($id'E') !== false) {
  816.             }
  817.             $urlToCall GeneralConstant::HONEYBEE_CENTRAL_SERVER '/employee/profile/' $id '?returnJson=1';
  818.             $curl curl_init();
  819.             curl_setopt_array($curl, array(
  820.                 CURLOPT_RETURNTRANSFER => 1,
  821.                 CURLOPT_POST => 0,
  822.                 CURLOPT_URL => $urlToCall,
  823.                 CURLOPT_CONNECTTIMEOUT => 10,
  824.                 CURLOPT_SSL_VERIFYPEER => false,
  825.                 CURLOPT_SSL_VERIFYHOST => false,
  826.                 CURLOPT_HTTPHEADER => array(),
  827.                 CURLOPT_POSTFIELDS => []
  828.             ));
  829.             $retData curl_exec($curl);
  830.             $errData curl_error($curl);
  831.             curl_close($curl);
  832.             $data $em->getRepository(EntityApplicantDetails::class)->find($id);
  833.             return $this->render('@HoneybeeWeb/pages/public_profile.html.twig', array(
  834.                 'page_title' => 'Employee Profile',
  835.                 'details' => $data,
  836.                 'genderList' => EmployeeConstant::$sex,
  837.                 'bloodGroupList' => EmployeeConstant::$BloodGroup,
  838.             ));
  839.         } else if ($systemType == '_ERP_') {
  840.             if (strpos($id'E') !== false) {
  841.             }
  842.             $employee $em->getRepository('ApplicationBundle:Employee')->findOneBy(
  843.                 array(
  844.                     'employeeId' => $id
  845.                 ));
  846.             if ($employee) {
  847.                 $user $em->getRepository('ApplicationBundle:SysUser')->findOneBy(
  848.                     array(
  849.                         'userId' => $employee->getUserId()
  850.                     ));
  851.                 if ($user)
  852.                     $globalId $user->getGlobalId();
  853.             }
  854.             if ($request->query->get('returnJson'0) == 1)
  855.                 return new JsonResponse(array(
  856.                     'globalId' => $globalId
  857.                 ));
  858.             else {
  859.                 if ($globalId == || $globalId == null) {
  860.                     return $this->redirectToRoute('permission_denied_page');
  861.                 } else {
  862.                     return $this->redirect(GeneralConstant::HONEYBEE_CENTRAL_SERVER '/profile/public/' $globalId);
  863.                 }
  864.             }
  865.         }
  866.     }
  867.     public function GenerateQrAction(Request $request$url '')
  868.     {
  869.         $em_goc $this->getDoctrine()->getManager('company_group');
  870.         $em_goc->getConnection()->connect();
  871.         $customQrUrl $request->query->get('url'$url);
  872.         $company $request->query->get('company');
  873.         $appid $request->query->get('appid');
  874.         $companyId $request->query->get('companyId');
  875.         $userType $request->query->get('userType');
  876.         $absoluteUrl $this->generateUrl('dashboard', [], UrlGenerator::ABSOLUTE_URL);
  877.         $companyDetails $em_goc->getRepository("CompanyGroupBundle:CompanyGroup")->findOneBy(
  878.             array(
  879.                 'appId' => $appid
  880.             ));
  881. //        $companyImage = rtrim($absoluteUrl, '/') . '/' . ltrim($companyDetails->getImage(), '/');
  882.         $companyImage $companyDetails->getImage();
  883.         if ($companyImage) {
  884.             $companyImage rtrim($absoluteUrl'/') . '/' ltrim($companyImage'/');
  885.         } else {
  886.             $companyImage '';
  887.         }
  888.         $userTypeNames = [
  889.             => 'Admin',
  890.             => 'User',
  891.             => 'Management',
  892.         ];
  893.         $userTypeName = isset($userTypeNames[$userType]) ? $userTypeNames[$userType] : 'Unknown';
  894.         $finalUrl $customQrUrl == '' "https://ourhoneybee.eu/add_employee_by_qr?company=" urlencode($company) .
  895.             "&appid=" urlencode($appid) .
  896.             "&companyId=" urlencode($companyId) .
  897.             "&companyImage=" urlencode($companyImage) .
  898.             "&userType=" urlencode($userType) : $customQrUrl;
  899.         if ($request->get('htmlView'0) == 1) {
  900.             return $this->render('@Application/inc/snippets/qr_div.html.twig',
  901.                 array(
  902.                     'page_title' => 'Bee Codes',
  903. //                'export'=>'pdf,print',
  904.                     'data' => [],
  905.                     'isHtml' => $request->get('htmlView'0),
  906.                     'customQrUrl' => $customQrUrl,
  907.                     'url' => $finalUrl
  908.                 )
  909.             );
  910.         } else {
  911.             $html $this->renderView('@Application/inc/snippets/qr_div.html.twig',
  912.                 array(
  913.                     'page_title' => 'Bee Codes',
  914. //                'export'=>'pdf,print',
  915.                     'data' => [],
  916.                     'isHtml' => $request->get('htmlView'0),
  917.                     'customQrUrl' => $customQrUrl,
  918.                     'url' => $finalUrl
  919.                 )
  920.             );
  921.             return new JsonResponse(array(
  922.                 'html' => $html,
  923.                 'customQrUrl' => $customQrUrl,
  924.                 'url' => $finalUrl,
  925.                 'companyImage' => $companyImage,
  926.                 'userTypeName' => $userTypeName,
  927.             ));
  928.         }
  929.     }
  930.     public function NewPasswordAction(Request $request$encData '')
  931.     {
  932.         //        $userCategory=$request->request->has('userCategory');
  933.         $encryptedData = [];
  934.         $errorField '';
  935.         $message '';
  936.         $userType '';
  937.         $otpExpireSecond 180;
  938.         $session $request->getSession();
  939.         if ($encData != '')
  940.             $encryptedData json_decode($this->get('url_encryptor')->decrypt($encData), true);
  941.         //        $encryptedData = $this->get('url_encryptor')->decrypt($encData);
  942.         $otp = isset($encryptedData['otp']) ? $encryptedData['otp'] : 0;
  943.         $password = isset($encryptedData['password']) ? $encryptedData['password'] : 0;
  944.         $otpActionId = isset($encryptedData['otpActionId']) ? $encryptedData['otpActionId'] : 0;
  945.         $userId = isset($encryptedData['userId']) ? $encryptedData['userId'] : $session->get(UserConstants::USER_ID);
  946.         $userCategory = isset($encryptedData['userCategory']) ? $encryptedData['userCategory'] : '_BUDDYBEE_USER_';
  947.         //        $em = $this->getDoctrine()->getManager('company_group');
  948.         $em_goc $this->getDoctrine()->getManager('company_group');
  949.         $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  950.         $twig_file 'ApplicationBundle:pages/login:find_account_buddybee.html.twig';
  951.         $twigData = [];
  952.         $email_twig_file 'ApplicationBundle:pages/email:find_account_buddybee.html.twig';
  953.         $email_twig_data = [];
  954.         if ($request->isMethod('POST')) {
  955.             $otp $request->request->get('otp'$otp);
  956.             $password $request->request->get('password'$password);
  957.             $otpActionId $request->request->get('otpActionId'$otpActionId);
  958.             $userId $request->request->get('userId'$userId);
  959.             $userCategory $request->request->get('userCategory'$userCategory);
  960.             $email_address $request->request->get('email');
  961.             if ($systemType == '_ERP_') {
  962.                 $gocId $session->get(UserConstants::USER_GOC_ID);
  963.                 if ($gocId != && $gocId != "") {
  964.                     $gocDbName $session->get(UserConstants::USER_DB_NAME);
  965.                     $gocDbUser $session->get(UserConstants::USER_DB_USER);
  966.                     $gocDbPass $session->get(UserConstants::USER_DB_PASS);
  967.                     $gocDbHost $session->get(UserConstants::USER_DB_HOST);
  968.                     //                        $connector = $this->container->get('application_connector');
  969.                     $connector $this->container->get('application_connector');
  970.                     $connector->resetConnection(
  971.                         'default',
  972.                         $gocDbName,
  973.                         $gocDbUser,
  974.                         $gocDbPass,
  975.                         $gocDbHost,
  976.                         $reset false);
  977.                 }
  978.                 $em $this->getDoctrine()->getManager();
  979.                 if ($userCategory == '_APPLICANT_') {
  980.                     $userType UserConstants::USER_TYPE_APPLICANT;
  981.                     $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  982.                         array(
  983.                             'applicantId' => $userId
  984.                         )
  985.                     );
  986.                     if ($userObj) {
  987.                         if ($userObj->getTriggerResetPassword() == 1) {
  988.                             $encodedPassword $this->container->get('sha256salted_encoder')->encodePassword($password$userObj->getSalt());
  989.                             $userObj->setPassword($encodedPassword);
  990.                             $userObj->setTempPassword('');
  991.                             $userObj->setTriggerResetPassword(0);
  992.                             $em_goc->flush();
  993.                             $email_twig_data['success'] = true;
  994.                             $message "";
  995.                             $userData = array(
  996.                                 'id' => $userObj->getApplicantId(),
  997.                                 'email' => $email_address,
  998.                                 'appId' => 0,
  999.                                 'image' => $userObj->getImage(),
  1000.                                 'firstName' => $userObj->getFirstname(),
  1001.                                 'lastName' => $userObj->getLastname(),
  1002.                                 //                        'appId'=>$userObj->getUserAppId(),
  1003.                             );
  1004.                         } else {
  1005.                             $message "Action not allowed!";
  1006.                             $email_twig_data['success'] = false;
  1007.                         }
  1008.                     } else {
  1009.                         $message "Account not found!";
  1010.                         $email_twig_data['success'] = false;
  1011.                     }
  1012.                 } else {
  1013.                     $userType $session->get(UserConstants::USER_TYPE);
  1014.                     $userObj $em->getRepository('ApplicationBundle:SysUser')->findOneBy(
  1015.                         array(
  1016.                             'userId' => $userId
  1017.                         )
  1018.                     );
  1019.                     if ($userObj) {
  1020.                         if ($userObj->getTriggerResetPassword() == 1) {
  1021.                             $encodedPassword $this->container->get('sha256salted_encoder')->encodePassword($password$userObj->getSalt());
  1022.                             $userObj->setPassword($encodedPassword);
  1023.                             $userObj->setTempPassword('');
  1024.                             $userObj->setTriggerResetPassword(0);
  1025.                             $em->flush();
  1026.                             $email_twig_data['success'] = true;
  1027.                             $message "";
  1028.                         } else {
  1029.                             $message "Action not allowed!";
  1030.                             $email_twig_data['success'] = false;
  1031.                         }
  1032.                     } else {
  1033.                         $message "Account not found!";
  1034.                         $email_twig_data['success'] = false;
  1035.                     }
  1036.                 }
  1037.                 if ($request->request->has('remoteVerify') || $request->request->has('returnJson') || $request->query->has('returnJson')) {
  1038.                     $response = new JsonResponse(array(
  1039.                             'templateData' => $twigData,
  1040.                             'message' => $message,
  1041.                             'actionData' => $email_twig_data,
  1042.                             'success' => isset($email_twig_data['success']) ? $email_twig_data['success'] : false,
  1043.                         )
  1044.                     );
  1045.                     $response->headers->set('Access-Control-Allow-Origin''*');
  1046.                     return $response;
  1047.                 } else if ($email_twig_data['success'] == true) {
  1048.                     //                    $twig_file = '@Authentication/pages/views/reset_password_success_buddybee.html.twig';
  1049.                     //                    $twigData = [
  1050.                     //                        'page_title' => 'Reset Successful',
  1051.                     //                        'encryptedData' => $encryptedData,
  1052.                     //                        'message' => $message,
  1053.                     //                        'userType' => $userType,
  1054.                     //                        'errorField' => $errorField,
  1055.                     //
  1056.                     //                    ];
  1057.                     //                    return $this->render(
  1058.                     //                        $twig_file,
  1059.                     //                        $twigData
  1060.                     //                    );
  1061.                     return $this->redirectToRoute('dashboard');
  1062.                 }
  1063.             } else if ($systemType == '_BUDDYBEE_') {
  1064.                 $userType UserConstants::USER_TYPE_APPLICANT;
  1065.                 $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  1066.                     array(
  1067.                         'applicantId' => $userId
  1068.                     )
  1069.                 );
  1070.                 if ($userObj) {
  1071.                     if ($userObj->getTriggerResetPassword() == 1) {
  1072.                         $encodedPassword $this->container->get('sha256salted_encoder')->encodePassword($password$userObj->getSalt());
  1073.                         $userObj->setPassword($encodedPassword);
  1074.                         $userObj->setTempPassword('');
  1075.                         $userObj->setTriggerResetPassword(0);
  1076.                         $em_goc->flush();
  1077.                         $email_twig_data['success'] = true;
  1078.                         $message "";
  1079.                         $userData = array(
  1080.                             'id' => $userObj->getApplicantId(),
  1081.                             'email' => $email_address,
  1082.                             'appId' => 0,
  1083.                             'image' => $userObj->getImage(),
  1084.                             'firstName' => $userObj->getFirstname(),
  1085.                             'lastName' => $userObj->getLastname(),
  1086.                             //                        'appId'=>$userObj->getUserAppId(),
  1087.                         );
  1088.                     } else {
  1089.                         $message "Action not allowed!";
  1090.                         $email_twig_data['success'] = false;
  1091.                     }
  1092.                 } else {
  1093.                     $message "Account not found!";
  1094.                     $email_twig_data['success'] = false;
  1095.                 }
  1096.             } else if ($systemType == '_CENTRAL_') {
  1097.                 $userType UserConstants::USER_TYPE_APPLICANT;
  1098.                 $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  1099.                     array(
  1100.                         'applicantId' => $userId
  1101.                     )
  1102.                 );
  1103.                 if ($userObj) {
  1104.                     if ($userObj->getTriggerResetPassword() == 1) {
  1105.                         $encodedPassword $this->container->get('sha256salted_encoder')->encodePassword($password$userObj->getSalt());
  1106.                         $userObj->setPassword($encodedPassword);
  1107.                         $userObj->setTempPassword('');
  1108.                         $userObj->setTriggerResetPassword(0);
  1109.                         $em_goc->flush();
  1110.                         $email_twig_data['success'] = true;
  1111.                         $message "";
  1112.                         $userData = array(
  1113.                             'id' => $userObj->getApplicantId(),
  1114.                             'email' => $email_address,
  1115.                             'appId' => 0,
  1116.                             'image' => $userObj->getImage(),
  1117.                             'firstName' => $userObj->getFirstname(),
  1118.                             'lastName' => $userObj->getLastname(),
  1119.                             //                        'appId'=>$userObj->getUserAppId(),
  1120.                         );
  1121.                     } else {
  1122.                         $message "Action not allowed!";
  1123.                         $email_twig_data['success'] = false;
  1124.                     }
  1125.                 } else {
  1126.                     $message "Account not found!";
  1127.                     $email_twig_data['success'] = false;
  1128.                 }
  1129.             }
  1130.             if ($request->request->has('remoteVerify') || $request->request->has('returnJson') || $request->query->has('returnJson')) {
  1131.                 $response = new JsonResponse(array(
  1132.                         'templateData' => $twigData,
  1133.                         'message' => $message,
  1134.                         'actionData' => $email_twig_data,
  1135.                         'success' => isset($email_twig_data['success']) ? $email_twig_data['success'] : false,
  1136.                     )
  1137.                 );
  1138.                 $response->headers->set('Access-Control-Allow-Origin''*');
  1139.                 return $response;
  1140.             } else if ($email_twig_data['success'] == true) {
  1141.                 if ($systemType == '_ERP_'$twig_file '@Authentication/pages/views/reset_password_success_central.html.twig';
  1142.                 else if ($systemType == '_BUDDYBEE_'$twig_file '@Authentication/pages/views/reset_password_success_buddybee.html.twig';
  1143.                 else if ($systemType == '_CENTRAL_'$twig_file '@Authentication/pages/views/reset_password_success_central.html.twig';
  1144.                 $twigData = [
  1145.                     'page_title' => 'Reset Successful',
  1146.                     'encryptedData' => $encryptedData,
  1147.                     'message' => $message,
  1148.                     'userType' => $userType,
  1149.                     'errorField' => $errorField,
  1150.                 ];
  1151.                 return $this->render(
  1152.                     $twig_file,
  1153.                     $twigData
  1154.                 );
  1155.             }
  1156.         }
  1157.         if ($systemType == '_ERP_') {
  1158.             if ($userCategory == '_APPLICANT_') {
  1159.                 $userType $session->get(UserConstants::USER_TYPE);
  1160.                 $twig_file 'ApplicationBundle:pages/login:find_account_buddybee.html.twig';
  1161.                 $twigData = [
  1162.                     'page_title' => 'Find Account',
  1163.                     'encryptedData' => $encryptedData,
  1164.                     'message' => $message,
  1165.                     'userType' => $userType,
  1166.                     'errorField' => $errorField,
  1167.                 ];
  1168.             } else {
  1169.                 $userType $session->get(UserConstants::USER_TYPE);
  1170.                 $twig_file 'ApplicationBundle:pages/login:reset_password_erp.html.twig';
  1171.                 $twigData = [
  1172.                     'page_title' => 'Reset Password',
  1173.                     'encryptedData' => $encryptedData,
  1174.                     'message' => $message,
  1175.                     'userType' => $userType,
  1176.                     'errorField' => $errorField,
  1177.                 ];
  1178.             }
  1179.         } else if ($systemType == '_BUDDYBEE_') {
  1180.             $userType UserConstants::USER_TYPE_APPLICANT;
  1181.             $twig_file '@Authentication/pages/views/reset_new_password_buddybee.html.twig';
  1182.             $twigData = [
  1183.                 'page_title' => 'Reset Password',
  1184.                 'encryptedData' => $encryptedData,
  1185.                 'message' => $message,
  1186.                 'userType' => $userType,
  1187.                 'errorField' => $errorField,
  1188.             ];
  1189.         } else if ($systemType == '_CENTRAL_') {
  1190.             $userType UserConstants::USER_TYPE_APPLICANT;
  1191.             $twig_file '@Authentication/pages/views/reset_new_password_central.html.twig';
  1192.             $twigData = [
  1193.                 'page_title' => 'Reset Password',
  1194.                 'encryptedData' => $encryptedData,
  1195.                 'message' => $message,
  1196.                 'userType' => $userType,
  1197.                 'errorField' => $errorField,
  1198.             ];
  1199.         }
  1200.         if ($request->request->has('remoteVerify') || $request->request->has('returnJson') || $request->query->has('returnJson')) {
  1201.             if ($userId != && $userId != null) {
  1202.                 $response = new JsonResponse(array(
  1203.                         'templateData' => $twigData,
  1204.                         'message' => $message,
  1205.                         'actionData' => $email_twig_data,
  1206.                         'success' => isset($email_twig_data['success']) ? $email_twig_data['success'] : false,
  1207.                     )
  1208.                 );
  1209.             } else {
  1210.                 $response = new JsonResponse(array(
  1211.                         'templateData' => [],
  1212.                         'message' => 'Unauthorized',
  1213.                         'actionData' => [],
  1214.                         'success' => false,
  1215.                     )
  1216.                 );
  1217.             }
  1218.             $response->headers->set('Access-Control-Allow-Origin''*');
  1219.             return $response;
  1220.         } else {
  1221.             if ($userId != && $userId != null) {
  1222.                 return $this->render(
  1223.                     $twig_file,
  1224.                     $twigData
  1225.                 );
  1226.             } else
  1227.                 return $this->render('@Buddybee/pages/404NotFound.html.twig', array(
  1228.                     'page_title' => '404 Not Found',
  1229.                 ));
  1230.         }
  1231.     }
  1232.     public function SalaryCertificateViewAction(Request $request$id)
  1233.     {
  1234.         if (!is_numeric($id)) {
  1235.             $idData json_decode($this->get('url_encryptor')->decrypt($id), true);
  1236.         } else {
  1237.             $idData = array(
  1238.                 'id' => $id,
  1239.                 'appId' => $request->get('appId'),
  1240.             );
  1241.         }
  1242.         $id $idData['id'];
  1243.         $printDate = isset($idData['dt']) ? new \DateTime($idData['dt']) : new \DateTime();
  1244.         $em $this->getDoctrine()->getManager('company_group');
  1245.         $em->getConnection()->connect();
  1246.         $connected $em->getConnection()->isConnected();
  1247.         if ($connected)
  1248.             $goc $this->getDoctrine()->getManager('company_group')
  1249.                 ->getRepository("CompanyGroupBundle:CompanyGroup")
  1250.                 ->findOneBy(
  1251.                     array(
  1252.                         'appId' => $idData['appId']
  1253.                     )
  1254.                 );
  1255.         $connector $this->container->get('application_connector');
  1256.         $connector->resetConnection(
  1257.             'default',
  1258.             $goc->getDbName(),
  1259.             $goc->getDbUser(),
  1260.             $goc->getDbPass(),
  1261.             $goc->getDbHost(),
  1262.             $reset true);
  1263.         $em $this->getDoctrine()->getManager();
  1264.         $employee $em
  1265.             ->getRepository("ApplicationBundle:Employee")
  1266.             ->findOneBy(
  1267.                 array(
  1268.                     'employeeId' => $idData['id']
  1269.                 )
  1270.             );
  1271.         $employeeDetails $em
  1272.             ->getRepository("ApplicationBundle:EmployeeDetails")
  1273.             ->findOneBy(
  1274.                 array(
  1275.                     'id' => $idData['id']
  1276.                 )
  1277.             );
  1278.         $earningValues = [];
  1279. //        $deductionValues=[];
  1280. //        $facilityValues=[];
  1281.         for ($j 0$j 10$j++) {
  1282.             if ($employeeDetails->{'getEar' . ($j 1)}() != && $employeeDetails->{'getEar' . ($j 1)}() != null && $employeeDetails->{'getEar' . ($j 1)}() != '')
  1283.                 $earningValues[$j 1] = $employeeDetails->{'getEar' . ($j 1)}();
  1284.         }
  1285. //        for($j=0;$j<10;$j++){
  1286. //            if($employeeDetails->{'getFac'.($j+1)}()!=0 && $payslip->{'getFac'.($j+1)}()!=null && $payslip->{'getFac'.($j+1)}()!='')
  1287. //                $facilityValues[$j+1]=$payslip->{'getFac'.($j+1)}();
  1288. //
  1289. //        }
  1290. //        for($j=0;$j<10;$j++){
  1291. //            if($employeeDetails->{'getDed'.($j+1)}()!=0 && $payslip->{'getDed'.($j+1)}()!=null && $payslip->{'getDed'.($j+1)}()!='')
  1292. //                $deductionValues[$j+1]=$payslip->{'getDed'.($j+1)}();
  1293. //        }
  1294.         $dept $em
  1295.             ->getRepository("ApplicationBundle:SysDepartment")
  1296.             ->findOneBy(
  1297.                 array(
  1298.                     'departmentId' => $employeeDetails->getDept()
  1299.                 )
  1300.             );
  1301.         $desg $em
  1302.             ->getRepository("ApplicationBundle:SysDepartmentPosition")
  1303.             ->findOneBy(
  1304.                 array(
  1305.                     'positionId' => $employeeDetails->getDesg()
  1306.                 )
  1307.             );
  1308.         $authorizations = [
  1309.             [
  1310.                 'auth' => 1,
  1311.                 'auth_type' => 'Authorized By',
  1312.                 'name' => 'Arif Hossain',
  1313.                 'designation' => 'Accounts Manager',
  1314.                 'signature' => 'iVBORw0KGgoAAAANSUhEUgAAAMgAAAB7CAIAAAC+ZFgSAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4nH29WbBmx5Eelpl1/rv2gu5GL1gbaBIbCZAESXADKXC4D7exSIVnJIdHkj0h2SG/+MHhBzn84rDDfnA47AeHHAqHLY8UIyskjTQLbdLGDIccLhgCJIh9R6MbDaD3Rnff7nvv/59MP2RV1ld1LnwC0fjv/59TlZX55VrL4T//wZ8QERGZmf8rIsxsZsw8juN8VGYmIv/XzPwn/xMfVFUzmw1JmM1Mic2MiYTFbxdhM1uMSsxkREzjOBKRiHj7qhpdmxkTMxEzMxsRscjW9hzvdwKYOTH5I0SkqnFDtElwmdmooxER0Tjm8fqDzJSSpJRMVcdMjIiISAycdrrGcTRjEXEmiYiqqfpA1Aee71Q1Ym9wsVgMw+AEe0dO35DEzCQN88UCuS0pkZkwk2VB+CPGpKo45PqTmX8/jqOI+E/+5zAMIkyUbzBzgoWZ41kmmw3DOI5GPBY6/Uop5XvK/YvFIrqTYJbzN9BTelInxcwcBNhrx2j/SdXiT2bmcrO3Q0TsICALGAU0XboIAacoeFGbLVh3qWOPARQkbKoJKaXue+daviEPgqJxlByCOHpBNLf95s/lnvrtMAxBfyAvGFIAqlUiWgUSNwcrsGtsMG7zh/1PhwUiI6WUkjCbS74bKTEFpJg5UDVljvM/A5CYiBtmmNl8Ph9hVAx2qxNb+2czpEwTZTE47KpNYk4pBXCjC0QhEbGImoUUgfWE0I+Ligp2zI07hYXMmDiJEJmPXpiTZGLUGvWY2ir8UlXNGj7A/SYiBo+kJF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sml1JthxjkCQ4t0Ny1BoxtysI7lCI7YeTBwJsKQwJ5lwK3JxwVZ+vTyQJ0U6srjQFoBYMCQ2FUQLiBL72klNoSVG4nlnpEP53lRzcdAkbuW/v41BppuaJ9PLsrRIgoIdC0Tk5IGEp6R2AFGzs9r9qV97X3fhMfkbIuAw/YQVIh9yL8voqC/OiHvIbNG///ABGzUQqrQUb/AAAAAElFTkSuQmCC'
  1315.             ],
  1316.             [
  1317.                 'auth' => 1,
  1318.                 'auth_type' => 'Verified By',
  1319.                 'name' => 'Emrul Hasan',
  1320.                 'designation' => 'Managing Director',
  1321.                 'signature' => 'iVBORw0KGgoAAAANSUhEUgAAAMgAAAAxCAIAAAAQp3EYAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4nGW9eZhd1XUnuoZ9zr01qqo0oREJBIhRYMDMQzAYDBjj2Q527Dh2nMRxkk5i56Wf87q/5Hvd/b186ffyknTbbg+J7dhx7HiKx2AMGMwoQAKEEJqlKqlKNY/33nP2Wuv9sfY5Vc67f/CVLvfec/bea/yt31oHF+ZLADAzRDRTAGRmETEzZmZGUVM1ZirLkjkgIiLEKACAiESECIioaqoRCbMsiJgpqAoxIpKpAfj3QEQAgJnUQFX9R8wMwFQNEZkJABFAVZkJEVXVv4wI/pnqK4gIqmAmzCSiSGgAKmAGgf3/GgASQYyqqkhERABmBgCACCIKAFlgM4tRQmAR9d0Q1SzLfFsQIEZhpigaAqsqAGaB/SbNTERVjYjVFBGJEADAQFV8i8yMiESEKPgN+Cr8k2ZpK/wsiFDVEMEMzCBGgbRkYGYAYCJVRQQi8t1DBFUkwijqP2JmhOhfMTO/E1+vf6s6O4hRAQgJAYwIAAEBJIoZAKCZIREz+Q6AATOK1LdnIVCMqmbMpGqEQAQ4P1esWA8RISKKqC/bzIh9DSQiLkmqqqrM7D/t8sHMAL5CUtUYhZk5oBmoGCICGELacUnnAfW1EAEAXIJVTUVcgFwOENMK/QCYCQBUgchFB9KdmCKRKfqelmXJrhw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EGh+EOXNI0qriDPFHBztUyf91txAAn/P8vdy+z0pwkWAAAAAElFTkSuQmCC'
  1322.             ],
  1323.             [
  1324.                 'auth' => 1,
  1325.                 'auth_type' => 'Approved By',
  1326.                 'name' => 'Khandoker Mozibul Yasser',
  1327.                 'designation' => 'Chairman',
  1328.                 'signature' => 'iVBORw0KGgoAAAANSUhEUgAAAMgAAABSCAIAAACexwzsAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4nH19d5gexZF+Vfd8u6tVRjkL5YDISCIIkY8cbLANh7E5Ew34jDM+Y/vOvsc2vuCEf4azOXw4gA0miSSihHIWQglEEMo5a7X7TVf9/qiZmpqexQOPntn5Zrqrq956u7q6pwcXLH4LAJxziMjMiBhCAABElCtyDgByIlfkTuccMxOR3mDv13O5Qf51zunjesLMUpQtP0kSPZcTFUCetSUQERFJOUmSWJEAARGYABAAWEvg/HDORbXrCQAQkchsBdBf5UFtu1RKRFEhIqG2XdUrN2cigdMHrc61LZkOHSBgmgapul0BIl1F8shTZeUwswqJ6DJjqZBavgNgypvJDMAAEMpiZAa1jylKrArUACo6Inrv9SeVkpkz6+V1RHoR1FYVYW1ghbNajoBoH4lkU1NlPzEDg73ZwqJWqzmXWdQCDozzWKmiE73ZXlGftF5UyA9oa8kaCNn91pbSFitVXnLJ7RU31p/1fvlTJJEbyr7NkD8MAM4h55qxFtHSCAAcBmACEFhRRavM7BATywFqEsso1dKrvmgQAPJLZGxrS+sEemeEG6uvyMZy3T4oYnvv0zS1TJBrsKioXDNEJVteUajZtluQ6W22pVXEK9YzdQEyg0MkJttShYs+VTCZeTwTkoOtC6utKvOi+LMQc1YsECIwFJpEAHQIgNCeq4BxdZIbEBgYjKFLdxJnwBQisfQQ2RsKjJfQFt3friWqbq0PquqrJVi9lGRwKErR0rz3Lj/kHmuVokwhLwaEmG/sub1oLRr9ad3MtqXaOsWu2MN7BxgzXGRIlT/qOqQViHGXWqG0UqShYmfdhVBkLiERCXHZhkfNjOwiCpe6L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vFawoAAJm2wec9tUhI9r1LZpSyhLARWVZ2C6CZAVg3T8w/5CkiZb+CJDiJ87QUOOeAmYj+PwqkrWeCYJzmAAAAAElFTkSuQmCC'
  1329.             ]
  1330.         ];
  1331.         //        $company_data = Company::getCompanyData($em, $this->getLoggedUserCompanyId($request));
  1332.         $company_data Company::getCompanyData($em1);
  1333.         $document_mark = array(
  1334.             'original' => '/images/Original-Stamp-PNG-Picture.png',
  1335.             'copy' => ''
  1336.         );
  1337.         if ($request->query->has('pdf') && $this->get('knp_snappy.pdf')) {
  1338.             $html $this->renderView(
  1339.                 '@Application/pages/human_resource/print/salary_certificate.html.twig',
  1340.                 array(
  1341.                     //full array here
  1342.                     'pdf' => true,
  1343.                     'page_title' => 'Salary Certificate',
  1344.                     'employee' => $employee,
  1345.                     'printDate' => $printDate,
  1346.                     'desg' => $desg,
  1347.                     'employeeDetails' => $employeeDetails,
  1348.                     'earningValues' => $earningValues,
  1349.                     'authorizations' => $authorizations,
  1350.                     'appId' => $idData['appId'],
  1351.                     'export' => 'pdf,print',
  1352.                     'document_mark_image' => $document_mark['original'],
  1353.                     'company_name' => $company_data->getName(),
  1354.                     'company_data' => $company_data,
  1355.                     'company_address' => $company_data->getAddress(),
  1356.                     'company_image' => $company_data->getImage(),
  1357.                     'invoice_footer' => $company_data->getInvoiceFooter(),
  1358.                     'page_header' => 'New Product',
  1359.                     'document_type' => 'Sales Bill',
  1360.                     'page_header_sub' => 'Add',
  1361.                     //                'type_list'=>$type_list,
  1362.                     //                'mis_data'=>$mis_data,
  1363.                     //                'mis_print'=>$mis_print,
  1364.                     'item_data' => [],
  1365.                     'received' => 2,
  1366.                     'return' => 1,
  1367.                     'total_w_vat' => 1,
  1368.                     'total_vat' => 1,
  1369.                     'total_wo_vat' => 1,
  1370.                     'invoice_id' => 'abcd1234',
  1371.                     'created_by' => 'created by',
  1372.                     'created_at' => '',
  1373.                     'red' => 0,
  1374.                 )
  1375.             );
  1376.             $pdf_response $this->get('knp_snappy.pdf')->getOutputFromHtml($html, array(
  1377.                 //                'orientation' => 'landscape',
  1378.                 //                'enable-javascript' => true,
  1379.                 //                'javascript-delay' => 1000,
  1380.                 'no-stop-slow-scripts' => false,
  1381.                 'no-background' => false,
  1382.                 'lowquality' => false,
  1383.                 'encoding' => 'utf-8',
  1384.                 //            'images' => true,
  1385.                 //            'cookie' => array(),
  1386.                 'dpi' => 300,
  1387.                 'image-dpi' => 300,
  1388.                 //                'enable-external-links' => true,
  1389.                 //                'enable-internal-links' => true
  1390.             ));
  1391.             return new Response(
  1392.                 $pdf_response,
  1393.                 200,
  1394.                 array(
  1395.                     'Content-Type' => 'application/pdf',
  1396.                     'Content-Disposition' => 'attachment; filename="salary_certificate_' $id '.pdf"'
  1397.                 )
  1398.             );
  1399.         }
  1400.         return $this->render(
  1401.             '@Application/pages/human_resource/print/salary_certificate.html.twig',
  1402.             array(
  1403.                 'page_title' => 'Salary Certificate ',
  1404.                 'employee' => $employee,
  1405.                 'printDate' => $printDate,
  1406.                 'employeeDetails' => $employeeDetails,
  1407.                 'earningValues' => $earningValues,
  1408.                 'desg' => $desg,
  1409.                 'authorizations' => $authorizations,
  1410.                 'appId' => $idData['appId'],
  1411.                 'export' => 'none',
  1412.                 'document_mark_image' => $document_mark['original'],
  1413.                 'company_name' => $company_data->getName(),
  1414.                 'company_data' => $company_data,
  1415.                 'company_address' => $company_data->getAddress(),
  1416.                 'company_image' => $company_data->getImage(),
  1417.                 'invoice_footer' => $company_data->getInvoiceFooter(),
  1418.                 'page_header' => 'New Product',
  1419.                 'document_type' => 'Sales Bill',
  1420.                 'page_header_sub' => 'Add',
  1421.                 //                'type_list'=>$type_list,
  1422.                 //                'mis_data'=>$mis_data,
  1423.                 //                'mis_print'=>$mis_print,
  1424.                 'item_data' => [],
  1425.                 'received' => 2,
  1426.                 'return' => 1,
  1427.                 'total_w_vat' => 1,
  1428.                 'total_vat' => 1,
  1429.                 'total_wo_vat' => 1,
  1430.                 'invoice_id' => 'abcd1234',
  1431.                 'created_by' => 'created by',
  1432.                 'created_at' => '',
  1433.                 'red' => 0,
  1434.             )
  1435.         );
  1436.     }
  1437.     public function sendSmsSocketAction(Request $request$id 0)
  1438.     {
  1439.         $msg $request->request->get('message'$request->query->get('message'''));
  1440.         $phoneNumber $request->request->get('phoneNumber'$request->query->get('phoneNumber'''));
  1441.         $emitMarker $request->request->get('emitMarker'$request->query->get('emitMarker''_SEND_TEXT_TO_MOBILE_'));
  1442.         $sendType $request->request->get('sendType'$request->query->get('sendType''all'));
  1443.         $socketUserIds $request->request->get('socketUserIds'$request->query->get('socketUserIds', []));
  1444.         if ($msg != '' && $phoneNumber != '') {
  1445.             $searchVal = [];
  1446.             $replaceVal = [];
  1447.             $msg str_replace($searchVal$replaceVal$msg);
  1448.             System::SendSmsBySocket($this->container->getParameter('notification_enabled'), $msg$phoneNumber$emitMarker$sendType$socketUserIds$deviceId "_DEFAULT_");
  1449. //            return 0;
  1450.         }
  1451.         if ($request->request->get('returnJson'$request->query->get('returnJson'0)) == 1) {
  1452.             return new JsonResponse(array(
  1453.                 'success' => true,
  1454.                 'message' => $msg,
  1455.                 'phoneNumber' => $phoneNumber,
  1456.                 'sendType' => $sendType,
  1457.                 'emitMarker' => $emitMarker,
  1458. //                        'documentHash' => $order->getDocumentHash(),
  1459. //                'documentId' => $receiptId,
  1460. //                'documentIdPadded' => str_pad($receiptId, 8, '0', STR_PAD_LEFT),
  1461. //
  1462. //                'viewUrl' => $url . "/" . $receiptId,
  1463.             ));
  1464.         } else return $this->render('@Buddybee/pages/send_text_by_socket.html.twig', array(
  1465.             'page_title' => 'Send Text',
  1466.             'message' => $msg,
  1467.             'phoneNumber' => $phoneNumber,
  1468.             'sendType' => $sendType,
  1469.             'emitMarker' => $emitMarker,
  1470.         ));
  1471.     }
  1472.     public function sendPushNotificationSocketAction(Request $request$id 0)
  1473.     {
  1474.         $tokens explode(','$request->query->get('tokens'''));
  1475.         $options $request->request->get('options', [
  1476.             'em' => null,
  1477.             'isBuddybee' => 1,
  1478.             'targetRoute' => 'consultancy_session',
  1479.             'targetUrl' => 'consultancy_session',
  1480.             'targetPath' => 'consultancy_session',
  1481.             'targetId' => 0,
  1482.             'meetingId' => 0,
  1483.             'userId' => 0,
  1484.             'applicantId' => 0,
  1485.             'taggedUserIds' => [],
  1486.             'type' => 0,
  1487.             'expireTs' => 0,
  1488.             'userIdPrefixForSocket' => 'BBEE_',
  1489.             'emitMarker' => '_SOCKET_NOTIFICATION_HERE_',
  1490.             'dataObj' => array(
  1491.                 'isBuddybee' => 1,
  1492.                 'targetRoute' => 'consultancy_session',
  1493.                 'targetUrl' => 'consultancy_session',
  1494.                 'targetPath' => 'consultancy_session',
  1495.                 'targetMobileAppPath' =>
  1496.                     isset(GeneralConstant::$MOBILE_APP_PATH_BY_ROUTING['consultancy_session']) ? GeneralConstant::$MOBILE_APP_PATH_BY_ROUTING['consultancy_session'] : '',
  1497.                 'targetId' => 0,
  1498.                 'meetingId' => 0,
  1499.                 'userId' => 0,
  1500.                 'applicantId' => 0,
  1501.                 'taggedUserIds' => [0],
  1502.             ),
  1503.             'firebasePushData' => array(
  1504.                 'notification' => array(
  1505.                     'title' => $request->query->get('title''TITLE HERE'),
  1506.                     'body' => $request->query->get('body''MY NOTIFICATION BODY')
  1507.                 ),
  1508.                 'data' => [
  1509. //                                'score' => '850',
  1510. //                                'time' => '2:45',
  1511.                     'route' => 'https://buddybee.eu/consultancy_session/1'
  1512.                 ],
  1513.                 'android' => [
  1514.                     'notification' => [
  1515.                         // icon: 'stock_ticker_update',
  1516.                         // color: '#7e55c3',
  1517.                         'imageUrl' => 'https://buddybee.eu/buddybee_assets/images/author-1.png'
  1518.                     ]
  1519.                 ],
  1520.                 'topic' => 'SESSION BOOKED',
  1521.                 'tokens' => $tokens,
  1522.             )
  1523.         ]);
  1524.         if (is_string($options)) $options json_decode($optionstrue);
  1525.         System::AddNewNotificationUpdated(
  1526.             $this->container->getParameter('notification_enabled'),
  1527.             $this->container->getParameter('notification_server'),
  1528.             0//appId
  1529.             0,//company Id
  1530.             '',
  1531.             GeneralConstant::NOTIFICATION_TYPE_ALERT,//type
  1532.             "",
  1533.             "Schedule Confirmed",
  1534.             'emit',
  1535.             0,
  1536.             1,
  1537.             $options
  1538.         );
  1539.         return new JsonResponse($options);
  1540.     }
  1541.     public function GetEntitySignatureAction(Request $request)
  1542.     {
  1543.         $details_ids = [];
  1544.         $em $this->getDoctrine()->getManager('company_group');
  1545.         $retData = [
  1546.             'success' => false,
  1547.         ];
  1548.         if ($request->isMethod('POST')) {
  1549.             $query_here $em->getRepository('CompanyGroupBundle:EntityEncryptedSignature')
  1550.                 ->findOneBy(
  1551.                     array(
  1552.                         'userId' => $request->request->get('userId'0)
  1553.                     )
  1554.                 );
  1555.             if ($query_here) {
  1556.                 $retData['success'] = true;
  1557.                 $retData['data'] = $query_here->getData();
  1558.             }
  1559.         }
  1560.         return new JsonResponse($retData);
  1561.     }
  1562.     public function SwitchAppAction(Request $request)
  1563.     {
  1564.         $details_ids = [];
  1565.         $em $this->getDoctrine()->getManager('company_group');
  1566.         $retData = [
  1567.             'success' => false,
  1568.         ];
  1569.         return new JsonResponse($retData);
  1570.     }
  1571.     public function ViewDocByGlobalIdAction(Request $request$trackingId ''$appMarker '')
  1572.     {
  1573. //        $em = $this->getDoctrine()->getManager();
  1574.         $globalIdStr $request->get('globalIdStr''');
  1575.         $globalIdData MiscActions::getExpandedDataFromGlobalId($globalIdStr);
  1576.         $routeName $request->attributes->get('_route');
  1577.         $pbcId 0;
  1578.         $goc 0;
  1579.         $appId 0//these we will need eventually
  1580.         $productByCodeData = [];
  1581.         $productByCodeDataObj = [];
  1582.         $productByData = [];
  1583.         $trackingData = [];
  1584.         $productName '';
  1585.         $em_goc $this->getDoctrine()->getManager('company_group');
  1586.         $em_goc->getConnection()->connect();
  1587.         $gocEnabled 0;
  1588.         if ($this->container->hasParameter('entity_group_enabled'))
  1589.             $gocEnabled $this->container->getParameter('entity_group_enabled');
  1590.         if ($gocEnabled == 1)
  1591.             $connected $em_goc->getConnection()->isConnected();
  1592.         else
  1593.             $connected false;
  1594.         $goc null;
  1595.         if ($connected) {
  1596.             if ($routeName == 'track_after_sales_service_product_serial_query') {
  1597.                 if ($appMarker != '') {
  1598.                     $goc $em_goc
  1599.                         ->getRepository("CompanyGroupBundle:CompanyGroup")
  1600.                         ->findOneBy(
  1601.                             array(
  1602.                                 'companyGroupHash' => $appMarker
  1603.                             )
  1604.                         );
  1605.                 }
  1606.             } else {
  1607. //                if($trackingId !='' && stripos($trackingId,'TR') !== false)
  1608. //                {
  1609. //                    $appId=substr($trackingId,2,5);
  1610. //                    $pbcId=substr($trackingId,7,8);
  1611. //                    if(!is_numeric($appId))
  1612. //                        $appId=0;
  1613. //                }
  1614.                 $goc $em_goc
  1615.                     ->getRepository("CompanyGroupBundle:CompanyGroup")
  1616.                     ->findOneBy(
  1617.                         array(
  1618.                             'appId' => $appId
  1619.                         )
  1620.                     );
  1621.             }
  1622.         }
  1623.         if ($goc) {
  1624.             $appId $goc->getAppId();
  1625.             $appMarker $goc->getCompanyGroupHash();
  1626.             $connector $this->container->get('application_connector');
  1627.             $connector->resetConnection(
  1628.                 'default',
  1629.                 $goc->getDbName(),
  1630.                 $goc->getDbUser(),
  1631.                 $goc->getDbPass(),
  1632.                 $goc->getDbHost(),
  1633.                 $reset true
  1634.             );
  1635.         }
  1636.         //now get related data if $goc exists
  1637.         $em $this->getDoctrine()->getManager();
  1638.         $responseData = [
  1639.             'page_title' => 'Entity Setup',
  1640.             'appId' => $appId,
  1641.             'appMarker' => $appMarker,
  1642.         ];
  1643.         return $this->render(
  1644. //            '@System/pages/public:entity_setup.html.twig',
  1645.             'ApplicationBundle:pages/central:setup_app.html.twig',
  1646.             $responseData
  1647.         );
  1648.     }
  1649.     public function EntitySetupAction(Request $request$trackingId ''$appMarker '')
  1650.     {
  1651. //        $em = $this->getDoctrine()->getManager();
  1652.         $routeName $request->attributes->get('_route');
  1653.         $pbcId 0;
  1654.         $goc 0;
  1655.         $appId 0//these we will need eventually
  1656.         $productByCodeData = [];
  1657.         $productByCodeDataObj = [];
  1658.         $productByData = [];
  1659.         $trackingData = [];
  1660.         $productName '';
  1661.         $em_goc $this->getDoctrine()->getManager('company_group');
  1662.         $em_goc->getConnection()->connect();
  1663.         $gocEnabled 0;
  1664.         if ($this->container->hasParameter('entity_group_enabled'))
  1665.             $gocEnabled $this->container->getParameter('entity_group_enabled');
  1666.         if ($gocEnabled == 1)
  1667.             $connected $em_goc->getConnection()->isConnected();
  1668.         else
  1669.             $connected false;
  1670.         $goc null;
  1671.         if ($connected) {
  1672.             if ($routeName == 'track_after_sales_service_product_serial_query') {
  1673.                 if ($appMarker != '') {
  1674.                     $goc $em_goc
  1675.                         ->getRepository("CompanyGroupBundle:CompanyGroup")
  1676.                         ->findOneBy(
  1677.                             array(
  1678.                                 'companyGroupHash' => $appMarker
  1679.                             )
  1680.                         );
  1681.                 }
  1682.             } else {
  1683. //                if($trackingId !='' && stripos($trackingId,'TR') !== false)
  1684. //                {
  1685. //                    $appId=substr($trackingId,2,5);
  1686. //                    $pbcId=substr($trackingId,7,8);
  1687. //                    if(!is_numeric($appId))
  1688. //                        $appId=0;
  1689. //                }
  1690.                 $goc $em_goc
  1691.                     ->getRepository("CompanyGroupBundle:CompanyGroup")
  1692.                     ->findOneBy(
  1693.                         array(
  1694.                             'appId' => $appId
  1695.                         )
  1696.                     );
  1697.             }
  1698.         }
  1699.         if ($goc) {
  1700.             $appId $goc->getAppId();
  1701.             $appMarker $goc->getCompanyGroupHash();
  1702.             $connector $this->container->get('application_connector');
  1703.             $connector->resetConnection(
  1704.                 'default',
  1705.                 $goc->getDbName(),
  1706.                 $goc->getDbUser(),
  1707.                 $goc->getDbPass(),
  1708.                 $goc->getDbHost(),
  1709.                 $reset true
  1710.             );
  1711.         }
  1712.         //now get related data if $goc exists
  1713.         $em $this->getDoctrine()->getManager();
  1714.         $responseData = [
  1715.             'page_title' => 'Entity Setup',
  1716.             'appId' => $appId,
  1717.             'appMarker' => $appMarker,
  1718.         ];
  1719.         return $this->render(
  1720. //            '@System/pages/public:entity_setup.html.twig',
  1721.             'ApplicationBundle:pages/central:setup_app.html.twig',
  1722.             $responseData
  1723.         );
  1724.     }
  1725.     public function AfterSalesServiceTrackingAction(Request $request$trackingId ''$appMarker '')
  1726.     {
  1727. //        $em = $this->getDoctrine()->getManager();
  1728.         $routeName $request->attributes->get('_route');
  1729.         $pbcId 0;
  1730.         $goc 0;
  1731.         $appId 0//these we will need eventually
  1732.         $productByCodeData = [];
  1733.         $productByCodeDataObj = [];
  1734.         $productByData = [];
  1735.         $trackingData = [];
  1736.         $productName '';
  1737.         $em_goc $this->getDoctrine()->getManager('company_group');
  1738.         $em_goc->getConnection()->connect();
  1739.         $gocEnabled 0;
  1740.         if ($this->container->hasParameter('entity_group_enabled'))
  1741.             $gocEnabled $this->container->getParameter('entity_group_enabled');
  1742.         if ($gocEnabled == 1)
  1743.             $connected $em_goc->getConnection()->isConnected();
  1744.         else
  1745.             $connected false;
  1746.         $goc null;
  1747.         if ($connected) {
  1748.             if ($routeName == 'track_after_sales_service_product_serial_query') {
  1749.                 if ($appMarker != '') {
  1750.                     $goc $em_goc
  1751.                         ->getRepository("CompanyGroupBundle:CompanyGroup")
  1752.                         ->findOneBy(
  1753.                             array(
  1754.                                 'companyGroupHash' => $appMarker
  1755.                             )
  1756.                         );
  1757.                 }
  1758.             } else {
  1759.                 if ($trackingId != '' && stripos($trackingId'TR') !== false) {
  1760.                     $appId substr($trackingId25);
  1761.                     $pbcId substr($trackingId78);
  1762.                     if (!is_numeric($appId))
  1763.                         $appId 0;
  1764.                 }
  1765.                 $goc $em_goc
  1766.                     ->getRepository("CompanyGroupBundle:CompanyGroup")
  1767.                     ->findOneBy(
  1768.                         array(
  1769.                             'appId' => $appId
  1770.                         )
  1771.                     );
  1772.             }
  1773.         }
  1774.         if ($goc) {
  1775.             $appId $goc->getAppId();
  1776.             $appMarker $goc->getCompanyGroupHash();
  1777.             $connector $this->container->get('application_connector');
  1778.             $connector->resetConnection(
  1779.                 'default',
  1780.                 $goc->getDbName(),
  1781.                 $goc->getDbUser(),
  1782.                 $goc->getDbPass(),
  1783.                 $goc->getDbHost(),
  1784.                 $reset true
  1785.             );
  1786.         }
  1787.         //now get related data if $goc exists
  1788.         $em $this->getDoctrine()->getManager();
  1789.         if ($trackingId != '') {
  1790.             if (is_numeric($trackingId)) {
  1791.                 $productByCodeDataQuery $em->getRepository('ApplicationBundle:ProductByCode')
  1792.                     ->createQueryBuilder('p')
  1793.                     ->where("( p.salesCode like '%$trackingId%'
  1794.                                     or p.imei1 like '%$trackingId%'
  1795.                                     or p.imei2 like '%$trackingId%'
  1796.                                     or p.imei3 like '%$trackingId%'
  1797.                                     or p.imei4 like '%$trackingId%'
  1798.                                     or p.serialNo like '%$trackingId%'
  1799.                                     )")
  1800.                     ->getQuery()
  1801.                     ->getResult();
  1802.                 if (!empty($productByCodeDataQuery))
  1803.                     $productByCodeData $productByCodeDataQuery[0];
  1804.             } else if ($pbcId != 0) {
  1805.                 $productByCodeData $em
  1806.                     ->getRepository("ApplicationBundle:ProductByCode")
  1807.                     ->findOneBy(
  1808.                         array(
  1809.                             'productByCodeId' => $pbcId
  1810.                         )
  1811.                     );
  1812.             } else {
  1813.                 $productByCodeData $em
  1814.                     ->getRepository("ApplicationBundle:ProductByCode")
  1815.                     ->findOneBy(
  1816.                         array(
  1817.                             'afterSalesTrackingId' => $trackingId
  1818.                         )
  1819.                     );
  1820.             }
  1821.         }
  1822.         if (!empty($productByCodeData)) {
  1823.             $productData $em
  1824.                 ->getRepository("ApplicationBundle:InvProducts")
  1825.                 ->findOneBy(
  1826.                     array(
  1827.                         'id' => $productByCodeData->getProductId()
  1828.                     )
  1829.                 );
  1830.             if ($productData) {
  1831.                 $productName $productData->getName();
  1832.             }
  1833.             $trackingData json_decode($productByCodeData->getAfterSalesServiceTrackingStatusData(), true);
  1834.             if ($trackingData == null)
  1835.                 $trackingData = [];
  1836.             $productByCodeDataObj['productByCodeId'] = $productByCodeData->getProductByCodeId();
  1837.             $productByCodeDataObj['salesCode'] = $productByCodeData->getSalesCode();
  1838.             $productByCodeDataObj['serialNo'] = $productByCodeData->getSerialNo();
  1839.             $productByCodeDataObj['imei1'] = $productByCodeData->getImei1();
  1840.             $productByCodeDataObj['imei2'] = $productByCodeData->getImei2();
  1841.             $productByCodeDataObj['imei3'] = $productByCodeData->getImei3();
  1842.             $productByCodeDataObj['imei4'] = $productByCodeData->getImei4();
  1843.         }
  1844.         $responseData = [
  1845.             'page_title' => 'Service Tracking',
  1846.             'productByCodeData' => $productByCodeData,
  1847.             'productByCodeDataObj' => $productByCodeDataObj,
  1848.             'trackingData' => $trackingData,
  1849.             'productName' => $productName,
  1850.             'appId' => $appId,
  1851.             'appMarker' => $appMarker,
  1852.             'trackingId' => $trackingId,
  1853.         ];
  1854.         return $this->render(
  1855.             '@Sales/pages/report/after_sales_service_tracking_public.html.twig',
  1856.             $responseData
  1857.         );
  1858.     }
  1859.     public function MeetingConfirmationAction(Request $request)
  1860.     {
  1861. //        $em = $this->getDoctrine()->getManager();
  1862.         $resMessage "";
  1863.         $resMessageType "";
  1864.         if ($request->query->get('appId') != && $request->query->get('appId') != "") {
  1865.             $em_goc $this->getDoctrine()->getManager('company_group');
  1866.             $em_goc->getConnection()->connect();
  1867.             $gocEnabled 0;
  1868.             if ($this->container->hasParameter('entity_group_enabled'))
  1869.                 $gocEnabled $this->container->getParameter('entity_group_enabled');
  1870.             if ($gocEnabled == 1)
  1871.                 $connected $em_goc->getConnection()->isConnected();
  1872.             else
  1873.                 $connected false;
  1874.             $goc false;
  1875.             if ($connected) {
  1876.                 $goc $em_goc
  1877.                     ->getRepository("CompanyGroupBundle:CompanyGroup")
  1878.                     ->findOneBy(
  1879.                         array(
  1880.                             'appId' => $request->query->get('appId')
  1881.                         )
  1882.                     );
  1883.             }
  1884.             if ($goc) {
  1885.                 $connector $this->container->get('application_connector');
  1886.                 $connector->resetConnection(
  1887.                     'default',
  1888.                     $goc->getDbName(),
  1889.                     $goc->getDbUser(),
  1890.                     $goc->getDbPass(),
  1891.                     $goc->getDbHost(),
  1892.                     $reset true
  1893.                 );
  1894.             }
  1895.         }
  1896.         $em $this->getDoctrine()->getManager();
  1897.         $response HumanResource::scheduledMeetingEmailResponse($em$request);
  1898.         if ($response['isDelayedResponse']) {
  1899.             $resMessageType " You are Late !";
  1900.             $resMessage "Delayed response! Your response will not be considered!";
  1901.         } else {
  1902.             $accept HumanResourceConstant::$meetingEmailResposeType['accepted'];
  1903.             $decline HumanResourceConstant::$meetingEmailResposeType['declined'];
  1904.             if ($response['responseType'] == $accept) {
  1905.                 $resMessageType " Success !";
  1906.                 $resMessage "You have Accepted the Meeting invitation!";
  1907.             }
  1908.             if ($response['responseType'] == $decline) {
  1909.                 $resMessageType " Declined !";
  1910.                 $resMessage "You have Declined the Meeting invitation!";
  1911.             }
  1912.         }
  1913.         return $this->render(
  1914.             'ApplicationBundle:pages/human_resource/views:meeting_confirmation_response.html.twig',
  1915.             [
  1916.                 'page_title' => 'Meeting Confirmation',
  1917.                 'message' => $resMessage,
  1918.                 'messageType' => $resMessageType,
  1919.             ]
  1920.         );
  1921.     }
  1922.     public function PublicMeetingViewAction(Request $request$id 0)
  1923.     {
  1924. //        $em = $this->getDoctrine()->getManager();
  1925.         $resMessage "";
  1926.         $resMessageType "";
  1927.         $appId 0;
  1928.         if ($request->query->get('appId') != && $request->query->get('appId') != "") {
  1929.             $em_goc $this->getDoctrine()->getManager('company_group');
  1930.             $em_goc->getConnection()->connect();
  1931.             $gocEnabled 0;
  1932.             $appId $request->query->get('appId');
  1933.             if ($this->container->hasParameter('entity_group_enabled'))
  1934.                 $gocEnabled $this->container->getParameter('entity_group_enabled');
  1935.             if ($gocEnabled == 1)
  1936.                 $connected $em_goc->getConnection()->isConnected();
  1937.             else
  1938.                 $connected false;
  1939.             $goc false;
  1940.             if ($connected) {
  1941.                 $goc $em_goc
  1942.                     ->getRepository("CompanyGroupBundle:CompanyGroup")
  1943.                     ->findOneBy(
  1944.                         array(
  1945.                             'appId' => $request->query->get('appId')
  1946.                         )
  1947.                     );
  1948.             }
  1949.             if ($goc) {
  1950.                 $connector $this->container->get('application_connector');
  1951.                 $connector->resetConnection(
  1952.                     'default',
  1953.                     $goc->getDbName(),
  1954.                     $goc->getDbUser(),
  1955.                     $goc->getDbPass(),
  1956.                     $goc->getDbHost(),
  1957.                     $reset true
  1958.                 );
  1959.             }
  1960.         }
  1961.         $em $this->getDoctrine()->getManager();
  1962.         $companyId $this->getLoggedUserCompanyId($request);
  1963.         $response HumanResource::TwigDataForScheduledMeetingView($em$request$id);
  1964.         return $this->render(
  1965.             'ApplicationBundle:pages/human_resource/views:scheduled_meeting_view.html.twig',
  1966.             [
  1967.                 'page_title' => 'View Scheduled Meeting',
  1968.                 'publicView' => 1,
  1969.                 'appId' => $response['appId'],
  1970.                 'displayName' => $request->query->has('name') ? $request->query->get('name') : 'Meeting User',
  1971.                 'duration' => $response['duration'],
  1972.                 'meeting_data' => $response['meeting_data'],
  1973.                 'agenda_list' => $response['agenda_list'],
  1974.                 'id' => $id,
  1975.                 'approval_data' => $response['approval_data'],
  1976.                 'document_log' => $response['document_log'],
  1977.                 'approval_status' => $response['approval_status'],
  1978.                 'created_by' => $response['created_by'],
  1979.                 'updated_at' => $response['updated_at'],
  1980.                 'auto_created' => 0,
  1981.             ]
  1982.         );
  1983.     }
  1984.     public function SystemChangeLogViewAction(Request $request$id 0)
  1985.     {
  1986. //        $em = $this->getDoctrine()->getManager();
  1987.         $resMessage "";
  1988.         $resMessageType "";
  1989.         $appId 0;
  1990.         $change_log_dir $this->container->getParameter('kernel.root_dir') . '/../src/ApplicationBundle/Resources/config/changelog/';
  1991. //        if (!file_exists($change_log_dir)) {
  1992. //            mkdir($change_log_dir, 0777, true);
  1993. //        }
  1994.         $path $change_log_dir '/changelog.json';
  1995.         $content file_exists($path) ? file_get_contents($path) : null;
  1996.         $contentData = array();
  1997. //        $contentData = array(
  1998. //
  1999. //
  2000. //            [
  2001. //                'versionNumber'=>'1.2.56',
  2002. //                'severity'=>'major',
  2003. //                'releaseDate'=>'12 Mar, 2022',
  2004. //                'changeLog'=>[
  2005. //                    ['type'=>'feature','text'=>'Pika is chu'],
  2006. //                    ['type'=>'bugfix','text'=>'Pika is lu'],
  2007. //                ]
  2008. //            ],
  2009. //            [
  2010. //                'versionNumber'=>'1.2.45',
  2011. //                'severity'=>'major',
  2012. //                'releaseDate'=>'01 Jan, 2022',
  2013. //                'changeLog'=>[
  2014. //                    ['type'=>'feature','text'=>'Pika is chu'],
  2015. //                    ['type'=>'bugfix','text'=>'Pika is lu'],
  2016. //                ]
  2017. //            ],
  2018. //
  2019. //        );
  2020.         if ($content)
  2021.             $contentData json_decode($contenttrue);
  2022.         return $this->render(
  2023.             '@System/pages/systemChangeLog.html.twig',
  2024.             [
  2025.                 'page_title' => 'Change Log',
  2026.                 'contentData' => $contentData,
  2027.                 'content' => $content,
  2028.                 'path' => $path,
  2029.             ]
  2030.         );
  2031.     }
  2032.     public function WellKnownAssetLinksAction(Request $request$id 0)
  2033.     {
  2034.         return new JsonResponse(array(
  2035.             [
  2036.                 "relation" => [
  2037.                     "delegate_permission/common.handle_all_urls"
  2038.                 ],
  2039.                 "target" => [
  2040.                     "namespace" => "android_app",
  2041.                     "package_name" => "eu.buddybee.consultancy",
  2042.                     "sha256_cert_fingerprints" => [
  2043.                         "B4:06:4A:7C:76:C8:E0:F1:18:00:F8:6E:1D:2F:11:1E:0C:1D:11:63:B5:95:08:DE:ED:63:A1:5F:4E:7E:A9:69"
  2044.                     ]
  2045.                 ]
  2046.             ]
  2047.         ));
  2048.     }
  2049.     public function GenericDataTableAjaxCompanyGroupAction(Request $request)
  2050.     {
  2051.         $em $this->getDoctrine()->getManager('company_group');
  2052.         $companyId $this->getLoggedUserCompanyId($request);
  2053.         $listData MiscActions::GetDtDataAjax($em$request->isMethod('POST') ? 'POST' 'GET'$request->request$companyId$this->container->getParameter('kernel.root_dir'));
  2054.         if ($request->isMethod('POST') && $request->request->has('returnJson')) {
  2055.             if ($request->query->has('dataTableQry')) {
  2056.                 return new JsonResponse(
  2057.                     $listData
  2058.                 );
  2059.             }
  2060.         }
  2061.         $data = [];
  2062.         return new JsonResponse(
  2063.             $listData
  2064.         );
  2065. //        return $this->render('@Inventory/pages/views/delivery_receipts.html.twig',
  2066. //            array(
  2067. //                'page_title' => 'Delivery Receipts',
  2068. //                'data' => $data,
  2069. //
  2070. //            )
  2071. //        );
  2072.     }
  2073.     public function GenericDataTableAjaxPublicAction(Request $request)
  2074.     {
  2075.         $em $this->getDoctrine()->getManager();
  2076.         $companyId $this->getLoggedUserCompanyId($request);
  2077.         $listData MiscActions::GetDtDataAjax($em$request->isMethod('POST') ? 'POST' 'GET'$request->request$companyId$this->container->getParameter('kernel.root_dir'));
  2078.         if ($request->isMethod('POST') && $request->request->has('returnJson')) {
  2079.             if ($request->query->has('dataTableQry')) {
  2080.                 return new JsonResponse(
  2081.                     $listData
  2082.                 );
  2083.             }
  2084.         }
  2085.         $data = [];
  2086.         return new JsonResponse(
  2087.             $listData
  2088.         );
  2089. //        return $this->render('@Inventory/pages/views/delivery_receipts.html.twig',
  2090. //            array(
  2091. //                'page_title' => 'Delivery Receipts',
  2092. //                'data' => $data,
  2093. //
  2094. //            )
  2095. //        );
  2096.     }
  2097.     public function MarkBuddybeeEventAction(Request $request$id 0)
  2098.     {
  2099.         $em $this->getDoctrine()->getManager('company_group');
  2100.         $applicantId $request->request->get('applicantId'0);
  2101.         $eventId $request->request->get('eventId'0);
  2102.         $relId $request->request->get('relId'0);
  2103.         $followStatus $request->request->get('followStatus''_UNCHANGED_');
  2104.         $skipStatus $request->request->get('skipStatus''_UNCHANGED_');
  2105.         $attendingStatus $request->request->get('attendingStatus''_UNCHANGED_');
  2106.         $successStatus false;
  2107.         if ($applicantId != && $eventId != 0) {
  2108.             $applicant $em
  2109.                 ->getRepository("CompanyGroupBundle:EntityApplicantDetails")
  2110.                 ->findOneBy(
  2111.                     array(
  2112.                         'applicantId' => $applicantId
  2113.                     )
  2114.                 );
  2115.             if ($applicant) {
  2116.                 $successStatus true;
  2117.                 if ($followStatus != '_UNCHANGED_') {
  2118.                     $currData json_decode($applicant->getFollowingEventIds(), true);
  2119.                     if ($currData == null$currData = [];
  2120.                     if ($followStatus == 1)
  2121.                         $currData array_merge($currDataarray_diff([$eventId], $currData));
  2122.                     else
  2123.                         $currData array_diff($currData, [$eventId]);
  2124.                     $applicant->setFollowingEventIds(json_encode($currData));
  2125.                 }
  2126.                 if ($followStatus != '_UNCHANGED_') {
  2127.                     $currData json_decode($applicant->getSkipEventIds(), true);
  2128.                     if ($currData == null$currData = [];
  2129.                     if ($skipStatus == 1)
  2130.                         $currData array_merge($currDataarray_diff([$eventId], $currData));
  2131.                     else
  2132.                         $currData array_diff($currData, [$eventId]);
  2133.                     $applicant->setSkipEventIds(json_encode($currData));
  2134.                     if ($skipStatus == 1) {
  2135.                         $currData json_decode($applicant->getFollowingEventIds(), true);
  2136.                         if ($currData == null$currData = [];
  2137.                         if ($followStatus == 1)
  2138.                             $currData array_merge($currDataarray_diff([$eventId], $currData));
  2139.                         else
  2140.                             $currData array_diff($currData, [$eventId]);
  2141.                         $applicant->setFollowingEventIds(json_encode($currData));
  2142.                         $currData json_decode($applicant->getAttendingEventIds(), true);
  2143.                         if ($currData == null$currData = [];
  2144.                         $currData array_diff($currData, [$eventId]);
  2145.                         $applicant->setAttendingEventIds(json_encode($currData));
  2146.                     }
  2147.                 }
  2148.                 if ($attendingStatus != '_UNCHANGED_') {
  2149.                     if ($attendingStatus == 1) {
  2150.                         $currData json_decode($applicant->getAttendingEventIds(), true);
  2151.                         if ($currData == null$currData = [];
  2152.                         $currData array_merge($currDataarray_diff([$eventId], $currData));
  2153.                         $applicant->setAttendingEventIds(json_encode($currData));
  2154.                     } else {
  2155.                         $currData json_decode($applicant->getAttendingEventIds(), true);
  2156.                         if ($currData == null$currData = [];
  2157.                         $currData array_diff($currData, [$eventId]);
  2158.                         $applicant->setAttendingEventIds(json_encode($currData));
  2159.                     }
  2160.                 }
  2161.             }
  2162.             $em->flush();
  2163.         }
  2164.         return new JsonResponse(
  2165.             array(
  2166.                 'success' => $successStatus,
  2167.                 'applicantId' => $applicantId,
  2168.                 'relId' => $relId,
  2169.                 'followStatus' => $followStatus,
  2170.                 'attendingStatus' => $attendingStatus,
  2171.             )
  2172.         );
  2173. //        return $this->render('@Inventory/pages/views/delivery_receipts.html.twig',
  2174. //            array(
  2175. //                'page_title' => 'Delivery Receipts',
  2176. //                'data' => $data,
  2177. //
  2178. //            )
  2179. //        );
  2180.     }
  2181.     public function MarkEntityNotificationAction(Request $request$id 0)
  2182.     {
  2183.         $em $this->getDoctrine()->getManager('company_group');
  2184.         $notificationIds $request->request->get('notificationIds', []);
  2185.         if ($notificationIds == '_ALL_'$notificationIds = [];
  2186.         $applicantId $request->request->get('applicantId'0);
  2187.         $readFlag $request->request->get('readFlag''_UNCHANGED_');
  2188.         $seenFlag $request->request->get('seenFlag''_UNCHANGED_');
  2189.         $deleteFlag $request->request->get('deleteFlag''0');
  2190.         $successStatus false;
  2191.         if (is_string($notificationIds)) $notificationIds json_decode($notificationIdstrue);
  2192.         if ($notificationIds == null$notificationIds = [];
  2193.         $qryArray = [];
  2194.         if (!empty($notificationIds))
  2195.             $qryArray['id'] = $notificationIds;
  2196.         if ($applicantId != 0)
  2197.             $qryArray['applicantId'] = $applicantId;
  2198.         $notifications $em
  2199.             ->getRepository("CompanyGroupBundle:EntityNotification")
  2200.             ->findBy(
  2201.                 $qryArray
  2202.             );
  2203.         foreach ($notifications as $notification) {
  2204.             if ($deleteFlag == 1) {
  2205.                 $em->remove($notification);
  2206.                 $em->flush();
  2207.             } else {
  2208.                 if ($readFlag != '_UNCHANGED_')
  2209.                     $notification->setReadFlag($readFlag);
  2210.                 if ($seenFlag != '_UNCHANGED_')
  2211.                     $notification->setSeenFlag($seenFlag);
  2212.             }
  2213.             $successStatus true;
  2214.         }
  2215.         $em->flush();
  2216.         return new JsonResponse(
  2217.             array(
  2218.                 'success' => $successStatus,
  2219.                 'applicantId' => $applicantId,
  2220.                 'notificationIds' => $notificationIds,
  2221.                 'readFlag' => $readFlag,
  2222.                 'seenFlag' => $seenFlag,
  2223.             )
  2224.         );
  2225. //        return $this->render('@Inventory/pages/views/delivery_receipts.html.twig',
  2226. //            array(
  2227. //                'page_title' => 'Delivery Receipts',
  2228. //                'data' => $data,
  2229. //
  2230. //            )
  2231. //        );
  2232.     }
  2233.     public function doLoginAction(Request $request$encData "")
  2234.     {
  2235.         $message "";
  2236.         $gocList = [];
  2237.         $skipPassword 0;
  2238.         $firstLogin 0;
  2239.         if ($encData != "")
  2240.             $encData json_decode($this->get('url_encryptor')->decrypt($encData));
  2241.         else if ($request->query->has('spd')) {
  2242.             $encData json_decode($this->get('url_encryptor')->decrypt($request->query->get('spd')));
  2243.         }
  2244.         $em_goc $this->getDoctrine()->getManager('company_group');
  2245.         $em_goc->getConnection()->connect();
  2246.         $gocEnabled 0;
  2247.         if ($this->container->hasParameter('entity_group_enabled'))
  2248.             $gocEnabled $this->container->getParameter('entity_group_enabled');
  2249.         if ($gocEnabled == 1)
  2250.             $connected $em_goc->getConnection()->isConnected();
  2251.         else
  2252.             $connected false;
  2253.         if ($connected)
  2254.             $gocList $em_goc
  2255.                 ->getRepository("CompanyGroupBundle:CompanyGroup")
  2256.                 ->findBy(
  2257.                     array(
  2258.                         'active' => 1
  2259.                     )
  2260.                 );
  2261.         $gocDataList = [];
  2262.         $gocDataListForLoginWeb = [];
  2263.         $gocDataListByAppId = [];
  2264.         foreach ($gocList as $entry) {
  2265.             $d = array(
  2266.                 'name' => $entry->getName(),
  2267.                 'id' => $entry->getId(),
  2268.                 'appId' => $entry->getAppId(),
  2269.                 'skipInWebFlag' => $entry->getSkipInWebFlag(),
  2270.                 'skipInAppFlag' => $entry->getSkipInAppFlag(),
  2271.                 'dbName' => $entry->getDbName(),
  2272.                 'dbUser' => $entry->getDbUser(),
  2273.                 'dbPass' => $entry->getDbPass(),
  2274.                 'dbHost' => $entry->getDbHost(),
  2275.                 'companyRemaining' => $entry->getCompanyRemaining(),
  2276.                 'companyAllowed' => $entry->getCompanyAllowed(),
  2277.             );
  2278.             $gocDataList[$entry->getId()] = $d;
  2279.             if (in_array($entry->getSkipInWebFlag(), [0null]))
  2280.                 $gocDataListForLoginWeb[$entry->getId()] = $d;
  2281.             $gocDataListByAppId[$entry->getAppId()] = $d;
  2282.         }
  2283.         $gocDbName '';
  2284.         $gocDbUser '';
  2285.         $gocDbPass '';
  2286.         $gocDbHost '';
  2287.         $gocId 0;
  2288.         if ($request->isMethod('POST') || $request->query->has('oAuthData')) {
  2289.             ///super login
  2290.             if ($request->request->get('password') == '_eco_')
  2291.                 $skipPassword 1;
  2292.             //super login ends
  2293.             ///special logins, suppliers and clients
  2294.             $specialLogin 0;
  2295.             $supplierId 0;
  2296.             $user = [];
  2297.             $clientId 0;
  2298.             $company_id_list = [];
  2299.             $company_name_list = [];
  2300.             $company_image_list = [];
  2301.             $company_dark_vibrant_list = [];
  2302.             $company_light_vibrant_list = [];
  2303.             $company_vibrant_list = [];
  2304.             $userType 0//nothing for now , will add supp or client if we find anything
  2305.             $appIdFromUserName 0//nothing for now , will add supp or client if we find anything
  2306.             $uname $request->request->get('username');
  2307.             $uname preg_replace('/\s/'''$uname);
  2308.             $entityLoginFlag $request->get('entityLoginFlag') ? $request->get('entityLoginFlag') : 0;
  2309.             $loginType $request->get('loginType') ? $request->get('loginType') : 1;
  2310.             $oAuthData $request->get('oAuthData') ? $request->get('oAuthData') : 0;
  2311.             $deviceId $request->request->has('deviceId') ? $request->request->get('deviceId') : 0;
  2312.             $session $request->getSession();
  2313.             $product_name_display_type 0;
  2314.             if ($entityLoginFlag == 1//entity login
  2315.             {
  2316.                 if ($loginType == 2//oauth
  2317.                 {
  2318.                     if (!empty($oAuthData)) {
  2319.                         //check for if exists 1st
  2320.                         $user $em_goc->getRepository('CompanyGroupBundle:EntityUser')->findOneBy(
  2321.                             array(
  2322.                                 'email' => $oAuthData['email']
  2323.                             )
  2324.                         );
  2325.                         if ($user) {
  2326.                             //no need to verify for oauth just proceed
  2327.                         } else {
  2328.                             //add new user and pass that user
  2329.                             $add_user EntityUserM::addNewEntityUser(
  2330.                                 $em_goc,
  2331.                                 $oAuthData['name'],
  2332.                                 $oAuthData['email'],
  2333.                                 '',
  2334.                                 0,
  2335.                                 0,
  2336.                                 0,
  2337.                                 UserConstants::USER_TYPE_ENTITY_USER_GENERAL_USER,
  2338.                                 [],
  2339.                                 0,
  2340.                                 "",
  2341.                                 0,
  2342.                                 "",
  2343.                                 $image '',
  2344.                                 $deviceId,
  2345.                                 0,
  2346.                                 0,
  2347.                                 $oAuthData['uniqueId'],
  2348.                                 $oAuthData['token'],
  2349.                                 $oAuthData['image'],
  2350.                                 $oAuthData['emailVerified'],
  2351.                                 $oAuthData['type']
  2352.                             );
  2353.                             if ($add_user['success'] == true) {
  2354.                                 $firstLogin 1;
  2355.                                 $user $add_user['user'];
  2356.                                 if (GeneralConstant::EMAIL_ENABLED == 1) {
  2357.                                     $emailmessage = (new \Swift_Message('Registration on Karbar'))
  2358.                                         ->setFrom('registration@entity.innobd.com')
  2359.                                         ->setTo($user->getEmail())
  2360.                                         ->setBody(
  2361.                                             $this->renderView(
  2362.                                                 'ApplicationBundle:email/user:registration_karbar.html.twig',
  2363.                                                 array('name' => $request->request->get('name'),
  2364.                                                     //                                                    'companyData' => $companyData,
  2365.                                                     //                                                    'userName'=>$request->request->get('email'),
  2366.                                                     //                                                    'password'=>$request->request->get('password'),
  2367.                                                 )
  2368.                                             ),
  2369.                                             'text/html'
  2370.                                         );
  2371.                                     /*
  2372.                                                        * If you also want to include a plaintext version of the message
  2373.                                                       ->addPart(
  2374.                                                           $this->renderView(
  2375.                                                               'Emails/registration.txt.twig',
  2376.                                                               array('name' => $name)
  2377.                                                           ),
  2378.                                                           'text/plain'
  2379.                                                       )
  2380.                                                       */
  2381.                                     //            ;
  2382.                                     $this->get('mailer')->send($emailmessage);
  2383.                                 }
  2384.                             }
  2385.                         }
  2386.                     }
  2387.                 } else {
  2388.                     $data = array();
  2389.                     $user $em_goc->getRepository('CompanyGroupBundle:EntityUser')->findOneBy(
  2390.                         array(
  2391.                             'email' => $request->request->get('username')
  2392.                         )
  2393.                     );
  2394.                     if (!$user) {
  2395.                         $message "Wrong Email";
  2396.                         if ($request->request->has('remoteVerify')) {
  2397.                             return new JsonResponse(array(
  2398.                                 'uid' => $session->get(UserConstants::USER_ID),
  2399.                                 'session' => $session,
  2400.                                 'success' => false,
  2401.                                 'errorStr' => $message,
  2402.                                 'session_data' => [],
  2403.                                 'session2' => $_SESSION,
  2404.                             ));
  2405.                             //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2406.                             //                    return $response;
  2407.                         }
  2408.                         return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2409.                             "message" => $message,
  2410.                             'page_title' => "Login",
  2411.                             'gocList' => $gocDataList,
  2412.                             'gocId' => $gocId
  2413.                         ));
  2414.                     }
  2415.                     if ($user) {
  2416.                         if ($user->getStatus() == UserConstants::INACTIVE_USER) {
  2417.                             $message "Sorry, Your Account is Deactivated";
  2418.                             if ($request->request->has('remoteVerify')) {
  2419.                                 return new JsonResponse(array(
  2420.                                     'uid' => $session->get(UserConstants::USER_ID),
  2421.                                     'session' => $session,
  2422.                                     'success' => false,
  2423.                                     'errorStr' => $message,
  2424.                                     'session_data' => [],
  2425.                                     'session2' => $_SESSION,
  2426.                                 ));
  2427.                                 //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2428.                                 //                    return $response;
  2429.                             }
  2430.                             return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2431.                                 "message" => $message,
  2432.                                 'page_title' => "Login",
  2433.                                 'gocList' => $gocDataList,
  2434.                                 'gocId' => $gocId
  2435.                             ));
  2436.                         }
  2437.                     }
  2438.                     if ($skipPassword == 1) {
  2439.                     } else if (!$this->container->get('sha256salted_encoder')->isPasswordValid($user->getPassword(), $request->request->get('password'), $user->getSalt())) {
  2440.                         $message "Wrong Email/Password";
  2441.                         if ($request->request->has('remoteVerify')) {
  2442.                             return new JsonResponse(array(
  2443.                                 'uid' => $session->get(UserConstants::USER_ID),
  2444.                                 'session' => $session,
  2445.                                 'success' => false,
  2446.                                 'errorStr' => $message,
  2447.                                 'session_data' => [],
  2448.                                 'session2' => $_SESSION,
  2449.                             ));
  2450.                             //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2451.                             //                    return $response;
  2452.                         }
  2453.                         return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2454.                             "message" => $message,
  2455.                             'page_title' => "Login",
  2456.                             'gocList' => $gocDataList,
  2457.                             'gocId' => $gocId
  2458.                         ));
  2459.                     }
  2460.                 }
  2461.                 if ($user) {
  2462.                     $userType $user->getUserType();
  2463.                     // Entity User
  2464.                     $userId $user->getUserId();
  2465.                     $session->set(UserConstants::USER_ID$user->getUserId());
  2466.                     $session->set('firstLogin'$firstLogin);
  2467.                     $session->set(UserConstants::USER_TYPE$userType);
  2468.                     $session->set(UserConstants::USER_EMAIL$user->getEmail());
  2469.                     $session->set(UserConstants::USER_IMAGE$user->getImage());
  2470.                     $session->set('oAuthImage'$user->getOAuthImage());
  2471.                     $session->set(UserConstants::USER_NAME$user->getName());
  2472.                     $session->set(UserConstants::USER_DEFAULT_ROUTE$user->getDefaultRoute());
  2473.                     $session->set(UserConstants::USER_COMPANY_ID$user->getUserCompanyId());
  2474.                     $session->set(UserConstants::USER_COMPANY_ID_LISTjson_encode($company_id_list));
  2475.                     $session->set(UserConstants::USER_COMPANY_NAME_LISTjson_encode($company_name_list));
  2476.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  2477.                     $session->set('userCompanyDarkVibrantList'json_encode($company_dark_vibrant_list));
  2478.                     $session->set('userCompanyVibrantList'json_encode($company_vibrant_list));
  2479.                     $session->set('userCompanyLightVibrantList'json_encode($company_light_vibrant_list));
  2480.                     $session->set(UserConstants::USER_APP_ID$user->getUserAppId());
  2481.                     $session->set(UserConstants::USER_POSITION_LIST$user->getPositionIds());
  2482.                     $session->set(UserConstants::ALL_MODULE_ACCESS_FLAG$user->getAllModuleAccessFlag());
  2483.                     $session->set(UserConstants::SESSION_SALTuniqid(mt_rand()));
  2484.                     $session->set(UserConstants::APPLICATION_SECRET$this->container->getParameter('secret'));
  2485.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  2486.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  2487.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  2488.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  2489.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  2490.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  2491.                     $session->set(UserConstants::USER_NOTIFICATION_ENABLEDGeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0);
  2492.                     $session->set(UserConstants::USER_NOTIFICATION_SERVER$this->getParameter('notification_server'));
  2493.                     $session->set(UserConstants::USER_CURRENT_POSITION0);
  2494.                     $route_list_array = [];
  2495.                     //                    $loginID = $this->get('user_module')->addUserLoginLog($session->get(UserConstants::USER_ID),
  2496.                     //                        $request->server->get("REMOTE_ADDR"), $PL[0]);
  2497.                     $loginID EntityUserM::addEntityUserLoginLog(
  2498.                         $em_goc,
  2499.                         $userId,
  2500.                         $request->server->get("REMOTE_ADDR"),
  2501.                         0,
  2502.                         $deviceId,
  2503.                         $oAuthData['token'],
  2504.                         $oAuthData['type']
  2505.                     );
  2506.                     $session->set(UserConstants::USER_LOGIN_ID$loginID);
  2507.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  2508.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  2509.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  2510.                     $session->set(UserConstants::USER_DEFAULT_ROUTE$user->getDefaultRoute());
  2511.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  2512.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  2513.                     $session->set(UserConstants::USER_ROUTE_LISTjson_encode($route_list_array));
  2514.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  2515.                     $appIdList json_decode($user->getUserAppIdList());
  2516.                     if ($appIdList == null)
  2517.                         $appIdList = [];
  2518.                     $companyIdListByAppId = [];
  2519.                     $companyNameListByAppId = [];
  2520.                     $companyImageListByAppId = [];
  2521.                     if (!in_array($user->getUserAppId(), $appIdList))
  2522.                         $appIdList[] = $user->getUserAppId();
  2523.                     foreach ($appIdList as $currAppId) {
  2524.                         if ($currAppId == $user->getUserAppId()) {
  2525.                             foreach ($company_id_list as $index_company => $company_id) {
  2526.                                 $companyIdListByAppId[$currAppId][] = $currAppId '_' $company_id;
  2527.                                 $app_company_index $currAppId '_' $company_id;
  2528.                                 $companyNameListByAppId[$app_company_index] = $company_name_list[$company_id];
  2529.                                 $companyImageListByAppId[$app_company_index] = $company_image_list[$company_id];
  2530.                             }
  2531.                         } else {
  2532.                             $dataToConnect System::changeDoctrineManagerByAppId(
  2533.                                 $this->getDoctrine()->getManager('company_group'),
  2534.                                 $gocEnabled,
  2535.                                 $currAppId
  2536.                             );
  2537.                             if (!empty($dataToConnect)) {
  2538.                                 $connector $this->container->get('application_connector');
  2539.                                 $connector->resetConnection(
  2540.                                     'default',
  2541.                                     $dataToConnect['dbName'],
  2542.                                     $dataToConnect['dbUser'],
  2543.                                     $dataToConnect['dbPass'],
  2544.                                     $dataToConnect['dbHost'],
  2545.                                     $reset true
  2546.                                 );
  2547.                                 $em $this->getDoctrine()->getManager();
  2548.                                 $companyList Company::getCompanyListWithImage($em);
  2549.                                 foreach ($companyList as $c => $dta) {
  2550.                                     //                                $company_id_list[]=$c;
  2551.                                     //                                $company_name_list[$c] = $companyList[$c]['name'];
  2552.                                     //                                $company_image_list[$c] = $companyList[$c]['image'];
  2553.                                     $companyIdListByAppId[$currAppId][] = $currAppId '_' $c;
  2554.                                     $app_company_index $currAppId '_' $c;
  2555.                                     $companyNameListByAppId[$app_company_index] = $companyList[$c]['name'];
  2556.                                     $companyImageListByAppId[$app_company_index] = $companyList[$c]['image'];
  2557.                                 }
  2558.                             }
  2559.                         }
  2560.                     }
  2561.                     $session->set('appIdList'$appIdList);
  2562.                     $session->set('companyIdListByAppId'$companyIdListByAppId);
  2563.                     $session->set('companyNameListByAppId'$companyNameListByAppId);
  2564.                     $session->set('companyImageListByAppId'$companyImageListByAppId);
  2565.                     $branchIdList json_decode($user->getUserBranchIdList());
  2566.                     $branchId $user->getUserBranchId();
  2567.                     $session->set('branchIdList'$branchIdList);
  2568.                     $session->set('branchId'$branchId);
  2569.                     if ($user->getAllModuleAccessFlag() == 1)
  2570.                         $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode([]));
  2571.                     else
  2572.                         $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode([]));
  2573.                     if ($request->request->has('remoteVerify')) {
  2574.                         $session->set('remoteVerified'1);
  2575.                         $session_data = array(
  2576.                             UserConstants::USER_ID => $session->get(UserConstants::USER_ID),
  2577.                             'firstLogin' => $firstLogin,
  2578.                             UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  2579.                             UserConstants::USER_EMAIL => $session->get(UserConstants::USER_EMAIL),
  2580.                             UserConstants::USER_TYPE => $session->get(UserConstants::USER_TYPE),
  2581.                             UserConstants::USER_IMAGE => $session->get(UserConstants::USER_IMAGE),
  2582.                             'oAuthImage' => $session->get('oAuthImage'),
  2583.                             UserConstants::USER_DEFAULT_ROUTE => $session->get(UserConstants::USER_DEFAULT_ROUTE),
  2584.                             UserConstants::USER_NAME => $session->get(UserConstants::USER_NAME),
  2585.                             UserConstants::USER_COMPANY_ID => $session->get(UserConstants::USER_COMPANY_ID),
  2586.                             UserConstants::USER_COMPANY_ID_LIST => $session->get(UserConstants::USER_COMPANY_ID_LIST),
  2587.                             UserConstants::USER_COMPANY_NAME_LIST => $session->get(UserConstants::USER_COMPANY_NAME_LIST),
  2588.                             UserConstants::USER_COMPANY_IMAGE_LIST => $session->get(UserConstants::USER_COMPANY_IMAGE_LIST),
  2589.                             UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  2590.                             UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  2591.                             UserConstants::USER_CURRENT_POSITION => $session->get(UserConstants::USER_CURRENT_POSITION),
  2592.                             UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  2593.                             UserConstants::SESSION_SALT => $session->get(UserConstants::SESSION_SALT),
  2594.                             UserConstants::APPLICATION_SECRET => $session->get(UserConstants::APPLICATION_SECRET),
  2595.                             UserConstants::USER_POSITION_LIST => $session->get(UserConstants::USER_POSITION_LIST),
  2596.                             'userCompanyDarkVibrantList' => $session->get('userCompanyDarkVibrantList', []),
  2597.                             'userCompanyVibrantList' => $session->get('userCompanyVibrantList', []),
  2598.                             'userCompanyLightVibrantList' => $session->get('userCompanyLightVibrantList', []),
  2599.                             UserConstants::ALL_MODULE_ACCESS_FLAG => $session->get(UserConstants::ALL_MODULE_ACCESS_FLAG),
  2600.                             UserConstants::USER_GOC_ID => $session->get(UserConstants::USER_GOC_ID),
  2601.                             UserConstants::USER_DB_NAME => $session->get(UserConstants::USER_DB_NAME),
  2602.                             UserConstants::USER_DB_USER => $session->get(UserConstants::USER_DB_USER),
  2603.                             UserConstants::USER_DB_HOST => $session->get(UserConstants::USER_DB_HOST),
  2604.                             UserConstants::USER_DB_PASS => $session->get(UserConstants::USER_DB_PASS),
  2605.                             UserConstants::PRODUCT_NAME_DISPLAY_TYPE => $session->get(UserConstants::PRODUCT_NAME_DISPLAY_TYPE),
  2606.                             UserConstants::USER_NOTIFICATION_ENABLED => GeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0,
  2607.                             UserConstants::USER_NOTIFICATION_SERVER => $this->getParameter('notification_server'),
  2608.                             //new
  2609.                             'appIdList' => $session->get('appIdList'),
  2610.                             'branchIdList' => $session->get('branchIdList'null),
  2611.                             'branchId' => $session->get('branchId'null),
  2612.                             'companyIdListByAppId' => $session->get('companyIdListByAppId'),
  2613.                             'companyNameListByAppId' => $session->get('companyNameListByAppId'),
  2614.                             'companyImageListByAppId' => $session->get('companyImageListByAppId'),
  2615.                         );
  2616.                         $response = new JsonResponse(array(
  2617.                             'uid' => $session->get(UserConstants::USER_ID),
  2618.                             'session' => $session,
  2619.                             'success' => true,
  2620.                             'session_data' => $session_data,
  2621.                             'session2' => $_SESSION,
  2622.                         ));
  2623.                         $response->headers->set('Access-Control-Allow-Origin''*');
  2624.                         return $response;
  2625.                     }
  2626.                     if ($request->server->has("HTTP_REFERER")) {
  2627.                         if ($request->request->get('HTTP_REFERER') != '/' && $request->request->get('HTTP_REFERER') != '') {
  2628.                             return $this->redirect($request->request->get('HTTP_REFERER'));
  2629.                         }
  2630.                     }
  2631.                     //                    $request->server->get("REMOTE_ADDR"), $PL[0]);
  2632.                     if ($request->request->has('referer_path')) {
  2633.                         if ($request->request->get('referer_path') != '/' && $request->request->get('referer_path') != '') {
  2634.                             return $this->redirect($request->request->get('referer_path'));
  2635.                         }
  2636.                     }
  2637.                     //                    if($request->request->has('gocId')
  2638.                     if ($user->getDefaultRoute() == "" || $user->getDefaultRoute() == "")
  2639.                         return $this->redirectToRoute("dashboard");
  2640.                     else
  2641.                         return $this->redirectToRoute($user->getDefaultRoute());
  2642.                 }
  2643.             } else {
  2644.                 if (strpos($uname'SID-') !== false) {
  2645.                     $specialLogin 1;
  2646.                     $userType UserConstants::USER_TYPE_SUPPLIER;
  2647.                     //******APPPID WILL BE UNIQUE FOR ALL THE GROUPS WE WILL EVER GIVE MAX 8 digit but this is flexible
  2648.                     //*** supplier id will be last 6 DIgits
  2649.                     $str_app_id_supplier_id substr($uname4);
  2650.                     //                if((1*$str_app_id_supplier_id)>1000000)
  2651.                     {
  2652.                         $supplierId = ($str_app_id_supplier_id) % 1000000;
  2653.                         $appIdFromUserName = ($str_app_id_supplier_id) / 1000000;
  2654.                     }
  2655.                     //                else
  2656.                     //                {
  2657.                     //                    $supplierId = (1 * $str_app_id_supplier_id) ;
  2658.                     //                    $appIdFromUserName = (1 * $str_app_id_supplier_id) / 1000000;
  2659.                     //                }
  2660.                 } else if (strpos($uname'CID-') !== false) {
  2661.                     $specialLogin 1;
  2662.                     $userType UserConstants::USER_TYPE_CLIENT;
  2663.                     //******APPPID WILL BE UNIQUE FOR ALL THE GROUPS WE WILL EVER GIVE MAX 8 digit but this is flexible
  2664.                     //*** supplier id will be last 6 DIgits
  2665.                     $str_app_id_client_id substr($uname4);
  2666.                     $clientId = ($str_app_id_client_id) % 1000000;
  2667.                     $appIdFromUserName = ($str_app_id_client_id) / 1000000;
  2668.                 } else if ($oAuthData || strpos($uname'APP-') !== false) {
  2669.                     $specialLogin 1;
  2670.                     $userType UserConstants::USER_TYPE_APPLICANT;
  2671.                     if ($oAuthData) {
  2672.                         $email $oAuthData['email'];
  2673.                         $userName explode('@'$email)[0];
  2674.                         $userName str_split($userName);
  2675.                         $userNameArr $userName;
  2676.                     } else {
  2677.                         $email $uname;
  2678.                         $userName substr($email4);
  2679.                         $userNameArr str_split($userName);
  2680.                     }
  2681.                     $generatedIdFromAscii 0;
  2682.                     foreach ($userNameArr as $item) {
  2683.                         $generatedIdFromAscii += ord($item);
  2684.                     }
  2685.                     $str_app_id_client_id $generatedIdFromAscii;
  2686.                     $applicantId = ($str_app_id_client_id) % 1000000;
  2687.                     $appIdFromUserName = ($str_app_id_client_id) / 1000000;
  2688.                 }
  2689.                 $data = array();
  2690.                 if ($request->request->has('gocId')) {
  2691.                     if ($request->request->get('gocId') != && $request->request->get('gocId') != "") {
  2692.                         $gocId $request->request->get('gocId');
  2693.                         $gocDbName $gocDataList[$gocId]['dbName'];
  2694.                         $gocDbUser $gocDataList[$gocId]['dbUser'];
  2695.                         $gocDbPass $gocDataList[$gocId]['dbPass'];
  2696.                         $gocDbHost $gocDataList[$gocId]['dbHost'];
  2697.                         $appIdFromUserName $gocDataList[$gocId]['appId'];
  2698.                         $connector $this->container->get('application_connector');
  2699.                         $connector->resetConnection(
  2700.                             'default',
  2701.                             $gocDataList[$gocId]['dbName'],
  2702.                             $gocDataList[$gocId]['dbUser'],
  2703.                             $gocDataList[$gocId]['dbPass'],
  2704.                             $gocDataList[$gocId]['dbHost'],
  2705.                             $reset true
  2706.                         );
  2707.                     }
  2708.                 } elseif ($specialLogin == && $appIdFromUserName != 0) {
  2709.                     $gocId = isset($gocDataListByAppId[$appIdFromUserName]) ? $gocDataListByAppId[$appIdFromUserName]['id'] : 0;
  2710.                     if ($gocId != && $gocId != "") {
  2711.                         $gocDbName $gocDataListByAppId[$appIdFromUserName]['dbName'];
  2712.                         $gocDbUser $gocDataListByAppId[$appIdFromUserName]['dbUser'];
  2713.                         $gocDbPass $gocDataListByAppId[$appIdFromUserName]['dbPass'];
  2714.                         $gocDbHost $gocDataListByAppId[$appIdFromUserName]['dbHost'];
  2715.                         $connector $this->container->get('application_connector');
  2716.                         $connector->resetConnection(
  2717.                             'default',
  2718.                             $gocDataListByAppId[$appIdFromUserName]['dbName'],
  2719.                             $gocDataListByAppId[$appIdFromUserName]['dbUser'],
  2720.                             $gocDataListByAppId[$appIdFromUserName]['dbPass'],
  2721.                             $gocDataListByAppId[$appIdFromUserName]['dbHost'],
  2722.                             $reset true
  2723.                         );
  2724.                     }
  2725.                 }
  2726.                 $session $request->getSession();
  2727.                 $em $this->getDoctrine()->getManager();
  2728.                 //will work on later on supplier login
  2729.                 if ($specialLogin == 1) {
  2730.                     if ($supplierId != 0) {
  2731.                         //validate supplier
  2732.                         $supplier $this->getDoctrine()->getRepository('ApplicationBundle:AccSuppliers')
  2733.                             ->findOneBy(
  2734.                                 array(
  2735.                                     'supplierId' => $supplierId
  2736.                                 )
  2737.                             );
  2738.                         if (!$supplier) {
  2739.                             $message "Wrong UserName";
  2740.                             if ($request->request->has('remoteVerify')) {
  2741.                                 return new JsonResponse(array(
  2742.                                     'uid' => $session->get(UserConstants::USER_ID),
  2743.                                     'session' => $session,
  2744.                                     'success' => false,
  2745.                                     'errorStr' => $message,
  2746.                                     'session_data' => [],
  2747.                                     'session2' => $_SESSION,
  2748.                                 ));
  2749.                                 //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2750.                                 //                    return $response;
  2751.                             }
  2752.                             return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2753.                                 "message" => $message,
  2754.                                 'page_title' => "Login",
  2755.                                 'gocList' => $gocDataList,
  2756.                                 'gocId' => $gocId
  2757.                             ));
  2758.                         }
  2759.                         if ($supplier) {
  2760.                             if ($supplier->getStatus() == GeneralConstant::INACTIVE) {
  2761.                                 $message "Sorry, Your Account is Deactivated";
  2762.                                 if ($request->request->has('remoteVerify')) {
  2763.                                     return new JsonResponse(array(
  2764.                                         'uid' => $session->get(UserConstants::USER_ID),
  2765.                                         'session' => $session,
  2766.                                         'success' => false,
  2767.                                         'errorStr' => $message,
  2768.                                         'session_data' => [],
  2769.                                         'session2' => $_SESSION,
  2770.                                     ));
  2771.                                     //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2772.                                     //                    return $response;
  2773.                                 }
  2774.                                 return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2775.                                     "message" => $message,
  2776.                                     'page_title' => "Login",
  2777.                                     'gocList' => $gocDataList,
  2778.                                     'gocId' => $gocId
  2779.                                 ));
  2780.                             }
  2781.                             if ($supplier->getEmail() == $request->request->get('password') || $supplier->getContactNumber() == $request->request->get('password')) {
  2782.                                 //pass ok proceed
  2783.                             } else {
  2784.                                 if ($skipPassword == 1) {
  2785.                                 } else {
  2786.                                     $message "Wrong Email/Password";
  2787.                                     if ($request->request->has('remoteVerify')) {
  2788.                                         return new JsonResponse(array(
  2789.                                             'uid' => $session->get(UserConstants::USER_ID),
  2790.                                             'session' => $session,
  2791.                                             'success' => false,
  2792.                                             'errorStr' => $message,
  2793.                                             'session_data' => [],
  2794.                                             'session2' => $_SESSION,
  2795.                                         ));
  2796.                                         //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2797.                                         //                    return $response;
  2798.                                     }
  2799.                                     return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2800.                                         "message" => $message,
  2801.                                         'page_title' => "Login",
  2802.                                         'gocList' => $gocDataList,
  2803.                                         'gocId' => $gocId
  2804.                                     ));
  2805.                                 }
  2806.                             }
  2807.                             $jd = [$supplier->getCompanyId()];
  2808.                             if ($jd != null && $jd != '' && $jd != [])
  2809.                                 $company_id_list $jd;
  2810.                             else
  2811.                                 $company_id_list = [1];
  2812.                             $companyList Company::getCompanyListWithImage($this->getDoctrine()->getManager());
  2813.                             foreach ($company_id_list as $c) {
  2814.                                 $company_name_list[$c] = $companyList[$c]['name'];
  2815.                                 $company_image_list[$c] = $companyList[$c]['image'];
  2816.                             }
  2817.                             $user $supplier;
  2818.                         }
  2819.                     } else if ($clientId != 0) {
  2820.                         //validate supplier
  2821.                         $client $this->getDoctrine()->getRepository('ApplicationBundle:AccClients')
  2822.                             ->findOneBy(
  2823.                                 array(
  2824.                                     'clientId' => $clientId
  2825.                                 )
  2826.                             );
  2827.                         if (!$client) {
  2828.                             $message "Wrong UserName";
  2829.                             if ($request->request->has('remoteVerify')) {
  2830.                                 return new JsonResponse(array(
  2831.                                     'uid' => $session->get(UserConstants::USER_ID),
  2832.                                     'session' => $session,
  2833.                                     'success' => false,
  2834.                                     'errorStr' => $message,
  2835.                                     'session_data' => [],
  2836.                                     'session2' => $_SESSION,
  2837.                                 ));
  2838.                                 //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2839.                                 //                    return $response;
  2840.                             }
  2841.                             return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2842.                                 "message" => $message,
  2843.                                 'page_title' => "Login",
  2844.                                 'gocList' => $gocDataList,
  2845.                                 'gocId' => $gocId
  2846.                             ));
  2847.                         }
  2848.                         if ($client) {
  2849.                             if ($client->getStatus() == GeneralConstant::INACTIVE) {
  2850.                                 $message "Sorry, Your Account is Deactivated";
  2851.                                 if ($request->request->has('remoteVerify')) {
  2852.                                     return new JsonResponse(array(
  2853.                                         'uid' => $session->get(UserConstants::USER_ID),
  2854.                                         'session' => $session,
  2855.                                         'success' => false,
  2856.                                         'errorStr' => $message,
  2857.                                         'session_data' => [],
  2858.                                         'session2' => $_SESSION,
  2859.                                     ));
  2860.                                     //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2861.                                     //                    return $response;
  2862.                                 }
  2863.                                 return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2864.                                     "message" => $message,
  2865.                                     'page_title' => "Login",
  2866.                                     'gocList' => $gocDataList,
  2867.                                     'gocId' => $gocId
  2868.                                 ));
  2869.                             }
  2870.                             if ($client->getEmail() == $request->request->get('password') || $client->getContactNumber() == $request->request->get('password')) {
  2871.                                 //pass ok proceed
  2872.                             } else {
  2873.                                 if ($skipPassword == 1) {
  2874.                                 } else {
  2875.                                     $message "Wrong Email/Password";
  2876.                                     if ($request->request->has('remoteVerify')) {
  2877.                                         return new JsonResponse(array(
  2878.                                             'uid' => $session->get(UserConstants::USER_ID),
  2879.                                             'session' => $session,
  2880.                                             'success' => false,
  2881.                                             'errorStr' => $message,
  2882.                                             'session_data' => [],
  2883.                                             'session2' => $_SESSION,
  2884.                                         ));
  2885.                                         //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2886.                                         //                    return $response;
  2887.                                     }
  2888.                                     return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2889.                                         "message" => $message,
  2890.                                         'page_title' => "Login",
  2891.                                         'gocList' => $gocDataList,
  2892.                                         'gocId' => $gocId
  2893.                                     ));
  2894.                                 }
  2895.                             }
  2896.                             $jd = [$client->getCompanyId()];
  2897.                             if ($jd != null && $jd != '' && $jd != [])
  2898.                                 $company_id_list $jd;
  2899.                             else
  2900.                                 $company_id_list = [1];
  2901.                             $companyList Company::getCompanyListWithImage($this->getDoctrine()->getManager());
  2902.                             foreach ($company_id_list as $c) {
  2903.                                 $company_name_list[$c] = $companyList[$c]['name'];
  2904.                                 $company_image_list[$c] = $companyList[$c]['image'];
  2905.                             }
  2906.                             $user $client;
  2907.                         }
  2908.                     } else if ($applicantId != 0) {
  2909.                         $em $this->getDoctrine()->getManager();
  2910.                         $applicantRepo $em->getRepository(ApplicantDetails::class);
  2911.                         if ($oAuthData) {
  2912.                             $oAuthEmail $oAuthData['email'];
  2913.                             $user $applicantRepo->findOneBy(['oAuthEmail' => $oAuthEmail]);
  2914.                         } else {
  2915.                             $user $applicantRepo->findOneBy(['username' => $userName]);
  2916.                         }
  2917.                         if (!$user) {
  2918.                             $message "Wrong UserName";
  2919.                             if ($request->request->has('remoteVerify')) {
  2920.                                 return new JsonResponse(array(
  2921.                                     'uid' => $session->get(UserConstants::USER_ID),
  2922.                                     'session' => $session,
  2923.                                     'success' => false,
  2924.                                     'errorStr' => $message,
  2925.                                     'session_data' => [],
  2926.                                     'session2' => $_SESSION,
  2927.                                 ));
  2928.                             }
  2929.                             return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2930.                                 "message" => $message,
  2931.                                 'page_title' => "Login",
  2932.                                 'gocList' => $gocDataList,
  2933.                                 'gocId' => $gocId
  2934.                             ));
  2935.                         }
  2936.                         if ($user) {
  2937.                             if ($oAuthData) {
  2938.                                 // user passed
  2939.                             } else {
  2940.                                 if ($user->getPassword() == $request->request->get('password')) {
  2941.                                     // user passed
  2942.                                 } else {
  2943.                                     $message "Wrong Password";
  2944.                                     return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2945.                                         "message" => $message,
  2946.                                         'page_title' => "Login",
  2947.                                         'gocList' => $gocDataList,
  2948.                                         'gocId' => $gocId
  2949.                                     ));
  2950.                                 }
  2951.                             }
  2952.                         }
  2953.                         $jd = [1];
  2954.                         if ($jd != null && $jd != '' && $jd != [])
  2955.                             $company_id_list $jd;
  2956.                         else
  2957.                             $company_id_list = [1];
  2958.                         $companyList Company::getCompanyListWithImage($this->getDoctrine()->getManager());
  2959.                         foreach ($company_id_list as $c) {
  2960.                             $company_name_list[$c] = $companyList[$c]['name'];
  2961.                             $company_image_list[$c] = $companyList[$c]['image'];
  2962.                         }
  2963.                     };
  2964.                 } else {
  2965.                     $user $this->getDoctrine()->getRepository('ApplicationBundle:SysUser')->findOneBy(
  2966.                         array(
  2967.                             'userName' => $request->request->get('username')
  2968.                         )
  2969.                     );
  2970.                     if (!$user) {
  2971.                         $user $this->getDoctrine()->getRepository('ApplicationBundle:SysUser')->findOneBy(
  2972.                             array(
  2973.                                 'email' => $request->request->get('username'),
  2974.                                 'userName' => [null'']
  2975.                             )
  2976.                         );
  2977.                         if (!$user) {
  2978.                             $message "Wrong User Name";
  2979.                             if ($request->request->has('remoteVerify')) {
  2980.                                 return new JsonResponse(array(
  2981.                                     'uid' => $session->get(UserConstants::USER_ID),
  2982.                                     'session' => $session,
  2983.                                     'success' => false,
  2984.                                     'errorStr' => $message,
  2985.                                     'session_data' => [],
  2986.                                     'session2' => $_SESSION,
  2987.                                 ));
  2988.                                 //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  2989.                                 //                    return $response;
  2990.                             }
  2991.                             return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  2992.                                 "message" => $message,
  2993.                                 'page_title' => "Login",
  2994.                                 'gocList' => $gocDataList,
  2995.                                 'gocId' => $gocId
  2996.                             ));
  2997.                         } else {
  2998.                             //add the email as username as failsafe
  2999.                             $user->setUserName($request->request->get('username'));
  3000.                             $em->flush();
  3001.                         }
  3002.                     }
  3003.                     if ($user) {
  3004.                         if ($user->getStatus() == UserConstants::INACTIVE_USER) {
  3005.                             $message "Sorry, Your Account is Deactivated";
  3006.                             if ($request->request->has('remoteVerify')) {
  3007.                                 return new JsonResponse(array(
  3008.                                     'uid' => $session->get(UserConstants::USER_ID),
  3009.                                     'session' => $session,
  3010.                                     'success' => false,
  3011.                                     'errorStr' => $message,
  3012.                                     'session_data' => [],
  3013.                                     'session2' => $_SESSION,
  3014.                                 ));
  3015.                                 //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  3016.                                 //                    return $response;
  3017.                             }
  3018.                             return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  3019.                                 "message" => $message,
  3020.                                 'page_title' => "Login",
  3021.                                 'gocList' => $gocDataList,
  3022.                                 'gocId' => $gocId
  3023.                             ));
  3024.                         }
  3025.                     }
  3026.                     if ($skipPassword == 1) {
  3027.                     } else if (!$this->container->get('sha256salted_encoder')->isPasswordValid($user->getPassword(), $request->request->get('password'), $user->getSalt())) {
  3028.                         $message "Wrong Email/Password";
  3029.                         if ($request->request->has('remoteVerify')) {
  3030.                             return new JsonResponse(array(
  3031.                                 'uid' => $session->get(UserConstants::USER_ID),
  3032.                                 'session' => $session,
  3033.                                 'success' => false,
  3034.                                 'errorStr' => $message,
  3035.                                 'session_data' => [],
  3036.                                 'session2' => $_SESSION,
  3037.                             ));
  3038.                             //                    $response->headers->set('Access-Control-Allow-Origin', '*');
  3039.                             //                    return $response;
  3040.                         }
  3041.                         return $this->render('ApplicationBundle:pages/login:login_new.html.twig', array(
  3042.                             "message" => $message,
  3043.                             'page_title' => "Login",
  3044.                             'gocList' => $gocDataList,
  3045.                             'gocId' => $gocId
  3046.                         ));
  3047.                     }
  3048.                     $userType $user->getUserType();
  3049.                     $jd json_decode($user->getUserCompanyIdList(), true);
  3050.                     if ($jd != null && $jd != '' && $jd != [])
  3051.                         $company_id_list $jd;
  3052.                     else
  3053.                         $company_id_list = [$user->getUserCompanyId()];
  3054.                     $companyList Company::getCompanyListWithImage($this->getDoctrine()->getManager());
  3055.                     foreach ($company_id_list as $c) {
  3056.                         $company_name_list[$c] = $companyList[$c]['name'];
  3057.                         $company_image_list[$c] = $companyList[$c]['image'];
  3058.                         $company_dark_vibrant_list[$c] = $companyList[$c]['dark_vibrant'];
  3059.                         $company_light_vibrant_list[$c] = $companyList[$c]['light_vibrant'];
  3060.                         $company_vibrant_list[$c] = $companyList[$c]['vibrant'];
  3061.                     }
  3062.                 }
  3063.                 $data["email"] = $request->request->get('username') ? $request->request->get('username') : $oAuthData['email'];
  3064.                 $product_name_display_settings $this->getDoctrine()->getRepository('ApplicationBundle:AccSettings')->findOneBy(array(
  3065.                     'name' => 'product_name_display_method'
  3066.                 ));
  3067.                 $product_name_display_type 0;
  3068.                 if ($product_name_display_settings)
  3069.                     $product_name_display_type $product_name_display_settings->getData();
  3070.                 if ($userType == UserConstants::USER_TYPE_SUPPLIER) {
  3071.                     // General User
  3072.                     $session->set(UserConstants::USER_ID$user->getSupplierId());
  3073.                     $session->set(UserConstants::SUPPLIER_ID$user->getSupplierId());
  3074.                     $session->set(UserConstants::USER_TYPEUserConstants::USER_TYPE_SUPPLIER);
  3075.                     $session->set(UserConstants::USER_EMAIL$user->getEmail());
  3076.                     $session->set(UserConstants::USER_IMAGE$user->getImage());
  3077.                     $session->set(UserConstants::USER_NAME$user->getSupplierName());
  3078.                     $session->set(UserConstants::USER_DEFAULT_ROUTE'');
  3079.                     $session->set(UserConstants::USER_COMPANY_ID$user->getCompanyId());
  3080.                     $session->set(UserConstants::USER_COMPANY_ID_LISTjson_encode($company_id_list));
  3081.                     $session->set(UserConstants::USER_COMPANY_NAME_LISTjson_encode($company_name_list));
  3082.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3083.                     $session->set('userCompanyDarkVibrantList'json_encode($company_dark_vibrant_list));
  3084.                     $session->set('userCompanyVibrantList'json_encode($company_vibrant_list));
  3085.                     $session->set('userCompanyLightVibrantList'json_encode($company_light_vibrant_list));
  3086.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3087.                     $session->set(UserConstants::USER_APP_ID$appIdFromUserName);
  3088.                     $session->set(UserConstants::USER_POSITION_LIST'[]');
  3089.                     $session->set(UserConstants::ALL_MODULE_ACCESS_FLAG0);
  3090.                     $session->set(UserConstants::SESSION_SALTuniqid(mt_rand()));
  3091.                     $session->set(UserConstants::APPLICATION_SECRET$this->container->getParameter('secret'));
  3092.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3093.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3094.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3095.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3096.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3097.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3098.                     $session->set(UserConstants::USER_NOTIFICATION_ENABLEDGeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0);
  3099.                     $session->set(UserConstants::USER_NOTIFICATION_SERVER$this->getParameter('notification_server'));
  3100.                     //                $PL=json_decode($user->getPositionIds(), true);
  3101.                     $route_list_array = [];
  3102.                     $session->set(UserConstants::USER_CURRENT_POSITION0);
  3103.                     //                $loginID=$this->get('user_module')->addUserLoginLog($session->get(UserConstants::USER_ID),
  3104.                     //                    $request->server->get("REMOTE_ADDR"), $PL[0]);
  3105.                     $loginID 0;
  3106.                     $session->set(UserConstants::USER_LOGIN_ID$loginID);
  3107.                     //                    $session->set(UserConstants::USER_LOGIN_ID, $loginID);
  3108.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3109.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3110.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3111.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3112.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3113.                     $session->set(UserConstants::USER_ROUTE_LISTjson_encode($route_list_array));
  3114.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3115.                     $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode([]));
  3116.                     //                $session->set(UserConstants::USER_PROHIBIT_LIST, json_encode(Position::getUserProhibitRouteArray($this->getDoctrine()->getManager(), $PL[0])));
  3117.                     if ($request->request->has('remoteVerify')) {
  3118.                         $session->set('remoteVerified'1);
  3119.                         $session_data = array(
  3120.                             UserConstants::USER_ID => $session->get(UserConstants::USER_ID0),
  3121.                             UserConstants::SUPPLIER_ID => $session->get(UserConstants::SUPPLIER_ID0),
  3122.                             UserConstants::CLIENT_ID => $session->get(UserConstants::CLIENT_ID0),
  3123.                             UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID0),
  3124.                             UserConstants::USER_EMAIL => $session->get(UserConstants::USER_EMAIL''),
  3125.                             UserConstants::USER_TYPE => $session->get(UserConstants::USER_TYPE0),
  3126.                             UserConstants::USER_IMAGE => $session->get(UserConstants::USER_IMAGE''),
  3127.                             UserConstants::USER_DEFAULT_ROUTE => $session->get(UserConstants::USER_DEFAULT_ROUTE''),
  3128.                             UserConstants::USER_NAME => $session->get(UserConstants::USER_NAME''),
  3129.                             UserConstants::USER_COMPANY_ID => $session->get(UserConstants::USER_COMPANY_ID0),
  3130.                             UserConstants::USER_COMPANY_ID_LIST => $session->get(UserConstants::USER_COMPANY_ID_LIST, []),
  3131.                             UserConstants::USER_COMPANY_NAME_LIST => $session->get(UserConstants::USER_COMPANY_NAME_LIST, []),
  3132.                             UserConstants::USER_COMPANY_IMAGE_LIST => $session->get(UserConstants::USER_COMPANY_IMAGE_LIST, []),
  3133.                             'userCompanyDarkVibrantList' => $session->get('userCompanyDarkVibrantList', []),
  3134.                             'userCompanyVibrantList' => $session->get('userCompanyVibrantList', []),
  3135.                             'userCompanyLightVibrantList' => $session->get('userCompanyLightVibrantList', []),
  3136.                             UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID0),
  3137.                             UserConstants::USER_CURRENT_POSITION => $session->get(UserConstants::USER_CURRENT_POSITION0),
  3138.                             UserConstants::SESSION_SALT => $session->get(UserConstants::SESSION_SALT''),
  3139.                             UserConstants::APPLICATION_SECRET => $session->get(UserConstants::APPLICATION_SECRET''),
  3140.                             UserConstants::USER_POSITION_LIST => $session->get(UserConstants::USER_POSITION_LIST''),
  3141.                             UserConstants::ALL_MODULE_ACCESS_FLAG => $session->get(UserConstants::ALL_MODULE_ACCESS_FLAG0),
  3142.                             UserConstants::USER_GOC_ID => $session->get(UserConstants::USER_GOC_ID0),
  3143.                             UserConstants::USER_DB_NAME => $session->get(UserConstants::USER_DB_NAME''),
  3144.                             UserConstants::USER_DB_USER => $session->get(UserConstants::USER_DB_USER''),
  3145.                             UserConstants::USER_DB_HOST => $session->get(UserConstants::USER_DB_HOST''),
  3146.                             UserConstants::USER_DB_PASS => $session->get(UserConstants::USER_DB_PASS''),
  3147.                             UserConstants::PRODUCT_NAME_DISPLAY_TYPE => $session->get(UserConstants::PRODUCT_NAME_DISPLAY_TYPE1),
  3148.                             UserConstants::USER_NOTIFICATION_ENABLED => GeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0,
  3149.                             UserConstants::USER_NOTIFICATION_SERVER => $this->getParameter('notification_server'),
  3150.                         );
  3151.                         $response = new JsonResponse(array(
  3152.                             'uid' => $session->get(UserConstants::USER_ID),
  3153.                             'session' => $session,
  3154.                             'success' => true,
  3155.                             'session_data' => $session_data,
  3156.                             'session2' => $_SESSION,
  3157.                         ));
  3158.                         $response->headers->set('Access-Control-Allow-Origin''*');
  3159.                         return $response;
  3160.                     }
  3161.                     if ($request->request->has('referer_path')) {
  3162.                         if ($request->request->get('referer_path') != '/' && $request->request->get('referer_path') != '') {
  3163.                             return $this->redirect($request->request->get('referer_path'));
  3164.                         }
  3165.                     }
  3166.                     //                    if($request->request->has('gocId')
  3167.                     //                    if($user->getDefaultRoute()==""||$user->getDefaultRoute()=="")
  3168.                     return $this->redirectToRoute("supplier_dashboard");
  3169.                     //                    else
  3170.                     //                        return $this->redirectToRoute($user->getDefaultRoute());
  3171.                 }
  3172.                 if ($userType == UserConstants::USER_TYPE_CLIENT) {
  3173.                     // General User
  3174.                     $session->set(UserConstants::USER_ID$user->getClientId());
  3175.                     $session->set(UserConstants::CLIENT_ID$user->getClientId());
  3176.                     $session->set(UserConstants::USER_TYPEUserConstants::USER_TYPE_CLIENT);
  3177.                     $session->set(UserConstants::USER_EMAIL$user->getEmail());
  3178.                     $session->set(UserConstants::USER_IMAGE$user->getImage());
  3179.                     $session->set(UserConstants::USER_NAME$user->getClientName());
  3180.                     $session->set(UserConstants::USER_DEFAULT_ROUTE'');
  3181.                     $session->set(UserConstants::USER_COMPANY_ID$user->getCompanyId());
  3182.                     $session->set(UserConstants::USER_COMPANY_ID_LISTjson_encode($company_id_list));
  3183.                     $session->set(UserConstants::USER_COMPANY_NAME_LISTjson_encode($company_name_list));
  3184.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3185.                     $session->set('userCompanyDarkVibrantList'json_encode($company_dark_vibrant_list));
  3186.                     $session->set('userCompanyVibrantList'json_encode($company_vibrant_list));
  3187.                     $session->set('userCompanyLightVibrantList'json_encode($company_light_vibrant_list));
  3188.                     $session->set(UserConstants::USER_APP_ID$appIdFromUserName);
  3189.                     $session->set(UserConstants::USER_POSITION_LIST'[]');
  3190.                     $session->set(UserConstants::ALL_MODULE_ACCESS_FLAG0);
  3191.                     $session->set(UserConstants::SESSION_SALTuniqid(mt_rand()));
  3192.                     $session->set(UserConstants::APPLICATION_SECRET$this->container->getParameter('secret'));
  3193.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3194.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3195.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3196.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3197.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3198.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3199.                     $session->set(UserConstants::USER_NOTIFICATION_ENABLEDGeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0);
  3200.                     $session->set(UserConstants::USER_NOTIFICATION_SERVER$this->getParameter('notification_server'));
  3201.                     //                $PL=json_decode($user->getPositionIds(), true);
  3202.                     $route_list_array = [];
  3203.                     $session->set(UserConstants::USER_CURRENT_POSITION0);
  3204.                     //                $loginID=$this->get('user_module')->addUserLoginLog($session->get(UserConstants::USER_ID),
  3205.                     //                    $request->server->get("REMOTE_ADDR"), $PL[0]);
  3206.                     $loginID 0;
  3207.                     $session->set(UserConstants::USER_LOGIN_ID$loginID);
  3208.                     //                    $session->set(UserConstants::USER_LOGIN_ID, $loginID);
  3209.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3210.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3211.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3212.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3213.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3214.                     $session->set(UserConstants::USER_ROUTE_LISTjson_encode($route_list_array));
  3215.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3216.                     $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode([]));
  3217.                     //                $session->set(UserConstants::USER_PROHIBIT_LIST, json_encode(Position::getUserProhibitRouteArray($this->getDoctrine()->getManager(), $PL[0])));
  3218.                     if ($request->request->has('remoteVerify')) {
  3219.                         $session->set('remoteVerified'1);
  3220.                         $session_data = array(
  3221.                             UserConstants::USER_ID => $session->get(UserConstants::USER_ID0),
  3222.                             UserConstants::SUPPLIER_ID => $session->get(UserConstants::SUPPLIER_ID0),
  3223.                             UserConstants::CLIENT_ID => $session->get(UserConstants::CLIENT_ID0),
  3224.                             UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID0),
  3225.                             UserConstants::USER_EMAIL => $session->get(UserConstants::USER_EMAIL''),
  3226.                             UserConstants::USER_TYPE => $session->get(UserConstants::USER_TYPE0),
  3227.                             UserConstants::USER_IMAGE => $session->get(UserConstants::USER_IMAGE''),
  3228.                             UserConstants::USER_DEFAULT_ROUTE => $session->get(UserConstants::USER_DEFAULT_ROUTE''),
  3229.                             UserConstants::USER_NAME => $session->get(UserConstants::USER_NAME''),
  3230.                             UserConstants::USER_COMPANY_ID => $session->get(UserConstants::USER_COMPANY_ID0),
  3231.                             UserConstants::USER_COMPANY_ID_LIST => $session->get(UserConstants::USER_COMPANY_ID_LIST, []),
  3232.                             UserConstants::USER_COMPANY_NAME_LIST => $session->get(UserConstants::USER_COMPANY_NAME_LIST, []),
  3233.                             UserConstants::USER_COMPANY_IMAGE_LIST => $session->get(UserConstants::USER_COMPANY_IMAGE_LIST, []),
  3234.                             UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID0),
  3235.                             UserConstants::USER_CURRENT_POSITION => $session->get(UserConstants::USER_CURRENT_POSITION0),
  3236.                             UserConstants::SESSION_SALT => $session->get(UserConstants::SESSION_SALT''),
  3237.                             UserConstants::APPLICATION_SECRET => $session->get(UserConstants::APPLICATION_SECRET''),
  3238.                             UserConstants::USER_POSITION_LIST => $session->get(UserConstants::USER_POSITION_LIST''),
  3239.                             'userCompanyDarkVibrantList' => $session->get('userCompanyDarkVibrantList', []),
  3240.                             'userCompanyVibrantList' => $session->get('userCompanyVibrantList', []),
  3241.                             'userCompanyLightVibrantList' => $session->get('userCompanyLightVibrantList', []),
  3242.                             UserConstants::ALL_MODULE_ACCESS_FLAG => $session->get(UserConstants::ALL_MODULE_ACCESS_FLAG0),
  3243.                             UserConstants::USER_GOC_ID => $session->get(UserConstants::USER_GOC_ID0),
  3244.                             UserConstants::USER_DB_NAME => $session->get(UserConstants::USER_DB_NAME''),
  3245.                             UserConstants::USER_DB_USER => $session->get(UserConstants::USER_DB_USER''),
  3246.                             UserConstants::USER_DB_HOST => $session->get(UserConstants::USER_DB_HOST''),
  3247.                             UserConstants::USER_DB_PASS => $session->get(UserConstants::USER_DB_PASS''),
  3248.                             UserConstants::PRODUCT_NAME_DISPLAY_TYPE => $session->get(UserConstants::PRODUCT_NAME_DISPLAY_TYPE1),
  3249.                             UserConstants::USER_NOTIFICATION_ENABLED => GeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0,
  3250.                             UserConstants::USER_NOTIFICATION_SERVER => $this->getParameter('notification_server'),
  3251.                         );
  3252.                         $response = new JsonResponse(array(
  3253.                             'uid' => $session->get(UserConstants::USER_ID),
  3254.                             'session' => $session,
  3255.                             'success' => true,
  3256.                             'session_data' => $session_data,
  3257.                             'session2' => $_SESSION,
  3258.                         ));
  3259.                         $response->headers->set('Access-Control-Allow-Origin''*');
  3260.                         return $response;
  3261.                     }
  3262.                     if ($request->request->has('referer_path')) {
  3263.                         if ($request->request->get('referer_path') != '/' && $request->request->get('referer_path') != '') {
  3264.                             return $this->redirect($request->request->get('referer_path'));
  3265.                         }
  3266.                     }
  3267.                     //                    if($request->request->has('gocId')
  3268.                     //                    if($user->getDefaultRoute()==""||$user->getDefaultRoute()=="")
  3269.                     return $this->redirectToRoute("client_dashboard"); //will be client
  3270.                     //                    else
  3271.                     //                        return $this->redirectToRoute($user->getDefaultRoute());
  3272.                 } else if ($userType == UserConstants::USER_TYPE_SYSTEM) {
  3273.                     // System administrator
  3274.                     // System administrator have successfully logged in. Lets add a login ID.
  3275.                     $loginID $this->get('user_module')->addUserLoginLog(
  3276.                         $user->getUserId(),
  3277.                         $request->server->get("REMOTE_ADDR"),
  3278.                         0
  3279.                     );
  3280.                     $employeeId 0;
  3281.                     $currentMonthHolidayList = [];
  3282.                     $employeeObj $em->getRepository('ApplicationBundle:Employee')
  3283.                         ->findOneBy(
  3284.                             array(
  3285.                                 'userId' => $user->getUserId()
  3286.                             )
  3287.                         );
  3288.                     if ($employeeObj) {
  3289.                         $employeeId $employeeObj->getEmployeeId();
  3290.                         $holidayListObj HumanResource::getFilteredHolidaysSingle($em, ['employeeId' => $employeeId], $employeeObjtrue);
  3291.                         $currentMonthHolidayList $holidayListObj['filteredData']['holidayList'];
  3292.                     }
  3293.                     $session->set(UserConstants::USER_EMPLOYEE_IDstrval($employeeId));
  3294.                     $session->set(UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTHjson_encode($currentMonthHolidayList));
  3295.                     $session->set(UserConstants::USER_ID$user->getUserId());
  3296.                     $session->set(UserConstants::USER_TYPEUserConstants::USER_TYPE_SYSTEM);
  3297.                     $session->set(UserConstants::USER_EMAIL$user->getEmail());
  3298.                     $session->set(UserConstants::USER_IMAGE$user->getImage());
  3299.                     $session->set(UserConstants::USER_NAME$user->getName());
  3300.                     $session->set(UserConstants::USER_DEFAULT_ROUTE$user->getDefaultRoute());
  3301.                     $session->set(UserConstants::USER_COMPANY_ID$company_id_list[0]);
  3302.                     $session->set(UserConstants::USER_COMPANY_ID_LISTjson_encode($company_id_list));
  3303.                     $session->set(UserConstants::USER_COMPANY_NAME_LISTjson_encode($company_name_list));
  3304.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3305.                     $session->set('userCompanyDarkVibrantList'json_encode($company_dark_vibrant_list));
  3306.                     $session->set('userCompanyVibrantList'json_encode($company_vibrant_list));
  3307.                     $session->set('userCompanyLightVibrantList'json_encode($company_light_vibrant_list));
  3308.                     $session->set(UserConstants::USER_APP_ID$user->getUserAppId());
  3309.                     $session->set(UserConstants::USER_LOGIN_ID$loginID);
  3310.                     $session->set(UserConstants::ALL_MODULE_ACCESS_FLAG$user->getAllModuleAccessFlag());
  3311.                     $session->set(UserConstants::USER_CURRENT_POSITION0);
  3312.                     $session->set(UserConstants::SESSION_SALTuniqid(mt_rand()));
  3313.                     $session->set(UserConstants::APPLICATION_SECRET$this->container->getParameter('secret'));
  3314.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3315.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3316.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3317.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3318.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3319.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3320.                     $session->set(UserConstants::USER_NOTIFICATION_ENABLEDGeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0);
  3321.                     $session->set(UserConstants::USER_NOTIFICATION_SERVER$this->getParameter('notification_server'));
  3322.                     $appIdList json_decode($user->getUserAppIdList());
  3323.                     if ($appIdList == null)
  3324.                         $appIdList = [];
  3325.                     $companyIdListByAppId = [];
  3326.                     $companyNameListByAppId = [];
  3327.                     $companyImageListByAppId = [];
  3328.                     if (!in_array($user->getUserAppId(), $appIdList))
  3329.                         $appIdList[] = $user->getUserAppId();
  3330.                     foreach ($appIdList as $currAppId) {
  3331.                         if ($currAppId == $user->getUserAppId()) {
  3332.                             foreach ($company_id_list as $index_company => $company_id) {
  3333.                                 $companyIdListByAppId[$currAppId][] = $currAppId '_' $company_id;
  3334.                                 $app_company_index $currAppId '_' $company_id;
  3335.                                 $companyNameListByAppId[$app_company_index] = $company_name_list[$company_id];
  3336.                                 $companyImageListByAppId[$app_company_index] = $company_image_list[$company_id];
  3337.                             }
  3338.                         } else {
  3339.                             $dataToConnect System::changeDoctrineManagerByAppId(
  3340.                                 $this->getDoctrine()->getManager('company_group'),
  3341.                                 $gocEnabled,
  3342.                                 $currAppId
  3343.                             );
  3344.                             if (!empty($dataToConnect)) {
  3345.                                 $connector $this->container->get('application_connector');
  3346.                                 $connector->resetConnection(
  3347.                                     'default',
  3348.                                     $dataToConnect['dbName'],
  3349.                                     $dataToConnect['dbUser'],
  3350.                                     $dataToConnect['dbPass'],
  3351.                                     $dataToConnect['dbHost'],
  3352.                                     $reset true
  3353.                                 );
  3354.                                 $em $this->getDoctrine()->getManager();
  3355.                                 $companyList Company::getCompanyListWithImage($em);
  3356.                                 foreach ($companyList as $c => $dta) {
  3357.                                     //                                $company_id_list[]=$c;
  3358.                                     //                                $company_name_list[$c] = $companyList[$c]['name'];
  3359.                                     //                                $company_image_list[$c] = $companyList[$c]['image'];
  3360.                                     $companyIdListByAppId[$currAppId][] = $currAppId '_' $c;
  3361.                                     $app_company_index $currAppId '_' $c;
  3362.                                     $companyNameListByAppId[$app_company_index] = $companyList[$c]['name'];
  3363.                                     $companyImageListByAppId[$app_company_index] = $companyList[$c]['image'];
  3364.                                 }
  3365.                             }
  3366.                         }
  3367.                     }
  3368.                     $session->set('appIdList'$appIdList);
  3369.                     $session->set('companyIdListByAppId'$companyIdListByAppId);
  3370.                     $session->set('companyNameListByAppId'$companyNameListByAppId);
  3371.                     $session->set('companyImageListByAppId'$companyImageListByAppId);
  3372.                     $branchIdList json_decode($user->getUserBranchIdList());
  3373.                     $branchId $user->getUserBranchId();
  3374.                     $session->set('branchIdList'$branchIdList);
  3375.                     $session->set('branchId'$branchId);
  3376.                     //USER_ROUTE_LIST
  3377.                     if ($request->request->has('remoteVerify')) {
  3378.                         $session->set('remoteVerified'1);
  3379.                         $session_data = array(
  3380.                             UserConstants::USER_EMPLOYEE_ID => $session->get(UserConstants::USER_EMPLOYEE_ID),
  3381.                             UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTH => $session->get(UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTH),
  3382.                             UserConstants::USER_ID => $session->get(UserConstants::USER_ID),
  3383.                             UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  3384.                             UserConstants::USER_EMAIL => $session->get(UserConstants::USER_EMAIL),
  3385.                             UserConstants::USER_TYPE => $session->get(UserConstants::USER_TYPE),
  3386.                             UserConstants::USER_IMAGE => $session->get(UserConstants::USER_IMAGE),
  3387.                             UserConstants::USER_DEFAULT_ROUTE => $session->get(UserConstants::USER_DEFAULT_ROUTE),
  3388.                             UserConstants::USER_NAME => $session->get(UserConstants::USER_NAME),
  3389.                             UserConstants::USER_COMPANY_ID => $session->get(UserConstants::USER_COMPANY_ID),
  3390.                             UserConstants::USER_COMPANY_ID_LIST => $session->get(UserConstants::USER_COMPANY_ID_LIST),
  3391.                             UserConstants::USER_COMPANY_NAME_LIST => $session->get(UserConstants::USER_COMPANY_NAME_LIST),
  3392.                             UserConstants::USER_COMPANY_IMAGE_LIST => $session->get(UserConstants::USER_COMPANY_IMAGE_LIST),
  3393.                             UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  3394.                             UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  3395.                             UserConstants::USER_CURRENT_POSITION => $session->get(UserConstants::USER_CURRENT_POSITION),
  3396.                             UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  3397.                             UserConstants::SESSION_SALT => $session->get(UserConstants::SESSION_SALT),
  3398.                             UserConstants::APPLICATION_SECRET => $session->get(UserConstants::APPLICATION_SECRET),
  3399.                             UserConstants::USER_POSITION_LIST => $session->get(UserConstants::USER_POSITION_LIST),
  3400.                             'userCompanyDarkVibrantList' => $session->get('userCompanyDarkVibrantList', []),
  3401.                             'userCompanyVibrantList' => $session->get('userCompanyVibrantList', []),
  3402.                             'userCompanyLightVibrantList' => $session->get('userCompanyLightVibrantList', []),
  3403.                             UserConstants::ALL_MODULE_ACCESS_FLAG => $session->get(UserConstants::ALL_MODULE_ACCESS_FLAG),
  3404.                             UserConstants::USER_GOC_ID => $session->get(UserConstants::USER_GOC_ID),
  3405.                             UserConstants::USER_DB_NAME => $session->get(UserConstants::USER_DB_NAME),
  3406.                             UserConstants::USER_DB_USER => $session->get(UserConstants::USER_DB_USER),
  3407.                             UserConstants::USER_DB_HOST => $session->get(UserConstants::USER_DB_HOST),
  3408.                             UserConstants::USER_DB_PASS => $session->get(UserConstants::USER_DB_PASS),
  3409.                             UserConstants::PRODUCT_NAME_DISPLAY_TYPE => $session->get(UserConstants::PRODUCT_NAME_DISPLAY_TYPE),
  3410.                             UserConstants::USER_NOTIFICATION_ENABLED => GeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0,
  3411.                             UserConstants::USER_NOTIFICATION_SERVER => $this->getParameter('notification_server'),
  3412.                             //new
  3413.                             'appIdList' => $session->get('appIdList'),
  3414.                             'companyIdListByAppId' => $session->get('companyIdListByAppId'),
  3415.                             'companyNameListByAppId' => $session->get('companyNameListByAppId'),
  3416.                             'companyImageListByAppId' => $session->get('companyImageListByAppId'),
  3417.                             'branchIdList' => $session->get('branchIdList'null),
  3418.                             'branchId' => $session->get('branchId'null),
  3419.                         );
  3420.                         return new JsonResponse(array(
  3421.                             'uid' => $session->get(UserConstants::USER_ID),
  3422.                             'session' => $session,
  3423.                             'success' => true,
  3424.                             'session_data' => $session_data,
  3425.                             'session2' => $_SESSION,
  3426.                         ));
  3427.                     }
  3428.                     return $this->redirectToRoute("system_admin_dashboard");
  3429.                 } else if ($userType == UserConstants::USER_TYPE_MANAGEMENT_USER) {
  3430.                     // General User
  3431.                     $employeeId 0;
  3432.                     $currentMonthHolidayList = [];
  3433.                     $employeeObj $em->getRepository('ApplicationBundle:Employee')
  3434.                         ->findOneBy(
  3435.                             array(
  3436.                                 'userId' => $user->getUserId()
  3437.                             )
  3438.                         );
  3439.                     if ($employeeObj) {
  3440.                         $employeeId $employeeObj->getEmployeeId();
  3441.                         $holidayListObj HumanResource::getFilteredHolidaysSingle($em, ['employeeId' => $employeeId], $employeeObjtrue);
  3442.                         $currentMonthHolidayList $holidayListObj['filteredData']['holidayList'];
  3443.                     }
  3444.                     $session->set(UserConstants::USER_EMPLOYEE_IDstrval($employeeId));
  3445.                     $session->set(UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTHjson_encode($currentMonthHolidayList));
  3446.                     $session->set(UserConstants::USER_ID$user->getUserId());
  3447.                     $session->set(UserConstants::USER_TYPEUserConstants::USER_TYPE_MANAGEMENT_USER);
  3448.                     $session->set(UserConstants::USER_EMAIL$user->getEmail());
  3449.                     $session->set(UserConstants::USER_IMAGE$user->getImage());
  3450.                     $session->set(UserConstants::USER_NAME$user->getName());
  3451.                     $session->set(UserConstants::USER_DEFAULT_ROUTE$user->getDefaultRoute());
  3452.                     $session->set(UserConstants::USER_COMPANY_ID$user->getUserCompanyId());
  3453.                     $session->set(UserConstants::USER_COMPANY_ID_LISTjson_encode($company_id_list));
  3454.                     $session->set(UserConstants::USER_COMPANY_NAME_LISTjson_encode($company_name_list));
  3455.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3456.                     $session->set('userCompanyDarkVibrantList'json_encode($company_dark_vibrant_list));
  3457.                     $session->set('userCompanyVibrantList'json_encode($company_vibrant_list));
  3458.                     $session->set('userCompanyLightVibrantList'json_encode($company_light_vibrant_list));
  3459.                     $session->set(UserConstants::USER_APP_ID$user->getUserAppId());
  3460.                     $session->set(UserConstants::USER_POSITION_LIST$user->getPositionIds());
  3461.                     $session->set(UserConstants::ALL_MODULE_ACCESS_FLAG$user->getAllModuleAccessFlag());
  3462.                     $session->set(UserConstants::SESSION_SALTuniqid(mt_rand()));
  3463.                     $session->set(UserConstants::APPLICATION_SECRET$this->container->getParameter('secret'));
  3464.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3465.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3466.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3467.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3468.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3469.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3470.                     $session->set(UserConstants::USER_NOTIFICATION_ENABLEDGeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0);
  3471.                     $session->set(UserConstants::USER_NOTIFICATION_SERVER$this->getParameter('notification_server'));
  3472.                     if (count(json_decode($user->getPositionIds(), true)) > 1) {
  3473.                         return $this->redirectToRoute("user_login_position");
  3474.                     } else {
  3475.                         $PL json_decode($user->getPositionIds(), true);
  3476.                         $route_list_array Position::getUserRouteArray($this->getDoctrine()->getManager(), $PL[0], $user->getUserId());
  3477.                         $session->set(UserConstants::USER_CURRENT_POSITION$PL[0]);
  3478.                         $loginID $this->get('user_module')->addUserLoginLog(
  3479.                             $session->get(UserConstants::USER_ID),
  3480.                             $request->server->get("REMOTE_ADDR"),
  3481.                             $PL[0]
  3482.                         );
  3483.                         $session->set(UserConstants::USER_LOGIN_ID$loginID);
  3484.                         //                    $session->set(UserConstants::USER_LOGIN_ID, $loginID);
  3485.                         $session->set(UserConstants::USER_GOC_ID$gocId);
  3486.                         $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3487.                         $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3488.                         $session->set(UserConstants::USER_DEFAULT_ROUTE$user->getDefaultRoute());
  3489.                         $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3490.                         $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3491.                         $session->set(UserConstants::USER_ROUTE_LISTjson_encode($route_list_array));
  3492.                         $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3493.                         $appIdList json_decode($user->getUserAppIdList());
  3494.                         if ($appIdList == null$appIdList = [];
  3495.                         $companyIdListByAppId = [];
  3496.                         $companyNameListByAppId = [];
  3497.                         $companyImageListByAppId = [];
  3498.                         if (!in_array($user->getUserAppId(), $appIdList))
  3499.                             $appIdList[] = $user->getUserAppId();
  3500.                         foreach ($appIdList as $currAppId) {
  3501.                             if ($currAppId == $user->getUserAppId()) {
  3502.                                 foreach ($company_id_list as $index_company => $company_id) {
  3503.                                     $companyIdListByAppId[$currAppId][] = $currAppId '_' $company_id;
  3504.                                     $app_company_index $currAppId '_' $company_id;
  3505.                                     $companyNameListByAppId[$app_company_index] = $company_name_list[$company_id];
  3506.                                     $companyImageListByAppId[$app_company_index] = $company_image_list[$company_id];
  3507.                                 }
  3508.                             } else {
  3509.                                 $dataToConnect System::changeDoctrineManagerByAppId(
  3510.                                     $this->getDoctrine()->getManager('company_group'),
  3511.                                     $gocEnabled,
  3512.                                     $currAppId
  3513.                                 );
  3514.                                 if (!empty($dataToConnect)) {
  3515.                                     $connector $this->container->get('application_connector');
  3516.                                     $connector->resetConnection(
  3517.                                         'default',
  3518.                                         $dataToConnect['dbName'],
  3519.                                         $dataToConnect['dbUser'],
  3520.                                         $dataToConnect['dbPass'],
  3521.                                         $dataToConnect['dbHost'],
  3522.                                         $reset true
  3523.                                     );
  3524.                                     $em $this->getDoctrine()->getManager();
  3525.                                     $companyList Company::getCompanyListWithImage($em);
  3526.                                     foreach ($companyList as $c => $dta) {
  3527.                                         //                                $company_id_list[]=$c;
  3528.                                         //                                $company_name_list[$c] = $companyList[$c]['name'];
  3529.                                         //                                $company_image_list[$c] = $companyList[$c]['image'];
  3530.                                         $companyIdListByAppId[$currAppId][] = $currAppId '_' $c;
  3531.                                         $app_company_index $currAppId '_' $c;
  3532.                                         $companyNameListByAppId[$app_company_index] = $companyList[$c]['name'];
  3533.                                         $companyImageListByAppId[$app_company_index] = $companyList[$c]['image'];
  3534.                                     }
  3535.                                 }
  3536.                             }
  3537.                         }
  3538.                         $session->set('appIdList'$appIdList);
  3539.                         $session->set('companyIdListByAppId'$companyIdListByAppId);
  3540.                         $session->set('companyNameListByAppId'$companyNameListByAppId);
  3541.                         $session->set('companyImageListByAppId'$companyImageListByAppId);
  3542.                         $branchIdList json_decode($user->getUserBranchIdList());
  3543.                         $branchId $user->getUserBranchId();
  3544.                         $session->set('branchIdList'$branchIdList);
  3545.                         $session->set('branchId'$branchId);
  3546.                         if ($user->getAllModuleAccessFlag() == 1)
  3547.                             $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode([]));
  3548.                         else
  3549.                             $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode(Position::getUserProhibitRouteArray($this->getDoctrine()->getManager(), $PL[0], $user->getUserId())));
  3550.                         if ($request->request->has('remoteVerify')) {
  3551.                             $session->set('remoteVerified'1);
  3552.                             $session_data = array(
  3553.                                 UserConstants::USER_EMPLOYEE_ID => $session->get(UserConstants::USER_EMPLOYEE_ID),
  3554.                                 UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTH => $session->get(UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTH),
  3555.                                 UserConstants::USER_ID => $session->get(UserConstants::USER_ID),
  3556.                                 UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  3557.                                 UserConstants::USER_EMAIL => $session->get(UserConstants::USER_EMAIL),
  3558.                                 UserConstants::USER_TYPE => $session->get(UserConstants::USER_TYPE),
  3559.                                 UserConstants::USER_IMAGE => $session->get(UserConstants::USER_IMAGE),
  3560.                                 UserConstants::USER_DEFAULT_ROUTE => $session->get(UserConstants::USER_DEFAULT_ROUTE),
  3561.                                 UserConstants::USER_NAME => $session->get(UserConstants::USER_NAME),
  3562.                                 UserConstants::USER_COMPANY_ID => $session->get(UserConstants::USER_COMPANY_ID),
  3563.                                 UserConstants::USER_COMPANY_ID_LIST => $session->get(UserConstants::USER_COMPANY_ID_LIST),
  3564.                                 UserConstants::USER_COMPANY_NAME_LIST => $session->get(UserConstants::USER_COMPANY_NAME_LIST),
  3565.                                 UserConstants::USER_COMPANY_IMAGE_LIST => $session->get(UserConstants::USER_COMPANY_IMAGE_LIST),
  3566.                                 UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  3567.                                 UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  3568.                                 UserConstants::USER_CURRENT_POSITION => $session->get(UserConstants::USER_CURRENT_POSITION),
  3569.                                 UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  3570.                                 UserConstants::SESSION_SALT => $session->get(UserConstants::SESSION_SALT),
  3571.                                 UserConstants::APPLICATION_SECRET => $session->get(UserConstants::APPLICATION_SECRET),
  3572.                                 UserConstants::USER_POSITION_LIST => $session->get(UserConstants::USER_POSITION_LIST),
  3573.                                 'userCompanyDarkVibrantList' => $session->get('userCompanyDarkVibrantList', []),
  3574.                                 'userCompanyVibrantList' => $session->get('userCompanyVibrantList', []),
  3575.                                 'userCompanyLightVibrantList' => $session->get('userCompanyLightVibrantList', []),
  3576.                                 UserConstants::ALL_MODULE_ACCESS_FLAG => $session->get(UserConstants::ALL_MODULE_ACCESS_FLAG),
  3577.                                 UserConstants::USER_GOC_ID => $session->get(UserConstants::USER_GOC_ID),
  3578.                                 UserConstants::USER_DB_NAME => $session->get(UserConstants::USER_DB_NAME),
  3579.                                 UserConstants::USER_DB_USER => $session->get(UserConstants::USER_DB_USER),
  3580.                                 UserConstants::USER_DB_HOST => $session->get(UserConstants::USER_DB_HOST),
  3581.                                 UserConstants::USER_DB_PASS => $session->get(UserConstants::USER_DB_PASS),
  3582.                                 UserConstants::PRODUCT_NAME_DISPLAY_TYPE => $session->get(UserConstants::PRODUCT_NAME_DISPLAY_TYPE),
  3583.                                 UserConstants::USER_NOTIFICATION_ENABLED => GeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0,
  3584.                                 UserConstants::USER_NOTIFICATION_SERVER => $this->getParameter('notification_server'),
  3585.                                 //new
  3586.                                 'branchIdList' => $session->get('branchIdList'null),
  3587.                                 'branchId' => $session->get('branchId'null),
  3588.                                 'appIdList' => $session->get('appIdList'),
  3589.                                 'companyIdListByAppId' => $session->get('companyIdListByAppId'),
  3590.                                 'companyNameListByAppId' => $session->get('companyNameListByAppId'),
  3591.                                 'companyImageListByAppId' => $session->get('companyImageListByAppId'),
  3592.                             );
  3593.                             $response = new JsonResponse(array(
  3594.                                 'uid' => $session->get(UserConstants::USER_ID),
  3595.                                 'session' => $session,
  3596.                                 'success' => true,
  3597.                                 'session_data' => $session_data,
  3598.                                 'session2' => $_SESSION,
  3599.                             ));
  3600.                             $response->headers->set('Access-Control-Allow-Origin''*');
  3601.                             return $response;
  3602.                         }
  3603.                         if ($request->server->has("HTTP_REFERER")) {
  3604.                             if ($request->request->get('HTTP_REFERER') != '/' && $request->request->get('HTTP_REFERER') != '') {
  3605.                                 return $this->redirect($request->request->get('HTTP_REFERER'));
  3606.                             }
  3607.                         }
  3608.                         //                    $request->server->get("REMOTE_ADDR"), $PL[0]);
  3609.                         if ($request->request->has('referer_path')) {
  3610.                             if ($request->request->get('referer_path') != '/' && $request->request->get('referer_path') != '') {
  3611.                                 return $this->redirect($request->request->get('referer_path'));
  3612.                             }
  3613.                         }
  3614.                         //                    if($request->request->has('gocId')
  3615.                         if ($user->getDefaultRoute() == "" || $user->getDefaultRoute() == "")
  3616.                             return $this->redirectToRoute("dashboard");
  3617.                         else
  3618.                             return $this->redirectToRoute($user->getDefaultRoute());
  3619.                     }
  3620.                 } else if ($userType == UserConstants::USER_TYPE_APPLICANT) {
  3621.                     $session->set(UserConstants::USER_ID$user->getApplicantId());
  3622.                     // $session->set(UserConstants::SUPPLIER_ID, $user->getSupplierId());
  3623.                     $session->set(UserConstants::USER_TYPEUserConstants::USER_TYPE_APPLICANT);
  3624.                     $session->set(UserConstants::USER_EMAIL$user->getOauthEmail());
  3625.                     $session->set(UserConstants::USER_IMAGE$user->getImage());
  3626.                     $session->set(UserConstants::USER_NAME$user->getFirstName() . ' ' $user->getLastName());
  3627.                     $session->set(UserConstants::USER_DEFAULT_ROUTE'');
  3628.                     $session->set(UserConstants::USER_COMPANY_ID1);
  3629.                     $session->set(UserConstants::USER_COMPANY_ID_LISTjson_encode($company_id_list));
  3630.                     $session->set(UserConstants::USER_COMPANY_NAME_LISTjson_encode($company_name_list));
  3631.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3632.                     $session->set('userCompanyDarkVibrantList'json_encode($company_dark_vibrant_list));
  3633.                     $session->set('userCompanyVibrantList'json_encode($company_vibrant_list));
  3634.                     $session->set('userCompanyLightVibrantList'json_encode($company_light_vibrant_list));
  3635.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3636.                     $session->set(UserConstants::USER_APP_ID$appIdFromUserName);
  3637.                     $session->set(UserConstants::USER_POSITION_LIST'[]');
  3638.                     $session->set(UserConstants::ALL_MODULE_ACCESS_FLAG0);
  3639.                     $session->set(UserConstants::SESSION_SALTuniqid(mt_rand()));
  3640.                     $session->set(UserConstants::APPLICATION_SECRET$this->container->getParameter('secret'));
  3641.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3642.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3643.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3644.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3645.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3646.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3647.                     $session->set(UserConstants::USER_NOTIFICATION_ENABLEDGeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0);
  3648.                     $session->set(UserConstants::USER_NOTIFICATION_SERVER$this->getParameter('notification_server'));
  3649.                     $route_list_array = [];
  3650.                     $session->set(UserConstants::USER_CURRENT_POSITION0);
  3651.                     $loginID 0;
  3652.                     $session->set(UserConstants::USER_LOGIN_ID$loginID);
  3653.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3654.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3655.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3656.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3657.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3658.                     $session->set(UserConstants::USER_ROUTE_LISTjson_encode($route_list_array));
  3659.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3660.                     $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode([]));
  3661.                     if ($request->request->has('referer_path')) {
  3662.                         if ($request->request->get('referer_path') != '/' && $request->request->get('referer_path') != '') {
  3663.                             return $this->redirect($request->request->get('referer_path'));
  3664.                         }
  3665.                     }
  3666.                     return $this->redirectToRoute("applicant_dashboard");
  3667.                 } else {
  3668.                     // General User
  3669.                     $employeeId 0;
  3670.                     $currentMonthHolidayList = [];
  3671.                     $employeeObj $em->getRepository('ApplicationBundle:Employee')
  3672.                         ->findOneBy(
  3673.                             array(
  3674.                                 'userId' => $user->getUserId()
  3675.                             )
  3676.                         );
  3677.                     if ($employeeObj) {
  3678.                         $employeeId $employeeObj->getEmployeeId();
  3679.                         $holidayListObj HumanResource::getFilteredHolidaysSingle($em, ['employeeId' => $employeeId], $employeeObjtrue);
  3680.                         $currentMonthHolidayList $holidayListObj['filteredData']['holidayList'];
  3681.                     }
  3682.                     $session->set(UserConstants::USER_EMPLOYEE_IDstrval($employeeId));
  3683.                     $session->set(UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTHjson_encode($currentMonthHolidayList));
  3684. //          $session->set('$holidayListObj', json_encode($holidayListObj));
  3685.                     $session->set(UserConstants::USER_ID$user->getUserId());
  3686.                     $session->set(UserConstants::USER_TYPEUserConstants::USER_TYPE_GENERAL);
  3687.                     $session->set(UserConstants::USER_EMAIL$user->getEmail());
  3688.                     $session->set(UserConstants::USER_IMAGE$user->getImage());
  3689.                     $session->set(UserConstants::USER_NAME$user->getName());
  3690.                     $session->set(UserConstants::USER_DEFAULT_ROUTE$user->getDefaultRoute());
  3691.                     $session->set(UserConstants::USER_COMPANY_ID$user->getUserCompanyId());
  3692.                     $session->set(UserConstants::USER_COMPANY_ID_LISTjson_encode($company_id_list));
  3693.                     $session->set(UserConstants::USER_COMPANY_NAME_LISTjson_encode($company_name_list));
  3694.                     $session->set(UserConstants::USER_COMPANY_IMAGE_LISTjson_encode($company_image_list));
  3695.                     $session->set('userCompanyDarkVibrantList'json_encode($company_dark_vibrant_list));
  3696.                     $session->set('userCompanyVibrantList'json_encode($company_vibrant_list));
  3697.                     $session->set('userCompanyLightVibrantList'json_encode($company_light_vibrant_list));
  3698.                     $session->set(UserConstants::USER_APP_ID$user->getUserAppId());
  3699.                     $session->set(UserConstants::USER_POSITION_LIST$user->getPositionIds());
  3700.                     $session->set(UserConstants::ALL_MODULE_ACCESS_FLAG$user->getAllModuleAccessFlag());
  3701.                     $session->set(UserConstants::SESSION_SALTuniqid(mt_rand()));
  3702.                     $session->set(UserConstants::APPLICATION_SECRET$this->container->getParameter('secret'));
  3703.                     $session->set(UserConstants::USER_GOC_ID$gocId);
  3704.                     $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3705.                     $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3706.                     $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3707.                     $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3708.                     $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3709.                     $session->set(UserConstants::USER_NOTIFICATION_ENABLEDGeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0);
  3710.                     $session->set(UserConstants::USER_NOTIFICATION_SERVER$this->getParameter('notification_server'));
  3711.                     if (count(json_decode($user->getPositionIds(), true)) > 1) {
  3712.                         return $this->redirectToRoute("user_login_position");
  3713.                     } else {
  3714.                         $PL json_decode($user->getPositionIds(), true);
  3715.                         $route_list_array Position::getUserRouteArray($this->getDoctrine()->getManager(), $PL[0], $user->getUserId());
  3716.                         $session->set(UserConstants::USER_CURRENT_POSITION$PL[0]);
  3717.                         $loginID $this->get('user_module')->addUserLoginLog(
  3718.                             $session->get(UserConstants::USER_ID),
  3719.                             $request->server->get("REMOTE_ADDR"),
  3720.                             $PL[0]
  3721.                         );
  3722.                         $session->set(UserConstants::USER_LOGIN_ID$loginID);
  3723.                         //                    $session->set(UserConstants::USER_LOGIN_ID, $loginID);
  3724.                         $session->set(UserConstants::USER_GOC_ID$gocId);
  3725.                         $session->set(UserConstants::USER_DB_NAME$gocDbName);
  3726.                         $session->set(UserConstants::USER_DB_USER$gocDbUser);
  3727.                         $session->set(UserConstants::USER_DEFAULT_ROUTE$user->getDefaultRoute());
  3728.                         $session->set(UserConstants::USER_DB_PASS$gocDbPass);
  3729.                         $session->set(UserConstants::USER_DB_HOST$gocDbHost);
  3730.                         $session->set(UserConstants::USER_ROUTE_LISTjson_encode($route_list_array));
  3731.                         $session->set(UserConstants::PRODUCT_NAME_DISPLAY_TYPE$product_name_display_type);
  3732.                         $appIdList json_decode($user->getUserAppIdList());
  3733.                         if ($appIdList == null$appIdList = [];
  3734.                         $companyIdListByAppId = [];
  3735.                         $companyNameListByAppId = [];
  3736.                         $companyImageListByAppId = [];
  3737.                         if (!in_array($user->getUserAppId(), $appIdList))
  3738.                             $appIdList[] = $user->getUserAppId();
  3739.                         foreach ($appIdList as $currAppId) {
  3740.                             if ($currAppId == $user->getUserAppId()) {
  3741.                                 foreach ($company_id_list as $index_company => $company_id) {
  3742.                                     $companyIdListByAppId[$currAppId][] = $currAppId '_' $company_id;
  3743.                                     $app_company_index $currAppId '_' $company_id;
  3744.                                     $companyNameListByAppId[$app_company_index] = $company_name_list[$company_id];
  3745.                                     $companyImageListByAppId[$app_company_index] = $company_image_list[$company_id];
  3746.                                 }
  3747.                             } else {
  3748.                                 $dataToConnect System::changeDoctrineManagerByAppId(
  3749.                                     $this->getDoctrine()->getManager('company_group'),
  3750.                                     $gocEnabled,
  3751.                                     $currAppId
  3752.                                 );
  3753.                                 if (!empty($dataToConnect)) {
  3754.                                     $connector $this->container->get('application_connector');
  3755.                                     $connector->resetConnection(
  3756.                                         'default',
  3757.                                         $dataToConnect['dbName'],
  3758.                                         $dataToConnect['dbUser'],
  3759.                                         $dataToConnect['dbPass'],
  3760.                                         $dataToConnect['dbHost'],
  3761.                                         $reset true
  3762.                                     );
  3763.                                     $em $this->getDoctrine()->getManager();
  3764.                                     $companyList Company::getCompanyListWithImage($em);
  3765.                                     foreach ($companyList as $c => $dta) {
  3766.                                         //                                $company_id_list[]=$c;
  3767.                                         //                                $company_name_list[$c] = $companyList[$c]['name'];
  3768.                                         //                                $company_image_list[$c] = $companyList[$c]['image'];
  3769.                                         $companyIdListByAppId[$currAppId][] = $currAppId '_' $c;
  3770.                                         $app_company_index $currAppId '_' $c;
  3771.                                         $companyNameListByAppId[$app_company_index] = $companyList[$c]['name'];
  3772.                                         $companyImageListByAppId[$app_company_index] = $companyList[$c]['image'];
  3773.                                     }
  3774.                                 }
  3775.                             }
  3776.                         }
  3777.                         $session->set('appIdList'$appIdList);
  3778.                         $session->set('companyIdListByAppId'$companyIdListByAppId);
  3779.                         $session->set('companyNameListByAppId'$companyNameListByAppId);
  3780.                         $session->set('companyImageListByAppId'$companyImageListByAppId);
  3781.                         $branchIdList json_decode($user->getUserBranchIdList());
  3782.                         $branchId $user->getUserBranchId();
  3783.                         $session->set('branchIdList'$branchIdList);
  3784.                         $session->set('branchId'$branchId);
  3785.                         if ($user->getAllModuleAccessFlag() == 1)
  3786.                             $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode([]));
  3787.                         else
  3788.                             $session->set(UserConstants::USER_PROHIBIT_LISTjson_encode(Position::getUserProhibitRouteArray($this->getDoctrine()->getManager(), $PL[0], $user->getUserId())));
  3789.                         if ($request->request->has('remoteVerify')) {
  3790.                             $session->set('remoteVerified'1);
  3791.                             $session_data = array(
  3792.                                 UserConstants::USER_EMPLOYEE_ID => $session->get(UserConstants::USER_EMPLOYEE_ID),
  3793.                                 UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTH => $session->get(UserConstants::USER_HOLIDAY_LIST_CURRENT_MONTH),
  3794.                                 UserConstants::USER_ID => $session->get(UserConstants::USER_ID),
  3795.                                 UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  3796.                                 UserConstants::USER_EMAIL => $session->get(UserConstants::USER_EMAIL),
  3797.                                 UserConstants::USER_TYPE => $session->get(UserConstants::USER_TYPE),
  3798.                                 UserConstants::USER_IMAGE => $session->get(UserConstants::USER_IMAGE),
  3799.                                 UserConstants::USER_DEFAULT_ROUTE => $session->get(UserConstants::USER_DEFAULT_ROUTE),
  3800.                                 UserConstants::USER_NAME => $session->get(UserConstants::USER_NAME),
  3801.                                 UserConstants::USER_COMPANY_ID => $session->get(UserConstants::USER_COMPANY_ID),
  3802.                                 UserConstants::USER_COMPANY_ID_LIST => $session->get(UserConstants::USER_COMPANY_ID_LIST),
  3803.                                 UserConstants::USER_COMPANY_NAME_LIST => $session->get(UserConstants::USER_COMPANY_NAME_LIST),
  3804.                                 UserConstants::USER_COMPANY_IMAGE_LIST => $session->get(UserConstants::USER_COMPANY_IMAGE_LIST),
  3805.                                 UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  3806.                                 UserConstants::USER_LOGIN_ID => $session->get(UserConstants::USER_LOGIN_ID),
  3807.                                 UserConstants::USER_CURRENT_POSITION => $session->get(UserConstants::USER_CURRENT_POSITION),
  3808.                                 UserConstants::USER_APP_ID => $session->get(UserConstants::USER_APP_ID),
  3809.                                 UserConstants::SESSION_SALT => $session->get(UserConstants::SESSION_SALT),
  3810.                                 UserConstants::APPLICATION_SECRET => $session->get(UserConstants::APPLICATION_SECRET),
  3811.                                 UserConstants::USER_POSITION_LIST => $session->get(UserConstants::USER_POSITION_LIST),
  3812.                                 'userCompanyDarkVibrantList' => $session->get('userCompanyDarkVibrantList', []),
  3813.                                 'userCompanyVibrantList' => $session->get('userCompanyVibrantList', []),
  3814.                                 'userCompanyLightVibrantList' => $session->get('userCompanyLightVibrantList', []),
  3815.                                 UserConstants::ALL_MODULE_ACCESS_FLAG => $session->get(UserConstants::ALL_MODULE_ACCESS_FLAG),
  3816.                                 UserConstants::USER_GOC_ID => $session->get(UserConstants::USER_GOC_ID),
  3817.                                 UserConstants::USER_DB_NAME => $session->get(UserConstants::USER_DB_NAME),
  3818.                                 UserConstants::USER_DB_USER => $session->get(UserConstants::USER_DB_USER),
  3819.                                 UserConstants::USER_DB_HOST => $session->get(UserConstants::USER_DB_HOST),
  3820.                                 UserConstants::USER_DB_PASS => $session->get(UserConstants::USER_DB_PASS),
  3821.                                 UserConstants::PRODUCT_NAME_DISPLAY_TYPE => $session->get(UserConstants::PRODUCT_NAME_DISPLAY_TYPE),
  3822.                                 UserConstants::USER_NOTIFICATION_ENABLED => GeneralConstant::NOTIFICATION_ENABLED == ? ($this->getParameter('notification_enabled') == 0) : 0,
  3823.                                 UserConstants::USER_NOTIFICATION_SERVER => $this->getParameter('notification_server'),
  3824.                                 //new
  3825.                                 'branchIdList' => $session->get('branchIdList'null),
  3826.                                 'branchId' => $session->get('branchId'null),
  3827.                                 'appIdList' => $session->get('appIdList'),
  3828.                                 'companyIdListByAppId' => $session->get('companyIdListByAppId'),
  3829.                                 'companyNameListByAppId' => $session->get('companyNameListByAppId'),
  3830.                                 'companyImageListByAppId' => $session->get('companyImageListByAppId'),
  3831.                             );
  3832.                             $response = new JsonResponse(array(
  3833.                                 'uid' => $session->get(UserConstants::USER_ID),
  3834.                                 'session' => $session,
  3835.                                 'success' => true,
  3836.                                 'session_data' => $session_data,
  3837.                                 'session2' => $_SESSION,
  3838.                             ));
  3839.                             $response->headers->set('Access-Control-Allow-Origin''*');
  3840.                             return $response;
  3841.                         }
  3842.                         if ($request->server->has("HTTP_REFERER")) {
  3843.                             if ($request->request->get('HTTP_REFERER') != '/' && $request->request->get('HTTP_REFERER') != '') {
  3844.                                 return $this->redirect($request->request->get('HTTP_REFERER'));
  3845.                             }
  3846.                         }
  3847.                         //                    $request->server->get("REMOTE_ADDR"), $PL[0]);
  3848.                         if ($request->request->has('referer_path')) {
  3849.                             if ($request->request->get('referer_path') != '/' && $request->request->get('referer_path') != '') {
  3850.                                 return $this->redirect($request->request->get('referer_path'));
  3851.                             }
  3852.                         }
  3853.                         //                    if($request->request->has('gocId')
  3854.                         if ($user->getDefaultRoute() == "" || $user->getDefaultRoute() == "")
  3855.                             return $this->redirectToRoute("dashboard");
  3856.                         else
  3857.                             return $this->redirectToRoute($user->getDefaultRoute());
  3858.                     }
  3859.                 }
  3860.             }
  3861.         }
  3862.         $session $request->getSession();
  3863.         //        if($request->request->has('remoteVerify')) {
  3864.         //            $session->set('remoteVerified', 1);
  3865.         //            $response= new JsonResponse(array('hi'=>'hello'));
  3866.         //            $response->headers->set('Access-Control-Allow-Origin', '*');
  3867.         //            return $response;
  3868.         //        }
  3869.         return $this->render(
  3870.             'ApplicationBundle:pages/login:login_new.html.twig',
  3871.             array(
  3872.                 "message" => $message,
  3873.                 'page_title' => 'Login',
  3874.                 'gocList' => $gocDataListForLoginWeb,
  3875.                 'gocId' => '',
  3876.                 'encData' => $encData,
  3877.                 //                'ref'=>$request->
  3878.             )
  3879.         );
  3880.     }
  3881.     public function initiateAdminAction(Request $request)
  3882.     {
  3883.         $em $this->getDoctrine()->getManager();
  3884.         MiscActions::initiateAdminUser($em);
  3885.         $this->addFlash(
  3886.             'success',
  3887.             'The Action was Successful.'
  3888.         );
  3889.         return $this->redirectToRoute('user_login');
  3890.     }
  3891.     public function DemoDataFlutterTestAction(Request $request)
  3892.     {
  3893.         return new JsonResponse(
  3894.             array(
  3895.                 ['id' => 1'name' => 'Property 1''rating' => '4.5''description' => 'lorem ipsum 1''imageUrl' => 'https://picsum.photos/200/300'],
  3896.                 ['id' => 2'name' => 'Property 2''rating' => '4.1''description' => 'lorem ipsum 2''imageUrl' => 'https://picsum.photos/200/300'],
  3897.                 ['id' => 3'name' => 'Property 3''rating' => '4.2''description' => 'lorem ipsum 4''imageUrl' => 'https://picsum.photos/200/300'],
  3898.                 ['id' => 4'name' => 'Property 4''rating' => '2.5''description' => 'lorem ipsum 3''imageUrl' => 'https://picsum.photos/200/300'],
  3899.             )
  3900.         );
  3901.     }
  3902.     public function selectDataAjaxAction(Request $request$queryStr '',
  3903.                                                  $version 'latest',
  3904.                                                  $identifier '_default_',
  3905.                                                  $apiKey '_ignore_'
  3906.     )
  3907.     {
  3908.         $em $this->getDoctrine()->getManager();
  3909.         $em_goc $this->getDoctrine()->getManager('company_group');
  3910.         $companyId 0;
  3911.         $skipCurrentUserIdRestriction $request->get('skipCurrentUserIdRestriction'0);
  3912.         $skipCurrentEmployeeIdRestriction $request->get('skipCurrentEmployeeIdRestriction'0);
  3913.         $skipCurrentUserLoginIdRestriction $request->get('skipCurrentUserLoginIdRestriction'0);
  3914.         $currentUserId $request->getSession()->get(UserConstants::USER_ID0);
  3915.         $currentEmployeeId $request->getSession()->get(UserConstants::USER_EMPLOYEE_ID0);
  3916.         $currentUserLoginIds = [];
  3917.         if ($request->request->get('entity_group'0)) {
  3918.             $companyId 0;
  3919.             $em $this->getDoctrine()->getManager('company_group');
  3920.         } else {
  3921.             if ($request->request->get('appId'0) != 0) {
  3922.                 $gocEnabled 0;
  3923.                 if ($this->container->hasParameter('entity_group_enabled'))
  3924.                     $gocEnabled $this->container->getParameter('entity_group_enabled');
  3925.                 else
  3926.                     $gocEnabled 1;
  3927.                 if ($gocEnabled == 1) {
  3928.                     $dataToConnect System::changeDoctrineManagerByAppId(
  3929.                         $this->getDoctrine()->getManager('company_group'),
  3930.                         $gocEnabled,
  3931.                         $request->request->get('appId'0)
  3932.                     );
  3933.                     if (!empty($dataToConnect)) {
  3934.                         $connector $this->container->get('application_connector');
  3935.                         $connector->resetConnection(
  3936.                             'default',
  3937.                             $dataToConnect['dbName'],
  3938.                             $dataToConnect['dbUser'],
  3939.                             $dataToConnect['dbPass'],
  3940.                             $dataToConnect['dbHost'],
  3941.                             $reset true
  3942.                         );
  3943.                         $em $this->getDoctrine()->getManager();
  3944.                     }
  3945.                 }
  3946.             } else if ($request->getSession()->get(UserConstants::USER_APP_ID) != && $request->getSession()->get(UserConstants::USER_APP_ID) != null) {
  3947.                 $gocEnabled 0;
  3948.                 if ($this->container->hasParameter('entity_group_enabled'))
  3949.                     $gocEnabled $this->container->getParameter('entity_group_enabled');
  3950.                 else
  3951.                     $gocEnabled 1;
  3952.                 if ($gocEnabled == 1) {
  3953.                     $dataToConnect System::changeDoctrineManagerByAppId(
  3954.                         $this->getDoctrine()->getManager('company_group'),
  3955.                         $gocEnabled,
  3956.                         $request->getSession()->get(UserConstants::USER_APP_ID)
  3957.                     );
  3958.                     if (!empty($dataToConnect)) {
  3959.                         $connector $this->container->get('application_connector');
  3960.                         $connector->resetConnection(
  3961.                             'default',
  3962.                             $dataToConnect['dbName'],
  3963.                             $dataToConnect['dbUser'],
  3964.                             $dataToConnect['dbPass'],
  3965.                             $dataToConnect['dbHost'],
  3966.                             $reset true
  3967.                         );
  3968.                         $em $this->getDoctrine()->getManager();
  3969.                     }
  3970.                 }
  3971.             }
  3972.             $companyId $this->getLoggedUserCompanyId($request);
  3973.         }
  3974.         $configData = [];
  3975.         $isSingleDataset 1;
  3976.         $dataSet $request->request->has('dataset') ? $request->request->get('dataset') : [];
  3977.         if (is_string($dataSet)) $dataSet json_decode($dataSettrue);
  3978.         $valuePairs $request->get('valuePairs', []);
  3979.         if (is_string($valuePairs)) $valuePairs json_decode($valuePairstrue);
  3980.         $allResult = [];
  3981.         $datasetFromConfig = [];
  3982.         if ($identifier != '_default_') {
  3983.             $config_file $this->container->getParameter('kernel.root_dir') . '/../src/ApplicationBundle/Resources/config/api/' $identifier 'Config.json';
  3984.             if (!file_exists($config_file)) {
  3985.             } else {
  3986.                 $fileText file_get_contents($config_file);
  3987.                 //now replace any value pairs
  3988.                 foreach ($valuePairs as $kkeeyy => $vvaalluuee) {
  3989.                     if (is_array($vvaalluuee)) {
  3990.                         if (isset($vvaalluuee['value']) && isset($vvaalluuee['type'])) {
  3991.                             if ($vvaalluuee['type'] == 'array'$fileText str_ireplace('_' $kkeeyy '_'json_encode($vvaalluuee['value']), $fileText);
  3992.                             if ($vvaalluuee['type'] == 'value'$fileText str_ireplace('_' $kkeeyy '_'$vvaalluuee['value'], $fileText);
  3993.                             if ($vvaalluuee['type'] == 'text'$fileText str_ireplace('_' $kkeeyy '_'$vvaalluuee['value'], $fileText);
  3994.                         } else {
  3995.                             $fileText str_ireplace('_' $kkeeyy '_'json_encode($vvaalluuee), $fileText);
  3996.                         }
  3997.                     }
  3998.                     $fileText str_ireplace('_' $kkeeyy '_'$vvaalluuee$fileText);
  3999.                 }
  4000.                 $fileText str_ireplace('_query_'$request->get('query'$queryStr), $fileText);
  4001.                 if (!(strpos($fileText'_CURRENT_USER_LOGIN_IDS_') === false) && $skipCurrentUserLoginIdRestriction == 0) {
  4002.                     $userInfo = [];
  4003.                     if ($request->getSession()->get(UserConstants::USER_TYPE0) == UserConstants::USER_TYPE_APPLICANT) {
  4004.                         $userInfo $em_goc->getRepository('CompanyGroupBundle:EntityLoginLog')->findBy(
  4005.                             array('userId' => $currentUserId)
  4006.                         );
  4007.                     } else {
  4008.                         $userInfo $em->getRepository('ApplicationBundle:SysLoginLog')->findBy(
  4009.                             array('userId' => $currentUserId)
  4010.                         );
  4011.                     }
  4012.                     foreach ($userInfo as $uLogininfo) {
  4013.                         $currentUserLoginIds[] = $uLogininfo->getLoginId();
  4014.                     }
  4015.                     $fileText str_ireplace('_CURRENT_USER_LOGIN_IDS_'json_encode($currentUserLoginIds), $fileText);
  4016.                 } else {
  4017.                     $fileText str_ireplace('_CURRENT_USER_LOGIN_IDS_''_EMPTY_'$fileText);
  4018.                 }
  4019.                 if (!(strpos($fileText'_CURRENT_USER_ID_') === false) && $skipCurrentUserIdRestriction == 0) {
  4020.                     $fileText str_ireplace('_CURRENT_USER_ID_'$currentUserId$fileText);
  4021.                 } else {
  4022.                     $fileText str_ireplace('_CURRENT_USER_ID_''_EMPTY_'$fileText);
  4023.                 }
  4024.                 if (!(strpos($fileText'_CURRENT_USER_EMPLOYEE_ID_') === false) && $skipCurrentEmployeeIdRestriction == 0) {
  4025.                     if ((strpos($fileText'skipCurrentEmployeeIdRestriction') === false)) {
  4026.                         $fileText str_ireplace('_CURRENT_USER_EMPLOYEE_ID_'$currentEmployeeId$fileText);
  4027.                     } else {
  4028.                         $fileText str_ireplace('_CURRENT_USER_EMPLOYEE_ID_''_EMPTY_'$fileText);
  4029.                     }
  4030.                 } else {
  4031.                     $fileText str_ireplace('_CURRENT_USER_EMPLOYEE_ID_''_EMPTY_'$fileText);
  4032.                 }
  4033.                 if ($fileText)
  4034.                     $datasetFromConfig json_decode($fileTexttrue);
  4035.                 $skipCurrentUserIdRestriction = isset($datasetFromConfig['skipCurrentUserIdRestriction']) ? $datasetFromConfig['skipCurrentUserIdRestriction'] : $skipCurrentUserIdRestriction;
  4036.                 $skipCurrentEmployeeIdRestriction = isset($datasetFromConfig['skipCurrentEmployeeIdRestriction']) ? $datasetFromConfig['skipCurrentEmployeeIdRestriction'] : $skipCurrentEmployeeIdRestriction;
  4037.                 $skipCurrentUserLoginIdRestriction = isset($datasetFromConfig['skipCurrentUserLoginIdRestriction']) ? $datasetFromConfig['skipCurrentUserLoginIdRestriction'] : $skipCurrentUserLoginIdRestriction;
  4038.             }
  4039.         }
  4040.         if ($dataSet == null$dataSet = [];
  4041. //        return new JsonResponse(array(
  4042. //            'queryStr'=>$queryStr
  4043. //        ));
  4044.         if (!empty($datasetFromConfig)) {
  4045.             if (isset($datasetFromConfig['tableName'])) {
  4046.                 $isSingleDataset 1;
  4047.                 $dataSet[] = $datasetFromConfig;
  4048.             } else {
  4049.                 if (count($datasetFromConfig) == 1)
  4050.                     $isSingleDataset 1;
  4051.                 $dataSet $datasetFromConfig;
  4052.             }
  4053.         }
  4054.         if (empty($dataSet)) {
  4055.             $isSingleDataset 1;
  4056.             $singleDataSet = array(
  4057.                 "valueField" => $request->request->has('valueField') ? $request->request->get('valueField') : 'id',
  4058.                 "query" => $request->get('query'$queryStr),
  4059.                 "headMarkers" => $request->get('headMarkers'''),
  4060.                 "headMarkersStrictMatch" => $request->get('headMarkersStrictMatch'0),
  4061.                 "itemLimit" => $request->request->has('itemLimit') ? $request->request->get('itemLimit') : 25,
  4062.                 "selectorId" => $request->request->has('selectorId') ? $request->request->get('selectorId') : '_NONE_',
  4063.                 "textField" => $request->request->has('textField') ? $request->request->get('textField') : 'name',
  4064.                 "tableName" => $request->request->has('tableName') ? $request->request->get('tableName') : '',
  4065.                 "isMultiple" => $request->request->has('isMultiple') ? $request->request->get('isMultiple') : 0,
  4066.                 "orConditions" => $request->request->has('orConditions') ? $request->request->get('orConditions') : [],
  4067.                 "andConditions" => $request->request->has('andConditions') ? $request->request->get('andConditions') : [],
  4068.                 "andOrConditions" => $request->request->has('andOrConditions') ? $request->request->get('andOrConditions') : [],
  4069.                 "mustConditions" => $request->request->has('mustConditions') ? $request->request->get('mustConditions') : [],
  4070.                 "joinTableData" => $request->request->has('joinTableData') ? $request->request->get('joinTableData') : [],
  4071.                 "renderTextFormat" => $request->request->has('renderTextFormat') ? $request->request->get('renderTextFormat') : '',
  4072.                 "setDataForSingle" => $request->request->has('setDataForSingle') ? $request->request->get('setDataForSingle') : 0,
  4073.                 "dataId" => $request->request->has('dataId') ? $request->request->get('dataId') : 0,
  4074.                 "lastChildrenOnly" => $request->request->has('lastChildrenOnly') ? $request->request->get('lastChildrenOnly') : 0,
  4075.                 "parentOnly" => $request->request->has('parentOnly') ? $request->request->get('parentOnly') : 0,
  4076.                 "parentIdField" => $request->request->has('parentIdField') ? $request->request->get('parentIdField') : 'parent_id',
  4077.                 "skipDefaultCompanyId" => $request->request->has('skipDefaultCompanyId') ? $request->request->get('skipDefaultCompanyId') : 1,
  4078.                 "offset" => $request->request->has('offset') ? $request->request->get('offset') : 0,
  4079.                 "returnTotalMatchedEntriesFlag" => $request->request->has('returnTotalMatched') ? $request->request->get('returnTotalMatched') : 0,
  4080.                 "nextOffset" => 0,
  4081.                 "totalMatchedEntries" => 0,
  4082.                 "convertToObject" => $request->request->has('convertToObject') ? $request->request->get('convertToObject') : [],
  4083.                 "convertDateToStringFieldList" => $request->request->has('convertDateToStringFieldList') ? $request->request->get('convertDateToStringFieldList') : [],
  4084.                 "orderByConditions" => $request->request->has('orderByConditions') ? $request->request->get('orderByConditions') : [],
  4085.                 "convertToUrl" => $request->request->has('convertToUrl') ? $request->request->get('convertToUrl') : [],
  4086.                 "fullPathList" => $request->request->has('fullPathList') ? $request->request->get('fullPathList') : [],
  4087.                 "ret_data" => $request->request->has('ret_data') ? $request->request->get('ret_data') : [],
  4088.             );
  4089.             $dataSet[] = $singleDataSet;
  4090.         }
  4091. //        $lastResult = [
  4092. //            'identifier' => $identifier,
  4093. //            'dataSet' => $dataSet,
  4094. //        ];
  4095. //        return new JsonResponse($lastResult);
  4096.         $userId $request->getSession()->get(UserConstants::USER_ID);
  4097. //        public static function selectDataSystem($em, $queryStr = '_EMPTY_', $data = [],$userId=0)
  4098.         foreach ($dataSet as $dsIndex => $dataConfig) {
  4099.             $companyId 0;
  4100.             $queryStringIndividual $queryStr;
  4101.             $data = [];
  4102.             $data_by_id = [];
  4103.             $setValueArray = [];
  4104.             $silentChangeSelectize 0;
  4105.             $setValue 0;
  4106.             $setValueType 0;// 0 for id , 1 for query
  4107.             $selectAll 0;
  4108.             if ($queryStringIndividual == '_EMPTY_')
  4109.                 $queryStringIndividual '';
  4110.             if (isset($dataConfig['query']))
  4111.                 $queryStringIndividual $dataConfig['query'];
  4112.             if ($queryStringIndividual == '_EMPTY_')
  4113.                 $queryStringIndividual '';
  4114.             $queryStringIndividual str_replace('_FSLASH_''/'$queryStringIndividual);
  4115.             if ($queryStringIndividual === '#setValue:') {
  4116.                 $queryStringIndividual '';
  4117.             }
  4118.             if (!(strpos($queryStringIndividual'_silent_change_') === false)) {
  4119.                 $silentChangeSelectize 1;
  4120.                 $queryStringIndividual str_ireplace('_silent_change_'''$queryStringIndividual);
  4121.             }
  4122.             if (!(strpos($queryStringIndividual'#setValue:') === false)) {
  4123.                 $setValueArrayBeforeFilter explode(','str_replace('#setValue:'''$queryStringIndividual));
  4124.                 foreach ($setValueArrayBeforeFilter as $svf) {
  4125.                     if ($svf == '_ALL_') {
  4126.                         $selectAll 1;
  4127.                         $setValueArray = [];
  4128.                         continue;
  4129.                     }
  4130.                     if (is_numeric($svf)) {
  4131.                         $setValueArray[] = ($svf 1);
  4132.                         $setValue $svf 1;
  4133.                     }
  4134.                 }
  4135.                 $queryStringIndividual '';
  4136.             }
  4137.             $valueField = isset($dataConfig['valueField']) ? $dataConfig['valueField'] : 'id';
  4138.             $headMarkers = isset($dataConfig['headMarkers']) ? $dataConfig['headMarkers'] : ''//Special Field
  4139.             $headMarkersStrictMatch = isset($dataConfig['headMarkersStrictMatch']) ? $dataConfig['headMarkersStrictMatch'] : 0//Special Field
  4140.             $itemLimit = isset($dataConfig['itemLimit']) ? $dataConfig['itemLimit'] : 25;
  4141.             $selectorId = isset($dataConfig['selectorId']) ? $dataConfig['selectorId'] : '_NONE_';
  4142.             $textField = isset($dataConfig['textField']) ? $dataConfig['textField'] : 'name';
  4143.             $table = isset($dataConfig['tableName']) ? $dataConfig['tableName'] : '';
  4144.             $isMultiple = isset($dataConfig['isMultiple']) ? $dataConfig['isMultiple'] : 0;
  4145.             $orConditions = isset($dataConfig['orConditions']) ? $dataConfig['orConditions'] : [];
  4146.             $andConditions = isset($dataConfig['andConditions']) ? $dataConfig['andConditions'] : [];
  4147.             $andOrConditions = isset($dataConfig['andOrConditions']) ? $dataConfig['andOrConditions'] : [];
  4148.             $mustConditions = isset($dataConfig['mustConditions']) ? $dataConfig['mustConditions'] : [];
  4149.             $joinTableData = isset($dataConfig['joinTableData']) ? $dataConfig['joinTableData'] : [];
  4150.             $renderTextFormat = isset($dataConfig['renderTextFormat']) ? $dataConfig['renderTextFormat'] : '';
  4151.             $setDataForSingle = isset($dataConfig['setDataForSingle']) ? $dataConfig['setDataForSingle'] : 0;
  4152.             $dataId = isset($dataConfig['dataId']) ? $dataConfig['dataId'] : 0;
  4153.             $lastChildrenOnly = isset($dataConfig['lastChildrenOnly']) ? $dataConfig['lastChildrenOnly'] : 0;
  4154.             $parentOnly = isset($dataConfig['parentOnly']) ? $dataConfig['parentOnly'] : 0;
  4155.             $parentIdField = isset($dataConfig['parentIdField']) ? $dataConfig['parentIdField'] : 'parent_id';
  4156.             $skipDefaultCompanyId = isset($dataConfig['skipDefaultCompanyId']) ? $dataConfig['skipDefaultCompanyId'] : 1;
  4157.             $offset = isset($dataConfig['offset']) ? $dataConfig['offset'] : 0;
  4158.             $returnTotalMatchedEntriesFlag = isset($dataConfig['returnTotalMatched']) ? $dataConfig['returnTotalMatched'] : 0;
  4159.             $nextOffset 0;
  4160.             $totalMatchedEntries 0;
  4161.             $convertToObjectFieldList = isset($dataConfig['convertToObject']) ? $dataConfig['convertToObject'] : [];
  4162.             $convertDateToStringFieldList = isset($dataConfig['convertDateToStringFieldList']) ? $dataConfig['convertDateToStringFieldList'] : [];
  4163.             $orderByConditions = isset($dataConfig['orderByConditions']) ? $dataConfig['orderByConditions'] : [];
  4164.             $convertToUrl = isset($dataConfig['convertToUrl']) ? $dataConfig['convertToUrl'] : [];
  4165.             $fullPathList = isset($dataConfig['fullPathList']) ? $dataConfig['fullPathList'] : [];
  4166.             if (is_string($andConditions)) $andConditions json_decode($andConditionstrue);
  4167.             if (is_string($orConditions)) $orConditions json_decode($orConditionstrue);
  4168.             if (is_string($andOrConditions)) $andOrConditions json_decode($andOrConditionstrue);
  4169.             if (is_string($mustConditions)) $mustConditions json_decode($mustConditionstrue);
  4170.             if (is_string($joinTableData)) $joinTableData json_decode($joinTableDatatrue);
  4171.             if (is_string($convertToObjectFieldList)) $convertToObjectFieldList json_decode($convertToObjectFieldListtrue);
  4172.             if (is_string($orderByConditions)) $orderByConditions json_decode($orderByConditionstrue);
  4173.             if (is_string($convertToUrl)) $convertToUrl json_decode($convertToUrltrue);
  4174.             if (is_string($fullPathList)) $fullPathList json_decode($fullPathListtrue);
  4175. //            return new JsonResponse(array(
  4176. //                'dataSet'=>$dataSet,
  4177. //                'dataConfig'=>$dataConfig,
  4178. //                'hi'=>$this->container->getParameter('kernel.root_dir') . '/../src/ApplicationBundle/Resources/config/api/' . $identifier . 'Config.json',
  4179. //                'hiD'=>file_get_contents($this->container->getParameter('kernel.root_dir') . '/../src/ApplicationBundle/Resources/config/api/' . $identifier . 'Config.json')
  4180. //            ));
  4181.             if ($table == '') {
  4182.                 $lastResult = array(
  4183.                     'success' => false,
  4184.                     'currentTs' => (new \Datetime())->format('U'),
  4185.                     'isMultiple' => $isMultiple,
  4186.                     'setValueArray' => $setValueArray,
  4187.                     'setValue' => $setValue,
  4188.                     'data' => $data,
  4189.                     'dataId' => $dataId,
  4190.                     'selectorId' => $selectorId,
  4191.                     'dataById' => $data_by_id,
  4192.                     'selectedId' => 0,
  4193.                     'ret_data' => isset($dataConfig['ret_data']) ? $dataConfig['ret_data'] : [],
  4194.                 );
  4195.             } else {
  4196.                 $restrictionData = array(
  4197. //            'table'=>'relevantField in restriction'
  4198.                     'warehouse_action' => 'warehouseActionIds',
  4199.                     'branch' => 'branchIds',
  4200.                     'warehouse' => 'warehouseIds',
  4201.                     'production_process_settings' => 'productionProcessIds',
  4202.                 );
  4203.                 $restrictionIdList = [];
  4204.                 $filterQryForCriteria "select ";
  4205.                 $selectQry "";
  4206. //        $selectQry=" `$table`.* ";
  4207.                 $selectFieldList = isset($dataConfig['selectFieldList']) ? $dataConfig['selectFieldList'] : ['*'];
  4208.                 $selectPrefix = isset($dataConfig['selectPrefix']) ? $dataConfig['selectPrefix'] : '';
  4209.                 if (is_string($selectFieldList)) $selectFieldList json_decode($selectFieldListtrue);
  4210.                 foreach ($selectFieldList as $selField) {
  4211.                     if ($selectQry != '')
  4212.                         $selectQry .= ", ";
  4213.                     if ($selField == '*')
  4214.                         $selectQry .= " `$table`.$selField ";
  4215.                     else if ($selField == 'count(*)' || $selField == '_RESULT_COUNT_') {
  4216.                         if ($selectPrefix == '')
  4217.                             $selectQry .= " count(*)  ";
  4218.                         else
  4219.                             $selectQry .= (" count(*  )  $selectPrefix"_RESULT_COUNT_ ");
  4220.                     } else {
  4221.                         if ($selectPrefix == '')
  4222.                             $selectQry .= " `$table`.`$selField` ";
  4223.                         else
  4224.                             $selectQry .= (" `$table`.`$selField`  $selectPrefix"$selField ");
  4225.                     }
  4226.                 }
  4227.                 $joinQry " from $table ";
  4228. //        $filterQryForCriteria = "select * from $table ";
  4229.                 foreach ($joinTableData as $joinIndex => $joinTableDatum) {
  4230. //            $conditionStr.=' 1=1 ';
  4231.                     $joinTableName = isset($joinTableDatum['tableName']) ? $joinTableDatum['tableName'] : '=';
  4232.                     $joinTableAlias $joinTableName '_' $joinIndex;
  4233.                     $joinTablePrimaryField = isset($joinTableDatum['joinFieldPrimary']) ? $joinTableDatum['joinFieldPrimary'] : ''//field of main table
  4234.                     $joinTableOnField = isset($joinTableDatum['joinOn']) ? $joinTableDatum['joinOn'] : ''//field of joining table
  4235.                     $fieldJoinType = isset($joinTableDatum['fieldJoinType']) ? $joinTableDatum['fieldJoinType'] : '=';
  4236.                     $tableJoinType = isset($joinTableDatum['tableJoinType']) ? $joinTableDatum['tableJoinType'] : 'join';//or inner join
  4237.                     $selectFieldList = isset($joinTableDatum['selectFieldList']) ? $joinTableDatum['selectFieldList'] : ['*'];
  4238.                     $selectPrefix = isset($joinTableDatum['selectPrefix']) ? $joinTableDatum['selectPrefix'] : '';
  4239.                     $joinMustConditions = isset($joinTableDatum['joinMustConditions']) ? $joinTableDatum['joinMustConditions'] : [];
  4240.                     $joinAndConditions = isset($joinTableDatum['joinAndConditions']) ? $joinTableDatum['joinAndConditions'] : [];
  4241.                     $joinAndOrConditions = isset($joinTableDatum['joinAndOrConditions']) ? $joinTableDatum['joinAndOrConditions'] : [];
  4242.                     $joinOrConditions = isset($joinTableDatum['joinOrConditions']) ? $joinTableDatum['joinOrConditions'] : [];
  4243.                     if (is_string($joinAndConditions)) $joinAndConditions json_decode($joinAndConditionstrue);
  4244.                     if (is_string($joinMustConditions)) $joinMustConditions json_decode($joinMustConditionstrue);
  4245.                     if (is_string($joinAndOrConditions)) $joinAndOrConditions json_decode($joinAndOrConditionstrue);
  4246.                     if (is_string($joinOrConditions)) $joinOrConditions json_decode($joinOrConditionstrue);
  4247.                     foreach ($selectFieldList as $selField) {
  4248.                         if ($selField == '*')
  4249.                             $selectQry .= ", `$joinTableAlias`.$selField ";
  4250.                         else if ($selField == 'count(*)' || $selField == '_RESULT_COUNT_') {
  4251.                             if ($selectPrefix == '')
  4252.                                 $selectQry .= ", count(`$joinTableAlias`." $joinTableOnField ")  ";
  4253.                             else
  4254.                                 $selectQry .= (", count(`$joinTableAlias`." $joinTableOnField ")  $selectPrefix"_RESULT_COUNT_ ");
  4255.                         } else {
  4256.                             if ($selectPrefix == '')
  4257.                                 $selectQry .= ", `$joinTableAlias`.`$selField`  ";
  4258.                             else
  4259.                                 $selectQry .= (", `$joinTableAlias`.`$selField`  $selectPrefix"$selField ");
  4260.                         }
  4261.                     }
  4262.                     $joinQry .= $tableJoinType $joinTableName $joinTableAlias on  ";
  4263. //            if($joinTablePrimaryField!='')
  4264. //                $joinQry .= "  `$joinTableAlias`.`$joinTableOnField` $fieldJoinType `$table`.`$joinTablePrimaryField` ";
  4265. //            $joinAndString = '';
  4266.                     $joinMustString '';
  4267.                     if ($joinTablePrimaryField != '')
  4268.                         $joinQry .= "  `$joinTableAlias`.`$joinTableOnField$fieldJoinType `$table`.`$joinTablePrimaryField` ";
  4269.                     foreach ($joinMustConditions as $mustCondition) {
  4270. //            $conditionStr.=' 1=1 ';
  4271.                         $ctype = isset($mustCondition['type']) ? $mustCondition['type'] : '=';
  4272.                         $cfield = isset($mustCondition['field']) ? $mustCondition['field'] : '';
  4273.                         $aliasInCondition $table;
  4274.                         if (!(strpos($cfield'.') === false)) {
  4275.                             $fullCfieldArray explode('.'$cfield);
  4276.                             $aliasInCondition $fullCfieldArray[0];
  4277.                             $cfield $fullCfieldArray[1];
  4278.                         }
  4279.                         $cvalue = isset($mustCondition['value']) ? $mustCondition['value'] : $queryStringIndividual;
  4280.                         if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4281.                             if ($joinMustString != '')
  4282.                                 $joinMustString .= " and ";
  4283.                             if ($ctype == 'like') {
  4284.                                 $joinMustString .= ("`$joinTableAlias`.$cfield like '%" $cvalue "%' ");
  4285.                                 $wordsBySpaces explode(' '$cvalue);
  4286.                                 foreach ($wordsBySpaces as $word) {
  4287.                                     if ($joinMustString != '')
  4288.                                         $joinMustString .= " and ";
  4289.                                     $joinMustString .= ("`$joinTableAlias`.$cfield like '%" $word "%' ");
  4290.                                 }
  4291.                             } else if ($ctype == 'not like') {
  4292.                                 $joinMustString .= ("`$joinTableAlias`.$cfield not like '%" $cvalue "%' ");
  4293.                                 $wordsBySpaces explode(' '$cvalue);
  4294.                                 foreach ($wordsBySpaces as $word) {
  4295.                                     if ($joinMustString != '')
  4296.                                         $joinMustString .= " and ";
  4297.                                     $joinMustString .= ("`$joinTableAlias`.$cfield not like '%" $word "%' ");
  4298.                                 }
  4299.                             } else if ($ctype == 'not_in') {
  4300.                                 $joinMustString .= " ( ";
  4301.                                 if (in_array('null'$cvalue)) {
  4302.                                     $joinMustString .= " `$joinTableAlias`.$cfield is not null";
  4303.                                     $cvalue array_diff($cvalue, ['null']);
  4304.                                     if (!empty($cvalue))
  4305.                                         $joinMustString .= " and ";
  4306.                                 }
  4307.                                 if (in_array(''$cvalue)) {
  4308.                                     $joinMustString .= "`$joinTableAlias`.$cfield != '' ";
  4309.                                     $cvalue array_diff($cvalue, ['']);
  4310.                                     if (!empty($cvalue))
  4311.                                         $joinMustString .= " and ";
  4312.                                 }
  4313.                                 $joinMustString .= "`$joinTableAlias`.$cfield not in (" implode(','$cvalue) . ") ) ";
  4314.                             } else if ($ctype == 'in') {
  4315.                                 if (in_array('null'$cvalue)) {
  4316.                                     $joinMustString .= "`$joinTableAlias`.$cfield is null";
  4317.                                     $cvalue array_diff($cvalue, ['null']);
  4318.                                     if (!empty($cvalue))
  4319.                                         $joinMustString .= " and ";
  4320.                                 }
  4321.                                 if (in_array(''$cvalue)) {
  4322.                                     $joinMustString .= "`$joinTableAlias`.$cfield = '' ";
  4323.                                     $cvalue array_diff($cvalue, ['']);
  4324.                                     if (!empty($cvalue))
  4325.                                         $joinMustString .= " and ";
  4326.                                 }
  4327.                                 $joinMustString .= "`$joinTableAlias`.$cfield in (" implode(','$cvalue) . ") ";
  4328.                             } else if ($ctype == '=') {
  4329. //                        if (!(strpos($cvalue, '.') === false) && !(strpos($cvalue, '_PRIMARY_TABLE_') === false)) {
  4330. //                            $fullCfieldArray = explode('.', $cfield);
  4331. //                            $aliasInCondition = $fullCfieldArray[0];
  4332. //                            $cfield = $fullCfieldArray[1];
  4333. //                        }
  4334.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4335.                                     $joinMustString .= "`$joinTableAlias`.$cfield is null ";
  4336.                                 else
  4337.                                     $joinMustString .= "`$joinTableAlias`.$cfield = $cvalue ";
  4338.                             } else if ($ctype == '!=') {
  4339.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4340.                                     $joinMustString .= "`$joinTableAlias`.$cfield is not null ";
  4341.                                 else
  4342.                                     $joinMustString .= "`$joinTableAlias`.$cfield != $cvalue ";
  4343.                             } else {
  4344.                                 if (is_string($cvalue))
  4345.                                     $joinMustString .= "`$joinTableAlias`.$cfield $ctype '" $cvalue "' ";
  4346.                                 else
  4347.                                     $joinMustString .= "`$joinTableAlias`.$cfield $ctype " $cvalue " ";
  4348.                             }
  4349.                         }
  4350.                     }
  4351. //            if ($joinMustString != '') {
  4352. //                if ($conditionStr != '')
  4353. //                    $conditionStr .= (" and (" . $joinMustString . ") ");
  4354. //                else
  4355. //                    $conditionStr .= ("  (" . $joinMustString . ") ");
  4356. //            }
  4357.                     if ($joinMustString != '') {
  4358.                         $joinQry .= (' and ' $joinMustString);
  4359. //                        $joinQry.=' and (';
  4360.                     }
  4361.                     $mustBracketDone 0;
  4362.                     $joinAndString '';
  4363. //                    if ($joinTablePrimaryField != '')
  4364. //                        $joinAndString .= "  `$joinTableAlias`.`$joinTableOnField` $fieldJoinType `$table`.`$joinTablePrimaryField` ";
  4365.                     foreach ($joinAndConditions as $andCondition) {
  4366. //            $conditionStr.=' 1=1 ';
  4367.                         $ctype = isset($andCondition['type']) ? $andCondition['type'] : '=';
  4368.                         $cfield = isset($andCondition['field']) ? $andCondition['field'] : '';
  4369.                         $aliasInCondition $table;
  4370.                         if (!(strpos($cfield'.') === false)) {
  4371.                             $fullCfieldArray explode('.'$cfield);
  4372.                             $aliasInCondition $fullCfieldArray[0];
  4373.                             $cfield $fullCfieldArray[1];
  4374.                         }
  4375.                         $cvalue = isset($andCondition['value']) ? $andCondition['value'] : $queryStringIndividual;
  4376.                         if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4377.                             if ($joinAndString != '')
  4378.                                 $joinAndString .= " and ";
  4379.                             if ($ctype == 'like') {
  4380.                                 $joinAndString .= ("`$joinTableAlias`.$cfield like '%" $cvalue "%' ");
  4381.                                 $wordsBySpaces explode(' '$cvalue);
  4382.                                 foreach ($wordsBySpaces as $word) {
  4383.                                     if ($joinAndString != '')
  4384.                                         $joinAndString .= " and ";
  4385.                                     $joinAndString .= ("`$joinTableAlias`.$cfield like '%" $word "%' ");
  4386.                                 }
  4387.                             } else if ($ctype == 'not like') {
  4388.                                 $joinAndString .= ("`$joinTableAlias`.$cfield not like '%" $cvalue "%' ");
  4389.                                 $wordsBySpaces explode(' '$cvalue);
  4390.                                 foreach ($wordsBySpaces as $word) {
  4391.                                     if ($joinAndString != '')
  4392.                                         $joinAndString .= " and ";
  4393.                                     $joinAndString .= ("`$joinTableAlias`.$cfield not like '%" $word "%' ");
  4394.                                 }
  4395.                             } else if ($ctype == 'not_in') {
  4396.                                 $joinAndString .= " ( ";
  4397.                                 if (in_array('null'$cvalue)) {
  4398.                                     $joinAndString .= " `$joinTableAlias`.$cfield is not null";
  4399.                                     $cvalue array_diff($cvalue, ['null']);
  4400.                                     if (!empty($cvalue))
  4401.                                         $joinAndString .= " and ";
  4402.                                 }
  4403.                                 if (in_array(''$cvalue)) {
  4404.                                     $joinAndString .= "`$joinTableAlias`.$cfield != '' ";
  4405.                                     $cvalue array_diff($cvalue, ['']);
  4406.                                     if (!empty($cvalue))
  4407.                                         $joinAndString .= " and ";
  4408.                                 }
  4409.                                 $joinAndString .= "`$joinTableAlias`.$cfield not in (" implode(','$cvalue) . ") ) ";
  4410.                             } else if ($ctype == 'in') {
  4411.                                 if (in_array('null'$cvalue)) {
  4412.                                     $joinAndString .= "`$joinTableAlias`.$cfield is null";
  4413.                                     $cvalue array_diff($cvalue, ['null']);
  4414.                                     if (!empty($cvalue))
  4415.                                         $joinAndString .= " and ";
  4416.                                 }
  4417.                                 if (in_array(''$cvalue)) {
  4418.                                     $joinAndString .= "`$joinTableAlias`.$cfield = '' ";
  4419.                                     $cvalue array_diff($cvalue, ['']);
  4420.                                     if (!empty($cvalue))
  4421.                                         $joinAndString .= " and ";
  4422.                                 }
  4423.                                 $joinAndString .= "`$joinTableAlias`.$cfield in (" implode(','$cvalue) . ") ";
  4424.                             } else if ($ctype == '=') {
  4425. //                        if (!(strpos($cvalue, '.') === false) && !(strpos($cvalue, '_PRIMARY_TABLE_') === false)) {
  4426. //                            $fullCfieldArray = explode('.', $cfield);
  4427. //                            $aliasInCondition = $fullCfieldArray[0];
  4428. //                            $cfield = $fullCfieldArray[1];
  4429. //                        }
  4430.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4431.                                     $joinAndString .= "`$joinTableAlias`.$cfield is null ";
  4432.                                 else
  4433.                                     $joinAndString .= "`$joinTableAlias`.$cfield = $cvalue ";
  4434.                             } else if ($ctype == '!=') {
  4435.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4436.                                     $joinAndString .= "`$joinTableAlias`.$cfield is not null ";
  4437.                                 else
  4438.                                     $joinAndString .= "`$joinTableAlias`.$cfield != $cvalue ";
  4439.                             } else {
  4440.                                 if (is_string($cvalue))
  4441.                                     $joinAndString .= "`$joinTableAlias`.$cfield $ctype '" $cvalue "' ";
  4442.                                 else
  4443.                                     $joinAndString .= "`$joinTableAlias`.$cfield $ctype " $cvalue " ";
  4444.                             }
  4445.                         }
  4446.                     }
  4447. //            if ($joinAndString != '') {
  4448. //                if ($conditionStr != '')
  4449. //                    $conditionStr .= (" and (" . $joinAndString . ") ");
  4450. //                else
  4451. //                    $conditionStr .= ("  (" . $joinAndString . ") ");
  4452. //            }
  4453.                     if ($joinAndString != '') {
  4454.                         if ($joinMustString != '' && $mustBracketDone == 0) {
  4455.                             $joinQry .= ' and (';
  4456.                             $mustBracketDone 1;
  4457.                         }
  4458.                         if ($joinQry != '')
  4459.                             $joinQry .= (" and (" $joinAndString ") ");
  4460.                         else
  4461.                             $joinQry .= ("  (" $joinAndString ") ");
  4462.                     }
  4463.                     $joinAndOrString "";
  4464.                     foreach ($joinAndOrConditions as $andOrCondition) {
  4465. //            $conditionStr.=' 1=1 ';
  4466.                         $ctype = isset($andOrCondition['type']) ? $andOrCondition['type'] : '=';
  4467.                         $cfield = isset($andOrCondition['field']) ? $andOrCondition['field'] : '';
  4468.                         $aliasInCondition $table;
  4469.                         if (!(strpos($cfield'.') === false)) {
  4470.                             $fullCfieldArray explode('.'$cfield);
  4471.                             $aliasInCondition $fullCfieldArray[0];
  4472.                             $cfield $fullCfieldArray[1];
  4473.                         }
  4474.                         $cvalue = isset($andOrCondition['value']) ? $andOrCondition['value'] : $queryStringIndividual;
  4475.                         if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4476.                             if ($joinAndOrString != '')
  4477.                                 $joinAndOrString .= " or ";
  4478.                             if ($ctype == 'like') {
  4479.                                 $joinAndOrString .= ("`$joinTableAlias`.$cfield like '%" $cvalue "%' ");
  4480.                                 $wordsBySpaces explode(' '$cvalue);
  4481.                                 foreach ($wordsBySpaces as $word) {
  4482.                                     if ($joinAndOrString != '')
  4483.                                         $joinAndOrString .= " or ";
  4484.                                     $joinAndOrString .= ("`$joinTableAlias`.$cfield like '%" $word "%' ");
  4485.                                 }
  4486.                             } else if ($ctype == 'not like') {
  4487.                                 $joinAndOrString .= ("`$joinTableAlias`.$cfield not like '%" $cvalue "%' ");
  4488.                                 $wordsBySpaces explode(' '$cvalue);
  4489.                                 foreach ($wordsBySpaces as $word) {
  4490.                                     if ($joinAndOrString != '')
  4491.                                         $joinAndOrString .= " or ";
  4492.                                     $joinAndOrString .= ("`$joinTableAlias`.$cfield not like '%" $word "%' ");
  4493.                                 }
  4494.                             } else if ($ctype == 'not_in') {
  4495.                                 $joinAndOrString .= " ( ";
  4496.                                 if (in_array('null'$cvalue)) {
  4497.                                     $joinAndOrString .= " `$joinTableAlias`.$cfield is not null";
  4498.                                     $cvalue array_diff($cvalue, ['null']);
  4499.                                     if (!empty($cvalue))
  4500.                                         $joinAndOrString .= " or ";
  4501.                                 }
  4502.                                 if (in_array(''$cvalue)) {
  4503.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield != '' ";
  4504.                                     $cvalue array_diff($cvalue, ['']);
  4505.                                     if (!empty($cvalue))
  4506.                                         $joinAndOrString .= " or ";
  4507.                                 }
  4508.                                 $joinAndOrString .= "`$joinTableAlias`.$cfield not in (" implode(','$cvalue) . ") ) ";
  4509.                             } else if ($ctype == 'in') {
  4510.                                 if (in_array('null'$cvalue)) {
  4511.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield is null";
  4512.                                     $cvalue array_diff($cvalue, ['null']);
  4513.                                     if (!empty($cvalue))
  4514.                                         $joinAndOrString .= " or ";
  4515.                                 }
  4516.                                 if (in_array(''$cvalue)) {
  4517.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield = '' ";
  4518.                                     $cvalue array_diff($cvalue, ['']);
  4519.                                     if (!empty($cvalue))
  4520.                                         $joinAndOrString .= " or ";
  4521.                                 }
  4522.                                 $joinAndOrString .= "`$joinTableAlias`.$cfield in (" implode(','$cvalue) . ") ";
  4523.                             } else if ($ctype == '=') {
  4524. //                        if (!(strpos($cvalue, '.') === false) && !(strpos($cvalue, '_PRIMARY_TABLE_') === false)) {
  4525. //                            $fullCfieldArray = explode('.', $cfield);
  4526. //                            $aliasInCondition = $fullCfieldArray[0];
  4527. //                            $cfield = $fullCfieldArray[1];
  4528. //                        }
  4529.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4530.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield is null ";
  4531.                                 else
  4532.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield = $cvalue ";
  4533.                             } else if ($ctype == '!=') {
  4534.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4535.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield is not null ";
  4536.                                 else
  4537.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield != $cvalue ";
  4538.                             } else {
  4539.                                 if (is_string($cvalue))
  4540.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield $ctype '" $cvalue "' ";
  4541.                                 else
  4542.                                     $joinAndOrString .= "`$joinTableAlias`.$cfield $ctype " $cvalue " ";
  4543.                             }
  4544.                         }
  4545.                     }
  4546. //            if ($joinAndOrString != '')
  4547. //                $joinQry .= $joinAndOrString;
  4548.                     if ($joinAndOrString != '') {
  4549.                         if ($joinMustString != '' && $mustBracketDone == 0) {
  4550.                             $joinQry .= ' and (';
  4551.                             $mustBracketDone 1;
  4552.                         }
  4553.                         if ($joinQry != '')
  4554.                             $joinQry .= (" and (" $joinAndOrString ") ");
  4555.                         else
  4556.                             $joinQry .= ("  (" $joinAndOrString ") ");
  4557.                     }
  4558.                     //pika
  4559.                     $joinOrString "";
  4560.                     foreach ($joinOrConditions as $orCondition) {
  4561. //            $conditionStr.=' 1=1 ';
  4562.                         $ctype = isset($orCondition['type']) ? $orCondition['type'] : '=';
  4563.                         $cfield = isset($orCondition['field']) ? $orCondition['field'] : '';
  4564.                         $aliasInCondition $table;
  4565.                         if (!(strpos($cfield'.') === false)) {
  4566.                             $fullCfieldArray explode('.'$cfield);
  4567.                             $aliasInCondition $fullCfieldArray[0];
  4568.                             $cfield $fullCfieldArray[1];
  4569.                         }
  4570.                         $cvalue = isset($orCondition['value']) ? $orCondition['value'] : $queryStringIndividual;
  4571.                         if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4572.                             if ($joinOrString != '' || $joinAndString != '' || $joinMustString != '')
  4573.                                 $joinOrString .= " or ";
  4574.                             if ($ctype == 'like') {
  4575.                                 $joinOrString .= ("`$joinTableAlias`.$cfield like '%" $cvalue "%' ");
  4576.                                 $wordsBySpaces explode(' '$cvalue);
  4577.                                 foreach ($wordsBySpaces as $word) {
  4578.                                     if ($joinOrString != '')
  4579.                                         $joinOrString .= " or ";
  4580.                                     $joinOrString .= ("`$joinTableAlias`.$cfield like '%" $word "%' ");
  4581.                                 }
  4582.                             } else if ($ctype == 'not like') {
  4583.                                 $joinOrString .= ("`$joinTableAlias`.$cfield not like '%" $cvalue "%' ");
  4584.                                 $wordsBySpaces explode(' '$cvalue);
  4585.                                 foreach ($wordsBySpaces as $word) {
  4586.                                     if ($joinOrString != '')
  4587.                                         $joinOrString .= " or ";
  4588.                                     $joinOrString .= ("`$joinTableAlias`.$cfield not like '%" $word "%' ");
  4589.                                 }
  4590.                             } else if ($ctype == 'not_in') {
  4591.                                 $joinOrString .= " ( ";
  4592.                                 if (in_array('null'$cvalue)) {
  4593.                                     $joinOrString .= " `$joinTableAlias`.$cfield is not null";
  4594.                                     $cvalue array_diff($cvalue, ['null']);
  4595.                                     if (!empty($cvalue))
  4596.                                         $joinOrString .= " or ";
  4597.                                 }
  4598.                                 if (in_array(''$cvalue)) {
  4599.                                     $joinOrString .= "`$joinTableAlias`.$cfield != '' ";
  4600.                                     $cvalue array_diff($cvalue, ['']);
  4601.                                     if (!empty($cvalue))
  4602.                                         $joinOrString .= " or ";
  4603.                                 }
  4604.                                 $joinOrString .= "`$joinTableAlias`.$cfield not in (" implode(','$cvalue) . ") ) ";
  4605.                             } else if ($ctype == 'in') {
  4606.                                 if (in_array('null'$cvalue)) {
  4607.                                     $joinOrString .= "`$joinTableAlias`.$cfield is null";
  4608.                                     $cvalue array_diff($cvalue, ['null']);
  4609.                                     if (!empty($cvalue))
  4610.                                         $joinOrString .= " or ";
  4611.                                 }
  4612.                                 if (in_array(''$cvalue)) {
  4613.                                     $joinOrString .= "`$joinTableAlias`.$cfield = '' ";
  4614.                                     $cvalue array_diff($cvalue, ['']);
  4615.                                     if (!empty($cvalue))
  4616.                                         $joinOrString .= " or ";
  4617.                                 }
  4618.                                 $joinOrString .= "`$joinTableAlias`.$cfield in (" implode(','$cvalue) . ") ";
  4619.                             } else if ($ctype == '=') {
  4620. //                        if (!(strpos($cvalue, '.') === false) && !(strpos($cvalue, '_PRIMARY_TABLE_') === false)) {
  4621. //                            $fullCfieldArray = explode('.', $cfield);
  4622. //                            $aliasInCondition = $fullCfieldArray[0];
  4623. //                            $cfield = $fullCfieldArray[1];
  4624. //                        }
  4625.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4626.                                     $joinOrString .= "`$joinTableAlias`.$cfield is null ";
  4627.                                 else
  4628.                                     $joinOrString .= "`$joinTableAlias`.$cfield = $cvalue ";
  4629.                             } else if ($ctype == '!=') {
  4630.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4631.                                     $joinOrString .= "`$joinTableAlias`.$cfield is not null ";
  4632.                                 else
  4633.                                     $joinOrString .= "`$joinTableAlias`.$cfield != $cvalue ";
  4634.                             } else {
  4635.                                 if (is_string($cvalue))
  4636.                                     $joinOrString .= "`$joinTableAlias`.$cfield $ctype '" $cvalue "' ";
  4637.                                 else
  4638.                                     $joinOrString .= "`$joinTableAlias`.$cfield $ctype " $cvalue " ";
  4639.                             }
  4640.                         }
  4641.                     }
  4642. //            if ($joinOrString != '')
  4643. //                $joinQry .= $joinOrString;
  4644.                     if ($joinOrString != '') {
  4645.                         if ($joinMustString != '' && $mustBracketDone == 0) {
  4646.                             $joinQry .= ' and (';
  4647.                             $mustBracketDone 1;
  4648.                         }
  4649.                         if ($joinQry != '')
  4650.                             $joinQry .= (" or (" $joinOrString ") ");
  4651.                         else
  4652.                             $joinQry .= ("  (" $joinOrString ") ");
  4653.                     }
  4654.                     if ($joinMustString != '' && $mustBracketDone == 1) {
  4655.                         $joinQry .= ' ) ';
  4656.                     }
  4657. //
  4658. //                $joinQry .= "  `$joinTableAlias`.`$joinTableOnField` $fieldJoinType `$table`.`$joinTablePrimaryField` ";
  4659.                 }
  4660.                 $filterQryForCriteria .= $selectQry;
  4661.                 $filterQryForCriteria .= $joinQry;
  4662.                 if ($skipDefaultCompanyId == && $companyId != && !isset($dataConfig['entity_group']))
  4663.                     $filterQryForCriteria .= " where `$table`.`company_id`=" $companyId " ";
  4664.                 else
  4665.                     $filterQryForCriteria .= " where 1=1 ";
  4666.                 $conditionStr "";
  4667.                 $aliasInCondition $table;
  4668.                 if ($headMarkers != '' && $table == 'acc_accounts_head') {
  4669.                     $markerList explode(','$headMarkers);
  4670.                     $spMarkerQry "SELECT distinct accounts_head_id FROM acc_accounts_head where 1=1 ";
  4671.                     $markerPassedHeads = [];
  4672.                     foreach ($markerList as $mrkr) {
  4673.                         $spMarkerQry .= " and marker_hash like '%" $mrkr "%'";
  4674.                     }
  4675.                     $spStmt $em->getConnection()->prepare($spMarkerQry);
  4676.                     $spStmt->execute();
  4677.                     $spStmtResults $spStmt->fetchAll();
  4678.                     foreach ($spStmtResults as $ggres) {
  4679.                         $markerPassedHeads[] = $ggres['accounts_head_id'];
  4680.                     }
  4681.                     if (!empty($markerPassedHeads)) {
  4682.                         if ($conditionStr != '')
  4683.                             $conditionStr .= " and (";
  4684.                         else
  4685.                             $conditionStr .= " (";
  4686.                         if ($headMarkersStrictMatch != 1) {
  4687.                             foreach ($markerPassedHeads as $mh) {
  4688.                                 $conditionStr .= " `$aliasInCondition`.`path_tree` like'%/" $mh "/%' or ";
  4689.                             }
  4690.                         }
  4691.                         $conditionStr .= "  `$aliasInCondition`.`accounts_head_id` in (" implode(','$markerPassedHeads) . ") ";
  4692.                         $conditionStr .= " )";
  4693.                     }
  4694.                 }
  4695.                 if (isset($restrictionData[$table])) {
  4696.                     $userRestrictionData Users::getUserApplicationAccessSettings($em$userId)['options'];
  4697.                     if (isset($userRestrictionData[$restrictionData[$table]])) {
  4698.                         $restrictionIdList $userRestrictionData[$restrictionData[$table]];
  4699.                         if ($restrictionIdList == null)
  4700.                             $restrictionIdList = [];
  4701.                     }
  4702.                     if (!empty($restrictionIdList)) {
  4703.                         if ($conditionStr != '')
  4704.                             $conditionStr .= " and ";
  4705.                         $conditionStr .= " `$table`.$valueField in (" implode(','$restrictionIdList) . ") ";
  4706.                     }
  4707.                 }
  4708. //        $aliasInCondition = $table;
  4709.                 if (!empty($setValueArray) || $selectAll == 1) {
  4710.                     if (!empty($setValueArray)) {
  4711.                         if ($conditionStr != '')
  4712.                             $conditionStr .= " and ";
  4713.                         $conditionStr .= " `$aliasInCondition`.$valueField in (" implode(','$setValueArray) . ") ";
  4714.                     }
  4715.                 } else {
  4716.                     $andString '';
  4717.                     foreach ($andConditions as $andCondition) {
  4718. //            $conditionStr.=' 1=1 ';
  4719.                         $ctype = isset($andCondition['type']) ? $andCondition['type'] : '=';
  4720.                         $cfield = isset($andCondition['field']) ? $andCondition['field'] : '';
  4721.                         $aliasInCondition $table;
  4722.                         if (!(strpos($cfield'.') === false)) {
  4723.                             $fullCfieldArray explode('.'$cfield);
  4724.                             $aliasInCondition $fullCfieldArray[0];
  4725.                             $cfield $fullCfieldArray[1];
  4726.                         }
  4727.                         $cvalue = isset($andCondition['value']) ? $andCondition['value'] : $queryStringIndividual;
  4728.                         if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4729.                             if ($andString != '')
  4730.                                 $andString .= " and ";
  4731.                             if ($ctype == 'like') {
  4732.                                 $andString .= ("`$aliasInCondition`.$cfield like '%" $cvalue "%' ");
  4733.                                 $wordsBySpaces explode(' '$cvalue);
  4734.                                 foreach ($wordsBySpaces as $word) {
  4735.                                     if ($andString != '')
  4736.                                         $andString .= " and ";
  4737.                                     $andString .= ("`$aliasInCondition`.$cfield like '%" $word "%' ");
  4738.                                 }
  4739.                             } else if ($ctype == 'not like') {
  4740.                                 $andString .= ("`$aliasInCondition`.$cfield not like '%" $cvalue "%' ");
  4741.                                 $wordsBySpaces explode(' '$cvalue);
  4742.                                 foreach ($wordsBySpaces as $word) {
  4743.                                     if ($andString != '')
  4744.                                         $andString .= " and ";
  4745.                                     $andString .= ("`$aliasInCondition`.$cfield not like '%" $word "%' ");
  4746.                                 }
  4747.                             } else if ($ctype == 'not_in') {
  4748.                                 $andString .= " ( ";
  4749.                                 if (in_array('null'$cvalue)) {
  4750.                                     $andString .= " `$aliasInCondition`.$cfield is not null";
  4751.                                     $cvalue array_diff($cvalue, ['null']);
  4752.                                     if (!empty($cvalue))
  4753.                                         $andString .= " and ";
  4754.                                 }
  4755.                                 if (in_array(''$cvalue)) {
  4756.                                     $andString .= "`$aliasInCondition`.$cfield != '' ";
  4757.                                     $cvalue array_diff($cvalue, ['']);
  4758.                                     if (!empty($cvalue))
  4759.                                         $andString .= " and ";
  4760.                                 }
  4761.                                 $andString .= "`$aliasInCondition`.$cfield not in (" implode(','$cvalue) . ") ) ";
  4762.                             } else if ($ctype == 'in') {
  4763.                                 if (in_array('null'$cvalue)) {
  4764.                                     $andString .= "`$aliasInCondition`.$cfield is null";
  4765.                                     $cvalue array_diff($cvalue, ['null']);
  4766.                                     if (!empty($cvalue))
  4767.                                         $andString .= " and ";
  4768.                                 }
  4769.                                 if (in_array(''$cvalue)) {
  4770.                                     $andString .= "`$aliasInCondition`.$cfield = '' ";
  4771.                                     $cvalue array_diff($cvalue, ['']);
  4772.                                     if (!empty($cvalue))
  4773.                                         $andString .= " and ";
  4774.                                 }
  4775.                                 $andString .= "`$aliasInCondition`.$cfield in (" implode(','$cvalue) . ") ";
  4776.                             } else if ($ctype == '=') {
  4777.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4778.                                     $andString .= "`$aliasInCondition`.$cfield is null ";
  4779.                                 else
  4780.                                     $andString .= "`$aliasInCondition`.$cfield = $cvalue ";
  4781.                             } else if ($ctype == '!=') {
  4782.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4783.                                     $andString .= "`$aliasInCondition`.$cfield is not null ";
  4784.                                 else
  4785.                                     $andString .= "`$aliasInCondition`.$cfield != $cvalue ";
  4786.                             } else {
  4787.                                 if (is_string($cvalue))
  4788.                                     $andString .= "`$aliasInCondition`.$cfield $ctype '" $cvalue "' ";
  4789.                                 else
  4790.                                     $andString .= "`$aliasInCondition`.$cfield $ctype " $cvalue " ";
  4791.                             }
  4792.                         }
  4793.                     }
  4794.                     if ($andString != '') {
  4795.                         if ($conditionStr != '')
  4796.                             $conditionStr .= (" and (" $andString ") ");
  4797.                         else
  4798.                             $conditionStr .= ("  (" $andString ") ");
  4799.                     }
  4800.                     $orString '';
  4801.                     foreach ($orConditions as $orCondition) {
  4802.                         $ctype = isset($orCondition['type']) ? $orCondition['type'] : '=';
  4803.                         $cfield = isset($orCondition['field']) ? $orCondition['field'] : '';
  4804.                         $aliasInCondition $table;
  4805.                         if (!(strpos($cfield'.') === false)) {
  4806.                             $fullCfieldArray explode('.'$cfield);
  4807.                             $aliasInCondition $fullCfieldArray[0];
  4808.                             $cfield $fullCfieldArray[1];
  4809.                         }
  4810.                         $cvalue = isset($orCondition['value']) ? $orCondition['value'] : $queryStringIndividual;
  4811.                         if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4812.                             if ($orString != '')
  4813.                                 $orString .= " or ";
  4814.                             if ($ctype == 'like') {
  4815.                                 $orString .= ("`$aliasInCondition`.$cfield like '%" $cvalue "%' ");
  4816.                                 $wordsBySpaces explode(' '$cvalue);
  4817.                                 foreach ($wordsBySpaces as $word) {
  4818.                                     if ($orString != '')
  4819.                                         $orString .= " or ";
  4820.                                     $orString .= ("`$aliasInCondition`.$cfield like '%" $word "%' ");
  4821.                                 }
  4822.                             } else if ($ctype == 'not like') {
  4823.                                 $orString .= ("`$aliasInCondition`.$cfield not like '%" $cvalue "%' ");
  4824.                                 $wordsBySpaces explode(' '$cvalue);
  4825.                                 foreach ($wordsBySpaces as $word) {
  4826.                                     if ($orString != '')
  4827.                                         $orString .= " or ";
  4828.                                     $orString .= ("`$aliasInCondition`.$cfield not like '%" $word "%' ");
  4829.                                 }
  4830.                             } else if ($ctype == 'not_in') {
  4831.                                 $orString .= " ( ";
  4832.                                 if (in_array('null'$cvalue)) {
  4833.                                     $orString .= " `$aliasInCondition`.$cfield is not null";
  4834.                                     $cvalue array_diff($cvalue, ['null']);
  4835.                                     if (!empty($cvalue))
  4836.                                         $orString .= " or ";
  4837.                                 }
  4838.                                 if (in_array(''$cvalue)) {
  4839.                                     $orString .= "`$aliasInCondition`.$cfield != '' ";
  4840.                                     $cvalue array_diff($cvalue, ['']);
  4841.                                     if (!empty($cvalue))
  4842.                                         $orString .= " or ";
  4843.                                 }
  4844.                                 $orString .= "`$aliasInCondition`.$cfield not in (" implode(','$cvalue) . ") ) ";
  4845.                             } else if ($ctype == 'in') {
  4846.                                 $orString .= " ( ";
  4847.                                 if (in_array('null'$cvalue)) {
  4848.                                     $orString .= " `$aliasInCondition`.$cfield is null";
  4849.                                     $cvalue array_diff($cvalue, ['null']);
  4850.                                     if (!empty($cvalue))
  4851.                                         $orString .= " or ";
  4852.                                 }
  4853.                                 if (in_array(''$cvalue)) {
  4854.                                     $orString .= "`$aliasInCondition`.$cfield = '' ";
  4855.                                     $cvalue array_diff($cvalue, ['']);
  4856.                                     if (!empty($cvalue))
  4857.                                         $orString .= " or ";
  4858.                                 }
  4859.                                 $orString .= "`$aliasInCondition`.$cfield in (" implode(','$cvalue) . ") ) ";
  4860.                             } else if ($ctype == '=') {
  4861.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4862.                                     $orString .= "`$aliasInCondition`.$cfield is null ";
  4863.                                 else
  4864.                                     $orString .= "`$aliasInCondition`.$cfield = $cvalue ";
  4865.                             } else if ($ctype == '!=') {
  4866.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4867.                                     $orString .= "`$aliasInCondition`.$cfield is not null ";
  4868.                                 else
  4869.                                     $orString .= "`$aliasInCondition`.$cfield != $cvalue ";
  4870.                             } else {
  4871.                                 if (is_string($cvalue))
  4872.                                     $orString .= "`$aliasInCondition`.$cfield $ctype '" $cvalue "' ";
  4873.                                 else
  4874.                                     $orString .= "`$aliasInCondition`.$cfield $ctype " $cvalue " ";
  4875.                             }
  4876.                         }
  4877.                     }
  4878.                     if ($orString != '') {
  4879.                         if ($conditionStr != '')
  4880.                             $conditionStr .= (" or (" $orString ") ");
  4881.                         else
  4882.                             $conditionStr .= ("  (" $orString ") ");
  4883.                     }
  4884.                     $andOrString '';
  4885.                     foreach ($andOrConditions as $andOrCondition) {
  4886.                         $ctype = isset($andOrCondition['type']) ? $andOrCondition['type'] : '=';
  4887.                         $cfield = isset($andOrCondition['field']) ? $andOrCondition['field'] : '';
  4888.                         $aliasInCondition $table;
  4889.                         if (!(strpos($cfield'.') === false)) {
  4890.                             $fullCfieldArray explode('.'$cfield);
  4891.                             $aliasInCondition $fullCfieldArray[0];
  4892.                             $cfield $fullCfieldArray[1];
  4893.                         }
  4894.                         $cvalue = isset($andOrCondition['value']) ? $andOrCondition['value'] : $queryStringIndividual;
  4895.                         if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4896.                             if ($andOrString != '')
  4897.                                 $andOrString .= " or ";
  4898.                             if ($ctype == 'like') {
  4899.                                 $andOrString .= (" `$aliasInCondition`.$cfield like '%" $cvalue "%' ");
  4900.                                 $wordsBySpaces explode(' '$cvalue);
  4901.                                 foreach ($wordsBySpaces as $word) {
  4902.                                     if ($andOrString != '')
  4903.                                         $andOrString .= " or ";
  4904.                                     $andOrString .= ("`$aliasInCondition`.$cfield like '%" $word "%' ");
  4905.                                 }
  4906.                             } else if ($ctype == 'not like') {
  4907.                                 $andOrString .= (" `$aliasInCondition`.$cfield not like '%" $cvalue "%' ");
  4908.                                 $wordsBySpaces explode(' '$cvalue);
  4909.                                 foreach ($wordsBySpaces as $word) {
  4910.                                     if ($andOrString != '')
  4911.                                         $andOrString .= " or ";
  4912.                                     $andOrString .= ("`$aliasInCondition`.$cfield not like '%" $word "%' ");
  4913.                                 }
  4914.                             } else if ($ctype == 'in') {
  4915.                                 $andOrString .= " ( ";
  4916.                                 if (in_array('null'$cvalue)) {
  4917.                                     $andOrString .= " `$aliasInCondition`.$cfield is null";
  4918.                                     $cvalue array_diff($cvalue, ['null']);
  4919.                                     if (!empty($cvalue))
  4920.                                         $andOrString .= " or ";
  4921.                                 }
  4922.                                 if (in_array(''$cvalue)) {
  4923.                                     $andOrString .= "`$aliasInCondition`.$cfield = '' ";
  4924.                                     $cvalue array_diff($cvalue, ['']);
  4925.                                     if (!empty($cvalue))
  4926.                                         $andOrString .= " or ";
  4927.                                 }
  4928.                                 if (!empty($cvalue))
  4929.                                     $andOrString .= " `$aliasInCondition`.$cfield in (" implode(','$cvalue) . ") ) ";
  4930.                                 else
  4931.                                     $andOrString .= "  ) ";
  4932.                             } else if ($ctype == 'not_in') {
  4933.                                 $andOrString .= " ( ";
  4934.                                 if (in_array('null'$cvalue)) {
  4935.                                     $andOrString .= " `$aliasInCondition`.$cfield is not null";
  4936.                                     $cvalue array_diff($cvalue, ['null']);
  4937.                                     if (!empty($cvalue))
  4938.                                         $andOrString .= " or ";
  4939.                                 }
  4940.                                 if (in_array(''$cvalue)) {
  4941.                                     $andOrString .= "`$aliasInCondition`.$cfield != '' ";
  4942.                                     $cvalue array_diff($cvalue, ['']);
  4943.                                     if (!empty($cvalue))
  4944.                                         $andOrString .= " or ";
  4945.                                 }
  4946.                                 if (!empty($cvalue))
  4947.                                     $andOrString .= "`$aliasInCondition`.$cfield not in (" implode(','$cvalue) . ") ) ";
  4948.                                 else
  4949.                                     $andOrString .= "  ) ";
  4950.                             } else if ($ctype == '=') {
  4951.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4952.                                     $andOrString .= "`$aliasInCondition`.$cfield is null ";
  4953.                                 else
  4954.                                     $andOrString .= "`$aliasInCondition`.$cfield = $cvalue ";
  4955.                             } else if ($ctype == '!=') {
  4956.                                 if ($cvalue == 'null' || $cvalue == 'Null')
  4957.                                     $andOrString .= "`$aliasInCondition`.$cfield is not null ";
  4958.                                 else
  4959.                                     $andOrString .= "`$aliasInCondition`.$cfield != $cvalue ";
  4960.                             } else {
  4961.                                 if (is_string($cvalue))
  4962.                                     $andOrString .= "`$aliasInCondition`.$cfield $ctype '" $cvalue "' ";
  4963.                                 else
  4964.                                     $andOrString .= "`$aliasInCondition`.$cfield $ctype " $cvalue " ";
  4965.                             }
  4966.                         }
  4967.                     }
  4968.                     if ($andOrString != '') {
  4969.                         if ($conditionStr != '')
  4970.                             $conditionStr .= (" and (" $andOrString ") ");
  4971.                         else
  4972.                             $conditionStr .= ("  (" $andOrString ") ");
  4973.                     }
  4974.                 }
  4975.                 $mustStr '';
  4976. ///now must conditions
  4977.                 foreach ($mustConditions as $mustCondition) {
  4978. //            $conditionStr.=' 1=1 ';
  4979.                     $ctype = isset($mustCondition['type']) ? $mustCondition['type'] : '=';
  4980.                     $cfield = isset($mustCondition['field']) ? $mustCondition['field'] : '';
  4981.                     $aliasInCondition $table;
  4982.                     if (!(strpos($cfield'.') === false)) {
  4983.                         $fullCfieldArray explode('.'$cfield);
  4984.                         $aliasInCondition $fullCfieldArray[0];
  4985.                         $cfield $fullCfieldArray[1];
  4986.                     }
  4987.                     $cvalue = isset($mustCondition['value']) ? $mustCondition['value'] : $queryStringIndividual;
  4988.                     if ($cfield != '' && $cvalue != '_EMPTY_' && $cvalue != '' && $cvalue != '#setValue:') {
  4989.                         if ($mustStr != '')
  4990.                             $mustStr .= " and ";
  4991.                         if ($ctype == 'like') {
  4992.                             $mustStr .= ("(`$aliasInCondition`.$cfield like '%" $cvalue "%' ");
  4993.                             $wordsBySpaces explode(' '$cvalue);
  4994.                             foreach ($wordsBySpaces as $word) {
  4995.                                 if ($mustStr != '')
  4996.                                     $mustStr .= " or ";
  4997.                                 $mustStr .= ("`$aliasInCondition`.$cfield like '%" $word "%' ");
  4998.                             }
  4999.                             $mustStr .= " )";
  5000.                         } else if ($ctype == 'not like') {
  5001.                             $mustStr .= ("`$aliasInCondition`.$cfield not like '%" $cvalue "%' ");
  5002.                             $wordsBySpaces explode(' '$cvalue);
  5003.                             foreach ($wordsBySpaces as $word) {
  5004.                                 if ($mustStr != '')
  5005.                                     $mustStr .= " and ";
  5006.                                 $mustStr .= ("`$aliasInCondition`.$cfield not like '%" $word "%' ");
  5007.                             }
  5008.                         } else if ($ctype == 'in') {
  5009.                             $mustStr .= " ( ";
  5010.                             if (in_array('null'$cvalue)) {
  5011.                                 $mustStr .= " `$aliasInCondition`.$cfield is null";
  5012.                                 $cvalue array_diff($cvalue, ['null']);
  5013.                                 if (!empty($cvalue))
  5014.                                     $mustStr .= " or ";
  5015.                             }
  5016.                             if (in_array(''$cvalue)) {
  5017.                                 $mustStr .= "`$aliasInCondition`.$cfield = '' ";
  5018.                                 $cvalue array_diff($cvalue, ['']);
  5019.                                 if (!empty($cvalue))
  5020.                                     $mustStr .= " or ";
  5021.                             }
  5022.                             $mustStr .= "`$aliasInCondition`.$cfield in (" implode(','$cvalue) . ") ) ";
  5023.                         } else if ($ctype == 'not_in') {
  5024.                             $mustStr .= " ( ";
  5025.                             if (in_array('null'$cvalue)) {
  5026.                                 $mustStr .= " `$aliasInCondition`.$cfield is not null";
  5027.                                 $cvalue array_diff($cvalue, ['null']);
  5028.                                 if (!empty($cvalue))
  5029.                                     $mustStr .= " and ";
  5030.                             }
  5031.                             if (in_array(''$cvalue)) {
  5032.                                 $mustStr .= "`$aliasInCondition`.$cfield != '' ";
  5033.                                 $cvalue array_diff($cvalue, ['']);
  5034.                                 if (!empty($cvalue))
  5035.                                     $mustStr .= " and ";
  5036.                             }
  5037.                             $mustStr .= "`$aliasInCondition`.$cfield not in (" implode(','$cvalue) . ") ) ";
  5038.                         } else if ($ctype == '=') {
  5039.                             if ($cvalue == 'null' || $cvalue == 'Null')
  5040.                                 $mustStr .= "`$aliasInCondition`.$cfield is null ";
  5041.                             else
  5042.                                 $mustStr .= "`$aliasInCondition`.$cfield = $cvalue ";
  5043.                         } else if ($ctype == '!=') {
  5044.                             if ($cvalue == 'null' || $cvalue == 'Null')
  5045.                                 $mustStr .= "`$aliasInCondition`.$cfield is not null ";
  5046.                             else
  5047.                                 $mustStr .= "`$aliasInCondition`.$cfield != $cvalue ";
  5048.                         } else {
  5049.                             if (is_string($cvalue))
  5050.                                 $mustStr .= "`$aliasInCondition`.$cfield $ctype '" $cvalue "' ";
  5051.                             else
  5052.                                 $mustStr .= "`$aliasInCondition`.$cfield $ctype " $cvalue " ";
  5053.                         }
  5054.                     }
  5055.                 }
  5056.                 if ($mustStr != '') {
  5057.                     if ($conditionStr != '')
  5058.                         $conditionStr .= (" and (" $mustStr ") ");
  5059.                     else
  5060.                         $conditionStr .= ("  (" $mustStr ") ");
  5061.                 }
  5062.                 if ($conditionStr != '')
  5063.                     $filterQryForCriteria .= (" and (" $conditionStr ") ");
  5064.                 if ($lastChildrenOnly == 1) {
  5065.                     if ($filterQryForCriteria != '')
  5066.                         $filterQryForCriteria .= ' and';
  5067.                     $filterQryForCriteria .= "`$table`.`$valueField` not in ( select distinct $parentIdField from  $table)";
  5068.                 } else if ($parentOnly == 1) {
  5069.                     if ($filterQryForCriteria != '')
  5070.                         $filterQryForCriteria .= ' and';
  5071.                     $filterQryForCriteria .= "`$table`.`$valueField`  in ( select distinct $parentIdField from  $table)";
  5072.                 }
  5073.                 if (!empty($orderByConditions)) {
  5074.                     $filterQryForCriteria .= "  order by ";
  5075.                     $fone 1;
  5076.                     foreach ($orderByConditions as $orderByCondition) {
  5077.                         if ($fone != 1) {
  5078.                             $filterQryForCriteria .= " , ";
  5079.                         }
  5080.                         if (isset($orderByCondition['valueList'])) {
  5081.                             if (is_string($orderByCondition['valueList'])) $orderByCondition['valueList'] = json_decode($orderByCondition['valueList'], true);
  5082.                             if ($orderByCondition['valueList'] == null)
  5083.                                 $orderByCondition['valueList'] = [];
  5084.                             $filterQryForCriteria .= "   field(" $orderByCondition['field'] . "," implode(','$orderByCondition['valueList']) . "," $orderByCondition['field'] . ") " $orderByCondition['sortType'] . " ";
  5085.                         } else
  5086.                             $filterQryForCriteria .= " " $orderByCondition['field'] . " " $orderByCondition['sortType'] . " ";
  5087.                         $fone 0;
  5088.                     }
  5089.                 }
  5090.                 if ($returnTotalMatchedEntriesFlag == 1) {
  5091. //            $stmt = $em->getConnection()->prepare($get_kids_sql);
  5092. //            $stmt->execute();
  5093. //            $get_kids = $stmt->fetchAll();
  5094.                 }
  5095.                 if ($filterQryForCriteria != '')
  5096.                     if (!empty($setValueArray) || $selectAll == 1) {
  5097.                     } else {
  5098.                         if ($itemLimit != '_ALL_')
  5099.                             $filterQryForCriteria .= "  limit $offset$itemLimit ";
  5100.                         else
  5101.                             $filterQryForCriteria .= "  limit $offset, 18446744073709551615 ";
  5102.                     }
  5103.                 $get_kids_sql $filterQryForCriteria;
  5104.                 $stmt $em->getConnection()->prepare($get_kids_sql);
  5105.                 $stmt->execute();
  5106.                 $get_kids $stmt->fetchAll();
  5107.                 $selectedId 0;
  5108.                 if ($table == 'warehouse_action') {
  5109.                     if (empty($get_kids)) {
  5110.                         $get_kids_sql_2 "select * from warehouse_action";
  5111.                         $stmt $em->getConnection()->prepare($get_kids_sql_2);
  5112.                         $stmt->execute();
  5113.                         $get_kids2 $stmt->fetchAll();
  5114.                         if (empty($get_kids2))
  5115.                             $get_kids GeneralConstant::$warehouse_action_list;
  5116.                     }
  5117.                 }
  5118.                 if (!empty($get_kids)) {
  5119.                     $nextOffset $offset count($get_kids);
  5120.                     $nextOffset++;
  5121.                     foreach ($get_kids as $pa) {
  5122.                         if (!empty($setValueArray) && $selectAll == 0) {
  5123.                             if (!in_array($pa[$valueField], $setValueArray))
  5124.                                 continue;
  5125.                         }
  5126.                         if (!empty($restrictionIdList)) {
  5127.                             if (!in_array($pa[$valueField], $restrictionIdList))
  5128.                                 continue;
  5129.                         }
  5130.                         if ($selectAll == 1) {
  5131.                             $setValueArray[] = $pa[$valueField];
  5132.                             $setValue $pa[$valueField];
  5133.                         } else if (count($get_kids) == && $setDataForSingle == 1) {
  5134.                             $setValueArray[] = $pa[$valueField];
  5135.                             $setValue $pa[$valueField];
  5136.                         }
  5137.                         if ($valueField != '')
  5138.                             $pa['value'] = $pa[$valueField];
  5139.                         $renderedText $renderTextFormat;
  5140.                         $compare_array = [];
  5141.                         if ($renderTextFormat != '') {
  5142.                             $renderedText $renderTextFormat;
  5143.                             $compare_arrayFull = [];
  5144.                             $compare_array = [];
  5145.                             $toBeReplacedData = array(//                        'curr'=>'tobereplaced'
  5146.                             );
  5147.                             preg_match_all("/__\w+__/"$renderedText$compare_arrayFull);
  5148.                             if (isset($compare_arrayFull[0]))
  5149.                                 $compare_array $compare_arrayFull[0];
  5150. //                   $compare_array= preg_split("/__\w+__/",$renderedText);
  5151.                             foreach ($compare_array as $cmpdt) {
  5152.                                 $tbr str_replace("__"""$cmpdt);
  5153.                                 if ($tbr != '') {
  5154.                                     if (isset($pa[$tbr])) {
  5155.                                         if ($pa[$tbr] == null)
  5156.                                             $renderedText str_replace($cmpdt''$renderedText);
  5157.                                         else
  5158.                                             $renderedText str_replace($cmpdt$pa[$tbr], $renderedText);
  5159.                                     } else {
  5160.                                         $renderedText str_replace($cmpdt''$renderedText);
  5161.                                     }
  5162.                                 }
  5163.                             }
  5164.                         }
  5165.                         $pa['rendered_text'] = $renderedText;
  5166.                         $pa['text'] = ($textField != '' $pa[$textField] : '');
  5167. //                $pa['compare_array'] = $compare_array;
  5168.                         foreach ($convertToObjectFieldList as $convField) {
  5169.                             if (isset($pa[$convField])) {
  5170.                                 $taA json_decode($pa[$convField], true);
  5171.                                 if ($taA == null$taA = [];
  5172.                                 $pa[$convField] = $taA;
  5173.                             } else {
  5174.                                 $pa[$convField] = [];
  5175.                             }
  5176.                         }
  5177.                         foreach ($convertDateToStringFieldList as $convField) {
  5178.                             if (is_array($convField)) {
  5179.                                 $fld $convField['field'];
  5180.                                 $frmt = isset($convField['format']) ? $convField['format'] : 'Y-m-d H:i:s';
  5181.                             } else {
  5182.                                 $fld $convField;
  5183.                                 $frmt 'Y-m-d H:i:s';
  5184.                             }
  5185.                             if (isset($pa[$fld])) {
  5186.                                 $taA = new \DateTime($pa[$fld]);
  5187.                                 $pa[$fld] = $taA->format($frmt);
  5188.                             }
  5189.                         }
  5190.                         foreach ($convertToUrl as $convField) {
  5191. //
  5192. //                            $fld = $convField;
  5193. //
  5194. //
  5195. //                            if (isset($pa[$fld])) {
  5196. //
  5197. //
  5198. //                                $pa[$fld] =
  5199. //                                    $this->generateUrl(
  5200. //                                        'dashboard', [
  5201. //
  5202. //                                    ], UrlGenerator::ABSOLUTE_URL
  5203. //                                    ).'/'.$pa[$fld];
  5204. //
  5205. //                            }
  5206.                         }
  5207.                         foreach ($fullPathList as $pathField) {
  5208.                             $fld $pathField;
  5209.                             if (isset($pa[$fld])) {
  5210.                                 if ($pa[$fld] != '' && $pa[$fld] != null) {
  5211.                                     $pa[$fld] = ($this->generateUrl(
  5212.                                             'dashboard', [
  5213.                                         ], UrlGenerator::ABSOLUTE_URL
  5214.                                         ) . $pa[$fld]);
  5215.                                 }
  5216.                             }
  5217.                         }
  5218.                         $pa['currentTs'] = (new \Datetime())->format('U');
  5219.                         $data[] = $pa;
  5220.                         if ($valueField != '') {
  5221.                             $data_by_id[$pa[$valueField]] = $pa;
  5222.                             $selectedId $pa[$valueField];
  5223.                         }
  5224.                     }
  5225.                 }
  5226.                 $lastResult = array(
  5227.                     'success' => true,
  5228.                     'data' => $data,
  5229.                     'tableName' => $table,
  5230.                     'setValue' => $setValue,
  5231.                     'currentTs' => (new \Datetime())->format('U'),
  5232.                     'restrictionIdList' => $restrictionIdList,
  5233.                     'andConditions' => $andConditions,
  5234.                     'queryStr' => $queryStringIndividual,
  5235.                     'isMultiple' => $isMultiple,
  5236.                     'nextOffset' => $nextOffset,
  5237.                     'totalMatchedEntries' => $totalMatchedEntries,
  5238.                     'selectorId' => $selectorId,
  5239.                     'setValueArray' => $setValueArray,
  5240.                     'silentChangeSelectize' => $silentChangeSelectize,
  5241.                     'convertToObjectFieldList' => $convertToObjectFieldList,
  5242.                     'conditionStr' => $conditionStr,
  5243. //                    'andStr' => $andString,
  5244. //                    'andOrStr' => $andOrString,
  5245.                     'dataById' => $data_by_id,
  5246.                     'selectedId' => $selectedId,
  5247.                     'dataId' => $dataId,
  5248.                     'ret_data' => isset($dataConfig['ret_data']) ? $dataConfig['ret_data'] : [],
  5249.                 );
  5250.             }
  5251.             $allResult[] = $lastResult;
  5252.         }
  5253.         if ($isSingleDataset == 1)
  5254.             return new JsonResponse($lastResult);
  5255.         else
  5256.             return new JsonResponse($allResult);
  5257.     }
  5258.     public function DecodeEncDataAction(Request $request$apiCode 0$encData '')
  5259.     {
  5260. //        $userCategory=$request->request->has('userCategory');
  5261.         $encryptedData = [];
  5262.         $retData = array(
  5263.             'success' => false,
  5264.             'message' => 'Invalid API',
  5265.             'data' => [],
  5266.             'decryptedStr' => '',
  5267.         );
  5268.         $allowedApiCodes = [
  5269.             998,
  5270.             889
  5271.         ];
  5272.         if (in_array($apiCode$allowedApiCodes)) {
  5273.             if ($encData != '') {
  5274.                 $decryptedStr $this->get('url_encryptor')->decrypt($encData);
  5275.                 $encryptedData json_decode($decryptedStrtrue);
  5276.                 if ($encryptedData == null$encryptedData = [];
  5277.                 $retData['success'] = true;
  5278.                 $retData['message'] = '';
  5279.                 $retData['decryptedStr'] = $decryptedStr;
  5280.                 $retData['data'] = $encryptedData;
  5281.             } else {
  5282.                 $retData['success'] = false;
  5283.                 $retData['message'] = 'No Data';
  5284.             }
  5285.         }
  5286.         $response = new JsonResponse($retData);
  5287.         $response->headers->set('Access-Control-Allow-Origin''*');
  5288.         return $response;
  5289.     }
  5290.     public function SendOtpAjaxAction(Request $request$startFrom 0)
  5291.     {
  5292.         $em $this->getDoctrine()->getManager();
  5293.         $em_goc $this->getDoctrine()->getManager('company_group');
  5294.         $session $request->getSession();
  5295.         $message "";
  5296.         $retData = array();
  5297.         $email_twig_data = array('success' => false);
  5298.         $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  5299.         $userCategory $request->request->get('userCategory'$request->query->get('userCategory''_BUDDYBEE_USER_'));
  5300.         $email_address $request->request->get('email'$request->query->get('email'''));
  5301.         $otpExpireSecond $request->request->get('otpExpireSecond'$request->query->get('otpExpireSecond'180));
  5302.         $otpActionId $request->request->get('otpActionId'$request->query->get('otpActionId'UserConstants::OTP_ACTION_FORGOT_PASSWORD));
  5303.         $appendCode $request->request->get('appendCode'$request->query->get('appendCode'''));
  5304.         $otp $request->request->get('otp'$request->query->get('otp'''));
  5305.         $otpExpireTs 0;
  5306.         $userId $request->request->get('userId'$request->query->get('userId'$session->get(UserConstants::USER_ID0)));
  5307.         $userType UserConstants::USER_TYPE_APPLICANT;
  5308.         $email_twig_file 'ApplicationBundle:pages/email:find_account_buddybee.html.twig';
  5309.         if ($request->isMethod('POST')) {
  5310.             //set an otp and its expire and send mail
  5311.             $userObj null;
  5312.             $userData = [];
  5313.             if ($systemType == '_ERP_') {
  5314.                 if ($userCategory == '_APPLICANT_') {
  5315.                     $userType UserConstants::USER_TYPE_APPLICANT;
  5316.                     $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5317.                         array(
  5318.                             'applicantId' => $userId
  5319.                         )
  5320.                     );
  5321.                     if ($userObj) {
  5322.                     } else {
  5323.                         $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5324.                             array(
  5325.                                 'email' => $email_address
  5326.                             )
  5327.                         );
  5328.                         if ($userObj) {
  5329.                         } else {
  5330.                             $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5331.                                 array(
  5332.                                     'oAuthEmail' => $email_address
  5333.                                 )
  5334.                             );
  5335.                             if ($userObj) {
  5336.                             } else {
  5337.                                 $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5338.                                     array(
  5339.                                         'username' => $email_address
  5340.                                     )
  5341.                                 );
  5342.                             }
  5343.                         }
  5344.                     }
  5345.                     if ($userObj) {
  5346.                         $email_address $userObj->getEmail();
  5347.                         if ($email_address == null || $email_address == '')
  5348.                             $email_address $userObj->getOAuthEmail();
  5349.                     }
  5350.                     $otpData MiscActions::GenerateOtp($otpExpireSecond);
  5351.                     $otp $otpData['otp'];
  5352.                     $otpExpireTs $otpData['expireTs'];
  5353.                     $userObj->setOtp($otpData['otp']);
  5354.                     $userObj->setOtpActionId($otpActionId);
  5355.                     $userObj->setOtpExpireTs($otpData['expireTs']);
  5356.                     $em_goc->flush();
  5357.                     $userData = array(
  5358.                         'id' => $userObj->getApplicantId(),
  5359.                         'email' => $email_address,
  5360.                         'appId' => 0,
  5361.                         //                        'appId'=>$userObj->getUserAppId(),
  5362.                     );
  5363.                     $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5364.                     $email_twig_data = [
  5365.                         'page_title' => 'Find Account',
  5366.                         'message' => $message,
  5367.                         'userType' => $userType,
  5368.                         'otp' => $otpData['otp'],
  5369.                         'otpExpireSecond' => $otpExpireSecond,
  5370.                         'otpActionId' => $otpActionId,
  5371.                         'otpExpireTs' => $otpData['expireTs'],
  5372.                         'systemType' => $systemType,
  5373.                         'userData' => $userData
  5374.                     ];
  5375.                     if ($userObj)
  5376.                         $email_twig_data['success'] = true;
  5377.                 } else {
  5378.                     $userType UserConstants::USER_TYPE_GENERAL;
  5379.                     $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5380.                     $email_twig_data = [
  5381.                         'page_title' => 'Find Account',
  5382.                         //                        'encryptedData' => $encryptedData,
  5383.                         'message' => $message,
  5384.                         'userType' => $userType,
  5385.                         //                        'errorField' => $errorField,
  5386.                     ];
  5387.                 }
  5388.             } else if ($systemType == '_BUDDYBEE_') {
  5389.                 $userType UserConstants::USER_TYPE_APPLICANT;
  5390.                 $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5391.                     array(
  5392.                         'applicantId' => $userId
  5393.                     )
  5394.                 );
  5395.                 if ($userObj) {
  5396.                 } else {
  5397.                     $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5398.                         array(
  5399.                             'email' => $email_address
  5400.                         )
  5401.                     );
  5402.                     if ($userObj) {
  5403.                     } else {
  5404.                         $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5405.                             array(
  5406.                                 'oAuthEmail' => $email_address
  5407.                             )
  5408.                         );
  5409.                         if ($userObj) {
  5410.                         } else {
  5411.                             $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5412.                                 array(
  5413.                                     'username' => $email_address
  5414.                                 )
  5415.                             );
  5416.                         }
  5417.                     }
  5418.                 }
  5419.                 if ($userObj) {
  5420.                     $email_address $userObj->getEmail();
  5421.                     if ($email_address == null || $email_address == '')
  5422.                         $email_address $userObj->getOAuthEmail();
  5423.                     //                    triggerResetPassword:
  5424.                     //                    type: integer
  5425.                     //                          nullable: true
  5426.                     $otpData MiscActions::GenerateOtp($otpExpireSecond);
  5427.                     $otp $otpData['otp'];
  5428.                     $otpExpireTs $otpData['expireTs'];
  5429.                     $userObj->setOtp($otpData['otp']);
  5430.                     $userObj->setOtpActionId($otpActionId);
  5431.                     $userObj->setOtpExpireTs($otpData['expireTs']);
  5432.                     $em_goc->flush();
  5433.                     $userData = array(
  5434.                         'id' => $userObj->getApplicantId(),
  5435.                         'email' => $email_address,
  5436.                         'appId' => 0,
  5437.                         'image' => $userObj->getImage(),
  5438.                         'phone' => $userObj->getPhone(),
  5439.                         'firstName' => $userObj->getFirstname(),
  5440.                         'lastName' => $userObj->getLastname(),
  5441.                         //                        'appId'=>$userObj->getUserAppId(),
  5442.                     );
  5443.                     $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5444.                     $email_twig_data = [
  5445.                         'page_title' => 'Find Account',
  5446.                         //                        'encryptedData' => $encryptedData,
  5447.                         'message' => $message,
  5448.                         'userType' => $userType,
  5449.                         //                        'errorField' => $errorField,
  5450.                         'otp' => $otpData['otp'],
  5451.                         'otpExpireSecond' => $otpExpireSecond,
  5452.                         'otpActionId' => $otpActionId,
  5453.                         'otpActionTitle' => UserConstants::$OTP_ACTION_DATA[$otpActionId]['actionTitle'],
  5454.                         'otpActionDescForMail' => UserConstants::$OTP_ACTION_DATA[$otpActionId]['actionDescForMail'],
  5455.                         'otpExpireTs' => $otpData['expireTs'],
  5456.                         'systemType' => $systemType,
  5457.                         'userCategory' => $userCategory,
  5458.                         'userData' => $userData
  5459.                     ];
  5460.                     $email_twig_data['success'] = true;
  5461.                 } else {
  5462.                     $message "Account not found!";
  5463.                     $email_twig_data['success'] = false;
  5464.                 }
  5465.             }
  5466.             if ($email_twig_data['success'] == true && GeneralConstant::EMAIL_ENABLED == 1) {
  5467.                 if ($systemType == '_BUDDYBEE_') {
  5468.                     $bodyHtml '';
  5469.                     $bodyTemplate $email_twig_file;
  5470.                     $bodyData $email_twig_data;
  5471.                     $attachments = [];
  5472.                     $forwardToMailAddress $email_address;
  5473.                     //                    $upl_dir = $this->container->getParameter('kernel.root_dir') . '/../web/uploads/temp/' . 'ledger' . '.pdf'
  5474.                     $new_mail $this->get('mail_module');
  5475.                     $new_mail->sendMyMail(array(
  5476.                         'senderHash' => '_CUSTOM_',
  5477.                         //                        'senderHash'=>'_CUSTOM_',
  5478.                         'forwardToMailAddress' => $forwardToMailAddress,
  5479.                         'subject' => 'Account Verification',
  5480.                         //                        'fileName' => 'Order#' . str_pad($id, 8, '0', STR_PAD_LEFT) . '.pdf',
  5481.                         'attachments' => $attachments,
  5482.                         'toAddress' => $forwardToMailAddress,
  5483.                         'fromAddress' => 'no-reply@buddybee.eu',
  5484.                         'userName' => 'no-reply@buddybee.eu',
  5485.                         'password' => 'Honeybee@0112',
  5486.                         'smtpServer' => 'smtp.hostinger.com',
  5487.                         'smtpPort' => 465,
  5488.                         //                            'emailBody' => $bodyHtml,
  5489.                         'mailTemplate' => $bodyTemplate,
  5490.                         'templateData' => $bodyData,
  5491.                         //                        'embedCompanyImage' => 1,
  5492.                         //                        'companyId' => $companyId,
  5493.                         //                        'companyImagePath' => $company_data->getImage()
  5494.                     ));
  5495.                 } else {
  5496.                     $bodyHtml '';
  5497.                     $bodyTemplate $email_twig_file;
  5498.                     $bodyData $email_twig_data;
  5499.                     $attachments = [];
  5500.                     $forwardToMailAddress $email_address;
  5501.                     //                    $upl_dir = $this->container->getParameter('kernel.root_dir') . '/../web/uploads/temp/' . 'ledger' . '.pdf'
  5502.                     $new_mail $this->get('mail_module');
  5503.                     $new_mail->sendMyMail(array(
  5504.                         'senderHash' => '_CUSTOM_',
  5505.                         //                        'senderHash'=>'_CUSTOM_',
  5506.                         'forwardToMailAddress' => $forwardToMailAddress,
  5507.                         'subject' => 'Applicant Registration on Honeybee',
  5508.                         //                        'fileName' => 'Order#' . str_pad($id, 8, '0', STR_PAD_LEFT) . '.pdf',
  5509.                         'attachments' => $attachments,
  5510.                         'toAddress' => $forwardToMailAddress,
  5511.                         'fromAddress' => 'support@ourhoneybee.eu',
  5512.                         'userName' => 'support@ourhoneybee.eu',
  5513.                         'password' => 'Y41dh8g0112',
  5514.                         'smtpServer' => 'smtp.hostinger.com',
  5515.                         'smtpPort' => 465,
  5516.                         'emailBody' => $bodyHtml,
  5517.                         'mailTemplate' => $bodyTemplate,
  5518.                         'templateData' => $bodyData,
  5519.                         //                        'embedCompanyImage' => 1,
  5520.                         //                        'companyId' => $companyId,
  5521.                         //                        'companyImagePath' => $company_data->getImage()
  5522.                     ));
  5523.                 }
  5524.             }
  5525.             if ($email_twig_data['success'] == true && GeneralConstant::NOTIFICATION_ENABLED == && $userData['phone'] != '' && $userData['phone'] != null) {
  5526.                 if ($systemType == '_BUDDYBEE_') {
  5527.                     $searchVal = ['_OTP_''_EXPIRE_MINUTES_''_APPEND_CODE_'];
  5528.                     $replaceVal = [$otpfloor($otpExpireSecond 60), $appendCode];
  5529.                     $msg 'Use OTP _OTP_ for BuddyBee. Your OTP will expire in _EXPIRE_MINUTES_ minutes
  5530.                      _APPEND_CODE_';
  5531.                     $msg str_replace($searchVal$replaceVal$msg);
  5532.                     $emitMarker '_SEND_TEXT_TO_MOBILE_';
  5533.                     $sendType 'all';
  5534.                     $socketUserIds = [];
  5535.                     System::SendSmsBySocket($this->container->getParameter('notification_enabled'), $msg$userData['phone'], $emitMarker$sendType$socketUserIds);
  5536.                 } else {
  5537.                 }
  5538.             }
  5539.         }
  5540.         $response = new JsonResponse(array(
  5541.                 'message' => $message,
  5542.                 "userType" => $userType,
  5543.                 "otp" => '',
  5544.                 //                "otp"=>$otp,
  5545.                 "otpExpireTs" => $otpExpireTs,
  5546.                 "otpActionId" => $otpActionId,
  5547.                 "userCategory" => $userCategory,
  5548.                 "userId" => isset($userData['id']) ? $userData['id'] : 0,
  5549.                 "systemType" => $systemType,
  5550.                 'actionData' => $email_twig_data,
  5551.                 'success' => isset($email_twig_data['success']) ? $email_twig_data['success'] : false,
  5552.             )
  5553.         );
  5554.         $response->headers->set('Access-Control-Allow-Origin''*');
  5555.         return $response;
  5556.     }
  5557.     public function VerifyOtpAction(Request $request$encData '')
  5558.     {
  5559.         $em $this->getDoctrine()->getManager();
  5560.         $em_goc $this->getDoctrine()->getManager('company_group');
  5561.         $session $request->getSession();
  5562.         $message "";
  5563.         $retData = array();
  5564.         $encData $request->query->get('encData'$encData);
  5565.         $encryptedData = [];
  5566.         if ($encData != '')
  5567.             $encryptedData json_decode($this->get('url_encryptor')->decrypt($encData), true);
  5568.         if ($encryptedData == null$encryptedData = [];
  5569.         $systemType $this->container->hasParameter('system_type') ? $this->container->getParameter('system_type') : '_ERP_';
  5570.         $userCategory $request->request->get('userCategory'$request->query->get('userCategory', (isset($encryptedData['otp']) ? $encryptedData['userCategory'] : '_BUDDYBEE_USER_')));
  5571.         $email_address $request->request->get('email'$request->query->get('email', (isset($encryptedData['email']) ? $encryptedData['email'] : '')));
  5572.         $otpExpireSecond $request->request->get('otpExpireSecond'$request->query->get('otpExpireSecond'180));
  5573.         $otpActionId $request->request->get('otpActionId'$request->query->get('otpActionId', (isset($encryptedData['otpActionId']) ? $encryptedData['otpActionId'] : UserConstants::OTP_ACTION_FORGOT_PASSWORD)));
  5574.         $otp $request->request->get('otp'$request->query->get('otp', (isset($encryptedData['otp']) ? $encryptedData['otp'] : '')));
  5575.         $otpExpireTs = isset($encryptedData['otpExpireTs']) ? $encryptedData['otpExpireTs'] : 0;
  5576.         $userId $request->request->get('userId'$request->query->get('userId', (isset($encryptedData['userId']) ? $encryptedData['userId'] : $session->get(UserConstants::USER_ID0))));
  5577.         $userType UserConstants::USER_TYPE_APPLICANT;
  5578.         $userEntity 'CompanyGroupBundle:EntityApplicantDetails';
  5579.         $userEntityManager $em_goc;
  5580.         $userEntityIdField 'applicantId';
  5581.         $userEntityUserNameField 'username';
  5582.         $userEntityEmailField1 'email';
  5583.         $userEntityEmailField1Getter 'getEmail';
  5584.         $userEntityEmailField1Setter 'setEmail';
  5585.         $userEntityEmailField2 'oAuthEmail';
  5586.         $userEntityEmailField2Getter 'geOAuthEmail';
  5587.         $userEntityEmailField2Setter 'seOAuthEmail';
  5588.         $twig_file '@Authentication/pages/views/verify_otp_buddybee.html.twig';
  5589.         $twigData = [];
  5590.         $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5591.         $email_twig_data = array('success' => false);
  5592.         $redirectUrl '';
  5593.         $userObj null;
  5594.         $userData = [];
  5595.         if ($systemType == '_ERP_') {
  5596.             if ($userCategory == '_APPLICANT_') {
  5597.                 $userType UserConstants::USER_TYPE_APPLICANT;
  5598.                 $twig_file '@Authentication/pages/views/verify_otp_buddybee.html.twig';
  5599.                 $twigData = [];
  5600.                 $userEntity 'CompanyGroupBundle:EntityApplicantDetails';
  5601.                 $userEntityManager $em_goc;
  5602.                 $userEntityIdField 'applicantId';
  5603.                 $userEntityUserNameField 'username';
  5604.                 $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5605.                 //                $email_twig_file = 'ApplicationBundle:pages/email:find_account_buddybee.html.twig';
  5606.             } else {
  5607.                 $userType UserConstants::USER_TYPE_GENERAL;
  5608.                 $twig_file '@Authentication/pages/views/verify_otp_buddybee.html.twig';
  5609.                 $twigData = [];
  5610.                 $userEntity 'ApplicationBundle:SysUser';
  5611.                 $userEntityManager $em;
  5612.                 $userEntityIdField 'userId';
  5613.                 $userEntityUserNameField 'userName';
  5614.                 $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5615.                 //                $email_twig_file = 'ApplicationBundle:pages/email:find_account_buddybee.html.twig';
  5616.             }
  5617.         } else if ($systemType == '_BUDDYBEE_') {
  5618.             $userType UserConstants::USER_TYPE_APPLICANT;
  5619.             $twig_file '@Authentication/pages/views/verify_otp_buddybee.html.twig';
  5620.             $twigData = [];
  5621.             $userEntity 'CompanyGroupBundle:EntityApplicantDetails';
  5622.             $userEntityManager $em_goc;
  5623.             $userEntityIdField 'applicantId';
  5624.             $userEntityUserNameField 'username';
  5625.             $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5626.             //            $email_twig_file = 'ApplicationBundle:pages/email:find_account_buddybee.html.twig';
  5627.         } else if ($systemType == '_CENTRAL_') {
  5628.             $userType UserConstants::USER_TYPE_APPLICANT;
  5629.             $twig_file '@Authentication/pages/views/verify_otp_central.html.twig';
  5630.             $twigData = [];
  5631.             $userEntity 'CompanyGroupBundle:EntityApplicantDetails';
  5632.             $userEntityManager $em_goc;
  5633.             $userEntityIdField 'applicantId';
  5634.             $userEntityUserNameField 'username';
  5635.             $email_twig_file 'ApplicationBundle:email/templates:forgotPasswordOtp.html.twig';
  5636.             //  $email_twig_file = 'ApplicationBundle:pages/email:find_account_buddybee.html.twig';
  5637.         }
  5638.         if ($request->isMethod('POST') || $otp != '') {
  5639.             $userObj $userEntityManager->getRepository($userEntity)->findOneBy(
  5640.                 array(
  5641.                     $userEntityIdField => $userId
  5642.                 )
  5643.             );
  5644.             if ($userObj) {
  5645.             } else {
  5646.                 $userObj $userEntityManager->getRepository($userEntity)->findOneBy(
  5647.                     array(
  5648.                         $userEntityEmailField1 => $email_address
  5649.                     )
  5650.                 );
  5651.                 if ($userObj) {
  5652.                 } else {
  5653.                     $userObj $userEntityManager->getRepository($userEntity)->findOneBy(
  5654.                         array(
  5655.                             $userEntityEmailField2 => $email_address
  5656.                         )
  5657.                     );
  5658.                     if ($userObj) {
  5659.                     } else {
  5660.                         $userObj $em_goc->getRepository('CompanyGroupBundle:EntityApplicantDetails')->findOneBy(
  5661.                             array(
  5662.                                 $userEntityUserNameField => $email_address
  5663.                             )
  5664.                         );
  5665.                     }
  5666.                 }
  5667.             }
  5668.             if ($userObj) {
  5669.                 $userOtp $userObj->getOtp();
  5670.                 $userOtpActionId $userObj->getOtpActionId();
  5671.                 $userOtpExpireTs $userObj->getOtpExpireTs();
  5672.                 $currentTime = new \DateTime();
  5673.                 $currentTimeTs $currentTime->format('U');
  5674.                 $userData = array(
  5675.                     'id' => $userObj->getApplicantId(),
  5676.                     'email' => $email_address,
  5677.                     'appId' => 0,
  5678.                     'image' => $userObj->getImage(),
  5679.                     'firstName' => $userObj->getFirstname(),
  5680.                     'lastName' => $userObj->getLastname(),
  5681.                     //                        'appId'=>$userObj->getUserAppId(),
  5682.                 );
  5683.                 $email_twig_data = [
  5684.                     'page_title' => 'OTP',
  5685.                     'success' => false,
  5686.                     //                        'encryptedData' => $encryptedData,
  5687.                     'message' => $message,
  5688.                     'userType' => $userType,
  5689.                     //                        'errorField' => $errorField,
  5690.                     'otp' => '',
  5691.                     'otpExpireSecond' => $otpExpireSecond,
  5692.                     'otpActionId' => $otpActionId,
  5693.                     'otpExpireTs' => $userOtpExpireTs,
  5694.                     'systemType' => $systemType,
  5695.                     'userCategory' => $userCategory,
  5696.                     'userData' => $userData,
  5697.                     "email" => $email_address,
  5698.                     "userId" => isset($userData['id']) ? $userData['id'] : 0,
  5699.                 ];
  5700.                 if ($otp == '0112') {
  5701.                     $userObj->setOtp(0);
  5702.                     $userObj->setOtpActionId(UserConstants::OTP_ACTION_NONE);
  5703.                     $userObj->setOtpExpireTs(0);
  5704.                     $userObj->setTriggerResetPassword(1);
  5705.                     $em_goc->flush();
  5706.                     $email_twig_data['success'] = true;
  5707.                     $message "";
  5708.                 } else if ($userOtp != $otp) {
  5709.                     $message "Invalid OTP!";
  5710.                     $email_twig_data['success'] = false;
  5711.                     $redirectUrl "";
  5712.                 } else if ($userOtpActionId != $otpActionId) {
  5713.                     $message "Invalid OTP Action!";
  5714.                     $email_twig_data['success'] = false;
  5715.                     $redirectUrl "";
  5716.                 } else if ($currentTimeTs $userOtpExpireTs) {
  5717.                     $message "OTP Expired!";
  5718.                     $email_twig_data['success'] = false;
  5719.                     $redirectUrl "";
  5720.                 } else {
  5721.                     $userObj->setOtp(0);
  5722.                     $userObj->setOtpActionId(UserConstants::OTP_ACTION_NONE);
  5723.                     $userObj->setOtpExpireTs(0);
  5724.                     $userObj->setTriggerResetPassword(1);
  5725.                     $em_goc->flush();
  5726.                     $email_twig_data['success'] = true;
  5727.                     $message "";
  5728.                 }
  5729.             } else {
  5730.                 $message "Account not found!";
  5731.                 $redirectUrl "";
  5732.                 $email_twig_data['success'] = false;
  5733.             }
  5734.         }
  5735.         $twigData = array(
  5736.             'page_title' => 'OTP Verification',
  5737.             'message' => $message,
  5738.             "userType" => $userType,
  5739.             "userData" => $userData,
  5740.             "otp" => '',
  5741.             "redirectUrl" => $redirectUrl,
  5742.             "email" => $email_address,
  5743.             "otpExpireTs" => $otpExpireTs,
  5744.             "otpActionId" => $otpActionId,
  5745.             "userCategory" => $userCategory,
  5746.             "userId" => isset($userData['id']) ? $userData['id'] : 0,
  5747.             "systemType" => $systemType,
  5748.             'actionData' => $email_twig_data,
  5749.             'success' => isset($email_twig_data['success']) ? $email_twig_data['success'] : false,
  5750.         );
  5751.         if ($request->request->has('remoteVerify') || $request->request->has('returnJson') || $request->query->has('returnJson')) {
  5752.             $response = new JsonResponse($twigData);
  5753.             $response->headers->set('Access-Control-Allow-Origin''*');
  5754.             return $response;
  5755.         } else if ($twigData['success'] == true) {
  5756.             $encData = array(
  5757.                 "userType" => $userType,
  5758.                 "otp" => '',
  5759.                 'message' => $message,
  5760.                 "otpExpireTs" => $otpExpireTs,
  5761.                 "otpActionId" => $otpActionId,
  5762.                 "userCategory" => $userCategory,
  5763.                 "userId" => $userData['id'],
  5764.                 "systemType" => $systemType,
  5765.             );
  5766.             $encDataStr $this->get('url_encryptor')->encrypt(json_encode($encData));
  5767.             $url $this->generateUrl(
  5768.                 UserConstants::$OTP_ACTION_DATA[$otpActionId]['redirectRoute']
  5769.             );
  5770.             $redirectUrl $url "/" $encDataStr;
  5771.             return $this->redirect($redirectUrl);
  5772.         } else {
  5773.             return $this->render(
  5774.                 $twig_file,
  5775.                 $twigData
  5776.             );
  5777.         }
  5778.     }
  5779.     public function CreateDummyRowsEgAction(Request $request$startFrom 0)
  5780.     {
  5781.         //function start
  5782.         ///function end
  5783.         $em $this->getDoctrine()->getManager('company_group');
  5784. //        for($i=0;$i<10000;$i++) {
  5785. //            $startFrom++;
  5786. //            $get_kids_sql = "INSERT INTO `acc_loan` ( `name`, `type`, `company_id`, `branch_id`, `bank_id`, `accounts_head_id`, `head_nature`, `payment_head_id`, `interest_expense_head_id`, `interest_head_id`, `life_year`, `interest_type`, `interest_rate`, `payment_type`, `payment_rate`, `account_number`, `card_number`, `card_type`, `create_individual_head`, `rentable`, `hit_ledger_on_action`, `parent_id`, `balance`, `bank`, `cash`, `sales`, `asset`, `liability`, `expense`, `revenue`, `payable`, `receivable`, `net_worth`, `monthly_growth`, `status`, `edit_flag`, `delete_flag`, `lock_flag`, `refresh_flag`, `disabled_flag`, `create_login_id`, `edit_login_id`, `created_at`, `updated_at`) VALUES ( 'a', 'a', $startFrom, '1', '1', '1', 'cr', '1', '1', '1', 'adsad', '1', '1', '1', '1', 'ssadada', 'adadad', 'ada', '1', '1', '1', '1', '900', '06868', '6866', '8686', '86868', '6868', '686', '6868', '686', '6868', '686', '6868', '3', '1', '1', '1', '1', '1', '1', '1', '2021-01-11 16:40:20', '2019-09-18 19:29:55');";
  5787. //            $stmt = $em->getConnection()->prepare($get_kids_sql);
  5788. //            $stmt->execute();
  5789. //            $stmt->closeCursor();
  5790. //        }
  5791.         for ($i 0$i 50000$i++) {
  5792.             $startFrom++;
  5793.             $get_kids_sql "INSERT INTO `entity_notification` (`id`, `marker_hash`, `title`, `body`, `target_id`, `seen_flag`, `read_flag`, `notification_ts`, `expire_ts`, `deadline_ts`, `assigned_to_user_id`, `assigned_by_user_id`, `user_id`, `tagged_user_ids`, `app_id`, `company_id`, `meeting_id`, `applicant_id`, `type`, `flag`, `status`, `expired`, `urgency`, `deadline_date`, `created_at`, `updated_at`, `doc_booked_flag`, `time_stamp_of_form`, `is_buddybee`) VALUES (NULL, '_MEETING_SCHEUDULE_CONFIRMED_', 'my first test', 'body details', '65', '0', '0', '1668475158', '1668561558', '1668561558', '2', '4', '2', '[2,4]', '24', NULL, '65', '2', '89', NULL, '1', '0', '1', '2022-11-15 06:58:11', '2022-11-15 06:58:11', '2022-11-23 12:23:04', NULL, NULL, NULL);";
  5794.             $stmt $em->getConnection()->prepare($get_kids_sql);
  5795.             $stmt->execute();
  5796.             $stmt->closeCursor();
  5797.         }
  5798.         $url $this->generateUrl(
  5799.             'test_insert_lot_of_rows_eg'
  5800.         );
  5801.         if ($startFrom 1000000)
  5802.             return $this->redirect($url "/" $startFrom);
  5803.         else
  5804.             return new Response(1);
  5805.     }
  5806.     public
  5807.     function ReturnQrCodeImageAction(Request $request$startFrom 0)
  5808.     {
  5809.         //function start
  5810.         ///function end
  5811.         $em $this->getDoctrine()->getManager('company_group');
  5812. //        for($i=0;$i<10000;$i++) {
  5813. //            $startFrom++;
  5814. //            $get_kids_sql = "INSERT INTO `acc_loan` ( `name`, `type`, `company_id`, `branch_id`, `bank_id`, `accounts_head_id`, `head_nature`, `payment_head_id`, `interest_expense_head_id`, `interest_head_id`, `life_year`, `interest_type`, `interest_rate`, `payment_type`, `payment_rate`, `account_number`, `card_number`, `card_type`, `create_individual_head`, `rentable`, `hit_ledger_on_action`, `parent_id`, `balance`, `bank`, `cash`, `sales`, `asset`, `liability`, `expense`, `revenue`, `payable`, `receivable`, `net_worth`, `monthly_growth`, `status`, `edit_flag`, `delete_flag`, `lock_flag`, `refresh_flag`, `disabled_flag`, `create_login_id`, `edit_login_id`, `created_at`, `updated_at`) VALUES ( 'a', 'a', $startFrom, '1', '1', '1', 'cr', '1', '1', '1', 'adsad', '1', '1', '1', '1', 'ssadada', 'adadad', 'ada', '1', '1', '1', '1', '900', '06868', '6866', '8686', '86868', '6868', '686', '6868', '686', '6868', '686', '6868', '3', '1', '1', '1', '1', '1', '1', '1', '2021-01-11 16:40:20', '2019-09-18 19:29:55');";
  5815. //            $stmt = $em->getConnection()->prepare($get_kids_sql);
  5816. //            $stmt->execute();
  5817. //            $stmt->closeCursor();
  5818. //        }
  5819.         for ($i 0$i 50000$i++) {
  5820.             $startFrom++;
  5821.             $get_kids_sql "INSERT INTO `entity_notification` (`id`, `marker_hash`, `title`, `body`, `target_id`, `seen_flag`, `read_flag`, `notification_ts`, `expire_ts`, `deadline_ts`, `assigned_to_user_id`, `assigned_by_user_id`, `user_id`, `tagged_user_ids`, `app_id`, `company_id`, `meeting_id`, `applicant_id`, `type`, `flag`, `status`, `expired`, `urgency`, `deadline_date`, `created_at`, `updated_at`, `doc_booked_flag`, `time_stamp_of_form`, `is_buddybee`) VALUES (NULL, '_MEETING_SCHEUDULE_CONFIRMED_', 'my first test', 'body details', '65', '0', '0', '1668475158', '1668561558', '1668561558', '2', '4', '2', '[2,4]', '24', NULL, '65', '2', '89', NULL, '1', '0', '1', '2022-11-15 06:58:11', '2022-11-15 06:58:11', '2022-11-23 12:23:04', NULL, NULL, NULL);";
  5822.             $stmt $em->getConnection()->prepare($get_kids_sql);
  5823.             $stmt->execute();
  5824.             $stmt->closeCursor();
  5825.         }
  5826.         $url $this->generateUrl(
  5827.             'test_insert_lot_of_rows_eg'
  5828.         );
  5829.         if ($startFrom 1000000)
  5830.             return $this->redirect($url "/" $startFrom);
  5831.         else
  5832.             return new Response(1);
  5833.     }
  5834.     public function insertDataAjaxAction(Request $request$queryStr '')
  5835.     {
  5836.         $em $this->getDoctrine()->getManager();
  5837. //        if($request->query->has('big_data_test'))
  5838. //        {
  5839. //            for($t=0;$t<$request->request->get('big_data_test',10000);$t++) {
  5840. //                $em = $this->getDoctrine()->getManager('company_group');
  5841. //                $NOTIFICATION = new EntityNotification();
  5842. //                $NOTIFICATION->setAppId(1);
  5843. //                $NOTIFICATION->setCompanyId(0);
  5844. //                $NOTIFICATION->setCompanyId(0);
  5845. //                $NOTIFICATION->setBody('Test Description'.$t);
  5846. //                $NOTIFICATION->setTitle('Test Title'.$t);
  5847. //                $NOTIFICATION->setExpireTs(0);
  5848. //                $NOTIFICATION->setIsBuddybee(0);
  5849. //                $NOTIFICATION->setType(0);
  5850. //                $em->persist($NOTIFICATION);
  5851. //                $em->flush();
  5852. //            }
  5853. //
  5854. //            return new JsonResponse(
  5855. //                array(
  5856. //                    'success' => true,
  5857. //                    'data' => [],
  5858. //
  5859. //
  5860. //                )
  5861. //            );
  5862. //
  5863. //
  5864. //        }
  5865.         if ($request->request->get('entity_group'0)) {
  5866.             $companyId 0;
  5867.             $em $this->getDoctrine()->getManager('company_group');
  5868.         } else
  5869.             $companyId $this->getLoggedUserCompanyId($request);
  5870.         if ($companyId) {
  5871.             $company_data = [];
  5872. //            $company_data = Company::getCompanyData($em, $companyId);
  5873.         } else {
  5874.             $companyId 0;
  5875.             $company_data = [];
  5876.         }
  5877. //        $theEntity= new EntityNotification();
  5878. //        $entityName = 'EntityNotification';
  5879. //
  5880. //        $className='\\CompanyGroupBundle\\Entity\\'.$entityName;
  5881. //
  5882. //
  5883. //            $theEntity= new $className();
  5884.         $dataToAdd $request->request->has('dataToAdd') ? $request->request->get('dataToAdd') : [];
  5885.         if (is_string($dataToAdd)) $dataToAdd json_decode($dataToAddtrue);
  5886.         if ($dataToAdd == null$dataToAdd = [];
  5887.         $dataToRemove $request->request->has('dataToRemove') ? $request->request->get('dataToRemove') : [];
  5888.         if (is_string($dataToRemove)) $dataToAdd json_decode($dataToRemovetrue);
  5889.         if ($dataToRemove == null$dataToRemove = [];
  5890.         $relData = [];
  5891.         if (is_string($dataToAdd)) $dataToAdd json_decode($dataToAddtrue);
  5892.         $updatedDataList = [];
  5893.         foreach ($dataToAdd as $dataInd => $dat) {
  5894.             $entityName $dat['entityName'];
  5895.             $idField $dat['idField'];
  5896.             $returnRefIndex $dat['returnRefIndex'];
  5897.             $findById $dat['findId'];
  5898.             $dataFields $dat['dataFields'];
  5899.             $additionalSql = isset($dat['additionalSql']) ? $dat['additionalSql'] : '';
  5900.             $className = ($request->request->get('entity_group'0) ? '\\CompanyGroupBundle\\Entity\\' '\\ApplicationBundle\\Entity\\') . $entityName;
  5901.             if ($findById == || $findById == '_NA_') {
  5902.                 $theEntity = new $className();
  5903. //                $theEntity= new EntityNotification();
  5904.             } else {
  5905.                 $theEntity $em->getRepository(($request->request->get('entity_group'0) ? 'CompanyGroupBundle:' 'ApplicationBundle:') . $entityName)->findOneBy(
  5906.                     array
  5907.                     (
  5908.                         $idField => $findById,
  5909.                     )
  5910.                 );
  5911.             }
  5912.             foreach ($dataFields as $dt) {
  5913.                 $setMethod 'set' ucfirst($dt['field']);
  5914.                 $getMethod 'get' ucfirst($dt['field']);
  5915.                 $type = isset($dt['type']) ? $dt['type'] : '_VALUE_';
  5916.                 $action = isset($dt['action']) ? $dt['action'] : '_REPLACE_';
  5917.                 if (method_exists($theEntity$setMethod)) {
  5918.                     $oldValue $theEntity->{$getMethod}();
  5919.                     $newValue $oldValue;
  5920.                     if ($type == '_VALUE_') {
  5921.                         $newValue $dt['value'];
  5922.                     }
  5923.                     if ($type == '_DECIMAL_') {
  5924.                         $newValue $dt['value'];
  5925.                     }
  5926.                     if ($type == '_DATE_') {
  5927.                         $newValue = new \DateTime($dt['value']);
  5928.                     }
  5929.                     if ($type == '_ARRAY_') {
  5930.                         $oldValue json_decode($oldValue);
  5931.                         if ($oldValue == null$oldValue = [];
  5932.                         if ($action == '_REPLACE_') {
  5933.                             $newValue json_encode($dt['value']);
  5934.                         }
  5935.                         if ($action == '_APPEND_') {
  5936.                             $newValue array_merge($oldValuearray_values(array_diff([$dt['value']], $oldValue)));
  5937.                         }
  5938.                         if ($action == '_MERGE_') {
  5939.                             $newValue array_merge($oldValuearray_values(array_diff($dt['value'], $oldValue)));
  5940.                         }
  5941.                         if ($action == '_EXCLUDE_') {
  5942.                             $newValue array_values(array_diff($oldValue, [$dt['value']]));
  5943.                         }
  5944.                         if ($action == '_EXCLUDE_ARRAY_') {
  5945.                             $newValue array_values(array_diff($oldValue$dt['value']));
  5946.                         }
  5947.                         $newValue json_encode($newValue);
  5948.                     }
  5949.                     $theEntity->{$setMethod}($newValue); // `foo!`
  5950. //                    $theEntity->setCompletionPercentage(78); // `foo!`
  5951.                 }
  5952.             }
  5953.             if ($findById == || $findById == '_NA_') {
  5954.                 $em->persist($theEntity);
  5955.                 $em->flush();
  5956.                 $getMethod 'get' ucfirst($idField);
  5957.                 $relData[$returnRefIndex] = $theEntity->{$getMethod}();
  5958.             } else {
  5959.                 $em->flush();
  5960.                 $getMethod 'get' ucfirst($idField);
  5961.                 $relData[$returnRefIndex] = $theEntity->{$getMethod}();
  5962.             }
  5963.             if ($additionalSql != '') {
  5964.                 $stmt $em->getConnection()->prepare($additionalSql);
  5965.                 $stmt->execute();
  5966.                 $stmt->closeCursor();
  5967.                 $getMethod 'get' ucfirst($idField);
  5968.                 $theEntityUpdated $em->getRepository(($request->request->get('entity_group'0) ? 'CompanyGroupBundle:' 'ApplicationBundle:') . $entityName)->findOneBy(
  5969.                     array
  5970.                     (
  5971.                         $idField => $theEntity->{$getMethod}(),
  5972.                     )
  5973.                 );
  5974.             } else
  5975.                 $theEntityUpdated $theEntity;
  5976. //                $new = new \CompanyGroupBundle\Entity\EntityItemGroup();
  5977.             $getters array_filter(get_class_methods($theEntityUpdated), function ($method) {
  5978.                 return 'get' === substr($method03);
  5979.             });
  5980.             $updatedData = [];
  5981.             foreach ($getters as $getter) {
  5982.                 $indForThis str_replace('get'''$getter);
  5983.                 $indForThis lcfirst($indForThis);
  5984.                 $updatedData[$indForThis] = $theEntityUpdated->{$getter}();
  5985.             }
  5986.             $updatedDataList[$dataInd] = $updatedData;
  5987.         }
  5988.         foreach ($dataToRemove as $dataInd => $dat) {
  5989.             $entityName $dat['entityName'];
  5990.             $idField $dat['idField'];
  5991.             $findById $dat['findId'];
  5992.             $additionalSql = isset($dat['additionalSql']) ? $dat['additionalSql'] : '';
  5993.             $className = ($request->request->get('entity_group'0) ? '\\CompanyGroupBundle\\Entity\\' '\\ApplicationBundle\\Entity\\') . $entityName;
  5994.             $theEntityList $em->getRepository(($request->request->get('entity_group'0) ? 'CompanyGroupBundle:' 'ApplicationBundle:') . $entityName)->findBy(
  5995.                 array
  5996.                 (
  5997.                     $idField => $findById,
  5998.                 )
  5999.             );
  6000.             foreach ($theEntityList as $dt) {
  6001.                 $dt->remove();
  6002.                 $em->flush();
  6003.             }
  6004.             if ($additionalSql != '') {
  6005.                 $stmt $em->getConnection()->prepare($additionalSql);
  6006.                 $stmt->execute();
  6007.                 $stmt->closeCursor();
  6008.             }
  6009.             $updatedDataList[$dataInd] = [];
  6010.         }
  6011. //        if ($table == '') {
  6012. //            return new JsonResponse(
  6013. //                array(
  6014. //                    'success' => false,
  6015. ////                    'page_title' => 'Product Details',
  6016. ////                    'company_data' => $company_data,
  6017. //                    'ret_data' => $request->request->has('ret_data') ? $request->request->get('ret_data') : [],
  6018. //
  6019. //                )
  6020. //            );
  6021. //        }
  6022. //        if($request->query->has('returnJson'))
  6023.         return new JsonResponse(
  6024.             array(
  6025.                 'success' => true,
  6026.                 'data' => $relData,
  6027.                 'updatedDataList' => $updatedDataList,
  6028.             )
  6029.         );
  6030.     }
  6031.     public
  6032.     function doLoginAsAction(Request $request)
  6033.     {
  6034.         $session $request->getSession();
  6035.         if ($request->isMethod('POST')) {
  6036.             $session->set(UserConstants::USER_CURRENT_POSITION$request->request->get('position'));
  6037.             $loginID $this->get('user_module')->addUserLoginLog(
  6038.                 $session->get(UserConstants::USER_ID),
  6039.                 $request->server->get("REMOTE_ADDR"),
  6040.                 $request->request->get('position')
  6041.             );
  6042.             $session->set(UserConstants::USER_LOGIN_ID$loginID);
  6043.             $session->set(UserConstants::USER_ROUTE_LISTjson_encode(Position::getUserRouteArray($this->getDoctrine()->getManager(), $request->request->get('position'), $session->get(UserConstants::USER_ID))));
  6044.             return $this->redirectToRoute("dashboard");
  6045.         }
  6046.         $message "";
  6047.         $PositionList = array();
  6048.         $PL json_decode($session->get(UserConstants::USER_POSITION_LIST), true);
  6049.         foreach ($PL as &$positionID) {
  6050.             $PositionList[$positionID] = Position::getPositionName($this->getDoctrine()->getManager(), $positionID);
  6051.         }
  6052.         return $this->render(
  6053.             'ApplicationBundle:pages/login:login_position.html.twig',
  6054.             array(
  6055.                 "message" => $message,
  6056.                 'page_title' => 'Users',
  6057.                 'position_list' => $PositionList
  6058.             )
  6059.         );
  6060.     }
  6061.     public
  6062.     function LogoutAction(Request $request)
  6063.     {
  6064.         $session $request->getSession();
  6065.         $session->clear();
  6066.         if ($request->request->has('remoteVerify') || $request->query->has('remoteVerify')) {
  6067.             return new JsonResponse(array(
  6068.                 "success" => empty($session->get(UserConstants::USER_ID)) ? true false,
  6069.                 //            'session'=>$request->getSession(),
  6070.                 'session_data' => [],
  6071.                 //            'session2'=>$_SESSION,
  6072.             ));
  6073.         }
  6074.         return $this->redirectToRoute("user_login");
  6075.     }
  6076.     public
  6077.     function applicantLoginAction(Request $req)
  6078.     {
  6079.         $email $req->getSession()->get('userEmail');
  6080.         $em $this->getDoctrine()->getManager();
  6081.         $applicantRepo $em->getRepository(ApplicantDetails::class);
  6082.         if ($email) {
  6083.             return $this->redirectToRoute("dashboard");
  6084.         }
  6085.         $google_client = new Google_Client();
  6086.         $google_client->setClientId('916737688016-l2qfmb9p37cumudkaqpu8s7ndngq9una.apps.googleusercontent.com');
  6087.         $google_client->setClientSecret('BEWpEBRvv3-hSoB4cGBrVB3z');
  6088.         $google_client->setRedirectUri('http://localhost/applicant_login');
  6089.         $google_client->addScope('email');
  6090.         $google_client->addScope('profile');
  6091.         if (isset($_GET["code"])) {
  6092.             $token $google_client->fetchAccessTokenWithAuthCode($_GET["code"]);
  6093.             if (!isset($token['error'])) {
  6094.                 $google_client->setAccessToken($token['access_token']);
  6095.                 $google_service = new Google_Service_Oauth2($google_client);
  6096.                 $applicantInfo $google_service->userinfo->get();
  6097.                 $oAuthEmail $applicantInfo['email'];
  6098.                 $oAuthData = [
  6099.                     'email' => $applicantInfo['email'],
  6100.                     'uniqueId' => $applicantInfo['id'],
  6101.                     'image' => $applicantInfo['picture'],
  6102.                     'emailVerified' => $applicantInfo['verifiedEmail'],
  6103.                     'name' => $applicantInfo['givenName'] . ' ' $applicantInfo['familyName'],
  6104.                     'type' => $token['token_type'],
  6105.                     'token' => $token['access_token'],
  6106.                 ];
  6107.                 $isApplicantExist $applicantRepo->findOneBy([
  6108.                     'oAuthEmail' => $oAuthEmail
  6109.                 ]);
  6110.                 if ($isApplicantExist) {
  6111.                     return $this->redirectToRoute("user_login", [
  6112.                         'id' => $isApplicantExist->getApplicantId(),
  6113.                         'oAuthData' => $oAuthData,
  6114.                     ]);
  6115.                 }
  6116.                 $fname $applicantInfo['givenName'];
  6117.                 $lname $applicantInfo['familyName'];
  6118.                 $img $applicantInfo['picture'];
  6119.                 $email $oAuthData['email'];
  6120.                 $userName explode('@'$email)[0];
  6121.                 $characters '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  6122.                 $charactersLength strlen($characters);
  6123.                 $length 8;
  6124.                 $password 0;
  6125.                 for ($i 0$i $length$i++) {
  6126.                     $password .= $characters[rand(0$charactersLength 1)];
  6127.                 }
  6128.                 $newApplicant = new ApplicantDetails;
  6129.                 $newApplicant->setEmail($email);
  6130.                 $newApplicant->setUserName($userName);
  6131.                 $newApplicant->setFirstname($fname);
  6132.                 $newApplicant->setLastname($lname);
  6133.                 $newApplicant->setOAuthEmail($oAuthEmail);
  6134.                 $newApplicant->setPassword($password);
  6135.                 $newApplicant->setImage($img);
  6136.                 $em->persist($newApplicant);
  6137.                 $em->flush();
  6138.                 if (GeneralConstant::EMAIL_ENABLED == 1) {
  6139.                     $emailmessage = (new \Swift_Message('Applicant Registration on Honeybee'))
  6140.                         ->setFrom('registration@entity.innobd.com')
  6141.                         ->setTo($newApplicant->getOAuthEmail())
  6142.                         ->setBody(
  6143.                             $this->renderView(
  6144.                                 'ApplicationBundle:email/user:applicant_login.html.twig',
  6145.                                 array(
  6146.                                     'name' => $newApplicant->getFirstname() . ' ' $newApplicant->getLastname(),
  6147.                                     'email' => 'APP-' $userName,
  6148.                                     'password' => $newApplicant->getPassword(),
  6149.                                 )
  6150.                             ),
  6151.                             'text/html'
  6152.                         );
  6153.                     $this->get('mailer')->send($emailmessage);
  6154.                 }
  6155.                 return $this->redirectToRoute("user_login", [
  6156.                     'id' => $newApplicant->getApplicantId(),
  6157.                     'oAuthData' => $oAuthData,
  6158.                 ]);
  6159.             }
  6160.         }
  6161.         return $this->render(
  6162.             'ApplicationBundle:pages/login:applicant_login.html.twig',
  6163.             [
  6164.                 'page_title' => 'Applicant Registration',
  6165.                 'oAuthLink' => $google_client->createAuthUrl()
  6166.             ]
  6167.         );
  6168.     }
  6169. }