Revision 1582
Added by Luisehahne almost 14 years ago
| modify.php | ||
|---|---|---|
| 28 | 28 |
if(function_exists('ini_set')) {
|
| 29 | 29 |
ini_set('arg_separator.output', '&');
|
| 30 | 30 |
} |
| 31 |
|
|
| 31 | 32 |
include_once(WB_PATH.'/framework/functions.php'); |
| 32 | 33 |
|
| 33 | 34 |
$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' ) ? '#'.SEC_ANCHOR.$section['section_id'] : '' ); |
| ... | ... | |
| 42 | 43 |
} |
| 43 | 44 |
|
| 44 | 45 |
?> |
| 45 |
<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
| 46 |
<table summary="" cellpadding="0" cellspacing="0" border="0" width="916">
|
|
| 46 | 47 |
<tr> |
| 47 | 48 |
<td align="left" width="33%"> |
| 48 | 49 |
<input type="button" value="<?php echo $TEXT['ADD'].' '.$TEXT['FIELD']; ?>" onclick="javascript: window.location = '<?php echo WB_URL; ?>/modules/form/add_field.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>';" style="width: 100%;" /> |
| ... | ... | |
| 67 | 68 |
$num_fields = $query_fields->numRows(); |
| 68 | 69 |
$row = 'a'; |
| 69 | 70 |
?> |
| 70 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
|
| 71 |
<table summary="" cellpadding="2" cellspacing="0" border="0"> |
|
| 72 |
<thead> |
|
| 71 | 73 |
<tr style="background-color: #dddddd; font-weight: bold;"> |
| 72 |
<td width="20" style="padding-left: 5px;"> </td>
|
|
| 73 |
<td width="30" style="text-align: right;">ID</td>
|
|
| 74 |
<td width="400"><?php print $TEXT['FIELD']; ?></td>
|
|
| 75 |
<td width="175"><?php print $TEXT['TYPE']; ?></td>
|
|
| 76 |
<td width="100"><?php print $TEXT['REQUIRED']; ?></td>
|
|
| 77 |
<td width="175">
|
|
| 74 |
<th width="20" style="padding-left: 5px;"> </th>
|
|
| 75 |
<th width="30" style="text-align: right;">ID</th>
|
|
| 76 |
<th width="400"><?php print $TEXT['FIELD']; ?></th>
|
|
| 77 |
<th width="175"><?php print $TEXT['TYPE']; ?></th>
|
|
| 78 |
<th width="100"><?php print $TEXT['REQUIRED']; ?></th>
|
|
| 79 |
<th width="175">
|
|
| 78 | 80 |
<?php |
| 79 | 81 |
echo $TEXT['MULTISELECT']; |
| 80 | 82 |
?> |
| 81 |
</td>
|
|
| 82 |
<td width="175" colspan="3">
|
|
| 83 |
</th>
|
|
| 84 |
<th width="175" colspan="3">
|
|
| 83 | 85 |
<?php |
| 84 | 86 |
echo $TEXT['ACTIONS']; |
| 85 | 87 |
?> |
| 86 |
</td>
|
|
| 88 |
</th>
|
|
| 87 | 89 |
</tr> |
| 90 |
</thead> |
|
| 91 |
<tbody> |
|
| 88 | 92 |
<?php |
| 89 | 93 |
while($field = $query_fields->fetchRow(MYSQL_ASSOC)) {
|
| 90 | 94 |
?> |
| ... | ... | |
| 123 | 127 |
} |
| 124 | 128 |
?> |
| 125 | 129 |
</td> |
| 126 |
<td> |
|
| 130 |
<td style="text-align: center;">
|
|
| 127 | 131 |
<?php |
| 128 | 132 |
if ($field['type'] != 'group_begin') {
|
| 129 | 133 |
if($field['required'] == 1) { echo $TEXT['YES']; } else { echo $TEXT['NO']; }
|
| ... | ... | |
| 138 | 142 |
} |
| 139 | 143 |
?> |
| 140 | 144 |
</td> |
| 141 |
<td width="20"> |
|
| 145 |
<td width="20" style="text-align: center;">
|
|
| 142 | 146 |
<?php if($field['position'] != 1) { ?>
|
| 143 | 147 |
<a href="<?php echo WB_URL; ?>/modules/form/move_up.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&field_id=<?php echo $admin->getIDKEY($field['field_id']); ?>" title="<?php echo $TEXT['MOVE_UP']; ?>"> |
| 144 | 148 |
<img src="<?php echo THEME_URL; ?>/images/up_16.png" border="0" alt="^" /> |
| 145 | 149 |
</a> |
| 146 | 150 |
<?php } ?> |
| 147 | 151 |
</td> |
| 148 |
<td width="20"> |
|
| 152 |
<td width="20" style="text-align: center;">
|
|
| 149 | 153 |
<?php if($field['position'] != $num_fields) { ?>
|
| 150 | 154 |
<a href="<?php echo WB_URL; ?>/modules/form/move_down.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&field_id=<?php echo $admin->getIDKEY($field['field_id']); ?>" title="<?php echo $TEXT['MOVE_DOWN']; ?>"> |
| 151 | 155 |
<img src="<?php echo THEME_URL; ?>/images/down_16.png" border="0" alt="v" /> |
| 152 | 156 |
</a> |
| 153 | 157 |
<?php } ?> |
| 154 | 158 |
</td> |
| 155 |
<td width="20"> |
|
| 159 |
<td width="20" style="text-align: center;">
|
|
| 156 | 160 |
<?php |
| 157 | 161 |
$url = (WB_URL.'/modules/form/delete_field.php?page_id='.$page_id.'&section_id='.$section_id.'&field_id='.$admin->getIDKEY($field['field_id'])) |
| 158 |
?>
|
|
| 162 |
?> |
|
| 159 | 163 |
<a href="javascript: confirm_link('<?php echo url_encode($TEXT['ARE_YOU_SURE']); ?>', '<?php echo $url; ?>');" title="<?php echo $TEXT['DELETE']; ?>">
|
| 160 | 164 |
<img src="<?php echo THEME_URL; ?>/images/delete_16.png" border="0" alt="X" /> |
| 161 | 165 |
</a> |
| 162 | 166 |
</td> |
| 163 | 167 |
</tr> |
| 164 |
<?php
|
|
| 168 |
<?php |
|
| 165 | 169 |
// Alternate row color |
| 166 | 170 |
if($row == 'a') {
|
| 167 | 171 |
$row = 'b'; |
| ... | ... | |
| 169 | 173 |
$row = 'a'; |
| 170 | 174 |
} |
| 171 | 175 |
} |
| 172 |
?> |
|
| 176 |
?> |
|
| 177 |
</tbody> |
|
| 173 | 178 |
</table> |
| 174 | 179 |
<?php |
| 175 | 180 |
} else {
|
| ... | ... | |
| 183 | 188 |
<h2><?php echo $TEXT['SUBMISSIONS']; ?></h2> |
| 184 | 189 |
|
| 185 | 190 |
<?php |
| 186 |
|
|
| 187 | 191 |
// Query submissions table |
| 188 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'mod_form_submissions` '; |
|
| 192 |
/* |
|
| 193 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'mod_form_submissions` '; |
|
| 189 | 194 |
$sql .= 'WHERE `section_id` = '.(int)$section_id.' '; |
| 190 | 195 |
$sql .= 'ORDER BY `submitted_when` ASC '; |
| 196 |
*/ |
|
| 197 |
$sql = 'SELECT s.*, u.`display_name` '; |
|
| 198 |
$sql .= 'FROM `'.TABLE_PREFIX.'mod_form_submissions` s '; |
|
| 199 |
$sql .= 'LEFT OUTER JOIN `'.TABLE_PREFIX.'users` u '; |
|
| 200 |
$sql .= 'ON u.`user_id` = s.`submitted_by` '; |
|
| 201 |
$sql .= 'WHERE s.`section_id` = '.(int)$section_id.' '; |
|
| 202 |
$sql .= 'ORDER BY s.`submitted_when` ASC '; |
|
| 203 |
|
|
| 191 | 204 |
if($query_submissions = $database->query($sql)) {
|
| 205 |
?> |
|
| 206 |
<!-- submissions --> |
|
| 207 |
<table summary="" cellpadding="2" cellspacing="0" border="0" class="" id="frm-ScrollTable" > |
|
| 208 |
<thead> |
|
| 209 |
<tr style="background-color: #dddddd; font-weight: bold;"> |
|
| 210 |
<th width="23" style="text-align: center;"> </th> |
|
| 211 |
<th width="33" style="text-align: right;"> ID </th> |
|
| 212 |
<th width="250" style="padding-left: 10px;"><?php echo $TEXT['SUBMITTED'] ?></th> |
|
| 213 |
<th width="240" style="padding-left: 10px;"><?php echo $TEXT['USER']; ?></th> |
|
| 214 |
<th width="250"> </th> |
|
| 215 |
<th width="20"> </th> |
|
| 216 |
<th width="20"> </th> |
|
| 217 |
<th width="20"> </th> |
|
| 218 |
<th width="20"> </th> |
|
| 219 |
</tr> |
|
| 220 |
</thead> |
|
| 221 |
<tbody> |
|
| 222 |
<?php |
|
| 192 | 223 |
if($query_submissions->numRows() > 0) {
|
| 193 |
?> |
|
| 194 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
|
| 195 |
<?php |
|
| 196 | 224 |
// List submissions |
| 197 | 225 |
$row = 'a'; |
| 198 | 226 |
while($submission = $query_submissions->fetchRow(MYSQL_ASSOC)) {
|
| 199 |
?> |
|
| 227 |
$submission['display_name'] = (($submission['display_name']!=null) ? $submission['display_name'] : $TEXT['UNKNOWN']); |
|
| 228 |
?> |
|
| 200 | 229 |
<tr class="row_<?php echo $row; ?>"> |
| 201 |
<td width="20" style="padding-left: 5px;"> |
|
| 230 |
<td width="20" style="padding-left: 5px;text-align: center;">
|
|
| 202 | 231 |
<a href="<?php echo WB_URL; ?>/modules/form/view_submission.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&submission_id=<?php echo $admin->getIDKEY($submission['submission_id']); ?>" title="<?php echo $TEXT['OPEN']; ?>"> |
| 203 | 232 |
<img src="<?php echo THEME_URL; ?>/images/folder_16.png" alt="<?php echo $TEXT['OPEN']; ?>" border="0" /> |
| 204 | 233 |
</a> |
| 205 | 234 |
</td> |
| 206 |
<td width="237"><?php echo $TEXT['SUBMISSION_ID'].': '.$submission['submission_id']; ?></td> |
|
| 207 |
<td><?php echo $TEXT['SUBMITTED'].': '.gmdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td> |
|
| 208 |
<td width="20"> |
|
| 235 |
<td width="30" style="padding-right: 5px;text-align: right;"><?php echo $submission['submission_id']; ?></td> |
|
| 236 |
<td width="250" style="padding-left: 10px;"><?php echo gmdate(DATE_FORMAT.', '.TIME_FORMAT, $submission['submitted_when']+TIMEZONE ); ?></td> |
|
| 237 |
<td width="250" style="padding-left: 10px;"><?php echo $submission['display_name']; ?></td> |
|
| 238 |
<td width="240"> </td> |
|
| 239 |
<td width="20" style="text-align: center;"> </td> |
|
| 240 |
<td width="20"> </td> |
|
| 241 |
<td width="20" style="text-align: center;"> |
|
| 209 | 242 |
<?php |
| 210 | 243 |
$url = (WB_URL.'/modules/form/delete_submission.php?page_id='.$page_id.'&section_id='.$section_id.'&submission_id='.$admin->getIDKEY($submission['submission_id'])) |
| 211 |
?>
|
|
| 244 |
?> |
|
| 212 | 245 |
<a href="javascript: confirm_link('<?php echo url_encode($TEXT['ARE_YOU_SURE']); ?>', '<?php echo $url; ?>');" title="<?php echo $TEXT['DELETE']; ?>">
|
| 213 | 246 |
<img src="<?php echo THEME_URL; ?>/images/delete_16.png" border="0" alt="X" /> |
| 214 | 247 |
</a> |
| 215 | 248 |
</td> |
| 249 |
<td width="20"> </td> |
|
| 216 | 250 |
</tr> |
| 217 |
<?php
|
|
| 251 |
<?php |
|
| 218 | 252 |
// Alternate row color |
| 219 | 253 |
if($row == 'a') {
|
| 220 | 254 |
$row = 'b'; |
| ... | ... | |
| 222 | 256 |
$row = 'a'; |
| 223 | 257 |
} |
| 224 | 258 |
} |
| 225 |
?> |
|
| 226 |
</table> |
|
| 227 |
<?php |
|
| 228 | 259 |
} else {
|
| 229 |
echo $TEXT['NONE_FOUND']; |
|
| 260 |
?> |
|
| 261 |
<tr><td><?php echo $TEXT['NONE_FOUND'] ?></td></tr> |
|
| 262 |
<?php |
|
| 230 | 263 |
} |
| 231 |
} |
|
| 264 |
?> |
|
| 265 |
</tbody> |
|
| 266 |
<tfoot> |
|
| 267 |
<tr style="background-color: #dddddd; font-weight: bold;"> |
|
| 268 |
<th width="23" style="text-align: center;"> </th> |
|
| 269 |
<th width="33" style="text-align: right;"> ID </th> |
|
| 270 |
<th width="250" style="padding-left: 10px;"><?php echo $TEXT['SUBMITTED'] ?></th> |
|
| 271 |
<th width="250" style="padding-left: 10px;"><?php echo $TEXT['USER']; ?></th> |
|
| 272 |
<th width="250"> </th> |
|
| 273 |
<th width="20"> </th> |
|
| 274 |
<th width="20"> </th> |
|
| 275 |
<th width="20"> </th> |
|
| 276 |
<th width="20"> </th> |
|
| 277 |
</tr> |
|
| 278 |
</tfoot> |
|
| 279 |
</table> |
|
| 280 |
<?php |
|
| 281 |
} else {
|
|
| 282 |
echo $database->get_error().'<br />'; |
|
| 283 |
echo $sql; |
|
| 284 |
} |
|
| 285 |
?> |
|
| 286 |
<script type="text/javascript"> |
|
| 287 |
var t = new ScrollableTable(document.getElementById('frm-ScrollTable'), 30, 916);
|
|
| 288 |
</script> |
|
Also available in: Unified diff
! form module, make show submission table scrollable