tabel genereren en vullen met 3 tabellen uit db
Ik zit met het volgende.
Vanuit drie tabellen uit mijn database, tabel 1 (hierna tabel locatie)
heeft een id die terug te is vinden in tabel 2 (hierna tabel klant) en 3
(hierna tabel werknemer), moet ik een tabel op een php-pagina genereren en
vullen. Tevens staat in tabel locatie in een rij de waarden 1, 2 of 3. Deze
bepaald of de gegevens in de uiteindelijke tabel komen en waar ze
weergeschreven moeten worden. 1 staat voor de 1e kolom, 2 voor de 2e kolom
en 3 voor de 3e. De gegevens in de te vullen tabel moeten per kolom worden
getoond. (zie voorbeeld)
Tabel voorbeeld:
_______________________________________________
|Naam kolom 1 | |Naam kolom 2 | |Naam kolom 3 |
|______________________________________________|
|gegevens tabel 1| |gegevens tabel 1| |gegevens tabel 1|
|______________________________________________|
|gegevens tabel 1| |gegevens tabel 1| |gegevens tabel 1|
|______________________________________________|
|gegevens tabel 2| |gegevens tabel 2| |gegevens tabel 2|
|______________________________________________|
|gegevens tabel 2| |gegevens tabel 2| |gegevens tabel 2|
|______________________________________________|
|gegevens tabel 3| |gegevens tabel 3| |gegevens tabel 3|
|______________________________________________|
|gegevens tabel 3| |gegevens tabel 3| |gegevens tabel 3|
|______________________________________________|
De <tr’s> staan, naar mijn idee, vooraf vast omdat, er een vast aantal
gegevens uit de databasetabellen moeten komen.
De <td>’s zijn dus afhankelijk van of er in tabel locatie in rijen een 1,2,
of 3 staat. Er staat altijd een 1 in 1 van de rijen, maar het kan dus ook
voorkomen dat er wel een 2, maar geen 3 is. Dit zou inhouden dat de
uiteindelijke tabel die gegenereerd moet worden, maar 2 kolommen heeft.
Mijn vraag is dan ook of iemand een idee heeft hoe ik dit moet maken met
php.
Ik hoop dat de omschrijving duidelijk is. Zo niet, dan hoor ik het graag.
Wim
ps, een soortgelijke vraag had ik al gesteld in dit bericht: http://www.phphulp.nl/forum/showtopic.php?cat=12&id=55997&page=60
maar dit krijg ik niet aan de praat met wat ik nu wil maken. Hetgeen ik nu namelijk wil is een vervolg op de in het vorige topic benoemde antwoord.
Gewijzigd op 01/01/1970 01:00:00 door Wim Selles
Ik ben er uit. Het zal niet de mooiste code zijn, maar het werkt in ieder geval, en daar gaat het mij om.
het php bestand
Code (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
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
<?php
// locatie 1
$sql_sel_locationtable1="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='1'";
$res_sel_locationtable1=mysql_db_query("$db","$sql_sel_locationtable1",$mysql_id);
$row_locationtable1=mysql_fetch_array($res_sel_locationtable1);
// locatie 1 klant 1
$sql_sel_contacttable11="SELECT * FROM crm_contact WHERE locationid='$row_locationtable1[locationid]' AND crm_place='1'";
$res_sel_contacttable11=mysql_db_query("$db","$sql_sel_contacttable11",$mysql_id);
$row_contacttable11=mysql_fetch_array($res_sel_contacttable11);
//locatie 1 klant 2
$sql_sel_contacttable12="SELECT * FROM crm_contact WHERE locationid='$row_locationtable1[locationid]' AND crm_place='2'";
$res_sel_contacttable12=mysql_db_query("$db","$sql_sel_contacttable12",$mysql_id);
$row_contacttable12=mysql_fetch_array($res_sel_contacttable12);
// locatie 2
$sql_sel_locationtable2="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='2'";
$res_sel_locationtable2=mysql_db_query("$db","$sql_sel_locationtable2",$mysql_id);
$row_locationtable2=mysql_fetch_array($res_sel_locationtable2);
// locatie 2 klant 1
$sql_sel_contacttable21="SELECT * FROM crm_contact WHERE locationid='$row_locationtable2[locationid]' AND crm_place='1'";
$res_sel_contacttable21=mysql_db_query("$db","$sql_sel_contacttable21",$mysql_id);
$row_contacttable21=mysql_fetch_array($res_sel_contacttable21);
//locatie 2 klant 2
$sql_sel_contacttable22="SELECT * FROM crm_contact WHERE locationid='$row_locationtable2[locationid]' AND crm_place='2'";
$res_sel_contacttable22=mysql_db_query("$db","$sql_sel_contacttable22",$mysql_id);
$row_contacttable22=mysql_fetch_array($res_sel_contacttable22);
// locatie 3
$sql_sel_locationtable3="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='3'";
$res_sel_locationtable3=mysql_db_query("$db","$sql_sel_locationtable3",$mysql_id);
$row_locationtable3=mysql_fetch_array($res_sel_locationtable3);
// locatie 3 klant 1
$sql_sel_contacttable31="SELECT * FROM crm_contact WHERE locationid='$row_locationtable3[locationid]' AND crm_place='1'";
$res_sel_contacttable31=mysql_db_query("$db","$sql_sel_contacttable31",$mysql_id);
$row_contacttable31=mysql_fetch_array($res_sel_contacttable31);
//locatie 3 klant 2
$sql_sel_contacttable32="SELECT * FROM crm_contact WHERE locationid='$row_locationtable3[locationid]' AND crm_place='2'";
$res_sel_contacttable32=mysql_db_query("$db","$sql_sel_contacttable32",$mysql_id);
$row_contacttable32=mysql_fetch_array($res_sel_contacttable32);
// locatie 4
$sql_sel_locationtable4="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='4'";
$res_sel_locationtable4=mysql_db_query("$db","$sql_sel_locationtable4",$mysql_id);
$row_locationtable4=mysql_fetch_array($res_sel_locationtable4);
// locatie 4 klant 1
$sql_sel_contacttable41="SELECT * FROM crm_contact WHERE locationid='$row_locationtable4[locationid]' AND crm_place='1'";
$res_sel_contacttable41=mysql_db_query("$db","$sql_sel_contacttable41",$mysql_id);
$row_contacttable41=mysql_fetch_array($res_sel_contacttable41);
//locatie 4 klant 2
$sql_sel_contacttable42="SELECT * FROM crm_contact WHERE locationid='$row_locationtable4[locationid]' AND crm_place='2'";
$res_sel_contacttable42=mysql_db_query("$db","$sql_sel_contacttable42",$mysql_id);
$row_contacttable42=mysql_fetch_array($res_sel_contacttable42);
//controle of de waarden vanuit het vorige scherm worden meegegeven
echo "<br />loc1= ".$row_locationtable1['locationid']."<br />\n";
echo "loc2= ".$row_locationtable2['locationid']."<br />\n";
echo "loc3= ".$row_locationtable3['locationid']."<br />\n";
echo "loc4= ".$row_locationtable4['locationid']."<br />\n";
// de tabel
include_once ('view/crm_view_location.html');
?>
// locatie 1
$sql_sel_locationtable1="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='1'";
$res_sel_locationtable1=mysql_db_query("$db","$sql_sel_locationtable1",$mysql_id);
$row_locationtable1=mysql_fetch_array($res_sel_locationtable1);
// locatie 1 klant 1
$sql_sel_contacttable11="SELECT * FROM crm_contact WHERE locationid='$row_locationtable1[locationid]' AND crm_place='1'";
$res_sel_contacttable11=mysql_db_query("$db","$sql_sel_contacttable11",$mysql_id);
$row_contacttable11=mysql_fetch_array($res_sel_contacttable11);
//locatie 1 klant 2
$sql_sel_contacttable12="SELECT * FROM crm_contact WHERE locationid='$row_locationtable1[locationid]' AND crm_place='2'";
$res_sel_contacttable12=mysql_db_query("$db","$sql_sel_contacttable12",$mysql_id);
$row_contacttable12=mysql_fetch_array($res_sel_contacttable12);
// locatie 2
$sql_sel_locationtable2="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='2'";
$res_sel_locationtable2=mysql_db_query("$db","$sql_sel_locationtable2",$mysql_id);
$row_locationtable2=mysql_fetch_array($res_sel_locationtable2);
// locatie 2 klant 1
$sql_sel_contacttable21="SELECT * FROM crm_contact WHERE locationid='$row_locationtable2[locationid]' AND crm_place='1'";
$res_sel_contacttable21=mysql_db_query("$db","$sql_sel_contacttable21",$mysql_id);
$row_contacttable21=mysql_fetch_array($res_sel_contacttable21);
//locatie 2 klant 2
$sql_sel_contacttable22="SELECT * FROM crm_contact WHERE locationid='$row_locationtable2[locationid]' AND crm_place='2'";
$res_sel_contacttable22=mysql_db_query("$db","$sql_sel_contacttable22",$mysql_id);
$row_contacttable22=mysql_fetch_array($res_sel_contacttable22);
// locatie 3
$sql_sel_locationtable3="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='3'";
$res_sel_locationtable3=mysql_db_query("$db","$sql_sel_locationtable3",$mysql_id);
$row_locationtable3=mysql_fetch_array($res_sel_locationtable3);
// locatie 3 klant 1
$sql_sel_contacttable31="SELECT * FROM crm_contact WHERE locationid='$row_locationtable3[locationid]' AND crm_place='1'";
$res_sel_contacttable31=mysql_db_query("$db","$sql_sel_contacttable31",$mysql_id);
$row_contacttable31=mysql_fetch_array($res_sel_contacttable31);
//locatie 3 klant 2
$sql_sel_contacttable32="SELECT * FROM crm_contact WHERE locationid='$row_locationtable3[locationid]' AND crm_place='2'";
$res_sel_contacttable32=mysql_db_query("$db","$sql_sel_contacttable32",$mysql_id);
$row_contacttable32=mysql_fetch_array($res_sel_contacttable32);
// locatie 4
$sql_sel_locationtable4="SELECT * FROM crm_location WHERE companyid='$customer' AND location_table='4'";
$res_sel_locationtable4=mysql_db_query("$db","$sql_sel_locationtable4",$mysql_id);
$row_locationtable4=mysql_fetch_array($res_sel_locationtable4);
// locatie 4 klant 1
$sql_sel_contacttable41="SELECT * FROM crm_contact WHERE locationid='$row_locationtable4[locationid]' AND crm_place='1'";
$res_sel_contacttable41=mysql_db_query("$db","$sql_sel_contacttable41",$mysql_id);
$row_contacttable41=mysql_fetch_array($res_sel_contacttable41);
//locatie 4 klant 2
$sql_sel_contacttable42="SELECT * FROM crm_contact WHERE locationid='$row_locationtable4[locationid]' AND crm_place='2'";
$res_sel_contacttable42=mysql_db_query("$db","$sql_sel_contacttable42",$mysql_id);
$row_contacttable42=mysql_fetch_array($res_sel_contacttable42);
//controle of de waarden vanuit het vorige scherm worden meegegeven
echo "<br />loc1= ".$row_locationtable1['locationid']."<br />\n";
echo "loc2= ".$row_locationtable2['locationid']."<br />\n";
echo "loc3= ".$row_locationtable3['locationid']."<br />\n";
echo "loc4= ".$row_locationtable4['locationid']."<br />\n";
// de tabel
include_once ('view/crm_view_location.html');
?>
de tabel
Code (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<br />
<br />
<form action="" method="post">
<table>
<tr>
<td><b>Straat :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['street']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['street']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['street']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['street']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Huisnummer :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['number']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['number']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['number']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['number']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Postcode :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['zip']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['zip']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['zip']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['zip']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Plaats :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['city']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['city']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['city']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['city']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>1e Contactpersoon :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['name']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['name']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['name']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['name']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Telefoonnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['phone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['phone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['phone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['phone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Mobielnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['mobilephone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['mobilephone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['mobilephone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['mobilephone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>E-mail :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['email']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['email']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['email']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['email']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>2e Contactpersoon :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['name']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['name']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['name']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['name']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Telefoonnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['phone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['phone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['phone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['phone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Mobielnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['mobilephone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['mobilephone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['mobilephone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['mobilephone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>E-mail :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['email']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['email']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['email']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['email']."\" /></td>\n";
}
?>
</tr>
</table>
</form>
<form action="crm/crm_contact_registration.php?c_id=<?php echo $customer;?>" method="post">
<input type="hidden" name="customer_contact_registration" value="<?php echo $customer;?>" />
<input type="submit" name="contact_registration" value="Contactregistratie" />
</form>
<br />
<form action="" method="post">
<table>
<tr>
<td><b>Straat :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['street']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['street']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['street']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['street']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Huisnummer :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['number']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['number']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['number']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['number']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Postcode :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['zip']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['zip']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['zip']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['zip']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Plaats :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable1['city']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable2['city']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable3['city']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_locationtable4['city']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>1e Contactpersoon :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['name']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['name']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['name']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['name']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Telefoonnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['phone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['phone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['phone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['phone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Mobielnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['mobilephone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['mobilephone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['mobilephone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['mobilephone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>E-mail :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable11['email']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable21['email']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable31['email']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable41['email']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>2e Contactpersoon :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['name']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['name']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['name']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['name']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Telefoonnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['phone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['phone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['phone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['phone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>Mobielnr :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['mobilephone']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['mobilephone']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['mobilephone']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['mobilephone']."\" /></td>\n";
}
?>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><b>E-mail :</b></td>
<?php
if ($row_locationtable1['location_table']=='1')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable12['email']."\" /></td>\n";
}
if ($row_locationtable2['location_table']=='2')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable22['email']."\" /></td>\n";
}
if ($row_locationtable3['location_table']=='3')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable32['email']."\" /></td>\n";
}
if ($row_locationtable4['location_table']=='4')
{
echo "<td width=\"5\"></td>\n</td><td><input type=\"text\" class=\"\" id=\"\" value=\"".$row_contacttable42['email']."\" /></td>\n";
}
?>
</tr>
</table>
</form>
<form action="crm/crm_contact_registration.php?c_id=<?php echo $customer;?>" method="post">
<input type="hidden" name="customer_contact_registration" value="<?php echo $customer;?>" />
<input type="submit" name="contact_registration" value="Contactregistratie" />
</form>