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

Revision

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

Revision Autor Zeilennr. Zeile
131 lars 1
{extends file="index.tpl"}
2
{block name="maincontent"}
3
    <!-- $Id: supplierList.tpl 223 2023-08-06 12:23:48Z lars $ BEGIN -->
143 lars 4
    <button id="new"></button>
5
    <br><br>
6
    <table class="keinRand" width="100%" cellspacing="0" cellpadding="3" id="dataTable">
144 lars 7
        <thead>
139 lars 8
        <tr class="links">
9
            <td>Lieferanten</td>
143 lars 10
            <td>Aktionen</td>
139 lars 11
        </tr>
144 lars 12
        </thead>
13
        <tbody>
157 lars 14
        {foreach $lieferanten as $lieferant}
139 lars 15
            {cycle values="ungerade, gerade" assign="class"}
16
            <tr class="rechts {$class}">
156 lars 17
                <td  style="text-align:left !important;">{$lieferant.name}</td>
143 lars 18
                <td  style="text-align:left !important;">
156 lars 19
                    <button class="edit" data-id="{$lieferant.id}"></button>
20
                    <button class="del" data-id="{$lieferant.id}"></button>
143 lars 21
                </td>
139 lars 22
            </tr>
156 lars 23
            {foreachelse}
24
        {/foreach}
139 lars 25
        {if $webs.bgcolor_seite != 'FFFFFF'}
26
            <tr class="links">
27
                <td>&nbsp;</td>
28
            </tr>
29
        {/if}
144 lars 30
        </tbody>
139 lars 31
    </table>
32
    <script>
33
        $(".keinRand tr").not(':first').hover(
34
            function () {
35
                $(this).css("background-color","#ccc");
36
            },
37
            function () {
38
                $(this).css("background-color","");
39
            }
40
        );
41
    </script>
42
 
43
    <style>
44
        a:hover{
45
            color: #000 !important;
46
        }
47
    </style>
143 lars 48
    <script>
49
        $(function (){
50
            $("#dataTable").dataTable({
51
                "lengthMenu": [[100, -1], [100, "Alle"]],
52
                "language": {
53
                    "url": "/js/DataTables-1.10.19/German.json"
54
                }
55
            });
56
            $('#editDlg').dialog({
57
                autoOpen:false,
58
                modal:true,
59
                resizable:false,
223 lars 60
                width:900,
164 lars 61
                height:400,
143 lars 62
                buttons:[
63
                    {
64
                        text:"Speichern",
65
                        icon:"ui-icon-check",
66
                        click:function (){
67
                            let url="/bestellwesen/suppliers";
68
                            if($("#ID").val())
69
                            {
70
                                url+="/"+$("#ID").val()
71
                            }
72
                            $.post(url,$('#supplierForm').serializeArray(),function(){
73
                                $('#editDlg').dialog("close")
74
                                location.reload()
75
                            });
76
                        }
77
                    },
78
                    {
79
                        text:"Abbrechen",
80
                        icon:"ui-icon-cancel",
81
                        click:function (){
82
                            $('#editDlg').dialog("close");
83
                        }
84
                    }
85
                ]
86
            })
87
            $('#delDlg').dialog({
88
                autoOpen:false,
89
                modal:true,
90
                resizable:false,
91
                width:800,
92
                buttons:[
93
                    {
94
                        text:"Löschen",
95
                        icon:"ui-icon-trash",
96
                        click:function (){
97
                            let url="/bestellwesen/suppliers/"+$("#mId").html();
98
                            $.post(url,$('#supplierDelForm').serializeArray(),function(){
99
                                $('#delDlg').dialog("close")
100
                                location.reload()
101
                            });
102
                        }
103
                    },
104
                    {
105
                        text:"Abbrechen",
106
                        icon:"ui-icon-cancel",
107
                        click:function (){
108
                            $('#delDlg').dialog("close");
109
                        }
110
                    }
111
                ]
112
            })
113
            $("#new").uibutton({
114
                icons:{
115
                    primary:"ui-icon-plus"
116
                }
117
            }).click(function()
118
            {
119
                let url="/bestellwesen/suppliers/create/";
120
                $('#editDlg').load(url).dialog("open");
121
            });
122
            $(".edit").uibutton({
123
                icons:{
124
                    primary:"ui-icon-pencil"
125
                }
126
            }).click(function() {
127
                let url="/bestellwesen/suppliers/"+$(this).attr("data-id")+"/edit/";
128
                $('#editDlg').load(url).dialog("open");
129
            });
130
            $(".del").uibutton({
131
                icons:{
132
                    primary:"ui-icon-trash"
133
                }
134
            }).click(function() {
135
                let mId=$(this).attr("data-id");
136
                $.get("/bestellwesen/suppliers/"+mId,function(name) {
147 lars 137
                    $('#supplierName').html(name);
143 lars 138
                    $('#mId').html(mId);
139
                    $('#delDlg').dialog("open");
140
                })
141
            })
142
 
143
        })
144
    </script>
145
    <div id="editDlg"></div>
146 lars 146
    <div id="delDlg" title="Lieferant löschen">
147
        Wollen Sie den Lieferanten <span id="supplierName"></span> wirklich löschen?
143 lars 148
        <span id="mId" style="display: none"></span>
149
        <form id="supplierDelForm">
150
            <input type="hidden" name="_method" value="DELETE">
151
            <input type="hidden" name="_token" value="{csrf_token()}">
152
        </form>
153
    </div>
131 lars 154
    <!-- $id$ END -->
155
{/block}