Updates to 03-2025

This commit is contained in:
Kevin Adametz 2025-04-01 10:40:14 +02:00
parent 881fc84207
commit 4eb83def39
142 changed files with 21396 additions and 11243 deletions

View file

@ -1,234 +0,0 @@
<?php
namespace App\Helper;
use App\Models\BookingDocument;
class BookingDocument
{
private static $files_count = 0;
public static function getFilesCount(){
return self::$files_count++;
}
public static function getBookingDocumentsHTMLTable($identifier, $booking){
$ret = "";
$files = self::getV2BookingDocuments($identifier, $booking);
if($files){
$ret .= self::makeHTMLTable($files, $identifier, 'v2');
}
return $ret;
//TODO !!! v3 save data and output
$files = self::getBookingDocuments($identifier, $booking->id);
if($files){
$ret .= self::makeHTMLTable($files, $identifier, 'v3');
}else{
$files = self::getV2BookingDocuments($identifier, $booking);
if($files){
$ret .= self::makeHTMLTable($files, $identifier, 'v2');
}
}
return $ret;
}
public static function getBookingDocuments($identifier, $booking_id){
switch($identifier){
case 'registration':
$files = BookingDocument::where('booking_id', $booking_id)->where('identifier', 'registration')->get();
break;
case 'confirmation':
$files = BookingDocument::where('booking_id', $booking_id)->where('identifier', 'confirmation')->get();
break;
case 'storno':
$files = BookingDocument::where('booking_id', $booking_id)->where('identifier', 'storno')->get();
break;
case 'coupon':
$files = BookingDocument::where('booking_id', $booking_id)->where('identifier', 'coupon')->get();
break;
case 'voucher':
$files = BookingDocument::where('booking_id', $booking_id)->where('identifier', 'voucher')->get();
break;
case 'voucher_agency':
$files = BookingDocument::where('booking_id', $booking_id)->where('identifier', 'voucher_agency')->get();
break;
default:
$files = null;
}
return $files;
}
public static function getV2BookingDocuments($identifier, $booking){
switch($identifier){
case 'registration':
$files = $booking->booking_applications;
break;
case 'confirmation':
$files = $booking->booking_confirmations;
break;
case 'storno':
$files = $booking->booking_stornos;
break;
case 'coupon':
$files = $booking->coupons;
break;
case 'voucher':
$files = $booking->booking_vouchers;
break;
case 'voucher_agency':
$files = $booking->booking_voucher_agencys;
break;
default:
$files = null;
}
return $files;
}
private static function makeHTMLTable($files, $identifier, $version){
$ret = "";
foreach($files as $file){
;
if($version === 'v2'){
$file_details = self::getV2FileDetails($file, $identifier);
}
if($version === 'v3'){
$file_details = self::getV2FileDetails($file, $identifier);
}
if(isset($file_details)){
$ret .= "<tr>";
$ret .= "<th scope='row'>".self::getFilesCount()."</th>";
$ret .= "<td>";
$ret .= "<a href='".route('customer_file_show', [$identifier, $file->id])."' target='_blank' class='badge badge-md badge-".$file_details->color."'>";
$ret .= "<i class='fa fa-file-pdf mr-1'></i> ".$file_details->name;
$ret .= "</a>";
$ret .= "</td>";
$ret .= "<td>".$file_details->cell."</td>";
$ret .= "<td>".$file_details->date."</td>";
$ret .= "<td>";
$ret .= "<a href='".route('customer_file_show', [$identifier, $file->id, true])."' class='btn btn-xs btn-default' title='Download' data-placement='left' rel='tooltip'>";
$ret .= "<i class='fa fa-download'></i>";
$ret .= "</a>";
$ret .= "</td>";
$ret .= "</tr>";
}
}
return $ret;
}
private static function getV3FileDetails($file, $identifier){
$ret = new \stdClass();
switch($identifier){
case 'registration':
$ret->name = "Reiseanmeldung";
$ret->color = "primary";
$ret->cell = "Reise | Gesamtpreis: ".\App\Services\Util::_number_format($file->total)." &euro;";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'confirmation':
$ret->name = "Reisebestätigung";
$ret->color = "success";
$ret->cell = "Reise | Gesamtpreis: ".\App\Services\Util::_number_format($file->total)." &euro; <br>
Anzahlung: ".\App\Services\Util::_number_format($file->deposit)." &euro; <br>
Restzahlung: ".\App\Services\Util::_number_format($file->final_payment)." &euro;";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'storno':
$ret->name = "Stornobestätigung";
$ret->color = "danger";
$ret->cell = "Storno | Betrag: ".\App\Services\Util::_number_format($file->total)." &euro;";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'coupon':
$ret->name = "Gutschein ".$file->number;
$ret->color = "danger";
$ret->cell = "Gutschein | Wert: ".\App\Services\Util::_number_format($file->value)." &euro; |
bis: ".\App\Services\Util::_format_date($file->valid_date, 'date')." |
".(($file->is_redeemed) ? '<i class="fa fa-check-circle text-success"></i> '.\App\Services\Util::_format_date($file->redeem_date, 'date') : '<i class="fa fa-times-circle text-danger"></i>')."";
$ret->date = \App\Services\Util::_format_date($file->issue_date, 'date');
break;
case 'voucher':
$ret->name = " Voucher ID ".$file->id;
$ret->color = "dark";
$ret->cell = " Voucher für den Kunden";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'voucher_agency':
$ret->name = "Voucher-Agentur ID ".$file->id;
$ret->color = "dark";
$ret->cell = "Voucher für die Agentur";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
default:
$ret->name = "";
$ret->color = "";
$ret->cell = "";
$ret->date = "";
}
return $ret;
return $ret;
}
private static function getV2FileDetails($file, $identifier){
$ret = new \stdClass();
switch($identifier){
case 'registration':
$ret->name = "Reiseanmeldung";
$ret->color = "primary";
$ret->cell = "Reise | Gesamtpreis: ".\App\Services\Util::_number_format($file->total)." &euro;";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'confirmation':
$ret->name = "Reisebestätigung";
$ret->color = "success";
$ret->cell = "Reise | Gesamtpreis: ".\App\Services\Util::_number_format($file->total)." &euro; <br>
Anzahlung: ".\App\Services\Util::_number_format($file->deposit)." &euro; <br>
Restzahlung: ".\App\Services\Util::_number_format($file->final_payment)." &euro;";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'storno':
$ret->name = "Stornobestätigung";
$ret->color = "danger";
$ret->cell = "Storno | Betrag: ".\App\Services\Util::_number_format($file->total)." &euro;";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'coupon':
$ret->name = "Gutschein ".$file->number;
$ret->color = "danger";
$ret->cell = "Gutschein | Wert: ".\App\Services\Util::_number_format($file->value)." &euro; |
bis: ".\App\Services\Util::_format_date($file->valid_date, 'date')." |
".(($file->is_redeemed) ? '<i class="fa fa-check-circle text-success"></i> '.\App\Services\Util::_format_date($file->redeem_date, 'date') : '<i class="fa fa-times-circle text-danger"></i>')."";
$ret->date = \App\Services\Util::_format_date($file->issue_date, 'date');
break;
case 'voucher':
$ret->name = " Voucher ID ".$file->id;
$ret->color = "dark";
$ret->cell = " Voucher für den Kunden";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
case 'voucher_agency':
$ret->name = "Voucher-Agentur ID ".$file->id;
$ret->color = "dark";
$ret->cell = "Voucher für die Agentur";
$ret->date = \App\Services\Util::_format_date($file->updated_at, 'date');
break;
default:
$ret->name = "";
$ret->color = "";
$ret->cell = "";
$ret->date = "";
}
return $ret;
}
}

View file

