Project

General

Profile

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

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

    
20
// Include WB admin wrapper script
21
require(WB_PATH.'/modules/admin.php');
22
/* */
23
include_once (WB_PATH.'/framework/functions.php');
24
// Get page
25
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
26
$page = intval(isset(${$requestMethod}['page'])) ? ${$requestMethod}['page'] : 1;
27

    
28
// Get id
29
$submission_id = intval($admin->checkIDKEY('submission_id', false, 'GET'));
30
if (!$submission_id) {
31
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page='.$page.'&amp;page_id='.$page_id.'#submissions');
32
}
33

    
34
// Get submission details
35
$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'mod_form_submissions` ';
36
$sql .= 'WHERE `submission_id` = '.$submission_id.' ';
37
if($query_content = $database->query($sql)) {
38

    
39
	$submission = $query_content->fetchRow(MYSQL_ASSOC);
40
}
41

    
42
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong>  basename: '.basename(__FILE__).'  line: '.__LINE__.' -> <br />';
43
//print_r( $page ); print '</pre>';
44

    
45
// Get the user details of whoever did this submission
46
$sql  = 'SELECT `username`,`display_name` FROM `'.TABLE_PREFIX.'users` ';
47
$sql .= 'WHERE `user_id` = '.$submission['submitted_by'];
48
if($get_user = $database->query($sql)) {
49
	if($get_user->numRows() != 0) {
50
		$user = $get_user->fetchRow(MYSQL_ASSOC);
51
	} else {
52
		$user['display_name'] = 'Unknown';
53
		$user['username'] = 'unknown';
54
	}
55
}
56
//$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR.$section['section_id'] : '' );
57
$sec_anchor = '#submissions';
58
?>
59
<table class="frm-submission" summary="" cellpadding="0" cellspacing="0" border="0">
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(DATE_FORMAT .', '.TIME_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td>
67
</tr>
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=<?php echo $page?>&amp;page_id=<?php echo $page_id.$sec_anchor; ?>';" 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 $admin->getIDKEY($submission_id).$sec_anchor; ?>');" style="width: 150px; margin-top: 5px;" />
88
<?php
89

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