Project

General

Profile

1
<?php
2

    
3
// $Id: view_submission.php 1074 2009-07-16 19:07:23Z Ruebenwurzel $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, 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
	exit(0);
37
} else {
38
	$submission_id = $_GET['submission_id'];
39
}
40

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

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

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

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

    
84
<br />
85

    
86
<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;" />
87
<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;" />
88
<?php
89

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

    
93
?>
(21-21/21)