Work on custom attendee questions
Start on moving surveys, widgets, check-in to their own pages
This commit is contained in:
parent
ad8b5d9f62
commit
6d101cea05
|
|
@ -138,7 +138,6 @@ class EventCheckoutController extends Controller
|
|||
$reservedTickets->session_id = session()->getId();
|
||||
$reservedTickets->save();
|
||||
|
||||
if ($event->ask_for_all_attendees_info) {
|
||||
for ($i = 0; $i < $current_ticket_quantity; $i++) {
|
||||
/*
|
||||
* Create our validation rules here
|
||||
|
|
@ -151,8 +150,21 @@ class EventCheckoutController extends Controller
|
|||
$validation_messages['ticket_holder_last_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s last name is required';
|
||||
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s email is required';
|
||||
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.email'] = 'Ticket holder ' . ($i + 1) . '\'s email appears to be invalid';
|
||||
|
||||
/*
|
||||
* Validation rules for custom questions
|
||||
*/
|
||||
foreach ($ticket->questions as $question) {
|
||||
|
||||
if($question->is_required) {
|
||||
$validation_rules['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id] = ['required'];
|
||||
$validation_messages['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id . '.required'] = "This question is required";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (empty($tickets)) {
|
||||
|
|
@ -443,6 +455,7 @@ class EventCheckoutController extends Controller
|
|||
$order->event_id = $ticket_order['event_id'];
|
||||
$order->save();
|
||||
|
||||
|
||||
/*
|
||||
* Update the event sales volume
|
||||
*/
|
||||
|
|
@ -517,24 +530,26 @@ class EventCheckoutController extends Controller
|
|||
$attendee->reference = $order->order_reference . '-' . ($attendee_increment);
|
||||
$attendee->save();
|
||||
|
||||
/*
|
||||
* Save the answers to any additional questions
|
||||
|
||||
/**
|
||||
* Save the attendee's questions
|
||||
*/
|
||||
foreach ($attendee_details['ticket']->questions as $question) {
|
||||
foreach ($attendee_details['ticket']->questions as $question) {
|
||||
|
||||
$ticket_answer = $ticket_questions[$attendee_details['ticket']->id][$i][$question->id];
|
||||
$ticket_answer = $ticket_questions[$attendee_details['ticket']->id][$i][$question->id];
|
||||
|
||||
if(!empty($ticket_answer)) {
|
||||
QuestionAnswer::create([
|
||||
'answer_text' => $ticket_answer,
|
||||
'attendee_id' => $attendee->id,
|
||||
'event_id' => $event->id,
|
||||
'account_id' => $event->account->id,
|
||||
'question_id' => $question->id
|
||||
]);
|
||||
if(!empty($ticket_answer)) {
|
||||
QuestionAnswer::create([
|
||||
'answer_text' => $ticket_answer,
|
||||
'attendee_id' => $attendee->id,
|
||||
'event_id' => $event->id,
|
||||
'account_id' => $event->account->id,
|
||||
'question_id' => $question->id
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Keep track of total number of attendees */
|
||||
$attendee_increment++;
|
||||
|
|
|
|||
|
|
@ -2,164 +2,9 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\StoreEventQuestionRequest;
|
||||
use App\Models\Event;
|
||||
use App\Models\Question;
|
||||
use App\Models\QuestionType;
|
||||
use Illuminate\Http\Request;
|
||||
/* Depreciated */
|
||||
|
||||
class EventQuestionsController extends MyBaseController
|
||||
{
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function showCreateEventQuestion(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
return view('ManageEvent.Modals.CreateQuestion', [
|
||||
'event' => $event,
|
||||
'modal_id' => $request->get('modal_id'),
|
||||
'question_types' => QuestionType::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @access public
|
||||
* @param StoreEventQuestionRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function postCreateEventQuestion(StoreEventQuestionRequest $request, $event_id)
|
||||
{
|
||||
|
||||
// Get the event or display a 'not found' warning.
|
||||
$event = Event::findOrFail($event_id);
|
||||
|
||||
// Create question.
|
||||
$question = Question::createNew(false, false, true);
|
||||
$question->title = $request->get('title');
|
||||
$question->instructions = $request->get('instructions');
|
||||
$question->is_required = ($request->get('is_required') == 'yes') ;
|
||||
$question->question_type_id = $request->get('question_type_id');
|
||||
$question->save();
|
||||
|
||||
// Get options.
|
||||
$options = $request->get('option');
|
||||
|
||||
// Add options.
|
||||
if ($options && is_array($options)) {
|
||||
foreach ($options as $option_name) {
|
||||
if (trim($option_name) !== '') {
|
||||
$question->options()->create([
|
||||
'name' => $option_name,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get tickets.
|
||||
$ticket_ids = $request->get('tickets');
|
||||
|
||||
$question->tickets()->attach($ticket_ids);
|
||||
|
||||
$event->questions()->attach($question->id);
|
||||
|
||||
session()->flash('message', 'Successfully Created Question');
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
'redirectUrl' => route('showEventCustomize', ['event_id' => $event_id]) . '#questions',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function showEditEventQuestion(Request $request, $event_id, $question_id)
|
||||
{
|
||||
$question = Question::scope()->findOrFail($question_id);
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$data = [
|
||||
'question' => $question,
|
||||
'event' => $event,
|
||||
'question_types' => QuestionType::all(),
|
||||
'modal_id' => $request->get('modal_id'),
|
||||
];
|
||||
|
||||
return view('ManageEvent.Modals.EditQuestion', $data);
|
||||
}
|
||||
|
||||
|
||||
public function postEditEventQuestion(Request $request, $event_id, $question_id)
|
||||
{
|
||||
// Get the event or display a 'not found' warning.
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
// Create question.
|
||||
$question = Question::scope()->findOrFail($question_id);
|
||||
$question->title = $request->get('title');
|
||||
$question->instructions = $request->get('instructions');
|
||||
$question->is_required = $request->get('is_required');
|
||||
$question->question_type_id = $request->get('question_type_id');
|
||||
$question->save();
|
||||
|
||||
// Get options.
|
||||
$options = $request->get('option');
|
||||
|
||||
$question->options()->delete();
|
||||
|
||||
// Add options.
|
||||
if ($options && is_array($options)) {
|
||||
foreach ($options as $option_name) {
|
||||
if (trim($option_name) !== '') {
|
||||
$question->options()->create([
|
||||
'name' => $option_name,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get tickets.
|
||||
$ticket_ids = $request->get('tickets');
|
||||
|
||||
$question->tickets()->sync($ticket_ids);
|
||||
|
||||
session()->flash('message', 'Successfully Edited Question');
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
'redirectUrl' => route('showEventCustomize', ['event_id' => $event_id]) . '#questions',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function postDeleteEventQuestion(Request $request, $event_id)
|
||||
{
|
||||
$question_id = $request->get('question_id');
|
||||
|
||||
$question = Question::scope()->find($question_id);
|
||||
|
||||
if ($question->delete()) {
|
||||
|
||||
session()->flash('message', 'Question Successfully Deleted');
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
'redirectUrl' => route('showEventCustomize', ['event_id' => $event_id]) . '#questions',
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'id' => $question->id,
|
||||
'message' => 'This question can\'t be deleted.',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\StoreEventQuestionRequest;
|
||||
use App\Models\Event;
|
||||
use App\Models\Question;
|
||||
use App\Models\QuestionType;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
class EventSurveyController extends MyBaseController
|
||||
{
|
||||
|
||||
|
||||
public function showEventSurveys(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$data = [
|
||||
'event' => $event,
|
||||
'questions' => $event->questions,
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'title',
|
||||
'q' => '',
|
||||
];
|
||||
|
||||
return view('ManageEvent.Surveys', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function showCreateEventQuestion(Request $request, $event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
return view('ManageEvent.Modals.CreateQuestion', [
|
||||
'event' => $event,
|
||||
'modal_id' => $request->get('modal_id'),
|
||||
'question_types' => QuestionType::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @access public
|
||||
* @param StoreEventQuestionRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function postCreateEventQuestion(StoreEventQuestionRequest $request, $event_id)
|
||||
{
|
||||
|
||||
// Get the event or display a 'not found' warning.
|
||||
$event = Event::findOrFail($event_id);
|
||||
|
||||
// Create question.
|
||||
$question = Question::createNew(false, false, true);
|
||||
$question->title = $request->get('title');
|
||||
$question->instructions = $request->get('instructions');
|
||||
$question->is_required = ($request->get('is_required') == 'yes') ;
|
||||
$question->question_type_id = $request->get('question_type_id');
|
||||
$question->save();
|
||||
|
||||
// Get options.
|
||||
$options = $request->get('option');
|
||||
|
||||
// Add options.
|
||||
if ($options && is_array($options)) {
|
||||
foreach ($options as $option_name) {
|
||||
if (trim($option_name) !== '') {
|
||||
$question->options()->create([
|
||||
'name' => $option_name,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get tickets.
|
||||
$ticket_ids = $request->get('tickets');
|
||||
|
||||
$question->tickets()->attach($ticket_ids);
|
||||
|
||||
$event->questions()->attach($question->id);
|
||||
|
||||
session()->flash('message', 'Successfully Created Question');
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
'redirectUrl' => '',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function showEditEventQuestion(Request $request, $event_id, $question_id)
|
||||
{
|
||||
$question = Question::scope()->findOrFail($question_id);
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$data = [
|
||||
'question' => $question,
|
||||
'event' => $event,
|
||||
'question_types' => QuestionType::all(),
|
||||
'modal_id' => $request->get('modal_id'),
|
||||
];
|
||||
|
||||
return view('ManageEvent.Modals.EditQuestion', $data);
|
||||
}
|
||||
|
||||
|
||||
public function postEditEventQuestion(Request $request, $event_id, $question_id)
|
||||
{
|
||||
// Get the event or display a 'not found' warning.
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
// Create question.
|
||||
$question = Question::scope()->findOrFail($question_id);
|
||||
$question->title = $request->get('title');
|
||||
$question->instructions = $request->get('instructions');
|
||||
$question->is_required = $request->get('is_required');
|
||||
$question->question_type_id = $request->get('question_type_id');
|
||||
$question->save();
|
||||
|
||||
// Get options.
|
||||
$options = $request->get('option');
|
||||
|
||||
$question->options()->delete();
|
||||
|
||||
// Add options.
|
||||
if ($options && is_array($options)) {
|
||||
foreach ($options as $option_name) {
|
||||
if (trim($option_name) !== '') {
|
||||
$question->options()->create([
|
||||
'name' => $option_name,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get tickets.
|
||||
$ticket_ids = $request->get('tickets');
|
||||
|
||||
$question->tickets()->sync($ticket_ids);
|
||||
|
||||
session()->flash('message', 'Successfully Edited Question');
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
'redirectUrl' => '',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function postDeleteEventQuestion(Request $request, $event_id)
|
||||
{
|
||||
$question_id = $request->get('question_id');
|
||||
|
||||
$question = Question::scope()->find($question_id);
|
||||
|
||||
if ($question->delete()) {
|
||||
|
||||
session()->flash('message', 'Question Successfully Deleted');
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
'redirectUrl' => route('showEventCustomize', ['event_id' => $event_id]) . '#questions',
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'id' => $question->id,
|
||||
'message' => 'This question can\'t be deleted.',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -375,36 +375,6 @@ Route::group(['middleware' => ['auth', 'first.run']], function () {
|
|||
'uses' => 'EventTicketQuestionsController@postCreateQuestion',
|
||||
]);
|
||||
|
||||
|
||||
/**
|
||||
* Event Questions
|
||||
*/
|
||||
Route::get('{event_id}/question/create', [
|
||||
'as' => 'showCreateEventQuestion',
|
||||
'uses' => 'EventQuestionsController@showCreateEventQuestion'
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/question/create', [
|
||||
'as' => 'postCreateEventQuestion',
|
||||
'uses' => 'EventQuestionsController@postCreateEventQuestion'
|
||||
]);
|
||||
|
||||
|
||||
Route::get('{event_id}/question/{question_id}', [
|
||||
'as' => 'showEditEventQuestion',
|
||||
'uses' => 'EventQuestionsController@showEditEventQuestion'
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/question/{question_id}', [
|
||||
'as' => 'postEditEventQuestion',
|
||||
'uses' => 'EventQuestionsController@postEditEventQuestion'
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/question/delete/{question_id}', [
|
||||
'as' => 'postDeleteEventQuestion',
|
||||
'uses' => 'EventQuestionsController@postDeleteEventQuestion'
|
||||
]);
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Attendees
|
||||
|
|
@ -569,6 +539,43 @@ Route::group(['middleware' => ['auth', 'first.run']], function () {
|
|||
'uses' => 'EventCustomizeController@postEditEventFees',
|
||||
]);
|
||||
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Event Survey page
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/surveys', [
|
||||
'as' => 'showEventSurveys',
|
||||
'uses' => 'EventSurveyController@showEventSurveys',
|
||||
]);
|
||||
Route::get('{event_id}/question/create', [
|
||||
'as' => 'showCreateEventQuestion',
|
||||
'uses' => 'EventSurveyController@showCreateEventQuestion'
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/question/create', [
|
||||
'as' => 'postCreateEventQuestion',
|
||||
'uses' => 'EventSurveyController@postCreateEventQuestion'
|
||||
]);
|
||||
|
||||
|
||||
Route::get('{event_id}/question/{question_id}', [
|
||||
'as' => 'showEditEventQuestion',
|
||||
'uses' => 'EventSurveyController@showEditEventQuestion'
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/question/{question_id}', [
|
||||
'as' => 'postEditEventQuestion',
|
||||
'uses' => 'EventSurveyController@postEditEventQuestion'
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/question/delete/{question_id}', [
|
||||
'as' => 'postDeleteEventQuestion',
|
||||
'uses' => 'EventSurveyController@postDeleteEventQuestion'
|
||||
]);
|
||||
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Check In App
|
||||
|
|
|
|||
|
|
@ -79,6 +79,14 @@ class Attendee extends MyBaseModel
|
|||
return $this->belongsTo('\App\Models\Event');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function answers()
|
||||
{
|
||||
return $this->hasMany('App\Models\QuestionAnswer');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to return attendees that have not cancelled.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ class Order extends MyBaseModel
|
|||
*/
|
||||
public $rules = [
|
||||
'order_first_name' => ['required'],
|
||||
'order_last_name' => ['required'],
|
||||
'order_email' => ['required', 'email'],
|
||||
'order_last_name' => ['required'],
|
||||
'order_email' => ['required', 'email'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -28,8 +28,8 @@ class Order extends MyBaseModel
|
|||
*/
|
||||
public $messages = [
|
||||
'order_first_name.required' => 'Please enter a valid first name',
|
||||
'order_last_name.required' => 'Please enter a valid last name',
|
||||
'order_email.email' => 'Please enter a valid email',
|
||||
'order_last_name.required' => 'Please enter a valid last name',
|
||||
'order_email.email' => 'Please enter a valid email',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -98,6 +98,7 @@ class Order extends MyBaseModel
|
|||
return $this->belongsTo('\App\Models\OrderStatus');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the organizer fee of the order.
|
||||
*
|
||||
|
|
@ -125,7 +126,7 @@ class Order extends MyBaseModel
|
|||
*/
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return $this->first_name.' '.$this->last_name;
|
||||
return $this->first_name . ' ' . $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -138,14 +139,14 @@ class Order extends MyBaseModel
|
|||
public function generatePdfTickets()
|
||||
{
|
||||
$data = [
|
||||
'order' => $this,
|
||||
'event' => $this->event,
|
||||
'tickets' => $this->event->tickets,
|
||||
'order' => $this,
|
||||
'event' => $this->event,
|
||||
'tickets' => $this->event->tickets,
|
||||
'attendees' => $this->attendees,
|
||||
];
|
||||
|
||||
$pdf_file_path = public_path(config('attendize.event_pdf_tickets_path')).'/'.$this->order_reference;
|
||||
$pdf_file = $pdf_file_path.'.pdf';
|
||||
$pdf_file_path = public_path(config('attendize.event_pdf_tickets_path')) . '/' . $this->order_reference;
|
||||
$pdf_file = $pdf_file_path . '.pdf';
|
||||
|
||||
if (file_exists($pdf_file)) {
|
||||
return true;
|
||||
|
|
@ -158,7 +159,7 @@ class Order extends MyBaseModel
|
|||
PDF::setOutputMode('F'); // force to file
|
||||
PDF::html('Public.ViewEvent.Partials.PDFTicket', $data, $pdf_file_path);
|
||||
|
||||
$this->ticket_pdf_path = config('attendize.event_pdf_tickets_path').'/'.$this->order_reference.'.pdf';
|
||||
$this->ticket_pdf_path = config('attendize.event_pdf_tickets_path') . '/' . $this->order_reference . '.pdf';
|
||||
$this->save();
|
||||
|
||||
return file_exists($pdf_file);
|
||||
|
|
@ -172,7 +173,7 @@ class Order extends MyBaseModel
|
|||
parent::boot();
|
||||
|
||||
static::creating(function ($order) {
|
||||
$order->order_reference = strtoupper(str_random(5)).date('jn');
|
||||
$order->order_reference = strtoupper(str_random(5)) . date('jn');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,20 +11,24 @@ class QuestionAnswer extends MyBaseModel
|
|||
'attendee_id',
|
||||
'account_id',
|
||||
'answer_text',
|
||||
'questionable_id',
|
||||
'questionable_type',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsToMany('\App\Models\Event');
|
||||
}
|
||||
|
||||
public function attendee()
|
||||
{
|
||||
return $this->belongsToMany('\App\Models\Attendee');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function question()
|
||||
{
|
||||
return $this->belongsToMany('\App\Models\Question');
|
||||
return $this->belongsTo('\App\Models\Question');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,17 +14,19 @@ class AddQuestionAnswersTable extends Migration
|
|||
{
|
||||
Schema::create('question_answers', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->integer('attendee_id')->unsigned()->index();
|
||||
|
||||
$table->integer('event_id')->unsigned()->index();
|
||||
$table->integer('question_id')->unsigned()->index();
|
||||
$table->integer('account_id')->unsigned()->index();
|
||||
$table->text('answer_text');
|
||||
$table->nullableTimestamps();
|
||||
|
||||
$table->foreign('attendee_id')->references('id')->on('attendees');
|
||||
$table->foreign('question_id')->references('id')->on('questions');
|
||||
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
$table->foreign('attendee_id')->references('id')->on('attendees')->onDelete('cascade');
|
||||
$table->foreign('event_id')->references('id')->on('events')->onDelete('cascade');
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -159,14 +159,7 @@ $(function() {
|
|||
$('.contact_form').slideToggle();
|
||||
});
|
||||
|
||||
$('#mirror_buyer_info').change(function(e) {
|
||||
|
||||
if ($(this).prop('checked')) {
|
||||
$('.ticket_holders_details').slideUp();
|
||||
} else {
|
||||
$('.ticket_holders_details').slideDown();
|
||||
}
|
||||
|
||||
$('#mirror_buyer_info').on('click', function(e) {
|
||||
$('.ticket_holder_first_name').val($('#order_first_name').val());
|
||||
$('.ticket_holder_last_name').val($('#order_last_name').val());
|
||||
$('.ticket_holder_email').val($('#order_email').val());
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -195,8 +195,7 @@
|
|||
<li data-route="{{route('showEventCustomizeTab', ['event_id' => $event->id, 'tab' => 'order_page'])}}"
|
||||
class="{{$tab == 'order_page' ? 'active' : ''}}"><a href="#order_page" data-toggle="tab">Order
|
||||
Form</a></li>
|
||||
<li data-route="{{route('showEventCustomizeTab', ['event_id' => $event->id, 'tab' => 'questions'])}}"
|
||||
class="{{$tab == 'questions' ? 'active' : ''}}"><a href="#questions" data-toggle="tab">Questions & Answers</a></li>
|
||||
|
||||
<li data-route="{{route('showEventCustomizeTab', ['event_id' => $event->id, 'tab' => 'social'])}}"
|
||||
class="{{$tab == 'social' ? 'active' : ''}}"><a href="#social" data-toggle="tab">Social</a></li>
|
||||
<li data-route="{{route('showEventCustomizeTab', ['event_id' => $event->id, 'tab' => 'affiliates'])}}"
|
||||
|
|
@ -496,7 +495,7 @@
|
|||
</div>
|
||||
<div class="help-block">
|
||||
If checked, the buyer will be asked for details of each attendee; as opposed to just
|
||||
himself.
|
||||
themselves.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -535,87 +534,8 @@
|
|||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane {{$tab == 'questions' ? 'active' : ''}}" id="questions">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
{!! Form::label('questions_collection_type', 'Question Collection Type', array('class'=>'control-label required')) !!}
|
||||
{!! Form::select('questions_collection_type', [
|
||||
'attendee' => 'Collect information for each attendee.',
|
||||
'buyer' => 'Only collect information for the buyer.'], $event->questions_collection_type,
|
||||
array(
|
||||
'class'=>'form-control'
|
||||
)) !!}
|
||||
</div>
|
||||
|
||||
<h4>Attendees questions</h4>
|
||||
<div class="panel">
|
||||
<div class="table-responsive">
|
||||
@if($questions->count())
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th>
|
||||
Question Title
|
||||
</th>
|
||||
<th>
|
||||
Question Type
|
||||
</th>
|
||||
<th>
|
||||
Required
|
||||
</th>
|
||||
<th>
|
||||
Applies to tickets
|
||||
</th>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($questions as $question)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $question->title }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $question->question_type->name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $question->is_required ? 'Yes' : 'No' }}
|
||||
</td>
|
||||
<td>
|
||||
{{implode(', ', array_column($question->tickets->toArray(), 'title'))}}
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-xs btn-primary loadModal" data-modal-id="EditQuestion" href="javascript:void(0);"
|
||||
data-href="{{route('showEditEventQuestion', ['event_id' => $event->id, 'question_id' => $question->id])}}">
|
||||
Edit
|
||||
</a>
|
||||
<a data-id="{{ $question->id }}" data-route="{{ route('postDeleteEventQuestion', ['event_id' => $event->id, 'question_id' => $question->id]) }}" data-type="question" href="javascript:void(0);" class="btn btn-xs btn-danger deleteThis">
|
||||
Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@else
|
||||
<div class="panel-body">
|
||||
You haven't added any questions yet. You can add question by clicking the '<b>Add Question</b>' button below.
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="panel-footer mt15 text-right">
|
||||
<button class="loadModal btn btn-success" type="button" data-modal-id="EditQuestion" href="javascript:void(0);"
|
||||
data-href="{{route('showCreateEventQuestion', ['event_id' => $event->id])}}">
|
||||
<i class="ico-question"></i> Add question
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane {{$tab == 'ticket_design' ? 'active' : ''}}" id="ticket_design">
|
||||
{!! Form::model($event, array('url' => route('postEditEventTicketDesign', ['event_id' => $event->id]), 'class' => 'ajax ')) !!}
|
||||
<h4>Ticket Design</h4>
|
||||
|
|
|
|||
|
|
@ -48,5 +48,25 @@
|
|||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h5 class="heading">Event Tools</h5>
|
||||
<ul id="nav_event" class="topmenu">
|
||||
<li class="{{ Request::is('*check_in*') ? 'active' : '' }}">
|
||||
<a href="{{route('showChechIn', array('event_id' => $event->id))}}">
|
||||
<span class="figure"><i class="ico-checkbox-checked"></i></span>
|
||||
<span class="text">Check-In</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('*surveys*') ? 'active' : '' }}">
|
||||
<a href="{{route('showEventSurveys', array('event_id' => $event->id))}}">
|
||||
<span class="figure"><i class="ico-question"></i></span>
|
||||
<span class="text">Surveys</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('*check_in*') ? 'active' : '' }}">
|
||||
<a href="{{route('showChechIn', array('event_id' => $event->id))}}">
|
||||
<span class="figure"><i class="ico-code"></i></span>
|
||||
<span class="text">Widgets</span>
|
||||
</a>
|
||||
</li>
|
||||
</section>
|
||||
</aside>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
@extends('Shared.Layouts.BlankSlate')
|
||||
|
||||
@section('blankslate-icon-class')
|
||||
ico-question2
|
||||
@stop
|
||||
|
||||
@section('blankslate-title')
|
||||
No Questions Yet
|
||||
@stop
|
||||
|
||||
@section('blankslate-text')
|
||||
Here you can add questions which attendees will be asked to answer during the check-out process.
|
||||
@stop
|
||||
|
||||
@section('blankslate-body')
|
||||
<button data-invoke="modal" data-modal-id='CreateQuestion' data-href="{{route('showCreateTicket', array('event_id'=>$event->id))}}" href='javascript:void(0);' class=' btn btn-success mt5 btn-lg' type="button" >
|
||||
<i class="ico-question"></i>
|
||||
Create Question
|
||||
</button>
|
||||
@stop
|
||||
|
||||
|
||||
|
|
@ -13,9 +13,8 @@
|
|||
@stop
|
||||
|
||||
@section('blankslate-body')
|
||||
<button data-invoke="modal" data-modal-id='CreateTicket' data-href="{{route('showCreateTicket', array('event_id'=>$event->id))}}" href='javascript:void(0);' class=' btn btn-success mt5 btn-lg' type="button" >
|
||||
<i class="ico-ticket"></i>
|
||||
Create Ticket
|
||||
</button>
|
||||
<button data-invoke="modal" data-modal-id='CreateTicket' data-href="{{route('showCreateTicket', array('event_id'=>$event->id))}}" href='javascript:void(0);' class=' btn btn-success mt5 btn-lg' type="button" >
|
||||
<i class="ico-ticket"></i>
|
||||
Create Ticket
|
||||
</button>
|
||||
@stop
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,130 @@
|
|||
@extends('Shared.Layouts.Master')
|
||||
|
||||
@section('title')
|
||||
@parent
|
||||
|
||||
Event Surveys
|
||||
@stop
|
||||
|
||||
@section('top_nav')
|
||||
@include('ManageEvent.Partials.TopNav')
|
||||
@stop
|
||||
|
||||
@section('menu')
|
||||
@include('ManageEvent.Partials.Sidebar')
|
||||
@stop
|
||||
|
||||
@section('page_title')
|
||||
<i class='ico-cart mr5'></i>
|
||||
Event Surveys
|
||||
@stop
|
||||
|
||||
@section('head')
|
||||
|
||||
@stop
|
||||
|
||||
@section('page_header')
|
||||
<div class="col-md-9 col-sm-6">
|
||||
<!-- Toolbar -->
|
||||
<div class="btn-toolbar" role="toolbar">
|
||||
<button class="loadModal btn btn-success" type="button" data-modal-id="CreateQuestion" href="javascript:void(0);"
|
||||
data-href="{{route('showCreateEventQuestion', ['event_id' => $event->id])}}">
|
||||
<i class="ico-question"></i> Add question
|
||||
</button>
|
||||
|
||||
<div class="btn-group btn-group btn-group-responsive">
|
||||
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="ico-users"></i> Export Answers <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="{{route('showExportOrders', ['event_id'=>$event->id,'export_as'=>'xlsx'])}}">Excel (XLSX)</a></li>
|
||||
<li><a href="{{route('showExportOrders', ['event_id'=>$event->id,'export_as'=>'xls'])}}">Excel (XLS)</a></li>
|
||||
<li><a href="{{route('showExportOrders', ['event_id'=>$event->id,'export_as'=>'csv'])}}">CSV</a></li>
|
||||
<li><a href="{{route('showExportOrders', ['event_id'=>$event->id,'export_as'=>'html'])}}">HTML</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Toolbar -->
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6">
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
|
||||
@section('content')
|
||||
<!--Start Questions table-->
|
||||
<div class="row">
|
||||
|
||||
@if($questions->count())
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<!-- START panel -->
|
||||
<div class="panel">
|
||||
<div class="table-responsive">
|
||||
@if($questions->count())
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th>
|
||||
Question Title
|
||||
</th>
|
||||
<th>
|
||||
Question Type
|
||||
</th>
|
||||
<th>
|
||||
Required
|
||||
</th>
|
||||
<th>
|
||||
Applies to tickets
|
||||
</th>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($questions as $question)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $question->title }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $question->question_type->name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $question->is_required ? 'Yes' : 'No' }}
|
||||
</td>
|
||||
<td>
|
||||
{{implode(', ', array_column($question->tickets->toArray(), 'title'))}}
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-xs btn-primary loadModal" data-modal-id="EditQuestion" href="javascript:void(0);"
|
||||
data-href="{{route('showEditEventQuestion', ['event_id' => $event->id, 'question_id' => $question->id])}}">
|
||||
Edit
|
||||
</a>
|
||||
<a data-id="{{ $question->id }}" data-route="{{ route('postDeleteEventQuestion', ['event_id' => $event->id, 'question_id' => $question->id]) }}" data-type="question" href="javascript:void(0);" class="btn btn-xs btn-danger deleteThis">
|
||||
Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@else
|
||||
<div class="panel-body">
|
||||
You haven't added any questions yet. You can add question by clicking the '<b>Add Question</b>' button below.
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@else
|
||||
|
||||
@include('ManageEvent.Partials.SurveyBlankSlate')
|
||||
|
||||
@endif
|
||||
</div> <!--/End attendees table-->
|
||||
@stop
|
||||
|
|
@ -4,24 +4,24 @@
|
|||
{!! Form::label("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]", $question->title, ['class' => $question->is_required ? 'required' : '']) !!}
|
||||
|
||||
@if($question->question_type_id == config('attendize.question_textbox_single'))
|
||||
{!! Form::text("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]", null, ['required' => $question->is_required ? 'required' : '', 'class' => "ticket_holder_email.$i.{$ticket['ticket']['id']} form-control"]) !!}
|
||||
{!! Form::text("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]", null, ['required' => $question->is_required ? 'required' : '', 'class' => "ticket_holder_questions.{$ticket->id}.{$i}.{$question->id} form-control"]) !!}
|
||||
@elseif($question->question_type_id == config('attendize.question_textbox_multi'))
|
||||
{!! Form::textarea("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]", null, ['rows'=>5, 'required' => $question->is_required ? 'required' : '', 'class' => "ticket_holder_question.{$ticket['ticket']['id']}.$i.$question->id form-control"]) !!}
|
||||
{!! Form::textarea("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]", null, ['rows'=>5, 'required' => $question->is_required ? 'required' : '', 'class' => "ticket_holder_questions.{$ticket->id}.{$i}.{$question->id} form-control"]) !!}
|
||||
@elseif($question->question_type_id == config('attendize.question_dropdown_single'))
|
||||
{!! Form::select("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$question->options->lists('name', 'id'), null, ['required' => $question->is_required ? 'required' : '', 'class' => "ticket_holder_question.{$ticket['ticket']['id']}.$i.$question->id form-control"]) !!}
|
||||
{!! Form::select("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$question->options->lists('name', 'name'), null, ['required' => $question->is_required ? 'required' : '', 'class' => "ticket_holder_questions.{$ticket->id}.{$i}.{$question->id} form-control"]) !!}
|
||||
@elseif($question->question_type_id == config('attendize.question_dropdown_multi'))
|
||||
{!! Form::select("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$question->options->lists('name', 'id'), null, ['required' => $question->is_required ? 'required' : '', 'multiple' => 'multiple','class' => "ticket_holder_question.{$ticket['ticket']['id']}.$i.$question->id form-control"]) !!}
|
||||
{!! Form::select("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$question->options->lists('name', 'name'), null, ['required' => $question->is_required ? 'required' : '', 'multiple' => 'multiple','class' => "ticket_holder_questions.{$ticket->id}.{$i}.{$question->id} form-control"]) !!}
|
||||
@elseif($question->question_type_id == config('attendize.question_checkbox_multi'))
|
||||
<br>
|
||||
@foreach($question->options as $option)
|
||||
{{$option->name}}
|
||||
{!! Form::checkbox("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$option->name) !!}<br>
|
||||
{!! Form::checkbox("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$option->name, false,['class' => "ticket_holder_questions.{$ticket->id}.{$i}.{$question->id} form-control"]) !!}<br>
|
||||
@endforeach
|
||||
@elseif($question->question_type_id == config('attendize.question_radio_single'))
|
||||
<br>
|
||||
@foreach($question->options as $option)
|
||||
{{$option->name}}
|
||||
{!! Form::radio("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$option->name) !!}<br>
|
||||
{!! Form::radio("ticket_holder_questions[{$ticket->id}][{$i}][$question->id]",$option->name, false, ['class' => "ticket_holder_questions.{$ticket->id}.{$i}.{$question->id} form-control"]) !!}<br>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
|
|
|
|||
|
|
@ -75,14 +75,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@if($event->ask_for_all_attendees_info)
|
||||
<div class="p20 pl0">
|
||||
{!! Form::label("mirror_buyer_info", 'Use buyer details for all ticket holders') !!}
|
||||
{!! Form::checkbox("mirror_buyer_info", 'on', false) !!}
|
||||
<a href="javascript:void(0);" class="btn btn-primary btn-xs" id="mirror_buyer_info">
|
||||
Copy buyer details to all ticket holders
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($event->ask_for_all_attendees_info)
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
|
@ -133,7 +130,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
@if($order_requires_payment && @$payment_gateway->is_on_site)
|
||||
|
||||
<h3>Payment Information</h3>
|
||||
|
|
|
|||
Loading…
Reference in New Issue