Natinality, Country, Agenda, search Request. CMS
Magazine Content
This commit is contained in:
parent
30d5ca3b44
commit
aebfb0586a
72 changed files with 4636 additions and 590 deletions
97
app/Http/Controllers/CMS/CMSContentController.php
Executable file
97
app/Http/Controllers/CMS/CMSContentController.php
Executable file
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\CMS;
|
||||
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CMSContent;
|
||||
use Input;
|
||||
use Request;
|
||||
use Validator;
|
||||
|
||||
|
||||
class CMSContentController extends Controller
|
||||
{
|
||||
|
||||
/*
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
'contents' => CMSContent::all()->sortByDesc('id')
|
||||
];
|
||||
return view('cms.content.index', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function store()
|
||||
{
|
||||
$data = Input::all();
|
||||
$rules = array(
|
||||
'name' => 'required',
|
||||
'field' => 'required',
|
||||
);
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator);
|
||||
}
|
||||
|
||||
if($data['id'] == "new"){
|
||||
CMSContent::create($data);
|
||||
}else{
|
||||
$model = CMSContent::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('cms_content'));
|
||||
}
|
||||
|
||||
|
||||
public function loadModal()
|
||||
{
|
||||
if(Request::ajax()){
|
||||
$data = Input::all();
|
||||
$returnHTML = "";
|
||||
if(isset($data['model']) && isset($data['id']) ){
|
||||
if($data['model'] == 'content'){
|
||||
if($data['id'] == "new"){
|
||||
$value = new CMSContent();
|
||||
}else {
|
||||
$value = CMSContent::find($data['id']);
|
||||
}
|
||||
$returnHTML = view("cms.content.modal", compact('data','value') )->render();
|
||||
}
|
||||
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$returnHTML]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function delete($id){
|
||||
$content = CMSContent::findOrFail($id);
|
||||
$content->delete();
|
||||
\Session()->flash('alert-success', __('Content gelöscht'));
|
||||
return redirect(route('cms_content'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
102
app/Http/Controllers/CMS/CMSTravelMagazineController.php
Executable file
102
app/Http/Controllers/CMS/CMSTravelMagazineController.php
Executable file
|
|
@ -0,0 +1,102 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\CMS;
|
||||
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\TravelMagazine;
|
||||
use Input;
|
||||
use Validator;
|
||||
|
||||
class CMSTravelMagazineController extends Controller
|
||||
{
|
||||
|
||||
/*
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
'travel_magazines' => TravelMagazine::all(),
|
||||
];
|
||||
return view('cms.travel_magazine.index', $data);
|
||||
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
if($id == "new") {
|
||||
$model = new TravelMagazine();
|
||||
$id = 'new';
|
||||
$model->active = 1;
|
||||
|
||||
}else{
|
||||
$model = TravelMagazine::findOrFail($id);
|
||||
$id = $model->id;
|
||||
}
|
||||
$data = [
|
||||
'travel_magazine' => $model,
|
||||
'id' => $id,
|
||||
];
|
||||
return view('cms.travel_magazine.detail', $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function store($id)
|
||||
{
|
||||
$data = Input::all();
|
||||
$data['active'] = isset($data['active']) ? true : false;
|
||||
$data['scope'] = isset($data['scope']) ? true : false;
|
||||
$rules = array(
|
||||
'name' => 'required',
|
||||
);
|
||||
if($id != "new") {
|
||||
$model = TravelMagazine::findOrFail($id);
|
||||
|
||||
$rules = array(
|
||||
'name' => 'required',
|
||||
'slug' => 'unique:mysql_stern.travel_magazines,slug,'.$model->id,
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator);
|
||||
}
|
||||
|
||||
if($id == "new") {
|
||||
$model = TravelMagazine::create($data);
|
||||
}else{
|
||||
$model = TravelMagazine::findOrFail($id);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('cms_travel_magazine_detail', [$model->id]));
|
||||
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
$model = TravelMagazine::findOrFail($id);
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', __('Eintrag Reisemagazin gelöscht'));
|
||||
return redirect(route('cms_travel_magazine'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4,8 +4,11 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Models\Booking;
|
||||
use App\Services\HTMLHelper;
|
||||
use Carbon\Carbon;
|
||||
use Composer\DependencyResolver\Request;
|
||||
use DataTables;
|
||||
use App\User;
|
||||
use Input;
|
||||
|
||||
class DataTableController extends Controller
|
||||
{
|
||||
|
|
@ -72,7 +75,7 @@ class DataTableController extends Controller
|
|||
public function getBookings()
|
||||
{
|
||||
//confirmation_code_remider is delete 2
|
||||
$query = Booking::orderBy("id", "DESC");
|
||||
$query = Booking::query();
|
||||
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
|
|
@ -80,9 +83,195 @@ class DataTableController extends Controller
|
|||
return '<a href="' . route('booking_detail', [$booking->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="far fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('id', function (Booking $booking) {
|
||||
return '<a href="' . route('booking_detail', [$booking->id]) . '" data-id="'.$booking->id.'">'.$booking->id.'</a>';
|
||||
return '<a data-order="'.$booking->id.'" href="' . route('booking_detail', [$booking->id]) . '" data-id="'.$booking->id.'">'.$booking->id.'</a>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->rawColumns(['action_edit', 'id'])
|
||||
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function getRequests()
|
||||
{
|
||||
|
||||
$query = Booking::where('lead_id', '!=', NULL);
|
||||
|
||||
if(Input::get('full_firstname_search') != ""){
|
||||
$query->where('participant_firstname', 'LIKE', '%'.Input::get('full_firstname_search').'%');
|
||||
}
|
||||
|
||||
if(Input::get('full_lastname_search') != ""){
|
||||
$query->where('participant_name', 'LIKE', '%'.Input::get('full_lastname_search').'%');
|
||||
}
|
||||
|
||||
// $query->where('end_date', '<=', $now);
|
||||
|
||||
if(Input::get('travel_option_search')){
|
||||
$now = Carbon::now();
|
||||
|
||||
|
||||
switch (Input::get('travel_option_search')){
|
||||
case 'before_2':
|
||||
$query->whereBetween('start_date', [Carbon::now()->modify('-2 month'), $now]);
|
||||
|
||||
break;
|
||||
case 'brefore_1':
|
||||
$query->whereBetween('start_date', [Carbon::now()->modify('-1 month'), $now]);
|
||||
|
||||
break;
|
||||
case 'on_site':
|
||||
$query->where('start_date', '<=', $now);
|
||||
$query->where('end_date', '>=', $now);
|
||||
break;
|
||||
case 'after_1':
|
||||
$query->whereBetween('start_date', [$now, Carbon::now()->modify('+1 month')]);
|
||||
|
||||
break;
|
||||
case 'after_2':
|
||||
$query->whereBetween('start_date', [$now, Carbon::now()->modify('+2 month')]);
|
||||
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
$start = null;
|
||||
$end = null;
|
||||
if(Input::get('arrival_start_date') != ""){
|
||||
$arrStart = explode(".", Input::get('arrival_start_date'));
|
||||
if(count($arrStart) == 3){
|
||||
$start = Carbon::create($arrStart[2], $arrStart[1], $arrStart[0], 0, 0, 0);
|
||||
}
|
||||
}
|
||||
if(Input::get('arrival_end_date') != ""){
|
||||
$arrEnd = explode(".", Input::get('arrival_end_date'));
|
||||
if(count($arrEnd) == 3){
|
||||
$end = Carbon::create($arrEnd[2], $arrEnd[1], $arrEnd[0], 23, 59, 59);
|
||||
}
|
||||
}
|
||||
if($start && $end){
|
||||
$query->whereBetween('start_date', [$start, $end]);
|
||||
}
|
||||
if($start && !$end){
|
||||
$query->where('start_date', '>=', $start);
|
||||
}
|
||||
if(!$start && $end){
|
||||
$query->where('start_date', '<=', $end);
|
||||
}
|
||||
|
||||
$start = null;
|
||||
$end = null;
|
||||
if(Input::get('departure_start_date') != ""){
|
||||
$arrStart = explode(".", Input::get('departure_start_date'));
|
||||
if(count($arrStart) == 3){
|
||||
$start = Carbon::create($arrStart[2], $arrStart[1], $arrStart[0], 0, 0, 0);
|
||||
}
|
||||
}
|
||||
if(Input::get('departure_end_date') != ""){
|
||||
$arrEnd = explode(".", Input::get('departure_end_date'));
|
||||
if(count($arrEnd) == 3){
|
||||
$end = Carbon::create($arrEnd[2], $arrEnd[1], $arrEnd[0], 23, 59, 59);
|
||||
}
|
||||
}
|
||||
if($start && $end){
|
||||
$query->whereBetween('end_date', [$start, $end]);
|
||||
}
|
||||
if($start && !$end){
|
||||
$query->where('end_date', '>=', $start);
|
||||
}
|
||||
if(!$start && $end){
|
||||
$query->where('end_date', '<=', $end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(Input::get('sort_travel_country_id') != ""){
|
||||
$query->where('travel_country_id', '=', Input::get('sort_travel_country_id'));
|
||||
}
|
||||
if(Input::get('sort_travelagenda_id') != ""){
|
||||
$query->where('travelagenda_id', '=', Input::get('sort_travelagenda_id'));
|
||||
}
|
||||
|
||||
if(Input::get('sort_sf_guard_user_id') != ""){
|
||||
$query->where('sf_guard_user_id', '=', Input::get('sort_sf_guard_user_id'));
|
||||
}
|
||||
|
||||
if(Input::get('sort_travel_documents') != ""){
|
||||
$query->where('travel_documents', '=', Input::get('sort_travel_documents'));
|
||||
}
|
||||
|
||||
|
||||
if(Input::get('full_lead_id_search') != ""){
|
||||
$query->where('lead_id', 'LIKE', '%'.Input::get('full_lead_id_search'). '%');
|
||||
}
|
||||
if(Input::get('full_booking_id_search') != ""){
|
||||
$query->where('id', 'LIKE', '%'.Input::get('full_booking_id_search').'%');
|
||||
}
|
||||
|
||||
//confirmation_code_remider is delete 2
|
||||
//
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (Booking $booking) {
|
||||
return ''; //'<a href="' . route('booking_detail', [$booking->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="far 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>';
|
||||
})
|
||||
->addColumn('participant_firstname', function (Booking $booking) {
|
||||
return '<a data-order="'.$booking->participant_firstname.'" href="'.make_old_url('customer/'.$booking->customer_id.'/edit').'" data-id="'.$booking->customer_id.'">'.$booking->participant_firstname.'</a>';
|
||||
})
|
||||
->addColumn('participant_name', function (Booking $booking) {
|
||||
return '<a data-order="'.$booking->participant_name.'" href="'.make_old_url('customer/'.$booking->customer_id.'/edit').'" data-id="'.$booking->customer_id.'">'.$booking->participant_name.'</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>';
|
||||
})
|
||||
->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>';
|
||||
})
|
||||
->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>';
|
||||
})
|
||||
->addColumn('start_date', function (Booking $booking) {
|
||||
return $booking->getStartDateFormat();
|
||||
})
|
||||
->addColumn('end_date', function (Booking $booking) {
|
||||
return $booking->getEndDateFormat();
|
||||
})
|
||||
->addColumn('travel_documents', function (Booking $booking) {
|
||||
return $booking->travel_documents ? ' <span data-order="1" class="badge badge-pill badge-success"><i class="far fa-check"></i></span>' : '<span data-order="0" class="badge badge-pill badge-danger"><i class="far 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>';
|
||||
})
|
||||
->addColumn('lead.status_id', function (Booking $booking) {
|
||||
return '<span data-order="'.($booking->lead->status_id ? $booking->lead->status_id : 0).'">'.($booking->lead->status_id ? $booking->lead->status->name : "-").'</span>';
|
||||
})
|
||||
/* ->filterColumn('travel_country_id', function($query, $keyword) {
|
||||
|
||||
if($keyword != "") {
|
||||
$query->whereRaw("travel_country_id = ?", $keyword);
|
||||
}
|
||||
|
||||
})
|
||||
->filterColumn('travelagenda_id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->whereRaw("travelagenda_id = ?", $keyword);
|
||||
|
||||
}
|
||||
})
|
||||
*/
|
||||
->orderColumn('lead_id', 'lead_id $1')
|
||||
->orderColumn('participant_firstname', 'participant_firstname $1')
|
||||
->orderColumn('participant_name', 'participant_name $1')
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('travel_country_id', 'travel_country_id $1')
|
||||
->orderColumn('travelagenda_id', 'travelagenda_id $1')
|
||||
->orderColumn('sf_guard_user_id', 'sf_guard_user_id $1')
|
||||
->orderColumn('start_date', 'start_date $1')
|
||||
->orderColumn('end_date', 'end_date $1')
|
||||
->orderColumn('travel_documents', 'travel_documents $1')
|
||||
->rawColumns(['action_edit', 'lead_id', 'participant_firstname', 'participant_name', 'travel_country_id', 'travelagenda_id', 'sf_guard_user_id', 'lead.status_id', 'id', 'travel_documents'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,12 +108,22 @@ class HomeController extends Controller
|
|||
return redirect(route('home'));
|
||||
}
|
||||
if($show == 'drafts'){
|
||||
return redirect(route('drafts'));
|
||||
return redirect(route('drafts'));
|
||||
}
|
||||
if(strpos($show, 'drafts_edit_booking_') !== false){
|
||||
$booking_id = str_replace('drafts_edit_booking_', '', $show);
|
||||
return redirect(route('booking_detail', [$booking_id]));
|
||||
}
|
||||
if($show == 'requests'){
|
||||
return redirect(route('requests'));
|
||||
}
|
||||
if($show == 'travel_agenda'){
|
||||
return redirect(route('admin_settings_travel_program'));
|
||||
}
|
||||
if($show == 'travel_country'){
|
||||
return redirect(route('admin_settings_travel_country'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
43
app/Http/Controllers/RequestController.php
Executable file
43
app/Http/Controllers/RequestController.php
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Booking;
|
||||
use Input;
|
||||
|
||||
class RequestController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'step' => $step
|
||||
];
|
||||
return view('request.index', $data);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
wirte old where has state to new has travel_documents
|
||||
$bs = Booking::whereHas('arrangements', function($q){
|
||||
$q->where('state', '!=', NULL);
|
||||
})->where('lead_id', '!=', NULL)->where('new_drafts', 0)->get();
|
||||
|
||||
foreach ($bs as $b){
|
||||
$b->travel_documents = true;
|
||||
$b->save();
|
||||
var_dump($b->travel_documents);
|
||||
}
|
||||
die();
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
70
app/Http/Controllers/Settings/TravelAgendaController.php
Executable file
70
app/Http/Controllers/Settings/TravelAgendaController.php
Executable file
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\Booking;
|
||||
use App\Models\TravelAgenda;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelNationality;
|
||||
use App\Models\TravelNationalityRequirement;
|
||||
use Carbon\Carbon;
|
||||
use HTMLHelper;
|
||||
use Input;
|
||||
|
||||
class TravelAgendaController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'travel_agenda' => TravelAgenda::all(),
|
||||
];
|
||||
return view('settings.travel_agenda.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function update(){
|
||||
|
||||
$data = Input::all();
|
||||
if($data['id'] == "new"){
|
||||
$model = TravelAgenda::create([
|
||||
'name' => $data['name'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
'travelcountry_id' => $data['travelcountry_id'],
|
||||
|
||||
]);
|
||||
}else{
|
||||
$model = TravelAgenda::find($data['id']);
|
||||
$model->name = $data['name'];
|
||||
$model->active = isset($data['active']) ? true : false;
|
||||
$model->travelcountry_id = $data['travelcountry_id'];
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_travel_program'));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
||||
if(Booking::where('travelagenda_id', $id)->count()){
|
||||
\Session()->flash('alert-error', 'Eintrag wird verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$model = TravelAgenda::findOrFail($id);
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4,6 +4,9 @@ namespace App\Http\Controllers\Settings;
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelNationality;
|
||||
use App\Models\TravelNationalityRequirement;
|
||||
use Carbon\Carbon;
|
||||
use HTMLHelper;
|
||||
use Input;
|
||||
|
|
@ -19,47 +22,88 @@ class TravelCountryController extends Controller
|
|||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'drafts' => Draft::all()->sortByDesc("id"),
|
||||
'draft_types' => DraftType::all()->sortByDesc("id"),
|
||||
'step' => $step
|
||||
'travel_countries' => TravelCountry::all(),
|
||||
];
|
||||
return view('drafts.index', $data);
|
||||
return view('settings.travel_country.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function store(){
|
||||
|
||||
$data = Input::all();
|
||||
if($data['id'] == "new"){
|
||||
$draft_type = DraftType::create([
|
||||
'name' => $data['name'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
'color' => $data['color'],
|
||||
]);
|
||||
public function detail($id)
|
||||
{
|
||||
if($id == "new") {
|
||||
$model = new TravelCountry();
|
||||
$id = 'new';
|
||||
$model->active_backend = 1;
|
||||
}else{
|
||||
$draft_type = DraftType::find($data['id']);
|
||||
$draft_type->name = $data['name'];
|
||||
$draft_type->active = isset($data['active']) ? true : false;
|
||||
$draft_type->color = $data['color'];
|
||||
|
||||
$draft_type->save();
|
||||
$model = TravelCountry::findOrFail($id);
|
||||
$id = $model->id;
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('drafts', ['type']));
|
||||
|
||||
$data = [
|
||||
'model' => $model,
|
||||
'id' => $id,
|
||||
'travel_nationalities' => TravelNationality::where('active', true)->get(),
|
||||
];
|
||||
return view('settings.travel_country.detail', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function store(){
|
||||
|
||||
$data = Input::all();
|
||||
$data['is_customer_country'] = isset($data['is_customer_country']) ? true : false;
|
||||
$data['active_frontend'] = isset($data['active_frontend']) ? true : false;
|
||||
$data['active_backend'] = isset($data['active_backend']) ? true : false;
|
||||
|
||||
if($data['id'] == "new"){
|
||||
$data['crm_id'] = 0;
|
||||
$model = TravelCountry::create($data);
|
||||
}else{
|
||||
$model = TravelCountry::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
//travel_nationality_requirement
|
||||
if(isset($data['travel_nationality_requirement'])){
|
||||
foreach ($data['travel_nationality_requirement'] as $travel_nationality_id => $text){
|
||||
$model->setNationalityRequirement($travel_nationality_id, $text);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO for this thime
|
||||
//we need an update in the old CRM v1 system DB
|
||||
$tc = \App\Models\Sym\TravelCountry::find($model->crm_id);
|
||||
if(!$tc){
|
||||
$tc = \App\Models\Sym\TravelCountry::create($data);
|
||||
$model->crm_id = $tc->id;
|
||||
$model->save();
|
||||
}else{
|
||||
$tc->fill($data);
|
||||
$tc->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_travel_country_detail', [$model->id]));
|
||||
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
||||
if(DraftItem::where('draft_type_id', $id)->count()){
|
||||
\Session()->flash('alert-error', 'Eintrag wird verwendet');
|
||||
return redirect(route('drafts'));
|
||||
$model = TravelCountry::findOrFail($id);
|
||||
if( $model->travel_nationality_requirements){
|
||||
foreach($model->travel_nationality_requirements as $travel_nationality_requirement){
|
||||
$travel_nationality_requirement->delete();
|
||||
}
|
||||
}
|
||||
$draft_type = DraftType::findOrFail($id);
|
||||
$draft_type->delete();
|
||||
$tc = \App\Models\Sym\TravelCountry::find($model->crm_id);
|
||||
if($tc){
|
||||
$tc->delete();
|
||||
}
|
||||
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect(route('drafts', ['type']));
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
65
app/Http/Controllers/Settings/TravelNationalityController.php
Executable file
65
app/Http/Controllers/Settings/TravelNationalityController.php
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelNationality;
|
||||
use App\Models\TravelNationalityRequirement;
|
||||
use Carbon\Carbon;
|
||||
use HTMLHelper;
|
||||
use Input;
|
||||
|
||||
class TravelNationalityController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'travel_nationality' => TravelNationality::all(),
|
||||
];
|
||||
return view('settings.travel_nationality.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function update(){
|
||||
|
||||
$data = Input::all();
|
||||
if($data['id'] == "new"){
|
||||
$model = TravelNationality::create([
|
||||
'name' => $data['name'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
]);
|
||||
}else{
|
||||
$model = TravelNationality::find($data['id']);
|
||||
$model->name = $data['name'];
|
||||
$model->active = isset($data['active']) ? true : false;
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_travel_nationality'));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
||||
if(TravelNationalityRequirement::where('travel_nationality_id', $id)->count()){
|
||||
\Session()->flash('alert-error', 'Eintrag wird verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
$model = TravelNationality::findOrFail($id);
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2,8 +2,88 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\Booking
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $booking_date
|
||||
* @property int $customer_id
|
||||
* @property int|null $lead_id
|
||||
* @property int|null $new_drafts
|
||||
* @property int $sf_guard_user_id
|
||||
* @property int $branch_id
|
||||
* @property float|null $service_fee
|
||||
* @property int|null $travel_country_id
|
||||
* @property int|null $travel_category_id
|
||||
* @property int|null $pax
|
||||
* @property int|null $coupon_id
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
* @property string|null $title
|
||||
* @property string|null $start_date
|
||||
* @property string|null $end_date
|
||||
* @property int|null $website_id
|
||||
* @property string|null $travel_number
|
||||
* @property string|null $participant_name
|
||||
* @property string|null $participant_firstname
|
||||
* @property string|null $participant_birthdate
|
||||
* @property int|null $participant_salutation_id
|
||||
* @property string|null $ev_number
|
||||
* @property string|null $merlin_knr
|
||||
* @property string|null $merlin_order_number
|
||||
* @property int|null $travel_company_id
|
||||
* @property int|null $travel_documents
|
||||
* @property float|null $price
|
||||
* @property float|null $price_total
|
||||
* @property float|null $deposit_total
|
||||
* @property float|null $final_payment
|
||||
* @property string|null $final_payment_date
|
||||
* @property int|null $travelagenda_id
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Sym\Arrangement[] $arrangements
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingDraftItem[] $booking_draft_items
|
||||
* @property-read \App\Models\TravelCountry|null $lead
|
||||
* @property-read \App\Models\SfGuardUser $sf_guard_user
|
||||
* @property-read \App\Models\TravelAgenda|null $travel_agenda
|
||||
* @property-read \App\Models\TravelCountry|null $travel_country
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereBookingDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereBranchId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereCouponId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereDepositTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereEndDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereEvNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereFinalPayment($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereFinalPaymentDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereMerlinKnr($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereMerlinOrderNumber($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereNewDrafts($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantBirthdate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereParticipantSalutationId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePax($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePrice($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking wherePriceTotal($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereServiceFee($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereSfGuardUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereStartDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelCategoryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelCompanyId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelDocuments($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereTravelNumber($value)
|
||||
* @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
|
||||
*/
|
||||
class Booking extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
|
@ -19,6 +99,34 @@ class Booking extends Model
|
|||
return $this->hasMany('App\Models\BookingDraftItem', 'booking_id', 'id')->orderBy('pos', 'ASC');
|
||||
}
|
||||
|
||||
//on crm
|
||||
public function travel_agenda()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelAgenda', 'travelagenda_id', 'id');
|
||||
}
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelCountry', 'travel_country_id', 'crm_id');
|
||||
}
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Lead', 'lead_id', 'id');
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\SfGuardUser', 'sf_guard_user_id', 'id');
|
||||
}
|
||||
|
||||
public function arrangements()
|
||||
{
|
||||
return $this->hasMany('App\Models\Sym\Arrangement', 'booking_id', 'id')->orderBy('view_position', 'DESC');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function findBeforeDraftItemRelation($reid)
|
||||
{
|
||||
|
|
@ -46,4 +154,14 @@ class Booking extends Model
|
|||
return false;
|
||||
}
|
||||
|
||||
public function getStartDateFormat(){
|
||||
if(!$this->attributes['start_date']){ return ""; }
|
||||
return Carbon::parse($this->attributes['start_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
public function getEndDateFormat(){
|
||||
if(!$this->attributes['end_date']){ return ""; }
|
||||
return Carbon::parse($this->attributes['end_date'])->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,11 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @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
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem whereFewoLodgingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingDraftItem wherePrice($value)
|
||||
*/
|
||||
class BookingDraftItem extends Model
|
||||
{
|
||||
|
|
|
|||
115
app/Models/CMSContent.php
Normal file
115
app/Models/CMSContent.php
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
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 $field
|
||||
* @property string|null $text
|
||||
* @property string|null $full_text
|
||||
* @property int|null $integer
|
||||
* @property float|null $decimal
|
||||
* @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
|
||||
*/
|
||||
class CMSContent extends Model
|
||||
{
|
||||
|
||||
use Sluggable;
|
||||
|
||||
|
||||
protected static $fields = [
|
||||
'text' => 'Text (190 Zeichen)',
|
||||
'full_text' => 'Full Text (50K Zeichen)',
|
||||
'integer' => 'Zahl (10 Stellen)',
|
||||
'decimal' => 'Kommazahl (10,2 Stellen)',
|
||||
];
|
||||
|
||||
protected $connection = 'mysql_stern';
|
||||
protected $table = 'c_m_s_contents';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'field', 'text', 'full_text', 'integer', 'decimal',
|
||||
];
|
||||
|
||||
public function sluggable()
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'name'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public static function getFieldsOptions($setKey = false){
|
||||
$options = self::$fields;
|
||||
$ret = "";
|
||||
foreach ($options as $key => $option){
|
||||
$attr = ($key == $setKey) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$key.'" '.$attr.'>'.$option.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function getFieldName(){
|
||||
return isset(self::$fields[$this->field]) ? self::$fields[$this->field] : '';
|
||||
}
|
||||
|
||||
public function getPreviewContent(){
|
||||
|
||||
$content = $this->{$this->field};
|
||||
if(strlen($content) > 40){
|
||||
return substr($content, 0, 40)." ...";
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
public function _format_number($value){
|
||||
return preg_replace("/[^0-9,]/", "", $value);
|
||||
}
|
||||
|
||||
public function setDecimalAttribute($value)
|
||||
{
|
||||
$value = $this->_format_number($value);
|
||||
$value = substr($value, -13);
|
||||
$this->attributes['decimal'] = floatval(str_replace(',', '.', $value));
|
||||
}
|
||||
|
||||
public function getDecimalAttribute()
|
||||
{
|
||||
if(isset($this->attributes['decimal'])){
|
||||
// 2 = decimal places | '.' = decimal seperator | ',' = thousand seperator
|
||||
return number_format(($this->attributes['decimal']), 2, ',', '.');
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function setIntegerAttribute($value)
|
||||
{
|
||||
$value = $this->_format_number($value);
|
||||
$value = substr($value, -10);
|
||||
$this->attributes['integer'] = intval($value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -44,6 +44,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @mixin \Eloquent
|
||||
* @property string|null $service
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem whereService($value)
|
||||
* @property float|null $price
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\DraftItem wherePrice($value)
|
||||
*/
|
||||
class DraftItem extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @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)
|
||||
*/
|
||||
class DraftType extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,97 @@ namespace App\Models;
|
|||
use Carbon\Carbon;
|
||||
use HTMLHelper;
|
||||
|
||||
/**
|
||||
* App\Models\Feedback
|
||||
*
|
||||
* @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\Feedback[] $children
|
||||
* @property-read \App\Models\Feedback|null $parent
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereBoxBody($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereBoxDiscount($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereBoxImageUrl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereBoxStar($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereBumaDestination($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereBumaGjr($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereCanonicalUrl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereCatalogId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereCatalogIndex($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereCmsSettings($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereContent($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereContentNew($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereFewoLodging($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereKeyword($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereKeywords($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereLft($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereLvl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereModel($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereOLDCatalogID($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereOLDOwnerID($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereOrder($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereOwner($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereOwnerSecond($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback wherePagetitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereParentId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback wherePriceTags($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereRealUrlPath($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereRgt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereShowInNavi($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereSlug($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereTemplate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereTextRight($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Feedback whereTitle($value)
|
||||
* @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
|
||||
*/
|
||||
class Feedback extends Page
|
||||
{
|
||||
protected $table = 'page';
|
||||
|
|
|
|||
81
app/Models/Lead.php
Normal file
81
app/Models/Lead.php
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\Lead
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $customer_id
|
||||
* @property string $request_date
|
||||
* @property string|null $travelperiod_start
|
||||
* @property string|null $travelperiod_end
|
||||
* @property int|null $travelperiod_length
|
||||
* @property int|null $travelcountry_id
|
||||
* @property int|null $travelagenda_id
|
||||
* @property string|null $remarks
|
||||
* @property int $sf_guard_user_id
|
||||
* @property int|null $is_closed
|
||||
* @property int|null $initialcontacttype_id
|
||||
* @property int|null $searchengine_id
|
||||
* @property string|null $searchengine_keywords
|
||||
* @property int $status_id
|
||||
* @property string|null $next_due_date
|
||||
* @property int|null $website_id
|
||||
* @property int|null $travelcategory_id
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
* @property float|null $price
|
||||
* @property int|null $pax
|
||||
* @property string|null $participant_name
|
||||
* @property string|null $participant_firstname
|
||||
* @property string|null $participant_birthdate
|
||||
* @property int|null $participant_salutation_id
|
||||
* @property-read \App\Models\SfGuardUser $sf_guard_user
|
||||
* @property-read \App\Models\Status $status
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereInitialcontacttypeId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereIsClosed($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereNextDueDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereParticipantBirthdate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereParticipantFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereParticipantName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereParticipantSalutationId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead wherePax($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead wherePrice($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereRemarks($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereRequestDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereSearchengineId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereSearchengineKeywords($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereSfGuardUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereStatusId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereTravelagendaId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereTravelcategoryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereTravelcountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereTravelperiodEnd($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereTravelperiodLength($value)
|
||||
* @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
|
||||
*/
|
||||
class Lead extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'lead';
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Status', 'status_id', 'id');
|
||||
}
|
||||
|
||||
public function sf_guard_user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\SfGuardUser', 'sf_guard_user_id', 'id');
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,95 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\Page
|
||||
*
|
||||
* @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
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereBoxBody($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereBoxDiscount($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereBoxImageUrl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereBoxStar($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereBumaDestination($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereBumaGjr($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereCanonicalUrl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereCatalogId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereCatalogIndex($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereCmsSettings($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereContent($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereContentNew($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereDate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereFewoLodging($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereKeyword($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereKeywords($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereLft($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereLvl($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereModel($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereOLDCatalogID($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereOLDOwnerID($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereOrder($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereOwner($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereOwnerSecond($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page wherePagetitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereParentId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page wherePriceTags($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereRealUrlPath($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereRgt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereShowInNavi($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereSlug($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereTemplate($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereTextRight($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereTitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereTravelProgram($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereTreeRoot($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Page whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Page extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
|
|
|
|||
|
|
@ -4,6 +4,29 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\SidebarWidget
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string|null $component
|
||||
* @property string|null $html
|
||||
* @property array|null $show_at
|
||||
* @property int|null $pos
|
||||
* @property int $active
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereActive($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereComponent($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereHtml($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SidebarWidget whereName($value)
|
||||
* @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
|
||||
*/
|
||||
class SidebarWidget extends Model
|
||||
{
|
||||
|
||||
|
|
|
|||
31
app/Models/Status.php
Normal file
31
app/Models/Status.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\Status
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $handling_days
|
||||
* @property string|null $color
|
||||
* @property-read \App\Models\Status $status
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereColor($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereHandlingDays($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Status whereName($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Status extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'status';
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Status', 'status_id', 'id');
|
||||
}
|
||||
}
|
||||
|
|
@ -34,6 +34,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class Arrangement extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'arrangement';
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class ArrangementTemplate extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'arrangement_template';
|
||||
|
||||
public function arrangements()
|
||||
|
|
|
|||
39
app/Models/Sym/TravelCountry.php
Normal file
39
app/Models/Sym/TravelCountry.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models\Sym;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
|
||||
/**
|
||||
* App\Models\Sym\TravelCountry
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int|null $is_customer_country
|
||||
* @property int|null $active_backend
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereActiveBackend($value)
|
||||
* @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
|
||||
*/
|
||||
class TravelCountry extends Model
|
||||
{
|
||||
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'travel_country';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'is_customer_country',
|
||||
'active_backend'
|
||||
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
50
app/Models/TravelAgenda.php
Normal file
50
app/Models/TravelAgenda.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelAgenda
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int|null $travelcountry_id
|
||||
* @property int|null $active
|
||||
* @property-read \App\Models\TravelCountry|null $travel_country
|
||||
* @property-read \App\Models\Sym\TravelCountry|null $travel_country_crm
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereActive($value)
|
||||
* @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
|
||||
*/
|
||||
class TravelAgenda extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'travel_agenda';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'travelcountry_id',
|
||||
'active'
|
||||
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
//on crm
|
||||
public function travel_country_crm()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Sym\TravelCountry', 'travelcountry_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
//on stern other DB
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelCountry', 'travelcountry_id', 'crm_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,36 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelCountry
|
||||
*
|
||||
* @property int $id
|
||||
* @property int|null $crm_id
|
||||
* @property string $name
|
||||
* @property string|null $html_information
|
||||
* @property string|null $entry_requirements
|
||||
* @property int|null $feedback_page_id
|
||||
* @property int|null $is_customer_country
|
||||
* @property int|null $active_frontend
|
||||
* @property int|null $active_backend
|
||||
* @property string|null $updated_at
|
||||
* @property string|null $created_at
|
||||
* @property-read \App\Models\Page|null $feedback_page
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelNationalityRequirement[] $travel_nationality_requirements
|
||||
* @property-read \App\Models\TravelProgramCountry $travel_program_country
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereActiveBackend($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereActiveFrontend($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereCrmId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereEntryRequirements($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereFeedbackPageId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereHtmlInformation($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereId($value)
|
||||
* @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
|
||||
*/
|
||||
class TravelCountry extends Model
|
||||
{
|
||||
//use the connection to sec. Datebase sterntours
|
||||
|
|
@ -15,6 +45,11 @@ class TravelCountry extends Model
|
|||
protected $fillable = [
|
||||
'name',
|
||||
'html_information',
|
||||
'entry_requirements',
|
||||
'is_customer_country',
|
||||
'active_frontend',
|
||||
'active_backend'
|
||||
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
|
@ -23,4 +58,40 @@ class TravelCountry extends Model
|
|||
{
|
||||
return $this->hasOne('App\Models\TravelProgramCountry', 'country_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
public function feedback_page()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Page', 'feedback_page_id', 'id');
|
||||
}
|
||||
|
||||
public function travel_nationality_requirements()
|
||||
{
|
||||
return $this->hasMany('App\Models\TravelNationalityRequirement', 'travel_country_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function getNationalityRequirement($travel_nationality_id){
|
||||
|
||||
$model = TravelNationalityRequirement::where('travel_country_id', $this->id)->where('travel_nationality_id', $travel_nationality_id)->first();
|
||||
if($model){
|
||||
return $model->text;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function setNationalityRequirement($travel_nationality_id, $text){
|
||||
$model = TravelNationalityRequirement::where('travel_country_id', $this->id)->where('travel_nationality_id', $travel_nationality_id)->first();
|
||||
if($model){
|
||||
$model->text = $text;
|
||||
$model->save();
|
||||
}else{
|
||||
$data = [
|
||||
'travel_country_id' => $this->id,
|
||||
'travel_nationality_id' => $travel_nationality_id,
|
||||
'text' => $text,
|
||||
];
|
||||
TravelNationalityRequirement::create($data);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
85
app/Models/TravelMagazine.php
Normal file
85
app/Models/TravelMagazine.php
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelMagazine
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property string|null $text
|
||||
* @property string|null $full_text
|
||||
* @property string|null $meta_title
|
||||
* @property string|null $meta_description
|
||||
* @property string|null $meta_keywords
|
||||
* @property int|null $pos
|
||||
* @property int $scope
|
||||
* @property int $active
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine findSimilarSlugs($attribute, $config, $slug)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereActive($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereFullText($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereMetaDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereMetaKeywords($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereMetaTitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine wherePos($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereScope($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereSlug($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereText($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelMagazine whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class TravelMagazine extends Model
|
||||
{
|
||||
|
||||
use Sluggable;
|
||||
|
||||
|
||||
//use the connection to sec. Datebase sterntours
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'travel_magazines';
|
||||
|
||||
|
||||
protected static $scopes = [
|
||||
0 => 'Kurze Version',
|
||||
1 => 'Lange Version',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'slug', 'text', 'full_text', 'meta_title', 'meta_description', 'meta_keywords', 'pos', 'scope', 'active',
|
||||
];
|
||||
|
||||
public function sluggable()
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'name'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public static function getScopeOptions($setKey = false){
|
||||
$options = self::$scopes;
|
||||
$ret = "";
|
||||
foreach ($options as $key => $option){
|
||||
$attr = ($key == $setKey) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$key.'" '.$attr.'>'.$option.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
public function getScopeName($key = 0){
|
||||
return isset(self::$scopes[$key]) ? self::$scopes[$key] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
33
app/Models/TravelNationality.php
Normal file
33
app/Models/TravelNationality.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelNationality
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $name
|
||||
* @property int|null $active
|
||||
* @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
|
||||
*/
|
||||
class TravelNationality extends Model
|
||||
{
|
||||
//use the connection to sec. Datebase sterntours
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'travel_nationality';
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'active',
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
}
|
||||
49
app/Models/TravelNationalityRequirement.php
Normal file
49
app/Models/TravelNationalityRequirement.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelNationalityRequirement
|
||||
*
|
||||
* @property int $id
|
||||
* @property int|null $travel_country_id
|
||||
* @property int|null $travel_nationality_id
|
||||
* @property string|null $text
|
||||
* @property-read \App\Models\TravelCountry|null $travel_country
|
||||
* @property-read \App\Models\TravelNationality|null $travel_nationality
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelNationalityRequirement whereId($value)
|
||||
* @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
|
||||
*/
|
||||
class TravelNationalityRequirement extends Model
|
||||
{
|
||||
//use the connection to sec. Datebase sterntours
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'travel_nationality_requirement';
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'travel_country_id',
|
||||
'travel_nationality_id',
|
||||
'text',
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelCountry', 'travel_country_id');
|
||||
}
|
||||
|
||||
public function travel_nationality()
|
||||
{
|
||||
return $this->belongsTo('App\Models\TravelNationality', 'travel_nationality_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -103,6 +103,9 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgram whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgram whereUpdatedAt($value)
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelProgramDraft[] $travel_program_drafts
|
||||
* @property int|null $insurance_4
|
||||
* @property-read \App\Models\TravelProgramCountry $travel_program_country
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelProgram whereInsurance4($value)
|
||||
*/
|
||||
class TravelProgram extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,8 +2,20 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelProgramCountry
|
||||
*
|
||||
* @property int|null $program_id
|
||||
* @property int|null $country_id
|
||||
* @property-read \App\Models\TravelCountry|null $travel_country
|
||||
* @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
|
||||
*/
|
||||
class TravelProgramCountry extends Model
|
||||
{
|
||||
//use the connection to sec. Datebase sterntours
|
||||
|
|
@ -28,4 +40,5 @@ class TravelProgramCountry extends Model
|
|||
{
|
||||
return $this->belongsTo('App\Models\TravelCountry', 'country_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use App\Models\DraftType;
|
|||
use App\Models\IndustrySector;
|
||||
use App\Models\Interest;
|
||||
use App\Models\TravelClass;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelProgram;
|
||||
use Form;
|
||||
|
||||
|
|
@ -141,6 +142,18 @@ class HTMLHelper
|
|||
return $ret;
|
||||
}
|
||||
|
||||
public static function getTravelCountriesOptions($countryId = false){
|
||||
$options = TravelCountry::where('active_backend',1)->get();
|
||||
$ret = '';
|
||||
foreach ($options as $option){
|
||||
$attr = ($option->crm_id === $countryId) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$option->crm_id.'" '.$attr.'>'.$option->name.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function getWeekdaysOptions($programId = false, $weekdays = []){
|
||||
if($programId){
|
||||
$tp = TravelProgram::findOrFail($programId);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
if (! function_exists('make_old_url')) {
|
||||
function make_old_url($path)
|
||||
{
|
||||
return config('app.old_url').$path;
|
||||
$path = trim($path, "/");
|
||||
return config('app.old_url')."/".$path;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -11,6 +12,7 @@ if (! function_exists('make_old_url')) {
|
|||
if (! function_exists('make_v2_url')) {
|
||||
function make_v2_url($path)
|
||||
{
|
||||
return config('app.url_v2').$path;
|
||||
$path = trim($path, "/");
|
||||
return config('app.url_v2')."/".$path;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue