/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $locations = [];
     $experienceLocationDetails = $this->experienceLocation->getExperienceLocationDetails();
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     return view('admin.experiences.locations.index', ['experienceLocationDetails' => $experienceLocationDetails, 'cities' => $cities]);
 }
 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     //echo "sda"; die;
     $RestaurantLocations = $this->repository->getAll();
     //echo "<pre>"; print_r($RestaurantLocations); die;
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     return view('admin.restaurants.locations.index', ['RestaurantLocations' => $RestaurantLocations, 'cities' => $cities]);
 }
예제 #3
0
 public function compose(View $view)
 {
     $view->with('uri', $this->request->path());
     $view->with('currentUser', $this->user);
     $view->with('roles_list', Role::lists('name', 'id'));
     $view->with('user_attributes_list', UserAttributes::lists('name', 'alias'));
     $view->with('restaurant_attributes_list', VendorAttributes::lists('name', 'alias'));
     $view->with('restaurant_locations_list', VendorLocation::wherehas('vendor.vendorType', function ($q) {
         $q->where('type', 'Restaurants');
     })->lists('slug', 'id'));
     $view->with('cities_list', Location::where('Type', 'City')->lists('name', 'id'));
     $view->with('locations_area_list', Location::where('Type', 'Area')->lists('name', 'id'));
     $view->with('cuisines', VendorAttributesSelectOptions::wherehas('attribute', function ($q) {
         $q->where('alias', 'cuisines');
     })->lists('option', 'id'));
     $view->with('_token', $this->encrypter->encrypt(csrf_token()));
     $view->with('media_url', Config::get('media.base_s3_url'));
     $view->with('curator_list', Curator::lists('name', 'id'));
     $view->with('tags_list', Collection::lists('name', 'id'));
     $view->with('flags_list', Flag::lists('name', 'id'));
     $view->with('restaurants_list', DB::table('vendors')->lists('name', 'id'));
     $experienceTypeArray = array('simple', 'complex');
     $view->with('experiences_list', DB::table('products')->whereIn('type', $experienceTypeArray)->lists('name', 'id'));
     $view->with('locations_list', Location::where('Type', 'Locality')->lists('name', 'id'));
     $view->with('price_type_list', PriceType::lists('type_name', 'id'));
     $variant_lists = DB::table('product_variant_options')->lists('variation_name', 'id');
     $view->with('variant_list', $variant_lists);
     $complex_experience_list = DB::table('products')->where('type', "complex")->lists('name', 'id');
     $view->with('complex_experience_list', $complex_experience_list);
     $curators_list = Curator::all()->lists('name', 'id');
     $curatorsList = [];
     foreach ($curators_list as $key => $value) {
         $curatorsList[] = ['id' => $key, 'text' => $value];
     }
     $flags_list = Flag::all()->lists('name', 'id');
     $flagsList = [];
     foreach ($flags_list as $key => $value) {
         $flagsList[] = ['id' => $key, 'text' => $value];
     }
     $restaurants_list = DB::table('vendors')->lists('name', 'id');
     $restaurantsList = [];
     foreach ($restaurants_list as $key => $value) {
         $restaurantsList[] = ['id' => $key, 'text' => $value];
     }
     $localities_list = Location::where('Type', 'Locality')->lists('name', 'id');
     $localitiesList = [];
     foreach ($localities_list as $key => $value) {
         $localitiesList[] = ['id' => $key, 'text' => $value];
     }
     //echo "test".die;
     JavaScript::put(['curatorsList' => $curatorsList, 'flagsList' => $flagsList, 'restaurantsList' => $restaurantsList, 'localitiesList' => $localitiesList]);
 }
 public function alacarteCheckout()
 {
     //echo "<pre>"; print_r(Input::all());
     $dataPost['reservationDate'] = Input::get('booking_date');
     $dataPost['reservationDay'] = date("D", strtotime($dataPost['reservationDate']));
     //
     $dataPost['reservationTime'] = Input::get('booking_time');
     $dataPost['partySize'] = Input::get('qty');
     $dataPost['vendorLocationID'] = Input::get('address');
     $dataPost['guestName'] = Input::get('fullname');
     $dataPost['guestEmail'] = Input::get('email');
     $dataPost['phone'] = Input::get('phone');
     $dataPost['reservationType'] = 'alacarte';
     $dataPost['specialRequest'] = Input::get('special');
     $dataPost['addon'] = Input::get('add_ons');
     $award = Input::get('avard_point');
     $user_email = Input::get('mail');
     $vendor_name = Input::get('vendor_name');
     $userID = Input::get('user_id');
     $userData = Profile::getUserProfileWeb($userID);
     $outlet = $this->alacarte_model->getOutlet($dataPost['vendorLocationID']);
     $locationDetails = $this->alacarte_model->getLocationDetails($dataPost['vendorLocationID']);
     $vendorDetails = $this->alacarterepository->getByRestaurantLocationId($dataPost['vendorLocationID']);
     $getUsersDetails = $this->experiences_model->fetchDetails($userID);
     $getReservationID = '';
     if ($userID > 0) {
         //validating the information submitted by users
         $arrResponse = $this->alacarte_model->validateReservationData($dataPost);
         if ($arrResponse['status'] == 'success') {
             $reservationResponse = $this->alacarte_model->addReservationDetails($dataPost, $userID);
             $rewardsPoints = isset($award) && $award != 0 ? $vendorDetails['attributes']['reward_points_per_reservation'] : 0;
             $bookingsMade = $userData['data']['a_la_carte_reservation'] + 1;
             $type = "new";
             $reservationType = "alacarte";
             $lastOrderId = $reservationResponse['data']['reservationID'];
             Profile::updateReservationInUsers($rewardsPoints, $type, $bookingsMade, $reservationType, $userID, $lastOrderId);
             DB::table('users')->where('id', $userID)->update(array('full_name' => $dataPost['guestName'], 'phone_number' => $dataPost['phone']));
             $getReservationID = $reservationResponse['data']['reservationID'];
             //for the new db structure support
             /*$newDb['attributes']['date'] = date('d-M-Y', strtotime($dataPost['reservationDate']));
               $newDb['attributes']['time'] = date("g:i A", strtotime($dataPost['reservationTime']));*/
             $combined_date_and_time = $dataPost['reservationDate'] . ' ' . $dataPost['reservationTime'];
             $newDb['attributes']['reserv_datetime'] = Carbon::createFromFormat('Y-m-d H:i A', $combined_date_and_time)->toDateTimeString();
             $newDb['attributes']['no_of_people_booked'] = $dataPost['partySize'];
             $newDb['attributes']['cust_name'] = $dataPost['guestName'];
             $newDb['attributes']['email'] = $dataPost['guestEmail'];
             $newDb['attributes']['contact_no'] = $dataPost['phone'];
             $newDb['attributes']['reserv_type'] = "Alacarte";
             $newDb['attributes']['loyalty_points_awarded'] = $rewardsPoints;
             $newDb['attributes']['special_request'] = $dataPost['specialRequest'];
             $newDb['attributes']['experience'] = $outlet->vendor_name . ' - Ala Carte';
             $newDb['attributes']['api_added'] = "Admin Reservation";
             $newDb['attributes']['giu_membership_id'] = $userData['data']['membership_number'];
             $newDb['attributes']['outlet'] = $outlet->name;
             $newDb['attributes']['auto_reservation'] = "Not available";
             $newDb['attributes']['ar_confirmation_id'] = "0";
             $newDb['attributes']['alternate_id'] = 'A' . sprintf("%06d", $reservationResponse['data']['reservationID']);
             $newDb['attributes']['reservation_status_id'] = 1;
             $newDb['userdetails']['user_id'] = $userID;
             $newDb['userdetails']['status'] = 1;
             //print_r($newDb);die;
             $reservDetails = new ReservationDetails();
             $newDbStatus = $reservDetails->updateAttributes($reservationResponse['data']['reservationID'], $newDb);
             $tokens = $reservDetails->pushToRestaurant($reservationResponse['data']['reservationID']);
             $this->restaurantapp->push($reservationResponse['data']['reservationID'], $tokens, true);
             //print_r($newDbStatus);die;
             /*TODO: Add the status of success check and include added_by and transaction_id attributes */
             //die;
             $zoho_data = array('Name' => $dataPost['guestName'], 'Email_ids' => $dataPost['guestEmail'], 'Contact' => $dataPost['phone'], 'Experience_Title' => $outlet->vendor_name . ' - Ala Carte', 'No_of_People' => $dataPost['partySize'], 'Date_of_Visit' => date('d-M-Y', strtotime($dataPost['reservationDate'])), 'Time' => date("g:i A", strtotime($dataPost['reservationTime'])), 'Alternate_ID' => 'A' . sprintf("%06d", $reservationResponse['data']['reservationID']), 'Special_Request' => $dataPost['specialRequest'], 'Type' => "Alacarte", 'API_added' => 'Admin Reservation', 'GIU_Membership_ID' => $userData['data']['membership_number'], 'Outlet' => $outlet->name, 'AR_Confirmation_ID' => '0', 'Auto_Reservation' => 'Not available', 'Calling_option' => 'No');
             //echo "<pre>"; print_r($zoho_data);
             $zoho_res = AdminReservations::zoho_add_booking($zoho_data);
             $zoho_success = $zoho_res->result->form->add->status;
             //echo "<pre>"; print_r($zoho_success); die;
             if ($zoho_success[0] != "Success") {
                 //$this->email->from('*****@*****.**', 'WowTables by GourmetItUp');
                 //$list = array('*****@*****.**', '*****@*****.**', '*****@*****.**');
                 //$this->email->to($list);
                 //$this->email->subject('Urgent: Zoho reservation posting error');
                 $mailbody = 'A' . sprintf("%06d", $reservationResponse['data']['reservationID']) . ' reservation has not been posted to zoho. Please fix manually.<br><br>';
                 $mailbody .= 'Reservation Details<br>';
                 foreach ($zoho_data as $key => $val) {
                     $name = str_replace('_', ' ', $key);
                     $mailbody .= $name . ' ' . $val . '<br>';
                 }
                 Mail::send('site.pages.zoho_posting_error', ['zoho_data' => $mailbody], function ($message) use($zoho_data) {
                     $message->from('*****@*****.**', 'WowTables by GourmetItUp');
                     $message->to('*****@*****.**')->subject('Urgent: Zoho reservation posting error');
                     $message->cc('*****@*****.**', '*****@*****.**', '*****@*****.**');
                 });
             }
             $mergeReservationsArray = array('order_id' => sprintf("%06d", $reservationResponse['data']['reservationID']), 'reservation_date' => date('d-F-Y', strtotime($dataPost['reservationDate'])), 'reservation_time' => date('g:i a', strtotime($dataPost['reservationTime'])), 'venue' => $outlet->vendor_name, 'username' => $dataPost['guestName']);
             //echo "<pre>"; print_r($mergeReservationsArray); die;
             $city_id = $locationDetails->city_id;
             $city_name = Location::where(['Type' => 'City', 'id' => $userData['data']['location_id']])->pluck('name');
             if (empty($city_name)) {
                 $city_name = 'mumbai';
             }
             $city = ucfirst($city_name);
             //Start MailChimp
             if (!empty($getUsersDetails)) {
                 $merge_vars = array('MERGE1' => $dataPost['guestName'], 'MERGE10' => date('m/d/Y'), 'MERGE11' => $userData['data']['a_la_carte_reservation'] + 1, 'MERGE13' => $dataPost['phone'], 'MERGE27' => date("m/d/Y", strtotime($dataPost['reservationDate'])), 'GROUPINGS' => array(array('id' => 9713, 'groups' => [$city])));
                 $this->mailchimp->lists->subscribe($this->listId, ["email" => $dataPost['guestEmail']], $merge_vars, "html", false, true);
                 //$this->mc_api->listSubscribe($list_id, $_POST['email'], $merge_vars,"html",true,true );
             }
             //End MailChimp
             $footerpromotions = DB::select('SELECT efp.link,mrn.file  FROM email_footer_promotions as efp LEFT JOIN media_resized_new as mrn ON mrn.media_id = efp.media_id WHERE efp.show_in_alacarte = 1 AND efp.city_id = ' . $city_id);
             if (isset($user_email) && $user_email != 0) {
                 Mail::send('site.pages.restaurant_reservation', ['location_details' => $locationDetails, 'outlet' => $outlet, 'post_data' => $dataPost, 'productDetails' => $vendorDetails, 'reservationResponse' => $reservationResponse, 'footerPromotions' => !empty($footerpromotions) ? $footerpromotions : ""], function ($message) use($mergeReservationsArray) {
                     $message->from('*****@*****.**', 'WowTables by GourmetItUp');
                     $message->to(Input::get('email'))->subject('Your WowTables Reservation at ' . $mergeReservationsArray['venue']);
                     //$message->cc('*****@*****.**', '*****@*****.**');
                 });
             }
             Mail::send('site.pages.restaurant_reservation', ['location_details' => $locationDetails, 'outlet' => $outlet, 'post_data' => $dataPost, 'productDetails' => $vendorDetails, 'reservationResponse' => $reservationResponse, 'footerPromotions' => !empty($footerpromotions) ? $footerpromotions : ""], function ($message) use($mergeReservationsArray) {
                 $message->from('*****@*****.**', 'WowTables by GourmetItUp');
                 $message->to('*****@*****.**')->subject('NR - #A' . $mergeReservationsArray['order_id'] . ' | ' . $mergeReservationsArray['reservation_date'] . ' , ' . $mergeReservationsArray['reservation_time'] . ' | ' . $mergeReservationsArray['venue'] . ' | ' . $mergeReservationsArray['username']);
                 $message->cc(['*****@*****.**', '*****@*****.**', '*****@*****.**']);
             });
             $result_data = array('full_name' => $dataPost['guestName'], 'email' => $dataPost['guestEmail'], 'phone' => $dataPost['phone'], 'booking_date' => $dataPost['reservationDate'], 'booking_time' => $dataPost['reservationTime'], 'exp_title' => $vendor_name, 'order_id' => 'A' . sprintf("%06d", $reservationResponse['data']['reservationID']));
             echo json_encode($result_data);
         }
     }
 }
