Mehrere Tickets 49, 50, 51, 52, 53
This commit is contained in:
parent
ae70577289
commit
e3495be8b8
61 changed files with 1904 additions and 344 deletions
|
|
@ -25,34 +25,44 @@ class AirlineController extends Controller
|
|||
return view('settings.airline.index', $data);
|
||||
}
|
||||
|
||||
public function detail($id, $step = false)
|
||||
{
|
||||
if($id === "new") {
|
||||
$model = new Airline();
|
||||
$id = 'new';
|
||||
}else{
|
||||
$model = Airline::findOrFail($id);
|
||||
$id = $model->id;
|
||||
}
|
||||
|
||||
public function update(){
|
||||
$data = [
|
||||
'model' => $model,
|
||||
'id' => $id,
|
||||
'step' => $step,
|
||||
];
|
||||
return view('settings.airline.detail', $data);
|
||||
}
|
||||
|
||||
public function update($id){
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
|
||||
$data['contact_emails'] = isset($data['contact_emails']) ? Util::_explodeLines($data['contact_emails']) : null;
|
||||
|
||||
if($data['id'] === "new"){
|
||||
if($id === "new"){
|
||||
$model = Airline::create($data);
|
||||
}else{
|
||||
$model = Airline::find($data['id']);
|
||||
$model->name = $data['name'];
|
||||
$model->name_full = $data['name_full'];
|
||||
$model->contact_emails = $data['contact_emails'];
|
||||
$model = Airline::find($id);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings_airline'));
|
||||
return redirect(route('admin_settings_airline_detail', [$model->id]));
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
//TODO check ist linked
|
||||
/*if(Booking::where('travelagenda_id', $id)->count()){
|
||||
\Session()->flash('alert-error', 'Eintrag wird verwendet');
|
||||
return redirect()->back();
|
||||
}*/
|
||||
|
||||
$model = Airline::findOrFail($id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue