Project

General

Profile

1
<?php
2

    
3
// $Id: view_submission.php 40 2005-09-07 19:22:34Z stefan $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2005, Ryan Djurovich
9

    
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

    
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

    
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

    
24
*/
25

    
26
/*
27
The Website Baker Project would like to thank Rudolph Lartey <www.carbonect.com>
28
for his contributions to this module - adding extra field types
29
*/
30

    
31
require('../../config.php');
32

    
33
// Get id
34
if(!isset($_GET['submission_id']) OR !is_numeric($_GET['submission_id'])) {
35
	header("Location: ".ADMIN_URL."/pages/index.php");
36
} else {
37
	$submission_id = $_GET['submission_id'];
38
}
39

    
40
// Include WB admin wrapper script
41
require(WB_PATH.'/modules/admin.php');
42

    
43
// Get submission details
44
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_form_submissions WHERE submission_id = '$submission_id'");
45
$submission = $query_content->fetchRow();
46

    
47
// Get the user details of whoever did this submission
48
$query_user = "SELECT username,display_name FROM ".TABLE_PREFIX."users WHERE user_id = '".$submission['submitted_by']."'";
49
$get_user = $database->query($query_user);
50
if($get_user->numRows() != 0) {
51
	$user = $get_user->fetchRow();
52
} else {
53
	$user['display_name'] = 'Unknown';
54
	$user['username'] = 'unknown';
55
}
56

    
57
?>
58
<table cellpadding="0" cellspacing="0" border="0" width="100%">
59
<tr>
60
	<td><?php echo $TEXT['SUBMISSION_ID']; ?>:</td>
61
	<td><?php echo $submission['submission_id']; ?></td>
62
</tr>
63
<tr>
64
	<td><?php echo $TEXT['SUBMITTED']; ?>:</td>
65
	<td><?php echo gmdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td>
66
</td>
67
<tr>
68
	<td><?php echo $TEXT['USER']; ?>:</td>
69
	<td><?php echo $user['display_name'].' ('.$user['username'].')'; ?></td>
70
</tr>
71
<tr>
72
	<td colspan="2">
73
		<hr />
74
	</td>
75
</tr>
76
<tr>
77
	<td colspan="2">
78
		<?php echo $admin->strip_slashes(str_replace('\n', '<br />', $submission['body'])); ?>
79
	</td>
80
</tr>
81
</table>
82

    
83
<br />
84

    
85
<input type="button" value="<?php echo $TEXT['CLOSE']; ?>" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" style="width: 150px; margin-top: 5px;" />
86
<input type="button" value="<?php echo $TEXT['DELETE']; ?>" onclick="javascript: confirm_link('<?php echo $TEXT['ARE_YOU_SURE']; ?>', '<?php echo WB_URL; ?>/modules/form/delete_submission.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&submission_id=<?php echo $submission_id; ?>');" style="width: 150px; margin-top: 5px;" />
87
<?php
88

    
89
// Print admin footer
90
$admin->print_footer();
91

    
92
?>
(17-17/17)