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 1804 2012-11-01 22:50:49Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/form/view_submission.php $
|
14
|
* @lastmodified $Date: 2012-11-01 23:50:49 +0100 (Thu, 01 Nov 2012) $
|
15
|
* @description
|
16
|
*/
|
17
|
|
18
|
require('../../config.php');
|
19
|
|
20
|
// Include WB admin wrapper script
|
21
|
require(WB_PATH.'/modules/admin.php');
|
22
|
// load module language file
|
23
|
$lang = (dirname(__FILE__)) . '/languages/' . LANGUAGE . '.php';
|
24
|
require_once(!file_exists($lang) ? (dirname(__FILE__)) . '/languages/EN.php' : $lang );
|
25
|
/* */
|
26
|
|
27
|
include_once (WB_PATH.'/framework/functions.php');
|
28
|
|
29
|
// Get page
|
30
|
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
|
31
|
$page = intval(isset(${$requestMethod}['page'])) ? ${$requestMethod}['page'] : 1;
|
32
|
|
33
|
// Get id
|
34
|
$submission_id = intval($admin->checkIDKEY('submission_id', false, 'GET'));
|
35
|
if (!$submission_id) {
|
36
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page='.$page.'&page_id='.$page_id.'#submissions');
|
37
|
}
|
38
|
|
39
|
// Get submission details
|
40
|
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'mod_form_submissions` ';
|
41
|
$sql .= 'WHERE `submission_id` = '.$submission_id.' ';
|
42
|
if($query_content = $database->query($sql)) {
|
43
|
|
44
|
$submission = $query_content->fetchRow(MYSQL_ASSOC);
|
45
|
}
|
46
|
|
47
|
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong> basename: '.basename(__FILE__).' line: '.__LINE__.' -> <br />';
|
48
|
//print_r( $page ); print '</pre>';
|
49
|
|
50
|
// Get the user details of whoever did this submission
|
51
|
$sql = 'SELECT `username`,`display_name` FROM `'.TABLE_PREFIX.'users` ';
|
52
|
$sql .= 'WHERE `user_id` = '.$submission['submitted_by'];
|
53
|
if($get_user = $database->query($sql)) {
|
54
|
if($get_user->numRows() != 0) {
|
55
|
$user = $get_user->fetchRow(MYSQL_ASSOC);
|
56
|
} else {
|
57
|
$user['display_name'] = $TEXT['GUEST'];
|
58
|
$user['username'] = $TEXT['UNKNOWN'];
|
59
|
}
|
60
|
}
|
61
|
//$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' ) ? '#'.SEC_ANCHOR.$section['section_id'] : '' );
|
62
|
$sec_anchor = '#submissions';
|
63
|
?>
|
64
|
<table class="frm-submission" summary="" cellpadding="0" cellspacing="0" border="0">
|
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(DATE_FORMAT .', '.TIME_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td>
|
72
|
</tr>
|
73
|
<tr>
|
74
|
<td><?php echo $TEXT['USER'].' ('.$TEXT['USERNAME'].')'; ?>:</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=<?php echo $page?>&page_id=<?php echo $page_id.$sec_anchor; ?>';" 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; ?>§ion_id=<?php echo $section_id; ?>&submission_id=<?php echo $admin->getIDKEY($submission_id).$sec_anchor; ?>');" style="width: 150px; margin-top: 5px;" />
|
93
|
<?php
|
94
|
|
95
|
// Print admin footer
|
96
|
$admin->print_footer();
|