Example #1
0
 public function routeAction(Request $request)
 {
     $id = $request->getSession()->get('userId');
     $user = new User();
     $user->load($id);
     if (!$user->getPatientId()) {
         $user->transfer();
     }
     return $this->redirectToRoute('patient_homepage', array('id' => $user->getPatientId()));
 }
Example #2
0
 public function saveRoleAction(Request $request)
 {
     $data = $request->request->all();
     if ($request->getSession()->get('userId')) {
         $user = new User();
         $user->load($data['user']);
         $user->setRoleId($data['role']);
         $user->save();
     }
     return new Response();
 }
Example #3
0
 public function fullLoad()
 {
     if ($this->getUserId()) {
         $user = new User();
         $user->load($this->getUserId());
         $this->setUserName($user->getName() . ' ' . $user->getSecondName());
     }
     if ($this->getPatientId()) {
         $patient = new Patient();
         $patient->load($this->getPatientId());
         $this->setPatientName($patient->getName() . ' ' . $patient->getSecondName());
     }
     if ($this->getDiseaseId()) {
         $disease = new Disease();
         $disease->load($this->getDiseaseId());
         $this->setTitle($disease->getTitle());
     }
 }
Example #4
0
 public function fullLoad()
 {
     if ($this->getUserId()) {
         $user = new User();
         $user->load($this->getUserId());
         $this->setUserName($user->getName() . ' ' . $user->getSecondName());
     }
     if ($this->getPatientId()) {
         $patient = new Patient();
         $patient->load($this->getPatientId());
         $this->setPatientName($patient->getName() . ' ' . $patient->getSecondName());
     }
     if ($this->getServiceId()) {
         $service = new Service();
         $service->load($this->getServiceId());
         $this->setTitle($service->getTitle());
         $this->setPrice($service->getPrice());
     }
 }
 /**
  * Save reset password.
  *
  * @param Request $request
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function saveResetAction(Request $request)
 {
     $data = $request->request->all();
     $user = new User();
     $user->loadByHash($data['hash']);
     if ($user->getId() && $data['password']) {
         $user->setPassword(md5($data['password']));
         $user->save();
     }
     return $this->redirectToRoute('lance_authorization');
 }