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

Revision

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

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