-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
67 lines (66 loc) · 2.51 KB
/
Copy pathsettings.php
File metadata and controls
67 lines (66 loc) · 2.51 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
<?php
include('./includes/logout.inc.php');
date_default_timezone_set('America/New_York');
require_once("./includes/session_timeout.inc.php");
require("./includes/connection.inc.php");
if (isset($_POST['settingsubmit'])){
require("./includes/settingupdate.inc.php");
}
$connw = dbConnect('write');
if($_SESSION['role'] != 'admin'){
header('Location: index.php');
}
$sql = "SELECT * FROM settings";
$result = $connw->query($sql);
include('./head.inc.php');
?>
<link rel="stylesheet" type="text/css" href="./includes/anytime.c.css" />
<script src="./includes/jquery.min.js"></script>
<script src="./includes/anytime.c.js"></script>
<h1>Settings Page</h1>
<br />
<table><tr><td>
<p>Here you can configure settings. Non-date values are restricted to integers of length 7. Please don't stuff other things than that into them or bad things will happen. Since you're the training coordinator/authorized person, I trust you. Nick will not fix your mistakes.</p>
</td></tr></table>
<form name="settings" method="post" action="">
<table border="2">
<?php while ($row = $result->fetch_assoc()){?>
<tr>
<td><b><?php echo $row['name']; ?></b></td>
<td><?php
if ($row['type'] == "int"){
echo '<input type="text" name="' . $row['name'] . '" id="' . $row['name'] .
'" value="' . $row['nvalue'] . '" maxchars="7">';
} elseif ($row['type'] == "date") {
echo '<input type="text" name="' . $row['name'] . '" id="' . $row['name']
. '" value="' . $row['dvalue'] . '"/>';?>
<script>
AnyTime.picker( "<?php echo $row['name']; ?>",
{ format: "%Y-%m-%d %T", firstDOW: 1 } );
</script>
<?php } ?>
</td>
<td><?php echo $row['Description']; ?></td>
</tr>
<?php } ?>
</table>
<br />
<h2>Text Editing</h2>
<p>This area allows customization of the side bar. Please compare what appears at your right with the text inside. To modify, simply change the text. It is coded with basic HTML and CSS tags which you can research if you want. To make a new line, copy and paste an existing line. Pretty simple.</p>
<table border="2">
<?php
$sql = "SELECT * FROM cmstext";
$text = $connw->query($sql);
while ( $item = $text->fetch_assoc()) {
?><tr>
<th><?php echo $item['name'];?></th>
<td><textarea name="<?php echo $item['name']; ?>" rows="8" cols="40"><?php
echo $item['body']; ?></textarea></td>
<td><?php echo $item['description'];?></td>
</tr>
<?php } ?>
</table>
<p><input type="submit" name="settingsubmit"></p>
</form>
<i><font color="grey">For a sanity check, the current time is <?php echo strftime("%c" , time()); ?></font></i>
<?php include('./tail.inc.php'); ?>