예제 #1
0
 /**
  * Returns the current kiosk location
  * 
  * @return Location $location
  * return the current registered location
  */
 public static function getLocation()
 {
     $locationId = Session::get('dmafriends.activeLocationId');
     if (!$locationId && isset($_SERVER['HTTP_X_DEVICE_UUID'])) {
         $uuid = $_SERVER['HTTP_X_DEVICE_UUID'];
         return Location::findByUUID($uuid)->first();
     }
     return Location::find($locationId);
 }
 public function onPrintCard()
 {
     $locationId = post('printerLocation');
     if (empty($locationId)) {
         Flash::error(Lang::get('dma.friends::lang.user.memberCardLocation'));
         return;
     }
     $location = Location::find($locationId);
     $user = post('User');
     $user = User::where('email', '=', $user['email'])->first();
     try {
         $manager = new PrintManager($location, $user);
         $manager->printIdCard();
         Flash::info(Lang::get('dma.friends::lang.user.memberCard', ['title' => $location->title]));
     } catch (SystemException $e) {
         Flash::error($e->getMessage());
     }
 }