public function indexAction() { $api = new Api(); $common = new Common(); $api_url = $this->getServiceLocator()->get('Config')['api_url']['value']; $url = $api_url . "/api/partners/?status_id=1"; $res = $api->curl($url, array(), "GET"); if ($res->getStatusCode() == 200) { $content = json_decode($res->getBody(), true); if ($this->getRequest()->isXmlHttpRequest()) { $partners_list = ''; foreach ($content as $data) { $partners_list .= "<li>"; $partners_list .= "<img src='" . $data['logo'] . "' alt='' >"; $partners_list .= "</li>"; } echo $partners_list; die; } // getting banners $banners = $common->getBanner($api_url, 13); $banner_content = $common->getPage($api_url, 14); return new ViewModel(array('partners' => $content, 'banners' => $banners, 'banner_content' => $banner_content)); } }
public function indexAction() { $api_url = $this->getServiceLocator()->get('Config')['api_url']['value']; if ($this->getRequest()->isXmlHttpRequest()) { //echo $this->getRequest()->getPost('page'); exit; $next = $this->getRequest()->getPost('page') != '' ? $this->getRequest()->getPost('page') : '1'; $api = new Api(); $url = $api_url . "/api/testimonials/"; $res = $api->curl($url, array('page' => $next, 'status_id' => '1'), "GET"); if ($res->getStatusCode() == 200) { $content = json_decode($res->getBody(), true); if (count($content['results'])) { $count = 0; foreach ($content['results'] as $value) { $currentDate = strtotime(date("Y-m-d H:i:s")); $lastDate = strtotime($value['created_on']); $dateTime = $lastDate + 86400 > $currentDate ? 'About ' . floor(($currentDate - $lastDate) / 3600) . ':' . floor(($currentDate - $lastDate) / (24 * 60)) . ' Hours Ago' : $value['created_on']; $ts_list[$count]['id'] = $value['id']; $ts_list[$count]['created_on'] = $dateTime; $ts_list[$count]['text'] = $value['text']; if (count($value['created_by_user']) > 0) { $details = json_decode($value['created_by_user'], true); foreach ($details as $user_detail) { $ts_list[$count]['user_name'] = $details['first_name'] . ' ' . $details['last_name']; $ts_list[$count]['user_id'] = $details['user_id']; $ts_list[$count]['img_url'] = $details['avtar_url'] != 'None' ? $details['avtar_url'] : 0; } } $count++; } if ($content['next'] != '') { $str = str_replace("page", "@!##", $content['next']); $str_arr = explode('@!##=', $str); $next = explode('&', $str_arr[1]); $ts_list['next'] = $next[0]; } else { $ts_list['next'] = ''; } //$ts_list['error'] = false; $ts_list['count'] = $count; echo json_encode($ts_list); exit; } else { $ts_list = ''; echo json_encode($ts_list); // no data found exit; } } else { $ts_list = array('next' => '', 'count' => ''); } echo json_encode($ts_list); exit; } else { // getting banners $common = new Common(); $banners = $common->getBanner($api_url, 8); return new ViewModel(array('banners' => $banners)); } }
public function practitionerAction() { $common = new Common(); $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; $faqs = $common->getFaqs($api_url, 3); $banners = $common->getBanner($api_url, 15); return new ViewModel(array('faqs' => $faqs, 'banners' => $banners)); }
public function indexAction() { $api = new Api(); $common = new Common(); $api_url = $this->getServiceLocator()->get('Config')['api_url']['value']; //Start:-- Search form $session = new Container('frontend'); $loggedInUser = $session->userid; $userType = $session->user_type_id; $model_practitioner = new Practitioners(); $loggedInUserAddress = $model_practitioner->getLoggedInUserAddress($loggedInUser, $userType, $api_url); $treatment_list = $common->getAllservices($api_url); $search_form = new SearchForm($treatment_list, $common->getstatesByCountry($api_url, $loggedInUserAddress->country_id)); // getting banners $banners = $common->getBanner($api_url, 1); //End:-- Search form $page1 = $common->getPage($api_url, 7); $page2 = $common->getPage($api_url, 8); $page3 = $common->getPage($api_url, 9); $page4 = $common->getMedia($api_url); $banner_content = $common->getPage($api_url, 13); $data = array('page1' => stripcslashes($page1), 'page2' => stripcslashes($page2), 'page3' => stripcslashes($page3), 'page4' => $page4, 'search_form' => $search_form, 'banners' => $banners, 'banner_content' => $banner_content); return new ViewModel($data); }
public function invoiceAction() { $id = (int) $this->params()->fromRoute('id', 0); if (!$id) { return $this->redirect()->toRoute('home'); } $auth = new FrontEndAuth(); $bookingModel = new Bookings(); $consumers = new Consumers(); $common = new Common(); $practitioners = new Practitioners(); $session = new Container('frontend'); $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; if ($auth->hasIdentity(3)) { // service provider invoice $data = $bookingModel->getBookings($api_url, '', '', '', '', '', '', $id, 'subscription'); $userDetails = $practitioners->getSPDetails($api_url, $session->userid); } else { return $this->redirect()->toRoute('home'); } $userDetails['address'] = json_decode($userDetails['address'][0], true); $userDetails['contact'] = json_decode($userDetails['contact'][0], true); //print_r($userDetails['address']); exit; if (isset($data['results']) && count($data['results']) == 1) { if ($this->getRequest()->getQuery('print') == 1) { $view = new viewModel(array('booking_details' => $data['results'], 'user_details' => $userDetails)); $view->setTemplate('application/membership/printinvoice.phtml'); $printData = $this->getServiceLocator()->get('viewrenderer')->render($view); // Store in PDF format $dompdf = new \DOMPDF(); $dompdf->load_html($printData); $dompdf->render(); $dompdf->stream('invoice.pdf', array('Attachment' => 0)); exit; } else { $banners = $common->getBanner($api_url, 16); return new viewModel(array('booking_details' => $data['results'], 'user_details' => $userDetails, 'id' => $id, 'banners' => $banners)); } } else { return $this->redirect()->toRoute('home'); } return new viewModel($this->invoicedetails()); }
public function indexAction() { $auth = new FrontEndAuth(); if (!$auth->hasIdentity()) { return $this->redirect()->toRoute('login', array('action' => 'index')); } $form = new VerificationForm(); $common = new Common(); $api_url = $this->getServiceLocator()->get('Config')['api_url']['value']; $session = new Container('frontend'); if ($session->user_type_id == 3) { $api_url = $this->getServiceLocator()->get('Config')['api_url']['value']; $subscriptionDetails = $common->getSubscriptiondetails($api_url, '', true); if (!isset($subscriptionDetails['features']) || !is_array($subscriptionDetails['features']) || !in_array(4, $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')); } } /* $getvalue = $this->checkuserexistence(); $msg=''; $class =''; if(count($getvalue)>0){ foreach($getvalue as $data){ // Email id condition if($data['verification_type_id']==1){ // already verified or verification code recieve (verification pending) $flag = ($data['verification_status']==1)?2:1; $msg = ($flag ==2)?"Your email id already verified":"Verified code already send on your registered email id. Please check it to get verified code"; $class = ($flag ==2)?"success-msg":"error-msg"; } else{ // For new user $flag = 3; } // Contact number condition if($data['verification_type_id']==2){ // already verified $noflag = ($data['verification_status']==1)?2:1; $msg = ($noflag ==2)?"Your number already verified":"Verified code already send on your registered number. Please check it to get verified code"; $class = ($flag ==2)?"success-msg":"error-msg"; } else{ // For new user $noflag = 3; } } }else{ // For new user $flag = 3; } */ // getting banners $banners = $common->getBanner($api_url, 17); $view = new ViewModel(array('form' => $form, 'flag' => $flag, 'noflag' => $noflag, 'msg' => $msg, 'class' => $class, 'banners' => $banners)); return $view; }
public function transactionsAction() { $api = new Api(); $trans = new Transactions(); $model = new Practitioners(); $common = new Common(); $bookingModel = new Bookings(); $session = new Container('frontend'); $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; $request = $this->getRequest(); if ($request->isPost()) { $page = $request->getPost('page'); $recordsPerPage = $request->getPost('items'); switch ($request->getPost('action')) { case 'subscriptions': $subscriptions = $bookingModel->getBookings($api_url, '', $session->userid, '', $page, $recordsPerPage, '', '', 'subscription'); echo json_encode($subscriptions['results']); break; case 'bookings': $bookings = $bookingModel->getBookings($api_url, $session->userid, '', '', $page, $recordsPerPage); echo json_encode($bookings['results']); break; } exit; } $auth = new FrontEndAuth(); if (!$auth->hasIdentity(3)) { return $this->redirect()->toRoute('login', array('action' => 'index')); } $res = $api->curl($api_url . "/api/spusers/" . $session->userid . "/", array(''), "GET"); if ($res->getStatusCode() != 200) { return $this->redirect()->toRoute('practitioner', array('action' => 'list')); } $data = $this->getSpdata($res); // getting banner for this page $banners = $common->getBanner($api_url, 4); return new ViewModel(array('user_id' => $session->userid, 'content' => $data['content'], 'notifications' => $model->getNotifications($api_url), 'booking_total' => $bookingModel->getBookings($api_url, $session->userid)['count'], 'subs_total' => $bookingModel->getBookings($api_url, '', $session->userid, '', '', '', '', '', 'subscription')['count'], 'banners' => $banners)); }
public function ratingsAction() { $id = $this->params()->fromRoute('id'); $getparams = $this->getRequest()->getQuery(); if (!empty($id) && $id != null && $id != "") { $auth = new FrontEndAuth(); if (!$auth->hasIdentity(4)) { return $this->redirect()->toUrl('/login'); } $ratingType = array(); $ratingData = array(); $session = new Container('frontend'); $model = new Practitioners(); $bookingModel = new Bookings(); $common = new Common(); $api = new Api(); $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; $reviewFlag = false; $user_id = $session->userid; if (isset($getparams['review']) && $getparams['review'] == 1 && isset($getparams['s_id'])) { // check service $serivce_id = $getparams['s_id']; $sp_id = $id; $result = $bookingModel->getBookings($api_url, $sp_id, $user_id, '4', "", "", $serivce_id); $reviewFlag = $model->setreviewFlg($result); //get service provider details $sp_res = $api->curl($api_url . "/api/spusers/" . $sp_id . "/", array(), "GET"); if ($sp_res->getStatusCode() == 200) { $spData = json_decode($sp_res->getBody(), true); } } if ($reviewFlag == true) { //get previous ratings $ratings_data_res = $api->curl($api_url . "/api/rating/", array("users_id" => $id, "service_id" => $serivce_id, "created_by" => $user_id), "GET"); if ($ratings_data_res->getStatusCode() == 200) { $ratingData = json_decode($ratings_data_res->getBody(), true); } //Check if rating data exits otherwise send $ratingType for fresh reviews. if (empty($ratingData)) { if (empty($ratingData)) { $rating_res = $api->curl($api_url . "/api/ratingtype/", array("status_id" => 1), "GET"); if ($rating_res->getStatusCode() == 200) { $ratingType = json_decode($rating_res->getBody(), true); } } } } else { return $this->redirect()->toUrl('/consumer/dashboard'); } } else { return $this->redirect()->toUrl('/consumer/dashboard'); } // getting banner for this page $banners = $common->getBanner($api_url, 5); return new viewModel(array("ratingType" => $ratingType, "ratingData" => $ratingData, "spData" => $spData, "service_id" => $serivce_id, 'banners' => $banners)); }
public function indexAction() { $contact_form = new ContactForm(); $request = $this->getRequest(); $common = new Common(); $api_url = $this->getServiceLocator()->get('Config')['api_url']['value']; if ($request->isXmlHttpRequest()) { $email = $request->getPost('email') != '' ? $request->getPost('email') : ''; $first_name = $request->getPost('first_name') != '' ? $request->getPost('first_name') : ''; $last_name = $request->getPost('last_name') != '' ? $request->getPost('last_name') : ''; $message = $request->getPost('message') != '' ? $request->getPost('message') : ''; $phone = $request->getPost('phone') != '' ? $request->getPost('phone') : ''; /* $api = new Api(); $url = $api_url."/api/contactus/"; $data = array('email' => $email, 'first_name'=> $first_name, 'last_name'=> $last_name, 'phone'=> $phone, 'message'=> $message ); $res = $api->curl($url, $data, "POST"); if($res->getStatusCode() == 200){ $msgbody = json_decode($res->getBody(), true); }else { $msgbody = ''; } */ $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; $consumer = new Consumers(); // Start :- Get admin email id $res = $consumer->getConsumerdetails($api_url, 1); if (count($res) > 0) { $adminEmailId = $res['email']; } if ($common->sendMail($api_url, $adminEmailId, $email, 23, '', array('/{{first_name}}/i', '/{{user_name}}/i', '/{{email}}/i', '/{{phone}}/i', '/{{message}}/i'), array($first_name, $first_name . " " . $last_name, $email, $phone, $message))) { $error = false; $msg = "Success!! Mail send sucessfully"; } else { $error = true; $msg = "Failed to send mail. Please try again later..!!"; } /* $mail = new Mail\Message(); $mail->setBody($messagebody); $mail->addTo(/*$adminEmailId'*****@*****.**', 'Name of recipient'); $mail->setSubject('An ovessence visitor whants to contact you.'); $transport = new Mail\Transport\Sendmail(); if($transport->send($mail)){ $msg = "Success!! Mail send sucessfully"; }else{ $error = true; $msg = "Error!! Unable to contact."; } */ echo json_encode(array('error' => $error, 'msg' => $msg)); exit; } $api = new Api(); $response = $api->curl($api_url . '/api/pages/3/', array(), "GET"); $content = '{{form}}'; if ($response->getStatusCode() == 200) { $data = json_decode($response->getBody(), true); $content = $data['content']; } $banners = $common->getBanner($api_url, 7); return new ViewModel(array('form' => $contact_form, 'content' => $content, 'banners' => $banners)); }