コード例 #1
0
 /**
  * This will grab a single event to edit schedules
  *
  * @depends testGetEvents
  */
 public function testGrabSchedule($events)
 {
     $event = $events[0];
     // Instanciate apihelper
     $api = new \App\Helpers\ApiHelper();
     $event = $api->show('events', $event['id'] . '?with[]=schedules');
     $schedule = $event['data']['event']['schedules'][0];
     return $schedule;
 }
コード例 #2
0
 /**
  * testPostAccountLogin (Logged out)
  *
  * @return $user
  */
 public function testLogin()
 {
     // Instanciate apihelper
     $api = new \App\Helpers\ApiHelper();
     // Grab a user from
     $user = $api->show('users', '2');
     // Set usersname
     $user = $user['data']['user'];
     return $user;
 }
コード例 #3
0
 /**
  * testPostAccountLogin (Logged out)
  *
  * @return $user
  */
 public function testAccountLogin()
 {
     // Instanciate apihelper
     $api = new \App\Helpers\ApiHelper();
     // Grab a user from
     $user = $api->show('users', '4');
     // Set usersname
     $user = $user['data']['user'];
     $result = $this->visit('account/login')->type($user['email'], 'email')->type('timberlake', 'password')->press('Sign in')->see($user['email'])->see('Search Events Near You')->seePageIs('/');
     return $user;
 }
コード例 #4
0
 /**
  * testPostAccountLogin (Logged out)
  *
  *
  */
 public function testUser()
 {
     // Instanciate apihelper
     $api = new \App\Helpers\ApiHelper();
     // Grab a user from
     $user = $api->show('users', '1');
     // Set usersname
     $user = $user['data']['user'];
     $auth = new ApiGenericUser(['id' => $user['id']]);
     return $auth;
 }
コード例 #5
0
 /**
  * testPostAccountLogin (Logged out)
  *
  * @return void
  */
 public function testAccountLogin()
 {
     // Instanciate apihelper
     $api = new \App\Helpers\ApiHelper();
     // Grab a user from
     $user = $api->show('users', '1');
     // Set usersname
     $user = $user['data']['user'];
     $login = $this->visit('account/login')->type($user['email'], 'email')->type('timberlake', 'password')->press('Sign in');
     $see = $this->see($user['email'])->see('Concerts')->see('See More')->seePageIs('/');
 }
コード例 #6
0
 /**
  * Get users profile
  *
  * @return $user
  */
 public function testShowProfile()
 {
     // Instanciate apihelper
     $api = new \App\Helpers\ApiHelper();
     // Grab a user from
     $user = $api->show('users', '1?with[]=events');
     // Set usersname
     $username = $user['data']['user']['username'];
     // Grab selected user via website
     $visit = $this->visit('users/' . $username);
     $see = $this->see($user['data']['user']['id'])->see($user['data']['user']['timeZoneId'])->see($user['data']['user']['firstName'])->see($user['data']['user']['lastName']);
     return $user;
 }
