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

Revision

Revision 98 | Revision 109 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

{extends file="index.tpl"}
{block name="maincontent"}
    <!-- $Id: manufacturerList.tpl 100 2023-07-14 21:40:24Z lars $ BEGIN -->
    <script>
        $(function (){
            $('#editDlg').dialog({
                autoOpen:false,
                modal:true,
                resizable:false,
                width:800,
                buttons:[
                    {
                        text:"OK",
                        icon:"ui-icon-check",
                        click:function (){
                            $.post("/Online-Shop/manufacturers/"+$("#ID").val(),$('#manufacturerForm').serializeArray(),function(){
                                $('#editDlg').dialog("close")
                                location.reload()
                            });
                        }
                    },
                    {
                        text:"Abbrechen",
                        icon:"ui-icon-cancel",
                        click:function (){
                            $('#editDlg').dialog("close");
                        }
                    }
                ]
            })
            $("#new").uibutton({
                icons:{
                    primary:"ui-icon-plus"
                }
            }).click(function()
            {
                let url="/Online-Shop/manufacturers/create/";
                $('#editDlg').load(url).dialog("open");
            });
            $(".edit").uibutton({
                icons:{
                    primary:"ui-icon-pencil"
                }
            }).click(function() {
                let url="/Online-Shop/manufacturers/"+$(this).attr("data-id")+"/edit/";
                $('#editDlg').load(url).dialog("open");
            });
            $(".del").uibutton({
                icons:{
                    primary:"ui-icon-trash"
                }
            })
            $("#dataTable").dataTable({
                "lengthMenu": [[100, -1], [100, "Alle"]],
                "language": {
                    "url": "/js/DataTables-1.10.19/German.json"
                }
            });
        })
    </script>
    <button id="new"></button>
    <br><br>
    <table style="width:100%" id="dataTable">
        <thead>
        <tr>
            <th>Name</th>
            <th>Aktionen</th>
        </tr>
        </thead>
        <tbody>
        {foreach $manufacturers as $manufacturer}
            <tr>
                <td>{$manufacturer.name}</td>
                <td>
                    <button class="edit" data-id="{$manufacturer.id}"></button>
                    <button class="del" data-id="{$manufacturer.id}"></button>
                </td>
            </tr>
        {/foreach}
        </tbody>
    </table>
    <div id="editDlg"></div>
    <!-- $Id: manufacturerList.tpl 100 2023-07-14 21:40:24Z lars $ END -->
{/block}