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

Revision

Revision 240 | Revision 255 | 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";
58
                            {/if}
227 lars 59
                            if($("#ID").val())
60
                            {
61
                                url+="/"+$("#ID").val()
62
                            }
233 lars 63
                            $.post(url,$('#shippingForm').serializeArray(),function(){
228 lars 64
                                $('#editShippingDlg').dialog("close")
227 lars 65
                            });
66
                        }
67
                    },
68
                    {
69
                        text:"Abbrechen",
70
                        icon:"ui-icon-cancel",
71
                        click:function (){
230 lars 72
                            $('#editShippingDlg').dialog("close");
227 lars 73
                        }
74
                    }
75
                ]
76
            })
230 lars 77
            $('#delShippingDlg').dialog({
227 lars 78
                autoOpen:false,
79
                modal:true,
80
                resizable:false,
81
                width:800,
82
                buttons:[
83
                    {
84
                        text:"Löschen",
85
                        icon:"ui-icon-trash",
86
                        click:function (){
228 lars 87
                            let url="/bestellwesen/suppliers/shipping/"+$("#mId").html();
233 lars 88
                            $.post(url,$('#delShippingForm').serializeArray(),function(){
228 lars 89
                                $('#delShippingDlg').dialog("close")
227 lars 90
                            });
91
                        }
92
                    },
93
                    {
94
                        text:"Abbrechen",
95
                        icon:"ui-icon-cancel",
96
                        click:function (){
228 lars 97
                            $('#delShippingDlg').dialog("close");
227 lars 98
                        }
99
                    }
100
                ]
101
            })
228 lars 102
            $("#newShipping").uibutton({
227 lars 103
                icons:{
104
                    primary:"ui-icon-plus"
105
                }
106
            }).click(function()
107
            {
240 lars 108
                let url="/bestellwesen/suppliers/{$supplier->id}/shipping/create/";
232 lars 109
                $('#editShippingDlg').load(url).dialog("open");
227 lars 110
            });
229 lars 111
            $(".editShipping").uibutton({
227 lars 112
                icons:{
113
                    primary:"ui-icon-pencil"
114
                }
115
            }).click(function() {
229 lars 116
 
117
                let url;
118
                {if $supplier->id}
119
                    url="/bestellwesen/suppliers/{$supplier->id}/shipping/"+$(this).attr("data-id")+"/edit/";
120
                {else}
121
                    url="online_shop/shipping/"+$(this).attr("data-id")+"/edit";
122
                {/if}
228 lars 123
                $('#editShippingDlg').load(url).dialog("open");
227 lars 124
            });
231 lars 125
            $(".delShipping").uibutton({
227 lars 126
                icons:{
127
                    primary:"ui-icon-trash"
128
                }
129
            }).click(function() {
130
                let mId=$(this).attr("data-id");
231 lars 131
                let url;
132
                {if $supplier->id}
133
                url="/bestellwesen/suppliers/{$supplier->id}/shipping/"+$(this).attr("data-id");
134
                {else}
135
                url="online_shop/shipping/"+$(this).attr("data-id");
136
                {/if}
137
                $.get(url,function(name) {
227 lars 138
                    $('#supplierName').html(name);
139
                    $('#mId').html(mId);
232 lars 140
                    $('#delShippingDlg').dialog("open");
227 lars 141
                })
142
            })
143
 
144
        })
145
    </script>
228 lars 146
    <div id="editShippingDlg"></div>
147
    <div id="delShippingDlg" title="Lieferant löschen">
148
        Wollen Sie <span id="supplierShippingName"></span> wirklich löschen?
227 lars 149
        <span id="mId" style="display: none"></span>
233 lars 150
        <form id="delShippingForm">
227 lars 151
            <input type="hidden" name="_method" value="DELETE">
152
            <input type="hidden" name="_token" value="{csrf_token()}">
153
        </form>
154
    </div>
224 lars 155
    <!-- $Id: shipping.tpl 1678 2023-05-13 23:45:07Z lars $ END -->