예제 #5
0
 /**
  * addReview view details of the user
  *
  * @static  true
  * @access  public
  * @param   post
  * @since   1.0.0
  */
 public function saveReview()
 {
     $user_array = Session::all();
     //$userID =Session::get('id');
     //this code is start in header and footer page.
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $arrResponse['cities'] = $cities;
     $arrResponse['user'] = Auth::user();
     $city_id = Input::get('city');
     $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');
     if (empty($city_name)) {
         $city_name = 'mumbai';
     }
     $arrResponse['allow_guest'] = 'Yes';
     $arrResponse['current_city'] = strtolower($city_name);
     $arrResponse['current_city_id'] = $city_id;
     //this code is start in header and footer page.
     $id = Session::get('id');
     $user_id = Input::get('user_id');
     $rating = Input::get('rating');
     $user_email = Input::get('user_email');
     $member_name = Input::get('member_name');
     $reservid = Input::get('reservid');
     $reservation_type = Input::get('reservation_type');
     $membership_num = Input::get('membership_num');
     $seating_date = Input::get('seating_date');
     $review_para = Input::get('review_para');
     $name_server = Input::get('name_server');
     $service = Input::get('service');
     $suggestion = Input::get('suggestion');
     $exp_name = Input::get('exp_name');
     $city = Input::get('city');
     if ($reservation_type == "experience") {
         $product_id = Input::get('product_id');
         $productReviews = new ProductReviews();
         $productReviews->product_id = $product_id;
         $productReviews->user_id = $user_id;
         $productReviews->reserv_id = $reservid;
         $productReviews->review = $review_para;
         $productReviews->server_name = $name_server;
         $productReviews->service = $service;
         $productReviews->suggestions = $suggestion;
         $productReviews->rating = $rating;
         $productReviews->save();
         /*DB::insert("insert into product_reviews(product_id,user_id,reserv_id,review,server_name,service,suggestions,rating)
           values ('$product_id', '$user_id', '$reservid', '$review_para', '$name_server', '$service', '$suggestion', '$rating')");*/
         //echo 'experience';
     } else {
         if ($reservation_type == "alacarte") {
             $vendor_location_id = Input::get('vendor_location_id');
             $vendorLocationReview = new VendorLocationsReviews();
             $vendorLocationReview->vendor_location_id = $vendor_location_id;
             $vendorLocationReview->user_id = $user_id;
             $vendorLocationReview->reserv_id = $reservid;
             $vendorLocationReview->review = $review_para;
             $vendorLocationReview->server_name = $name_server;
             $vendorLocationReview->service = $service;
             $vendorLocationReview->suggestions = $suggestion;
             $vendorLocationReview->rating = $rating;
             $vendorLocationReview->save();
             /*DB::insert("insert into vendor_location_reviews(vendor_location_id,user_id,reserv_id,review,server_name,service,suggestions,rating)
               values ('$vendor_location_id', '$user_id', '$reservid', '$review_para', '$name_server', '$service', '$suggestion', '$rating')");*/
             //echo 'alacarte';
         }
     }
     $add_points = 500;
     DB::update('UPDATE users SET points_earned = points_earned + ' . $add_points . ' WHERE id = ' . $user_id);
     Mail::send('site.pages.review_mail_user', ['member_name' => $member_name, 'email_id' => $user_email, 'exp_name' => $exp_name, 'rating' => $rating, 'review_para' => $review_para, 'name_server' => $name_server, 'service' => $service, 'suggestion' => $suggestion, 'membership_num' => $membership_num], function ($message) use($exp_name, $member_name) {
         $message->from('*****@*****.**', 'WowTables by GourmetItUp');
         $message->to('*****@*****.**')->subject(' New Feedback on ' . $exp_name . ' by ' . $member_name . '');
         $message->cc(['*****@*****.**', '*****@*****.**']);
     });
     $page_text = "<center><h2>Thank you for your review.</h2></center>";
     $page_text .= "<p>Dear " . ucfirst($member_name) . ",</p>";
     //if review is 1 or 2
     if ($rating == 1 || $rating == 2) {
         $page_text .= "<p>Thank you for your review. Your Gourmet Points have been added to your account.</p>";
         $page_text .= "<p>We are sorry you did not have a satisfactory dining experience. WowTables is dedicated to doing everything possible to make sure you enjoy our services and restaurants.</p>";
         $page_text .= "<p>Our concierge desk will be contacting you by phone or email to understand the issue better so that we can attempt to resolve it, convey the feedback to the restaurant's management and improve the experience for the next time. You can also reach out to our concierge desk at anytime by emailing <a href='mailto:concierge@wowtables.com'>concierge@wowtables.com</a> or by calling 09619551387.</p>";
         $page_text .= "<p>Our member feedback is reviewed by me personally every week. However if you wish to reach out to me directly, my personal email address is <a href='mailto:kunal@wowtables.com'>kunal@wowtables.com</a>.</p>";
         $page_text .= "<p>Thanks again and we assure you a better experience next time!</p>";
         $page_text .= "<p>Regards,<br/>Kunal Jain<br/>Co-founder - WowTables</p>";
     } else {
         if ($rating == 3) {
             //if review is 3
             $page_text .= "<p>Thank you for your review. Your Gourmet Points have been added to your account.</p>";
             if ($reservation_type == "experience") {
                 $page_text .= "<p>All member feedback is reviewed by the WowTables founding team personally and used to continuously improve our experiences and services. </p>";
             }
             $page_text .= "<p>Thanks again and we assure you a better experience next time!</p>";
             $page_text .= "<p>Regards,<br/>The WowTables Team</p>";
         } else {
             if ($rating == 4 || $rating == 5) {
                 //if review is 4 or 5
                 $page_text .= "<p>Thank you for your review. Your Gourmet Points have been added to your account.</p>";
                 $page_text .= "<p>We're glad that you had a good experience with WowTables and look forward to seeing you again!</p>";
                 if ($reservation_type == "experience") {
                     $page_text .= "<p>P.S. Help us grow by posting this review on social media & external review sites. Don't forget to mention that others can access this experience through the Wowtables website! </p>";
                     $page_text .= "<p>Send us a screenshot at <a href='mailto:concierge@wowtables.com'>concierge@wowtables.com</a> and we'll send you a Rs. 500 WowTables gift card for your next experience! </p>";
                 } else {
                     if ($reservation_type == "alacarte") {
                         $page_text .= "<p>P.S. Help us grow by posting this review on social media & external reveiw sites. Do mention our reservations services and send us a screenshot to get a Rs. 500 gift card towards your next experience reservation. Thanks!</p>";
                     }
                 }
                 $page_text .= "<p>Thanks again and we assure you a better experience next time!</p>";
                 $page_text .= "<p>Regards,<br/>The WowTables Team</p>";
             }
         }
     }
     $page_text .= "<p class='text-center lead'>\n                                <a class='btn btn-warning' href='" . URL::to('/') . '/' . $city . "'>Return to experiences</a>\n                           </p>";
     return view('frontend.pages.thankyou_addreview', $arrResponse)->with('page_text', $page_text);
 }
