06 2022
This commit is contained in:
parent
34a3d2196b
commit
93d1bea8e3
45 changed files with 1601 additions and 573 deletions
|
|
@ -3,24 +3,25 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
use App\Models\BookingApplication;
|
||||
use App\Models\BookingConfirmation;
|
||||
use App\Models\BookingStorno;
|
||||
use App\Models\BookingVoucher;
|
||||
use App\Models\Coupon;
|
||||
use App\Models\FewoLodging;
|
||||
use App\Models\InsuranceCertificate;
|
||||
use App\Models\TravelInsurance;
|
||||
use App\Repositories\CustomerFileRepository;
|
||||
use App\Services\BookingFewo;
|
||||
use App\Services\CreateCouponPDF;
|
||||
use App\Services\CreatePDF;
|
||||
use App\Services\Util;
|
||||
use Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Request;
|
||||
use Response;
|
||||
use App\Models\Coupon;
|
||||
use App\Services\Util;
|
||||
use App\Models\FewoLodging;
|
||||
use App\Services\CreatePDF;
|
||||
use App\Models\BookingStorno;
|
||||
use App\Services\BookingFewo;
|
||||
use App\Models\BookingVoucher;
|
||||
use App\Models\TravelInsurance;
|
||||
use App\Services\CreateCouponPDF;
|
||||
use App\Models\BookingApplication;
|
||||
use App\Models\BookingConfirmation;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use App\Models\BookingVoucherAgency;
|
||||
use App\Models\InsuranceCertificate;
|
||||
use App\Repositories\CustomerFileRepository;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
class CustomerFileController extends Controller
|
||||
{
|
||||
|
|
@ -75,9 +76,16 @@ class CustomerFileController extends Controller
|
|||
}
|
||||
break;
|
||||
case 'booking_voucher':
|
||||
if($booking_vouchers = BookingVoucher::find($id)){
|
||||
$filename = "Voucher-".$booking_vouchers->booking->getBookingNumber().".pdf";
|
||||
$file = base64_decode($booking_vouchers->binary_data);
|
||||
if($booking_voucher = BookingVoucher::find($id)){
|
||||
$filename = "Voucher-".$booking_voucher->booking->getBookingNumber().".pdf";
|
||||
$file = base64_decode($booking_voucher->binary_data);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'booking_voucher_agency':
|
||||
if($booking_voucher_agency = BookingVoucherAgency::find($id)){
|
||||
$filename = "Voucher-Agentur-".$booking_voucher_agency->booking->getBookingNumber().".pdf";
|
||||
$file = base64_decode($booking_voucher_agency->binary_data);
|
||||
}
|
||||
break;
|
||||
case 'insurance_certificate':
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ class TravelAgendaController extends Controller
|
|||
|
||||
public function delete($id){
|
||||
|
||||
if(Booking::where('travelagenda_id', $id)->count()){
|
||||
\Session()->flash('alert-error', 'Eintrag wird verwendet');
|
||||
if(Booking::where('travelagenda_id', $id)->count()){
|
||||
\Session()->flash('alert-error', 'Eintrag wird bei Buchnungen verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\TravelArrivalPoint;
|
||||
use Request;
|
||||
|
||||
class TravelArrivalPointController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(['superadmin', '2fa']);
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'travel_arrival_point' => TravelArrivalPoint::all(),
|
||||
];
|
||||
return view('settings.travel_arrival_point.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function update(){
|
||||
|
||||
$data = Request::all();
|
||||
if($data['id'] === "new"){
|
||||
$model = TravelArrivalPoint::create([
|
||||
'name' => $data['name'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
'travel_country_id' => $data['travel_country_id'],
|
||||
|
||||
]);
|
||||
}else{
|
||||
$model = TravelArrivalPoint::find($data['id']);
|
||||
$model->name = $data['name'];
|
||||
$model->active = isset($data['active']) ? true : false;
|
||||
$model->travel_country_id = $data['travel_country_id'];
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_travel_arrival_point'));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
||||
$model = TravelArrivalPoint::findOrFail($id);
|
||||
if($model->travel_programs->count() > 0){
|
||||
\Session()->flash('alert-error', 'Eintrag wird bei Reiseprogrammen verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
67
app/Http/Controllers/Settings/TravelCategoryController.php
Normal file
67
app/Http/Controllers/Settings/TravelCategoryController.php
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\TravelCategory;
|
||||
use Request;
|
||||
|
||||
class TravelCategoryController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(['superadmin', '2fa']);
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'travel_category' => TravelCategory::all(),
|
||||
];
|
||||
return view('settings.travel_category.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function update(){
|
||||
|
||||
$data = Request::all();
|
||||
if($data['id'] === "new"){
|
||||
$model = TravelCategory::create([
|
||||
'name' => $data['name'],
|
||||
'active' => isset($data['active']) ? true : false
|
||||
|
||||
]);
|
||||
}else{
|
||||
$model = TravelCategory::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_category'));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
|
||||
$model = TravelCategory::findOrFail($id);
|
||||
if($model->bookings->count() > 0){
|
||||
\Session()->flash('alert-error', 'Eintrag wird bei Buchnungen verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
if($model->travel_programs->count() > 0){
|
||||
\Session()->flash('alert-error', 'Eintrag wird bei Programmen verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
if($model->leads->count() > 0){
|
||||
\Session()->flash('alert-error', 'Eintrag wird bei Anfragen verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\TravelGerneralNote;
|
||||
use Request;
|
||||
|
||||
class TravelGerneralNotesController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(['superadmin', '2fa']);
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'gerneral_notes' => TravelGerneralNote::all(),
|
||||
];
|
||||
return view('settings.gerneral_notes.index', $data);
|
||||
}
|
||||
|
||||
public function update(){
|
||||
$data = Request::all();
|
||||
if($data['id'] === "new"){
|
||||
$model = TravelGerneralNote::create([
|
||||
'name' => $data['name'],
|
||||
'text' => $data['text']
|
||||
]);
|
||||
}else{
|
||||
$model = TravelGerneralNote::find($data['id']);
|
||||
$model->name = $data['name'];
|
||||
$model->text = $data['text'];
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_gerneral_notes'));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
$model = TravelGerneralNote::findOrFail($id);
|
||||
if($model->travel_programs->count() > 0){
|
||||
\Session()->flash('alert-error', 'Eintrag wird bei Reiseprogrammen verwendet');
|
||||
return redirect()->back();
|
||||
}
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -48,10 +48,23 @@ class TravelProgramController extends Controller
|
|||
|
||||
public function store($id)
|
||||
{
|
||||
//TODO new must have an extra funtction!
|
||||
$data = Request::all();
|
||||
$program = $this->travelProgramRepo->update($data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('travel_program_detail', [$program->id]));
|
||||
if(!isset($data['action'])){
|
||||
abort(403, 'keine Action');
|
||||
}
|
||||
if($data['action'] === 'saveGeneral'){
|
||||
$program = $this->travelProgramRepo->updateGeneral($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('travel_program_detail', [$program->id])."#collapseBookingNotice");
|
||||
}
|
||||
if($data['action'] === 'saveDetails'){
|
||||
$program = $this->travelProgramRepo->updateDetail($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('travel_program_detail', [$program->id])."#collapseTravelProgramDetails");
|
||||
}
|
||||
|
||||
return redirect(route('travel_program_detail', [$id]));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -68,6 +81,7 @@ class TravelProgramController extends Controller
|
|||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('travel_program_detail', [$data['program_id']]));
|
||||
}
|
||||
|
||||
public function classDelete($id){
|
||||
$travel_class = TravelClass::findOrFail($id);
|
||||
$pId = $travel_class->program_id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue