-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsecretaries.php
More file actions
92 lines (84 loc) · 2.89 KB
/
secretaries.php
File metadata and controls
92 lines (84 loc) · 2.89 KB
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
<?php
include_once "inc/prelude.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>COJO OLYMPIC GAMES PROJECT - CSI2532 :: Officiels</title>
<style>
body {
background-image: url(" r/olympic3.jpg");
} </style>
<?php include "inc/resources.php" ?>
</head>
<body>
<div class="wrapper">
<header>
<h1>COJO OLYMPIC GAMES PROJECT - CSI2532</h1>
<?php breadcrumb("Officiels") ?>
</header>
<a href="newOfficielView.php" class="new">New</a>
<h2>--------Superviseur des Athletes------</h2>
<?php
connectDB();
$sql = <<<EOF
(select s.id, s.pprenom, s.pnomDeFamille, s.pAdressePermanente, s.pAdresseVillage, s.otype, p.name
From cojoDatabase.Officiel s
join (select id, officiel, id || ': ' || pprenom || ' ' || pnomDeFamille as name from cojoDatabase.Athlete) p
on p.officiel=s.id
order by s.id)
EOF;
$ret = pg_query($db, $sql);
closeDB();
if(!$ret) {
echo pg_last_error($db);
}
else {
datatable(["ID", "First Name", "Last Name", "Address Permanante", "Adresse Village","Type", "Athlete Supervise"]);
while ($row = pg_fetch_row($ret)) {
echo "<tr>";
for ($i = 0; $i < 7; $i++) {
echo "<td>", $row[$i], "</td>";
}
if(isset ($_SESSION['loggedin']) && $_SESSION['loggedin'])
{
editCell("Officiel", $row[0]);
deleteCell("Officiel", $row[0]);
}
echo "</tr>";
}
endDatatable();
}
?>
<h2>--------------Listes DES Officiels----------------</h2>
<?php
connectDB();
$sql = <<<EOF
select * from cojoDatabase.Officiel;
EOF;
$ret = pg_query($db, $sql);
closeDB();
if(!$ret) {
echo pg_last_error($db);
}
else {
datatable(["ID", "First Name", "Last Name", "Address Permanante", "Adresse Village","Type"]);
while ($row = pg_fetch_row($ret)) {
echo "<tr>";
for ($i = 0; $i < 6; $i++) {
echo "<td>", $row[$i], "</td>";
}
if(isset ($_SESSION['loggedin']) && $_SESSION['loggedin'])
{
editCell("Officiel", $row[0]);
deleteCell("Officiel", $row[0]);
}
echo "</tr>";
}
endDatatable();
}
?>
</div>
</body>
</html>