@ -474,7 +474,10 @@ class HTMLHelper
$dom = new \DOMDocument('1.0', 'UTF-8');
//@$dom->loadHTML();
if($html == ""){
return "";
}
@$dom->loadHTML( mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
if(isset($arg['src'])){

View file

@ -58,7 +58,7 @@ class ReportFewoController extends Controller
}
if(Request::get('filter_date_to') != ""){
$date_to = Carbon::parse(Request::get('filter_date_to'))->format("Y-m-d");
$query->where("to_date", '<=', $date_to);
$query->where("from_date", '<=', $date_to);
}
if(Request::get('filter_booking_date_from') != ""){

View file

@ -36,20 +36,19 @@ class AdminUserController extends Controller
];
$user = User::findOrFail(8);
/* $MyGoogle2FA = new MyGoogle2FA();
/* $MyGoogle2FA = new MyGoogle2FA();
$valid = $MyGoogle2FA->init($user)->check2Fa('676493');
dd($valid); */
dd($valid); */
return view('admin.users', $data);
}
public function edit($id)
{
if($id == "new"){
if ($id == "new") {
$user = new User();
}else{
} else {
$user = User::findOrFail($id);
}
/*if(!$user->account){
$user->account = new Account();
@ -60,21 +59,19 @@ class AdminUserController extends Controller
'isFromAdmin' => 'true',
];
return view('admin.user_edit', $data);
}
public function store()
{
$data = Request::all();
if($data['user_id'] === "new"){
if ($data['user_id'] === "new") {
$rules = array(
'name' => 'required',
'email' => 'required|string|email|max:255|unique:users',
'email-confirm' => 'required|same:email',
);
}else{
} else {
$rules = array(
'name' => 'required'
);
@ -84,27 +81,24 @@ class AdminUserController extends Controller
return back()->withRequest(Request::all())->withErrors($validator);
}
if($data['user_id'] === "new"){
if ($data['user_id'] === "new") {
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => env('APP_KEY'),
]);
$unique = false;
do{
do {
$confirmation_code = str_random(30);
if( User::where('confirmation_code', '=', $confirmation_code)->count() == 0){
if (User::where('confirmation_code', '=', $confirmation_code)->count() == 0) {
$unique = true;
}
}
while(!$unique);
} while (!$unique);
$user->confirmation_code = $confirmation_code;
$user->save();
Mail::to($user->email)->send(new MailVerifyContact($confirmation_code, $user));
}else{
} else {
$user = User::findOrFail($data['user_id']);
$user->name = $data['name'];
$user->save();
@ -121,54 +115,54 @@ class AdminUserController extends Controller
\Session()->flash('alert-success', "Kontakt gelöscht");
return redirect('/admin/users');
}
public function loadModal($id){
public function loadModal($id)
{
if(Request::ajax()) {
if (Request::ajax()) {
$data = Request::all();
$user = User::findOrFail($id);
if(isset($data['action'])){
if($data['action'] === 'show-user-roles'){
if (isset($data['action'])) {
if ($data['action'] === 'show-user-roles') {
$fill = [
'user' => $user,
'action' => $data['action'],
'groups' => config('permissions.groups'),
'roles' => config('permissions.roles')
];
return view("admin.user_modal", $fill )->render();
return view("admin.user_modal", $fill)->render();
}
if($data['action'] === 'show-user-active'){
if ($data['action'] === 'show-user-active') {
$fill = [
'user' => $user,
'action' => $data['action'],
];
return view("admin.active_modal", $fill )->render();
return view("admin.active_modal", $fill)->render();
}
if($data['action'] === 'show-user-google2fa'){
if($user->isGoogle2Fa()){
if ($data['action'] === 'show-user-google2fa') {
if ($user->isGoogle2Fa()) {
$MyGoogle2FA = new MyGoogle2FA();
$MyGoogle2FA->init($user);
$MyGoogle2FA->init($user);
$fill = [
'user' => $user,
'action' => 'delete-user-google2fa',
'MyGoogle2FA' => $MyGoogle2FA,
];
return view("admin.google2fa_delete_modal", $fill )->render();
}else{
return view("admin.google2fa_delete_modal", $fill)->render();
} else {
$MyGoogle2FA = new MyGoogle2FA();
$MyGoogle2FA->init($user)->generate();
$MyGoogle2FA->init($user)->generate();
$fill = [
'user' => $user,
'action' => 'activate-user-google2fa',
'MyGoogle2FA' => $MyGoogle2FA,
];
return view("admin.google2fa_modal", $fill )->render();
return view("admin.google2fa_modal", $fill)->render();
}
}
}
@ -176,9 +170,10 @@ class AdminUserController extends Controller
return false;
}
public function updateModal($action = false){
public function updateModal($action = false)
{
if($action=== 'show-user-roles'){
if ($action === 'show-user-roles') {
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->permissions = isset($data['permissions']) ? $data['permissions'] : [];
@ -187,17 +182,15 @@ class AdminUserController extends Controller
$user->active = isset($data['active']) ? true : false;
$user->save();
\Session()->flash('alert-save', true);
}
if($action=== 'show-user-active'){
if ($action === 'show-user-active') {
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->active = isset($data['active']) ? true : false;
$user->save();
\Session()->flash('alert-save', true);
}
if($action=== 'activate-user-google2fa'){
if ($action === 'activate-user-google2fa') {
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->google2fa = true;
@ -205,7 +198,7 @@ class AdminUserController extends Controller
\Session()->flash('alert-save', true);
}
if($action=== 'delete-user-google2fa'){
if ($action === 'delete-user-google2fa') {
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->google2fa = false;
@ -228,23 +221,22 @@ class AdminUserController extends Controller
return '<a href="' . route('admin_user_edit', [$user->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('admin', function (User $user) {
return '<a href="#" data-url="'.route('admin_user_load_modal', $user->id).'" data-data="'.$user->id.'" data-action="show-user-roles" class="update_modal_data_show">'.HTMLHelper::getRoleLabel($user->admin, '<i class="fa fa-edit"></i> Rechte + ','').'</a>';
return '<a href="#" data-url="' . route('admin_user_load_modal', $user->id) . '" data-data="' . $user->id . '" data-action="show-user-roles" class="update_modal_data_show">' . HTMLHelper::getRoleLabel($user->admin, '<i class="fa fa-edit"></i> Rechte + ', '') . '</a>';
})
->addColumn('google2fa', function (User $user) {
$icon = $user->google2fa ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>';
$color = $user->google2fa ? 'primary' : 'danger';
return ' <a href="#" data-url="'.route('admin_user_load_modal', $user->id).'" data-data="'.$user->id.'" data-action="show-user-google2fa" class="update_modal_data_show btn btn-sm btn-'.$color.'">'.$icon.' google2fa</a>';
return ' <a href="#" data-url="' . route('admin_user_load_modal', $user->id) . '" data-data="' . $user->id . '" data-action="show-user-google2fa" class="update_modal_data_show btn btn-sm btn-' . $color . '">' . $icon . ' google2fa</a>';
})
->addColumn('confirmed', function (User $user) {
return $user->confirmed ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('active', function (User $user) {
$active = $user->active ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
return ' <a href="#" data-url="'.route('admin_user_load_modal', $user->id).'" data-data="'.$user->id.'" data-action="show-user-active" class="update_modal_data_show">'.$active.'</a>';
return ' <a href="#" data-url="' . route('admin_user_load_modal', $user->id) . '" data-data="' . $user->id . '" data-action="show-user-active" class="update_modal_data_show">' . $active . '</a>';
})
->addColumn('action_delete', function (User $user) {
return '<a href="' . route('admin_user_delete', [$user->id]) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\''.__('Really delete entry?').'\');"><span class="fa fa-trash"></span></a>';
return '<a href="' . route('admin_user_delete', [$user->id]) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\'' . __('Really delete entry?') . '\');"><span class="fa fa-trash"></span></a>';
})
->orderColumn('confirmed', 'confirmed $1')
->orderColumn('active', 'active $1')
@ -252,8 +244,4 @@ class AdminUserController extends Controller
->rawColumns(['action_edit', 'admin', 'confirmed', 'active', 'action_delete', 'google2fa'])
->make(true);
}
}
}

View file

@ -0,0 +1,124 @@
<?php
namespace App\Http\Controllers\CMS;
use App\Http\Controllers\Controller;
use App\Models\News;
use App\Models\Page;
use Carbon\Carbon;
use IqContent\LaravelFilemanager\Lfm;
use Request;
class CMSNewsController extends Controller
{
/*
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware(['admin', '2fa']);
}
public function index()
{
$data = [
'news' => News::all(),//News::where('lvl', 1)->get(),
];
return view('cms.news.index', $data);
}
public function detail($id)
{
if($id === "new") {
$news = new News();
$id = 'new';
$news->status = 1;
$news->content_new = "";
}else{
$news = News::findOrFail($id);
$id = $news->id;
}
$data = [
'news' => $news,
'id' => $id,
'lfm_helper' => app(Lfm::class),
];
return view('cms.news.detail', $data);
}
public function store($id)
{
$data = Request::all();
if($id === "new") {
$news = new News();
$news->model = 'news';
$news->owner_second = 0;
$news->show_in_navi = 1;
$news->catalog_id = 1;
}else{
$news = News::findOrFail($id);
}
$news->title = $data['title'];
$news->status = isset($data['status']) ? true : false;
$news->slug = $data['slug'];
$news->date = $data['date'];
$news->content_new = $data['content_new'];
$news->box_body = $data['image'];
$news->description = $data['description'];
$news->pagetitle = $data['pagetitle'];
$news->keywords = $data['keywords'];
$news->order = (new Carbon($news->date))->format('Ymd')*-1;
$root_news = News::where('cms_settings', 'news_root')->first();
if($id != $root_news->id){
//root ID = 3126
$news->lvl = 1;
$news->owner = $root_news->id;
$news->parent_id = $root_news->id;
$news->tree_root = $root_news->id;
if($first_news = $root_news->children->first()){
$news->lft = $first_news->lft;
$news->rgt = $first_news->rgt;
}else{
$news->lft = $root_news->lft +1;
$news->rgt = $root_news->lft +2;
}
}
$news->save();
\Session()->flash('alert-save', '1');
return redirect(route('cms_news_detail', [$news->id]));
}
public function delete($id){
$news = News::findOrFail($id);
//TODO
//check for delete, only delete lvl 2 .,...?
if ($news->lvl != 1){
abort(404);
die();
}
$news->delete();
\Session()->flash('alert-success', __('News gelöscht'));
return redirect(route('cms_news'));
}
}

View file

@ -1,31 +0,0 @@
<?php
namespace App\Http\Controllers\IQ;
use App\Http\Controllers\Controller;
use Request;
use IqContent\LaravelFilemanager\Controllers\LfmController;
class ContentAssetController extends LfmController
{
public function index()
{
$data = [
'models' => [],
'lfm_helper' => $this->helper,
'modal' => false,
];
return view('iq.content.assets.index', $data);
}
public function modal(){
$data = [
'models' => [],
'lfm_helper' => $this->helper,
'modal' => true,
];
return view('iq.content.assets.body', $data);
}
}

View file

@ -22,13 +22,23 @@ class RequestController extends Controller
public function __construct()
{
$this->middleware(['admin', '2fa']);
$this->middleware(['admin', '2fa']);
}
public function index($step = false)
{
// Get distinct travel_country_ids from bookings that are not null
$usedCountryIds = Booking::whereNotNull('travel_country_id')
->distinct()
->pluck('travel_country_id');
// Fetch the corresponding TravelCountry models and create an associative array [id => name]
$travel_countries = TravelCountry::whereIn('id', $usedCountryIds)
->pluck('name', 'id') // Use country id as key
->toArray();
//dd($travel_countries); // Keep this for debugging if needed
$travel_countries = Booking::join('travel_country', 'travel_country_id', '=', 'travel_country.id')->get()->pluck('name', 'travel_country_id')->unique()->toArray();
$filter_lead_status = Status::get()->pluck('name', 'id')->toArray();
$filter_travel_company = TravelCompany::get()->pluck('name', 'id')->toArray();
$filter_airports = Airport::get()->pluck('name', 'id')->toArray();
@ -61,6 +71,7 @@ class RequestController extends Controller
'filter_sf_guard_user' => $filter_sf_guard_user,
'filter_airports' => $filter_airports,
];
return view('request.index', $data);
}
@ -87,60 +98,62 @@ class RequestController extends Controller
}
die();
*/
private function getSearchRequests(){
private function getSearchRequests()
{
$query = Booking::with('lead')->with('customer')->with('customer_mails')->with('customer_mails')->select('booking.*')->where('lead_id', '!=', NULL);
if(Request::get('full_firstname_search') != ""){
if (Request::get('full_firstname_search') != "") {
$query->whereHas('customer', function ($q) {
$q->where('firstname', 'LIKE', '%'.Request::get('full_firstname_search').'%');
}); }
if(Request::get('full_lastname_search') != ""){
$query->whereHas('customer', function ($q) {
$q->where('name', 'LIKE', '%'.Request::get('full_lastname_search').'%');
$q->where('firstname', 'LIKE', '%' . Request::get('full_firstname_search') . '%');
});
}
if(Request::get('travel_option_country_id') != ""){
$country_ids = TravelCountry::where('contact_lands', 'LIKE', '%"'.Request::get('travel_option_country_id').'"%')->get()->pluck('id');
if (Request::get('full_lastname_search') != "") {
$query->whereHas('customer', function ($q) {
$q->where('name', 'LIKE', '%' . Request::get('full_lastname_search') . '%');
});
}
if (Request::get('travel_option_country_id') != "") {
$country_ids = TravelCountry::where('contact_lands', 'LIKE', '%"' . Request::get('travel_option_country_id') . '"%')->get()->pluck('id');
$country_ids[] = Request::get('travel_option_country_id');
$query->whereIn('travel_country_id', $country_ids);
}
if(Request::get('travel_option_agenda_id') != ""){
if (Request::get('travel_option_agenda_id') != "") {
$query->where('travelagenda_id', '=', Request::get('travel_option_agenda_id'));
}
if(Request::get('travel_option_company_id') != ""){
if (Request::get('travel_option_company_id') != "") {
$query->where('travel_company_id', '=', Request::get('travel_option_company_id'));
}
if(Request::get('travel_option_lead_status_id') != ""){
if (Request::get('travel_option_lead_status_id') != "") {
$query->whereHas('lead', function ($q) {
$q->whereIn('status_id', Request::get('travel_option_lead_status_id'));
});
}
if(Request::get('travel_option_paying_out') != ""){
if (Request::get('travel_option_paying_out') != "") {
$query->where('paying_out', '=', Request::get('travel_option_paying_out'));
}
if(Request::get('travel_option_paying_out_status') != ""){
if (Request::get('travel_option_paying_out_status') != "") {
$query->where('paying_out_status', '=', Request::get('travel_option_paying_out_status'));
}
if(Request::get('travel_option_refund') != ""){
if (Request::get('travel_option_refund') != "") {
$query->where('refund', '=', Request::get('travel_option_refund'));
}
if(Request::get('travel_option_xx_tkt') != ""){
if (Request::get('travel_option_xx_tkt') != "") {
$query->where('xx_tkt', '=', Request::get('travel_option_xx_tkt'));
}
if(Request::get('travel_option_airline_id') != ""){
$query->where('airline_ids', 'LIKE', '%'.Request::get('travel_option_airline_id').'%');
if (Request::get('travel_option_airline_id') != "") {
$query->where('airline_ids', 'LIKE', '%' . Request::get('travel_option_airline_id') . '%');
}
if(Request::get('travel_option_airport_id') != ""){
if (Request::get('travel_option_airport_id') != "") {
$query->where('airport_id', '=', Request::get('travel_option_airport_id'));
}
// $query->where('end_date', '<=', $now);
if(Request::get('travel_option_search')){
if (Request::get('travel_option_search')) {
$now = Carbon::now();
switch (Request::get('travel_option_search')){
switch (Request::get('travel_option_search')) {
case 'before_2':
$query->whereBetween('start_date', [Carbon::now()->modify('-2 month'), $now]);
@ -162,245 +175,245 @@ class RequestController extends Controller
break;
}
}else{
} else {
$start = null;
$end = null;
if(Request::get('arrival_start_date') != ""){
if (Request::get('arrival_start_date') != "") {
$arrStart = explode(".", Request::get('arrival_start_date'));
if(count($arrStart) == 3){
if (count($arrStart) == 3) {
$start = Carbon::create($arrStart[2], $arrStart[1], $arrStart[0], 0, 0, 0);
}
}
if(Request::get('arrival_end_date') != ""){
if (Request::get('arrival_end_date') != "") {
$arrEnd = explode(".", Request::get('arrival_end_date'));
if(count($arrEnd) == 3){
if (count($arrEnd) == 3) {
$end = Carbon::create($arrEnd[2], $arrEnd[1], $arrEnd[0], 23, 59, 59);
}
}
if($start && $end){
if ($start && $end) {
$query->whereBetween('start_date', [$start, $end]);
}
if($start && !$end){
if ($start && !$end) {
$query->where('start_date', '>=', $start);
}
if(!$start && $end){
if (!$start && $end) {
$query->where('start_date', '<=', $end);
}
$start = null;
$end = null;
if(Request::get('departure_start_date') != ""){
if (Request::get('departure_start_date') != "") {
$arrStart = explode(".", Request::get('departure_start_date'));
if(count($arrStart) == 3){
if (count($arrStart) == 3) {
$start = Carbon::create($arrStart[2], $arrStart[1], $arrStart[0], 0, 0, 0);
}
}
if(Request::get('departure_end_date') != ""){
if (Request::get('departure_end_date') != "") {
$arrEnd = explode(".", Request::get('departure_end_date'));
if(count($arrEnd) == 3){
if (count($arrEnd) == 3) {
$end = Carbon::create($arrEnd[2], $arrEnd[1], $arrEnd[0], 23, 59, 59);
}
}
if($start && $end){
if ($start && $end) {
$query->whereBetween('end_date', [$start, $end]);
}
if($start && !$end){
if ($start && !$end) {
$query->where('end_date', '>=', $start);
}
if(!$start && $end){
if (!$start && $end) {
$query->where('end_date', '<=', $end);
}
}
if(Request::get('sort_travel_country_id') != ""){
if (Request::get('sort_travel_country_id') != "") {
$query->where('travel_country_id', '=', Request::get('sort_travel_country_id'));
}
if(Request::get('sort_travelagenda_id') != ""){
if (Request::get('sort_travelagenda_id') != "") {
$query->where('travelagenda_id', '=', Request::get('sort_travelagenda_id'));
}
if(Request::get('sort_sf_guard_user_id') != ""){
if (Request::get('sort_sf_guard_user_id') != "") {
$query->where('sf_guard_user_id', '=', Request::get('sort_sf_guard_user_id'));
}
if(Request::get('sort_travel_documents') != ""){
if (Request::get('sort_travel_documents') != "") {
$query->where('travel_documents', '=', Request::get('sort_travel_documents'));
}
if(Request::get('full_lead_id_search') != ""){
$query->where('lead_id', 'LIKE', '%'.Request::get('full_lead_id_search'). '%');
if (Request::get('full_lead_id_search') != "") {
$query->where('lead_id', 'LIKE', '%' . Request::get('full_lead_id_search') . '%');
}
if(Request::get('full_booking_id_search') != ""){
$query->where('id', 'LIKE', '%'.Request::get('full_booking_id_search').'%');
if (Request::get('full_booking_id_search') != "") {
$query->where('id', 'LIKE', '%' . Request::get('full_booking_id_search') . '%');
}
return $query;
}
public function getAjaxRequests(){
public function getAjaxRequests()
{
$data = Request::all();
if(Request::ajax()) {
if(isset($data['action']) && $data['action'] === "get_popover_booking_services") {
if (Request::ajax()) {
if (isset($data['action']) && $data['action'] === "get_popover_booking_services") {
$booking = Booking::findOrFail($data['booking_id']);
$ret = "";
$count = false;
foreach($booking->travel_country->getContactLandsModels() as $TravelCountry){
if($TravelCountry->stern_travel_country){
$hl = $TravelCountry->stern_travel_country->name."<br>";
foreach ($booking->travel_country->getContactLandsModels() as $TravelCountry) {
if ($TravelCountry->stern_travel_country) {
$hl = $TravelCountry->stern_travel_country->name . "<br>";
$tmp = "";
foreach($TravelCountry->stern_travel_country->travel_country_services as $travel_country_service){
foreach ($TravelCountry->stern_travel_country->travel_country_services as $travel_country_service) {
$tmp .= \App\Models\BookingCountryService::getStatus($travel_country_service->id, $booking->id) ?
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$travel_country_service->name.'</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> '.$travel_country_service->name.'</span>';
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> ' . $travel_country_service->name . '</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> ' . $travel_country_service->name . '</span>';
$tmp .= '<br>';
}
if($tmp !== ""){
$ret .= $hl.$tmp;
if ($tmp !== "") {
$ret .= $hl . $tmp;
}
}
}
if($booking->service_provider_entries->count()){
foreach($booking->service_provider_entries as $service_provider_entry){
if($service_provider_entry->service_provider->service_provider_services->count()){
$hl = $service_provider_entry->service_provider->name."<br>";
if ($booking->service_provider_entries->count()) {
foreach ($booking->service_provider_entries as $service_provider_entry) {
if ($service_provider_entry->service_provider->service_provider_services->count()) {
$hl = $service_provider_entry->service_provider->name . "<br>";
$tmp = "";
foreach($service_provider_entry->service_provider->service_provider_services as $service_provider_service){
foreach ($service_provider_entry->service_provider->service_provider_services as $service_provider_service) {
$tmp .= \App\Models\BookingProviderService::getStatus($service_provider_service->id, $booking->id) ?
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$service_provider_service->name.'</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> '.$service_provider_service->name.'</span>';
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> ' . $service_provider_service->name . '</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> ' . $service_provider_service->name . '</span>';
$tmp .= '<br>';
}
if($tmp !== ""){
$ret .= $hl.$tmp;
if ($tmp !== "") {
$ret .= $hl . $tmp;
}
}
}
}
if($booking->booking_service_items->count()){
foreach($booking->booking_service_items as $booking_service_item){
if($booking_service_item->travel_company->travel_company_services->count()){
$hl = $booking_service_item->travel_company->name."<br>";
if ($booking->booking_service_items->count()) {
foreach ($booking->booking_service_items as $booking_service_item) {
if ($booking_service_item->travel_company->travel_company_services->count()) {
$hl = $booking_service_item->travel_company->name . "<br>";
$tmp = "";
foreach($booking_service_item->travel_company->travel_company_services as $travel_company_service){
foreach ($booking_service_item->travel_company->travel_company_services as $travel_company_service) {
$tmp .= \App\Models\BookingCompanyService::getStatus($travel_company_service->id, $booking->id) ?
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$travel_company_service->name.'</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> '.$travel_company_service->name.'</span>';
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> ' . $travel_company_service->name . '</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> ' . $travel_company_service->name . '</span>';
$tmp .= '<br>';
}
if($tmp !== ""){
$ret .= $hl.$tmp;
if ($tmp !== "") {
$ret .= $hl . $tmp;
}
}
}
}
return $ret === "" ? 'keine Leistungen definiert' : $ret;
return $ret === "" ? 'keine Leistungen definiert' : $ret;
}
if(isset($data['action']) && $data['action'] === "get_popover_booking_notice"){
if (isset($data['action']) && $data['action'] === "get_popover_booking_notice") {
$booking = Booking::findOrFail($data['booking_id']);
$ret = "";
if($booking->booking_notices->count()){
if ($booking->booking_notices->count()) {
$booking_notice = $booking->booking_notices->first();
return $booking_notice->getSmallerMessage(500);
}
return $ret === "" ? 'keine E-Notiz' : $ret;
return $ret === "" ? 'keine E-Notiz' : $ret;
}
if(isset($data['action']) && $data['action'] === "get_popover_booking_last_email"){
if (isset($data['action']) && $data['action'] === "get_popover_booking_last_email") {
$booking = Booking::findOrFail($data['booking_id']);
$ret = "";
if($booking->customer_mails->count()){
if ($booking->customer_mails->count()) {
$customer_mail = $booking->customer_mails_sent_at->last();
return "<h6>".$customer_mail->subject."</h6>".$customer_mail->message;
}
return $ret === "" ? 'keine E-Mail' : $ret;
return "<h6>" . $customer_mail->subject . "</h6>" . $customer_mail->message;
}
return $ret === "" ? 'keine E-Mail' : $ret;
}
if(isset($data['action']) && $data['action'] === "get_popover_booking_participants_pass"){
if (isset($data['action']) && $data['action'] === "get_popover_booking_participants_pass") {
$booking = Booking::findOrFail($data['booking_id']);
$ret = "";
if($booking->participant_firstname){
$ret .= $booking->participant_pass ?
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$booking->participant_firstname." ".$booking->participant_lastname.'</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> '.$booking->participant_firstname." ".$booking->participant_lastname.'</span>';
$ret .= "<br>";
if ($booking->participant_firstname) {
$ret .= $booking->participant_pass ?
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> ' . $booking->participant_firstname . " " . $booking->participant_lastname . '</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> ' . $booking->participant_firstname . " " . $booking->participant_lastname . '</span>';
$ret .= "<br>";
}
if($booking->participants->count()){
foreach($booking->participants as $participant){
if ($booking->participants->count()) {
foreach ($booking->participants as $participant) {
$ret .= $participant->participant_pass ?
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> '.$participant->participant_firstname." ".$participant->participant_lastname.'</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> '.$participant->participant_firstname." ".$participant->participant_lastname.'</span>';
'<span class="badge badge-pill badge-success"><i class="fa fa-check"></i> ' . $participant->participant_firstname . " " . $participant->participant_lastname . '</span>' :
'<span class="badge badge-pill badge-danger""><i class="fa fa-times"></i> ' . $participant->participant_firstname . " " . $participant->participant_lastname . '</span>';
$ret .= "<br>";
}
}
return $ret === "" ? 'keine Teilnehmer' : $ret;
}
$query = $this->getSearchRequests();
$ret = $query->get()->pluck('travelagenda_id', 'id')->unique()->toArray();
return TravelAgenda::whereIn('id', $ret)->get()->pluck('name', 'id');
}
}
public function loadModal(){
public function loadModal()
{
$data = Request::all();
$ret = "";
if(Request::ajax()){
if($data['action'] === 'new-customer-mail'){
if (Request::ajax()) {
if ($data['action'] === 'new-customer-mail') {
$data['customers'] = [];
$query = $this->getSearchRequests();
$bookings = $query->orderBy('id', 'DESC')->limit(50)->get();
foreach ($bookings as $booking){
foreach ($bookings as $booking) {
$tmp = [];
$tmp['email'] = $booking->customer ? $booking->customer->email : "";
$tmp['name'] = $booking->customer ? $booking->customer->firstname." ".$booking->customer->name." | " : "- | ";
$tmp['name'] .= $booking->travel_country_id ? $booking->travel_country->name." | " : "- | ";
$tmp['name'] .= $booking->travelagenda_id ? $booking->travel_agenda->name."" : "-";
$tmp['name'] = $booking->customer ? $booking->customer->firstname . " " . $booking->customer->name . " | " : "- | ";
$tmp['name'] .= $booking->travel_country_id ? $booking->travel_country->name . " | " : "- | ";
$tmp['name'] .= $booking->travelagenda_id ? $booking->travel_agenda->name . "" : "-";
$data['customers'][$booking->id] = $tmp;
}
$ret = CustomerMailRepository::loadModal($data);
}
if($data['action'] === 'show-customer-mail'){
if ($data['action'] === 'show-customer-mail') {
$booking = Booking::findOrFail($data['booking_id']);
$ret = "";
if($booking->customer_mails->count()){
if ($booking->customer_mails->count()) {
$ret = CustomerMailRepository::loadModal($data);
}
}
}
}
return response()->json(['response' => $data, 'html'=>$ret]);
return response()->json(['response' => $data, 'html' => $ret]);
}
public function getRequests()
{
$query = $this->getSearchRequests();
return DataTables::eloquent($query)
->addColumn('action_booking_edit', function (Booking $booking) {
return '<a href="' . route('booking_detail', [$booking->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('action_booking_edit', function (Booking $booking) {
return '<a href="' . route('booking_detail', [$booking->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('id', function (Booking $booking) {
return '<a data-order="'.$booking->id.'" href="'.make_old_url('booking/'.$booking->id.'/edit').'" data-id="'.$booking->id.'">'.$booking->id.'</a>';
return '<a data-order="' . $booking->id . '" href="' . make_old_url('booking/' . $booking->id . '/edit') . '" data-id="' . $booking->id . '">' . $booking->id . '</a>';
})
->addColumn('action_lead_edit', function (Booking $booking) {
return '<a href="' . route('lead_detail', [$booking->lead_id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('lead_id', function (Booking $booking) {
return '<a data-order="'.$booking->lead_id.'" href="'.make_old_url('leads/'.$booking->lead_id.'/edit').'" data-id="'.$booking->lead_id.'">'.$booking->lead_id.'</a>';
return '<a data-order="' . $booking->lead_id . '" href="' . make_old_url('leads/' . $booking->lead_id . '/edit') . '" data-id="' . $booking->lead_id . '">' . $booking->lead_id . '</a>';
})
->addColumn('travel_country_id', function (Booking $booking) {
return '<span data-order="'.($booking->travel_country_id ? $booking->travel_country_id : 0).'">'.($booking->travel_country_id ? $booking->travel_country->name : "-").'</span>';
return '<span data-order="' . ($booking->travel_country_id ? $booking->travel_country_id : 0) . '">' . ($booking->travel_country_id ? $booking->travel_country->name : "-") . '</span>';
})
->addColumn('travelagenda_id', function (Booking $booking) {
return '<span data-order="'.($booking->travelagenda_id ? $booking->travelagenda_id : 0).'">'.($booking->travelagenda_id ? $booking->travel_agenda->name : "-").'</span>';
return '<span data-order="' . ($booking->travelagenda_id ? $booking->travelagenda_id : 0) . '">' . ($booking->travelagenda_id ? $booking->travel_agenda->name : "-") . '</span>';
})
->addColumn('travel_company_id', function (Booking $booking) {
return '<span data-order="'.($booking->travel_company_id ? $booking->travel_company_id : 0).'">'.($booking->travel_company ? $booking->travel_company->name : "-").'</span>';
return '<span data-order="' . ($booking->travel_company_id ? $booking->travel_company_id : 0) . '">' . ($booking->travel_company ? $booking->travel_company->name : "-") . '</span>';
})
->addColumn('airport_id', function (Booking $booking) {
return '<span data-order="'.($booking->airport_id ? $booking->airport_id : 0).'">'.($booking->airport ? $booking->airport->name : "-").'</span>';
return '<span data-order="' . ($booking->airport_id ? $booking->airport_id : 0) . '">' . ($booking->airport ? $booking->airport->name : "-") . '</span>';
})
->addColumn('comfort', function (Booking $booking) {
return $booking->comfort ? ' <span data-order="1" class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
@ -415,92 +428,94 @@ class RequestController extends Controller
return $booking->travel_documents ? '<span data-order="1" class="badge badge-pill badge-success" title="Reiseunterlagen vollständig" data-placement="top" rel="tooltip"><i class="fa fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger" title="Reiseunterlagen nicht vollständig" data-placement="top" rel="tooltip"><i class="fa fa-times"></i></span>';
})
->addColumn('booking_services', function (Booking $booking) {
return $booking->hasBookingServicesUnchecked() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="'.$booking->id.'" data-action="get_popover_booking_services" data-placement="top" data-toggle="popover" title="ServiceLeistungen"><i class="fa fa-check"></i></span>' :
'<span data-order="0" class="badge badge-pill badge-danger" data-booking_id="'.$booking->id.'" data-action="get_popover_booking_services" data-placement="top" data-toggle="popover" title="ServiceLeistungen"><i class="fa fa-times"></i></span>';
return $booking->hasBookingServicesUnchecked() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="' . $booking->id . '" data-action="get_popover_booking_services" data-placement="top" data-toggle="popover" title="ServiceLeistungen"><i class="fa fa-check"></i></span>' :
'<span data-order="0" class="badge badge-pill badge-danger" data-booking_id="' . $booking->id . '" data-action="get_popover_booking_services" data-placement="top" data-toggle="popover" title="ServiceLeistungen"><i class="fa fa-times"></i></span>';
})
->addColumn('booking_notice', function (Booking $booking) {
return $booking->booking_notices->count() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="'.$booking->id.'" data-action="get_popover_booking_notice" data-placement="top" data-toggle="popover" title="letzte Notiz"><i class="fa fa-check"></i></span>' :
return $booking->booking_notices->count() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="' . $booking->id . '" data-action="get_popover_booking_notice" data-placement="top" data-toggle="popover" title="letzte Notiz"><i class="fa fa-check"></i></span>' :
'<span data-order="0" class="badge badge-pill badge-danger" title="keine Notiz" data-placement="top" rel="tooltip"><i class="fa fa-times"></i></span>';
})
->addColumn('sf_guard_user_id', function (Booking $booking) {
return '<span data-order="'.($booking->sf_guard_user_id ? $booking->sf_guard_user_id : 0).'">'.($booking->sf_guard_user_id? $booking->sf_guard_user->first_name." ".$booking->sf_guard_user->last_name : "-").'</span>';
return '<span data-order="' . ($booking->sf_guard_user_id ? $booking->sf_guard_user_id : 0) . '">' . ($booking->sf_guard_user_id ? $booking->sf_guard_user->first_name . " " . $booking->sf_guard_user->last_name : "-") . '</span>';
})
->addColumn('lead.status_id', function (Booking $booking) {
if($booking->lead){
if ($booking->lead) {
return $booking->lead->getStatusBadge($booking);
}
return '<span data-order="0">-</span>';
})
->addColumn('last_customer_email', function (Booking $booking) {
if($booking->customer_mails->count()){
$customer_mail = $booking->customer_mails_sent_at->last();
$badge = $customer_mail->is_answer ? 'badge-default' : 'badge-secondary';
$badge = !$customer_mail->send ? $badge : 'badge-success';
return '<a data-order="'.$customer_mail->getSentAtRaw().'" href="#" data-toggle="modal"
if ($booking->customer_mails->count()) {
$customer_mail = $booking->customer_mails_sent_at->last();
$badge = $customer_mail->is_answer ? 'badge-default' : 'badge-secondary';
$badge = !$customer_mail->send ? $badge : 'badge-success';
return '<a data-order="' . $customer_mail->getSentAtRaw() . '" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
data-url="mail"
data-preview="true"
data-booking_id="'.$booking->id.'"
data-customer_mail_id="'.$customer_mail->id.'"
data-booking_id="' . $booking->id . '"
data-customer_mail_id="' . $customer_mail->id . '"
data-action="show-customer-mail"
data-redirect="back"
data-route="'.route('requests_modal_load').'">
<span class="badge '.$badge.'">'
.($customer_mail->send ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>').' '
.$customer_mail->sent_at.'</span>
data-route="' . route('requests_modal_load') . '">
<span class="badge ' . $badge . '">'
. ($customer_mail->send ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>') . ' '
. $customer_mail->sent_at . '</span>
</a>';
}
return '<span data-order="">-</span>';
})
->addColumn('booking_participants_pass', function (Booking $booking) {
return $booking->hasBookingParticipantsPass() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="'.$booking->id.'" data-action="get_popover_booking_participants_pass" data-placement="top" data-toggle="popover" title="Teilnehmer Pass"><i class="fa fa-check"></i></span>' :
'<span data-order="0" class="badge badge-pill badge-danger" data-booking_id="'.$booking->id.'" data-action="get_popover_booking_participants_pass" data-placement="top" data-toggle="popover" title="Teilnehmer Pass"><i class="fa fa-times"></i></span>';
return $booking->hasBookingParticipantsPass() ? '<span data-order="1" class="badge badge-pill badge-success" data-booking_id="' . $booking->id . '" data-action="get_popover_booking_participants_pass" data-placement="top" data-toggle="popover" title="Teilnehmer Pass"><i class="fa fa-check"></i></span>' :
'<span data-order="0" class="badge badge-pill badge-danger" data-booking_id="' . $booking->id . '" data-action="get_popover_booking_participants_pass" data-placement="top" data-toggle="popover" title="Teilnehmer Pass"><i class="fa fa-times"></i></span>';
})
->addColumn('paying_out', function (Booking $booking) {
$icon = "";
$badge = $booking->getPayingOutColor();
if($booking->paying_out_status == 1){ //offen
if ($booking->paying_out_status == 1) { //offen
$icon = '<i class="fa fa-times-circle"></i> ';
}
if($booking->paying_out_status == 2){ //erledigt
if ($booking->paying_out_status == 2) { //erledigt
$badge = 'success';
$icon = '<i class="fa fa-check-circle"></i> ';
}
return '<span data-order="'.$booking->paying_out.'"><span class="badge badge-'.$booking->getPayingOutColor().'">'.$icon.$booking->getPayingOutType().'</span></span>';
return '<span data-order="' . $booking->paying_out . '"><span class="badge badge-' . $booking->getPayingOutColor() . '">' . $icon . $booking->getPayingOutType() . '</span></span>';
})
->addColumn('paying_out_status', function (Booking $booking) {
return '<span data-order="'.$booking->paying_out_status.'"><span class="badge badge-'.$booking->getPayingOutStatusColor().'">'.$booking->getPayingOutStatusType().'</span></span>';
return '<span data-order="' . $booking->paying_out_status . '"><span class="badge badge-' . $booking->getPayingOutStatusColor() . '">' . $booking->getPayingOutStatusType() . '</span></span>';
})
->addColumn('airline_ids', function (Booking $booking) {
return $booking->airline_ids ? '<span data-order="'.$booking->getAirlinesIDs().'">'. $booking->getAirlinesAsNames().'</span>' : '-';
return $booking->airline_ids ? '<span data-order="' . $booking->getAirlinesIDs() . '">' . $booking->getAirlinesAsNames() . '</span>' : '-';
})
->addColumn('refund', function (Booking $booking) {
return '<span data-order="'.$booking->refund_date.'"><span class="badge badge-'.$booking->getRefundColor().'">'.$booking->getRefundTypeList().'</span></span>';
return '<span data-order="' . $booking->refund_date . '"><span class="badge badge-' . $booking->getRefundColor() . '">' . $booking->getRefundTypeList() . '</span></span>';
})
->addColumn('hold', function (Booking $booking) {
return $booking->hold ? ' <span data-order="1" class="badge badge-pill badge-success" title="Hold" data-placement="top" rel="tooltip"><i class="fa fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger" title="Hold" data-placement="top" rel="tooltip"><i class="fa fa-times"></i></span>';
})
->addColumn('xx_tkt', function (Booking $booking) {
return '<span data-order="'.$booking->xx_tkt_date.'"><span class="badge badge-'.$booking->getXxTktColor().'">'.$booking->getXxTktTypeList().'</span></span>';
return '<span data-order="' . $booking->xx_tkt_date . '"><span class="badge badge-' . $booking->getXxTktColor() . '">' . $booking->getXxTktTypeList() . '</span></span>';
})
->orderColumn('last_customer_email', function ($query, $order) {
$query->whereHas('customer_mails',
function ($q) use ($order) {
// $q->select('sent_at')->where('sent_at', DB::raw("(select max('sent_at') customer_mails)")); //)
})->orderBy(
$query->whereHas(
'customer_mails',
function ($q) use ($order) {
// $q->select('sent_at')->where('sent_at', DB::raw("(select max('sent_at') customer_mails)")); //)
}
)->orderBy(
CustomerMail::select('sent_at')
->whereColumn('booking_id', 'booking.id')
->orderBy('sent_at', 'DESC')
->limit(1)
, $order);
->limit(1),
$order
);
})
/*
/*
->filterColumn('travelagenda_id', function($query, $keyword) {
if($keyword != ""){
$query->whereRaw("travelagenda_id = ?", $keyword);
@ -528,5 +543,3 @@ class RequestController extends Controller
->make(true);
}
}

View file

@ -1,102 +0,0 @@
<?php
namespace App\Http\Controllers\SyS\Tools;
use App\Http\Controllers\Controller;
use App\Models\Booking;
use App\Models\IQContentSite;
use App\Models\IQContentSiteField;
use App\Models\IQContentTree;
use App\Models\IQContentTreeNode;
use App\Models\TravelCountry;
use App\Models\TravelGuide;
use App\Models\TravelNationality;
use App\Models\TravelBooking;
use Illuminate\Support\Str;
use IqContent\LaravelFilemanager\Controllers\FileController;
use IqContent\LaravelFilemanager\Controllers\FolderController;
use IqContent\LaravelFilemanager\Models\IQContentFile;
use Request;
use Validator;
class SysController extends Controller
{
private $tree = [];
/**
* ContentSiteController constructor.
*/
public function __construct()
{
$this->middleware(['sysadmin', '2fa']);
}
public function filterHTML(){
}
//content_links
public function calcu()
{
/*$query = Booking::with('booking_draft_items')->select('booking.*')->where('new_drafts', true);
$query->whereHas('booking_draft_items', function ($q) {
$q->where('comfort', true);
});
$bookings = $query->get();
foreach ($bookings as $booking){
$booking->comfort = true;
$booking->save();
}
*/
$bookings = Booking::orderBy('id', 'DESC')->offset(0)->limit(1000)->get();
// dd("nothing");
$val = [];
$text = "";
$data = [
'text' => $text,
'bookings' => $bookings,
];
return view('sys.tools.links', $data);
}
/*
clean code
$travelGuides = TravelGuide::all();
foreach ($travelGuides as $travelGuide){
if(strpos($travelGuide->full_text, "<h1><br></h1>") !== false){
$val[$travelGuide->id] = "<h1><br></h1>";
}
}
foreach ($travelGuides as $travelGuide){
if(strpos($travelGuide->full_text, "<h1") !== false){
$val[$travelGuide->id] = "<h1";
}
}
$travelGuide = TravelGuide::find(203);
$text = $travelGuide->full_text;
// $new_text = preg_replace('/<h1[^>]*>([\s\S]*?)<\/h1[^>]*>/', '', $TravelGuide->full_text);
*/
public function calcuStore()
{
return redirect()->back();
}
}

View file

@ -99,7 +99,6 @@ class TravelUserBookingFewoController extends Controller
return redirect(route('travel_user_booking_fewo_detail', [$travel_user_booking_fewo->id])."#collapseBookingNotice");
}
if($data['action'] === 'saveAll'){
return $this->userBookingFewoRepo->update($id, $data);
}

View file

@ -1,24 +0,0 @@
<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
use App\Services\AuthGoogle2FA;
class AuthGoogle2FA
{
public function handle($request, Closure $next)
{
$AuthGoogle2FA = app(AuthGoogle2FA::class)->init($request);
if(!Auth::user()->isGoogle2Fa()){
return $AuthGoogle2FA->makeActiveOneTimePasswordResponse();
}
if ($AuthGoogle2FA->isAuthenticated()) {
return $next($request);
}
return $AuthGoogle2FA->makeRequestOneTimePasswordResponse();
}
}

View file

@ -1,24 +0,0 @@
<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
use App\Services\AuthGoogle2FA;
class Google2FA
{
public function handle($request, Closure $next)
{
$AuthGoogle2FA = app(AuthGoogle2FA::class)->init($request);
if(!Auth::user()->isGoogle2Fa()){
return $AuthGoogle2FA->makeActiveOneTimePasswordResponse();
}
if ($AuthGoogle2FA->isAuthenticated()) {
return $next($request);
}
return $AuthGoogle2FA->makeRequestOneTimePasswordResponse();
}
}

View file

@ -1,25 +0,0 @@
<?php
namespace App\Http\Middleware;
use Closure;
use PragmaRX\Google2FALaravel\Support\Authenticator;
use Auth;
class Google2FA
{
public function handle($request, Closure $next)
{
$authenticator = app(Authenticator::class)->boot($request);
dd(Auth::user()->isGoogle2Fa());
if(Auth::user()->isGoogle2Fa()){
}
if ($authenticator->isAuthenticated()) {
return $next($request);
}
return $authenticator->makeRequestOneTimePasswordResponse();
}
}

View file

@ -21,10 +21,10 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\App\Models\Account withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\Models\Account withoutTrashed()
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Account newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Account newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Account query()
* @mixin \Eloquent
*/
class Account extends Model
{

View file

@ -30,13 +30,13 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereNameFull($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $flight_info
* @property string|null $check_in
* @property string|null $baggage
* @method static \Illuminate\Database\Eloquent\Builder|Airline whereBaggage($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airline whereCheckIn($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airline whereFlightInfo($value)
* @mixin \Eloquent
*/
class Airline extends Model
{

View file

@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Airport
*
*
* @property int $id
* @property string $code
* @property string $name
@ -20,8 +20,19 @@ use Illuminate\Database\Eloquent\Model;
* @property bool $active
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|Airport newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Airport newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Airport query()
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereCity($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereCountry($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airport whereUpdatedAt($value)
* @mixin \Eloquent
*/
class Airport extends Model
{

View file

@ -32,12 +32,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereQuestion($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereQuestionText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereUpdatedAt($value)
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faq
* @property-read int|null $iq_content_faq_count
* @property int|null $i_q_content_category_id
* @property-read \App\Models\IQContentCategory|null $iq_content_category
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereIQContentCategoryId($value)
* @mixin \Eloquent
*/
class AnswerQuestion extends Model
{

View file

@ -40,6 +40,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereTypeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereTypeS($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Arrangement whereViewPosition($value)
* @property-read \App\Models\ArrangementType|null $arrangement_type
* @mixin \Eloquent
*/
class Arrangement extends Model

View file

@ -117,7 +117,6 @@ use Illuminate\Database\Eloquent\Collection;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelagendaId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereWebsiteId($value)
* @mixin \Eloquent
* @property-read int|null $service_provider_entries_count
* @property float|null $canceled
* @property float|null $price_canceled
@ -190,6 +189,17 @@ use Illuminate\Database\Eloquent\Collection;
* @property-read \App\Models\BookingStorno|null $booking_strono
* @method static \Illuminate\Database\Eloquent\Builder|Booking whereAirlineIds($value)
* @method static \Illuminate\Database\Eloquent\Builder|Booking whereParticipantPass($value)
* @property int|null $insurance_offer
* @property int|null $airport_id
* @property-read \App\Models\Airport|null $airport
* @property-read Collection<int, \App\Models\BookingDocument> $booking_documents
* @property-read int|null $booking_documents_count
* @property-read Collection<int, \App\Models\CustomerMail> $customer_mails_reverse
* @property-read int|null $customer_mails_reverse_count
* @property-read \App\Models\Salutation|null $participant_salutation
* @method static \Illuminate\Database\Eloquent\Builder|Booking whereAirportId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Booking whereInsuranceOffer($value)
* @mixin \Eloquent
*/
class Booking extends Model
{

View file

@ -28,9 +28,9 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCountryService whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCountryService whereTravelCountryServiceId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCountryService whereUpdatedAt($value)
* @mixin \Eloquent
* @property int|null $status
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCountryService whereStatus($value)
* @mixin \Eloquent
*/
class BookingCountryService extends Model
{

View file

@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class BookingDocument
*
*
* @property int $id
* @property int|null $booking_id
* @property int|null $customer_id
@ -26,12 +26,37 @@ use Illuminate\Database\Eloquent\Model;
* @property Carbon $date
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @property Booking|null $booking
* @property Customer|null $customer
* @property Lead|null $lead
*
* @package App\Models
* @property \App\Models\Coupon|null $coupon_id
* @property int|null $booking_storno_id
* @property object|null $data
* @property int|null $status
* @property-read \App\Models\BookingStorno|null $booking_storno
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument query()
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereBookingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereBookingStornoId($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereCouponId($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereCustomerId($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereData($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereDir($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereExt($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereFilename($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereIdentifier($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereLeadId($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereMine($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereOriginalName($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereSize($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|BookingDocument whereUpdatedAt($value)
* @mixin \Eloquent
*/
class BookingDocument extends Model
{

View file

@ -55,7 +55,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem whereTravelClassId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem whereTravelProgramId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem whereUpdatedAt($value)
* @mixin \Eloquent
* @property int|null $fewo_lodging_id
* @property float|null $price
* @property-read \App\Models\Booking $booking
@ -64,6 +63,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem query()
* @mixin \Eloquent
*/
class BookingDraftItem extends Model
{

View file

@ -36,9 +36,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereStornoDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereTotal($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereUpdatedAt($value)
* @mixin \Eloquent
* @property \Illuminate\Support\Carbon|null $storno_print
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingStorno whereStornoPrint($value)
* @property-read \App\Models\BookingDocument|null $booking_document
* @mixin \Eloquent
*/
class BookingStorno extends Model
{

View file

@ -24,9 +24,9 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSAuthor whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSAuthor whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSAuthor whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $description
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSAuthor whereDescription($value)
* @mixin \Eloquent
*/
class CMSAuthor extends Model
{

View file

@ -4,41 +4,42 @@ namespace App\Models;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\CMSContent
*
* @property int $id
* @property string $name
* @property string $slug
* @property string|null $identifier
* @property string $field
* @property string|null $text
* @property string|null $full_text
* @property array|null $object
* @property int|null $integer
* @property float|null $decimal
* @property string|null $decimal
* @property int|null $pos
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent findSimilarSlugs($attribute, $config, $slug)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereDecimal($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereField($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereFullText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereInteger($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent query()
* @property string|null $identifier
* @property array|null $object
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereIdentifier($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereObject($value)
* @property int|null $pos
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent findSimilarSlugs(string $attribute, array $config, string $slug)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent query()
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereDecimal($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereField($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereFullText($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereIdentifier($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereInteger($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereObject($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class CMSContent extends Model
{
@ -74,7 +75,7 @@ class CMSContent extends Model
'pos' => 'int'
];
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [

View file

@ -34,12 +34,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfo whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfo whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfo whereUpdatedAt($value)
* @mixin \Eloquent
* @property string $type
* @property int $bool
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfo whereBool($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfo whereType($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSInfo withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class CMSInfo extends Model
{
@ -61,7 +61,8 @@ class CMSInfo extends Model
'name', 'slug', 'type', 'text', 'full_text', 'integer', 'decimal', 'bool'
];
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [

View file

@ -26,13 +26,13 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfoAvailable whereTo($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfoAvailable whereType($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfoAvailable whereUpdatedAt($value)
* @mixin \Eloquent
* @property int $wday
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfoAvailable whereWday($value)
* @property int|null $special
* @property string|null $date
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfoAvailable whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfoAvailable whereSpecial($value)
* @mixin \Eloquent
*/
class CMSInfoAvailable extends Model
{

View file

@ -26,10 +26,10 @@ use PHPUnit\Framework\Constraint\Count;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Country whereIt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Country wherePhone($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Country whereRu($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Country newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Country newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Country query()
* @mixin \Eloquent
*/
class Country extends Model
{

View file

@ -44,9 +44,10 @@ use Illuminate\Database\Eloquent\Collection;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereValidDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereValue($value)
* @mixin \Eloquent
* @property string|null $text
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Coupon whereText($value)
* @property-read \App\Models\BookingDocument|null $booking_document
* @mixin \Eloquent
*/
class Coupon extends Model
{

View file

@ -42,12 +42,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoFile whereSize($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoFile whereTravelUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoFile whereUpdatedAt($value)
* @mixin \Eloquent
* @property \Illuminate\Support\Carbon|null $deleted_at
* @method static \Illuminate\Database\Query\Builder|\App\Models\CustomerFewoFile onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoFile whereDeletedAt($value)
* @method static \Illuminate\Database\Query\Builder|\App\Models\CustomerFewoFile withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\Models\CustomerFewoFile withoutTrashed()
* @mixin \Eloquent
*/
class CustomerFewoFile extends Model
{

View file

@ -70,7 +70,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereTravelUserBookingFewoId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereTravelUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereUpdatedAt($value)
* @mixin \Eloquent
* @property-read \App\Models\TravelUserBookingFewo $booking
* @property-read \App\Models\TravelUser $customer
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\CustomerFewoFile[] $customer_files
@ -83,6 +82,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Query\Builder|\App\Models\CustomerFewoMail withoutTrashed()
* @property array|null $forward
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereForward($value)
* @mixin \Eloquent
*/
class CustomerFewoMail extends Model
{

View file

@ -74,11 +74,11 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSubject($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereTravelCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereUpdatedAt($value)
* @mixin \Eloquent
* @property int|null $subdir
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSubdir($value)
* @property array|null $forward
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereForward($value)
* @mixin \Eloquent
*/
class CustomerMail extends Model
{

View file

@ -17,7 +17,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Draft whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Draft whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Draft whereUpdatedAt($value)
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\DraftItem[] $draft_items
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelProgramDraft[] $travel_program_drafts
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Draft newModelQuery()
@ -25,6 +24,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Draft query()
* @property-read int|null $draft_items_count
* @property-read int|null $travel_program_drafts_count
* @mixin \Eloquent
*/
class Draft extends Model
{

View file

@ -42,7 +42,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem wherePriceAdult($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem wherePriceChildren($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $service
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem whereService($value)
* @property float|null $price
@ -50,6 +49,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem query()
* @mixin \Eloquent
*/
class DraftItem extends Model
{

View file

@ -17,7 +17,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereUpdatedAt($value)
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\DraftItem[] $draft_items
* @property string|null $color
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType whereColor($value)
@ -27,6 +26,7 @@ use Illuminate\Database\Eloquent\Model;
* @property int|null $pos
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftType wherePos($value)
* @property-read int|null $draft_items_count
* @mixin \Eloquent
*/
class DraftType extends Model
{

View file

@ -31,9 +31,9 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\EmailTemplate whereMessage($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\EmailTemplate whereSubject($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\EmailTemplate whereUpdatedAt($value)
* @mixin \Eloquent
* @property string $name
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\EmailTemplate whereName($value)
* @mixin \Eloquent
*/
class EmailTemplate extends Model
{

View file

@ -94,7 +94,6 @@ use HTMLHelper;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereTravelProgram($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereTreeRoot($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereUpdatedAt($value)
* @mixin \Eloquent
* @property int|null $travel_guide_content_id
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback newQuery()
@ -105,6 +104,20 @@ use HTMLHelper;
* @property-read int|null $children_count
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereBeforeTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereTitleShort($value)
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Page> $child_pages
* @property-read int|null $child_pages_count
* @property-read \App\Models\Page|null $page
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Page> $pages
* @property-read int|null $pages_count
* @property-read \App\Models\Page|null $parent_page
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\TravelCountry> $travel_countries
* @property-read int|null $travel_countries_count
* @property-read \App\Models\TravelCountry|null $travel_country
* @property-read \App\Models\TravelGuide|null $travel_guide
* @property-read \App\Models\TravelProgram|null $travel_program_content
* @method static \Illuminate\Database\Eloquent\Builder|Page findSimilarSlugs(string $attribute, array $config, string $slug)
* @method static \Illuminate\Database\Eloquent\Builder|Page withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class Feedback extends Page
{

View file

@ -34,7 +34,6 @@ use Reliese\Database\Eloquent\Model as Eloquent;
* @property \Illuminate\Database\Eloquent\Collection $pages
* @property \Illuminate\Database\Eloquent\Collection $travel_user_booking_fewos
* @package App\Models
* @mixin \Eloquent
* @property string|null $single_name
* @property string $zip_code
* @property int|null $maximum_adults
@ -65,6 +64,7 @@ use Reliese\Database\Eloquent\Model as Eloquent;
* @property-read int|null $travel_user_booking_fewos_count
* @property string|null $pdf_name
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodging wherePdfName($value)
* @mixin \Eloquent
*/
class FewoLodging extends Model
{

View file

@ -17,7 +17,6 @@ use Illuminate\Database\Eloquent\Model;
* @property \Illuminate\Database\Eloquent\Collection $fewo_lodgings
* @property \Illuminate\Database\Eloquent\Collection $fewo_lodging_group_images
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroup newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroup newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroup query()
@ -25,6 +24,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroup whereName($value)
* @property-read int|null $fewo_lodging_group_images_count
* @property-read int|null $fewo_lodgings_count
* @mixin \Eloquent
*/
class FewoLodgingGroup extends Model
{

View file

@ -21,7 +21,6 @@ use Illuminate\Database\Eloquent\Model;
* @property string $description
* @property \App\Models\FewoLodgingGroup $fewo_lodging_group
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroupImage newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroupImage newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroupImage query()
@ -32,6 +31,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroupImage whereGroupId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroupImage whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingGroupImage wherePos($value)
* @mixin \Eloquent
*/
class FewoLodgingGroupImage extends Model
{

View file

@ -20,7 +20,6 @@ use Illuminate\Database\Eloquent\Model;
* @property string $description
* @property \App\Models\FewoLodging $fewo_lodging
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingImage newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingImage newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingImage query()
@ -30,6 +29,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingImage whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingImage whereLodgingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingImage wherePos($value)
* @mixin \Eloquent
*/
class FewoLodgingImage extends Model
{

View file

@ -16,13 +16,13 @@ use Illuminate\Database\Eloquent\Model;
* @property string $name
* @property \Illuminate\Database\Eloquent\Collection $fewo_lodgings
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingType newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingType newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingType query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingType whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoLodgingType whereName($value)
* @property-read int|null $fewo_lodgings_count
* @mixin \Eloquent
*/
class FewoLodgingType extends Model
{

View file

@ -20,7 +20,6 @@ use Illuminate\Database\Eloquent\Model;
* @property \App\Models\FewoSeason $fewo_season
* @property \App\Models\FewoLodging $fewo_lodging
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoPrice newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoPrice newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoPrice query()
@ -29,6 +28,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoPrice whereLodgingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoPrice wherePerNight($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoPrice whereSeasonId($value)
* @mixin \Eloquent
*/
class FewoPrice extends Model
{

View file

@ -20,7 +20,6 @@ use Illuminate\Database\Eloquent\Model;
* @property int $type
* @property \App\Models\FewoLodging $fewo_lodging
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoReservation newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoReservation newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoReservation query()
@ -30,6 +29,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoReservation whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoReservation whereToDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoReservation whereType($value)
* @mixin \Eloquent
*/
class FewoReservation extends Model
{

View file

@ -21,7 +21,6 @@ use Illuminate\Database\Eloquent\Model;
* @property int $only_weekday
* @property \Illuminate\Database\Eloquent\Collection $fewo_prices
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoSeason newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoSeason newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoSeason query()
@ -33,6 +32,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoSeason whereOnlyWeekday($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\FewoSeason whereToDate($value)
* @property-read int|null $fewo_prices_count
* @mixin \Eloquent
*/
class FewoSeason extends Model
{

View file

@ -37,8 +37,8 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|IQContentCategory withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class IQContentCategory extends Model
{
@ -62,7 +62,7 @@ class IQContentCategory extends Model
];
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [

View file

@ -25,10 +25,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereTreeNodeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereFaqId($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQContentFaq extends Model
{

View file

@ -22,9 +22,9 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereTravelGuideId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereTreeNodeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $identifier
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereIdentifier($value)
* @mixin \Eloquent
*/
class IQContentSite extends Model
{

View file

@ -42,13 +42,13 @@ use Illuminate\Support\Str;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTree whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\App\Models\IQContentTree withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\Models\IQContentTree withoutTrashed()
* @mixin \Eloquent
* @property int|null $page_id
* @property int|null $root_id
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTree wherePageId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTree whereRootId($value)
* @property-read int|null $iq_content_tree_nodes_count
* @method static \Illuminate\Database\Eloquent\Builder|IQContentTree withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class IQContentTree extends Model
{
@ -67,7 +67,7 @@ class IQContentTree extends Model
protected $casts = ['settings' => 'array'];
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [

View file

@ -50,7 +50,6 @@ use Illuminate\Support\Str;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTreeNode whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\App\Models\IQContentTreeNode withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\Models\IQContentTreeNode withoutTrashed()
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentSite[] $iq_content_site
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentSite[] $iq_content_sites
* @property-read int|null $iq_content_sites_count
@ -64,6 +63,7 @@ use Illuminate\Support\Str;
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faqs
* @property-read int|null $iq_content_faqs_count
* @method static \Illuminate\Database\Eloquent\Builder|IQContentTreeNode withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class IQContentTreeNode extends Model
{
@ -82,7 +82,7 @@ class IQContentTreeNode extends Model
protected $casts = ['settings' => 'array', 'image' => 'array'];
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [

View file

@ -91,7 +91,6 @@ use Illuminate\Database\Eloquent\Collection;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereTravelperiodStart($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereWebsiteId($value)
* @mixin \Eloquent
* @property-read \App\Models\Sym\TravelCountry|null $travel_country_crm
* @property bool|null $is_rebook
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereIsRebook($value)
@ -104,6 +103,7 @@ use Illuminate\Database\Eloquent\Collection;
* @property-read int|null $lead_mails_sent_at_count
* @property-read Collection|\App\Models\LeadNotice[] $lead_notices
* @property-read int|null $lead_notices_count
* @mixin \Eloquent
*/
class Lead extends Model
{

View file

@ -30,12 +30,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantFirstname($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantSalutationId($value)
* @mixin \Eloquent
* @property int|null $participant_child
* @property int|null $nationality_id
* @property-read \App\Models\TravelNationality|null $travel_nationality
* @method static \Illuminate\Database\Eloquent\Builder|LeadParticipant whereNationalityId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadParticipant whereParticipantChild($value)
* @mixin \Eloquent
*/
class LeadParticipant extends Model
{

228
app/Models/News.php Normal file
View file

@ -0,0 +1,228 @@
<?php
namespace App\Models;
use Carbon\Carbon;
use HTMLHelper;
/**
* App\Models\News
*
* @property int $id
* @property int|null $owner
* @property string|null $model
* @property int|null $lvl
* @property int $owner_second
* @property int|null $catalog_id
* @property int|null $catalog_index
* @property string|null $slug
* @property int|null $travel_program
* @property int|null $status
* @property int|null $show_in_navi
* @property int|null $order
* @property string|null $title
* @property string|null $pagetitle
* @property string|null $description
* @property string|null $keywords
* @property string|null $content
* @property string|null $content_new
* @property string|null $buma_destination
* @property int|null $OLD_CatalogID
* @property int|null $OLD_OwnerID
* @property int|null $buma_gjr
* @property string|null $date
* @property int $price-tags
* @property string|null $text_right
* @property string|null $keyword
* @property string|null $canonical_url
* @property int|null $country_id
* @property string|null $template
* @property int|null $lft
* @property int|null $rgt
* @property int|null $tree_root
* @property int|null $parent_id
* @property string|null $real_url_path
* @property string|null $box_body
* @property string|null $box_image_url
* @property string|null $box_star
* @property string|null $box_discount
* @property string|null $cms_settings
* @property int|null $fewo_lodging
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\News[] $children
* @property-read \App\Models\News|null $parent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereBoxBody($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereBoxDiscount($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereBoxImageUrl($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereBoxStar($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereBumaDestination($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereBumaGjr($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereCanonicalUrl($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereCatalogId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereCatalogIndex($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereCmsSettings($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereContent($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereContentNew($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereFewoLodging($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereKeyword($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereKeywords($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereLft($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereLvl($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereModel($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereOLDCatalogID($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereOLDOwnerID($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereOrder($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereOwner($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereOwnerSecond($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News wherePagetitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereParentId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News wherePriceTags($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereRealUrlPath($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereRgt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereShowInNavi($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTemplate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTextRight($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTravelProgram($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTreeRoot($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereUpdatedAt($value)
* @property int|null $travel_guide_content_id
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTravelGuideContentId($value)
* @property string|null $title_short
* @property string|null $before_title
* @property-read int|null $children_count
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereBeforeTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTitleShort($value)
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Page> $child_pages
* @property-read int|null $child_pages_count
* @property-read \App\Models\Page|null $page
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Page> $pages
* @property-read int|null $pages_count
* @property-read \App\Models\Page|null $parent_page
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\TravelCountry> $travel_countries
* @property-read int|null $travel_countries_count
* @property-read \App\Models\TravelCountry|null $travel_country
* @property-read \App\Models\TravelGuide|null $travel_guide
* @property-read \App\Models\TravelProgram|null $travel_program_content
* @method static \Illuminate\Database\Eloquent\Builder|Page findSimilarSlugs(string $attribute, array $config, string $slug)
* @method static \Illuminate\Database\Eloquent\Builder|Page withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class News extends Page
{
protected $table = 'page';
protected $fillable = [
'title', 'status', 'slug', 'date', 'content', 'content_new', 'box_body', 'description', 'pagetitle', 'keywords', 'order', 'active',
];
protected $casts = ['box_body' => 'array', 'date' => 'date', 'status' => 'boolean', 'active' => 'boolean'];
public static function boot()
{
parent::boot();
static::addGlobalScope(function ($query) {
$query->where('model', 'news');
$query->orderBy('lvl', 'ASC');
$query->orderBy('date', 'DESC');
});
}
public function parent()
{
return $this->belongsTo('App\Models\News', 'parent_id');
}
public function getParent()
{
if ($this->lvl == 1) {
$this->parent();
}
return false;
}
public function children()
{
return $this->hasMany('App\Models\News', 'parent_id');
}
public function setContentAttribute($value)
{
if (!$value) {
$this->attributes['content'] = $value;
} else {
$this->attributes['content'] = HTMLHelper::filterHTML($value, ['src' => ['removeHost']], true);
}
}
public function getContentAttribute()
{
return $this->attributes['content_new'] === null ? $this->attributes['content'] : $this->attributes['content_new'];
}
public function setContentNewAttribute($value)
{
if (!$value) {
$this->attributes['content_new'] = $value;
} else {
$this->attributes['content_new'] = HTMLHelper::filterHTML($value, ['src' => ['removeHost']], true);
}
}
public function getContentNewAttribute()
{
return $this->attributes['content_new'] === null ? $this->attributes['content'] : $this->attributes['content_new'];
}
public function getParentsArray(){
//lvl 0
return Page::where('model', 'News')->where('lvl', 1)->get()->pluck('title', 'id');
}
//$Newss = News::where('lvl', 1)->get();
public function getDateRow()
{
return$this->attributes['date'];
}
public function getDateAttribute()
{
return isset($this->attributes['date']) ? Carbon::parse($this->attributes['date'])->format("d.m.Y") : '';
}
public function setDateAttribute($value)
{
if (!$value) {
$this->attributes['date'] = null;
} else {
try {
$this->attributes['date']= Carbon::parse($value);
} catch (\Exception $e) {
$this->attributes['date'] = Carbon::now();
}
}
}
public function getImage($key){
//use box_body for images
if(isset($this->box_body[$key])){
return $this->box_body[$key];
}
return "";
}
}

View file

@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Page
*
*
* @property int $id
* @property int|null $owner
* @property string|null $model
@ -59,7 +59,6 @@ use Illuminate\Database\Eloquent\Model;
* @property int|null $fewo_lodging
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @property Page|null $page
* @property TravelCountry|null $travel_country
* @property TravelGuide|null $travel_guide
@ -67,9 +66,63 @@ use Illuminate\Database\Eloquent\Model;
* @property Collection|Redirect[] $redirects
* @property Collection|TravelCountry[] $travel_countries
* @property Collection|TravelProgram[] $travel_program_content
*
* @package App\Models
* @property-read Collection<int, Page> $child_pages
* @property-read int|null $child_pages_count
* @property-read int|null $pages_count
* @property-read Page|null $parent_page
* @property-read int|null $travel_countries_count
* @method static \Illuminate\Database\Eloquent\Builder|Page findSimilarSlugs(string $attribute, array $config, string $slug)
* @method static \Illuminate\Database\Eloquent\Builder|Page newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Page newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Page query()
* @method static \Illuminate\Database\Eloquent\Builder|Page whereBeforeTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereBoxBody($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereBoxDiscount($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereBoxImageUrl($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereBoxStar($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereBumaDestination($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereBumaGjr($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereCanonicalUrl($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereCatalogId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereCatalogIndex($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereCmsSettings($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereContent($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereContentNew($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereFewoLodging($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereKeyword($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereKeywords($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereLft($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereLvl($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereModel($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereOLDCatalogID($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereOLDOwnerID($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereOrder($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereOwner($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereOwnerSecond($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page wherePagetitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereParentId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page wherePriceTags($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereRealUrlPath($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereRgt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereShowInNavi($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereTemplate($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereTextRight($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereTitleShort($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereTravelGuideContentId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereTravelProgram($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereTreeRoot($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Page withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class Page extends Model
{
@ -151,7 +204,7 @@ class Page extends Model
'fewo_lodging'
];
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [
@ -187,7 +240,7 @@ class Page extends Model
public function redirects()
{
return $this->hasMany(Redirect::class);
//return $this->hasMany(Redirect::class);
}
public function travel_countries()

View file

@ -32,7 +32,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantFirstname($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereParticipantSalutationId($value)
* @mixin \Eloquent
* @property int|null $nationality_id
* @property-read \App\Models\TravelNationality|null $travel_nationality
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereNationalityId($value)
@ -40,6 +39,7 @@ use Illuminate\Database\Eloquent\Model;
* @property bool|null $participant_storno
* @method static \Illuminate\Database\Eloquent\Builder|Participant whereParticipantPass($value)
* @method static \Illuminate\Database\Eloquent\Builder|Participant whereParticipantStorno($value)
* @mixin \Eloquent
*/
class Participant extends Model
{

View file

@ -26,13 +26,13 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereType($value)
* @mixin \Eloquent
* @property array|null $contact_emails
* @property bool|null $active
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ServiceProvider whereContactEmails($value)
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ServiceProviderService[] $service_provider_services
* @property-read int|null $service_provider_services_count
* @mixin \Eloquent
*/
class ServiceProvider extends Model
{

View file

@ -49,12 +49,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser whereUsername($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser query()
* @property-read \App\User|null $user
* @property-read mixed $fullname
* @mixin \Eloquent
*/
class SfGuardUser extends Model
{

View file

@ -25,10 +25,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereShowAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget query()
* @mixin \Eloquent
*/
class SidebarWidget extends Model
{
@ -54,6 +54,7 @@ class SidebarWidget extends Model
'travelGuideSidebarWidget' => 'Reiseführer',
'travelMagazineSidebarWidget' => 'Reisemagazin',
'offersSidebarWidget' => 'Angebote',
'newsSidebarWidget' => 'News',
];

View file

@ -30,10 +30,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\Arrangement whereTypeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\Arrangement whereTypeS($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\Arrangement whereViewPosition($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\Arrangement newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\Arrangement newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\Arrangement query()
* @mixin \Eloquent
*/
class Arrangement extends Model
{

View file

@ -13,11 +13,11 @@ use Illuminate\Database\Eloquent\Model;
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Sym\Arrangement[] $arrangements
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\ArrangementTemplate whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\ArrangementTemplate whereTitle($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\ArrangementTemplate newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\ArrangementTemplate newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\ArrangementTemplate query()
* @property-read int|null $arrangements_count
* @mixin \Eloquent
*/
class ArrangementTemplate extends Model
{

View file

@ -32,7 +32,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent findSimilarSlugs($attribute, $config, $slug)
* @property string|null $identifier
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereIdentifier($value)
@ -41,6 +40,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereObject($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|CmsContent withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class CmsContent extends Model
{
@ -62,7 +62,7 @@ class CmsContent extends Model
public $timestamps = false;
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [

View file

@ -20,7 +20,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereIsCustomerCountry($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereName($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry query()
@ -53,6 +52,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereDestco($value)
* @property string|null $visum_text
* @method static \Illuminate\Database\Eloquent\Builder|TravelCountry whereVisumText($value)
* @mixin \Eloquent
*/
class TravelCountry extends Model
{

View file

@ -17,10 +17,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereTravelcountryId($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda query()
* @mixin \Eloquent
*/
class TravelAgenda extends Model
{

View file

@ -37,6 +37,15 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance wherePremium($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereRequestData($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereUpdatedAt($value)
* @property string|null $name
* @property int|null $travel_country_id
* @property int|null $active
* @property-read \App\Models\TravelCountry|null $travel_country
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\TravelProgram> $travel_programs
* @property-read int|null $travel_programs_count
* @method static \Illuminate\Database\Eloquent\Builder|TravelArrivalPoint whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelArrivalPoint whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelArrivalPoint whereTravelCountryId($value)
* @mixin \Eloquent
*/
class TravelArrivalPoint extends Model

View file

@ -9,6 +9,104 @@ namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\TravelBooking
*
* @property int $id
* @property int|null $crm_booking_id
* @property int|null $salutation_id
* @property string|null $first_name
* @property string|null $last_name
* @property string|null $street
* @property string|null $zipcode
* @property string|null $city
* @property int|null $country_id
* @property string|null $fax
* @property string|null $phone
* @property string|null $mobile
* @property string|null $email
* @property string|null $comments
* @property \Illuminate\Support\Carbon|null $created
* @property \Illuminate\Support\Carbon|null $selected_start_date
* @property \Illuminate\Support\Carbon|null $selected_end_date
* @property string|null $program_name
* @property array|null $selected_travel
* @property array|null $selected_departure
* @property int|null $program_id
* @property int|null $period_id
* @property string|null $class
* @property int|null $selected_adults
* @property int|null $selected_childs
* @property int|null $participants_total
* @property array|null $participants
* @property array|null $drafts
* @property array|null $service_items
* @property array|null $arrangements
* @property array|null $rooms
* @property float|null $price
* @property float|null $price_total
* @property float|null $deposit_total
* @property float|null $final_payment
* @property \Illuminate\Support\Carbon|null $final_payment_date
* @property string|null $insurance_name
* @property array|null $insurances
* @property int|null $insurance_offer
* @property int|null $travel_cancellation
* @property array|null $options
* @property array $class_options
* @property array $extra_category
* @property bool|null $accept_legal_rights
* @property string|null $ip
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking query()
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereAcceptLegalRights($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereArrangements($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereCity($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereClass($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereClassOptions($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereComments($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereCreated($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereCrmBookingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereDepositTotal($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereDrafts($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereExtraCategory($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereFax($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereFinalPayment($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereFinalPaymentDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereFirstName($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereInsuranceName($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereInsuranceOffer($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereInsurances($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereIp($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereLastName($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereMobile($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereOptions($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereParticipants($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereParticipantsTotal($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking wherePeriodId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking wherePhone($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking wherePrice($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking wherePriceTotal($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereProgramId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereProgramName($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereRooms($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereSalutationId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereSelectedAdults($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereSelectedChilds($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereSelectedDeparture($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereSelectedEndDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereSelectedStartDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereSelectedTravel($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereServiceItems($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereStreet($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereTravelCancellation($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelBooking whereZipcode($value)
* @mixin \Eloquent
*/
class TravelBooking extends Model
{
protected $connection = 'mysql_stern';

View file

@ -18,7 +18,6 @@ use Illuminate\Database\Eloquent\Model;
* @property \Carbon\Carbon $updated_at
* @property \Illuminate\Database\Eloquent\Collection $travel_user_booking_fewos
* @package App\Models
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBookingFewoChannel newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBookingFewoChannel newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBookingFewoChannel query()
@ -27,6 +26,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBookingFewoChannel whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelBookingFewoChannel whereUpdatedAt($value)
* @property-read int|null $travel_user_booking_fewos_count
* @mixin \Eloquent
*/
class TravelBookingFewoChannel extends Model
{

View file

@ -24,6 +24,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCategory whereName($value)
* @property int|null $active
* @property-read Collection<int, \App\Models\TravelProgram> $travel_programs
* @property-read int|null $travel_programs_count
* @method static \Illuminate\Database\Eloquent\Builder|TravelCategory whereActive($value)
* @mixin \Eloquent
*/
class TravelCategory extends Model

View file

@ -23,12 +23,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereProgramId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereStandard($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereUpdatedAt($value)
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelProgramDraft[] $travel_program_drafts
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass query()
* @property-read int|null $travel_program_drafts_count
* @mixin \Eloquent
*/
class TravelClass extends Model
{

View file

@ -31,13 +31,13 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereIsInhouse($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany wherePercentage($value)
* @mixin \Eloquent
* @property int|null $active
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereActive($value)
* @property array|null $contact_emails
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCompany whereContactEmails($value)
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelCompanyService[] $travel_company_services
* @property-read int|null $travel_company_services_count
* @mixin \Eloquent
*/
class TravelCompany extends Model
{

View file

@ -33,7 +33,6 @@ use Illuminate\Support\Str;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereIsCustomerCountry($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry query()
@ -73,6 +72,7 @@ use Illuminate\Support\Str;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereDestco($value)
* @property string|null $visum_text
* @method static \Illuminate\Database\Eloquent\Builder|TravelCountry whereVisumText($value)
* @mixin \Eloquent
*/
class TravelCountry extends Model
{

View file

@ -37,6 +37,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance wherePremium($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereRequestData($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelInsurance whereUpdatedAt($value)
* @property string|null $name
* @property string $text
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\TravelProgram> $travel_programs
* @property-read int|null $travel_programs_count
* @method static \Illuminate\Database\Eloquent\Builder|TravelGerneralNote whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelGerneralNote whereText($value)
* @mixin \Eloquent
*/
class TravelGerneralNote extends Model

View file

@ -35,7 +35,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide query()
@ -52,6 +51,7 @@ use Illuminate\Database\Eloquent\Model;
* @property-read \App\Models\CMSAuthor|null $author
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereAuthorId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelGuide withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
* @mixin \Eloquent
*/
class TravelGuide extends Model
{
@ -75,7 +75,7 @@ class TravelGuide extends Model
];
public function sluggable()
public function sluggable(): array
{
return [
'slug' => [

View file

@ -13,12 +13,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationality whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationality whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationality whereName($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationality newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationality newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationality query()
* @property string|null $nat
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationality whereNat($value)
* @mixin \Eloquent
*/
class TravelNationality extends Model
{

View file

@ -17,10 +17,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationalityRequirement whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationalityRequirement whereTravelCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationalityRequirement whereTravelNationalityId($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationalityRequirement newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationalityRequirement newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationalityRequirement query()
* @mixin \Eloquent
*/
class TravelNationalityRequirement extends Model
{

View file

@ -96,11 +96,11 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelPageGuide whereTravelProgram($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelPageGuide whereTreeRoot($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelPageGuide whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $title_short
* @property string|null $before_title
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelPageGuide whereBeforeTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelPageGuide whereTitleShort($value)
* @mixin \Eloquent
*/
class TravelPageGuide extends Model
{

View file

@ -127,6 +127,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgram whereUrl($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgram whereWeekdays($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgram whereYouth($value)
* @property string|null $payment_conditions
* @property-read \App\Models\Page|null $page
* @property-read \App\Models\TravelProgramCategory|null $travel_program_category
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgram wherePaymentConditions($value)
* @mixin \Eloquent
*/
class TravelProgram extends Model
@ -237,7 +241,7 @@ class TravelProgram extends Model
//default 1 sterntours
public function travel_organizer()
{
return $this->belongsTo(TravelOrganizer::class, 'organizer');
//return $this->belongsTo(TravelOrganizer::class, 'organizer');
}
public function travel_insurance()
@ -252,12 +256,12 @@ class TravelProgram extends Model
public function travel_general_note()
{
return $this->belongsTo(TravelGeneralNote::class, 'generalnote');
//return $this->belongsTo(TravelGeneralNote::class, 'generalnote');
}
public function option()
{
return $this->hasOne(Option::class, 'program_id');
//return $this->hasOne(Option::class, 'program_id');
}
public function page()
@ -278,12 +282,12 @@ class TravelProgram extends Model
public function travel_departure_points()
{
return $this->hasMany(TravelDeparturePoint::class, 'program_id');
//return $this->hasMany(TravelDeparturePoint::class, 'program_id');
}
public function travel_periods()
{
return $this->hasMany(TravelPeriod::class, 'program_id');
//return $this->hasMany(TravelPeriod::class, 'program_id');
}
public function travel_program_country()
@ -293,7 +297,7 @@ class TravelProgram extends Model
public function travel_program_destination()
{
return $this->hasOne(TravelProgramDestination::class, 'program_id');
//return $this->hasOne(TravelProgramDestination::class, 'program_id');
}
public function travel_program_drafts()
@ -303,17 +307,17 @@ class TravelProgram extends Model
public function travel_program_images()
{
return $this->hasMany(TravelProgramImage::class, 'program_id');
//return $this->hasMany(TravelProgramImage::class, 'program_id');
}
public function travel_program_option()
{
return $this->hasOne(TravelProgramOption::class, 'program_id');
//return $this->hasOne(TravelProgramOption::class, 'program_id');
}
public function travel_program_related()
{
return $this->hasOne(TravelProgramRelated::class, 'program_2');
//return $this->hasOne(TravelProgramRelated::class, 'program_2');
}
public function hasTravelProgramDrafts (){

View file

@ -10,6 +10,22 @@ use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\TravelProgramCategory
*
* @property int $id
* @property string|null $name
* @property string $conversion_code
* @property-read int|null $travel_programs_count
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgramCategory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgramCategory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgramCategory query()
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgramCategory whereConversionCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgramCategory whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelProgramCategory whereName($value)
* @property-read Collection<int, \App\Models\TravelProgram> $travel_programs
* @mixin \Eloquent
*/
class TravelProgramCategory extends Model
{
protected $connection = 'mysql_stern';

View file

@ -14,10 +14,10 @@ use Illuminate\Database\Eloquent\Model;
* @property-read \App\Models\TravelProgram|null $travel_program
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramCountry whereCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramCountry whereProgramId($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramCountry newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramCountry newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramCountry query()
* @mixin \Eloquent
*/
class TravelProgramCountry extends Model
{

View file

@ -24,10 +24,10 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramDraft whereTravelProgramId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramDraft whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramDraft whereWeekdays($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramDraft newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramDraft newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgramDraft query()
* @mixin \Eloquent
*/
class TravelProgramDraft extends Model
{

View file

@ -1,29 +0,0 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
class TravelProgramCategory extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'travel_category';
public $timestamps = false;
protected $fillable = [
'name',
];
public function travel_programs()
{
return $this->hasMany(TravelProgram::class, 'category_id');
}
}

View file

@ -42,7 +42,6 @@ use Illuminate\Database\Eloquent\Model;
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\App\Models\TravelUser withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\Models\TravelUser withoutTrashed()
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUser query()
@ -67,6 +66,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUser whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelUser whereZipcode($value)
* @property-read int|null $travel_user_booking_fewos_count
* @mixin \Eloquent
*/
class TravelUser extends Model
{

View file

@ -47,7 +47,6 @@ use App\Services\Util;
* @method static bool|null restore()
* @method static \Illuminate\Database\Query\Builder|\App\Models\TravelUserBookingFewo withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\Models\TravelUserBookingFewo withoutTrashed()
* @mixin \Eloquent
* @property int|null $fewo_reservation_id
* @property float|null $price_balance
* @property float|null $price_extra
@ -108,6 +107,9 @@ use App\Services\Util;
* @property-read \App\Models\TravelUser $customer
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelUserBookingFewoNotice[] $booking_fewo_notices
* @property-read int|null $booking_fewo_notices_count
* @property bool $is_calendar_traum_fewo
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewo whereIsCalendarTraumFewo($value)
* @mixin \Eloquent
*/
class TravelUserBookingFewo extends Model
{

View file

@ -8,7 +8,6 @@ use Illuminate\Database\Eloquent\Model;
* App\Models\UserUpdateEmail
*
* @property-read \App\User $user
* @mixin \Eloquent
* @property int $user_id
* @property string $email
* @property string $token
@ -20,6 +19,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserUpdateEmail whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserUpdateEmail whereToken($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserUpdateEmail whereUserId($value)
* @mixin \Eloquent
*/
class UserUpdateEmail extends Model
{

View file

@ -207,7 +207,8 @@ class BookingPDFRepository extends BaseRepository {
'total' => $price,
'storno' => $price_canceled,
'storno_date' => $data['storno_date'],
'storno_print' => $data['storno_print']
'storno_print' => $data['storno_print'],
'binary_data' => NULL,
];
if($this->model->hasDocument($identifier)){
$booking_document = $this->model->getDocument($identifier);

View file

@ -51,7 +51,7 @@ class CustomerMailRepository extends BaseRepository {
$data['subject'] = $this->prepareContent($booking, $data['subject']);
}
$reply_id = isset($data['customer_mail_id']) ? $data['customer_mail_id'] : NULL;
$email = isset($data['send_mail_to_mail'][$booking_id]) ? $data['send_mail_to_mail'][$booking_id] : $booking->customer->email;
$email = isset($data['send_mail_to_mail'][$booking_id]) ? $data['send_mail_to_mail'][$booking_id] : null;
$customer_mail = $this->store($booking, $data, $email, false, $reply_id);
foreach ($customer_files as $file) {
$file->customer_id = $booking->customer_id;

View file

@ -19,8 +19,11 @@ use App\Models\FewoReservation;
use App\Models\TravelProgramDraft;
use App\Models\TravelUserBookingFewo;
use App\Models\TravelUserBookingFewoNotice;
use Illuminate\Validation\ValidationException;
use Illuminate\Support\Facades\Log;
class TravelUserBookingFewoRepository extends BaseRepository {
class TravelUserBookingFewoRepository extends BaseRepository
{
public function __construct(TravelProgram $model)
@ -28,28 +31,31 @@ class TravelUserBookingFewoRepository extends BaseRepository {
$this->model = $model;
}
public function updateNotice($id, $data){
public function updateNotice($id, $data)
{
$model = TravelUserBookingFewo::findOrFail($id);
if($data['action'] === 'edit_notice' && isset($data['notice_id'])){
if ($data['action'] === 'edit_notice' && isset($data['notice_id'])) {
$BookingNotice = TravelUserBookingFewoNotice::findOrFail($data['notice_id']);
$BookingNotice->message = isset($data['booking_fewo_notice']) ? $data['booking_fewo_notice'] : "";
$BookingNotice->edit_at = now();
$BookingNotice->save();
}else{
} else {
//save_notice
TravelUserBookingFewoNotice::create([
'travel_user_booking_fewo_id' => $model->id,
'from_user_id' => \Auth::user()->id,
'message' => isset($data['booking_fewo_notice']) ? $data['booking_fewo_notice'] : "",
TravelUserBookingFewoNotice::create(
[
'travel_user_booking_fewo_id' => $model->id,
'from_user_id' => \Auth::user()->id,
'message' => isset($data['booking_fewo_notice']) ? $data['booking_fewo_notice'] : "",
]
);
}
return $model;
}
public function createTravelInfoPDF($id, $travel_info_user_text){
public function createTravelInfoPDF($id, $travel_info_user_text)
{
$model = TravelUserBookingFewo::findOrFail($id);
$travel_info_user_text = str_replace("", "&euro;", $travel_info_user_text);
@ -61,31 +67,31 @@ class TravelUserBookingFewoRepository extends BaseRepository {
'travel_info_user_text' => $travel_info_user_text,
];
$path =$model->getTravelInfoPath();
$path = $model->getTravelInfoPath();
$dir = $model->getTravelInfoDir();
$filename = $model->getTravelInfoFileName();
$pdf_file = new CreatePDF('pdf.travel_info_fewo', 'fewo_infos');
$pdf_file->create($data, $filename, 'save', $path);
$pdf_file->merger($dir, $filename, 'sterntours-template-logo');
return $path.$filename;
return $path . $filename;
}
public function createInvoicePDF($id){
public function createInvoicePDF($id)
{
$model = TravelUserBookingFewo::findOrFail($id);
$data = [
'model' => $model,
];
$path =$model->getInvoicePath();
$path = $model->getInvoicePath();
$dir = $model->getInvoiceDir();
$filename = $model->getInvoiceFileName();
$pdf_file = new CreatePDF('pdf.invoice_fewo', 'fewo_invoices');
$pdf_file->create($data, $filename, 'save', $path);
$pdf_file->merger($dir, $filename, 'sterntours-template-logo');
return $path.$filename;
return $path . $filename;
}
public function check($id,$data)
public function check($id, $data)
{
//check for data
$model = TravelUserBookingFewo::findOrFail($id);
@ -99,10 +105,10 @@ class TravelUserBookingFewoRepository extends BaseRepository {
->where('to_date', '>', $from_date)
->get();
if($fewos->count()){
if ($fewos->count()) {
$error = [];
foreach ($fewos as $fewo){
$error[] = "Reservierung gefunden: ".$fewo->from_date->format('d.m.Y')." - ".$fewo->to_date->format('d.m.Y');
foreach ($fewos as $fewo) {
$error[] = "Reservierung gefunden: " . $fewo->from_date->format('d.m.Y') . " - " . $fewo->to_date->format('d.m.Y');
}
return ['success' => false, 'error' => $error];
}
@ -112,13 +118,13 @@ class TravelUserBookingFewoRepository extends BaseRepository {
'travel_user_id' => 'required',
'fewo_lodging_id' => 'required',
'booking_date' => 'required',
'invoice_number' => 'required|unique:mysql_stern.travel_user_booking_fewos,invoice_number,'.$model->id,
'from_date'=>'required',
'to_date'=>'required',
'invoice_number' => 'required|unique:mysql_stern.travel_user_booking_fewos,invoice_number,' . $model->id,
'from_date' => 'required',
'to_date' => 'required',
'travel_booking_fewo_channel_id' => 'required',
'status' => 'required'
);
// $rules['email'] = 'required|string|email|max:255|unique:.travel_users,email,'.$model->id;
// $rules['email'] = 'required|string|email|max:255|unique:.travel_users,email,'.$model->id;
$validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) {
return ['success' => false, 'error' => $validator];
@ -132,23 +138,24 @@ class TravelUserBookingFewoRepository extends BaseRepository {
$model->daily_prices = $res['season'];
if($fewo_reservation = $model->fewo_reservation){
if($model->is_calendar_stern_tours){
if ($fewo_reservation = $model->fewo_reservation) {
if ($model->is_calendar_stern_tours) {
$model->fewo_reservation->from_date = $model->getFromDateRaw();
$model->fewo_reservation->to_date = $model->getToDateRaw();
}else{
} else {
$model->fewo_reservation->from_date = null;
$model->fewo_reservation->to_date = null;
}
$model->fewo_reservation->save();
}else{
if($model->is_calendar_stern_tours){
} else {
if ($model->is_calendar_stern_tours) {
$res = FewoReservation::create([
'lodging_id' => $model->fewo_lodging_id,
'from_date' => $model->getFromDateRaw(),
'to_date' => $model->getToDateRaw(),
'status' => 0,
'type' => 0]);
'type' => 0
]);
$model->fewo_reservation_id = $res->id;
$model->save();
}
@ -156,145 +163,169 @@ class TravelUserBookingFewoRepository extends BaseRepository {
$model->save();
\Session()->flash('alert-save', '1');
return ['success' => true, 'id' => $model->id];
}
public function update($id,$data)
public function update($id, $data)
{
//check for data
$check_for_reservation = true;
$fewo_reservation_id = 0;
$model = false;
if($id > 0) {
$model = TravelUserBookingFewo::findOrFail($id);
if($data['from_date'] == $model->from_date && $data['to_date'] == $model->to_date){
$check_for_reservation = false;
}
$fewo_reservation_id = $model->fewo_reservation_id;
try {
$needsReservationCheck = true;
$existingReservationId = 0;
$existingBooking = null;
}
if($check_for_reservation){
$from_date = Carbon::parse($data['from_date'])->format('Y-m-d');
$to_date = Carbon::parse($data['to_date'])->format('Y-m-d');
$fewos = FewoReservation::where('lodging_id', $data['fewo_lodging_id'])
->where('id', '!=', $fewo_reservation_id)
->where('from_date', '<', $to_date)
->where('to_date', '>', $from_date)
->get();
if($fewos->count()){
$error = [];
foreach ($fewos as $fewo){
$error[] = "Reservierung gefunden: ".$fewo->from_date->format('d.m.Y')." - ".$fewo->to_date->format('d.m.Y');
// Prüfe ob es eine Bearbeitung ist
if (is_numeric($id) && $id > 0) {
$existingBooking = TravelUserBookingFewo::findOrFail($id);
// Prüfe ob sich relevante Daten geändert haben
$needsReservationCheck = !($data['from_date'] == $existingBooking->from_date &&
$data['to_date'] == $existingBooking->to_date &&
$data['fewo_lodging_id'] == $existingBooking->fewo_lodging_id);
$existingReservationId = $existingBooking->fewo_reservation_id;
}
if ($needsReservationCheck) {
// Validiere und formatiere Daten
if (!isset($data['from_date'], $data['to_date'], $data['fewo_lodging_id'])) {
throw new ValidationException('Erforderliche Daten fehlen');
}
return back()->withRequest(Request::all())->withErrors($error);
}
}
//check for
$rules = array(
'travel_user_id' => 'required',
'fewo_lodging_id' => 'required',
'from_date'=>'required',
'to_date'=>'required',
'travel_booking_fewo_channel_id' => 'required',
'status' => 'required'
);
$fromDate = Carbon::parse($data['from_date'])->startOfDay();
$toDate = Carbon::parse($data['to_date'])->startOfDay();
if($fewo_reservation_id > 0 && $model && Request::get('invoice_number')){
$rules['invoice_number'] = 'required|unique:mysql_stern.travel_user_booking_fewos,invoice_number,'.$model->id;
}
// Prüfe auf Überschneidungen
$overlappingReservations = FewoReservation::where('lodging_id', $data['fewo_lodging_id'])
->where('id', '!=', $existingReservationId)
->where('from_date', '<', $toDate)
->where('to_date', '>', $fromDate)
->get();
$validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) {
return back()->withRequest(Request::all())->withErrors($validator);
}
$data['is_calendar_fewo_direct'] = isset($data['is_calendar_fewo_direct']) ? true : false;
$data['is_calendar_traum_fewo'] = isset($data['is_calendar_traum_fewo']) ? true : false;
$data['is_calendar_hrs'] = isset($data['is_calendar_hrs']) ? true : false;
$data['is_calendar_stern_tours'] = isset($data['is_calendar_stern_tours']) ? true : false;
if($id === "new") {
$model = TravelUserBookingFewo::create($data);
}else{
$model = TravelUserBookingFewo::findOrFail($id);
if($data['from_date'] == $model->from_date && $data['to_date'] == $model->to_date){
}
$model->fill($data)->save();
}
$model->last_change_at = now();
$model->save();
$res = $this->calculatePriceNew($model);
if($res['season_find'] && $res['price_find']){
$model->daily_prices = $res['season'];
if (isset($data['calculate_price_new'])) {
$model->price_travel = $res['price_travel'];
$model->price_service = $res['price_service'];
$model->price_deposit = $res['price_deposit'];
$model->calculate_price();
$model->save();
if ($fewo_reservation = $model->fewo_reservation) {
$model->fewo_reservation->from_date = $model->getFromDateRaw();
$model->fewo_reservation->to_date = $model->getToDateRaw();
$model->fewo_reservation->save();
if ($overlappingReservations->isNotEmpty()) {
$conflicts = $overlappingReservations->map(function ($reservation) {
$lodgingName = $reservation->fewo_lodging->name;
$fewoBooking = TravelUserBookingFewo::where('fewo_reservation_id', $reservation->id)->first();
return "Reservierung gefunden: " .
$reservation->from_date->format('d.m.Y') . " - " .
$reservation->to_date->format('d.m.Y') . " (ID: " . $reservation->id . " | " . $lodgingName . ($fewoBooking ? " | " . $fewoBooking->id . " | " . $fewoBooking->travel_user->first_name . " " . $fewoBooking->travel_user->last_name : "") . ")";
})->toArray();
return back()
->withInput()
->withErrors($conflicts);
}
}
if ($fewo_reservation = $model->fewo_reservation) {
if ($model->is_calendar_stern_tours) {
$model->fewo_reservation->from_date = $model->getFromDateRaw();
$model->fewo_reservation->to_date = $model->getToDateRaw();
$model->fewo_reservation->save();
} else {
$FewoReservation = FewoReservation::find($model->fewo_reservation_id);
$model->fewo_reservation_id = NULL;
$model->save();
$FewoReservation->delete();
//check for
$rules = array(
'travel_user_id' => 'required',
'fewo_lodging_id' => 'required',
'from_date' => 'required',
'to_date' => 'required',
'travel_booking_fewo_channel_id' => 'required',
'status' => 'required'
);
$FewoReservations = FewoReservation::where('lodging_id', $model->fewo_lodging_id)->where('from_date', $model->getFromDateRaw())->where('to_date', $model->getToDateRaw())->get();
foreach ($FewoReservations as $FewoReservation) {
$FewoReservation->delete();
}
// $model->fewo_reservation->from_date = null;
// $model->fewo_reservation->to_date = null;
}
if ($existingReservationId > 0 && $existingBooking && Request::get('invoice_number')) {
$rules['invoice_number'] = 'required|unique:mysql_stern.travel_user_booking_fewos,invoice_number,' . $existingBooking->id;
}
$validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) {
return back()->withRequest(Request::all())->withErrors($validator);
}
$data['is_calendar_fewo_direct'] = isset($data['is_calendar_fewo_direct']) ? true : false;
$data['is_calendar_traum_fewo'] = isset($data['is_calendar_traum_fewo']) ? true : false;
$data['is_calendar_hrs'] = isset($data['is_calendar_hrs']) ? true : false;
$data['is_calendar_stern_tours'] = isset($data['is_calendar_stern_tours']) ? true : false;
if ($id === "new") {
$model = TravelUserBookingFewo::create($data);
} else {
if ($model->is_calendar_stern_tours) {
$model = TravelUserBookingFewo::findOrFail($id);
$model->fill($data)->save();
}
$res = FewoReservation::create([
'lodging_id' => $model->fewo_lodging_id,
'from_date' => $model->getFromDateRaw(),
'to_date' => $model->getToDateRaw(),
'status' => 0,
'type' => 0]);
$model->fewo_reservation_id = $res->id;
$model->last_change_at = now();
$model->save();
$res = $this->calculatePriceNew($model);
if ($res['season_find'] && $res['price_find']) {
$model->daily_prices = $res['season'];
if (isset($data['calculate_price_new'])) {
$model->price_travel = $res['price_travel'];
$model->price_service = $res['price_service'];
$model->price_deposit = $res['price_deposit'];
$model->calculate_price();
$model->save();
if ($fewo_reservation = $model->fewo_reservation) {
$model->fewo_reservation->from_date = $model->getFromDateRaw();
$model->fewo_reservation->to_date = $model->getToDateRaw();
$model->fewo_reservation->lodging_id = $model->fewo_lodging_id;
$model->fewo_reservation->save();
}
}
if ($fewo_reservation = $model->fewo_reservation) {
if ($model->is_calendar_stern_tours) {
$model->fewo_reservation->from_date = $model->getFromDateRaw();
$model->fewo_reservation->to_date = $model->getToDateRaw();
$model->fewo_reservation->lodging_id = $model->fewo_lodging_id;
$model->fewo_reservation->save();
} else {
$FewoReservation = FewoReservation::find($model->fewo_reservation_id);
$model->fewo_reservation_id = NULL;
$model->save();
$FewoReservation->delete();
$FewoReservations = FewoReservation::where('lodging_id', $model->fewo_lodging_id)->where('from_date', $model->getFromDateRaw())->where('to_date', $model->getToDateRaw())->get();
foreach ($FewoReservations as $FewoReservation) {
$FewoReservation->delete();
}
// $model->fewo_reservation->from_date = null;
// $model->fewo_reservation->to_date = null;
}
} else {
if ($model->is_calendar_stern_tours) {
$res = FewoReservation::create([
'lodging_id' => $model->fewo_lodging_id,
'from_date' => $model->getFromDateRaw(),
'to_date' => $model->getToDateRaw(),
'status' => 0,
'type' => 0
]);
$model->fewo_reservation_id = $res->id;
$model->save();
}
}
}
$model->save();
\Session()->flash('alert-save', '1');
return redirect(route('travel_user_booking_fewo_detail', [$model->id]));
} catch (\Exception $e) {
Log::error('Fehler bei der Reservierungsprüfung: ' . $e->getMessage());
return back()
->withInput()
->withErrors(['system' => 'Ein Systemfehler ist aufgetreten']);
}
$model->save();
\Session()->flash('alert-save', '1');
return redirect(route('travel_user_booking_fewo_detail', [$model->id]));
}
private function calculatePriceNew(TravelUserBookingFewo $travel_user_booking_fewo){
private function calculatePriceNew(TravelUserBookingFewo $travel_user_booking_fewo)
{
$FewoSeasons = FewoSeason::where('from_date', '<', $travel_user_booking_fewo->getToDateRaw())
->where('to_date', '>=', $travel_user_booking_fewo->getFromDateRaw())
->get();
$seasons = [];
foreach ($FewoSeasons as $fewoSeason){
foreach ($FewoSeasons as $fewoSeason) {
$FewoPrices = FewoPrice::where('lodging_id', $travel_user_booking_fewo->fewo_lodging_id)->where('season_id', $fewoSeason->id)->get();
$price = [];
foreach ($FewoPrices as $fewoPrice){
foreach ($FewoPrices as $fewoPrice) {
$price = $fewoPrice;
}
$seasons[] = [
@ -304,7 +335,6 @@ class TravelUserBookingFewoRepository extends BaseRepository {
'minimum_stay' => $fewoSeason->minimum_stay,
'price' => $price,
];
}
$fromDate = Carbon::parse($travel_user_booking_fewo->getFromDateRaw());
$toDate = Carbon::parse($travel_user_booking_fewo->gettoDateRaw());
@ -328,17 +358,17 @@ class TravelUserBookingFewoRepository extends BaseRepository {
//days
foreach ($period as $dt) {
foreach ($seasons as $season) {
if($dt->format("Y-m-d") >= $season['fromDay'] && $dt->format("Y-m-d") <= $season['toDay']){
if ($dt->format("Y-m-d") >= $season['fromDay'] && $dt->format("Y-m-d") <= $season['toDay']) {
$check_days[] = $dt->format("d.m.Y");
$price = $season['price'];
if(isset($price->per_night)){
if (isset($price->per_night)) {
$result['price_find'] = true;
}
$name = $season['name'];
$result['season_find'] = true;
if(!isset($result['season'][$name])){
if (!isset($result['season'][$name])) {
$result['season'][$name]['fromDay'] = $dt->format("d.m.Y");
$result['price_service'] = isset($price->flat_price) ? $price->flat_price : 0;
$result['season'][$name]['price'] = 0;
@ -347,25 +377,20 @@ class TravelUserBookingFewoRepository extends BaseRepository {
$result['season'][$name]['minimumStay'] = $season['minimum_stay'];
}
if(!$frist_day){
if (!$frist_day) {
$result['season'][$name]['price'] += isset($price->per_night) ? $price->per_night : 0;
$result['season'][$name]['numberDays'] ++;
$result['season'][$name]['numberDays']++;
$result['season'][$name]['toDay'] = $dt->format("d.m.Y");
$result['price_travel'] += isset($price->per_night) ? $price->per_night : 0;
$result['days'] ++;
$result['days']++;
$result['season_find'] = true;
}else{
} else {
$frist_day = true;
}
}
}
}
$result['price_total'] = $result['price_deposit'] + $result['price_travel'] + $result['price_service'];
return $result;
}
}
}

View file

@ -1,175 +0,0 @@
<?php
namespace App\Services;
use App\Libraries\CouponPDF;
use App\Models\Coupon;
class CreateCouponPDF {
protected $pdfRenderer;
protected $coupon;
protected $styles = array();
protected $pdf;
public function __construct(Coupon $coupon)
{
$this->coupon = $coupon;
}
public function create(){
// initiate FPDI
$pdf = new CouponPDF();
if($this->coupon->text == NULL && $this->coupon->value == 50.00){
$is_static_coupon = true;
$pdf->_set('is_static_coupon', true);
}else{
$is_static_coupon = false;
$pdf->_set('is_static_coupon', false);
}
$pdf->AddFont('Helvetica', '', 'helvetica.php');
$pdf->AddPage('P', array(210, 297));
if ($this->coupon->isLegal()) {
$pdf->SetXY(20, 90);
$pdf->SetTextColor(230, 10, 10);
$pdf->SetFont('Helvetica', 'B', 28);
$pdf->Cell(80, 20, utf8_decode('Der Gutschein ist nicht mehr gültig!'), 0, 0, 'L');
}
if(!$is_static_coupon){
$pdf->SetXY(30, 55);
$pdf->SetTextColor(16, 77, 140);
$pdf->SetFont('Helvetica', 'B', 50);
$pdf->Cell(80, 20, Util::_number_format($this->coupon->value), 0, 0, 'L');
}
$pdf->SetDrawColor(16, 77, 140);
$pdf->SetFillColor(16, 77, 140);
$pdf->SetLineWidth(0.4);
$pdf->Rect(126, 31, 74, 20, 'DF');
$pdf->SetTextColor(255,255,255);
$x = 128;
$y = 32;
$border = 0;
$pdf->SetXY($x, $y);
$pdf->SetFont('Helvetica', 'B', 10);
$pdf->Cell(30, 6, "Nummer:", $border, 0, 'L');
$pdf->SetFont('Helvetica', '', 10);
$pdf->Cell(40, 6, $this->coupon->number, $border, 0, 'R');
$y += 6;
$pdf->SetXY($x, $y);
$pdf->SetFont('Helvetica', 'B', 10);
$pdf->Cell(30, 6, utf8_decode('Gültig vom:'), $border, 0, 'L');
$pdf->SetFont('Helvetica', '', 10);
$pdf->Cell(40, 6, Util::_format_date($this->coupon->issue_date), $border, 0, 'R');
$y += 6;
$pdf->SetXY($x, $y);
$pdf->SetFont('Helvetica', 'B', 10);
$pdf->Cell(30, 6, utf8_decode('Gültig bis:'), $border, 0, 'L');
$pdf->SetFont('Helvetica', '', 10);
$pdf->Cell(40, 6, Util::_format_date($this->coupon->valid_date), $border, 0, 'R');
//$pdf->SetDrawColor(16, 77, 140);
$pdf->SetFillColor(16, 77, 140);
$pdf->Rect(126, 56, 74, 7.5, 'DF');
$pdf->Rect(126, 56, 74, 35, 'D');
$x = 128;
$y = 56;
$pdf->SetXY($x, $y);
$pdf->SetFont('Helvetica', 'B', 10);
$pdf->Cell(40, 7.5, utf8_decode('Ausgestellt für:'), $border, 0, 'L');
$pdf->SetTextColor(16, 77, 140);
$pdf->SetFont('Helvetica', '', 10);
$customerName = ($this->coupon->customer && $this->coupon->customer->salutation ? $this->coupon->customer->salutation->name . ' ' : '' )
. ($this->coupon->customer->title ? $this->coupon->customer->title . ' ' : '' )
. $this->coupon->customer->fullName();
$customerStreet = $this->coupon->customer ? $this->coupon->customer->street : '';
$customerRegion = $this->coupon->customer->zip ? $this->coupon->customer->zip." " : '';
$customerRegion .= $this->coupon->customer->city ? $this->coupon->customer->city : '';
$y += 12;
$pdf->SetXY($x, $y);
$pdf->Cell(70, 5.5, utf8_decode($customerName), $border, 0, 'L');
$y += 5.5;
$pdf->SetXY($x, $y);
$pdf->Cell(70, 5.5, utf8_decode($customerStreet), $border, 0, 'L');
$y += 5.5;
$pdf->SetXY($x, $y);
$pdf->Cell(70, 5.5, utf8_decode($customerRegion), $border, 0, 'L');
$x = 128;
$y = 106;
$pdf->SetXY($x, $y);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Helvetica', 'B', 10);
$sender = 'STERN TOURS GmbH'."\n".
'Emser Straße 3'."\n".
'10719 Berlin'."\n\n".
'Fon: +49 (0) 30 700 9410 0'."\n".
'Fax: +49 (0) 30 700 9410 44'."\n".
'e-Mail: stern@sterntours.de'."\n".
'Internet: www.sterntours.de'."\n";
$pdf->MultiCell(70, 5.5, utf8_decode($sender), $border, 'L');
if($is_static_coupon) {
$x = 12;
$y = 155.5;
$pdf->SetXY($x, $y);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Helvetica', 'B', 10);
$pdf->Cell(130, 5.5, utf8_decode('Gutscheinbedingungen:'), $border, 0, 'L');
$pdf->SetFont('Helvetica', '', 7);
$terms = '- gültig bei Pauschalreisen, Last Minute & More, Hotel und Ferienhäuser'."\n".
'- nur Einlösbar bei Buchungen mit einem Gesamtreisepreis von mind. Euro 750,-'."\n".
'- Der Gutscheinbetrag wird Ihnen nach Reiseantritt der nächsten Reise per'."\n".
' Banküberweisung zugestellt'."\n".
'- der Reise-Gutschein kann bis einen Tag vor Abreise eingelöst werden'."\n".
'- pro Buchung kann nur ein Reise-Gutschein eingelöst werden'."\n".
'- der Reise-Gutschein kann nicht auf Stornokosten angerechnet werden'."\n".
'- bei Stornierung der Reise wird der Reise-Gutschein ungültig und nicht ausgezahlt'."\n".
'- der Reise-Gutschein ist nicht übertragbar'."\n";
$y += 5.5;
$pdf->SetXY($x, $y);
$pdf->MultiCell(130, 3.5, utf8_decode($terms), $border, 'L');
}else{
$x = 12;
$y = 157;
$pdf->SetXY($x, $y);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Helvetica', '', 9);
if( $this->coupon->text !== ""){
$text = $this->coupon->text;
$text = preg_replace("/\r\n|\n|\r/", "\n", $text);
$pdf->MultiCell(180, 4.2, utf8_decode($text), 0, 'L');
}
}
$this->pdf = $pdf;
}
public function output($filename, $cd){
if($cd){
return $this->pdf->Output($filename, 'D');
}
return $this->pdf->Output();
}
}
?>

View file

@ -1,45 +0,0 @@
<?php
namespace App\Services;
use App\Libraries\CouponPDF;
use App\Models\Coupon;
use Storage;
class CreatePDF{
protected $view;
protected $pdf;
public function __construct($view)
{
$this->view = $view;
}
public function create($data, $name='test.pdf', $output='stream', $path = false){
header('Content-type: text/html; charset=UTF-8') ;//chrome
//dd($data);
$pdf = app('dompdf.wrapper');
$pdf->getDomPDF()->set_option("enable_php", true);
$pdf->loadView($this->view, $data);
$pdf->setPaper('A4', 'portrait');
if($output === 'stream'){
return $pdf->stream($name);
}
if($output === 'download'){
return $pdf->download($name);
}
if($output === 'save'){
if($path){
$pdf->save($path.$name);
return $path.$name;
}
}
}
}
?>

View file

@ -1,47 +0,0 @@
<?php
namespace App\Services;
use App\Libraries\CouponPDF;
use App\Models\Coupon;
use Storage;
class CreatePDFCoupon{
protected $view;
protected $pdf;
public function __construct($view)
{
$this->view = $view;
}
public function create($data, $name='test.pdf', $output='stream', $path = false){
header('Content-type: text/html; charset=UTF-8') ;//chrome
//dd($data);
$pdf = app('dompdf.wrapper');
$pdf->getDomPDF()->set_option("enable_php", true);
$pdf->loadView($this->view, $data);
$customPaper = array(0, 0, 595.28, 283,47);
$pdf->setPaper($customPaper, 'portrait');
// $pdf->setPaper('A4', 'portrait');
if($output === 'stream'){
return $pdf->stream($name);
}
if($output === 'download'){
return $pdf->download($name);
}
if($output === 'save'){
if($path){
$pdf->save($path.$name);
return $path.$name;
}
}
}
}
?>

View file

@ -1,127 +0,0 @@
<?php
namespace App\Services;
use App\Models\Airline;
use App\Models\Insurance;
use App\Models\CMSContent;
use App\Models\CustomerMail;
use App\Models\TravelCompany;
class Booking
{
private static $output_dirs = [];
public static function contentFiles(){
$booking_email_files = CMSContent::where('identifier', '=', 'booking-email-file')->get()->sortByDesc('pos')->pluck('slug', 'id');
return $booking_email_files;
}
public static function setOutputDirs($dir, $subdir){
self::$output_dirs[$dir][] = $subdir;
}
public static function getMailDirNotInOutput($booking_id, $dir){
$is_o_dirs = isset(self::$output_dirs[$dir]) ? self::$output_dirs[$dir] : [];
$ret = [];
$CustomerMails = CustomerMail::whereBookingId($booking_id)->whereDir($dir)->get();
if($CustomerMails){
foreach($CustomerMails as $CustomerMail){
if(!in_array($CustomerMail->subdir, $is_o_dirs)){
$ret[] = $CustomerMail->subdir;
}
}
}
return $ret;
}
public static function getCustomerMailDirs(){
$customer_mail_dirs = CMSContent::where('identifier', '=', 'customer-mail-dirs')->get()->sortBy('pos');
return $customer_mail_dirs;
}
public static function getCustomerMailDir($id){
return CMSContent::where('identifier', '=', 'customer-mail-dirs')->where('pos', '=', $id)->first();
}
public static function getCustomerMailName($customer_mail_dir, $mail_dir_id){
switch ($customer_mail_dir->getArrayContent('model')){
case 'TravelCountry':
$model = \App\Models\Sym\TravelCountry::find($mail_dir_id);
break;
case 'Airline':
$model = Airline::find($mail_dir_id);
break;
case 'Insurance':
$model = Insurance::find($mail_dir_id);
break;
case 'TravelCompany':
$model = TravelCompany::find($mail_dir_id);
break;
default:
return '';
}
if($model){
if($customer_mail_dir->getArrayContent('model') === 'TravelCountry'){
return $model->mail_dir_name;
}
return $model->name;
}
return "";
}
public static function getCustomerMailEmails($customer_mail_dir, $mail_dir_id){
switch ($customer_mail_dir->getArrayContent('model')){
case 'TravelCountry':
$model = \App\Models\Sym\TravelCountry::find($mail_dir_id);
break;
case 'Airline':
$model = Airline::find($mail_dir_id);
break;
case 'Insurance':
$model = Insurance::find($mail_dir_id);
break;
case 'TravelCompany':
$model = TravelCompany::find($mail_dir_id);
break;
default:
//direkt from CMSContent
return $customer_mail_dir->getArrayContent('emails');
}
if($model){
return $model->contact_emails;
}
return [];
}
public static function getBookingInstructionPDFName($fewo){
return "HINWEISE-FERIENWOHNUNG-".$fewo->pdf_name.".pdf";
}
public static function getBookingCMSContent($content, $identifier){
return CMSContent::where('identifier', '=', $identifier)->where('integer', $content->id)->get()->sortBy('pos');
}
public static function getBookingCMSContentForPDF($identifier_content, $identifier){
$pdf_content = [];
$contents = CMSContent::where('identifier', '=', $identifier_content)->get()->sortBy('pos');
foreach ($contents as $content){
if($content->decimal > 0){ //in_pdf
$pdf_content[] = $content;
}
if($fewo_contents = self::getBookingCMSContent($content, $identifier)){
foreach ($fewo_contents as $fewo_content){
if($fewo_content->decimal > 0){ //in_pdf
$pdf_content[] = $fewo_content;
}
}
}
}
return $pdf_content;
}
}

View file

@ -117,7 +117,7 @@ class Model
}
public static function getCMSContentGeneralNameById($id = false){
if($id > 0){
if($id != 'new' && $id > 0){
$content = CMSContent::findOrFail($id);
return $content->name;
}

View file

@ -1,188 +0,0 @@
<?php
namespace App\Services;
//use FPDI in myMerge v2
//use FPDF;
//use FPDI;
class MyPDFMerger
{
private $_files; //['form.pdf'] ["1,2,4, 5-19"]
private $_fpdi;
public function __construct()
{
/* if(!class_exists("FPDF")) {
require_once(__DIR__.'/fpdf/fpdf.php');
}
if(!class_exists("FPDI")) {
require_once(__DIR__.'/fpdi/fpdi.php');
}*/
}
public function addPDF($filepath, $pages = 'all')
{
if (file_exists($filepath)) {
if (strtolower($pages) != 'all') {
$pages = $this->_rewritepages($pages);
}
$this->_files[] = array($filepath, $pages);
} else {
throw new \exception("Could not locate PDF on '$filepath'");
}
return $this;
}
public function myMerge($outputmode = 'browser', $outputpath = 'newfile.pdf', $theme = false)
{
if (!isset($this->_files) || !is_array($this->_files)): throw new \exception("No PDFs to merge."); endif;
$fpdi = new \setasign\Fpdi\Fpdi();
$first = 1;
//
//merger operations
foreach ($this->_files as $file) {
$filename = $file[0];
$filepages = $file[1];
$count = $fpdi->setSourceFile($filename);
//add the pages
if ($filepages == 'all') {
for ($i = 1; $i <= $count; $i++) {
$count = $fpdi->setSourceFile($filename);
$template = $fpdi->importPage($i);
$size = $fpdi->getTemplateSize($template);
$orientation = ($size['height'] > $size['width']) ? 'P' : 'L';
$fpdi->AddPage($orientation, array($size['width'], $size['height']));
if($theme){
$fpdi->setSourceFile(__DIR__ . '/../../public/pdf/'.$theme.'-'.$first.'.pdf');
if($first == 1){
$first = 2;
}
$backId = $fpdi->importPage(1);
$fpdi->useTemplate($backId);
}
$fpdi->useTemplate($template);
}
} else {
foreach ($filepages as $page) {
$count = $fpdi->setSourceFile($filename);
if (!$template = $fpdi->importPage($page)): throw new \exception("Could not load page '$page' in PDF '$filename'. Check that the page exists."); endif;
$size = $fpdi->getTemplateSize($template);
$orientation = ($size['h'] > $size['w']) ? 'P' : 'L';
$fpdi->AddPage($orientation, array($size['w'], $size['h']));
if($theme){
$fpdi->setSourceFile(__DIR__ . '/../../public/pdf/'.$theme.'-'.$first.'.pdf');
if($first == 1){
$first = 2;
}
$backId = $fpdi->importPage(1);
$fpdi->useTemplate($backId);
}
$fpdi->useTemplate($template);
}
}
//after first file (invoice) on bpaper
$slug = false;
}
//output operations
$mode = $this->_switchmode($outputmode);
if ($mode == 'S') {
return $fpdi->Output($outputpath, 'S');
} else {
if ($fpdi->Output($outputpath, $mode) == '') {
return true;
} else {
throw new \exception("Error outputting PDF to '$outputmode'.");
return false;
}
}
}
/**
* FPDI uses single characters for specifying the output location. Change our more descriptive string into proper format.
* @param $mode
* @return Character
*/
private function _switchmode($mode)
{
switch (strtolower($mode)) {
case 'download':
return 'D';
break;
case 'browser':
return 'I';
break;
case 'file':
return 'F';
break;
case 'string':
return 'S';
break;
default:
return 'I';
break;
}
}
/**
* Takes our provided pages in the form of 1,3,4,16-50 and creates an array of all pages
* @param $pages
* @return array
* @throws exception
*/
private function _rewritepages($pages)
{
$pages = str_replace(' ', '', $pages);
$part = explode(',', $pages);
//parse hyphens
foreach ($part as $i) {
$ind = explode('-', $i);
if (count($ind) == 2) {
$x = $ind[0]; //start page
$y = $ind[1]; //end page
if ($x > $y): throw new \exception("Starting page, '$x' is greater than ending page '$y'.");
return false; endif;
//add middle pages
while ($x <= $y): $newpages[] = (int)$x;
$x++; endwhile;
} else {
$newpages[] = (int)$ind[0];
}
}
return $newpages;
}
}
/*
$pdf = new PDFMerger;
$pdf->addPDF('samplepdfs/one.pdf', '1, 3, 4')
->addPDF('samplepdfs/two.pdf', '1-2')
->addPDF('samplepdfs/three.pdf', 'all')
->merge('file', 'samplepdfs/TEST2.pdf');
//REPLACE 'file' WITH 'browser', 'download', 'string', or 'file' for output options
//You do not need to give a file path for browser, string, or download - just the name.
*/

View file

@ -34,6 +34,13 @@ class Util
}
return 'd.m.Y - H:i';
}
public static function _format_text($text, $opt = 'html'){
if($opt === 'html'){
return html_entity_decode(nl2br($text));
}
return $text;
}
public static function _format_date($date, $to = 'date'){
if($to === 'datetime'){

View file

@ -33,7 +33,6 @@ use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\F;
* @method static \Illuminate\Database\Eloquent\Builder|\App\User whereRememberToken($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\User whereToken($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\User whereUpdatedAt($value)
* @mixin \Eloquent
* @property int|null $confirmed
* @property string|null $confirmation_code
* @property string|null $confirmation_date
@ -79,6 +78,11 @@ use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\F;
* @property-read int|null $tokens_count
* @property-read int|null $user_update_email_count
* @property-read \App\Models\SfGuardUser|null $sf_guard_user
* @property string|null $secret_key
* @property int|null $google2fa
* @method static \Illuminate\Database\Eloquent\Builder|User whereGoogle2fa($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereSecretKey($value)
* @mixin \Eloquent
*/
class User extends Authenticatable
{

View file

@ -24,6 +24,14 @@ if (! function_exists('_format_date')) {
}
}
if (! function_exists('_format_text')) {
function _format_text($text, $opt = 'html')
{
return $text ? \App\Services\Util::_format_text($text, $opt) : null;
}
}
if (! function_exists('_number_format')) {
function _number_format($number, $dec = 2)
{