-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_group.php
139 lines (120 loc) · 7.67 KB
/
add_group.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
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
<?php
include 'includes/connect.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="styles.css">
<title>Agregar un nuevo grupo</title>
</head>
<body>
<div class="admin-panel-header">
<h1>Alta para nuevo grupo</h1>
</div>
<form action="add_group_record.php" method="POST">
<div class="add-group-layout">
<div class="first-row">
<section class="top-row"> <!-- Nombre y dirección -->
<p>Nombre</p>
<input type="text" class="new-record-input" name="name" id="name" required>
<p>Dirección</p>
<input type="text" class="new-record-input" name="address" id="address">
</section>
<section class="bottom-row"> <!-- Reuniones y Región -->
<?php $query_reunion = "SELECT * FROM meeting_reunion";
$result_query_reunion = mysqli_query($conn, $query_reunion); ?>
<p>De</p>
<select class="select-from-list" name="from_this_day">
<option selected disabled>Día</option>
<?php while($row_for_reunion = mysqli_fetch_assoc($result_query_reunion)):;?>
<option value="<?php echo $row_for_reunion['day_id']?>"> <?php echo $row_for_reunion['reunion_day']?> </option>
<?php endwhile; ?>
</select>
<span> a </span>
<?php $query_reunion = "SELECT * FROM meeting_reunion";
$result_query_reunion = mysqli_query($conn, $query_reunion); ?>
<select class="select-from-list" name="to_this_day">
<option selected disabled>Día</option>
<?php while($row_for_reunion = mysqli_fetch_assoc($result_query_reunion)):;?>
<option value="<?php echo $row_for_reunion['day_id']?>"> <?php echo $row_for_reunion['reunion_day']?> </option>
<?php endwhile; ?>
</select>
<?php $query_regions_group = "SELECT * FROM meeting_region";
$result_query_region_group = mysqli_query($conn, $query_regions_group); ?> <!-- Get regions table -->
<!-- Feed dropdown list with table content -->
<p>Localidad</p>
<select class="select-from-list" name="region">
<option selected disabled>Región</option>
<?php while($row_for_region_group = mysqli_fetch_assoc($result_query_region_group)):;?>
<option value="<?php echo $row_for_region_group['region_id']?>"><?php echo $row_for_region_group['locality']?></option>
<?php endwhile; ?>
</select>
</section>
</div> <!-- First row END -->
<div class="second-row">
<section class="top-row"> <!-- Horario y período -->
<p>Horario</p>
<input type="text" class="new-record-input" name="schedule">
<?php $query_period_day = "SELECT * FROM meeting_period";
$result_query_period_day = mysqli_query($conn, $query_period_day); ?>
<p>Período</p>
<select class="select-from-list" name="period">
<option selected disabled>Período del día</option>
<?php while($row_for_period_day = mysqli_fetch_assoc($result_query_period_day)):;?>
<option value="<?php echo $row_for_period_day['period_id']?>"><?php echo $row_for_period_day['period_string']?></option>
<?php endwhile; ?>
</select>
</section> <!-- Top Row END -->
<section class="bottom-row"> <!-- Horario extra -->
<button class="extra-schedule-btn" onclick="submenuToggle('extraSchedule')">Agregar nuevo horario</button>
<div class="extra-schedule-menu" id="extraSchedule">
<?php $query_reunion = "SELECT * FROM meeting_reunion";
$result_query_reunion = mysqli_query($conn, $query_reunion); ?>
<select class="select-from-list" name="from_this_day">
<option selected disabled>Día</option>
<?php while($row_for_reunion = mysqli_fetch_assoc($result_query_reunion)):;?>
<option value="<?php echo $row_for_reunion['day_id']?>"> <?php echo $row_for_reunion['reunion_day']?> </option>
<?php endwhile; ?>
</select>
<input type="text" class="new-record-input" name="schedule" placeholder="Horario">
<?php $query_period_day = "SELECT * FROM meeting_period";
$result_query_period_day = mysqli_query($conn, $query_period_day); ?>
<select class="select-from-list" name="period">
<option selected disabled>Período del día</option>
<?php while($row_for_period_day = mysqli_fetch_assoc($result_query_period_day)):;?>
<option value="<?php echo $row_for_period_day['period_id']?>"><?php echo $row_for_period_day['period_string']?></option>
<?php endwhile; ?>
</select>
</div> <!-- Extra schedule END -->
</section> <!-- Bottom row END -->
</div> <!-- Second row END -->
<div class="third-row"> <!-- Distrito -->
<p>Distrito</p>
<input type="text" class="new-record-input" name="district">
</div> <!-- Third Row END -->
<div class="fourth-row"> <!-- Mapa, submit button -->
<p>Mapa</p>
<input type="text" class="new-record-input" name="group_map" id="group_map">
<input type="submit" name="submit" class="guardar-btn" id="submit" value="Agregar">
<div class="go-back-link">
<a href="admin_panel.php">Regresar</a>
<a href="admin_panel_groups.php">Ver grupos</a>
</div>
</div> <!-- Fourth Row END -->
</div> <!-- Add group layout END -->
</form> <!-- Add group form END -->
<script>
function submenuToggle(divid) {
var submenu = document.getElementById(divid);
if( submenu.style.display === "none") {
submenu.style.display = "block";
} else {
submenu.style.display = "none";
}
}
</script>
</body>
</html>