Beispiel #1
0
 public function balanceDetailsAction($user_id, $date_from, $date_to, $acr_id)
 {
     $context = ['time' => date('Y-m-d H:i:s'), 'function' => __METHOD__, 'user_detail' => $user_id, 'date_from' => $date_from, 'date_to' => $date_to, 'acr_id' => $acr_id];
     try {
         $user = $this->getUser();
         if (!$user) {
             throw new AuthenticationException('User was not founded');
         }
         $context['user_id'] = $this->getUser()->getId();
         $parameters = ['user_id' => $user_id, 'date_from' => $date_from, 'date_to' => $date_to, 'acr_id' => $acr_id];
         $types = DBPupil::getInstance()->getAllType(['user_id' => $user_id]);
         $pupil = DBPupil::getInstance()->getUserInfoById($user_id);
         $info = DBBoss::getInstance()->getBalanceDetail($parameters);
         $cls_name = $pupil[0]['cls_name'];
         $full_name = $pupil[0]['user_name'];
         return $this->render('CabinetBundle:Boss/balance:balance_detail_report.html.twig', ['info' => $info, 'money_types' => $types, 'date_from' => $parameters['date_from'], 'date_to' => $parameters['date_to'], 'curr_acr_id' => $parameters['acr_id'], 'full_name' => $full_name, 'cls_name' => $cls_name, 'user_id' => $user_id]);
     } catch (Exception $e) {
         $this->get('logger')->error($e->getMessage(), $context);
         return new Response('Ошибка. Обратитесь к администратору');
     }
 }
Beispiel #2
0
 public function updateInfoAction(Request $request)
 {
     $context = ['time' => date('Y-m-d H:i:s'), 'function' => __METHOD__];
     try {
         $user = $this->getUser();
         if (!$user) {
             throw new AuthenticationException('User was not founded');
         }
         $context['user_id'] = $this->getUser()->getId();
         $parameters = ['limit' => $request->get('limit'), 'user_id' => $user->getId(), 'parent_id' => $user->getParentId(), 'pupil_name' => $request->get('name'), 'parent_name' => $request->get('parent_name'), 'phone' => $request->get('phone'), 'email' => $request->get('email'), 'tarif_id' => $request->get('tarif_id')];
         DBPupil::getInstance()->updateInfo($parameters);
         return new Response(1);
     } catch (Exception $e) {
         $this->get('logger')->error($e->getMessage(), $context);
         return false;
     }
 }
Beispiel #3
0
 public function enterDetailAction(Request $request)
 {
     $context = ['time' => date('Y-m-d H:i:s'), 'function' => __METHOD__];
     try {
         $user = $this->getUser();
         if (!$user) {
             throw new AuthenticationException('User was not founded');
         }
         $context['user_id'] = $this->getUser()->getId();
         $parameters = ['user_id' => $request->get('user_id'), 'date_from' => $request->get('date_from'), 'date_to' => $request->get('date_to')];
         $result = DBPupil::getInstance()->getPupilEnter($parameters);
         return $this->render('CabinetBundle:Pupil/enter:enter_report.html.twig', ['result' => $result]);
     } catch (Exception $e) {
         $this->get('logger')->error($e->getMessage(), $context);
         return new Response('Ошибка. Обратитесь к администратору');
     }
 }