public function dashboardAction() { $auth = new FrontEndAuth(); if (!$auth->hasIdentity(4)) { return $this->redirect()->toUrl('/login'); } $session = new Container('frontend'); // 0:- both(sms & mail) are verified 1:- any one or both(sms & mail) are unverified $verifystatus = $session->email_verification_status == 1 && $session->sms_verification_status == 1 ? 0 : 1; $api = new Api(); $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; $loggedInUser = $session->userid; $userType = $session->user_type_id; $model_practitioner = new Practitioners(); $model_consumer = new Consumers(); $loggedInUserAddress = $model_practitioner->getLoggedInUserAddress($loggedInUser, $userType, $api_url); $common = new Common(); $search_form = new SearchForm($common->getAllservices($api_url), $common->getstatesByCountry($api_url, $loggedInUserAddress->country_id)); $notifications = $model_practitioner->getNotifications($api_url, 'consumer'); $consumer_details = $model_consumer->getConsumerdetails($api_url, $session->userid); $practitioners_list = $model_practitioner->getSPlist($api_url); if (!$consumer_details) { $this->redirect()->toUrl('/consumer/list'); } $bookings_count = $this->getConsumerbookingsCount($session->userid, $api, $api_url); //getting bookings count for Consumer $wishlist_count = $this->getConsumerWishlistCount($session->userid, $api, $api_url); //getting wishlist count for Consumer $contact_list_count = $model_consumer->getContactedListCount($session->userid, $api_url); $data = $this->getConsumerData($consumer_details); // getting banner for this page $banners = $common->getBanner($api_url, 5); // getting advertisments $ad = $common->getAdvertisement($api_url, 5); return new ViewModel(array('consumer' => $data, 'states' => $common->getstatesByCountry($api_url), 'countries' => $common->getCountries($api_url), 'languages' => $model_consumer->getLanguages($api_url), 'booking_count' => $bookings_count, 'wishlist_count' => $wishlist_count, 'notifications' => $notifications, 'practitioners_list' => $practitioners_list, 'search_form' => $search_form, 'last_login' => $session->last_login, 'contact_list_count' => $contact_list_count, 'verifystatus' => $verifystatus, 'banners' => $banners, 'addresses' => $common->getAddresses($api_url), 'service_list' => $common->getServices($api_url), 'advertisement' => $ad)); }
public function listAction() { $loggedInUserAddress = array(); $common = new Common(); $model = new Practitioners(); $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; $session = new Container('frontend'); $loggedInUser = $session->userid; $userType = $session->user_type_id; $auth = new FrontEndAuth(); $loggedInUserAddress = $model->getLoggedInUserAddress($loggedInUser, $userType, $api_url); if ($this->getRequest()->isXmlHttpRequest()) { if ($this->getRequest()) { $post = $this->getRequest()->getPost(); $remoteAddr = $this->getRequest()->getServer('REMOTE_ADDR'); $model->userlistByFilterData($post, $api_url, $remoteAddr); exit; } else { echo ''; // return null exit; } } else { $sp_list = ''; $treatment_list = $common->getAllservices($api_url); $country_list = $common->getCountries($api_url); $search_form = new SearchForm($treatment_list, $common->getstatesByCountry($api_url, $loggedInUserAddress->country_id)); $data = $this->request->getPost(); if ($this->request->isPost()) { $search_form->bind($data); } // getting banner for this page $banners = $common->getBanner($api_url, 2); // getting advertisments $ad = $common->getAdvertisement($api_url, 2); return new ViewModel(array('treatment_list' => $treatment_list, 'country_list' => $country_list, 'address' => $loggedInUserAddress, 'state' => $common->getstatesByCountry($api_url, $loggedInUserAddress->country_id), 'search_form' => $search_form, 'auth' => $auth, 'location_types' => $model->getLocationTypes($api_url), 'banners' => $banners, 'advertisement' => $ad)); } }