This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
divisions.php
60 lines (57 loc) · 1.64 KB
/
divisions.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
<? if(!defined("CONFIG")) exit(); ?>
<? if(!isset($login)) { show_error("You do not have administrator rights\n"); return; } ?>
<?
if(isset($_GET['filter'])) {
$filter = $_GET['filter'];
$query_where = "WHERE name LIKE '%$filter%' OR type LIKE '%$filter%'";
}
$query = "SELECT * FROM division $query_where ORDER BY name ASC";
require_once("functions.php"); // import mysql function
$link = mysqlconnect(); // call mysql function to get the link to the database
$result = mysqli_query($link,$query);
if(!$result) {
show_error("MySQL error: " . mysqli_error($link));
return;
}
?>
<h1>Divisions</h1>
<div align="right">
<form action="." method="GET">
<input type="hidden" name="page" value="divisions">
<input type="text" class="search" name="filter" value="<?=$_GET['filter']?>">
</form>
</div>
<a href=".?page=division_add">Add division</a>
<?
if(mysqli_num_rows($result) == 0) {
show_msg("No divisions found\n");
return;
}
?>
<!-- old style.css<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr class="head">
<td width="40"> </td>-->
<div class="w3-container">
<table class="w3-table-all">
<tr class="w3-dark-grey">
<td>Division</td>
<td>Type</td>
</tr>
<?
$style = "odd";
while($item = mysqli_fetch_array($result)) {
?>
<!--old style.css<tr class="<?=$style?>">-->
<tr class="w3-hover-green">
<td>
<a href=".?page=division_chg&id=<?=$item['id']?>"><img src="images/edit16.png" alt="chg"></a>
<a href=".?page=division_rem&id=<?=$item['id']?>"><img src="images/delete16.png" alt="rem"></a>
</td>
<td><?=$item['name']?></td>
<td><?=$item['type']?></td>
</tr>
<?
#old style.css $style = $style == "odd" ? "even" : "odd";
}
?>
</table>