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

Revision

Revision 123 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
{extends file="index.tpl"}
2
{block name="maincontent"}
87 lars 3
    <!-- $Id: manufacturerList.tpl 125 2023-07-22 21:05:22Z lars $ BEGIN -->
2 lars 4
    <script>
5
        $(function (){
85 lars 6
            $('#editDlg').dialog({
2 lars 7
                autoOpen:false,
8
                modal:true,
9
                resizable:false,
98 lars 10
                width:800,
11
                buttons:[
12
                    {
125 lars 13
                        text:"Speichern",
98 lars 14
                        icon:"ui-icon-check",
15
                        click:function (){
109 lars 16
                            let url="/Online-Shop/manufacturers";
17
                            if($("#ID").val())
18
                            {
19
                                url+="/"+$("#ID").val()
20
                            }
21
                            $.post(url,$('#manufacturerForm').serializeArray(),function(){
98 lars 22
                                $('#editDlg').dialog("close")
23
                                location.reload()
24
                            });
25
                        }
26
                    },
27
                    {
28
                        text:"Abbrechen",
29
                        icon:"ui-icon-cancel",
30
                        click:function (){
100 lars 31
                            $('#editDlg').dialog("close");
98 lars 32
                        }
33
                    }
34
                ]
2 lars 35
            })
114 lars 36
            $('#delDlg').dialog({
37
                autoOpen:false,
38
                modal:true,
39
                resizable:false,
40
                width:800,
41
                buttons:[
42
                    {
125 lars 43
                        text:"Löschen",
44
                        icon:"ui-icon-trash",
114 lars 45
                        click:function (){
123 lars 46
                            let url="/Online-Shop/manufacturers/"+$("#mId").html();
119 lars 47
                            $.post(url,$('#manufacturerDelForm').serializeArray(),function(){
114 lars 48
                                $('#delDlg').dialog("close")
49
                                location.reload()
50
                            });
51
                        }
52
                    },
53
                    {
54
                        text:"Abbrechen",
55
                        icon:"ui-icon-cancel",
56
                        click:function (){
57
                            $('#delDlg').dialog("close");
58
                        }
59
                    }
60
                ]
61
            })
2 lars 62
            $("#new").uibutton({
63
                icons:{
64
                    primary:"ui-icon-plus"
65
                }
66
            }).click(function()
67
            {
85 lars 68
                let url="/Online-Shop/manufacturers/create/";
69
                $('#editDlg').load(url).dialog("open");
2 lars 70
            });
71
            $(".edit").uibutton({
72
                icons:{
73
                    primary:"ui-icon-pencil"
74
                }
75
            }).click(function() {
86 lars 76
                let url="/Online-Shop/manufacturers/"+$(this).attr("data-id")+"/edit/";
85 lars 77
                $('#editDlg').load(url).dialog("open");
2 lars 78
            });
79
            $(".del").uibutton({
80
                icons:{
81
                    primary:"ui-icon-trash"
82
                }
114 lars 83
            }).click(function() {
84
                let mId=$(this).attr("data-id");
118 lars 85
                $.get("/Online-Shop/manufacturers/"+mId,function(name) {
114 lars 86
                    $('#manufacturerName').html(name);
123 lars 87
                    $('#mId').html(mId);
116 lars 88
                    $('#delDlg').dialog("open");
114 lars 89
                })
2 lars 90
            })
87 lars 91
            $("#dataTable").dataTable({
2 lars 92
                "lengthMenu": [[100, -1], [100, "Alle"]],
93
                "language": {
94
                    "url": "/js/DataTables-1.10.19/German.json"
95
                }
96
            });
97
        })
98
    </script>
99
    <button id="new"></button>
100
    <br><br>
87 lars 101
    <table style="width:100%" id="dataTable">
2 lars 102
        <thead>
103
        <tr>
104
            <th>Name</th>
105
            <th>Aktionen</th>
106
        </tr>
107
        </thead>
108
        <tbody>
85 lars 109
        {foreach $manufacturers as $manufacturer}
2 lars 110
            <tr>
85 lars 111
                <td>{$manufacturer.name}</td>
2 lars 112
                <td>
85 lars 113
                    <button class="edit" data-id="{$manufacturer.id}"></button>
114
                    <button class="del" data-id="{$manufacturer.id}"></button>
2 lars 115
                </td>
116
            </tr>
117
        {/foreach}
118
        </tbody>
119
    </table>
85 lars 120
    <div id="editDlg"></div>
114 lars 121
    <div id="delDlg" title="Hersteller löschen">
122
        Wollen Sie den Hersteller <span id="manufacturerName"></span> wirklich löschen?
122 lars 123
        <span id="mId" style="display: none"></span>
119 lars 124
        <form id="manufacturerDelForm">
115 lars 125
            <input type="hidden" name="_method" value="DELETE">
126
            <input type="hidden" name="_token" value="{csrf_token()}">
127
        </form>
114 lars 128
    </div>
87 lars 129
    <!-- $Id: manufacturerList.tpl 125 2023-07-22 21:05:22Z lars $ END -->
2 lars 130
{/block}