Subversion-Projekte lars-tiefland.ci

Revision

Revision 2043 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

{include file="header.tpl"}
<!-- $Id: herstellerkatalog.tpl 2048 2017-02-17 23:41:59Z lars $ BEGIN -->
<script>
        $(function(){
                $('#result').dialog({
                        autoOpen:false,
                        resizable:false,
                        width:400,
                        modal:true,
                        buttons:{
                                "OK":function(){
                                        $(this).dialog("close");
                                        document.location.reload();
                                }
                        }
                })
                $(".del_hst").button({
                        icons:{
                                primary:"ui-icon-trash"
                        }
                }).css("cursor","pointer").click(delHst);
                $(".edit_hst").button({
                        icons:{
                                primary:"ui-icon-pencil"
                        }
                }).css("cursor","pointer").click(editHst);
                $('#hstEditDlg').dialog({
                        autoOpen:false,
                        modal:true,
                        width:600,
                        resizable:false,
                        buttons:[{
                                text:"speichern",
                                icons: {
                                        primary: "ui-icon-check"
                                },
                                click:function()
                                {
                                        $('#result').load("/backend/herstellerkatalog/save",$('#herstellerForm').serializeArray(),function(){
                                                $('#result').dialog("open");
                                        })
                                        $('#hstEditDlg').dialog("close");
                                }
                        },
                        {
                                text:"verwerfen",
                                icons: {
                                        primary: "ui-icon-close"
                                },
                                click:function(){
                                        $('#hstEditDlg').dialog("close");
                                }
                        }
                        ]                       
                })
                $('#hstDelDlg').dialog({
                        autoOpen:false,
                        resizable:false,
                        modal:true,
                        width:"90%",
                        buttons:{
                                "Ja":function(){
                                        $('#result').load('/backend/herstellerkatalog/del/',$('#delForm').serializeArray(),function()
                                        {
                                                $('#result').dialog("open");
                                        });
                                        $(this).dialog("close")
                                },
                                "Nein":function()
                                {
                                        $(this).dialog("close")
                                }
                        }
                })
        })
        function editHst()
        {
                $('#hstEditDlg').load("/backend/herstellerkatalog/edit/"+$(this).attr('data-id'),function(){
                        $('#hstEditDlg').dialog('open');
                });
        }
        function delHst()
        {
                $('#hstDelDlg').load("/backend/herstellerkatalog/del/"+$(this).attr('data-id'),function(){
                        $('#hstDelDlg').dialog('open');
                });
        }
</script>
<table style="width:100%">
        <tr>
                <th>Name</th>
                <th style="width:210px">Aktionen</th>
        </tr>
        {foreach $hersteller as $hst}
        <tr>
                <td>
                        {$hst.name}
                </td>
                <td>
                        <a class="edit_hst" data-id="{$hst.id}">ändern</a>
                        <a class="del_hst" data-id="{$hst.id}" data-name="{$hst.name}">löschen</a>
                </td>
        </tr>
        {/foreach}
</table>
<div id="hstEditDlg"></div>
<div id="hstDelDlg" title="Hersteller löschen"></div>
<div id="result" title="Ergebnis"></div>
<!-- $Id: herstellerkatalog.tpl 2048 2017-02-17 23:41:59Z lars $ END -->
{include file="footer.tpl"}