update 20.10.2025
This commit is contained in:
parent
8c11130b5d
commit
a939cd51ef
616 changed files with 84821 additions and 4121 deletions
74
dev/app-bak/Http/Controllers/UserLevelController.php
Executable file
74
dev/app-bak/Http/Controllers/UserLevelController.php
Executable file
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\UserLevel;
|
||||
use Request;
|
||||
|
||||
|
||||
class UserLevelController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = [
|
||||
'values' => UserLevel::orderBy('pos', 'asc')->get(),
|
||||
'trans' => array_keys(config('localization.supportedLocales')),
|
||||
];
|
||||
return view('admin.level.index', $data);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
|
||||
$data = Request::all();
|
||||
$data['active'] = isset($data['active']) ? true : false;
|
||||
$data['default'] = isset($data['default']) ? true : false;
|
||||
$data['next_id'] = (isset($data['next_id']) && $data['next_id'] != 0) ? $data['next_id'] : null;
|
||||
//is true -> set all other of false;
|
||||
if($data['default'] === true){
|
||||
$values = UserLevel::all();
|
||||
foreach ($values as $value) {
|
||||
$value->default = false;
|
||||
$value->save();
|
||||
}
|
||||
}
|
||||
//set paylines //pr_line_1
|
||||
for ($i=1; $i <=8; $i++) {
|
||||
if(isset($data['pr_line_'.$i])){
|
||||
$data['paylines'] = $i;
|
||||
}
|
||||
}
|
||||
if($data['id'] == "new"){
|
||||
$model = UserLevel::create($data);
|
||||
}else{
|
||||
$model = UserLevel::find($data['id']);
|
||||
$model->fill($data);
|
||||
$model->save();
|
||||
}
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_levels'));
|
||||
}
|
||||
|
||||
|
||||
/*public function delete($id){
|
||||
|
||||
if(ProductAttribute::where('attribute_id', $id)->count()){
|
||||
\Session()->flash('alert-error', 'Eintrag wird als Produktattribute verwendet');
|
||||
return redirect(route('admin_product_attributes'));
|
||||
}
|
||||
|
||||
$model = Attribute::findOrFail($id);
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', 'Eintrag gelöscht');
|
||||
return redirect(route('admin_product_attributes'));
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue