- Fix missing method error when changing event social settings
This commit is contained in:
parent
50453a48c4
commit
9862fb3992
|
|
@ -5,78 +5,89 @@ namespace App\Http\Controllers;
|
|||
use App\Models\Event;
|
||||
use App\Models\EventImage;
|
||||
use App\Models\Organiser;
|
||||
use Illuminate\Http\Request;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Image;
|
||||
use Input;
|
||||
use Response;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
|
||||
class EventController extends MyBaseController
|
||||
{
|
||||
public function showCreateEvent()
|
||||
/**
|
||||
* Show the 'Create Event' Modal
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showCreateEvent(Request $request)
|
||||
{
|
||||
$data = [
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'modal_id' => $request->get('modal_id'),
|
||||
'organisers' => Organiser::scope()->lists('name', 'id'),
|
||||
'organiser_id' => Input::get('organiser_id') ? Input::get('organiser_id') : false,
|
||||
'organiser_id' => $request->get('organiser_id') ? $request->get('organiser_id') : false,
|
||||
];
|
||||
|
||||
return View::make('ManageOrganiser.Modals.CreateEvent', $data);
|
||||
return view('ManageOrganiser.Modals.CreateEvent', $data);
|
||||
}
|
||||
|
||||
public function postCreateEvent()
|
||||
/**
|
||||
* Create an event
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postCreateEvent(Request $request)
|
||||
{
|
||||
$event = Event::createNew();
|
||||
|
||||
if (!$event->validate(Input::all())) {
|
||||
return Response::json([
|
||||
if (!$event->validate($request->all())) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'messages' => $event->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->title = Input::get('title');
|
||||
$event->description = strip_tags(Input::get('description'));
|
||||
$event->start_date = Input::get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_date')) : null;
|
||||
$event->title = $request->get('title');
|
||||
$event->description = strip_tags($request->get('description'));
|
||||
$event->start_date = $request->get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', $request->get('start_date')) : null;
|
||||
|
||||
/*
|
||||
* Venue location info (Usually autofilled from google maps)
|
||||
* Venue location info (Usually auto-filled from google maps)
|
||||
*/
|
||||
|
||||
$is_auto_address = (trim(Input::get('place_id')) !== '');
|
||||
$is_auto_address = (trim($request->get('place_id')) !== '');
|
||||
|
||||
if ($is_auto_address) { /* Google auto filled */
|
||||
$event->venue_name = Input::get('name');
|
||||
$event->venue_name_full = Input::get('venue_name_full');
|
||||
$event->location_lat = Input::get('lat');
|
||||
$event->location_long = Input::get('lng');
|
||||
$event->location_address = Input::get('formatted_address');
|
||||
$event->location_country = Input::get('country');
|
||||
$event->location_country_code = Input::get('country_short');
|
||||
$event->location_state = Input::get('administrative_area_level_1');
|
||||
$event->location_address_line_1 = Input::get('route');
|
||||
$event->location_address_line_2 = Input::get('locality');
|
||||
$event->location_post_code = Input::get('postal_code');
|
||||
$event->location_street_number = Input::get('street_number');
|
||||
$event->location_google_place_id = Input::get('place_id');
|
||||
$event->venue_name = $request->get('name');
|
||||
$event->venue_name_full = $request->get('venue_name_full');
|
||||
$event->location_lat = $request->get('lat');
|
||||
$event->location_long = $request->get('lng');
|
||||
$event->location_address = $request->get('formatted_address');
|
||||
$event->location_country = $request->get('country');
|
||||
$event->location_country_code = $request->get('country_short');
|
||||
$event->location_state = $request->get('administrative_area_level_1');
|
||||
$event->location_address_line_1 = $request->get('route');
|
||||
$event->location_address_line_2 = $request->get('locality');
|
||||
$event->location_post_code = $request->get('postal_code');
|
||||
$event->location_street_number = $request->get('street_number');
|
||||
$event->location_google_place_id = $request->get('place_id');
|
||||
$event->location_is_manual = 0;
|
||||
} else { /* Manually entered */
|
||||
$event->venue_name = Input::get('location_venue_name');
|
||||
$event->location_address_line_1 = Input::get('location_address_line_1');
|
||||
$event->location_address_line_2 = Input::get('location_address_line_2');
|
||||
$event->location_state = Input::get('location_state');
|
||||
$event->location_post_code = Input::get('location_post_code');
|
||||
$event->venue_name = $request->get('location_venue_name');
|
||||
$event->location_address_line_1 = $request->get('location_address_line_1');
|
||||
$event->location_address_line_2 = $request->get('location_address_line_2');
|
||||
$event->location_state = $request->get('location_state');
|
||||
$event->location_post_code = $request->get('location_post_code');
|
||||
$event->location_is_manual = 1;
|
||||
}
|
||||
|
||||
$event->end_date = Input::get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_date')) : null;
|
||||
$event->end_date = $request->get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', $request->get('end_date')) : null;
|
||||
|
||||
$event->currency_id = Auth::user()->account->currency_id;
|
||||
//$event->timezone_id = Auth::user()->account->timezone_id;
|
||||
|
||||
if (Input::get('organiser_name')) {
|
||||
if ($request->get('organiser_name')) {
|
||||
$organiser = Organiser::createNew(false, false, true);
|
||||
|
||||
$rules = [
|
||||
|
|
@ -87,7 +98,7 @@ class EventController extends MyBaseController
|
|||
'organiser_name.required' => 'You must give a name for the event organiser.',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json([
|
||||
|
|
@ -96,27 +107,28 @@ class EventController extends MyBaseController
|
|||
]);
|
||||
}
|
||||
|
||||
$organiser->name = Input::get('organiser_name');
|
||||
$organiser->about = Input::get('organiser_about');
|
||||
$organiser->email = Input::get('organiser_email');
|
||||
$organiser->facebook = Input::get('organiser_facebook');
|
||||
$organiser->twitter = Input::get('organiser_twitter');
|
||||
$organiser->name = $request->get('organiser_name');
|
||||
$organiser->about = $request->get('organiser_about');
|
||||
$organiser->email = $request->get('organiser_email');
|
||||
$organiser->facebook = $request->get('organiser_facebook');
|
||||
$organiser->twitter = $request->get('organiser_twitter');
|
||||
$organiser->save();
|
||||
$event->organiser_id = $organiser->id;
|
||||
} elseif (Input::get('organiser_id')) {
|
||||
$event->organiser_id = Input::get('organiser_id');
|
||||
|
||||
} elseif ($request->get('organiser_id')) {
|
||||
$event->organiser_id = $request->get('organiser_id');
|
||||
} else { /* Somethings gone horribly wrong */
|
||||
}
|
||||
|
||||
$event->save();
|
||||
|
||||
if (Input::hasFile('event_image')) {
|
||||
if ($request->hasFile('event_image')) {
|
||||
$path = public_path().'/'.config('attendize.event_images_path');
|
||||
$filename = 'event_image-'.md5(time().$event->id).'.'.strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
$filename = 'event_image-'.md5(time().$event->id).'.'.strtolower($request->file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$file_full_path = $path.'/'.$filename;
|
||||
|
||||
Input::file('event_image')->move($path, $filename);
|
||||
$request->file('event_image')->move($path, $filename);
|
||||
|
||||
$img = Image::make($file_full_path);
|
||||
|
||||
|
|
@ -136,7 +148,7 @@ class EventController extends MyBaseController
|
|||
$eventImage->save();
|
||||
}
|
||||
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'id' => $event->id,
|
||||
'redirectUrl' => route('showEventTickets', [
|
||||
|
|
@ -146,49 +158,56 @@ class EventController extends MyBaseController
|
|||
]);
|
||||
}
|
||||
|
||||
public function postEditEvent($event_id)
|
||||
/**
|
||||
* Edit an event
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $event_id
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postEditEvent(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
if (!$event->validate(Input::all())) {
|
||||
return Response::json([
|
||||
if (!$event->validate($request->all())) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'messages' => $event->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->is_live = Input::get('is_live');
|
||||
$event->title = Input::get('title');
|
||||
$event->description = strip_tags(Input::get('description'));
|
||||
$event->start_date = Input::get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_date')) : null;
|
||||
$event->is_live = $request->get('is_live');
|
||||
$event->title = $request->get('title');
|
||||
$event->description = strip_tags($request->get('description'));
|
||||
$event->start_date = $request->get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', $request->get('start_date')) : null;
|
||||
|
||||
/*
|
||||
* If the google place ID is the same as before then don't update the venue
|
||||
*/
|
||||
if ((Input::get('place_id') !== $event->location_google_place_id) || $event->location_google_place_id == '') {
|
||||
$is_auto_address = (trim(Input::get('place_id')) !== '');
|
||||
if (($request->get('place_id') !== $event->location_google_place_id) || $event->location_google_place_id == '') {
|
||||
$is_auto_address = (trim($request->get('place_id')) !== '');
|
||||
|
||||
if ($is_auto_address) { /* Google auto filled */
|
||||
$event->venue_name = Input::get('name');
|
||||
$event->venue_name_full = Input::get('venue_name_full');
|
||||
$event->location_lat = Input::get('lat');
|
||||
$event->location_long = Input::get('lng');
|
||||
$event->location_address = Input::get('formatted_address');
|
||||
$event->location_country = Input::get('country');
|
||||
$event->location_country_code = Input::get('country_short');
|
||||
$event->location_state = Input::get('administrative_area_level_1');
|
||||
$event->location_address_line_1 = Input::get('route');
|
||||
$event->location_address_line_2 = Input::get('locality');
|
||||
$event->location_post_code = Input::get('postal_code');
|
||||
$event->location_street_number = Input::get('street_number');
|
||||
$event->location_google_place_id = Input::get('place_id');
|
||||
$event->venue_name = $request->get('name');
|
||||
$event->venue_name_full = $request->get('venue_name_full');
|
||||
$event->location_lat = $request->get('lat');
|
||||
$event->location_long = $request->get('lng');
|
||||
$event->location_address = $request->get('formatted_address');
|
||||
$event->location_country = $request->get('country');
|
||||
$event->location_country_code = $request->get('country_short');
|
||||
$event->location_state = $request->get('administrative_area_level_1');
|
||||
$event->location_address_line_1 = $request->get('route');
|
||||
$event->location_address_line_2 = $request->get('locality');
|
||||
$event->location_post_code = $request->get('postal_code');
|
||||
$event->location_street_number = $request->get('street_number');
|
||||
$event->location_google_place_id = $request->get('place_id');
|
||||
$event->location_is_manual = 0;
|
||||
} else { /* Manually entered */
|
||||
$event->venue_name = Input::get('location_venue_name');
|
||||
$event->location_address_line_1 = Input::get('location_address_line_1');
|
||||
$event->location_address_line_2 = Input::get('location_address_line_2');
|
||||
$event->location_state = Input::get('location_state');
|
||||
$event->location_post_code = Input::get('location_post_code');
|
||||
$event->venue_name = $request->get('location_venue_name');
|
||||
$event->location_address_line_1 = $request->get('location_address_line_1');
|
||||
$event->location_address_line_2 = $request->get('location_address_line_2');
|
||||
$event->location_state = $request->get('location_state');
|
||||
$event->location_post_code = $request->get('location_post_code');
|
||||
$event->location_is_manual = 1;
|
||||
$event->location_google_place_id = '';
|
||||
$event->venue_name_full = '';
|
||||
|
|
@ -201,21 +220,21 @@ class EventController extends MyBaseController
|
|||
}
|
||||
}
|
||||
|
||||
$event->end_date = Input::get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_date')) : null;
|
||||
$event->end_date = $request->get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', $request->get('end_date')) : null;
|
||||
|
||||
if (Input::get('remove_current_image') == '1') {
|
||||
if ($request->get('remove_current_image') == '1') {
|
||||
EventImage::where('event_id', '=', $event->id)->delete();
|
||||
}
|
||||
|
||||
$event->save();
|
||||
|
||||
if (Input::hasFile('event_image')) {
|
||||
if ($request->hasFile('event_image')) {
|
||||
$path = public_path().'/'.config('attendize.event_images_path');
|
||||
$filename = 'event_image-'.md5(time().$event->id).'.'.strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
$filename = 'event_image-'.md5(time().$event->id).'.'.strtolower($request->file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$file_full_path = $path.'/'.$filename;
|
||||
|
||||
Input::file('event_image')->move($path, $filename);
|
||||
$request->file('event_image')->move($path, $filename);
|
||||
|
||||
$img = Image::make($file_full_path);
|
||||
|
||||
|
|
@ -236,7 +255,7 @@ class EventController extends MyBaseController
|
|||
$eventImage->save();
|
||||
}
|
||||
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'id' => $event->id,
|
||||
'message' => 'Event Successfully Updated',
|
||||
|
|
@ -244,11 +263,17 @@ class EventController extends MyBaseController
|
|||
]);
|
||||
}
|
||||
|
||||
public function postUploadEventImage()
|
||||
/**
|
||||
* Upload event image
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postUploadEventImage(Request $request)
|
||||
{
|
||||
if (Input::hasFile('event_image')) {
|
||||
$the_file = \File::get(Input::file('event_image')->getRealPath());
|
||||
$file_name = 'event_details_image-'.md5(microtime()).'.'.strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
if ($request->hasFile('event_image')) {
|
||||
$the_file = \File::get($request->file('event_image')->getRealPath());
|
||||
$file_name = 'event_details_image-'.md5(microtime()).'.'.strtolower($request->file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$relative_path_to_file = config('attendize.event_images_path').'/'.$file_name;
|
||||
$full_path_to_file = public_path().'/'.$relative_path_to_file;
|
||||
|
|
@ -262,12 +287,12 @@ class EventController extends MyBaseController
|
|||
|
||||
$img->save($full_path_to_file);
|
||||
if (\Storage::put($file_name, $the_file)) {
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'link' => '/'.$relative_path_to_file,
|
||||
]);
|
||||
}
|
||||
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'error' => 'There was a problem uploading your image.',
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,18 @@ namespace App\Http\Controllers;
|
|||
use App\Models\Event;
|
||||
use File;
|
||||
use Image;
|
||||
use Input;
|
||||
use Response;
|
||||
use Validator;
|
||||
use View;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EventCustomizeController extends MyBaseController
|
||||
{
|
||||
/**
|
||||
* Show the event customize page
|
||||
*
|
||||
* @param string $event_id
|
||||
* @param string $tab
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showCustomize($event_id = '', $tab = '')
|
||||
{
|
||||
$data = $this->getEventViewData($event_id, [
|
||||
|
|
@ -21,9 +25,14 @@ class EventCustomizeController extends MyBaseController
|
|||
'tab' => $tab,
|
||||
]);
|
||||
|
||||
return View::make('ManageEvent.Customize', $data);
|
||||
return view('ManageEvent.Customize', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* get an array of available event background images
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAvailableBackgroundImages()
|
||||
{
|
||||
$images = [];
|
||||
|
|
@ -37,6 +46,11 @@ class EventCustomizeController extends MyBaseController
|
|||
return $images;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of event bg image thumbnails
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAvailableBackgroundImagesThumbs()
|
||||
{
|
||||
$images = [];
|
||||
|
|
@ -50,8 +64,14 @@ class EventCustomizeController extends MyBaseController
|
|||
return $images;
|
||||
}
|
||||
|
||||
|
||||
public function postEditEventTicketSocial($event_id)
|
||||
/**
|
||||
* Edit social settings of an event
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $event_id
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postEditEventSocial(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
|
|
@ -65,29 +85,29 @@ class EventCustomizeController extends MyBaseController
|
|||
];
|
||||
|
||||
$messages = [
|
||||
'social_share_text.max' => 'Please keep the shate text under 3000 characters.',
|
||||
'social_share_text.max' => 'Please keep the text under 3000 characters.',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->social_share_text = Input::get('social_share_text');
|
||||
$event->social_show_facebook = Input::get('social_show_facebook');
|
||||
$event->social_show_linkedin = Input::get('social_show_linkedin');
|
||||
$event->social_show_twitter = Input::get('social_show_twitter');
|
||||
$event->social_show_email = Input::get('social_show_email');
|
||||
$event->social_show_googleplus = Input::get('social_show_googleplus');
|
||||
$event->social_share_text = $request->get('social_share_text');
|
||||
$event->social_show_facebook = $request->get('social_show_facebook');
|
||||
$event->social_show_linkedin = $request->get('social_show_linkedin');
|
||||
$event->social_show_twitter = $request->get('social_show_twitter');
|
||||
$event->social_show_email = $request->get('social_show_email');
|
||||
$event->social_show_googleplus = $request->get('social_show_googleplus');
|
||||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Social Settings Succesfully Upated',
|
||||
'message' => 'Social Settings Successfully Updated',
|
||||
]);
|
||||
|
||||
}
|
||||
|
|
@ -117,7 +137,7 @@ class EventCustomizeController extends MyBaseController
|
|||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
|
|
@ -137,7 +157,14 @@ class EventCustomizeController extends MyBaseController
|
|||
]);
|
||||
}
|
||||
|
||||
public function postEditEventFees($event_id)
|
||||
/**
|
||||
* Edit fees of an event
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $event_id
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postEditEventFees(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
|
|
@ -147,30 +174,37 @@ class EventCustomizeController extends MyBaseController
|
|||
];
|
||||
$messages = [
|
||||
'organiser_fee_percentage.numeric' => 'Please enter a value between 0 and 100',
|
||||
'organiser_fee_fixed.numeric' => 'Please check the format. It shoud be in the format 0.00.',
|
||||
'organiser_fee_fixed.numeric' => 'Please check the format. It should be in the format 0.00.',
|
||||
'organiser_fee_fixed.between' => 'Please enter a value between 0 and 100.',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->organiser_fee_percentage = Input::get('organiser_fee_percentage');
|
||||
$event->organiser_fee_fixed = Input::get('organiser_fee_fixed');
|
||||
$event->organiser_fee_percentage = $request->get('organiser_fee_percentage');
|
||||
$event->organiser_fee_fixed = $request->get('organiser_fee_fixed');
|
||||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Order Page Succesfully Upated',
|
||||
'message' => 'Order Page Successfully Updated',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditEventOrderPage($event_id)
|
||||
/**
|
||||
* Edit the event order page settings
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $event_id
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postEditEventOrderPage(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
|
|
@ -178,27 +212,34 @@ class EventCustomizeController extends MyBaseController
|
|||
$rules = [];
|
||||
$messages = [];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->pre_order_display_message = trim(Input::get('pre_order_display_message'));
|
||||
$event->post_order_display_message = trim(Input::get('post_order_display_message'));
|
||||
$event->ask_for_all_attendees_info = (Input::get('ask_for_all_attendees_info') == 'on');
|
||||
$event->pre_order_display_message = trim($request->get('pre_order_display_message'));
|
||||
$event->post_order_display_message = trim($request->get('post_order_display_message'));
|
||||
$event->ask_for_all_attendees_info = ($request->get('ask_for_all_attendees_info') == 'on');
|
||||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Order Page Successfully Upated',
|
||||
'message' => 'Order Page Successfully Updated',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditEventDesign($event_id)
|
||||
/**
|
||||
* Edit event page design/colors etc.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $event_id
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postEditEventDesign(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
|
|
@ -210,35 +251,35 @@ class EventCustomizeController extends MyBaseController
|
|||
'bg_image_path.max' => 'Please ensure the image is not larger than 2.5MB',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
if (Input::get('bg_image_path_custom') && Input::get('bg_type') == 'image') {
|
||||
$event->bg_image_path = Input::get('bg_image_path_custom');
|
||||
if ($request->get('bg_image_path_custom') && $request->get('bg_type') == 'image') {
|
||||
$event->bg_image_path = $request->get('bg_image_path_custom');
|
||||
$event->bg_type = 'image';
|
||||
}
|
||||
|
||||
if (Input::get('bg_color') && Input::get('bg_type') == 'color') {
|
||||
$event->bg_color = Input::get('bg_color');
|
||||
if ($request->get('bg_color') && $request->get('bg_type') == 'color') {
|
||||
$event->bg_color = $request->get('bg_color');
|
||||
$event->bg_type = 'color';
|
||||
}
|
||||
|
||||
/*
|
||||
* Not in use for now.
|
||||
*/
|
||||
if (Input::hasFile('bg_image_path') && Input::get('bg_type') == 'custom_image') {
|
||||
if ($request->hasFile('bg_image_path') && $request->get('bg_type') == 'custom_image') {
|
||||
$path = public_path() . '/' . config('attendize.event_images_path');
|
||||
$filename = 'event_bg-' . md5($event->id) . '.' . strtolower(Input::file('bg_image_path')->getClientOriginalExtension());
|
||||
$filename = 'event_bg-' . md5($event->id) . '.' . strtolower($request->file('bg_image_path')->getClientOriginalExtension());
|
||||
|
||||
$file_full_path = $path . '/' . $filename;
|
||||
|
||||
Input::file('bg_image_path')->move($path, $filename);
|
||||
$request->file('bg_image_path')->move($path, $filename);
|
||||
|
||||
$img = Image::make($file_full_path);
|
||||
|
||||
|
|
@ -257,9 +298,9 @@ class EventCustomizeController extends MyBaseController
|
|||
|
||||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Event Page Succesfully Upated',
|
||||
'message' => 'Event Page Successfully Updated',
|
||||
'runThis' => 'document.getElementById(\'previewIframe\').contentWindow.location.reload(true);',
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,10 +8,15 @@ use Carbon\Carbon;
|
|||
use DateInterval;
|
||||
use DatePeriod;
|
||||
use DateTime;
|
||||
use View;
|
||||
|
||||
class EventDashboardController extends MyBaseController
|
||||
{
|
||||
/**
|
||||
* Show the event dashboard
|
||||
*
|
||||
* @param bool|false $event_id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showDashboard($event_id = false)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
|
@ -74,36 +79,7 @@ class EventDashboardController extends MyBaseController
|
|||
'chartData' => json_encode($result),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Dashboard', $data);
|
||||
return view('ManageEvent.Dashboard', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $chartData
|
||||
* @param bool|false $from_date
|
||||
* @param bool|false $toDate
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generateChartJson($chartData, $from_date = false, $toDate = false)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$startdate = '2014-10-1';
|
||||
$enddate = '2014-11-7';
|
||||
$timestamp = strtotime($startdate);
|
||||
while ($startdate <= $enddate) {
|
||||
$startdate = date('Y-m-d', $timestamp);
|
||||
|
||||
$data[] = [
|
||||
'date' => $startdate,
|
||||
'tickets_sold' => rand(0, 7),
|
||||
'views' => rand(0, 5),
|
||||
'unique_views' => rand(0, 5),
|
||||
];
|
||||
|
||||
$timestamp = strtotime('+1 days', strtotime($startdate));
|
||||
}
|
||||
|
||||
return json_encode($data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue