function view() { $osool_contact_usModel = new osool_contact_usModel(); $current_osool_contact_us = $osool_contact_usModel->get_by_id(1); $view = new viewModel('osool_contact_us'); $view->assign('current_osool_contact_us', $current_osool_contact_us); }
public function index() { if (isset($_POST['smt_go'])) { $name = $_POST['txt_name']; $email1 = $_POST['txt_email1']; $email2 = $_POST['txt_email2']; $email3 = $_POST['txt_email3']; $email4 = $_POST['txt_email4']; $email5 = $_POST['txt_email5']; $view = new viewModel('result'); if (isset($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else { $lang = 'en'; } if ($lang == 'ar') { $message = "تم ارسال الموقع لجميع اصدقائك بنجاح"; } else { $message = "The Website sended to your friends successfully."; } $view->assign('message', $message); die; } else { $view = new viewModel('tell_friends'); } }
public function delete($id) { $business_fieldModel = new business_fieldModel(); $business_fieldModel->delete($id); $business_fields = $business_fieldModel->get_all(); $view = new viewModel('business_field'); $view->assign('business_fields', $business_fields); }
public function delete($id) { $osool_messagesModel = new osool_messagesModel(); $osool_messagesModel->delete($id); $osool_messagess = $osool_messagesModel->get_all(); $view = new viewModel('admin/osool_messages'); $view->assign('osool_messagess', $osool_messagess); }
public function action() { //页面展示 $viewModel = new viewModel(); $result = $viewModel->getResult(); $info = $result['info']['article'][0]; $reply = $result['info']['reply']; // $like = $result['info']['like'][0]; $this->tpl->assign('reply', $reply); $this->tpl->assign('info', $info); //$this->tpl->assign('like',$like); $this->tpl->display('view.tpl'); }
/** * 抢单的任务详情 */ public function grabAction() { //获取抢单ID $workId = $this->params()->fromRoute('id'); //获取我的workerId $workerId = '1'; //验证是否有此ID,并获取详细信息 $work_info = $this->_verfiy_workID($workId); if (empty($work_info)) { //跳回原来的页面 return $this->redirect()->toRoute('mygrab', array('status' => 'notfoundid')); } /*判断是否已经抢单,如果抢了就输出抢的信息*/ $view = new viewModel(); //post标记 $flat_post = $this->getRequest()->isPost(); //验证是否抢过单了 $grab_data = $this->_verfig_grabed($workId, $workerId); if (!empty($grab_data)) { //标记已经抢过了 $view->setVariable('workstatus', 'grabed'); if ($flat_post) { $view->setVariable('error', '已经抢过了'); } } else { // 没抢单,判断是否过期 if ($work_info->getWorkJointime() > time() && $work_info->getWorkStatus() == '0') { $view->setVariable('workstatus', 'grab'); if ($flat_post) { //枪单流程 if ($this->_grab_work($this->getRequest()->getPost(), $workId)) { $view->setVariable('workstatus', 'grabed'); $view->setVariable('error', '抢单成功'); } else { $view->setVariable('error', '抢单失败'); } } } else { $view->setVariable('workstatus', 'over'); if ($flat_post) { $view->setVariable('error', '已经过期了'); } } } //输出一个表单 $view->setVariable('form', new GrabForm()); $view->setVariable('workgrab', $grab_data); $view->setVariable('workinfo', $work_info); return $view; }
public function jsonmapasaAction() { $distrit = $this->params()->fromQuery('distrito'); $view = new viewModel(); $view->setTerminal(true); $valor1 = explode(',', $distrit); $distrito = $valor1[0]; $texto = $this->params()->fromQuery('q'); setcookie('distrito', $distrito); $valor = explode(" ", $texto); if ($valor[0] == 'restaurante:') { $buscar = $valor[1] . ' ' . $valor[2] . ' ' . $valor[3] . ' ' . $valor[4]; $plato = $valor[0] . '"' . $buscar . '"'; } elseif ($valor[0] == 'tag:') { $buscar = $valor[1] . ' ' . $valor[2] . ' ' . $valor[3]; $plato = $valor[0] . '"' . $buscar . '"'; } elseif ($valor[0] == 'name:') { $buscar = $valor[1] . ' ' . $valor[2] . ' ' . $valor[3] . ' ' . $valor[4]; $plato = $valor[0] . '"' . $buscar . '"'; } else { $filter = new \Zend\I18n\Filter\Alnum(true); $plato = $filter->filter($texto); setcookie('q', $texto); } if ($distrito and $distrito != 'LIMA') { $distrit = '"' . $distrito . '"'; $resultados = false; $palabraBuscar = isset($plato) ? $plato : false; $list = 1000; $fd = array('fq' => 'en_estado:activo AND restaurant_estado:activo AND distrito:' . strtoupper($distrito), 'fl' => 'id,latitud,longitud,tx_descripcion,va_imagen,restaurante_estado,restaurante,name,plato_tipo,distrito', 'wt' => 'json'); if ($palabraBuscar) { $solar = \Classes\Solr::getInstance()->getSolr(); if (get_magic_quotes_gpc() == 1) { $palabraBuscar = stripslashes($palabraBuscar); } try { $resultados = $solar->search($palabraBuscar, 0, $list, $fd); } catch (Exception $e) { die("<html><head><title>SEARCH EXCEPTION</title><body><pre>{$e->__toString()}</pre></body></html>"); } } } elseif ($distrito == 'LIMA') { $limite = 1000; $resultados = false; $palabraBuscar = isset($plato) ? $plato : false; $fd = array('fq' => 'en_estado:activo AND restaurant_estado:activo AND departamento:' . strtoupper($distrito), 'fl' => 'id,latitud,longitud,tx_descripcion,va_imagen,restaurante_estado,restaurante,name,plato_tipo,distrito', 'wt' => 'json'); if ($palabraBuscar) { $solar = \Classes\Solr::getInstance()->getSolr(); if (get_magic_quotes_gpc() == 1) { $palabraBuscar = stripslashes($palabraBuscar); } try { $resultados = $solar->search($palabraBuscar, 0, $limite, $fd); // var_dump($resultados);exit; } catch (Exception $e) { $this->redirect()->toUrl('/'); } } } else { $limite = 1000; // $distrito= '"LIMA"'; $resultados = false; $palabraBuscar = isset($plato) ? $plato : false; $fd = array('fq' => 'en_estado:activo AND restaurant_estado:activo ', 'fl' => 'id,latitud,longitud,tx_descripcion,va_imagen,restaurante_estado,restaurante,name,plato_tipo,distrito', 'wt' => 'json'); if ($palabraBuscar) { $solar = \Classes\Solr::getInstance()->getSolr(); if (get_magic_quotes_gpc() == 1) { $palabraBuscar = stripslashes($palabraBuscar); } try { $resultados = $solar->search($palabraBuscar, 0, $limite, $fd); // var_dump($resultados);exit; } catch (Exception $e) { $this->redirect()->toUrl('/'); } } } echo $resultados->getRawResponse(); exit; }
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="css/style.css"> <link href='http://fonts.googleapis.com/css?family=Lekton' rel='stylesheet' type='text/css'> </head> <body> <?php require_once "models/viewModel.php"; $views = new viewModel(); $views->getView("views/header.html"); $views->getView("views/home.html"); $views->getView("views/footer.html"); ?> </body> </html>
<h1>First Day</h1> <?php require_once "models/view_model.php"; $views = new viewModel(); $views->getView("views/header.html");
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 updateAction() { $request = $this->getRequest(); if ($request->isPost()) { $action = $request->getPost('action'); $api = new Api(); $common = new Common(); $model = new Practitioners(); $bookingModel = new Bookings(); $session = new Container('frontend'); $user_id = $session->userid; $api_url = $this->getServiceLocator()->get('config')['api_url']['value']; switch ($action) { case 'name': $contact_data['user_id'] = $user_id; $contact_data = $user_data = $errors = array(); $contact_id = $request->getPost('contact_id'); $full_name = explode(' ', trim($request->getPost('practitioner_name'))); isset($full_name[0]) && $full_name[0] != '' ? $contact_data['first_name'] = $user_data['first_name'] = ucfirst($full_name[0]) : ''; isset($full_name[1]) && $full_name[1] != '' ? $contact_data['last_name'] = $user_data['last_name'] = ucfirst($full_name[1]) : ($contact_data['last_name'] = $user_data['last_name'] = ''); $result = $model->updateContact($api_url, $contact_data, $contact_id); if ($result == true) { $result = $model->updateData($api_url, $user_data, $user_id); if ($result == true) { echo json_encode(array('status' => 1, 'msg' => 'Name successfully updated..!!')); } else { if (is_array($result)) { echo json_encode(array('status' => 0, 'errors' => $result)); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to update name..!!')); } } } else { if (is_array($result)) { echo json_encode(array('status' => 0, 'errors' => $result)); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to update name..!!')); } } break; case 'profile': $details_data = $address_data = array(); $address_data['user_id'] = $details_data['user_id'] = $user_id; $address_data['user_type'] = ''; $detail_id = $request->getQuery('detail_id'); $address_id = $request->getQuery('address_id'); trim($request->getQuery('designation')) != "" ? $details_data['designation'] = trim($request->getQuery('designation')) : ''; trim($request->getQuery('company_name')) != "" ? $details_data['company_name'] = trim($request->getQuery('company_name')) : ''; trim($request->getQuery('dob')) != "" ? $details_data['dob'] = date('Y-m-d', strtotime(trim($request->getQuery('dob')))) : ''; trim($request->getQuery('specialties')) != "" ? $details_data['specialties'] = trim($request->getQuery('specialties')) : ''; trim($request->getQuery('degrees')) != "" ? $details_data['degrees'] = trim($request->getQuery('degrees')) : ''; trim($request->getQuery('years_of_experience')) != "" ? $details_data['years_of_experience'] = str_replace(' Years', '', trim($request->getQuery('years_of_experience'))) : ''; trim($request->getQuery('prof_membership')) != "" ? $details_data['prof_membership'] = trim($request->getQuery('prof_membership')) : ''; trim($request->getQuery('professional_license_number')) != "" ? $details_data['professional_license_number'] = trim($request->getQuery('professional_license_number')) : ''; trim($request->getQuery('awards_and_publication')) != "" ? $details_data['awards_and_publication'] = trim($request->getQuery('awards_and_publication')) : ''; trim($request->getQuery('auth_to_bill_insurence_copany')) != "" ? $details_data['auth_to_bill_insurence_copany'] = trim($request->getQuery('auth_to_bill_insurence_copany')) : ''; trim($request->getQuery('auth_to_issue_insurence_rem_receipt')) != "" ? $details_data['auth_to_issue_insurence_rem_receipt'] = trim($request->getQuery('auth_to_issue_insurence_rem_receipt')) : ''; trim($request->getQuery('treatment_for_physically_disabled_person')) != "" ? $details_data['treatment_for_physically_disabled_person'] = trim($request->getQuery('treatment_for_physically_disabled_person')) : ''; trim($request->getQuery('offering_at_home')) != "" ? $details_data['offering_at_home'] = trim($request->getQuery('offering_at_home')) : ''; trim($request->getQuery('offering_at_work_office')) != "" ? $details_data['offering_at_work_office'] = trim($request->getQuery('offering_at_work_office')) : ''; trim($request->getQuery('age')) != "" ? $user_data['age'] = trim($request->getQuery('age')) : ''; trim($request->getQuery('gender')) != "" ? $user_data['gender'] = trim($request->getQuery('gender')) : ''; // Updating languges if ($model->updateLanguages($api_url, $user_id, $request->getQuery('language'))) { // Updating educations if ($model->updateEducations($api_url, $user_id, $request->getQuery('education'))) { // Updating practitioner details $result = $model->updateDetails($api_url, $details_data, $detail_id); if ($result['status'] == 1) { // Updating practitioner address $res = $model->updateData($api_url, $user_data, $user_id); if ($res == true) { echo json_encode(array('status' => 1, 'msg' => 'Profile updated successfully..!!', 'data' => array('detail_id' => $result['id'], 'address_id' => $response['id']))); } else { if (is_array($res)) { echo json_encode(array('status' => 0, 'errors' => $res)); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to update profile..!!')); } } } else { echo json_encode($result); } } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to update languages..!!')); } } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to update languages..!!')); } break; case 'about': $details_data = array(); $details_data['user_id'] = $user_id; $detail_id = $request->getQuery('detail_id'); trim($request->getQuery('description')) != "" ? $details_data['description'] = addslashes(trim(str_replace(array("\r", "\n"), '', nl2br($request->getQuery('description'))))) : ''; echo json_encode($model->updateDetails($api_url, $details_data, $detail_id)); break; case 'contact': $contact_data = array(); $contact_data['user_id'] = $user_id; $contact_id = $request->getQuery('contact_id'); trim($request->getQuery('cellphone')) != "" ? $contact_data['cellphone'] = trim($request->getQuery('cellphone')) : ''; trim($request->getQuery('phone_number')) != "" ? $contact_data['phone_number'] = trim($request->getQuery('phone_number')) : ''; if (isset($contact_data['cellphone']) && $contact_data['cellphone'] != '' && !preg_match('/^\\d{11}$/', $contact_data['cellphone'])) { echo json_encode(array('status' => 0, 'msg' => 'Main phone number should be 11 digit number (1 as a prefix and 10 digit phone number)..!!')); } elseif (isset($contact_data['phone_number']) && $contact_data['phone_number'] != '' && !preg_match('/^\\d{11}$/', $contact_data['phone_number'])) { echo json_encode(array('status' => 0, 'msg' => 'Office phone number should be 11 digit number (1 as a prefix and 10 digit phone number)..!!')); } else { echo json_encode($model->updateContact($api_url, $contact_data, $contact_id)); } break; case 'organization': echo json_encode($model->updateOrganization($api_url, $user_id, $request->getQuery('organization'))); break; case 'location_type': echo json_encode($model->updateLocationTypes($api_url, $user_id, $request->getQuery('location_types'))); break; case 'image': $File = $this->params()->fromFiles('image'); if ($File['error'] == 0 && $File['size'] > 0) { $S3 = new ImageS3(); $data = $S3->uploadFiles($_FILES['image'], "Media", array(), array('Media' => 100, 'Media_thumb' => '138x108\\>\\!')); if (is_array($data) && count($data) > 0) { $imageData = array(); $imageData['user_id'] = $user_id; $imageData['media_url'] = $data['Media']; $imageData['media_type'] = 1; $imageData['media_title'] = trim($request->getPost('media_title')); //$imageData['media_description'] = addslashes(trim($request->getPost('media_description'))); $imageData['media_description'] = addslashes(trim($request->getPost('media_title'))); $imageData['created_by'] = $user_id; $imageData['updated_date'] = date('Y-m-d h:i:s'); $imageData['updated_by'] = $user_id; $imageData['status_id'] = 5; if ($request->getPost('id') != "") { $res = $api->curl($api_url . "/api/media/" . $request->getPost('id') . "/", $imageData, "PUT"); } else { $res = $api->curl($api_url . "/api/media/", $imageData, "POST"); } if ($res->getStatusCode() == 200 || $res->getStatusCode() == 201) { $image_res = json_decode($res->getBody(), true); echo json_encode(array('status' => 1, 'msg' => 'Image uploaded successfully..!!', 'id' => $image_res['id'], 'title' => $image_res['media_title'], 'media_description' => $image_res['media_description'], 'url' => $data['Media_thumb'])); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to upload image..!!', 'code' => $res)); } } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to upload image on server..!!', 'code' => $File)); } } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to upload image..!!', 'code' => $File)); } break; case 'avtar': $id = $request->getPost('image'); if ($user_id != "" && $id != "") { $media_res = $api->curl($api_url . "/api/media/" . $id . "/", array(), "GET"); if ($media_res->getStatusCode() == 200) { $media = json_decode($media_res->getBody(), true); $file = explode('/', $media['media_url']); $fileName = "./public/uploads/" . end($file); file_put_contents($fileName, fopen($media['media_url'], 'r')); try { $S3 = new ImageS3(); $data = $S3->uploadFile($fileName, array('Avtars' => '378x378')); } catch (\Exception $e) { echo json_encode(array('status' => 0, 'msg' => 'Failed to update avtar image..!!')); exit; } $temp = $api->curl($api_url . "/api/spusers/" . $user_id . "/", array(), "GET"); $avtar = json_decode($temp->getBody(), true); $avtar['avtar_url'] != '' ? $S3->deleteFile(str_replace('https://ovessence.s3.amazonaws.com/', '', $avtar['avtar_url'])) : ''; $res = $api->curl($api_url . "/api/spusers/" . $user_id . "/", array('avtar_url' => $data['Avtars'], 'user_type_id' => 3), "PUT"); if ($res->getStatusCode() == 200 || $res->getStatusCode() == 201) { echo json_encode(array('status' => 1, 'msg' => 'Avtar image changed successfully..!!', 'image_url' => $data['Avtars'])); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to update avtar image..!!', 'errors' => json_decode($res->getBody(), true))); } } } break; case 'delete_image': $id = $request->getPost('image'); $media_res = $api->curl($api_url . "/api/media/" . $id . "/", array(), "GET"); if ($media_res->getStatusCode() == 200) { $media = json_decode($media_res->getBody(), true); $del_res = $api->curl($api_url . "/api/media/" . $id . "/", array(), "DELETE"); if ($del_res->getStatusCode() == 204) { $S3 = new ImageS3(); $media['media_url'] != '' ? $S3->deleteFile(str_replace('https://ovessence.s3.amazonaws.com/', '', $media['media_url'])) : ''; echo json_encode(array('status' => 1, 'msg' => 'Image deleted successfully..!!')); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to delete image..!!')); } } else { echo json_encode(array('status' => 0, 'msg' => 'No image found..!!')); } break; case 'delete_video': $id = $request->getPost('video'); $media_res = $api->curl($api_url . "/api/media/" . $id . "/", array(), "GET"); if ($media_res->getStatusCode() == 200) { $media = json_decode($media_res->getBody(), true); $del_res = $api->curl($api_url . "/api/media/" . $id . "/", array(), "DELETE"); if ($del_res->getStatusCode() == 204) { $media['media_url'] != '' ? @unlink($media['media_url']) : ''; echo json_encode(array('status' => 1, 'msg' => 'Video deleted successfully..!!')); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to delete video..!!')); } } else { echo json_encode(array('status' => 0, 'msg' => 'No video found..!!')); } break; case 'delete_avtar': $details = $model->getSPDetails($api_url, $session->userid); if (isset($details['avtar_url']) && $details['avtar_url'] != '') { $S3 = new ImageS3(); $res = $S3->deleteFile(str_replace('https://ovessence.s3.amazonaws.com/', '', $details['avtar_url'])); if ($model->updateData($api_url, array('avtar_url' => ''), $session->userid)) { echo json_encode(array('status' => 1, 'msg' => 'Avtar image deleted successfully..!!', 'code' => $res)); } else { echo json_encode(array('status' => 0, 'msg' => 'Failed to delete avtar image..!!')); } } else { echo json_encode(array('status' => 0, 'msg' => 'No image found..!!')); } break; case 'video': $total = count($model->getSPMedia($api_url, $user_id, 2)); $subscriptionDetails = $common->getSubscriptiondetails($api_url, '', true); $video_limit = $subscriptionDetails['video_limit']['limit']; if ($total < $video_limit) { $renameUpload = new \Zend\Filter\File\RenameUpload(array('target' => "./public/uploads/", 'randomize' => true, 'use_upload_name' => true)); if ($fileDetails = $renameUpload->filter($_FILES['video'])) { $filePath = $fileDetails['tmp_name']; // check video orientation and rotate if needed /* exec("mediainfo ".$fileDetails['tmp_name']." | grep Rotation", $mediaInfo); var_dump($mediaInfo); exit; if (is_array($mediaInfo) && count($mediaInfo)>0) { $tempPath = explode("/", $fileDetails['tmp_name']); $filePath = "./public/uploads/new_".end($tempPath); exec('ffmpeg -i '.$fileDetails['tmp_name'].' -vf "transpose=1" -strict -2 '.$filePath, $output, $response); ($response == '0')?@unlink($fileDetails['tmp_name']):''; } */ $videoData = array(); $videoData['user_id'] = $user_id; $videoData['media_url'] = $filePath; $videoData['media_title'] = trim($request->getPost('media_title')); //$videoData['media_description'] = addslashes(trim($request->getPost('media_description'))); $videoData['media_description'] = addslashes(trim($request->getPost('media_title'))); $videoData['created_by'] = $user_id; $videoData['updated_date'] = date('Y-m-d h:i:s'); $videoData['updated_by'] = $user_id; $videoData['status_id'] = 5; /* $length = exec("ffmpeg -i /var/www/html/ovessence".str_replace('.','',$fileDetails['tmp_name'])." 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//'"); echo var_dump($length); exit; */ echo json_encode($model->updateSPMedia($api_url, $videoData, 2, $request->getPost('id'))); } else { echo json_encode(array('status' => 0, 'msg' => 'Unable to upload video..!!')); } } else { echo json_encode(array('status' => 0, 'msg' => 'You have already uploaded the maximum number of videos (' . $video_limit . ') allowed by your subscription..!!')); } break; case 'workdays': //echo '<pre>'; print_r($request->getQuery()); exit; $id = $request->getQuery('id'); $start_time = $request->getQuery('start_time'); $end_time = $request->getQuery('end_time'); $lunch_start_time = $request->getQuery('lunch_start_time'); $lunch_end_time = $request->getQuery('lunch_end_time'); $address_id = $request->getQuery('address_id'); $mode = 'add'; foreach ($start_time as $key => $value) { $data = array(); $mode = isset($id[$key]) && $id[$key] != '' && $mode == 'add' ? 'edit' : $mode; $data['start_time'] = $value != '' ? date('H:i:s', strtotime($value)) : '00:00:00'; $data['end_time'] = $end_time[$key] != '' ? date('H:i:s', strtotime($end_time[$key])) : '00:00:00'; $data['lunch_start_time'] = $lunch_start_time[$key] != '' ? date('H:i:s', strtotime($lunch_start_time[$key])) : '00:00:00'; $data['lunch_end_time'] = $lunch_end_time[$key] != '' ? date('H:i:s', strtotime($lunch_end_time[$key])) : '00:00:00'; $data['address_id'] = $address_id[$key] != '' ? $address_id[$key] : null; $data['days_id'] = $key; $data['user_id'] = $user_id; if ($mode == 'edit') { $data['id'] = $id[$key] == "" ? $id[$key - 1] + 1 : $id[$key]; $wk_res = $api->curl($api_url . "/api/sp_availability/?user_id=" . $user_id, $data, "PUT"); } else { $wk_res = $api->curl($api_url . "/api/sp_availability/?user_id=" . $user_id, $data, "POST"); } if ($wk_res->getStatusCode() != 200 && $wk_res->getStatusCode() != 201) { echo json_encode(array('status' => 0, 'msg' => 'Failed to update workdays..!!', 'error' => json_decode($wk_res->getBody(), true), 'workdays' => $model->getSPWorkdays($user_id, $api_url))); exit; } } if ($request->getQuery('delay_id') != "") { $delay_res = $api->curl($api_url . "/api/appointment_delay_list/" . $request->getQuery('delay_id') . "/", array('user_id' => $user_id, 'delay_time' => $request->getQuery('appointment_delay')), "PUT"); } else { $delay_res = $api->curl($api_url . "/api/appointment_delay_list/", array('user_id' => $user_id, 'delay_time' => $request->getQuery('appointment_delay')), "POST"); } if ($delay_res->getStatusCode() != 200 && $delay_res->getStatusCode() != 201) { echo json_encode(array('status' => 0, 'msg' => 'Failed to update appointment delay time..!!', 'workdays' => $model->getSPWorkdays($user_id, $api_url))); } else { echo json_encode(array('status' => 1, 'msg' => 'Workdays updated successfully..!!', 'error' => json_decode($wk_res->getBody(), true), 'workdays' => $model->getSPWorkdays($user_id, $api_url))); } break; case 'sp_address': //echo json_encode(array('status' => 0, 'msg' => 'here')); exit; if ($request->getPost('layout') == 'true') { $view = new viewModel(array('states' => $common->getstatesByCountry($api_url), 'countries' => $common->getCountries($api_url), 'location_types' => $model->getLocationTypes($api_url), 'id' => $request->getPost('id'))); $view->setTemplate('application/practitioner/workplaceaddress.phtml'); $printData = $this->getServiceLocator()->get('viewrenderer')->render($view); echo json_encode(array('layout' => $printData)); exit; } $address_data = array(); $address_data['user_type'] = 'sp'; $address_data['user_id'] = $user_id; $address_id = $request->getQuery('address_id'); trim($request->getQuery('street1_address')) != "" ? $address_data['street1_address'] = trim($request->getQuery('street1_address')) : ''; trim($request->getQuery('zip_code')) != "" ? $address_data['zip_code'] = trim($request->getQuery('zip_code')) : ''; trim($request->getQuery('city')) != "" ? $address_data['city'] = trim($request->getQuery('city')) : ''; trim($request->getQuery('country_id')) != "" ? $address_data['country_id'] = trim($request->getQuery('country_id')) : ''; trim($request->getQuery('state_id')) != "" ? $address_data['state_id'] = trim($request->getQuery('state_id')) : ''; trim($request->getQuery('location_type_id')) != "" ? $address_data['location_type_id'] = trim($request->getQuery('location_type_id')) : ''; echo json_encode($model->updateSPAddress($api_url, $address_data, $address_id, $session->userid)); break; case 'remove_sp_address': $address_id = $request->getPost('id'); echo json_encode($model->deleteSPAddress($api_url, $address_id, $session->userid)); break; case 'invite': //if ($request->getPost('user') != "" && $request->getPost('email') != "") { if ($request->getPost('email') != "") { $common = new Common(); if ($template = $common->emailTemplate($api_url, 5)) { $user_details = $model->getSPDetails($api_url, $session->userid); $mail = new Message(); $transport = new \Zend\Mail\Transport\Sendmail(); $html = new MimePart(stripslashes(preg_replace('/{{user_name}}/i', '<strong>' . $user_details['first_name'] . ' ' . $user_details['last_name'] . '</strong>', $template['content']))); $html->type = "text/html"; $body = new MimeMessage(); $body->setParts(array($html)); $mail->setBody($body)->setFrom($template['fromEmail'], 'Ovessence')->addTo($request->getPost('email'), '')->setSubject($template['subject']); $transport->send($mail); echo json_encode(array('status' => 1, 'msg' => 'Invitation sent to the email address..!!')); } else { echo json_encode(array('status' => 0, 'msg' => 'Unable to find mail template..!!')); } } else { echo json_encode(array('status' => 0, 'msg' => 'Unable to send invitation..!!')); } break; } } exit; }
public function autorenewcodeAction($api_url, $common, $detail) { $data = array('user_id' => $detail['user_id'], 'use_for_renew' => 1); $getCardDetails = $common->getUserCardDetails($api_url, $data); $card = end($getCardDetails); // Start:-- Get card details if ($card['creditCardDetails_token'] != '' && $card['customerDetails_id'] != '') { $bookingModel = new Bookings(); $trans = new Transactions(); $model = new Practitioners(); $transaction['amount'] = $detail['price']; //$details['price']; $transaction['creditCardDetails_token'] = $card['creditCardDetails_token']; //$getCardDetails['creditCardDetails_token']; $transaction['customerDetails_id'] = $card['customerDetails_id']; //$getCardDetails['customerDetails_id']; $result = $trans->processPayment($this->getServiceLocator()->get('Config'), $transaction, 1); $user_details = $model->getSPDetails($api_url, $detail['user_id']); // getting use email permissions $subscriptionDetails = $common->getSubscriptiondetails($api_url, $detail['user_id'], true); // getting service provider subscription details $userFeatures = $common->getFeatures($api_url, $detail['user_id']); // If transaction done if ($result['status'] == 1) { $sendMail = 0; // Not send mail // Start :- Get subscription end date if (isset($detail['duration_in'])) { if ($detail['duration_in'] == "1") { // move subs date $selected['duration'] year ahed $new_expireDate = date('Y-m-d', strtotime("+" . $detail['duration'] . " year", strtotime($detail['subscription_end_date']))); } else { if ($detail['duration_in'] == "2") { // move subs date $selected['duration'] month ahed $new_expireDate = date('Y-m-d', strtotime("+" . $detail['duration'] . " month", strtotime($detail['subscription_end_date']))); } else { if ($detail['duration_in'] == "3") { // move subs date $selected['duration'] month ahed $new_expireDate = date('Y-m-d', strtotime("+" . $detail['duration'] . " days", strtotime($detail['subscription_end_date']))); } else { // do nothing } } } } // End :- Get subscription end date $subscriptionData = array(); $subscriptionData['subscription_duration_id'] = $detail['subscription_duration_id']; $subscriptionData['payment_status_id'] = 7; $subscriptionData['site_commision'] = "0"; $subscriptionData['status_id'] = 1; $subscriptionData['user_id'] = $detail['user_id']; $subscriptionData['invoice_total'] = $detail['price']; $subscriptionData['created_by'] = $detail['user_id']; $subscriptionData['invoice_status'] = 1; $subscriptionData['amount'] = $detail['price']; $subscriptionData['currency'] = $detail['currency']; $subscriptionData['payment_date'] = date('Y-m-d H:i:s'); $subscriptionData['amount_paid'] = $detail['price']; $subscriptionData['transaction_id'] = $result['transaction_id']; $subscriptionData['payment_instrument_no'] = '5100'; $subscriptionData['payment_method_id'] = '1'; $subscriptionData['payment_status'] = 7; $subscriptionData['subscription_start_date'] = date('Y-m-d'); $subscriptionData['sale_type'] = 1; $subscriptionData['subscription_end_date'] = $new_expireDate; $response = $bookingModel->addBooking($api_url, $subscriptionData); if ($response['status'] == 1 && isset($response['id'])) { $user_details['address'] = json_decode($user_details['address'][0], true); $user_details['contact'] = json_decode($user_details['contact'][0], true); $data = $bookingModel->getBookings($api_url, '', '', '', '', '', '', $response['id'], 'subscription'); $view = new viewModel(array('booking_details' => $data['results'], 'user_details' => $user_details)); $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(); $output = $dompdf->output(); $attachment = new MimePart($output); $attachment->type = 'application/pdf'; $attachment->filename = 'invoice.pdf'; $attachment->encoding = \Zend\Mime\Mime::ENCODING_BASE64; $attachment->disposition = \Zend\Mime\Mime::DISPOSITION_ATTACHMENT; $patterns = array('/{{user_name}}/i'); $replaces = array('<strong>' . $user_details['first_name'] . ' ' . $user_details['last_name'] . '</strong>'); if (isset($subscriptionDetails['features']) && is_array($subscriptionDetails['features']) && in_array(11, $subscriptionDetails['features']) || $userFeatures['email'] == 1) { $common->sendMail($api_url, $user_details['email'], '', 11, '', $patterns, $replaces, $attachment); } } } else { /* Make entry in failed payment history (pi21jan) */ $check_failedpayArr = array('user_id' => $detail['user_id'], 'date' => date('Y-m-d', strtotime('-3 days'))); $res = $common->check_failed_payment_history($api_url, $check_failedpayArr); if ($res) { // there is a failed payment in last three days then set the subscription to basic one $ongoing_subscription = $common->getSubscriptiondetails($api_url, $detail['user_id']); $common->addSubscription($api_url, array('user_id' => $detail['user_id'], 'id' => $ongoing_subscription[0]['id'])); $delete_arr = array('user_id' => $detail['user_id']); $common->deletefailedpayment($api_url, $delete_arr); } else { $failed_payment_data = array('user_id' => $detail['user_id'], 'sale_type' => '1', 'instrument_no' => '', 'date' => date('Y-m-d H:i:s')); $common->setfailedpayment($api_url, $failed_payment_data); } /* Failed payment code ends here */ $consumer = new Consumers(); // Start :- Get admin email id $res = $consumer->getConsumerdetails($api_url, 1); if (count($res) > 0) { $adminEmailId = $res['email']; } // End :- Get admin email id $pattern = array('/{{user_name}}/i', '/{{subscription_name}}/i', '/{{error_message}}/i'); $replace = array('<strong>' . $user_details['first_name'] . ' ' . $user_details['last_name'] . '</strong>', $detail['subscription_name'], '<strong>Transaction failed with message :- </strong>' . $result['msg']); if (isset($subscriptionDetails['features']) && is_array($subscriptionDetails['features']) && in_array(11, $subscriptionDetails['features']) || $userFeatures['email'] == 1) { $common->sendMail($api_url, $user_details['email'], '', 19, '', $pattern, $replace, '', $adminEmailId); } } } else { /* Make entry in failed payment history (pi21jan) */ $check_failedpayArr = array('user_id' => $detail['user_id'], 'date' => date('Y-m-d', strtotime('-3 days'))); $res = $common->check_failed_payment_history($api_url, $check_failedpayArr); if ($res) { // there is a failed payment in last three days then set the subscription to basic one $ongoing_subscription = $common->getSubscriptiondetails($api_url, $detail['user_id']); $common->addSubscription($api_url, array('user_id' => $detail['user_id'], 'id' => $ongoing_subscription[0]['id'])); $delete_arr = array('user_id' => $detail['user_id']); $common->deletefailedpayment($api_url, $delete_arr); } else { $failed_payment_data = array('user_id' => $detail['user_id'], 'sale_type' => '1', 'instrument_no' => '', 'date' => date('Y-m-d H:i:s')); $common->setfailedpayment($api_url, $failed_payment_data); } /* Failed payment code ends here */ } // End:-- Get card details }
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="css/style.css"> <link href='http://fonts.googleapis.com/css?family=Lekton' rel='stylesheet' type='text/css'> </head> <body> <?php require_once "models/viewModel.php"; $views = new viewModel(); $views->getView("views/header.html"); $views->getView("views/contact.html"); $views->getView("views/footer.html"); ?> </body> </html>
public function edit() { //$id=$_SESSION['company']['id']; $id = 1; $companyModel = new companyModel(); $current_company = $companyModel->get_by_id($id); //$companys = $companyModel->get_all(); $combosModel = new combosModel(); $company_types = $combosModel->get_all_company_type(); $combosModel = new combosModel(); $countrys = $combosModel->get_all_country(); $combosModel = new combosModel(); $cities = $combosModel->get_all_city(1000); $combosModel = new combosModel(); $titles = $combosModel->get_all_title(); $business_fieldModel = new business_fieldModel(); $business_fields = $business_fieldModel->get_all(); $view = new viewModel('company_account'); $view->assign('company_types', $company_types); $view->assign('countrys', $countrys); $city_id = $_POST['cmb_city']; $view->assign('titles', $titles); $view->assign('business_fields', $business_fields); $view->assign('current_company', $current_company); //$view->assign('companys',$companys); }
public function admin_details($id) { $companyModel = new companyModel(); $companys = $companyModel->get_all(); $business_fieldModel = new business_fieldModel(); $business_fields = $business_fieldModel->get_all(); $combosModel = new combosModel(); $countrys = $combosModel->get_all_country(); $combosModel = new combosModel(); $cities = $combosModel->get_all_cities(); $combosModel = new combosModel(); $job_types = $combosModel->get_all_job_type(); $combosModel = new combosModel(); $currencys = $combosModel->get_all_currency(); $combosModel = new combosModel(); $grades = $combosModel->get_all_grade(); $combosModel = new combosModel(); $genders = $combosModel->get_all_gender(); $combosModel = new combosModel(); $positions = $combosModel->get_all_position(); $view = new viewModel('admin/job_details'); $view->assign('companys', $companys); $view->assign('business_fields', $business_fields); $view->assign('countrys', $countrys); $view->assign('cities', $cities); $view->assign('job_types', $job_types); $view->assign('currencys', $currencys); $view->assign('grades', $grades); $view->assign('genders', $genders); $view->assign('positions', $positions); $jobsModel = new jobsModel(); $current_job = $jobsModel->get_by_id($id); $view->assign('current_job', $current_job); }
<?php include 'models/viewModel.php'; echo 'home controller'; $vm = new viewModel(); if (!empty($_GET["action"])) { if ($_GET["action"] == 'home') { $data = array("name" => "orcun"); $vm->getView("views/homeView.php", $data); } else { if ($_GET["action"] == "contact") { $data = array("name" => "contact"); $vm->getView("views/homeView.php", $data); } } } else { $data = array("name" => "orcun"); $vm->getView("views/homeView.php", $data); }
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="css/style.css"> <link href='http://fonts.googleapis.com/css?family=Lekton' rel='stylesheet' type='text/css'> </head> <body> <?php require_once "models/viewModel.php"; $views = new viewModel(); $views->getView("views/header.html"); $views->getView("views/blogs.html"); $views->getView("views/footer.html"); ?> </body> </html>
function jobs() { if (isset($_SESSION['applicant'])) { $applicant_id = $_SESSION['applicant']['id']; $applicantModel = new applicantModel(); $applicant_jobs = $applicantModel->get_applicant_jobs($applicant_id); $view = new viewModel('job_search'); $view->assign('search_jobs', $applicant_jobs); } }