예제 #6
0
 public function thankyou($response)
 {
     //echo "orderid == ".$orderID;
     $result1 = Session::get('response');
     session_start();
     $result = $_SESSION["result"] = $result1;
     $data['current_city'] = $result['current_city'];
     $data['current_city_id'] = $result['current_city_id'];
     $data['user'] = Auth::user();
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $data['cities'] = $cities;
     return view('frontend.pages.alacarte_thankyou', $data, ['result' => $result]);
     //echo "dsf<pre>"; print_r($result); echo "asc<pre>";
 }
 /**
  * Handles requst for displaying the complete_signup.
  * record of the logged in user.
  * 
  * @access	public
  * @param	string	$access_token
  * @return	response
  * @since	1.0.0
  */
 public function completeSignup()
 {
     $data = array('email' => $_GET['email'], 'phone' => $_GET['phone_number'], 'cityName' => $_GET['city']);
     //print_r($data);
     $cities = Location::where(['Type' => 'City', 'visible' => 1, 'name' => $data['cityName']])->pluck('id');
     $data['city'] = $cities;
     $count = count($cities);
     if ($count == '0') {
         die("City name doesn't exist.");
         exit;
     } else {
         return view('frontend.pages.completesignup', $data);
     }
 }
 public function index()
 {
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     return view('admin.giftcards.admin_giftcards', ['cities' => $cities]);
 }
