Subversion-Projekte lars-tiefland.ci

Revision

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

<!-- $Id: edit_preiskalkulation.tpl 10438 2016-03-18 14:26:18Z tiefland $ -->
<script src="/js/jquery-1.8.3.min.js"></script>
<script src="/js/jquery-ui-1.9.0.custom.min.js"></script>
  <style>
  .ui-tooltip, .arrow:after {
    border: 2px solid white;
  }
  .ui-tooltip {
    padding: 10px 20px;
    border-radius: 20px;
    font: bold 14px "Helvetica Neue", Sans-Serif;
    text-transform: uppercase;
    box-shadow: 0 0 7px black;
  }
  .arrow {
    width: 70px;
    height: 16px;
    overflow: hidden;
    position: absolute;
    left: 50%;
    margin-left: -35px;
    bottom: -16px;
  }
  .arrow.top {
    top: -16px;
    bottom: auto;
  }
  .arrow.left {
    left: 20%;
  }
  .arrow:after {
    content: "";
    background: black;
    position: absolute;
    left: 20px;
    top: -20px;
    width: 25px;
    height: 25px;
    box-shadow: 6px 5px 9px -9px black;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    tranform: rotate(45deg);
  }
  .arrow.top:after {
    bottom: -20px;
    top: auto;
  }
                        #demoWrapper {
                                padding : 1em;
                                width : 500px;
                                border-style: solid;
                        }

                        #fieldWrapper {
                        }

                        #demoNavigation {
                                margin-top : 0.5em;
                                margin-right : 1em;
                                text-align: right;
                        }
                        
                        #data {
                                font-size : 0.7em;
                        }

                        input {
                                margin-right: 0.1em;
                                margin-bottom: 0.5em;
                        }

                        .input_field_25em {
                                width: 2.5em;
                        }

                        .input_field_3em {
                                width: 3em;
                        }

                        .input_field_35em {
                                width: 3.5em;
                        }

                        .input_field_12em {
                                width: 12em;
                        }

                        label {
                                margin-bottom: 0.2em;
                                font-weight: bold;
                                font-size: 0.8em;
                        }

                        label.error {
                                color: red;
                                font-size: 0.8em;
                                margin-left : 0.5em;
                        }

                        .step span {
                                float: right;
                                font-weight: bold;
                                padding-right: 0.8em;
                        }

                        .navigation_button {
                                width : 70px;
                margin-bottom:10px;
                        }
                        
                        #data {
                                        overflow : auto;
                        }
                        
                        #step_visualization {

                                margin : 2em;
                        }
                        
                        #visualization_first{
                                background-color : #ffffdd;
                        }

                        #visualization_finland{
                                background-color : #ffff99;
                        }
                        
                        #visualization_confirmation{
                                background-color : #ffff44;
                        }
                                                
                        .visualization {
                                border-style : solid;
                                font-size: 0.8em;
                          font-weight: bold;
                                padding-left: 1em;
                                padding-right: 1em;
                        }
            .indent
            {
                padding:10px;
            }
            
