src/Controller/IndexController.php line 50

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Roles;
  4. use App\Entity\User;
  5. use App\Helpers\Utils;
  6. use App\Services\CashdeskService;
  7. use App\Services\TimetableService;
  8. use App\Services\WorkshiftService;
  9. use App\Services\UserService;
  10. use App\ValueObjects\Timetable\TimetableFilter;
  11. use App\ValueObjects\Timetable\TimetablePersonalReport;
  12. use Exception;
  13. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  14. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  15. use Symfony\Component\HttpFoundation\JsonResponse;
  16. use Symfony\Component\HttpFoundation\RedirectResponse;
  17. use Symfony\Component\HttpFoundation\Request;
  18. use Symfony\Component\HttpFoundation\Response;
  19. use Symfony\Component\Routing\Annotation\Route;
  20. use Symfony\Contracts\Translation\TranslatorInterface;
  21. use Webmozart\Assert\Assert;
  22. use PDO;
  23. class IndexController extends AbstractController
  24. {
  25.     /**
  26.      * @var CashdeskService
  27.      */
  28.     private CashdeskService $cashdeskService;
  29.     /** @var UserService */
  30.     private UserService $userService;
  31.     private TranslatorInterface $translator;
  32.     private TimetableService $timetableService;
  33.     private WorkshiftService $workshiftService;
  34.     public function __construct(CashdeskService $cashdeskServiceUserService $userServiceTimetableService $timetableServiceTranslatorInterface $translatorWorkshiftService $workshiftService)
  35.     {
  36.         $this->cashdeskService $cashdeskService;
  37.         $this->userService $userService;
  38.         $this->translator $translator;
  39.         $this->timetableService $timetableService;
  40.         $this->workshiftService $workshiftService;
  41.     }
  42.     /**
  43.      * @Route(path="/", name="app_index")
  44.      */
  45.     public function index(): Response
  46.     {
  47.         return $this->render('contentBlock.html.twig', [
  48.             "content" => "",
  49.             "cashdesks" => $this->cashdeskService->getAllowedCashdesksList()
  50.         ]);
  51.     }
  52.     /**
  53.      * @Route("/chooseCashdesk", name="app_choose_cashdesk", methods={"POST"})
  54.      * @param Request $request
  55.      * @return RedirectResponse|Response
  56.      */
  57.     public function chooseCashdesk(Request $request)
  58.     {
  59.         /** @var User $currentUser */
  60.         $currentUser $this->getUser();
  61.         try {
  62.             if ($request->request->has("currentCashdeskId")) {
  63.                 $currentCashdeskId $request->request->getInt("currentCashdeskId");
  64.                 $cashdesk $this->cashdeskService->getById($currentCashdeskId);
  65.                 Assert::notEmpty($cashdesk$this->translator->trans('Cashdesk not found'));
  66.                 if (!empty($currentCashdeskId) && in_array($currentCashdeskId$currentUser->getAllowedCashdesksId())) {
  67.                     $this->cashdeskService->setUserIntoCashdesk($currentUser$currentCashdeskId);
  68.                     $this->timetableService->saveClubToTimetable($currentUser$cashdesk->getClubId());
  69.                     if($currentUser->isTimetableEnabled()){
  70.                         if($currentUser->getTimetables()->last()->getFinishDatetime()){
  71.                             $this->timetableService->start($currentUser);
  72.                         }
  73.                     }
  74.                 }
  75.             } else {
  76.                 $this->userService->releaseCurrentCashdesk($currentUser);
  77.             }
  78.             return $this->redirectToRoute("app_index");
  79.         } catch (Exception $e) {
  80.             $error $e->getMessage();
  81.         }
  82.         return $this->render('contentBlock.html.twig', [
  83.             "content" => $error,
  84.             "cashdesks" => $this->cashdeskService->getAllowedCashdesksList()
  85.         ]);
  86.     }
  87.     /**
  88.      * @Route("/workShiftOpen", name="app_work_shift_open", methods={"POST"})
  89.      * @param Request $request
  90.      * @return RedirectResponse|Response
  91.      */
  92.     public function workShiftOpen(Request $request)
  93.     {
  94.         /** @var User $currentUser */
  95.         $currentUser $this->getUser();
  96.         try {
  97.             $currentCashdesk $currentUser->getCurrentCashdesk();
  98.             Assert::notEmpty($currentCashdesk$this->translator->trans('Please, choose your current cashdesk on top menu'));
  99.             Assert::true($currentCashdesk->isGranted(Roles::ROLE_ONLINE_CASHDESK_WORK_SHIFT), $this->translator->trans('You do not have permission'));
  100.             $this->workshiftService->open($currentCashdesk$currentUser);
  101.             return $this->redirectToRoute("app_index");
  102.         } catch (Exception $e) {
  103.             $error $e->getMessage();
  104.         }
  105.         return $this->render('contentBlock.html.twig', [
  106.             "content" => $error
  107.         ]);
  108.     }
  109.     /**
  110.      * @Route("/workShiftClose", name="app_work_shift_close", methods={"POST"})
  111.      * @param Request $request
  112.      * @return RedirectResponse|Response
  113.      */
  114.     public function workShiftClose(Request $request)
  115.     {
  116.         /** @var User $currentUser */
  117.         $currentUser $this->getUser();
  118.         try {
  119.             $currentCashdesk $currentUser->getCurrentCashdesk();
  120.             Assert::notEmpty($currentCashdesk$this->translator->trans('Please, choose your current cashdesk on top menu'));
  121.             Assert::true($currentCashdesk->isGranted(Roles::ROLE_ONLINE_CASHDESK_WORK_SHIFT), $this->translator->trans('You do not have permission'));
  122.             $currentWorkshift $currentCashdesk->getCurrentWorkshift();
  123.             Assert::notEmpty($currentWorkshift$this->translator->trans('Cashdesk does not have open workshift'));
  124.             $this->workshiftService->close($currentWorkshift);
  125.             return $this->redirectToRoute("app_index");
  126.         } catch (Exception $e) {
  127.             $error $e->getMessage();
  128.         }
  129.         return $this->render('contentBlock.html.twig', [
  130.             "content" => $error
  131.         ]);
  132.     }
  133.     /**
  134.      * @Route(path="/getBalance", name="app_get_balance")
  135.      */
  136.     public function getBalance(): JsonResponse
  137.     {
  138.         $balance 0;
  139.         /** @var User $currentUser */
  140.         $currentUser $this->getUser();
  141.         if ($currentUser) {
  142.             $balance Utils::showMoney($currentUser->getBalance());
  143.             if ($this->isGranted(Roles::ROLE_CASHIER) && $currentUser->getCurrentCashdesk() && $currentUser->getCurrentCashdesk()->getBalance()) {
  144.                 $balance Utils::showMoney($currentUser->getCurrentCashdesk()->getBalance());
  145.             }
  146.         }
  147.         return new JsonResponse([
  148.             'balance' => $balance,
  149.         ]);
  150.     }
  151.     /**
  152.      * @Route(path="/getScalary", name="app_get_scalary")
  153.      */
  154. //    public function getScalary(): JsonResponse
  155. //    {
  156. //        /** @var User $currentUser */
  157. //        $currentUser = $this->getUser();
  158. //
  159. //        $filter = new TimetableFilter();
  160. //        $filter
  161. //            ->setStartDate(strtotime(date("Y-m-01 06:00:00")))
  162. //            ->setFinishDate(strtotime(date("Y-m-d H:i:s")))
  163. //            ->setUserId($currentUser->getId());
  164. //
  165. //        $personalReport = $this->timetableService->getPersonalReport($filter);
  166. //        if (sizeof($personalReport->getTimetables()) > 0) {
  167. //            foreach ($personalReport->getTimetables() as $timetable) {
  168. ////                $finish_date = date("Y-m-d H:i:s");
  169. //                if($timetable->getFinishDatetime()){
  170. //                    $finish_date = $timetable->getFinishDatetime()->format('Y-m-d H:i:s');
  171. //
  172. //                    $info_user[] = [
  173. //                        'user_id' => $timetable->getUser()->getId(),
  174. //                        'start_datetime' => $timetable->getStartDatetime()->format('Y-m-d H:i:s'),
  175. //                        'finish_datetime' => $finish_date,
  176. //                        'hour_cost_0' => $timetable->getUser()->getHourCost_0(),
  177. //                        'hour_cost_1' => $timetable->getUser()->getHourCost_1(),
  178. //                        'hour_cost_2' => $timetable->getUser()->getHourCost_2(),
  179. //                    ];
  180. //                }
  181. //            }
  182. //
  183. //            $array_info = [
  184. //                "club_title" => "",
  185. //            ];
  186. //            foreach ($info_user as $row){
  187. //                if(date("d", strtotime($row['start_datetime'])) > 15){
  188. //                    $half = "second_half_duration";
  189. //                }elseif(date("d", strtotime($row['start_datetime'])) <= 15){
  190. //                    $half = "first_half_duration";
  191. //                }
  192. //
  193. //                $duration = "";
  194. //
  195. ////                $array_info["club_title"] = $row["club_title"];
  196. ////                $array_info["username"] = $row["username"];
  197. ////                $array_info["shift_duration"] = $row["username"];
  198. ////                $array_info["shift_cost"] = $row["shift_cost"];
  199. //                $array_info["hour_cost_0"] = $row["hour_cost_0"];
  200. //                $array_info["hour_cost_1"] = $row["hour_cost_1"];
  201. //                $array_info["hour_cost_2"] = $row["hour_cost_2"];
  202. ////                $array_info["ban"] = $row["ban"];
  203. ////                $array_info["bank_title"] = $row["bank_title"];
  204. //                $array_info["start_datetime"][] = $row["start_datetime"];
  205. //                $array_info["finish_datetime"][] = $row["finish_datetime"];
  206. //                $array_info["shift_datetime"][] = [$row["start_datetime"], $row["finish_datetime"]];
  207. //
  208. //                $T1 = strtotime($row['start_datetime']);
  209. //                $T2 = strtotime($row['finish_datetime']);
  210. //
  211. //                $t1_6am_8am = strtotime(date("Y-m-d 06:00:00", $T1));
  212. //                if(($T2-$T1) < 86400){
  213. //                    $t2_6am_8am = strtotime(date("Y-m-d 08:00:00", $T2));
  214. //                }else{
  215. //                    $t2_6am_8am = strtotime(date("Y-m-d 08:00:00", $T1));
  216. //                }
  217. //                $duration_6am_8am = $Lmin_6am_8am = $Lreal_6am_8am = 0;
  218. //                $Lmin_6am_8am = ($T2 - $T1) + ($t2_6am_8am - $t1_6am_8am);
  219. //                $Lreal_6am_8am = max($T2, $t2_6am_8am) - max($T1, $t1_6am_8am);
  220. //                if($Lmin_6am_8am >= $Lreal_6am_8am){
  221. //                    if(($T1 <= $t1_6am_8am) && ($T2 >= $t2_6am_8am)){
  222. //                        $duration_6am_8am = $t2_6am_8am - $t1_6am_8am;
  223. //                        $duration = "duration_6am_8am";
  224. //                    }
  225. //                    if((($T1 >= $t1_6am_8am) && ($T1 < $t2_6am_8am)) && ($T2 >= $t2_6am_8am)){
  226. //                        if(($t2_6am_8am - $T1) > 0){
  227. //                            $duration_6am_8am = $t2_6am_8am - $T1;
  228. //                            $duration = "duration_6am_8am";
  229. //                        }
  230. //                    }
  231. //                    if(($T1 >= $t1_6am_8am) && ($T2 <= $t2_6am_8am)){
  232. //                        $duration_6am_8am = $Lmin_6am_8am - ($t2_6am_8am - $t1_6am_8am);
  233. //                        $duration = "duration_6am_8am";
  234. //                    }
  235. //                    if(($T1 <= $t1_6am_8am) && ($T2 <= $t2_6am_8am) && ($T2 > $t1_6am_8am)){
  236. //                        $duration_6am_8am = $T2 - $t1_6am_8am;
  237. //                        $duration = "duration_6am_8am";
  238. //                    }
  239. //                }
  240. //                if(($T2-$T1) >= 86400){
  241. //                    $koef = intval(($T2-$T1) / 86400);
  242. //                    $duration_6am_8am = $duration_6am_8am * $koef;
  243. //                }
  244. //                if($half == "first_half_duration" && $duration == "duration_6am_8am" && $duration_6am_8am > 0){
  245. //                    if(isset($array_info[$half][$duration])){
  246. //                        $array_info[$half][$duration] = $array_info[$half][$duration] + $duration_6am_8am;
  247. //                    }else{
  248. //                        $array_info[$half][$duration] = $duration_6am_8am;
  249. //                    }
  250. //                }
  251. //                if($half == "second_half_duration" && $duration == "duration_6am_8am" && $duration_6am_8am > 0){
  252. //                    $a[] = $duration_6am_8am;
  253. //                    if(isset($array_info[$half][$duration])){
  254. //                        $array_info[$half][$duration] = $array_info[$half][$duration] + $duration_6am_8am;
  255. //                    }else{
  256. //                        $array_info[$half][$duration] = $duration_6am_8am;
  257. //                    }
  258. //                }
  259. //
  260. //                $t1_8am_7pm = strtotime(date("Y-m-d 08:00:00", $T1));
  261. //                if(($T2-$T1) < 86400){
  262. //                    $t2_8am_7pm = strtotime(date("Y-m-d 19:00:00", $T2));
  263. //                }else{
  264. //                    $t2_8am_7pm = strtotime(date("Y-m-d 19:00:00", $T1));
  265. //                }
  266. //                $duration_8am_7pm = $Lmin_8am_7pm = $Lreal_8am_7pm = 0;
  267. //                $Lmin_8am_7pm = ($T2 - $T1) + ($t2_8am_7pm - $t1_8am_7pm);
  268. //                $Lreal_8am_7pm = max($T2, $t2_8am_7pm) - max($T1, $t1_8am_7pm);
  269. //                if($Lmin_8am_7pm >= $Lreal_8am_7pm){
  270. //                    if(($T1 <= $t1_8am_7pm) && ($T2 >= $t2_8am_7pm)){
  271. //                        $duration_8am_7pm = $t2_8am_7pm - $t1_8am_7pm;
  272. //                        $duration = "duration_8am_7pm";
  273. //                    }
  274. //                    if((($T1 >= $t1_8am_7pm) && $T1 < $t2_8am_7pm) && ($T2 >= $t2_8am_7pm)){
  275. //                        if(($t2_8am_7pm - $T1) > 0){
  276. //                            $duration_8am_7pm = $t2_8am_7pm - $T1;
  277. //                            $duration = "duration_8am_7pm";
  278. //                        }
  279. //                    }
  280. //                    if(($T1 <= $t1_8am_7pm) && ($T2 <= $t2_8am_7pm) && ($T2 > $t1_8am_7pm)){
  281. //                        $duration_8am_7pm = $T2 - $t1_8am_7pm;
  282. //                        $duration = "duration_8am_7pm";
  283. //                    }
  284. //                    if(($T1 >= $t1_8am_7pm) && ($T2 <= $t2_8am_7pm)){
  285. //                        $duration_8am_7pm = $Lmin_8am_7pm - ($t2_8am_7pm - $t1_8am_7pm);
  286. //                        $duration = "duration_8am_7pm";
  287. //                    }
  288. //                }
  289. //                if(($T2-$T1) >= 86400){
  290. //                    $koef = intval(($T2-$T1) / 86400);
  291. //                    $duration_8am_7pm = $duration_8am_7pm * $koef;
  292. //                }
  293. //                if($half == "first_half_duration" && $duration == "duration_8am_7pm" && $duration_8am_7pm > 0){
  294. //                    if(isset($array_info[$half][$duration])){
  295. //                        $array_info[$half][$duration] = $array_info[$half][$duration] + $duration_8am_7pm;
  296. //                    }else{
  297. //                        $array_info[$half][$duration] = $duration_8am_7pm;
  298. //                    }
  299. //                }
  300. //                if($half == "second_half_duration" && $duration == "duration_8am_7pm" && $duration_8am_7pm > 0){
  301. //                    if(isset($array_info[$half][$duration])){
  302. //                        $array_info[$half][$duration] = $array_info[$half][$duration] + $duration_8am_7pm;
  303. //                    }else{
  304. //                        $array_info[$half][$duration] = $duration_8am_7pm;
  305. //                    }
  306. //                }
  307. //
  308. //                $t1_7pm_10pm = strtotime(date("Y-m-d 19:00:00", $T1));
  309. //                if(($T2-$T1) < 86400){
  310. //                    $t2_7pm_10pm = strtotime(date("Y-m-d 22:00:00", $T2));
  311. //                }else{
  312. //                    $t2_7pm_10pm = strtotime(date("Y-m-d 22:00:00", $T1));
  313. //                }
  314. //                $duration_7pm_10pm = $Lmin_7pm_10pm = $Lreal_7pm_10pm = 0;
  315. //                $Lmin_7pm_10pm = ($T2 - $T1) + ($t2_7pm_10pm - $t1_7pm_10pm);
  316. //                $Lreal_7pm_10pm = max($T2, $t2_7pm_10pm) - max($T1, $t1_7pm_10pm);
  317. //                if($Lmin_7pm_10pm >= $Lreal_7pm_10pm){
  318. //                    if(($T1 <= $t1_7pm_10pm) && ($T2 >= $t2_7pm_10pm)){
  319. //                        $duration_7pm_10pm = $t2_7pm_10pm - $t1_7pm_10pm;
  320. //                        $duration = "duration_7pm_10pm";
  321. //                    }
  322. //                    if((($T1 >= $t1_7pm_10pm) && $T1 < $t2_7pm_10pm) && ($T2 > $t2_7pm_10pm)){
  323. //                        if(($t2_7pm_10pm - $T1) > 0){
  324. //                            $duration_7pm_10pm = $t2_7pm_10pm - $T1;
  325. //                            $duration = "duration_7pm_10pm";
  326. //                        }
  327. //                    }
  328. //                    if(($T1 <= $t1_7pm_10pm) && ($T2 <= $t2_7pm_10pm) && ($T2 > $t1_7pm_10pm)){
  329. //                        $duration_7pm_10pm = $T2 - $t1_7pm_10pm;
  330. //                        $duration = "duration_7pm_10pm";
  331. //                    }
  332. //                    if(($T1 >= $t1_7pm_10pm) && ($T2 <= $t2_7pm_10pm)){
  333. //                        $duration_7pm_10pm = $Lmin_7pm_10pm - ($t2_7pm_10pm - $t1_7pm_10pm);
  334. //                        $duration = "duration_7pm_10pm";
  335. //                    }
  336. //                }
  337. //                if(($T2-$T1) >= 86400){
  338. //                    $koef = intval(($T2-$T1) / 86400);
  339. //                    $duration_7pm_10pm = $duration_7pm_10pm * $koef;
  340. //                }
  341. //                if($half == "first_half_duration" && $duration == "duration_7pm_10pm" && $duration_7pm_10pm > 0){
  342. //                    if(isset($array_info[$half][$duration])){
  343. //                        $array_info[$half][$duration] = $array_info[$half][$duration] + $duration_7pm_10pm;
  344. //                    }else{
  345. //                        $array_info[$half][$duration] = $duration_7pm_10pm;
  346. //                    }
  347. //                }
  348. //                if($half == "second_half_duration" && $duration == "duration_7pm_10pm" && $duration_7pm_10pm > 0){
  349. //                    if(isset($array_info[$half][$duration])){
  350. //                        $array_info[$half][$duration] = $array_info[$half][$duration] + $duration_7pm_10pm;
  351. //                    }else{
  352. //                        $array_info[$half][$duration] = $duration_7pm_10pm;
  353. //                    }
  354. //                }
  355. //            }
  356. //
  357. //            $array_sum_first_6am_8am = $array_sum_first_8am_7pm = $array_sum_first_7pm_10pm = 0;
  358. //            $array_sum_second_6am_8am = $array_sum_second_8am_7pm = $array_sum_second_7pm_10pm = 0;
  359. //            foreach ($info_user as $row) {
  360. //                if(isset($array_info["first_half_duration"]["duration_6am_8am"]))
  361. //                    $array_sum_first_6am_8am = $array_info["first_half_duration"]["duration_6am_8am"];
  362. //                if(isset($array_info["first_half_duration"]["duration_8am_7pm"]))
  363. //                    $array_sum_first_8am_7pm = $array_info["first_half_duration"]["duration_8am_7pm"];
  364. //                if(isset($array_info["first_half_duration"]["duration_7pm_10pm"]))
  365. //                    $array_sum_first_7pm_10pm = intval($array_info["first_half_duration"]["duration_7pm_10pm"]);
  366. //
  367. //                if(isset($array_info["second_half_duration"]["duration_6am_8am"]))
  368. //                    $array_sum_second_6am_8am = $array_info["second_half_duration"]["duration_6am_8am"];
  369. //                if(isset($array_info["second_half_duration"]["duration_8am_7pm"]))
  370. //                    $array_sum_second_8am_7pm = intval($array_info["second_half_duration"]["duration_8am_7pm"]);
  371. //                if(isset($array_info["second_half_duration"]["duration_7pm_10pm"]))
  372. //                    $array_sum_second_7pm_10pm = intval($array_info["second_half_duration"]["duration_7pm_10pm"]);
  373. //
  374. //                $result = [
  375. //                    'user_id' => intval($row['user_id']),
  376. //                    'hour_cost_0' => intval($row['hour_cost_0']),
  377. //                    'hour_cost_1' => intval($row['hour_cost_1']),
  378. //                    'hour_cost_2' => intval($row['hour_cost_2']),
  379. //                    'firstHalfDuration_6am_8am' => $array_sum_first_6am_8am,
  380. //                    'secondHalfDuration_6am_8am' => $array_sum_second_6am_8am,
  381. //                    'firstHalfDuration_8am_7pm' => $array_sum_first_8am_7pm,
  382. //                    'secondHalfDuration_8am_7pm' => $array_sum_second_8am_7pm,
  383. //                    'firstHalfDuration_7pm_10pm' => $array_sum_first_7pm_10pm,
  384. //                    'secondHalfDuration_7pm_10pm' => $array_sum_second_7pm_10pm,
  385. //                ];
  386. //            }
  387. //
  388. //            $firstHalfShiftsCount_6am_8am = intval($result["firstHalfDuration_6am_8am"] / 60);
  389. //            $firstHalfShiftsCount_8am_7pm = intval($result["firstHalfDuration_8am_7pm"] / 60);
  390. //            $firstHalfShiftsCount_7pm_10pm = intval($result["firstHalfDuration_7pm_10pm"] / 60);
  391. //            $firstHalfSalary = $firstHalfShiftsCount_6am_8am * intval($result["hour_cost_0"] / 60) + $firstHalfShiftsCount_8am_7pm * intval($result["hour_cost_1"] / 60) + $firstHalfShiftsCount_7pm_10pm * intval($result["hour_cost_2"] / 60);
  392. //            $firstHalfSalary = intval($firstHalfSalary/100)*0.1;
  393. //            $firstHalfSalary = intval(round($firstHalfSalary)*1000);
  394. //            $days_1 = $firstHalfShiftsCount_6am_8am + $firstHalfShiftsCount_8am_7pm + $firstHalfShiftsCount_7pm_10pm;
  395. //            $secondHalfShiftsCount_6am_8am = intval($result["secondHalfDuration_6am_8am"] / 60);
  396. //            $secondHalfShiftsCount_8am_7pm = intval($result["secondHalfDuration_8am_7pm"] / 60);
  397. //            $secondHalfShiftsCount_7pm_10pm = intval($result["secondHalfDuration_7pm_10pm"] / 60);
  398. //            $secondHalfSalary = $secondHalfShiftsCount_6am_8am * intval($result["hour_cost_0"] / 60) + $secondHalfShiftsCount_8am_7pm * intval($result["hour_cost_1"] / 60) + $secondHalfShiftsCount_7pm_10pm * intval($result["hour_cost_2"] / 60);
  399. //            $secondHalfSalary = intval($secondHalfSalary/100)*0.1;
  400. //            $secondHalfSalary = intval(round($secondHalfSalary)*1000);
  401. //            $days_2 = $secondHalfShiftsCount_6am_8am + $secondHalfShiftsCount_8am_7pm + $secondHalfShiftsCount_7pm_10pm;
  402. //            $salaryGross = $firstHalfSalary + $secondHalfSalary;
  403. //            $annualSalaryGross = $salaryGross * 12;
  404. //        }
  405. //
  406. //        function secToTimeArray($secs)
  407. //        {
  408. //            $res = array();
  409. //            $res['hours'] = floor($secs / 3600);
  410. //            $secs = $secs % 3600;
  411. //            $minutes = floor($secs / 60);
  412. //            if($minutes < 10)
  413. //                $minutes = "0" . $minutes;
  414. //            $res['minutes'] = $minutes;
  415. //            return $res;
  416. //        }
  417. //
  418. //        $time_1 = secToTimeArray($days_1 * 60);
  419. //        $time_2 = secToTimeArray($days_2 * 60);
  420. //
  421. //
  422. //        return new JsonResponse([
  423. //            'firstHalfSalary' => $firstHalfSalary / 100,
  424. //            'secondHalfSalary' => $secondHalfSalary / 100,
  425. //            'work_hours_1' => $time_1['hours'] . ":" . $time_1['minutes'],
  426. //            'work_hours_2' => $time_2['hours'] . ":" . $time_2['minutes'],
  427. //            'month' => date("F"),
  428. //        ]);
  429. //    }
  430. }