예제 #9
0
 public function set_location_id_phone()
 {
     $input = $this->request->all();
     $userEmail = DB::table('user_devices')->leftJoin('users', 'user_devices.user_id', '=', 'users.id')->where('access_token', $input['access_token'])->select('users.email')->first();
     if (!isset($input['location_id']) && !isset($input['phone_number'])) {
         response()->json(['action' => 'Check for the phone number and the location input', 'message' => 'Check for validation errors in the input'], 422);
     } else {
         $updateUser = $this->user->updateLocationAndPhone($input['user']->user_id, ['phone_number' => $input['phone_number'], 'location_id' => $input['location_id']]);
         $city_name = Location::where(['Type' => 'City', 'id' => $input['location_id']])->pluck('name');
         if (empty($city_name)) {
             $city_name = 'mumbai';
         }
         $city = ucfirst($city_name);
         $merge_vars = array('MERGE1' => $input['user']->full_name, 'GROUPINGS' => array(array('id' => 9713, 'groups' => [$city]), array('id' => 9705, 'groups' => [$city])), 'SIGNUPTP' => 'Facebook');
         $this->mailchimp->lists->subscribe($this->listId, ["email" => $userEmail->email], $merge_vars, "html", false, true);
         return response()->json($updateUser['data'], $updateUser['code']);
     }
 }
