forked from kivitendo/kivitendo-crm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathartikel.php
107 lines (105 loc) · 4.03 KB
/
artikel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
require_once("inc/stdLib.php");
include("inc/wvLib.php");
$mid=($_GET["mid"])?$_GET["mid"]:$_POST["mid"];
$aid=($_GET["aid"])?$_GET["aid"]:$_POST["aid"];
if ($_POST["sichern"]) {
safeMaschMat($mid,$aid,$_POST["material"]);
}
$masch=getAllMaschine($mid);
$material=getAllMat($aid,$mid);
$menu = $_SESSION['menu'];
$head = mkHeader();
?>
<html>
<head><title>LX - CRM</title>
<?php echo $menu['stylesheets']; ?>
<?php echo $head['CRMCSS']; ?>
<script language="JavaScript">
<!--
function selall() {
len=document.mat.elements[2].length;
document.mat.elements[2].multiple=true;
for (i=0; i<len; i++) {
document.mat.elements[2].options[i].selected=true;
}
}
function subart() {
nr=document.mat.elements[2].selectedIndex;
document.mat.elements[2].options[nr]=null
}
function auswahl() {
nr=artikelwindow.document.pgartikel.artikel.selectedIndex;
tmp=artikelwindow.document.pgartikel.artikel.options[nr].value;
val=tmp.split(",");
preis=val[1];
txt=artikelwindow.document.pgartikel.artikel.options[nr].text.split(" ->");
tmp=document.artikel.anz.value;
anz=tmp.replace(",",".");
tmp=document.artikel.preis.value;
if (tmp) preis=tmp;
sum=anz*preis;
val=anz+";"+val[0]+";"+preis;
NeuerEintrag = new Option(anz+" x "+txt[0]+" ("+preis+")",val,false,true);
document.mat.elements[2].options[document.mat.elements[2].length] = NeuerEintrag;
}
function getData() {
nr=document.artikel.gruppen.selectedIndex;
val=document.artikel.gruppen.options[nr].value;
artikelwindow.location.href="pg_artikel.php?pg="+val;
}
//-->
</script>
</head>
<body onLoad="self.focus()">
<center><form name="artikel">
<table class="karte" width="100%">
<tr><td>Warengruppen:</td><td></td></tr>
<tr><td>
<select name="gruppen" size="8" Style="width:450px" onDblClick="getData()">
<option value=''>Artikel ohne Warengruppe</option>
<?php
$partsgrp=getAllPG();
if ($partsgrp) foreach ($partsgrp as $zeile) {
echo "\t<option value='".$zeile["id"]."'>".$zeile["partsgroup"]."</option>\n";
}
?>
</select>
</td>
<td><input type="button" name="ok" value="Fenster schließen" onClick="self.close();"></td>
</tr>
<tr><td>Artikel:</td><td></td></tr>
<tr><td>
<iframe src="pg_artikel.php" name="artikelwindow" width="450" height="141" marginheight="0" marginwidth="0" frameborder="0" align="left">
<p>Ihr Browser kann leider keine eingebetteten Frames anzeigen</p>
</iframe>
</td>
<td><input type="button" name="ok" value="übernehmen" onClick="auswahl()"><br><br>
<input type="text" name="anz" size="4" value="1">Stck.
<input type="text" name="preis" size="5" value="">€</td>
</tr>
<tr><td>verbrauchtes Material und erbrachte Leistungen:</td><td></form><form name="mat" action="artikel.php" method="post" onSubmit="return selall();"></td></tr>
<tr><td>
<input type="hidden" name="mid" value="<?php echo $mid ?>">
<input type="hidden" name="aid" value="<?php echo $aid ?>">
<select name="material[]" size="6" Style="width:450px">
<?php
if ($material) foreach ($material as $zeile) {
$val=$zeile["menge"];
$val.=";".$zeile["parts_id"];
$preis=sprintf("%0.2f",$zeile["betrag"]);
$val.=";".$preis;
echo "\t<option value='".$val."'>".$zeile["menge"]." x ".substr($zeile["description"],0,54)." (".$preis.")</option>\n";
}
?>
</select>
</td>
<td>
<input type="button" name="ok" value="<- entfernen" onClick="subart()"><br><br>
<input type="submit" name="sichern" value="sichern" ><br><br>
</td>
</tr>
</table>
</form>
</body>
</html>