Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
    $(function(){
2
        $('#Name1').keyup(search);
3
        $('#Ort').keyup(search);
4
        $('#PLZ').keyup(search);
5
        $('#Name2').keyup(search);
6
        $('#E_Mail').keyup(search);
7
        $('#reset').click(reset_Form);
8
        $('#suchen').click(suchen);
9
 
10
        function suchen()
11
        {
12
            desc=$('#bezeichnung').val();
13
            db=$("#database").val();
14
            b_id=$('#bestellung').val();
15
            s_id=$("#shop").val();
16
            $('#results').load("/Warenwirtschaft/best_manu_search.php",{"desc": desc, "database":db, "b_id": b_id, "shop":s_id});
17
        }
18
    });
19
 
20
function reset_Form()
21
{
22
    $('#knr').html("Neuanlage");
23
    $('#neukunde').val(1);
24
    $('#ergebnisse').html("");
25
    $('#speichern').val("Kunden eintragen");
26
    $('#suche_an').val(1);
27
    $('#Ort').css({background: "none"});
28
}
29
function search()
30
{
31
    if($('#suche_an').val()==1)
32
    {
33
        $('#ergebnisse').load("/Warenwirtschaft/kundensuche.php", $("#kundensuche").serializeArray());
34
    }
35
}
36
function uebernehmen()
37
{
38
    ref=$(this).attr("href");
39
    ref=ref.split('#');
40
    id=ref[1];
41
    $('#knr').html(id);
42
    $.post("/Warenwirtschaft/kundensuche.php", {id: id},function(data){
43
        data=data.split("###");
44
        $('#Anrede').val(data[0]);
45
        $('#Name1').val(data[1]);
46
        $('#Vorname').val(data[2]);
47
        $('#Name2').val(data[3]);
48
        $('#Strasse').val(data[4]);
49
        $('#Hausnummer').val(data[5]);
50
        $('#PLZ').val(data[6]);
51
        $('#Ort').val(data[7]);
52
        $('#Land').val(data[8]);
53
        $('#Telefon').val(data[9]);
54
        $('#Fax').val(data[10]);
55
        $('#E_Mail').val(data[11]);
56
        $('#AP_Bemerkung').val(data[12]);
57
        $('#kunden_id').val(id);
58
        $('#neukunde').val(0);
59
        $('#suche_an').val(0);
60
        $('#speichern').val("Daten übernehmen");
61
    });
62
    //alert("Daten übernommen");
63
}
64
function pruefeStep1()
65
{
66
    if (document.getElementById('shop').value == 0)
67
    {
68
        alert("Bitte wählen Sie einen Shop aus!");
69
        return false;
70
    }
71
 
72
    if (document.getElementById('bestellart'))
73
    {
74
        if(document.getElementById('bestellart').value == 0)
75
        {
76
            alert("Bitte wählen Sie eine Bestellart aus!");
77
            return false;
78
        }
79
    }
80
 
81
    //document.form_step1.submit();
82
}
83
 
84
function pruefeStep22()
85
{
86
    //if (document.getElementById('Name1').value == "")
87
    //{
88
    //    alert("Fehler! Bitte füllen Sie alle mit * makierten Felder aus!");
89
    //}
90
    //else
91
    //{
92
        document.form_step22.submit();
93
    //}
94
}
95
 
96
function pruefeStep3()
97
{
98
    empfehlung=$('.empfehlung').fieldValue();
99
    if(empfehlung=="")
100
    {
101
        alert("Bitte wählen Sie einen Aufmerksamkeitsstatus aus!");
102
        return false;
103
    }
104
}
105
 
106
function killkomma(w)
107
{
108
    return w.replace(/,/,'.');
109
}
110
 
111
 
112
function killkomma_extra() {
113
    this.value = killkomma(this.value);
114
}
115
 
116
 
117
function addInput(Name, Preis, Nummer)
118
{
119
    for (var i = 0; window.parent.tool.document.getElementById(i); i++)
120
    {
121
       /* Wird durchlaufen um zu bestimmen wie viele Elemente es im Warenkorb gibt
122
       und welches name-Attribut der Löschen-Button bekommt.
123
 
124
       i = name des einzufügenden Löschen-Buttons */
125
    }
126
 
127
    var newInput1 = window.parent.tool.document.createElement('input');
128
    newInput1.type = 'text';
129
    newInput1.name = 'artikel[]';
130
    newInput1.size = '55';
131
    newInput1.value = Name;
132
 
133
    var newInput2 = window.parent.tool.document.createElement('input');
134
    newInput2.type = 'text';
135
    newInput2.name = 'menge[]';
136
    newInput2.size = '5';
137
    newInput2.value = '1';
138
    newInput2.onkeyup = killkomma_extra;
139
    newInput2.onchange = killkomma_extra;
140
 
141
    var newInput3 = window.parent.tool.document.createElement('input');
142
    newInput3.type = 'text';
143
    newInput3.name = 'preis[]';
144
    newInput3.size = '5';
145
    newInput3.value = killkomma(Preis);
146
    newInput3.onkeyup = killkomma_extra;
147
    newInput3.onchange = killkomma_extra;
148
 
149
    var newInput4 = window.parent.tool.document.createElement('input');
150
    newInput4.type = 'submit';
151
    newInput4.name = i;
152
    newInput4.value = "X";
153
 
154
    var newInput5 = window.parent.tool.document.createElement('input');
155
    newInput5.type = 'hidden';
156
    newInput5.name = 'nummer[]';
157
    newInput5.value = Nummer;
158
 
159
    var neueZeile = window.parent.tool.document.createElement('tr');
160
 
161
    var neueSpalte1 = window.parent.tool.document.createElement('td');
162
    neueSpalte1.className = "rechts";
163
    neueSpalte1.appendChild(newInput1);
164
 
165
    var neueSpalte2 = window.parent.tool.document.createElement('td');
166
    neueSpalte2.className = "rechts";
167
    neueSpalte2.appendChild(newInput2);
168
 
169
    var neueSpalte3 = window.parent.tool.document.createElement('td');
170
    neueSpalte3.className = "rechts";
171
    neueSpalte3.appendChild(newInput3);
172
 
173
    var neueSpalte4 = window.parent.tool.document.createElement('td');
174
    neueSpalte4.className = "rechts";
175
    neueSpalte4.appendChild(newInput4);
176
    neueSpalte4.appendChild(newInput5);
177
 
178
    neueZeile.appendChild(neueSpalte1);
179
    neueZeile.appendChild(neueSpalte2);
180
    neueZeile.appendChild(neueSpalte3);
181
    neueZeile.appendChild(neueSpalte4);
182
 
183
    var tabelle             = window.parent.tool.document.getElementById('tabelle_warenkorb');
184
    var tbody               = tabelle.getElementsByTagName("tbody")[0];
185
    var letztes_element     = tbody.lastChild;
186
    //alert(tbody);
187
    tbody.appendChild(neueZeile);
188
 
189
    window.parent.tool.document.form_step3.submit();
190
}
191
 
192
var win=null;
193
 
194
onerror = stopError;
195
function stopError(){
196
    return true;
197
}
198
 
199
    function trigger(ID, Bestellung)
200
    {
201
        document.forms[0].action="/Warenwirtschaft/best_manu_tree.php?Bestellung="+Bestellung+"&nav="+ID+"#"+ID;
202
        document.forms[0].submit();
203
        $('#tabs').tabs("select",1);
204
 
205
        //alert(document.forms[0].name+": "+document.forms[0].action);
206
    }