예제 #10
0
 /**
  * Handles requst for displaying the redeemRewards page.
  * record of the logged in user.
  * 
  * @access	public
  * @param	string	$access_token
  * @return	response
  * @since	1.0.0
  */
 public function redeemRewards()
 {
     $accessToken = $this->request->get('access_token');
     if ($accessToken != "") {
         Session::flush();
         $accessDetails = UserDevices::getUserDetailsByAccessToken($accessToken);
         if ($accessDetails > 0) {
             $user_array = Auth::loginUsingId($accessDetails);
             //echo "<pre>"; print_r($user_array);
             $userdata = array('id' => $user_array->id, 'username' => substr($user_array->email, 0, strpos($user_array->email, "@")), 'email' => $user_array->email, 'full_name' => $user_array->full_name, 'user_role' => $user_array->role_id, 'phone' => $user_array->phone_number, 'city_id' => $user_array->location_id, 'facebook_id' => @$user_array->fb_token, 'exp' => "10", 'logged_in' => TRUE);
             Session::put($userdata);
         }
     }
     $user_array = Session::all();
     //$userID =Session::get('id');
     //this code is start in header and footer page.
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $arrResponse['cities'] = $cities;
     $arrResponse['user'] = Auth::user();
     $city_id = Input::get('city');
     $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');
     if (empty($city_name)) {
         $city_name = 'mumbai';
     }
     $arrResponse['allow_guest'] = 'Yes';
     $arrResponse['current_city'] = strtolower($city_name);
     $arrResponse['current_city_id'] = $city_id;
     //this code is start in header and footer page.
     $id = Session::get('id');
     //$data=Profile::getUserProfileWeb($id);
     return view('frontend.pages.redeemrewards', $arrResponse);
 }
