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

Revision

Revision 100 | Revision 114 | Zur aktuellen Revision | 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 109 2023-07-15 20:27:04Z 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
                    {
13
                        text:"OK",
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
            })
36
            $("#new").uibutton({
37
                icons:{
38
                    primary:"ui-icon-plus"
39
                }
40
            }).click(function()
41
            {
85 lars 42
                let url="/Online-Shop/manufacturers/create/";
43
                $('#editDlg').load(url).dialog("open");
2 lars 44
            });
45
            $(".edit").uibutton({
46
                icons:{
47
                    primary:"ui-icon-pencil"
48
                }
49
            }).click(function() {
86 lars 50
                let url="/Online-Shop/manufacturers/"+$(this).attr("data-id")+"/edit/";
85 lars 51
                $('#editDlg').load(url).dialog("open");
2 lars 52
            });
53
            $(".del").uibutton({
54
                icons:{
55
                    primary:"ui-icon-trash"
56
                }
57
            })
87 lars 58
            $("#dataTable").dataTable({
2 lars 59
                "lengthMenu": [[100, -1], [100, "Alle"]],
60
                "language": {
61
                    "url": "/js/DataTables-1.10.19/German.json"
62
                }
63
            });
64
        })
65
    </script>
66
    <button id="new"></button>
67
    <br><br>
87 lars 68
    <table style="width:100%" id="dataTable">
2 lars 69
        <thead>
70
        <tr>
71
            <th>Name</th>
72
            <th>Aktionen</th>
73
        </tr>
74
        </thead>
75
        <tbody>
85 lars 76
        {foreach $manufacturers as $manufacturer}
2 lars 77
            <tr>
85 lars 78
                <td>{$manufacturer.name}</td>
2 lars 79
                <td>
85 lars 80
                    <button class="edit" data-id="{$manufacturer.id}"></button>
81
                    <button class="del" data-id="{$manufacturer.id}"></button>
2 lars 82
                </td>
83
            </tr>
84
        {/foreach}
85
        </tbody>
86
    </table>
85 lars 87
    <div id="editDlg"></div>
87 lars 88
    <!-- $Id: manufacturerList.tpl 109 2023-07-15 20:27:04Z lars $ END -->
2 lars 89
{/block}