</style>
    <script>
        $(function(){
            $('#add').button({
                icons:{
                    primary:"ui-icon-plus"
                }
            }).click(add_art);
            $('.add').button({
                icons:{
                    primary:"ui-icon-plus"
                }
            }).click(add_stufe);
            $('.edit').button({
                icons:{
                    primary:"ui-icon-pencil"
                }
            }).click(edit_stufe);
            $('.del').button({
                icons:{
                    primary:"ui-icon-trash"
                }
            }).click(del_stufe);
            $( document ).tooltip({
                position: {
                    my: "center bottom-20",
                    at: "center top",
                    using: function( position, feedback ) {
                        $( this ).css( position );
                        $( "<div>" )
                            .addClass( "arrow" )
                            .addClass( feedback.vertical )
                            .addClass( feedback.horizontal )
                            .appendTo( this );
                    }
                }
            });
            $('#edit_dlg').dialog({
                autoOpen:false,
                modal:true,
                resizable:false,
                height:300,
                width:400,
                position: {
                    my:"center bottom",
                    at:"center top"
                },
                buttons:{
                    "specichern":function(){
                        $.post("/toolbox/saveCalcStufe.php",$('#save_calc_stufe').serializeArray(),function(html){
                            //alert(html);
                            $('#edit_dlg').dialog("close");
                            document.location.reload();
                        });
                    },
                    "abbrechen":function(){
                        $(this).dialog("close");
                    }
                }
            })
            $('#del_dlg').dialog({
                autoOpen:false,
                modal:true,
                resizable:false,
                position: {
                    my:"center bottom",
                    at:"center top"
                },
                buttons:{
                    "ja":function(){
                        $.get("/toolbox/delCalcStufe.php?id="+$('#del_stufe_id').html(),function(){
                            $('#del_dlg').dialog("close");
                            document.location.reload();
                        });
                    },
                    "nein":function(){
                        $(this).dialog("close");
                    }
                }
            })
        });
        
        function add_art(e)
        {
            e.preventDefault();
            $('#edit_dlg').load("/toolbox/getCalcStufe.php").dialog("open");
        }
        function add_stufe(e)
        {
            e.preventDefault();
            sId=this.id.split("__");
            art=sId[1];
            $('#edit_dlg').load("/toolbox/getCalcStufe.php?art="+art).dialog("open");
        }
        function edit_stufe(e)
        {
            e.preventDefault();
            sId=this.id.split("_");
            sId=sId[1];
            $('#edit_dlg').load("/toolbox/getCalcStufe.php?id="+sId).dialog("open");
        }
        function del_stufe(e)
        {
            e.preventDefault();
            sId=this.id.split("_");
            sId=sId[1];
            $('#del_stufe_id').html(sId)
            $('#del_dlg').dialog("open");
        }
    </script>
    <table class="keinRand" style="width:100%" id="kalkulation">
        <thead>
            <tr class="links">
                <td>ID</td>
                <td>Preis von</td>
                <td>Preis bis</td>
                <td>Multiplikator</td>
                <td>Aufschlag</td>
                <td>erstellt von</td>
                <td>erstellt am</td>
                <td>ge&auml;ndert von</td>
                <td>ge&auml;ndert am</td>
                <td>Aktionen</td>
            </tr>
        </thead>
        {foreach $calc as $art => $stufen}
        <tbody>
        <tr>
            <td colspan="10">{$art}
                <button title="Stufe hinzuf&uuml;gen" class="add" id="add__{$art}">&nbsp;</button>
            </td>
        </tr>
        {foreach $stufen as $stufe}
        <tr>
            <td>{$stufe.id}</td>
            <td>{$stufe.preis_von|money_format}</td>
            <td>
                {if !is_null($stufe.preis_bis)}{$stufe.preis_bis|money_format}{else}unendlich{/if}
            </td>
            <td>{$stufe.multiplikator}</td>
            <td>{$stufe.aufschlag|money_format}</td>
            <td>{$stufe.erstellt_von}</td>
            <td>{$stufe.erstellt_am|date_format:"%x<br>um %X"}</td>
            <td>{$stufe.geaendert_von}</td>
            <td>{$stufe.geaendert_am|date_format:"%x<br>um %X"}</td>
            <td>
                <button title="&auml;ndern" class="edit" id="edit_{$stufe.id}">&nbsp;</button>
                <button title="l&ouml;schen" class="del" id="del_{$stufe.id}">&nbsp;</button>
            </td>
        </tr>
        {/foreach}
        </tbody>
        {/foreach}
    </table>

<div id="edit_dlg" title="Preiskalkulationsstufe bearbeiten">
</div>

<div id="del_dlg" title="Kalkulationsstufe <span id='del_stufe_id'></span> l&ouml;schen?">
    Wollen Sie die Stufe wirklich l&ouml;schen?
</div>