@extends('layouts.master') @section('content') @php $stat_service = new \App\Services\StatisticService(); [$title, $description, $event_type, $selected_categories, $event_picture, $scala_picture_id, $scala_picture_URL] = $stat_service->getValues('OVA', request()->get('stat_id')); $selected_categories = null; $via_template = 0; $online_event = null; $filiale_event = true; $event_district = null; $show_on_website = true; // Online Event Type $online_event_type_filiale = true; $online_event_type_partner = null; $online_event_type_large = null; // Images $scala_logo_id = null; $scala_logo_URL = ''; $bubble_deactivated = null; // Partner info $partner = null; // Checkbox $partner_name = null; $partner_street = null; $partner_zipcode = null; $partner_city = null; $partner_website = null; $partner_logo = null; $partner_logo_URL = ''; // Address info $custom_address_name = null; $custom_address_street = null; $custom_address_zipcode = null; $custom_address_city = null; $telephone = null; // Address type $partner_address_type = null; $filiale_address_type = null; $custom_address_type = null; // Registration info $paid_entry = null; // Checkbox $ticket_price = null; $ticket_desk = null; $ticket_deadline = null; $registration_required = null; // Checkbox $registration_fee = null; $max_attendees = '1'; $max_plus_allowed = '0'; $registration_deadline = null; $free_entry = null; $contact_email = null; $status_email = null; // Checkbox $all_emails = null; // Checkbox // Social media $social_media = false; $facebook = null; $linkedin = null; $google = null; // Active Tracking for Social Media options $active_tracking = false; // Touch points $stw = 1; $sf = 1; $sb = 1; // Updating an Event if (isset($event)) { $title = $event->title; $description = $event->description; $event_type = $event->event_type; $via_template = $event->via_template; $event_district = $event->district; if ((int) $event->online_event === 0) { $filiale_event = true; } elseif ((int) $event->online_event === 1) { $online_event = true; if ((int) $event->online_event_partner === 1) { $online_event_type_partner = true; } elseif ((int) $event->online_event_partner === 2) { $online_event_type_large = true; } else { $online_event_type_filiale = true; } } if ($event->has_partner === 1) { $partner = 1; // Checkbox } foreach ($event->addresses as $addr) { if ($addr->type === 1) { $partner_name = $addr->name; $partner_street = $addr->street; $partner_zipcode = $addr->PLZ; $partner_city = $addr->ort; $partner_website = $addr->website; $partner_logo = $addr->logo; $telephone = $addr->telephone; } if ((int) $event->address_type === (int) $addr->type) { $custom_address_name = $addr->name; $custom_address_street = $addr->street; $custom_address_zipcode = $addr->PLZ; $custom_address_city = $addr->ort; $telephone = $addr->telephone; } } $selected_categories = $event->categories; $event_picture = $event->details->picture; // Changing logic because of old IDs for picture and logo from previous scala CM $picture_id = (int) $event->details->scala_picture_id; $logo_id = (int) $event->details->scala_logo_id; // Event picture if ($picture_id === 1) { $scala_picture_id = 1; $scala_picture_URL = Helper::getEventCalendarImageURL($event_picture); } elseif ($picture_id !== 0) { $scala_picture_id = $picture_id; $scala_picture_URL = Helper::getScalaMedia($scala_picture_id); } // Logo if ($logo_id === 1) { if ($partner_logo) { $scala_logo_id = 1; $scala_logo_URL = Helper::getEventCalendarImageURL($partner_logo); } } elseif ($logo_id !== 0) { $scala_logo_id = $event->details->scala_logo_id; $scala_logo_URL = Helper::getScalaMedia($scala_logo_id); } if (isset($event->bubble_deactivated) && (int) $event->bubble_deactivated === 1) { $bubble_deactivated = true; } // Assign address type $address_type = (int) $event->address_type; if ($address_type === 1) { $partner_address_type = true; } elseif ($address_type === 2) { $filiale_address_type = true; } elseif ($address_type === 3) { $custom_address_type = true; } if ($event->details->ticket_price !== '0') { $paid_entry = true; // Checkbox $ticket_price = $event->details->ticket_price; $ticket_desk = $event->details->ticket_desk; $ticket_deadline = $event->details->ticket_deadline; } if ($event->details->registration_required === 1) { $registration_required = true; // Checkbox $max_attendees = $event->details->max_attendees; $max_plus_allowed = $event->details->max_plus_allowed; $registration_deadline = $event->details->registration_deadline; $registration_fee = $event->details->registration_fee; } if (!$registration_required && !$paid_entry) { $free_entry = true; } $contact_email = $event->details->contact_email; // Email notification choice if ($event->details->notification_choice === 1) { $status_email = true; // Checkbox } elseif ($event->details->notification_choice === 2) { $all_emails = true; // Checkbox } elseif ($event->details->notification_choice === 3) { $status_email = true; // Checkbox $all_emails = true; // Checkboxes } // Active Tracking for Social Media options if (isset($event->tracking_id)) { if ($tracking = \App\Models\Tracking::find($event->tracking_id)) { if ($tracking->active === 1) { $active_tracking = true; } } } if (isset($event->social_media)) { $platforms = []; foreach (['facebook', 'linkedin', 'google'] as $platform) { if ($event->social_media->{$platform} !== 0) { $social_media = 1; ${$platform} = 1; if ($platform === 'google') { $platforms[] = 'Google my business'; } elseif ($platform === 'facebook') { $platforms[] = 'Facebook/Instagram (99 Euro Kostenbeteiligung)'; } elseif ($platform === 'linkedin') { $platforms[] = 'Linkedin (99 Euro Kostenbeteiligung)'; } } } $platforms = implode(', ', $platforms); } if (isset($event->touch_point)) { if ($event->touch_point->stw === 0) { $stw = null; } if ($event->touch_point->sb === 0) { $sb = null; } if ($event->touch_point->sf === 0) { $sf = null; } } if (isset($event->show_on_website) && (int) $event->show_on_website === 0) { $show_on_website = null; } } if (old('scala_picture_id')) { $scala_picture_id = (int) old('scala_picture_id'); if (!in_array($scala_picture_id, [0, 1])) { $scala_picture_URL = Helper::getScalaMedia($scala_picture_id); } } @endphp