Hallo.
Ik heb het volgende probleem met dit script
http://bestellen.eetsjopbaloe.com/test2/test.php
Ik kan producten toevoegen en dan worden ze automatisch aan die lijst en categorie toegevoegd.
Hoe dit werkt staat in het script hieronder.
Nu wil ik echter de productnamen + de aantallen die worden ingevoerd allemaal netjes onder mekaar in de te verzenden email als er op bestellen wordt gedrukt.
Wat is hiervoor de makkelijkste manier?
Ik heb het volgende probleem met dit script
http://bestellen.eetsjopbaloe.com/test2/test.php
Ik kan producten toevoegen en dan worden ze automatisch aan die lijst en categorie toegevoegd.
Hoe dit werkt staat in het script hieronder.
Nu wil ik echter de productnamen + de aantallen die worden ingevoerd allemaal netjes onder mekaar in de te verzenden email als er op bestellen wordt gedrukt.
Wat is hiervoor de makkelijkste manier?
code:
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
| <?php
require("config.php");
echo " <head>";
echo " <link rel=\"stylesheet\" href=\"css/style.css\" type=\"text/css\" media=\"screen\" />";
echo " <script type=\"text/javascript\" src=\"scripts/calculations.js\"></script>";
echo " </head>";
echo " <form method=post action=\"#\" name='order'>";
echo " <input type=\"hidden\" name=\"recipient\" value=\"email@ontvanger.nl\">";
echo " <input type=hidden name=\"subject\" value=\"Bestelling\" />";
echo " <input type=hidden name=\"print_blank_fields\" value=\"0\">";
echo " <input type=hidden name=\"missing_fields_redirect\" value=\"http://www.URL-HIER.nl/error.html\">";
echo " <input type=\"hidden\" name=\"redirect\" value=\"http://www.URL-HIER.nl/verzonden.html\">";
$select = "SELECT * FROM producten";
$query = mysql_query($select);
$aantal = mysql_num_rows($query);
$list = mysql_fetch_object($query);
if ($_POST["Bestellen"])
{
$datum = date("Y-m-j");
if (empty($_POST['naam']))
{
echo "<b>Verzenden mislukt</b><br><br>";
echo "U bent uw naam vergeten in te vullen.<br><br><a class=\"linkje1\" href=\"javascript:history.go(-1)\">Klik hier om terug te gaan naar de vorige pagina</a>";
}
elseif (empty($_POST['email']))
{
echo "<b>Verzenden mislukt</b><br><br>";
echo "U bent een email adres vergeten in te vullen.<br><br><a class=\"linkje1\" href=\"javascript:history.go(-1)\">Klik hier om terug te gaan naar de vorige pagina</a>";
}
else
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Eetsjop Baloe <info@eetsjopbaloe.com>\r\n";
$mail_body = "Bestel script werd op " . date("d-m-Y") . " om " . date("H:i") . " uur uitgevoerd.<br><br>";
$mail_body .= "De volgende persoon vulde het bestel formulier in:<br><br>";
$mail_body .= "<strong>Naam:</strong> " . $_POST['naam'] . "<br>";
$mail_body .= "<strong>Telefoonnummer:</strong> " . $_POST['telnumr'] . "<br>";
$mail_body .= "<strong>Gewenste tijdstip van afhalen:</strong> " . $_POST['tijd_uur'] . ":" . $_POST['tijd_minuut'] . "<br>";
$mail_body .= "<strong>E-mailadres:</strong> " . $_POST['email'] . "<br><br>";
$mail_body .= "Overzicht Bestelling<br>";
$mail_body .= "Hier moet een lijst komen met alle waardes";
mail("msn@creative-ws.nl", "Bestelling", $mail_body, $headers);
echo "<form method=\"post\" action=\"$PHP_SELF\" onSubmit=\"this.submit.disabled='true'\">";
echo "<table width=\"100%\" cellpadding=\"2\">";
echo "<tr>";
echo "<td>Uw bestelling is geplaatst<br><br></td>";
echo "</tr>";
echo "<tr>";
echo "<td><a href=\"test.php\">klik hier om terug te gaan</a><br><br></td>";
echo "</tr>";
echo "</table>";
echo "</form>";
}
}
else{
echo "<center><a href='#snacks'>Snacks</a> <a href='#sausje'>Sausjes en garnituren</a><br><br><b>Frites</b><br>";
echo "Er zijn momenteel</font> ";
if ($aantal == 1)
{
echo "<b>1</b> product in deze categorie.";
}
else
{
echo "<b>$aantal</b> producten in deze categorie.<br><br></center>";
}
if ($aantal != 0)
{
$select = "SELECT * FROM producten WHERE `categorie`='Patat' ORDER BY productid";
$query = mysql_query($select);
$aantal = mysql_num_rows($query);
echo "<br><table align=\"center\" class=\"teksten\" width=\"70%\" cellpadding=\"2\">";
echo "<tr><td width=\"10%\"><b>Product ID</b></td></td><td><b>Omschrijving</b></td><td><b>Prijs</b></td><td><b>Aantal</b></td><td><b>Totaal</b></td></tr>";
while ($list = mysql_fetch_object($query))
{
echo "<tr><td width=\"15%\">$list->productid</td><td width=\"30%\">$list->omschrijving</td><td>€$list->prijs</td><td><select class=\"H1\" onchange=\"calculate(this, $list->prijs)\"
size=\"1\" name=\"pw$list->productid\">
<option value=\"0\" selected=\"selected\">0</option>
<option
value=\"1\">1</option>
<option value=\"2\">2</option>
<option
value=\"3\">3</option>
<option value=\"4\">4</option>
<option
value=\"5\">5</option>
<option value=\"6\">6</option>
<option
value=\"7\">7</option>
<option value=\"8\">8</option>
<option
value=\"9\">9</option>
<option value=\"10\">10</option>
<option
value=\"11\">11</option>
<option value=\"12\">12</option>
<option
value=\"13\">13</option>
<option value=\"14\">14</option>
<option
value=\"15\">15</option>
<option value=\"16\">16</option>
<option
value=\"17\">17</option>
<option value=\"18\">18</option>
<option
value=\"19\">19</option>
<option value=\"20\">20</option>
</select></td><td><input class=\"H1\" size=\"10\" name=\"tw$list->productid\" READONLY /></td></tr>";
}
echo "</table><br><br>";
}
echo "<center><a name=snacks>Snacks</a> <a href='#sausje'>Sausjes en garnituren</a><br><br><b>Frites</b><br>";
echo "Er zijn momenteel</font> ";
if ($aantal == 1)
{
echo "<b>1</b> product in deze categorie.";
}
else
{
echo "<b>$aantal</b> producten in deze categorie.<br><br></center>";
}
if ($aantal != 0)
{
$select = "SELECT * FROM producten WHERE `categorie`='Snacks' ORDER BY productid";
$query = mysql_query($select);
$aantal = mysql_num_rows($query);
echo "<br><table align=\"center\" class=\"teksten\" width=\"70%\" cellpadding=\"2\">";
echo "<tr><td width=\"10%\"><b>Product ID</b></td></td><td><b>Omschrijving</b></td><td><b>Prijs</b></td><td><b>Aantal</b></td><td><b>Totaal</b></td></tr>";
while ($list = mysql_fetch_object($query))
{
echo "<tr><td width=\"15%\">$list->productid</td><td width=\"30%\">$list->omschrijving</td><td>€$list->prijs</td><td><select class=\"H1\" onchange=\"calculate(this, $list->prijs)\"
size=\"1\" name=\"pw$list->productid\">
<option value=\"0\" selected=\"selected\">0</option>
<option
value=\"1\">1</option>
<option value=\"2\">2</option>
<option
value=\"3\">3</option>
<option value=\"4\">4</option>
<option
value=\"5\">5</option>
<option value=\"6\">6</option>
<option
value=\"7\">7</option>
<option value=\"8\">8</option>
<option
value=\"9\">9</option>
<option value=\"10\">10</option>
<option
value=\"11\">11</option>
<option value=\"12\">12</option>
<option
value=\"13\">13</option>
<option value=\"14\">14</option>
<option
value=\"15\">15</option>
<option value=\"16\">16</option>
<option
value=\"17\">17</option>
<option value=\"18\">18</option>
<option
value=\"19\">19</option>
<option value=\"20\">20</option>
</select></td><td><input class=\"H1\" size=\"10\" name=\"tw$list->productid\" READONLY /></td></tr>";
}
echo "</table><br><br>";
}
echo "
<input type=\"hidden\" name=\"dummy_1\" class=\"H1\" id=\"dummy_1\" size=\"10\" />
<input type=\"hidden\" name=\"dummy_2\" class=\"H2\" id=\"dummy_2\" size=\"10\" />
<input type=\"hidden\" name=\"dummy_3\" class=\"H1\" id=\"dummy_3\" size=\"10\" />
<input type=\"hidden\" name=\"dummy_4\" class=\"H1\" id=\"dummy_4\" size=\"10\" />
<input type=\"hidden\" name=\"dummy_5\" class=\"H1\" id=\"dummy_5\" size=\"10\" />
<input type=\"hidden\" name=\"dummy_6\" class=\"H1\" id=\"dummy_6\" size=\"10\" />
<br>
<br>
<br>
<center>totaal: <input class=\"Header_zwart\" size=\"10\" name=\"totalw\" />
<br>
<br>
<tr>
<td height=\"75\" align=\"center\" valign=\"middle\" class=\"style2\"><p><br />
Vul hier uw gegevens in<br />
<br />
<strong>Naam:</strong><br />
<span class=\"H1\">
<input type=\"text\" class=\"Header_zwart\" size=\"30\" name=\"naam\" />
</span><br />
<br />
<strong>Telnmr:</strong><br />
<span class=\"H1\">
<input type=\"text\" class=\"Header_zwart\" size=\"30\" name=\"telnumr\" />
</span><br />
<br />
<strong>Email:</strong><br />
<span class=\"H1\">
<input type=\"text\" class=\"Header_zwart\" size=\"30\" name=\"email\" />
</span><br />
<br />
Gewenste tijd van afhalen<br />
<select name=\"tijd_uur\" id=\"select\"><br />
<option value=\"1\" selected=\"selected\">1</option><br />
<option value=\"2\">2</option><br />
<option value=\"3\">3</option><br />
<option value=\"4\">4</option><br />
<option value=\"5\">5</option><br />
<option value=\"6\">6</option><br />
<option value=\"7\">7</option><br />
<option value=\"8\">8</option><br />
<option value=\"9\">9</option><br />
<option value=\"10\">10</option><br />
<option value=\"11\">11</option><br />
<option value=\"12\">12</option><br />
<option value=\"13\">13</option><br />
<option value=\"14\">14</option><br />
<option value=\"15\">15</option><br />
<option value=\"16\">16</option><br />
<option value=\"17\">17</option><br />
<option value=\"18\">18</option><br />
<option value=\"19\">19</option><br />
<option value=\"20\">20</option><br />
<option value=\"21\">21</option><br />
<option value=\"22\">22</option><br />
<option value=\"23\">23</option><br />
<option value=\"24\">24</option>
</select>
<select name=\"tijd_minuut\" id=\"select2\"><br />
<option value=\"01\" selected=\"selected\">01</option><br />
<option value=\"02\">02</option><br />
<option value=\"03\">03</option><br />
<option value=\"04\">04</option><br />
<option value=\"05\">05</option><br />
<option value=\"06\">06</option><br />
<option value=\"07\">07</option><br />
<option value=\"08\">08</option><br />
<option value=\"09\">09</option><br />
<option value=\"10\">10</option><br />
<option value=\"11\">11</option><br />
<option value=\"12\">12</option><br />
<option value=\"13\">13</option><br />
<option value=\"14\">14</option><br />
<option value=\"15\">15</option><br />
<option value=\"16\">16</option><br />
<option value=\"17\">17</option><br />
<option value=\"18\">18</option><br />
<option value=\"19\">19</option><br />
<option value=\"20\">20</option><br />
<option value=\"21\">21</option><br />
<option value=\"22\">22</option><br />
<option value=\"23\">23</option><br />
<option value=\"24\">24</option><br />
<option value=\"25\">25</option><br />
<option value=\"26\">26</option><br />
<option value=\"27\">27</option><br />
<option value=\"28\">28</option><br />
<option value=\"29\">29</option><br />
<option value=\"30\">30</option><br />
<option value=\"31\">31</option><br />
<option value=\"32\">32</option><br />
<option value=\"33\">33</option><br />
<option value=\"34\">34</option><br />
<option value=\"35\">35</option><br />
<option value=\"36\">36</option><br />
<option value=\"37\">37</option><br />
<option value=\"38\">38</option><br />
<option value=\"39\">39</option><br />
<option value=\"40\">40</option><br />
<option value=\"41\">41</option><br />
<option value=\"42\">42</option><br />
<option value=\"43\">43</option><br />
<option value=\"44\">44</option><br />
<option value=\"45\">45</option><br />
<option value=\"46\">46</option><br />
<option value=\"47\">48</option><br />
<option value=\"49\">49</option><br />
<option value=\"50\">50</option><br />
<option value=\"51\">51</option><br />
<option value=\"52\">52</option><br />
<option value=\"53\">53</option><br />
<option value=\"54\">54</option><br />
<option value=\"55\">55</option><br />
<option value=\"56\">56</option><br />
<option value=\"57\">57</option><br />
<option value=\"58\">58</option><br />
<option value=\"59\">59</option><br />
<option value=\"60\">60</option>
</select>
</p>
<p><br />
<input name=\"Bestellen\" type=\"submit\" class=\"H1\" value=\"Bestellen\" />
<br />
<br />
<br />
</p></td>
</tr>
</form></center>
";
}
?> |