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:
|
<?php
include('checkuser.php')
?>
<html>
<head>
<title>Gut Brynne</title>
<link rel="stylesheet" href="http://brynne.bplaced.net/neu/style.css">
</head>
<?php
//Datenbankverbindung einfügen!
include('datenbank.php');
//Variablen festlegen
$id = $_POST["id"];
$ergebnis = $_POST["ergebnis"];
$preis = $_POST["preis"];
$pferd = $_POST["pferd"];
$dis = $_POST["dis"];
if($ergebnis==1){ $plus=10; }
if($ergebnis==2){ $plus=9; }
if($ergebnis==3){ $plus=8; }
if($ergebnis==4){ $plus=7; }
if($ergebnis==5){ $plus=6; }
if($ergebnis==6){ $plus=5; }
if($ergebnis==7){ $plus=4; }
if($ergebnis==8){ $plus=3; }
if($ergebnis==9){ $plus=2; }
if($ergebnis==10){ $plus=1; }
if($ergebnis >= 11) { $plus=0; }
//wenn eine der Variablen name, pass oder mail leer ist, dann [if]
if( ($ergebnis=='') ) {
//Ausgabe der Fehlermeldung
echo "<b>Error</b>
Bitte gebe eine Platzierung ein!<br><br>
<a href="javascript:%20history.back(-2)" target="_self">Zurück</a>";
//wenn alles richtig ist:
} else {
$aendern = "UPDATE `ergebnis` SET `ergebnis` = '$ergebnis', `preis` = '$preis' WHERE `id` = $id";
$update = mysql_query($aendern);
if($update==true) {
echo "<h2>Eintrag erfolgreich</h2>
Das Ergebnis wurde eingetragen.";
} else {
echo "Fehler!";
include('ergebniseintragen.php');
}
$Ergebnis = mysql_query("SELECT * FROM pferd WHERE name = '$pferd'");
if (@mysql_num_rows($Ergebnis) == 0) {
echo "Dieses Pferd existiert nicht.";
}
else {
while($Data = mysql_fetch_array($Ergebnis)) {
if($dis=='Dressur'){$neu = $Data[p1] + $plus; }
if($dis=='Springen'){$neu = $Data[p2] + $plus; }
if($dis=='Military'){$neu = $Data[p3] + $plus; }
if($dis=='Klassische Dr.'){$neu = $Data[p7] + $plus; }
if($dis=='Fahren'){$neu = $Data[p4] + $plus; }
if($dis=='Distanz'){$neu = $Data[p6] + $plus; }
if($dis=='Voltigieren'){$neu = $Data[p5] + $plus; }
if($dis=='Reining'){$neu = $Data[p8] + $plus; }
if($dis=='Trail'){$neu = $Data[p9] + $plus; }
if($dis=='Pleasure'){$neu = $Data[p10] + $plus; }
if($dis=='Horsemanship'){$neu = $Data[p11] + $plus; }
if($dis=='Western Riding'){$neu = $Data[p12] + $plus; }
if($dis=='Cutting'){$neu = $Data[p13] + $plus; }
if($dis=='Working Cowhorse'){$neu = $Data[p14] + $plus; }
if($dis=='Barrel Race'){$neu = $Data[p15] + $plus; }
if($dis=='Pole Bending'){$neu = $Data[p16] + $plus; }
if($dis=='Superhorse'){$neu = $Data[p17] + $plus; }
if($dis=='Halter'){$neu = $Data[p24] + $plus; }
if($dis=='Töltprüfung'){$neu = $Data[p18] + $plus; }
if($dis=='Mehrgangprüfung'){$neu = $Data[p19] + $plus; }
if($dis=='Fünfgangprüfung'){$neu = $Data[p20] + $plus; }
if($dis=='Passprüfung'){$neu = $Data[p21] + $plus; }
if($dis=='Passrennen'){$neu = $Data[p22] + $plus; }
if($dis=='Gehorsam'){$neu = $Data[p23] + $plus; }
if($neu >= 100) {
if($dis=='Dressur'){
if($Data[dressura] != $Data[dressurp]){
if($Data[dressura] == 'Reitpferdeprüfung'){ $new = 'Kl. E'; }
if($Data[dressura] == 'Reitponyprüfung'){ $new = 'Kl. E'; }
if($Data[dressura] == 'Kl. E'){ $new = 'Kl. A'; }
if($Data[dressura] == 'Kl. A'){ $new = 'Kl. L'; }
if($Data[dressura] == 'Kl. L'){ $new = 'Kl. M'; }
if($Data[dressura] == 'Kl. M'){ $new = 'Kl. S'; }
if($Data[dressura] == 'Kl. S'){ $new = 'Intermediaire I'; }
if($Data[dressura] == 'Intermediaire I'){ $new = 'Intermediaire II'; }
if($Data[dressura] == 'Intermediaire II'){ $new = 'Grand Prix'; }
if($Data[dressura] == 'Grand Prix'){ $new = 'Grand Prix Special'; }
if($Data[dressura] == 'Grand Prix'){ $new = 'Grand Prix Kür'; }
$aendern = "UPDATE `pferd` SET `p1` = '0', `dressura` = '$new' WHERE `name` = '$pferd'";
$update = mysql_query($aendern);
if($update==true) {
echo "<br><br><h2>Eintrag erfolgreich</h2>
Juchu! $pferd ist eine Klasse aufgestiegen. (:";
} else {
echo "Fehler!";
echo mysql_error();
include('ergebniseintragen.php');
}}}
if($dis=='Springen'){
if($Data[springena] != $Data[springenp]){
if($Data[springena] == 'Springpferdeprüfung'){ $new = 'Kl. E'; }
if($Data[springena] == 'Springponyprüfung'){ $new = 'Kl. E'; }
if($Data[springena] == 'Kl. E'){ $new = 'Kl. A*'; }
if($Data[springena] == 'Kl. A*'){ $new = 'Kl. A**'; }
if($Data[springena] == 'Kl. A**'){ $new = 'Kl. L'; }
if($Data[springena] == 'Kl. L'){ $new = 'Kl. M*'; }
if($Data[springena] == 'Kl. M*'){ $new = 'Kl. M**'; }
if($Data[springena] == 'Kl. M**'){ $new = 'Kl. S*'; }
if($Data[springena] == 'Kl. S*'){ $new = 'Kl. S**'; }
if($Data[springena] == 'Kl. S**'){ $new = 'Kl. S***'; }
if($Data[springena] == 'Kl. S***'){ $new = 'Kl. S****'; }}}
if($dis=='Military'){
if($Data[vielseitigkeita] != $Data[vielseitigkeitp]){
if($Data[vielseitigkeita] == 'Kl. E'){ $new = 'Kl. A'; }
if($Data[vielseitigkeita] == 'Kl. A'){ $new = 'Kl. L'; }
if($Data[vielseitigkeita] == 'Kl. L'){ $new = 'Kl. M'; }
if($Data[vielseitigkeita] == 'Kl. M'){ $new = 'Kl. S'; }}}
if($dis=='Klassische Dr.'){
if($Data[klassischa] != $Data[klassischp]){
if($Data[klassischa] == 'Kl. P1'){ $new = 'P2'; }
if($Data[klassischa] == 'Kl. P2'){ $new = 'P3'; }
if($Data[klassischa] == 'Kl. P3'){ $new = 'P4'; }
if($Data[klassischa] == 'Kl. P4'){ $new = 'P5'; }
if($Data[klassischa] == 'Kl. P4'){ $new = 'P6'; }
if($Data[klassischa] == 'Kl. P6'){ $new = 'SP'; }}}
}
else {
if($dis=='Dressur') {
$aendern = "UPDATE `pferd` SET `p1` = '$neu' WHERE `name` = '$pferd'";
$update = mysql_query($aendern);
if($update==true) {
echo "<br><br><h2>Eintrag erfolgreich</h2>
$plus Punkte wurden hinzugezählt.";
} else {
echo "Fehler!";
echo mysql_error();
}}
}}}
}
//PHP schließen
?>
|