ik heb een tabel met uitgaven in html die gegenereerd word middels data uit een database, nu komt het voor dat er meerdere bedrijven voorkomen hoe kan ik het zo doen dat deze gegroepeerd worden, en dat er dan een plusje voorkomt te staan dat als ik erop klik, dat dan alle uitgaven bij bijbehorend bedrijf te zien is dus zo:
(omschrijving leeg) + bedrijf totaal_ex_btw totaal_btw totaal_in_btw
en als ik er dan op klik:
omschrijving - bedrijf totaal_ex_btw totaal_btw totaal_in_btw
omschrijving bedrijf ex_btw btw in_btw
omschrijving bedrijf ex_btw btw in_btw
omschrijving bedrijf ex_btw btw in_btw
IK HEB NU DIT:
hij geeft nu de error dat hij een id nodig heeft maar die heeft ie, staat tussen haakjes bij pop(), EN als ik de pagina opvraag is de DIV gewoon zichtbaar, dat meot dus niet, dat moet dus pas als ik op het plusje klik
(omschrijving leeg) + bedrijf totaal_ex_btw totaal_btw totaal_in_btw
en als ik er dan op klik:
omschrijving - bedrijf totaal_ex_btw totaal_btw totaal_in_btw
omschrijving bedrijf ex_btw btw in_btw
omschrijving bedrijf ex_btw btw in_btw
omschrijving bedrijf ex_btw btw in_btw
IK HEB NU DIT:
hij geeft nu de error dat hij een id nodig heeft maar die heeft ie, staat tussen haakjes bij pop(), EN als ik de pagina opvraag is de DIV gewoon zichtbaar, dat meot dus niet, dat moet dus pas als ik op het plusje klik
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
| <? //uitgaven $query = mysql_query("SELECT * FROM ".$tabel_uitgaven." WHERE factuur = 'Nee' AND datum LIKE '".$jaar."%' GROUP BY omschrijving ORDER BY datum"); $result = mysql_num_rows($query); echo "<BR><BR><table width='760' cellpadding='0'>"; if($result){ echo "<tr> <td width='250' class='tdtitel'>Opdracht</td> <td width='249' class='tdtitel'>Bedrijf</td> <td width='87' class='tdtitel'>Ex. BTW</td> <td width='87' class='tdtitel'>BTW</td> <td width='87' class='tdtitel'>In. BTW</td> </tr> <tr> <td colspan='5'></td> </tr>"; } while($s = mysql_fetch_object($query)){ $get = mysql_query("SELECT * FROM ".$tabel_opdrachten." WHERE opdrachtnummer='".$s->opdrachtnummer."'"); while($b = mysql_fetch_object($get)){ $kort_om = $b->kort_om; $opdrachtid = $b->opd_id; } if($kort_om == ""){ $kort_om = "Intern"; } else{ $kort_om = "<a href='opdrachten_view.php?opd_id=".$opdrachtid."'>".$kort_om."</a>"; } $stuksprijs = $s->aantal*$s->stuksprijs; $btw=$stuksprijs/119*19; $totex=$stuksprijs-$btw; ?> <input type="hidden" onChange=""> <script LANGUAGE="VBScript"> sub pop (id) if id.style.display = "" then id.style.display = "none" else id.style.display = "" end if end sub </script> <? echo "<tr> <td width='250'>".$kort_om."</td> <td width='249'><a href='#' onclick='pop(".$s->ko_id.")'>+</a> <a href='uitgaven_view.php?ko_id=".$s->ko_id."'>".$s->omschrijving."</a></td> <td width='87'></td> <td width='87'></td> <td width='87'></td> </tr>"; echo "<div id='".$s->ko_id."' style='DISPLAY: none'>"; $query2 = mysql_query("SELECT * FROM ".$tabel_uitgaven." WHERE omschrijving='".$s->omschrijving."' ORDER BY datum"); $result2 = mysql_num_rows($query2); while($more = mysql_fetch_object($query2)){ $stuksprijs2 = $more->aantal*$more->stuksprijs; $btw2=$stuksprijs2/119*19; $totex2=$stuksprijs2-$btw2; echo "<tr> <td width='250'>".$kort_om."</td> <td width='249'> <a href='uitgaven_view.php?ko_id=".$more->ko_id."'>".$more->omschrijving."</a></td> <td width='87'>€ ".number_format($totex2, 2, ',', '.')."</td> <td width='87'>€ ".number_format($btw2, 2, ',', '.')."</td> <td width='87'>€ ".number_format($stuksprijs2, 2, ',', '.')."</td> </tr>"; } echo "</div>"; $kort_om=""; $totex=""; $btw=""; $stuksprijs=""; } $query = mysql_query("SELECT SUM(stuksprijs) AS prijs FROM ".$tabel_uitgaven." WHERE factuur = 'Nee' AND datum LIKE '".$jaar."%' ORDER BY datum"); while($s = mysql_fetch_object($query)){ $btw=$s->prijs/119*19; $totex=$s->prijs-$btw; $prijs = $s->prijs; echo "<tr> <td colspan='5'></td> </tr><tr> <td width='250'></td> <td width='249'></td> <td width='87' class='topborder'><B>€ ".number_format($totex, 2, ',', '.')."</B></td> <td width='87' class='topborder'><B>€ ".number_format($btw, 2, ',', '.')."</B></td> <td width='87' class='topborder'><B>€ ".number_format($prijs, 2, ',', '.')."</B></td> </tr>"; } echo "</table>"; ?> |
[ Voor 23% gewijzigd door robg1984 op 07-10-2004 20:46 ]