예제 #11
0
 public function verifyResetToken($token, $id)
 {
     //echo "sadsad"; die;
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $arrResponse['cities'] = $cities;
     $city_id = Input::get('city');
     $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');
     if (empty($city_name)) {
         $city_name = 'mumbai';
     }
     $arrResponse['allow_guest'] = 'Yes';
     $arrResponse['current_city'] = strtolower($city_name);
     $arrResponse['current_city_id'] = $city_id;
     $data = array('token' => $token);
     $validator = Validator::make($data, Password::$arrPasswordToken);
     //echo "<pre>"; print_r($validator); die;
     if ($validator->fails()) {
         $message = $validator->messages();
         foreach ($data as $key => $value) {
             $errorMessage = '';
             if ($message->has($key)) {
                 $errorMessage .= $message->first($key) . '\\n ';
             }
         }
         $arrResponse['status'] = Config::get('constants.API_ERROR');
         $arrResponse['msg'] = $errorMessage;
         //return response()->json($arrResponse,200);
         if ($arrResponse['status'] == "FAIL") {
             return view('frontend.pages.invalid_request', $arrResponse);
         }
     } else {
         $getUserDetails = $this->customermodel->getUserDetailsFromToken($token);
         //echo "<pre>"; print_r($getUserDetails); die;
         return view('frontend.pages.forgot_password', $arrResponse, ['data' => $getUserDetails]);
     }
     //return response()->json($arrResponse,200);
 }
예제 #12
0
 /**
  * Show the form for editing the specified resource.
  *
  * @Get("/edit/{id}", as="AdminUserEdit")
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //$user = $this->userRepo->getByUserId($id);
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $data = Profile::getUserProfileWeb($id);
     $role = DB::table('roles')->select('id', 'name')->get();
     /*		print_r($role);
     		exit;*/
     return view('admin.users.edit', ['data' => $data])->with('cities', $cities)->with('role', $role);
 }
예제 #13
0
 public function apply($id = "")
 {
     $career = CareerModel::find($id);
     $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
     $arrResponse['cities'] = $cities;
     $arrResponse['user'] = Auth::user();
     $city_id = Input::get('city');
     $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');
     if (empty($city_name)) {
         $city_name = 'mumbai';
     }
     $arrResponse['allow_guest'] = 'Yes';
     $arrResponse['current_city'] = strtolower($city_name);
     $arrResponse['current_city_id'] = $city_id;
     return view('frontend.pages.career_apply', $arrResponse)->with('career', $career);
 }
