This repository has been archived by the owner on Sep 5, 2021. It is now read-only.
forked from avs-code/PREM-Podium-race-E-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseason_add.php
80 lines (78 loc) · 2.1 KB
/
season_add.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
<? if(!defined("CONFIG")) exit(); ?>
<? if(!isset($login)) { show_error("You do not have administrator rights\n"); return; } ?>
<?
require_once("functions.php"); // import mysql function
$link = mysqlconnect(); // call mysql function to get the link to the database
$diquery = "SELECT * FROM division ORDER BY name ASC";
$diresult = mysqli_query($link,$diquery);
if(!$diresult) {
show_error("MySQL error: " . mysqli_error($link) . "\n");
return;
}
if(mysqli_num_rows($diresult) == 0) {
show_error("There are no divisions.\n<a href=\"?page=division_add\">Add one</a> first.\n");
return;
}
$rsquery = "SELECT * FROM point_ruleset ORDER BY name ASC";
$rsresult = mysqli_query($link,$rsquery);
if(!$rsresult) {
show_error("MySQL error: " . mysqli_error($link) . "\n");
return;
}
if(mysqli_num_rows($rsresult) == 0) {
show_error("There are no rulesets.\n<a href=\"?page=point_add\">Add one</a> first.\n");
return;
}
?>
<h1>Add season</h1>
<form action="season_add_do.php" method="post">
<table border="0">
<tr>
<td width="120">Name:</td>
<td><input type="text" name="name" maxlength="20"></td>
</tr>
<tr>
<td>Division:</td>
<td>
<select name="division">
<? while($diitem = mysqli_fetch_array($diresult)) { ?>
<option value="<?=$diitem['id']?>"><?=$diitem['name']?></option>
<? } ?>
</select>
</td>
</tr>
<tr>
<td>Ruleset:</td>
<td>
<select name="ruleset">
<? while($rsitem = mysqli_fetch_array($rsresult)) { ?>
<option value="<?=$rsitem['id']?>"><?=$rsitem['name']?></option>
<? } ?>
</select>
</td>
</tr>
<tr>
<td>Ruleset qualifying:</td>
<td>
<select name="ruleset_qualifying">
<option value="0"> </option>
<? mysqli_data_seek($rsresult, 0); ?>
<? while($rsitem = mysqli_fetch_array($rsresult)) { ?>
<option value="<?=$rsitem['id']?>"><?=$rsitem['name']?></option>
<? } ?>
</select>
</td>
</tr>
<tr>
<td>Max teams:</td>
<td><input type="text" name="maxteams" maxlength="3" size="2" value="10"></td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" class="button submit" value="Add">
<input type="button" class="button cancel" value="Cancel" onclick="history.go(-1);">
</td>
</tr>
</table>
</form>