Project

General

Profile

1
<?php
2

    
3
// $Id: view_submission.php 1069 2009-07-15 20:28:15Z 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
//overwrite php.ini on Apache servers for valid SESSION ID Separator
45
if(function_exists('ini_set')) {
46
	ini_set('arg_separator.output', '&amp;');
47
}
48

    
49
// Get submission details
50
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_form_submissions WHERE submission_id = '$submission_id'");
51
$submission = $query_content->fetchRow();
52

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

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

    
89
<br />
90

    
91
<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;" />
92
<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; ?>&amp;section_id=<?php echo $section_id; ?>&submission_id=<?php echo $submission_id; ?>');" style="width: 150px; margin-top: 5px;" />
93
<?php
94

    
95
// Print admin footer
96
$admin->print_footer();
97

    
98
?>
(21-21/21)