예제 #14
0
 /**
  * Push this reservation to specified devices
  *
  * @param  int  $id
  * @return Response
  */
 public function push($id, $tokenArr, $showNotification)
 {
     try {
         $reservation = array();
         $key = 'reservation_id';
         $value = (int) $id;
         $reservation[$key] = $value;
         //Int type
         $reservationIntAttrArr = ReservationAttributesInteger::where('reservation_id', (int) $id)->get();
         foreach ($reservationIntAttrArr as $reservationIntAttr) {
             $key = $reservationIntAttr->attribute->alias;
             $value = $reservationIntAttr->attribute_value;
             $reservation[$key] = $value;
             //Check log for same attribute
             $reservationStatusLog = ReservationStatusLog::where(['reservation_id' => $reservationIntAttr->reservation_id, 'new_reservation_status_id' => ReservationController::$edited_status_id])->orderBy('created_at', 'DESC')->first();
             if ($reservationStatusLog != null) {
                 $reservationIntAttrLogArr = ReservationAttributesIntegerLog::where(['reservation_attribute_id' => $reservationIntAttr->attribute->id, 'reservation_status_log_id' => $reservationStatusLog->id])->get();
                 foreach ($reservationIntAttrLogArr as $reservationIntAttrLog) {
                     $key = "old_" . $reservationIntAttrLog->attribute->alias;
                     $value = $reservationIntAttrLog->old_attribute_value;
                     $reservation[$key] = $value;
                 }
             }
         }
         //Float type
         $reservationFloatAttrArr = ReservationAttributesFloat::where('reservation_id', (int) $id)->get();
         foreach ($reservationFloatAttrArr as $reservationFloatAttr) {
             $key = $reservationFloatAttr->attribute->alias;
             $value = $reservationFloatAttr->attribute_value;
             $reservation[$key] = $value;
         }
         //Date type
         $reservationDateAttrArr = ReservationAttributesDate::where('reservation_id', (int) $id)->get();
         foreach ($reservationDateAttrArr as $reservationDateAttr) {
             $key = $reservationDateAttr->attribute->alias;
             $value = $reservationDateAttr->attribute_value;
             $reservation[$key] = $value;
             //Check log for same attribute
             $reservationStatusLog = ReservationStatusLog::where(['reservation_id' => $reservationDateAttr->reservation_id, 'new_reservation_status_id' => ReservationController::$edited_status_id])->orderBy('created_at', 'DESC')->first();
             if ($reservationStatusLog != null) {
                 $reservationDateAttrLogArr = ReservationAttributesDateLog::where(['reservation_attribute_id' => $reservationDateAttr->attribute->id, 'reservation_status_log_id' => $reservationStatusLog->id])->get();
                 foreach ($reservationDateAttrLogArr as $reservationDateAttrLog) {
                     $key = "old_" . $reservationDateAttrLog->attribute->alias;
                     $value = $reservationDateAttrLog->old_attribute_value;
                     $reservation[$key] = $value;
                 }
             }
         }
         //Text type
         $reservationTextAttrArr = ReservationAttributesText::where('reservation_id', (int) $id)->get();
         foreach ($reservationTextAttrArr as $reservationTextAttr) {
             $key = $reservationTextAttr->attribute->alias;
             $value = $reservationTextAttr->attribute_value;
             $reservation[$key] = $value;
             $reservationStatusLog = ReservationStatusLog::where(['reservation_id' => $reservationTextAttr->reservation_id, 'new_reservation_status_id' => ReservationController::$edited_status_id])->orderBy('created_at', 'DESC')->first();
             if ($reservationStatusLog != null) {
                 $reservationTextAttrLogArr = ReservationAttributesTextLog::where(['reservation_attribute_id' => $reservationTextAttr->attribute->id, 'reservation_status_log_id' => $reservationStatusLog->id])->get();
                 foreach ($reservationTextAttrLogArr as $reservationTextAttrLog) {
                     $key = "old_" . $reservationTextAttrLog->attribute->alias;
                     $value = $reservationTextAttrLog->old_attribute_value;
                     $reservation[$key] = $value;
                 }
             }
         }
         //Boolean type
         $reservationBoolAttrArr = ReservationAttributesBoolean::where('reservation_id', (int) $id)->get();
         foreach ($reservationBoolAttrArr as $reservationBoolAttr) {
             $key = $reservationBoolAttr->attribute->alias;
             $value = $reservationBoolAttr->attribute_value;
             if ($value == 1) {
                 $reservation[$key] = true;
             } else {
                 $reservation[$key] = false;
             }
         }
         //VarChar type
         $reservationVarcharAttrArr = ReservationAttributesVarchar::where('reservation_id', (int) $id)->get();
         foreach ($reservationVarcharAttrArr as $reservationVarcharAttr) {
             $key = $reservationVarcharAttr->attribute->alias;
             $value = $reservationVarcharAttr->attribute_value;
             $reservation[$key] = $value;
         }
         //Get Customer
         $reservationDetail = ReservationDetail::where('id', (int) $id)->first();
         if ($reservationDetail) {
             $reservation['reservation_type'] = $reservationDetail->reservation_type;
             $customer = array();
             $customer['id'] = $reservationDetail->user->id;
             $customer['full_name'] = $reservationDetail->user->full_name;
             $customer['email'] = $reservationDetail->user->email;
             $customer['phone_number'] = $reservationDetail->user->phone_number;
             $customer['points_earned'] = $reservationDetail->user->points_earned;
             $customer['rating'] = UserRating::where(['user_id' => $reservationDetail->user, 'id' => $reservationDetail->id])->avg('rating');
             if ($customer['rating'] == null) {
                 $customer['rating'] = 0.0;
             }
             $customerPreferences = UserAttributesVarChar::where(['user_id' => $reservationDetail->user->id, 'user_attribute_id' => ReservationController::$cust_pref_attr_id])->first();
             if ($customerPreferences) {
                 $customer['customer_preferences'] = $customerPreferences->attribute_value;
             }
             $reservation['customer'] = $customer;
         }
         //Get Location
         $reservationDetail = ReservationDetail::where('id', (int) $id)->first();
         if ($reservationDetail) {
             $location = array();
             $vendorLocation = VendorLocation::where('id', $reservationDetail->vendor_location_id)->first();
             $location['location_id'] = $vendorLocation->location_id;
             $location['location'] = Location::where('id', $vendorLocation->location_id)->first()->name;
             $reservation['location'] = $location;
         }
         //Get Product
         $reservationDetail = ReservationDetail::where('id', (int) $id)->first();
         if ($reservationDetail && $reservationDetail->reservation_type == 'experience') {
             $product = array();
             $product['product_id'] = $reservationDetail->product_id;
             $product['product'] = Product::where('id', $reservationDetail->product_id)->first()->name;
             $addonsArr = Product::where('product_parent_id', $reservationDetail->product_id)->get();
             if (sizeof($addonsArr) > 0) {
                 $productAddonArr = array();
                 foreach ($addonsArr as $addon) {
                     $addons = array();
                     $addons['addon_id'] = $addon->id;
                     $addons['addon_name'] = $addon->name;
                     $reservationAddonDetail = ReservationAddonsVariantsDetail::where(['reservation_id' => (int) $id, 'reservation_status_id' => $reservation['reservation_status_id'], 'options_id' => $addon->id])->first();
                     if ($reservationAddonDetail != null) {
                         $addons['no_of_persons'] = $reservationAddonDetail->no_of_persons;
                     }
                     array_push($productAddonArr, $addons);
                 }
                 $product['addons'] = $productAddonArr;
             }
             $reservation['product'] = $product;
         }
         if ($showNotification) {
             $reservation["show_notfn"] = 1;
         } else {
             $reservation["show_notfn"] = 0;
         }
         //$tokenArr = json_decode($input['tokens'], true);
         foreach ($tokenArr as $token) {
             PushNotification::app('appNameAndroid')->to($token['token'])->send(json_encode($reservation));
         }
         $arrResponse['status'] = Config::get('constants.API_SUCCESS');
         return response()->json($arrResponse, 200);
     } catch (\Exception $e) {
         return response()->json(['message' => 'An application error occured.', 'error' => $e->getMessage()], 500);
     }
 }
