-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddgroup1.php
54 lines (47 loc) · 1.79 KB
/
addgroup1.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
<?PHP
include "dbconnect.php";
$sql = "SELECT * from coaches";
$result = $conn->query($sql);
$coaches = $result->fetch_all(MYSQLI_ASSOC);
?>
<form action="addgroup2.php">
<label for="group_name">Group Name:</label></br>
<input type="text" id="group_name" name="group_name" value="<?php echo $row["group_name"];?>"></br>
<label for="num_swimmers">Number of Swimmers:</label></br>
<input type="text" id="num_swimmers" name="num_swimmers" value="<?php echo $row["num_swimmers"];?>"></br>
<label for="coach_id">Coach:</label></br>
<select id="coach_id" name="coach_id" >
<?php
for($i=0; $i< count($coaches); $i++)
{
echo '<option value = "' . $coaches[$i]["coach_id"] . '">';
echo $coaches[$i]["fname"] . "</option>";
}
?>
</select> </br>
<label for="assistant_1">Assistant 1:</label></br>
<select id="assistant_1" name="assistant_1" >
<?php
for($i=0; $i< count($coaches); $i++)
{
echo '<option value = "' . $coaches[$i]["fname"] . '">';
echo $coaches[$i]["fname"] . "</option>";
}
echo '<option value = NULL>None</option>';
?>
</select> </br>
<label for="assistant_2">Assistant 2:</label></br>
<select id="assistant_2" name="assistant_2" >
<?php
for($i=0; $i< count($coaches); $i++)
{
echo '<option value = "' . $coaches[$i]["fname"] . '">';
echo $coaches[$i]["fname"] . "</option>";
}
echo '<option value = NULL>None</option>';
?>
</select> </br>
<label for="age_range">Age Range:</label></br>
<input type="text" id="age_range" name="age_range" value="<?php echo $row["age_range"];?>"></br>
<input type="submit" value="Submit">
</form>