Project

General

Profile

1 560 Ruebenwurz
<?php
2 1375 FrankH
/**
3
 *
4
 * @category        module
5
 * @package         Form
6 1714 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7 1919 Luisehahne
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 1375 FrankH
 * @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$
13 1919 Luisehahne
 * @filesource      $HeadURL$
14 1457 Luisehahne
 * @lastmodified    $Date$
15 1714 Luisehahne
 * @description
16 1375 FrankH
 */
17 560 Ruebenwurz
18 1375 FrankH
require('../../config.php');
19 560 Ruebenwurz
20 1375 FrankH
// Include WB admin wrapper script
21
require(WB_PATH.'/modules/admin.php');
22 1804 Luisehahne
// load module language file
23
$lang = (dirname(__FILE__)) . '/languages/' . LANGUAGE . '.php';
24
require_once(!file_exists($lang) ? (dirname(__FILE__)) . '/languages/EN.php' : $lang );
25 1466 Luisehahne
/* */
26 1804 Luisehahne
27 1655 Luisehahne
include_once (WB_PATH.'/framework/functions.php');
28 1804 Luisehahne
29 1714 Luisehahne
// Get page
30
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
31
$page = intval(isset(${$requestMethod}['page'])) ? ${$requestMethod}['page'] : 1;
32
33 560 Ruebenwurz
// Get id
34 1553 Luisehahne
$submission_id = intval($admin->checkIDKEY('submission_id', false, 'GET'));
35 1375 FrankH
if (!$submission_id) {
36 1714 Luisehahne
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page='.$page.'&amp;page_id='.$page_id.'#submissions');
37 560 Ruebenwurz
}
38 1466 Luisehahne
39 560 Ruebenwurz
// Get submission details
40 1553 Luisehahne
$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'mod_form_submissions` ';
41 1714 Luisehahne
$sql .= 'WHERE `submission_id` = '.$submission_id.' ';
42 1553 Luisehahne
if($query_content = $database->query($sql)) {
43 1714 Luisehahne
44 1553 Luisehahne
	$submission = $query_content->fetchRow(MYSQL_ASSOC);
45
}
46 1714 Luisehahne
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 560 Ruebenwurz
// Get the user details of whoever did this submission
51 1553 Luisehahne
$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 1804 Luisehahne
		$user['display_name'] = $TEXT['GUEST'];
58
		$user['username'] = $TEXT['UNKNOWN'];
59 1553 Luisehahne
	}
60 560 Ruebenwurz
}
61 1919 Luisehahne
//$sSectionIdPrefix = ( defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? '#'.SEC_ANCHOR : 'Sec' );
62
$sSectionIdPrefix = 'submissions';
63 560 Ruebenwurz
?>
64 1553 Luisehahne
<table class="frm-submission" summary="" cellpadding="0" cellspacing="0" border="0">
65 560 Ruebenwurz
<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 1582 Luisehahne
	<td><?php echo gmdate(DATE_FORMAT .', '.TIME_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td>
72 1553 Luisehahne
</tr>
73 560 Ruebenwurz
<tr>
74 1804 Luisehahne
	<td><?php echo $TEXT['USER'].' ('.$TEXT['USERNAME'].')'; ?>:</td>
75 560 Ruebenwurz
	<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 1919 Luisehahne
<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.'#'.$sSectionIdPrefix; ?>';" 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; ?>&section_id=<?php echo $section_id; ?>&submission_id=<?php echo $admin->getIDKEY($submission_id).'#'.$sSectionIdPrefix; ?>');" style="width: 150px; margin-top: 5px;" />
93 560 Ruebenwurz
<?php
94
95
// Print admin footer
96
$admin->print_footer();