예제 #15
0
 public function process_response(Request $request)
 {
     //echo "<pre>"; print_r(Input::all());
     //echo $request->get('status'); //die;
     $requestarray = Input::all();
     $fetch_cookie = Session::get('purchase_giftcard_session');
     //echo "<pre>"; print_r($fetch_cookie); //die;
     $id = $fetch_cookie['actual_order_id'];
     //echo "order id = ".$id;
     if ($request->get('status') == "success") {
         $details = '<table width="600" cellpadding="2" cellspacing="2" border="0">
     <tr>
         <th colspan="2">Transaction Details</th>
     </tr>';
         foreach ($requestarray as $key => $value) {
             $details .= '<tr>
             <td class="fieldName" width="50%">' . $key . '</td>
             <td class="fieldName" align="left" width="50%">' . $value . '</td>
         </tr>';
         }
         $details .= '</table>';
         $transaction['user_id'] = $fetch_cookie['userID'];
         $transaction['response_code'] = $requestarray['unmappedstatus'];
         $transaction['response_message'] = $requestarray['status'];
         $transaction['transaction_date'] = date('Y-m-d H:i:s');
         $transaction['reservation_id'] = $id;
         $transaction['amount_paid'] = $requestarray['amount'];
         $transaction['transaction_number'] = $requestarray['mihpayid'];
         $transaction['transaction_details'] = $details . "~~" . $requestarray['status'];
         $transaction['source_type'] = "gift_cards";
         $lastTransactionID = DB::table('transactions_details')->insertGetId($transaction);
         Giftcards::updateDetails($id, $lastTransactionID);
         if ($fetch_cookie['giftcardType'] == 2) {
             $experienceDetails = Giftcards::getExperienceDetails($id);
             $addonsDetails = Giftcards::getAddonsDetails($id);
             $fetch_cookie['experienceName'] = $experienceDetails[0]->name;
             $addonsString = '';
             foreach ($addonsDetails as $addons) {
                 $addonsString .= $addons->name . ": (" . $addons->no_of_guests . "),";
             }
             $addonsDetail = rtrim($addonsString, ",");
             $fetch_cookie['addonsDetail'] = $addonsDetail;
         }
         $fetch_cookie['paymentStatus'] = $request->get('status');
         //echo "<pre>sd = "; print_r($fetch_cookie);
         //die;
         Mail::send('site.pages.giftcard_purchase_confirmation', ['giftcard' => $fetch_cookie], function ($message) use($fetch_cookie) {
             $message->from('*****@*****.**', 'WowTables by GourmetItUp');
             $message->to($fetch_cookie['guestEmail'])->subject('New gift card purchase order no. ' . $fetch_cookie['order_id']);
             $message->bcc('*****@*****.**');
         });
         //$dataPost['admin']  = "yes";
         Mail::send('site.pages.giftcard_purchase_confirmation', ['giftcard' => $fetch_cookie], function ($message) use($fetch_cookie) {
             $message->from('*****@*****.**', 'WowTables by GourmetItUp');
             $message->to('*****@*****.**')->subject('WowTables Gift Card Purchase Confirmation ' . $fetch_cookie['order_id']);
             $message->cc(['*****@*****.**', '*****@*****.**']);
         });
         $cities = Location::where(['Type' => 'City', 'visible' => 1])->lists('name', 'id');
         $arrResponse['cities'] = $cities;
         $arrResponse['user'] = Auth::user();
         $city_id = Input::get('city');
         $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');
         if (empty($city_name)) {
             $city_name = 'mumbai';
         }
         $arrResponse['allow_guest'] = 'Yes';
         $arrResponse['current_city'] = strtolower($city_name);
         $arrResponse['current_city_id'] = $city_id;
         return view('frontend.pages.giftcard_thankyou', $arrResponse)->with('orderDetails', $fetch_cookie);
     }
 }