Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         Form
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id: view_submission.php 1553 2011-12-31 15:03:03Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/form/view_submission.php $
15
 * @lastmodified    $Date: 2011-12-31 16:03:03 +0100 (Sat, 31 Dec 2011) $
16
 * @description     
17
 */
18

    
19
require('../../config.php');
20

    
21
// Include WB admin wrapper script
22
require(WB_PATH.'/modules/admin.php');
23
/* */
24

    
25
// Get id
26
$submission_id = intval($admin->checkIDKEY('submission_id', false, 'GET'));
27
if (!$submission_id) {
28
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
29
}
30

    
31
// Get submission details
32
$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'mod_form_submissions` ';
33
$sql .= 'WHERE submission_id = '.$submission_id.' ';
34
if($query_content = $database->query($sql)) {
35
	$submission = $query_content->fetchRow(MYSQL_ASSOC);
36
}
37
// Get the user details of whoever did this submission
38
$sql  = 'SELECT `username`,`display_name` FROM `'.TABLE_PREFIX.'users` ';
39
$sql .= 'WHERE `user_id` = '.$submission['submitted_by'];
40
if($get_user = $database->query($sql)) {
41
	if($get_user->numRows() != 0) {
42
		$user = $get_user->fetchRow(MYSQL_ASSOC);
43
	} else {
44
		$user['display_name'] = 'Unknown';
45
		$user['username'] = 'unknown';
46
	}
47
}
48
$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$section['section_id'] : '' );
49
?>
50
<table class="frm-submission" summary="" cellpadding="0" cellspacing="0" border="0">
51
<tr>
52
	<td><?php echo $TEXT['SUBMISSION_ID']; ?>:</td>
53
	<td><?php echo $submission['submission_id']; ?></td>
54
</tr>
55
<tr>
56
	<td><?php echo $TEXT['SUBMITTED']; ?>:</td>
57
	<td><?php echo gmdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td>
58
</tr>
59
<tr>
60
	<td><?php echo $TEXT['USER']; ?>:</td>
61
	<td><?php echo $user['display_name'].' ('.$user['username'].')'; ?></td>
62
</tr>
63
<tr>
64
	<td colspan="2">
65
		<hr />
66
	</td>
67
</tr>
68
<tr>
69
	<td colspan="2">
70
		<?php echo nl2br($submission['body']); ?>
71
	</td>
72
</tr>
73
</table>
74

    
75
<br />
76

    
77
<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.$sec_anchor; ?>';" style="width: 150px; margin-top: 5px;" />
78
<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 $admin->getIDKEY($submission_id); ?>');" style="width: 150px; margin-top: 5px;" />
79
<?php
80

    
81
// Print admin footer
82
$admin->print_footer();
(24-24/24)