Newer
Older
<?php
// Variabeln definieren
if (!isset($_GET['rally'])) $_GET['rally'] = '1';
if (!isset($_POST['speichern'])) $_POST['speichern'] = '';
if (!isset($_POST['reset'])) $_POST['reset'] = '';
if (!isset($_POST['auswerten'])) $_POST['auswerten'] = '';
$rp = 0;
$sql = sql::$db->prepare("SELECT * FROM " . _VMS_ . "_rallydaten WHERE id = :rally LIMIT 1");
$sql -> bindParam(':rally', $_GET['rally'], PDO::PARAM_STR);
$sql -> execute();
// Ralleystand reseten
if ($_POST['reset'] == 'Reseten') {
$sql = sql::$db->prepare("DELETE FROM " . _VMS_ . "_rallyuser WHERE rally = ? and ausgezahlt = ?");
$sql->execute(array( $ralleydaten['name'], '0'));
$sql = sql::$db->prepare("UPDATE " . _VMS_ . "_rallydaten SET ende_punkte_aktuell = ?, gewinn_topf = ? WHERE id = ? LIMIT 1");
$sql->execute(array('0', $ralleydaten['tagpotstart'], $_GET['rally'] ));
if (isset($_POST['auswert']) AND $_POST['auswert'] == 'Auswerten') {
$sql = sql::$db->query("SELECT * FROM " . _VMS_ . "_rallydaten WHERE id = :rally LIMIT 1");
$sql->bindParam(':rally', $_GET['rally'], PDO::PARAM_INT);
$sql->execute();
$ralleydaten = $sql->fetch();
$platz = sql::$db->query("SELECT * FROM " . _VMS_ . "_rallyuser WHERE rally = :name AND ausgezahlt = '0' AND punkte >= :mindestpunktzhl ORDER BY punkte DESC LIMIT :gewinner_anzahl");
$platz->bindParam(':name', $ralleydaten['name'], PDO::PARAM_STR);
$platz->bindParam(':mindestpunktzhl', $ralleydaten['mindestpunktzhl'], PDO::PARAM_INT);
$platz->bindParam(':gewinner_anzahl', $ralleydaten['gewinner_anzahl'], PDO::PARAM_INT);
$platz->execute();
$x1 ++;
$rp++;
$buchungssumme = $ralleydaten['gewinn_topf'] / 100 * $ralleydaten['p' . $rp];
$sql = sql::$db->prepare("UPDATE " . _VMS_ . "_rallyuser SET auszahlungssumme = ? WHERE uid = ? AND ausgezahlt = '0' AND rally = ? LIMIT 1");
$sql->execute(array( $buchungssumme, $pa['uid'], $ralleydaten['name'] ));
$buchungs_id = create_code(14);
kontobuchung ('+', $buchungssumme, $pa['uid']);
buchungsliste ($buchungs_id, '+' . $buchungssumme, $ralleydaten['name'] . ' (Platz ' . $rp . ')', $pa['uid']);
echo' Die UID ' . $pa['uid'] . ' war auf Platz' . $x1 . 'und hat' . $buchungssumme . ' erhalten <br>';
$sql = sql::$db->prepare("UPDATE " . _VMS_ . "_rallyuser SET ausgezahlt = ? WHERE rally = ? AND ausgezahlt = ?");
$sql->execute(array( time(), $ralleydaten['name'], '0' ));
$sql = sql::$db->prepare("DELETE FROM " . _VMS_ . "_rallyuser WHERE rally = ? and ausgezahlt = ?");
$sql->execute(array( $ralleydaten['name'], '0'));
$sql = sql::$db->prepare("UPDATE " . _VMS_ . "_rallydaten SET ende_punkte_aktuell = ?, gewinn_topf = ? WHERE id = ? LIMIT 1");
$sql->execute(array('0', $ralleydaten['tagpotstart'], $_GET['rally'] ));
echo 'Auswertung durch';
}
// Ralleydaten speichern
if (isset($_POST['plaetze']) AND $_POST['plaetze'] == 'Speichern') {
$sql = sql::$db->prepare("UPDATE " . _VMS_ . "_rallydaten SET p1=?,p2=?,p3=?,p4=?,p5=?,p6=?,p7=?,p8=?,p9=?,p10=?,p11=?,p12=?,p13=?,p14=?,p15=?,p16=?,p17=?,p18=?,p19=?,p20=?,p21=?,p22=?,p23=?,p24=?,p25=?,p26=?,p27=?,p28=?,p29=?,p30=?,p31=?,p32=?,p33=?,p34=?,p35=?,p36=?,p37=?,p38=?,p39=?,p40=?,p41=?,p42=?,p43=?,p44=?,p45=?,p46=?,p47=?,p48=?,p49=?,p50=? WHERE id = ?");
$sql->execute(array($_POST['p1'],$_POST['p2'],$_POST['p3'],$_POST['p4'],$_POST['p5'],$_POST['p6'],$_POST['p7'],$_POST['p8'],$_POST['p9'],$_POST['p10'],$_POST['p11'],$_POST['p12'],$_POST['p13'],$_POST['p14'],$_POST['p15'],$_POST['p16'],$_POST['p17'],$_POST['p18'],$_POST['p19'],$_POST['p20'],$_POST['p21'],$_POST['p22'],$_POST['p23'],$_POST['p24'],$_POST['p25'],$_POST['p26'],$_POST['p27'],$_POST['p28'],$_POST['p29'],$_POST['p30'],$_POST['p31'],$_POST['p32'],$_POST['p33'],$_POST['p34'],$_POST['p35'],$_POST['p36'],$_POST['p37'],$_POST['p38'],$_POST['p39'],$_POST['p40'],$_POST['p41'],$_POST['p42'],$_POST['p43'],$_POST['p44'],$_POST['p45'],$_POST['p46'],$_POST['p47'],$_POST['p48'],$_POST['p49'],$_POST['p50'],$_GET['rally']));
if (isset($_POST['konfig']) AND $_POST['konfig'] == 'Speichern') {
$ralleystart = strtotime("" . $_POST['start_monat'] . "/" . $_POST['start_tag'] . "/" . $_POST['start_jahr'] . " " . $_POST['start_stunde'] . " hours " . $_POST['start_minute'] . " minutes 0 seconds");
$ralleyende = strtotime("" . $_POST['ende_monat'] . "/" . $_POST['ende_tag'] . "/" . $_POST['ende_jahr'] . " " . $_POST['ende_stunde'] . " hours " . $_POST['ende_minute'] . " minutes 0 seconds");
$sql = sql::$db->prepare("UPDATE " . _VMS_ . "_rallydaten SET status=?, start=?, ende_art=?, ende_zeit=?, ende_punkte=?, ende_punkte_aktuell=?, ende_punkte_anzahl=?, ende_formulierung=?, ende_fortschritt=?, gewinn_art=?, gewinn_dyn_steigerung=?, gewinn_topf=?, gewinner_anzahl=?, mindestpunktzhl=?, sperruser=?, tagpotstart=?, einheit=? WHERE id = ?");
$sql->execute(array($_POST['status'], $ralleystart, $_POST['ende_art'], $ralleyende, $_POST['ende_punkte'], $_POST['ende_punkte_aktuell'], $_POST['ende_punkte_anzahl'], $_POST['ende_formulierung'], $_POST['ende_fortschritt'], $_POST['gewinn_art'], $_POST['gewinn_dyn_steigerung'], $_POST['gewinn_topf'], $_POST['gewinner_anzahl'], $_POST['mindestpunktzhl'], $_POST['sperruser'], $_POST['tagpotstart'], $_POST['einheit'], $_GET['rally']));
if (isset($_POST['beschrieb']) AND $_POST['beschrieb'] == 'Speichern') {
$sql = sql::$db->prepare("UPDATE " . _VMS_ . "_rallydaten SET beschrieb = ? WHERE id = ?");
$sql->execute(array($_POST['beschriebf'], $_GET['rally']));
$sql = sql::$db->prepare("SELECT * FROM " . _VMS_ . "_rallydaten WHERE id=:rally LIMIT 1");
$sql->bindParam(':rally', $_GET['rally'], PDO::PARAM_INT);
$sql->execute();
head($ralleydaten['name'] . "-Rally bearbeiten (html erlaubt!)");
?>
<div align="center">
Dieser Text wird auf der Userseite angezeigt.
<br>
<form action="" method="post">
<textarea name="beschriebf" style="width:500px; height:300px;"><?php echo $ralleydaten['beschrieb'];?></textarea><br>
<input type="Submit" name="beschrieb" value="Speichern">
</form>
</div>
<?php foot();
head($ralleydaten['name'] . "-Rally bearbeiten (html erlaubt!)");
?>
<form action="" method="post">
<table cellpadding="2" cellspacing="1" border="0" align="center" bgcolor="gray">
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right" width="210px"> <b>Status </b> </td>
<td bgcolor="#F0F0F0" valign="middle" align="left" width="265px">
<select name="status" size="1" style="width: 150px;">
<option value="aktive"<?php if ($ralleydaten['status'] == 'aktive') echo' selected';?>>Aktiv</option>
<option value="deaktiviert"<?php if ($ralleydaten['status'] == 'deaktiviert') echo' selected';?>>Inaktiv</option>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;"> Schalten Sie die Rally schnell um ohne die Einstellungen anpassen zu müssen.</td>
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
</tr>
<tr>
<td bgcolor="#D4D4D4" valign="middle" align="right"><b>Start der Ralley</b> <br><code>(<i>HH/MM. - TT/MM/JJJJ</i>)</code></td>
<td bgcolor="#D4D4D4" valign="middle" align="left">
<select name="start_stunde" size="1">
<?php
for($x = 0;$x < 24;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("H", $ralleydaten['start']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
<select name="start_minute" size="1">
<?php
for($x = 0;$x < 60;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("i", $ralleydaten['start']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
-
<select name="start_tag" size="1">
<?php
for($x = 1;$x < 32;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("d", $ralleydaten['start']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
<select name="start_monat" size="1">
<?php
for($x = 1;$x < 13;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("m", $ralleydaten['start']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
<select name="start_jahr" size="1">
<?php
for($x = 2009;$x < 2051;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("Y", $ralleydaten['start']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
</td>
<td bgcolor="#D4D4D4" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Wählen Sie hier wann die Rally starten soll.</td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right"> <b>Rally endet nach? </b> </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<select name="ende_art" size="1" style="width: 150px;">
<option value="punkt"<?php if ($ralleydaten['ende_art'] == 'punkt') echo' selected';?>>Punkten</option>
<option value="zeit"<?php if ($ralleydaten['ende_art'] == 'zeit') echo' selected';?>>Datum</option>
</select>
</td>
<td align="left" valign="middle" bgcolor="#F0F0F0" style="font-size: 12px; line-height: 13px;">Soll die Rally bis zum Datum x laufen oder nach der Aktivität x enden?</td>
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
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right"><b>↳Datum</b><br> <code>(<i>HH/MM. - TT/MM/JJJJ</i>)</code></td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<select name="ende_stunde" size="1">
<?php
for($x = 0;$x < 24;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("H", $ralleydaten['ende_zeit']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
<select name="ende_minute" size="1">
<?php
for($x = 0;$x < 60;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("i", $ralleydaten['ende_zeit']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
-
<select name="ende_tag" size="1">
<?php
for($x = 1;$x < 32;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("d", $ralleydaten['ende_zeit']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
<select name="ende_monat" size="1">
<?php
for($x = 1;$x < 13;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("m", $ralleydaten['ende_zeit']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
<select name="ende_jahr" size="1">
<?php
for($x = 2009;$x < 2051;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if (date("Y", $ralleydaten['ende_zeit']) == $y) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Wenn die Rally bis zum Datum x geht stellen sie dies bitte hier ein.</td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right"><b>↳Punkten</b> </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<input type="Text" name="ende_punkte" value="<?php echo $ralleydaten['ende_punkte'];?>" style="width:150px;"><br>
<code><font style="font-size:12px;">Aktuell: <?php echo number_format($ralleydaten['ende_punkte'],'2',',','\'');?></font></code>
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Wenn die Rally nach Punkten endet stellen Sie hier ein bei wie vielen Punkten das Ende erreicht ist.</td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right">↳Punkten (aktuell) </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<input type="Text" name="ende_punkte_aktuell" value="<?php echo $ralleydaten['ende_punkte_aktuell'];?>" style="width:150px;"><br>
<code><font style="font-size:12px;">Aktuell: <?php echo number_format($ralleydaten['ende_punkte_aktuell'],'2',',','\'');?></font></code>
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Wie viele Punkte schon erreicht sind. (Sollte zu rallystart 0 sein)</td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right">↳Steigerung Punkte </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<input type="Text" name="ende_punkte_anzahl" value="<?php echo $ralleydaten['ende_punkte_anzahl'];?>" style="width:150px;">
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Steigerung der Punkte im Verhältnis zum Umsatz (hier ist ein mathematischer String einzugeben) (wenn sie pro Aufruf nur 1 Punkte geben wollen z.b. Klickrally geben Sie folgendes ein *0+1 wenn sie in einer gamerally z.b. einfach den Umsatz werten wollen geben Sie *1 ein. Wenn Sie eine AP-Rally haben z.b. und ein AP 100 Währung Umsatz braucht geben Sie /100 ein. Es ist jede mathematische Rechnung möglich.</td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right">↳Formulierung Ende </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<input type="Text" name="ende_formulierung" value="<?php echo $ralleydaten['ende_formulierung'];?>" style="width:150px;">
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Wird im Userbereich angezeigt. "Du hast in der RALLYNAME-Rally bereits x [_IHR_TEXT_]. (Danke)" z.b. in einer Klickrally "Klicks gemacht."</td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right">↳Anzeige </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<select name="ende_fortschritt" size="1" style="width: 150px;">
<option value="datum"<?php if ($ralleydaten['ende_fortschritt'] == 'datum') echo' selected';?>>Ende nach Datum</option>
<option value="Jeden Tag"<?php if ($ralleydaten['ende_fortschritt'] == 'Jeden Tag') echo' selected';?>>Täglicher Neustart</option>
<option value="Jede Woche"<?php if ($ralleydaten['ende_fortschritt'] == 'Jede Woche') echo' selected';?>>Wöchentliche Umrechnung</option>
<option value="Jeden Monat"<?php if ($ralleydaten['ende_fortschritt'] == 'Jeden Monat') echo' selected';?>>Monatliche Umrechnung</option>
<option value="Jedes Jahr"<?php if ($ralleydaten['ende_fortschritt'] == 'Jedes Jahr') echo' selected';?>>Jährliche Umrechnung</option>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Falls es eine Rally ist die täglich,wöchentlich,monatlich per Cron immer wieder neu gestartet wird können Sie das "Datum" für das Ende in die Zukunft stellen und hier den Rhythmus angeben. Ist das Ende wie eingestellt stellen Sie die Einstellung bitte auf Datum.<br>Täglich = 23.59 Uhr /-/ Wöchentlich = So 23.59 Uhr /-/ Monatlich = Letzter Tag 23.59 Uhr</td>
</tr>
<tr>
<td bgcolor="#D4D4D4" valign="middle" align="right"> <b>Rallyart </b> </td>
<td bgcolor="#D4D4D4" valign="middle" align="left">
<select name="gewinn_art" size="1" style="width: 150px;">
<option value="statisch"<?php if ($ralleydaten['gewinn_art'] == 'statisch') echo' selected';?>>Statisch</option>
<option value="dynamisch"<?php if ($ralleydaten['gewinn_art'] == 'dynamisch') echo' selected';?>>Dynamisch</option>
</select>
</td>
<td bgcolor="#D4D4D4" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Ob der Gewinn Statisch (fix) ist oder Dynamisch (abhängig von der Aktivität)</td>
</tr>
<tr>
<td bgcolor="#D4D4D4" valign="middle" align="right">↳Steigerung bei Dyn. </td>
<td bgcolor="#D4D4D4" valign="middle" align="left">
<input type="Text" name="gewinn_dyn_steigerung" value="<?php echo $ralleydaten['gewinn_dyn_steigerung'];?>" style="width:150px;">
</td>
<td bgcolor="#D4D4D4" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Steigerung der Punkte im Verhältnis zum Umsatz (hier ist ein mathematischer String einzugeben) (wenn Sie pro Aufruf nur 5 Punkte geben wollen z.b. Klickrally geben Sie folgendes ein *0+5 wenn Sie in einer Gamerally z.b. einfach 1 Proz. des Umsatzes werten wollen geben Sie /100 ein. Es ist jede mathematische Rechnung möglich.</td>
</tr>
<tr>
<td bgcolor="#D4D4D4" valign="middle" align="right">↳Gewinn Topf </td>
<td bgcolor="#D4D4D4" valign="middle" align="left">
<input type="Text" name="gewinn_topf" value="<?php echo $ralleydaten['gewinn_topf'];?>" style="width:150px;"><br>
<code><font style="font-size:12px;">Aktuell: <?php echo number_format($ralleydaten['gewinn_topf'],'2',',','\'');?> </font></code>
</td>
<td bgcolor="#D4D4D4" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Wie viel aktuell im Topf für die Ausschüttung ist (ist sowohl bei dynamisch als auch bei statisch anzugeben. Bei statisch wird dieser prozentual aufgeteilt bei dynamisch zählt dies als Startpot und wird bei Aktivität steigen.</td>
<td bgcolor="#F0F0F0" valign="middle" align="right"> <b>Jackpot startet nach Auswertung mit </b> </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<input type="Text" name="tagpotstart" value="<?php echo $ralleydaten['tagpotstart'];?>" style="width:150px;"><br>
<code><font style="font-size:12px;">Aktuell: <?php echo number_format($ralleydaten['tagpotstart'],'2',',','\'');?> </font></code>
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Mit diesem Wert wird der Gewinn-Pot bei einer Umrechnung gefüllt (z.b. bei einer Tagesrally die statisch ist, ist dies die Gewinnsumme)</td>
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
</tr>
<tr>
<td bgcolor="#D4D4D4" valign="middle" align="right"> <b>Anzahl der Plätze </b> </td>
<td bgcolor="#D4D4D4" valign="middle" align="left">
<select name="gewinner_anzahl" size="1" style="width: 150px;">
<?php
for($x = 0;$x < 51;$x++) {
if ($x <= 9) {
$y = '0' . $x;
} else {
$y = $x;
}
if ($ralleydaten['gewinner_anzahl'] == $x) {
$select = ' selected';
} else {
$select = '';
}
echo '<option value="' . $x . '"' . $select . '>' . $y . '</option>';
}
?>
</select>
</td>
<td bgcolor="#D4D4D4" valign="middle" align="left" style="font-size: 12px; line-height: 13px;"></td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right"> <b>Einheit</b> </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<input type="Text" name="einheit" value="<?php echo $ralleydaten['einheit'];?>" style="width:150px;">
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Klicks/AP/Lose-Umsatz/... je nach Rallyart (ist die Überschrift in der Usertabelle)</td>
</tr>
<tr>
<td bgcolor="#D4D4D4" valign="middle" align="right"><b>Mindestpunktzahl für Gewinn</b> </td>
<td bgcolor="#D4D4D4" valign="middle" align="left">
<input type="Text" name="mindestpunktzhl" value="<?php echo $ralleydaten['mindestpunktzhl'];?>" style="width:150px;"><br>
<code><font style="font-size:12px;">Aktuell: <?php echo number_format($ralleydaten['mindestpunktzhl'],'2',',','\'');?></font></code>
</td>
<td bgcolor="#D4D4D4" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Wie viele Punkte ein User mindestens haben muss um etwas zu gewinnen.</td>
</tr>
<tr>
<td bgcolor="#F0F0F0" valign="middle" align="right"> <b>Gesperrte User</b> </td>
<td bgcolor="#F0F0F0" valign="middle" align="left">
<input type="Text" name="sperruser" value="<?php echo $ralleydaten['sperruser'];?>" style="width:260px;">
</td>
<td bgcolor="#F0F0F0" valign="middle" align="left" style="font-size: 12px; line-height: 13px;">Bitte so eintragen: 9999999,9999998, ......</td>
</tr>
<tr>
<td align="center" valign="middle" colspan="3"><input type="Submit" name="konfig" value="Speichern" style="width:100px;"></td>
</tr>
</table>
<p align="center"><font color="#008800" size="3">Gewinnplätze.</font> <br>
Geben Sie hier den prozentualen Anteil vom Gewinn Topf an. <br>(Die Summe aller Zahlen sollte 100 ergeben)</p>
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
<table cellpadding="4" cellspacing="6" border="0" align="center" bgcolor="#333333">
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 1<br><input type="Text" name="p1" value="<?php echo $ralleydaten['p1'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 2<br><input type="Text" name="p2" value="<?php echo $ralleydaten['p2'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 3<br><input type="Text" name="p3" value="<?php echo $ralleydaten['p3'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 4<br><input type="Text" name="p4" value="<?php echo $ralleydaten['p4'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 5<br><input type="Text" name="p5" value="<?php echo $ralleydaten['p5'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 6<br><input type="Text" name="p6" value="<?php echo $ralleydaten['p6'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 7<br><input type="Text" name="p7" value="<?php echo $ralleydaten['p7'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 8<br><input type="Text" name="p8" value="<?php echo $ralleydaten['p8'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 9<br><input type="Text" name="p9" value="<?php echo $ralleydaten['p9'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 10<br><input type="Text" name="p10" value="<?php echo $ralleydaten['p10'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 11<br><input type="Text" name="p11" value="<?php echo $ralleydaten['p11'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 12<br><input type="Text" name="p12" value="<?php echo $ralleydaten['p12'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 13<br><input type="Text" name="p13" value="<?php echo $ralleydaten['p13'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 14<br><input type="Text" name="p14" value="<?php echo $ralleydaten['p14'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 15<br><input type="Text" name="p15" value="<?php echo $ralleydaten['p15'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 16<br><input type="Text" name="p16" value="<?php echo $ralleydaten['p16'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 17<br><input type="Text" name="p17" value="<?php echo $ralleydaten['p17'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 17<br><input type="Text" name="p18" value="<?php echo $ralleydaten['p18'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 18<br><input type="Text" name="p19" value="<?php echo $ralleydaten['p19'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 20<br><input type="Text" name="p20" value="<?php echo $ralleydaten['p20'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 21<br><input type="Text" name="p21" value="<?php echo $ralleydaten['p21'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 22<br><input type="Text" name="p22" value="<?php echo $ralleydaten['p22'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 23<br><input type="Text" name="p23" value="<?php echo $ralleydaten['p23'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 24<br><input type="Text" name="p24" value="<?php echo $ralleydaten['p24'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 25<br><input type="Text" name="p25" value="<?php echo $ralleydaten['p25'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 26<br><input type="Text" name="p26" value="<?php echo $ralleydaten['p26'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 27<br><input type="Text" name="p27" value="<?php echo $ralleydaten['p27'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 28<br><input type="Text" name="p28" value="<?php echo $ralleydaten['p28'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 29<br><input type="Text" name="p29" value="<?php echo $ralleydaten['p29'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 30<br><input type="Text" name="p30" value="<?php echo $ralleydaten['p30'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 31<br><input type="Text" name="p31" value="<?php echo $ralleydaten['p31'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 32<br><input type="Text" name="p32" value="<?php echo $ralleydaten['p32'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 33<br><input type="Text" name="p33" value="<?php echo $ralleydaten['p33'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 34<br><input type="Text" name="p34" value="<?php echo $ralleydaten['p34'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 35<br><input type="Text" name="p35" value="<?php echo $ralleydaten['p35'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 36<br><input type="Text" name="p36" value="<?php echo $ralleydaten['p36'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 37<br><input type="Text" name="p37" value="<?php echo $ralleydaten['p37'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 38<br><input type="Text" name="p38" value="<?php echo $ralleydaten['p38'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 39<br><input type="Text" name="p39" value="<?php echo $ralleydaten['p39'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 40<br><input type="Text" name="p40" value="<?php echo $ralleydaten['p40'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 41<br><input type="Text" name="p41" value="<?php echo $ralleydaten['p41'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 42<br><input type="Text" name="p42" value="<?php echo $ralleydaten['p42'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 43<br><input type="Text" name="p43" value="<?php echo $ralleydaten['p43'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 44<br><input type="Text" name="p44" value="<?php echo $ralleydaten['p44'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 45<br><input type="Text" name="p45" value="<?php echo $ralleydaten['p45'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 46<br><input type="Text" name="p46" value="<?php echo $ralleydaten['p46'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 47<br><input type="Text" name="p47" value="<?php echo $ralleydaten['p47'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 48<br><input type="Text" name="p48" value="<?php echo $ralleydaten['p48'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 49<br><input type="Text" name="p49" value="<?php echo $ralleydaten['p49'];?>" style="width:80px;"></td>
<td align="center" valign="middle" bgcolor="#C0C0C0">Platz 50<br><input type="Text" name="p50" value="<?php echo $ralleydaten['p50'];?>" style="width:80px;"></td>
</tr>
<tr>
<td align="center" valign="middle" colspan="5"><input type="Submit" name="plaetze" value="Speichern" style="width:100px;"></td>
</tr>
</table>
<?php foot();?>
<?php head("Platzierungen und Preise");?>
<table width="100%" cellpadding="1" cellspacing="1" border="0" class="tablesorter">
<thead>
<tr >
<th width="30"><b>Rang</b></th>
<th><b>User</b></th>
<th width="100"><b><?php echo $ralleydaten['einheit'];?></b></th>
<th width="180"><b>möglicher Gewinn</b></th>
<th width="110"><b>Mindestpunktzahl</b></th>
</tr>
</thead>
<tbody>
<?php
$sql = sql::$db->query("SELECT * FROM " . _VMS_ . "_rallydaten");
$rally = $sql->fetch();
$platz = sql::$db->prepare('SELECT k.punkte,u.nickname,u.uid FROM '._VMS_.'_rallyuser k LEFT JOIN '._VMS_.'_userdaten u ON u.uid = k.uid WHERE k.rally = :name AND k.ausgezahlt = "0" ORDER BY k.punkte DESC');
$platz -> bindParam(':name', $ralleydaten['name'] , PDO::PARAM_STR);
$platz -> execute();
$rp = 1;
$gesperrt = explode(',', $ralleydaten['sperruser']);
if (!in_array($pa['uid'], $gesperrt)) {
if ($ralleydaten['gewinner_anzahl'] >= $rp) {
$mg = number_format(($ralleydaten['gewinn_topf'] / 100 * $ralleydaten['p' . $rp]), 2, ',', '.') . ' ' . $system['waehrung'];
if ($pa['punkte'] < $ralleydaten['mindestpunktzhl']) $mindestpunkt = '<span style="color:'.$system['negativ_farbe'].';">Nicht erreicht.</span>';
if ($pa['punkte'] >= $ralleydaten['mindestpunktzhl']) $mindestpunkt = '<span style="color:'.$system['positiv_farbe'].';">Erreicht.</span>';
echo '<tr>
<td align="right">' . $rp++ . '. </td>
<td> ' . $pa['nickname'] . '</td>
<td align="right">' . number_format($pa['punkte'], 0) . ' </td>
<td align="right">' . $mg . ' </td>
<td align="right"><strong>' . $mindestpunkt . '</strong></td>
</tr>';
}
}
for($x = $rp;$x < ($rally['gewinner_anzahl']+1);$x++) {
$mg = number_format($rally['p' . $rp], 2, ',', '.') . ' ' . $system['waehrung'];
if ($x > $rally['gewinner_anzahl']) $mg = '---';
?>
<tr>
<td align="right"><?php echo $rp++;?>. </td>
<td> n/a</td>
<td align="right">0 </td>
<td align="right"><?php echo $mg;?> </td>
</tr>
<?php
}
?>
</tbody>
</table>
<form action="" method="POST">
<div align="center">
<input type="Submit" name="reset" value="Reseten"><input type="Submit" name="auswert" value="Auswerten">
</div>
</form>
<?php foot();