-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
109 lines (100 loc) · 2.51 KB
/
index.php
File metadata and controls
109 lines (100 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
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
<?php
require_once 'util.php'; // does a session_start
require_once 'gp-api.php';
function newthread() {
$html = '';
$html .= '
<h2>Create a New Thread</h2>
<form class="panel" action="/postsubmit.php" method="POST" >
<table class="heading">';
if(!empty($_GET['e'])) {
$html .= '
<tr>
<td align="center" colspan="2"><font color="red">'.$_GET['e'].'</font></td>
</tr>';
}
$html .= '
<tr>
<th>Subject</th>
</tr>
<tr>
<td><input type="text" name="subject" value="" /></td>
</tr>
<tr>
<th>Response</th>
</tr>
<tr>
<td><textarea rows="5" name="response" style="width:100%"></textarea></td>
</tr>
<tr>
<td><input type="submit" value="Submit" /></td>
</tr>
</table>
</form>';
return $html;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Greenpride Mobile</title>
<?php echo head_links(); ?>
</head>
<body>
<?php
?>
<?php
if(!logged_in()) {
?>
<form id="login" title="Theaters" class="panel" action="/login.php" method="POST" selected="true">
<img src="/img/Logo.jpg" /><br>
<h2>Please Login</h2>
<fieldset>
<?php
if(!empty($_GET['e'])) {
?>
<div class="row">
<b><center><font color="red"><?php echo $_GET['e'] ?></font></center></b>
</div>
<?php } ?>
<div class="row">
<label>Username</label>
<input type="text" name="username" value=""/>
</div>
<div class="row">
<label>Password</label>
<input type="password" name="password" value=""/>
</div>
</fieldset>
<input type="submit" class="whiteButton" value="Login" />
</form>
<?php } else { // logged in
$api = new GpAPI();
$posts = $api->Posts();
$nextUnreadPostId = $api->PostNextUnreadID();
?>
<div class="panel" selected="true">
<input id="newThreadToggle" type="button" value="New Thread" onclick="javascript:toggleDiv('newThread', 'newThreadToggle', 'New Thread', 'Hide New Thread')" />
<div id="newThread" style="display:none;">
<?php
echo newthread();
?>
</div>
<?php
$menuSettings = array('nextUnreadPostId' => $nextUnreadPostId, 'returnToBoard' => FALSE);
echo menu($menuSettings);
display_posts($posts);
echo newthread();
?>
<?php
$menuSettings['showStats'] = TRUE;
$menuSettings['logout'] = TRUE;
echo menu($menuSettings);
?>
</div>
<?php
} ?>
<?php echo footer(); ?>
</body>
</html>