Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Revision 407 | Revision 414 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
<?php
2
 
395 lars 3
    namespace App\Http\Controllers;
2 lars 4
 
395 lars 5
    use App\Models\SalesPortal;
6
    use App\Models\SalesPortalItem;
7
    use Illuminate\Contracts\Foundation\Application;
8
    use Illuminate\Contracts\View\Factory;
9
    use Illuminate\Contracts\View\View;
10
    use Illuminate\Http\Request;
2 lars 11
 
395 lars 12
    class SalesPortalItemController extends Controller
390 lars 13
    {
395 lars 14
        //
15
        //
16
        /**
17
         * @return Application|Factory|View
18
         */
19
        public function index(): View|Factory|Application
20
        {
21
            $salesPortals = SalesPortal::all();
399 lars 22
            $vPortale = array( "" => "Bitte wählen" );
398 lars 23
            foreach ( $salesPortals as $vPortal )
24
            {
25
                $vPortale[$vPortal->id] = $vPortal->name;
26
            }
27
            return view( 'salesPortal/itemPortalSelect', [ "vportale" => $vPortale, ] );
395 lars 28
        }
390 lars 29
 
408 lars 30
        public function show(SalesPortal $salesPortal): Factory|View|Application
395 lars 31
        {
408 lars 32
            \view::share( "salesPortal", $salesPortal );
402 lars 33
            return view( "salesPortal/itemList" );
395 lars 34
        }
390 lars 35
 
395 lars 36
        /**
37
         * @return Application|Factory|View
38
         */
39
        public function create(): View|Factory|Application
40
        {
41
            return view( "salesPortal/edit" );
42
        }
390 lars 43
 
395 lars 44
        /**
45
         * @param SalesPortal $salesPortal
46
         * @return Application|Factory|View
47
         */
48
        public function edit( SalesPortal $salesPortal ): View|Factory|Application
49
        {
50
            return view( "salesPortal/edit", [ "vportal" => $salesPortal ] );
51
        }
390 lars 52
 
395 lars 53
        public function store()
54
        {
390 lars 55
 
395 lars 56
        }
390 lars 57
 
395 lars 58
        public function update()
59
        {
390 lars 60
 
395 lars 61
        }
390 lars 62
 
395 lars 63
        public function destroy()
64
        {
65
 
66
        }
67
 
404 lars 68
        public function getArtikel()
69
        {
70
            $items = SalesPortalItem::where( "sales_portal_id", $_GET["vp_id"] );
71
            return json_encode( $items );
72
        }
73
 
390 lars 74
    }