IQ Reisebausteine bis Gruppe
This commit is contained in:
parent
6880c7e989
commit
9baa1a6233
43 changed files with 2206 additions and 24 deletions
|
|
@ -44,9 +44,9 @@ class HomeController extends Controller
|
|||
return redirect('login');
|
||||
}
|
||||
|
||||
$last_booking_notices = BookingNotice::orderBy('edit_at', 'DESC')->orderBy('created_at', 'DESC')->limit(10)->get();
|
||||
$last_booking_fewo_notices = TravelUserBookingFewoNotice::orderBy('edit_at', 'DESC')->orderBy('created_at', 'DESC')->limit(10)->get();
|
||||
$last_lead_notices = LeadNotice::orderBy('edit_at', 'DESC')->orderBy('created_at', 'DESC')->limit(10)->get();
|
||||
$last_booking_notices = BookingNotice::orderBy('updated_at', 'DESC')->limit(10)->get();
|
||||
$last_booking_fewo_notices = TravelUserBookingFewoNotice::orderBy('updated_at', 'DESC')->limit(10)->get();
|
||||
$last_lead_notices = LeadNotice::orderBy('updated_at', 'DESC')->limit(10)->get();
|
||||
|
||||
|
||||
$data = [
|
||||
|
|
|
|||
31
app/Http/Controllers/IQ/ItemController.php
Normal file
31
app/Http/Controllers/IQ/ItemController.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
||||
126
app/Http/Controllers/IQ/TravelGroupController.php
Normal file
126
app/Http/Controllers/IQ/TravelGroupController.php
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\IQ;
|
||||
|
||||
use Request;
|
||||
use App\Models\IQTravelItemPlace;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\IQTravelGroup;
|
||||
use App\Models\IQTravelGroupItem;
|
||||
use App\Repositories\IQ\TravelRepository;
|
||||
|
||||
class TravelGroupController extends Controller
|
||||
{
|
||||
|
||||
protected $tavelRepo;
|
||||
|
||||
|
||||
public function __construct(TravelRepository $tavelRepo)
|
||||
{
|
||||
$this->middleware('admin');
|
||||
$this->tavelRepo = $tavelRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
];
|
||||
return view('iq.travel.group.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function detail($id, $step = false)
|
||||
{
|
||||
if($id === "new") {
|
||||
$model = new IQTravelGroup();
|
||||
$id = 'new';
|
||||
$model->active = 1;
|
||||
}else{
|
||||
$model = IQTravelGroup::findOrFail($id);
|
||||
$id = $model->id;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'model' => $model,
|
||||
'id' => $id,
|
||||
|
||||
];
|
||||
return view('iq.travel.group.detail', $data);
|
||||
}
|
||||
|
||||
|
||||
public function store($id)
|
||||
{
|
||||
$data = Request::all();
|
||||
if(isset($data['action'])){
|
||||
if($data['action'] === 'saveAll'){
|
||||
$travel_group = $this->tavelRepo->updateTravelGroup($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('iq_travel_group_detail', [$travel_group->id]));
|
||||
|
||||
}
|
||||
if($data['action'] === 'save-iq_travel_item_group'){
|
||||
$travel_group_item = $this->tavelRepo->updateTravelGroupItem($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('iq_travel_group_detail', [$id]));
|
||||
|
||||
}
|
||||
}
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
public function delete($id, $del=false){
|
||||
|
||||
if($del === 'i_q_travel_group_item'){
|
||||
$IQTravelGroupItem = IQTravelGroupItem::findOrFail($id);
|
||||
$r_id = $IQTravelGroupItem->i_q_travel_group_id;
|
||||
//TODO check need ???
|
||||
$IQTravelGroupItem->delete();
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('iq_travel_group_detail', [$r_id]));
|
||||
}
|
||||
if($del === 'iq_travel_group'){
|
||||
$IQTravelGroup = IQTravelGroup::findOrFail($id);
|
||||
//TODO check need ???
|
||||
$IQTravelGroup->delete();
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('iq_travel_groups'));
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function getTravelGroups()
|
||||
{
|
||||
$query = IQTravelGroup::with('i_q_travel_group_items')->with('i_q_travel_group_items.i_q_travel_item')->select('i_q_travel_groups.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (IQTravelGroup $iq_travel_group) {
|
||||
return '<a href="'.route('iq_travel_group_detail', [$iq_travel_group->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('trave_items', function (IQTravelGroup $iq_travel_group) {
|
||||
$ret = "";
|
||||
if($iq_travel_group->i_q_travel_group_items->count()){
|
||||
foreach($iq_travel_group->i_q_travel_group_items as $i_q_travel_group_item){
|
||||
$ret .= $i_q_travel_group_item->i_q_travel_item->name;
|
||||
$ret .= $i_q_travel_group_item->i_q_travel_item->draft_type_id ? ' | <span class="py-0 px-2" style="background-color:'.$i_q_travel_group_item->i_q_travel_item->draft_type->color.'">'.$i_q_travel_group_item->i_q_travel_item->draft_type->name.'</span>' : '';
|
||||
|
||||
|
||||
$ret .= "<br>";
|
||||
}
|
||||
$ret = rtrim($ret, '<br>');
|
||||
}
|
||||
return $ret;
|
||||
})
|
||||
->addColumn('active', function (IQTravelGroup $iq_travel_group) {
|
||||
return get_active_badge($iq_travel_group->active);
|
||||
})
|
||||
->addColumn('action_delete', function (IQTravelGroup $iq_travel_group) {
|
||||
return '<a href="' . route('iq_travel_group_delete', [$iq_travel_group->id, 'iq_travel_group']) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\''.__('Really delete entry?').'\');"><span class="fa fa-trash"></span></a>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->rawColumns(['action_edit', 'id', 'active', 'trave_items', 'action_delete'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
136
app/Http/Controllers/IQ/TravelItemController.php
Normal file
136
app/Http/Controllers/IQ/TravelItemController.php
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\IQ;
|
||||
|
||||
use Request;
|
||||
use App\Models\IQTravelItem;
|
||||
use App\Models\IQTravelItemPlace;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\IQ\TravelRepository;
|
||||
|
||||
class TravelItemController extends Controller
|
||||
{
|
||||
|
||||
protected $tavelRepo;
|
||||
|
||||
|
||||
public function __construct(TravelRepository $tavelRepo)
|
||||
{
|
||||
$this->middleware('admin');
|
||||
$this->tavelRepo = $tavelRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
];
|
||||
return view('iq.travel.item.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function detail($id, $step = false)
|
||||
{
|
||||
if($id === "new") {
|
||||
$model = new IQTravelItem();
|
||||
$id = 'new';
|
||||
$model->active = 1;
|
||||
}else{
|
||||
$model = IQTravelItem::findOrFail($id);
|
||||
$id = $model->id;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'model' => $model,
|
||||
'id' => $id,
|
||||
|
||||
];
|
||||
return view('iq.travel.item.detail', $data);
|
||||
}
|
||||
|
||||
|
||||
public function store($id)
|
||||
{
|
||||
$data = Request::all();
|
||||
if(isset($data['action'])){
|
||||
if($data['action'] === 'saveAll'){
|
||||
$travel_item = $this->tavelRepo->updateTravelItem($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('iq_travel_item_detail', [$travel_item->id]));
|
||||
|
||||
}
|
||||
if($data['action'] === 'save-iq_travel_item_place'){
|
||||
$travel_item_place = $this->tavelRepo->updateTravelItemPlace($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('iq_travel_item_detail', [$id]));
|
||||
|
||||
}
|
||||
}
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
public function delete($id, $del=false){
|
||||
if($del === 'i_q_travel_item_place'){
|
||||
$IQTravelItemPlace = IQTravelItemPlace::findOrFail($id);
|
||||
$r_id = $IQTravelItemPlace->i_q_travel_item_id;
|
||||
//TODO check need ???
|
||||
$IQTravelItemPlace->delete();
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('iq_travel_item_detail', [$r_id]));
|
||||
}
|
||||
if($del === 'iq_travel_item'){
|
||||
$IQTravelItem = IQTravelItem::findOrFail($id);
|
||||
//TODO check need ???
|
||||
$IQTravelItem->delete();
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('iq_travel_items'));
|
||||
}
|
||||
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function getTravelItems()
|
||||
{
|
||||
$query = IQTravelItem::with('draft_type')->with('i_q_travel_item_places')->select('i_q_travel_items.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (IQTravelItem $iq_travel_item) {
|
||||
return '<a href="'.route('iq_travel_item_detail', [$iq_travel_item->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('draft_type', function (IQTravelItem $iq_travel_item) {
|
||||
return $iq_travel_item->draft_type ? '<span class="py-1 px-2" style="background-color:'.$iq_travel_item->draft_type->color.'">'.$iq_travel_item->draft_type->name.'</span>' : '';
|
||||
})
|
||||
->addColumn('country', function (IQTravelItem $iq_travel_item) {
|
||||
return $iq_travel_item->travel_country ? $iq_travel_item->travel_country->name : '';
|
||||
})
|
||||
->addColumn('trave_places', function (IQTravelItem $iq_travel_item) {
|
||||
$ret = "";
|
||||
if($iq_travel_item->i_q_travel_item_places->count()){
|
||||
foreach($iq_travel_item->i_q_travel_item_places as $i_q_travel_item_place){
|
||||
$ret .= $i_q_travel_item_place->travel_place->name."<br>";
|
||||
}
|
||||
$ret = rtrim($ret, '<br>');
|
||||
}
|
||||
return $ret;
|
||||
})
|
||||
->addColumn('active', function (IQTravelItem $iq_travel_item) {
|
||||
return get_active_badge($iq_travel_item->active);
|
||||
})
|
||||
/*
|
||||
->filterColumn('draft_type', function ($query, $keyword) {
|
||||
if ($keyword != "") {
|
||||
$query->whereHas('draft_type', function ($q) use ($keyword) {
|
||||
$q->where("name", 'LIKE', '%' . $keyword . '%');
|
||||
});
|
||||
}
|
||||
})
|
||||
*/
|
||||
->addColumn('action_delete', function (IQTravelItem $iq_travel_item) {
|
||||
return '<a href="' . route('iq_travel_item_delete', [$iq_travel_item->id, 'iq_travel_item']) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\''.__('Really delete entry?').'\');"><span class="fa fa-trash"></span></a>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->rawColumns(['action_edit', 'id', 'active', 'draft_type', 'trave_places', 'action_delete'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
126
app/Http/Controllers/IQ/TravelProgrammController.php
Normal file
126
app/Http/Controllers/IQ/TravelProgrammController.php
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\IQ;
|
||||
|
||||
use Request;
|
||||
use App\Models\IQTravelItemPlace;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\IQTravelGroup;
|
||||
use App\Models\IQTravelGroupItem;
|
||||
use App\Repositories\IQ\TravelRepository;
|
||||
|
||||
class TravelProgrammController extends Controller
|
||||
{
|
||||
|
||||
protected $tavelRepo;
|
||||
|
||||
|
||||
public function __construct(TravelRepository $tavelRepo)
|
||||
{
|
||||
$this->middleware('admin');
|
||||
$this->tavelRepo = $tavelRepo;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
|
||||
];
|
||||
return view('iq.travel.programm.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function detail($id, $step = false)
|
||||
{
|
||||
if($id === "new") {
|
||||
$model = new IQTravelGroup();
|
||||
$id = 'new';
|
||||
$model->active = 1;
|
||||
}else{
|
||||
$model = IQTravelGroup::findOrFail($id);
|
||||
$id = $model->id;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'model' => $model,
|
||||
'id' => $id,
|
||||
|
||||
];
|
||||
return view('iq.travel.group.detail', $data);
|
||||
}
|
||||
|
||||
|
||||
public function store($id)
|
||||
{
|
||||
$data = Request::all();
|
||||
if(isset($data['action'])){
|
||||
if($data['action'] === 'saveAll'){
|
||||
$travel_group = $this->tavelRepo->updateTravelGroup($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('iq_travel_group_detail', [$travel_group->id]));
|
||||
|
||||
}
|
||||
if($data['action'] === 'save-iq_travel_item_group'){
|
||||
$travel_group_item = $this->tavelRepo->updateTravelGroupItem($id, $data);
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('iq_travel_group_detail', [$id]));
|
||||
|
||||
}
|
||||
}
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
public function delete($id, $del=false){
|
||||
|
||||
if($del === 'i_q_travel_group_item'){
|
||||
$IQTravelGroupItem = IQTravelGroupItem::findOrFail($id);
|
||||
$r_id = $IQTravelGroupItem->i_q_travel_group_id;
|
||||
//TODO check need ???
|
||||
$IQTravelGroupItem->delete();
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('iq_travel_group_detail', [$r_id]));
|
||||
}
|
||||
if($del === 'iq_travel_group'){
|
||||
$IQTravelGroup = IQTravelGroup::findOrFail($id);
|
||||
//TODO check need ???
|
||||
$IQTravelGroup->delete();
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('iq_travel_groups'));
|
||||
}
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function getTravelGroups()
|
||||
{
|
||||
$query = IQTravelGroup::with('i_q_travel_group_items')->with('i_q_travel_group_items.i_q_travel_item')->select('i_q_travel_groups.*');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (IQTravelGroup $iq_travel_group) {
|
||||
return '<a href="'.route('iq_travel_group_detail', [$iq_travel_group->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('trave_items', function (IQTravelGroup $iq_travel_group) {
|
||||
$ret = "";
|
||||
if($iq_travel_group->i_q_travel_group_items->count()){
|
||||
foreach($iq_travel_group->i_q_travel_group_items as $i_q_travel_group_item){
|
||||
$ret .= $i_q_travel_group_item->i_q_travel_item->name;
|
||||
$ret .= $i_q_travel_group_item->i_q_travel_item->draft_type_id ? ' | <span class="py-0 px-2" style="background-color:'.$i_q_travel_group_item->i_q_travel_item->draft_type->color.'">'.$i_q_travel_group_item->i_q_travel_item->draft_type->name.'</span>' : '';
|
||||
|
||||
|
||||
$ret .= "<br>";
|
||||
}
|
||||
$ret = rtrim($ret, '<br>');
|
||||
}
|
||||
return $ret;
|
||||
})
|
||||
->addColumn('active', function (IQTravelGroup $iq_travel_group) {
|
||||
return get_active_badge($iq_travel_group->active);
|
||||
})
|
||||
->addColumn('action_delete', function (IQTravelGroup $iq_travel_group) {
|
||||
return '<a href="' . route('iq_travel_group_delete', [$iq_travel_group->id, 'iq_travel_group']) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\''.__('Really delete entry?').'\');"><span class="fa fa-trash"></span></a>';
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->rawColumns(['action_edit', 'id', 'active', 'trave_items', 'action_delete'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,14 +2,16 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Request;
|
||||
use App\Models\GeneralFile;
|
||||
use App\Models\IQContentSite;
|
||||
use App\Models\ServiceProviderService;
|
||||
use App\Models\TravelCompanyService;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\IQTravelGroupItem;
|
||||
use App\Models\IQTravelItemPlace;
|
||||
use App\Models\TravelCompanyService;
|
||||
use App\Models\TravelCountryService;
|
||||
use App\Models\ServiceProviderService;
|
||||
use App\Repositories\GeneralFileRepository;
|
||||
use Request;
|
||||
|
||||
class ModalController extends Controller
|
||||
{
|
||||
|
|
@ -70,6 +72,29 @@ class ModalController extends Controller
|
|||
}
|
||||
$ret = view("admin.modal.provider-service", compact('data', 'value'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'modal-iq_travel_item-place'){
|
||||
if($data['id'] === 'new'){
|
||||
$value = new IQTravelItemPlace();
|
||||
$value->pos = 0;
|
||||
}else{
|
||||
$value = IQTravelItemPlace::find($data['id']);
|
||||
}
|
||||
$ret = view("admin.modal.iq_travel_item-place", compact('data', 'value'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'modal-iq_travel_item-group'){
|
||||
if($data['id'] === 'new'){
|
||||
$value = new IQTravelGroupItem();
|
||||
$value->pos = 0;
|
||||
}else{
|
||||
$value = IQTravelGroupItem::find($data['id']);
|
||||
}
|
||||
$ret = view("admin.modal.iq_travel_group-item", compact('data', 'value'))->render();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
|
||||
}
|
||||
|
|
|
|||
58
app/Http/Controllers/Settings/TravelPlaceController.php
Normal file
58
app/Http/Controllers/Settings/TravelPlaceController.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\IQContentCategory;
|
||||
use App\Models\TravelPlace;
|
||||
use App\Services\Util;
|
||||
use Request;
|
||||
|
||||
class TravelPlaceController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'travel_places' => TravelPlace::all(),
|
||||
];
|
||||
return view('settings.place.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function update(){
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
|
||||
$data['active'] = isset($data['active']) ? true : false;
|
||||
|
||||
if($data['id'] === "new"){
|
||||
$model = TravelPlace::create($data);
|
||||
}else{
|
||||
$model = TravelPlace::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_travel_places'));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
//TODO check ist linked
|
||||
|
||||
$model = TravelPlace::findOrFail($id);
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue