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

Revision

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

Revision Autor Zeilennr. Zeile
224 lars 1
    <!-- $Id: shipping.tpl 1678 2023-05-13 23:45:07Z lars $ BEGIN -->
2
 
228 lars 3
    <button id="newShipping"></button>
227 lars 4
    <br><br>
251 lars 5
    <table style="width:100%" id="dataTableShipping">
224 lars 6
        <thead>
7
            <tr>
8
                <td>Rang</td>
9
                <td>Name</td>
10
                <td>Versandgruppe</td>
11
                <td></td>
12
                <td>Preis</td>
13
                <td>Gewichtsbereich</td>
14
                <td>Preisbereich</td>
15
                <td>Aktionen</td>
16
            </tr>
17
        </thead>
18
        <tbody>
19
        {foreach $shipping as $versand}
20
            <tr>
21
                <td>{$versand->rank}</td>
22
                <td>{$versand->name}</td>
23
                <td>{$versand->shipping_group->name}</td>
24
                <td></td>
25
                <td>{$versand->price|money_format}</td>
26
                <td>{$versand->calc_weight_from|number_format:2:",":"."} kG - {$versand->calc_weight_to|number_format:2:",":"."} kG</td>
27
                <td>{$versand->calc_price_from|money_format} - {$versand->calc_price_to|money_format}</td>
227 lars 28
                <td  style="text-align:left !important;">
230 lars 29
                    <button class="editShipping" data-id="{$versand.id}"></button>
30
                    <button class="delShipping" data-id="{$versand.id}"></button>
227 lars 31
                </td>
224 lars 32
            </tr>
33
        {/foreach}
34
        </tbody>
35
    </table>
227 lars 36
    <script>
37
        $(function (){
38
            $("#dataTableShipping").dataTable({
39
                "lengthMenu": [[100, -1], [100, "Alle"]],
40
                "language": {
41
                    "url": "/js/DataTables-1.10.19/German.json"
42
                }
43
            });
228 lars 44
            $('#editShippingDlg').dialog({
227 lars 45
                autoOpen:false,
46
                modal:true,
47
                resizable:false,
48
                width:900,
49
                height:400,
50
                buttons:[
51
                    {
52
                        text:"Speichern",
53
                        icon:"ui-icon-check",
54
                        click:function (){
232 lars 55
                            let url;
56
                            {if $supplier->id}
57
                            url="/bestellwesen/suppliers/{$supplier->id}/shipping";
274 lars 58
                            {else}
258 lars 59
                            url="Online-Shop/shippings"
232 lars 60
                            {/if}
227 lars 61
                            if($("#ID").val())
62
                            {
63
                                url+="/"+$("#ID").val()
64
                            }
233 lars 65
                            $.post(url,$('#shippingForm').serializeArray(),function(){
228 lars 66
                                $('#editShippingDlg').dialog("close")
227 lars 67
                            });
68
                        }
69
                    },
70
                    {
71
                        text:"Abbrechen",
72
                        icon:"ui-icon-cancel",
73
                        click:function (){
230 lars 74
                            $('#editShippingDlg').dialog("close");
227 lars 75
                        }
76
                    }
77
                ]
78
            })
230 lars 79
            $('#delShippingDlg').dialog({
227 lars 80
                autoOpen:false,
81
                modal:true,
82
                resizable:false,
83
                width:800,
84
                buttons:[
85
                    {
86
                        text:"Löschen",
87
                        icon:"ui-icon-trash",
88
                        click:function (){
268 lars 89
                            let url;
90
                            {if $supplier->id}
273 lars 91
                            url="/bestellwesen/suppliers/{$supplier->id}/shipping/"+$("#mId").html();
268 lars 92
                            {else}
273 lars 93
                            url="/Online-Shop/shippings/"+$("#mId").html();
268 lars 94
                            {/if}
233 lars 95
                            $.post(url,$('#delShippingForm').serializeArray(),function(){
228 lars 96
                                $('#delShippingDlg').dialog("close")
227 lars 97
                            });
98
                        }
99
                    },
100
                    {
101
                        text:"Abbrechen",
102
                        icon:"ui-icon-cancel",
103
                        click:function (){
228 lars 104
                            $('#delShippingDlg').dialog("close");
227 lars 105
                        }
106
                    }
107
                ]
108
            })
228 lars 109
            $("#newShipping").uibutton({
227 lars 110
                icons:{
111
                    primary:"ui-icon-plus"
112
                }
113
            }).click(function()
114
            {
240 lars 115
                let url="/bestellwesen/suppliers/{$supplier->id}/shipping/create/";
232 lars 116
                $('#editShippingDlg').load(url).dialog("open");
227 lars 117
            });
229 lars 118
            $(".editShipping").uibutton({
227 lars 119
                icons:{
120
                    primary:"ui-icon-pencil"
121
                }
122
            }).click(function() {
229 lars 123
 
124
                let url;
125
                {if $supplier->id}
126
                    url="/bestellwesen/suppliers/{$supplier->id}/shipping/"+$(this).attr("data-id")+"/edit/";
127
                {else}
259 lars 128
                    url="/Online-Shop/shippings/"+$(this).attr("data-id")+"/edit";
229 lars 129
                {/if}
228 lars 130
                $('#editShippingDlg').load(url).dialog("open");
227 lars 131
            });
231 lars 132
            $(".delShipping").uibutton({
227 lars 133
                icons:{
134
                    primary:"ui-icon-trash"
135
                }
136
            }).click(function() {
137
                let mId=$(this).attr("data-id");
231 lars 138
                let url;
139
                {if $supplier->id}
140
                url="/bestellwesen/suppliers/{$supplier->id}/shipping/"+$(this).attr("data-id");
141
                {else}
260 lars 142
                url="/Online-Shop/shippings/"+$(this).attr("data-id");
231 lars 143
                {/if}
144
                $.get(url,function(name) {
256 lars 145
                    $('#shippingName').html(name);
227 lars 146
                    $('#mId').html(mId);
232 lars 147
                    $('#delShippingDlg').dialog("open");
227 lars 148
                })
149
            })
150
 
151
        })
152
    </script>
228 lars 153
    <div id="editShippingDlg"></div>
154
    <div id="delShippingDlg" title="Lieferant löschen">
256 lars 155
        Wollen Sie <span id="shippingName"></span> wirklich löschen?
227 lars 156
        <span id="mId" style="display: none"></span>
233 lars 157
        <form id="delShippingForm">
227 lars 158
            <input type="hidden" name="_method" value="DELETE">
159
            <input type="hidden" name="_token" value="{csrf_token()}">
160
        </form>
161
    </div>
224 lars 162
    <!-- $Id: shipping.tpl 1678 2023-05-13 23:45:07Z lars $ END -->