コード例 #7
0
 /**
  * Show the create event page
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function showCreate($id = null)
 {
     $events = null;
     $tagNames = [];
     // Instantiate the APIHelper
     $api = new \App\Helpers\ApiHelper();
     $tagUrl = 'tags?filter[and][][is_category]=1';
     if (\Auth::check()) {
         $tagUrl .= '&auth_user_id=' . \Auth::user()->id;
     }
     // Event categories
     $categories = $api->index($tagUrl);
     $categories = $categories['data']['tags'];
     foreach ($categories as $key => $value) {
         $categories[$key] = $value['tag'];
     }
     // Check if user is signed in
     if (\Auth::check()) {
         // Gather user information
         $user = $api->show('users', \Auth::user()->id . '?with[]=stripeSubscriptions&with[]=ticketInventories&with[]=stripeManagedAccounts&auth_user_id=' . \Auth::user()->id);
         $user = $user['data']['user'];
     }
     // Default value
     $userCard = null;
     // If there is a card available
     if (isset($user['stripeSubscriptions'][0])) {
         // Set the card ID
         $userCard = $user['stripeSubscriptions'][0]['cardId'];
     }
     if ($id !== null) {
         $eventUrl = 'events/' . $id . '?with[]=tags';
         if (\Auth::check()) {
             $eventUrl .= '&auth_user_id=' . \Auth::user()->id;
         }
         // Show event associated the ID.
         $events = $api->show($eventUrl, '');
         // load tags to show
         $tags = $events['data']['event']['tags'];
         foreach ($tags as $tag) {
             $tagNames[] = $tag['tag'];
         }
     }
     $stateList = ['Alabama' => "Alabama", 'Alaska' => "Alaska", 'Arizona' => "Arizona", 'Arkansas' => "Arkansas", 'California' => "California", 'Colorado' => "Colorado", 'Connecticut' => "Connecticut", 'Delaware' => "Delaware", 'District Of Columbia' => "District Of Columbia", 'Florida' => "Florida", 'Georgia' => "Georgia", 'Hawaii' => "Hawaii", 'Idaho' => "Idaho", 'Illinois' => "Illinois", 'Indiana' => "Indiana", 'Iowa' => "Iowa", 'Kansas' => "Kansas", 'Kentucky' => "Kentucky", 'Louisiana' => "Louisiana", 'Maine' => "Maine", 'Maryland' => "Maryland", 'Massachusetts' => "Massachusetts", 'Michigan' => "Michigan", 'Minnesota' => "Minnesota", 'Mississippi' => "Mississippi", 'Missouri' => "Missouri", 'Montana' => "Montana", 'Nebraska' => "Nebraska", 'Nevada' => "Nevada", 'New Hampshire' => "New Hampshire", 'New Jersey' => "New Jersey", 'New Mexico' => "New Mexico", 'New York' => "New York", 'North Carolina' => "North Carolina", 'North Dakota' => "North Dakota", 'Ohio' => "Ohio", 'Oklahoma' => "Oklahoma", 'Oregon' => "Oregon", 'Pennsylvania' => "Pennsylvania", 'Rhode Island' => "Rhode Island", 'South Carolina' => "South Carolina", 'South Dakota' => "South Dakota", 'Tennessee' => "Tennessee", 'Texas' => "Texas", 'Utah' => "Utah", 'Vermont' => "Vermont", 'Virginia' => "Virginia", 'Washington' => "Washington", 'West Virginia' => "West Virginia", 'Wisconsin' => "Wisconsin", 'Wyoming' => "Wyoming"];
     $timeList = ['12:00' => "12:00", '12:15' => "12:15", '12:30' => "12:30", '12:45' => "12:45", '1:00' => "1:00", '1:15' => "1:15", '1:30' => "1:30", '1:45' => "1:45", '2:00' => "2:00", '2:15' => "2:15", '2:30' => "2:30", '2:45' => "2:45", '3:00' => "3:00", '3:15' => "3:15", '3:30' => "3:30", '3:45' => "3:45", '4:00' => "4:00", '4:15' => "4:15", '4:30' => "4:30", '4:45' => "4:45", '5:00' => "5:00", '5:15' => "5:15", '5:30' => "5:30", '5:45' => "5:45", '6:00' => "6:00", '6:15' => "6:15", '6:30' => "6:30", '6:45' => "6:45", '7:00' => "7:00", '7:15' => "7:15", '7:30' => "7:30", '7:45' => "7:45", '8:00' => "8:00", '8:15' => "8:15", '8:30' => "8:30", '8:45' => "8:45", '9:00' => "9:00", '9:15' => "9:15", '9:30' => "9:30", '9:45' => "9:45", '10:00' => "10:00", '10:15' => "10:15", '10:30' => "10:30", '10:45' => "10:45", '11:00' => "11:00", '11:15' => "11:15", '11:30' => "11:30", '11:45' => "11:45"];
     $repeatList = ['daily' => 'Daily', 'weekly' => 'Weekly', 'monthly' => 'Monthly', 'yearly' => 'Yearly'];
     $events = $events['data']['event'];
     $uploadUrl = 'settings/upload';
     $timezoneUrl = 'collections/timezones?limit=200&fields[]=id&fields[]=zoneName';
     if (\Auth::check()) {
         $uploadUrl .= '?auth_user_id=' . \Auth::user()->id;
         $timezoneUrl .= '&auth_user_id=' . \Auth::user()->id;
     }
     // Get upload settings for evaporate.js
     $uploadSettings = $api->index($uploadUrl);
     $uploadSettings = isset($uploadSettings['data']) ? $uploadSettings['data'] : [];
     // Get list of timezones
     $timezoneList = [];
     $timezones = $api->index($timezoneUrl);
     $timezones = isset($timezones['data']['timezones']) ? $timezones['data']['timezones'] : [];
     // Create timezone list for select input
     foreach ($timezones as $timezone) {
         // Set time_zone_id
         $timeZoneId = $timezone['id'];
         // Set label
         $timezoneList[$timeZoneId] = $timezone['zoneName'];
     }
     return \View::make('events.create')->with(['categories' => $categories, 'event' => $events, 'step' => 'create_event', 'stateList' => $stateList, 'timeList' => $timeList, 'repeatList' => $repeatList, 'stepsLocked' => $events === null, 'tagConcat' => implode(',', $tagNames), 'uploadSettings' => $uploadSettings, 'userCard' => $userCard, 'user' => isset($user) ? $user : null, 'timezoneList' => $timezoneList]);
 }
コード例 #8
0
 /**
  * Display the reservation confirmation page.
  *
  * @param  $slug returns title of specified event
  * @param  $reserve holds name of reservation
  * @param  $confirmation holds confirmation message
  *
  * @return Returns reservation confirmation for all reservations made and returns view
  */
 public function showReservationConfirmation($slug)
 {
     // Instantiate the APIHelper
     $api = new \App\Helpers\ApiHelper();
     if (\Session::has('confirmation')) {
         $url = 'events/' . $slug . '?with[]=photos&with[]=TicketsOrder';
         if (\Auth::check()) {
             $url .= '&auth_user_id=' . \Auth::user()->id;
         }
         // Pull in single event with photos
         $events = $api->show($url, '');
         // Define events
         $events = $events['data']['event'];
         // Set default photo
         $defaultPhoto = null;
         // Use featured photo if available
         if (isset($events['featuredPhoto'])) {
             $defaultPhoto = $events['featuredPhoto'];
         }
         // Holds name of reservation
         $reserve = \Session::get('reserveInfo');
         // Holds returned success response for confirmation info
         $confirmation = \Session::get('confirmation');
         // For each reservation made, pull name and confirmation message
         for ($n = 0; $n < count($reserve); $n++) {
             $reservationConfirmation[] = ['name' => $reserve[$n]['name'], 'confirmation' => $confirmation[$n]['confirmation']];
         }
         return \View::make('events.reservation-confirmation')->with(array('events' => $events, 'defaultPhoto' => $defaultPhoto, 'reservationConfirmation' => $reservationConfirmation));
     } else {
         return \Redirect::back()->with('message', 'Something went wrong.');
     }
 }
コード例 #9
0
 public function showPayment()
 {
     // Insanciate the APIHelper
     $api = new \App\Helpers\ApiHelper();
     // Check if user is signed in
     if (\Auth::check()) {
         // Pull in users account
         $user = $api->show('users', \Auth::user()->id . '?with[]=ticketInventories&with[]=stripeManagedAccounts&auth_user_id=' . \Auth::user()->id);
         $user = $user['data']['user'];
     }
     if (isset($user['stripeManagedAccounts'][0]['acctId'])) {
         $accountId = $user['stripeManagedAccounts'][0]['acctId'];
         // Pull users stripe account
         $account = $api->show('users/showManaged', $accountId . '?auth_user_id=' . \Auth::user()->id);
         $account = isset($account['data'][0][0]) ? $account['data'][0][0] : $account;
         if (isset($account['verification'])) {
             // Return with view and variables
             return View::make('accounts.payment')->with(['warning_message' => $account['verification']['fields_needed'], 'account' => $account, 'accountId' => isset($account['id']) ? $account['id'] : $accountId, 'user' => isset($user) ? $user : null]);
         }
     }
     return View::make('accounts.payment')->with(['user' => isset($user) ? $user : null, 'account' => isset($account) ? $account : []]);
 }