public function trashAction()
 {
     $auth = new FrontEndAuth();
     if (!$auth->hasIdentity(3)) {
         return $this->redirect()->toUrl('/login');
     }
     $session = new Container('frontend');
     $common = new Common();
     $api = new Api();
     $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];
     $model = new Practitioners();
     $notifications = $model->getNotifications($api_url);
     $sp_details = $model->getSPDetails($api_url, $session->userid);
     $subscriptionDetails = $common->getSubscriptiondetails($api_url, '', true);
     if (!isset($subscriptionDetails['features']) || !is_array($subscriptionDetails['features']) || !in_array(5, $subscriptionDetails['features'])) {
         $this->flashMessenger()->addErrorMessage("Either you have not subscribed any subscription or your subscription don't have permission to access this section..!!");
         return $this->redirect()->toRoute('practitioner', array('action' => 'dashboard'));
     }
     if ($this->getRequest()->isXmlHttpRequest()) {
         $request = $this->getRequest();
         $page = $request->getPost('page');
         $no_of_records = $request->getPost('no_of_records');
         $model = new Messages();
         $result = $model->getMessages($api_url, $session->userid, $session->user_type_id, $page, "trash", $no_of_records);
         echo json_encode($result);
         exit;
     }
     // getting banner for this page
     $banners = $common->getBanner($api_url, 4);
     return new ViewModel(array('notifications' => $notifications, 'avtar_url' => $sp_details['avtar_url'], 'first_name' => $sp_details['first_name'], 'last_name' => $sp_details['last_name'], 'banners' => $banners));
 }
Пример #2
0
 public function trashAction()
 {
     $auth = new FrontEndAuth();
     if (!$auth->hasIdentity(4)) {
         return $this->redirect()->toUrl('/login');
     }
     $session = new Container('frontend');
     $api = new Api();
     $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];
     /* get details and notifiactions for consumer */
     $model_practitioner = new Practitioners();
     $model_consumer = new Consumers();
     $common = new Common();
     $notifications = $model_practitioner->getNotifications($api_url, 'consumer');
     $consumer_details = $model_consumer->getConsumerdetails($api_url, $session->userid);
     if ($this->getRequest()->isXmlHttpRequest()) {
         $request = $this->getRequest();
         $page = $request->getPost('page');
         $model = new Messages();
         $result = $model->getMessages($api_url, $session->userid, $session->user_type_id, $page, "trash");
         echo json_encode($result);
         exit;
     }
     // getting banner for this page
     $banners = $common->getBanner($api_url, 5);
     return new ViewModel(array('notifications' => $notifications, 'avtar_url' => $consumer_details['avtar_url'], 'first_name' => $consumer_details['first_name'], 'last_name' => $consumer_details['last_name'], 'banners' => $banners));
 }