This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rreg3.php
65 lines (59 loc) · 1.69 KB
/
rreg3.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
<?php
if ($_SESSION['innlogget'] == 1) {
//Kobler til databse
$con = mysql_connect("REDACTED", "REDACTED", "REDACTED");
if ($con) {
mysql_select_db("REDACTED", $con);
//Henter POST-data
$s = $_POST['stevne'];
//Henter info om stevne
$q = mysql_query("SELECT * FROM stevne WHERE stevneID='$s'");
printf("<table><tr><th>%s</th></tr>", mysql_result($q, 0, "navn"));
//Henter �velser p� stevne
$q = mysql_query("
SELECT * FROM ovelse,ovelsepastevne
WHERE ovelsepastevne.stevne=$s AND ovelsepastevne.ovelse=ovelse.ovelseID
ORDER BY ovelse
");
//Skriver ut alle personer som tar alle �velser
while ($a = mysql_fetch_array($q)) {
//Henter ut p�melding for gjeldende �velse
$ops = $a['opsID'];
$k = mysql_query("
SELECT * FROM pamelding,utover
WHERE pamelding.ovelsepastevne=$ops AND pamelding.svommer=utover.utoverID
AND resreg=0
");
if (mysql_num_rows($k) > 0) {
printf("<tr><th>%s %s</th></tr>", $a['distanse'], $a['art']);
while ($b = mysql_fetch_array($k)) {
$pam = $b['pamID'];
$r_m = $pam . m;
$r_s = $pam . s;
$pts = $pam . p;
$r_m = $_POST[$r_m];
$r_s = $_POST[$r_s];
$pts = $_POST[$pts];
if ($r_s != "") {
printf(
"<tr><td>%s %s %s</td>
<td>%s:%s</td>",
$b['pamID'],
$b['fornavn'],
$b['etternavn'],
$r_m,
$r_s
);
mysql_query("UPDATE pamelding set res_m='$r_m' , res_s='$r_s' , poeng='$pts' , resreg=1
WHERE pamID='$pam'");
}
}
}
}
echo "</table>";
//Lukke database
mysql_close($con);
} else {
die("Could not connnect - " . mysql_error());
}
}