83 lines
2.3 KiB
PHP
83 lines
2.3 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
|
|
// Ensure that only valid user types have access to this module
|
|
$AllowedUserTypes = array('SuperUser','System Administrator','Application Administrator','Communications Administrator');
|
|
if (checkPermission($AllowedUserTypes) != 1) {
|
|
echo("<br>\n");
|
|
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
|
|
include "form.messages.php";
|
|
return;
|
|
}
|
|
|
|
|
|
// Setup default values on insert
|
|
if ($naction == 'add') {
|
|
$date_added = date("Y-m-d",time());
|
|
}
|
|
|
|
$date_modified = date("Y-m-d",time());
|
|
|
|
?>
|
|
<br>
|
|
<form method='post' action='/'>
|
|
<?php
|
|
$message_width = $default_form_width;
|
|
include "form.messages.php";
|
|
?>
|
|
<table width='<?php echo($default_form_width) ?>' class='content-table'>
|
|
<tr>
|
|
<td align='center' class='heading'><?php echo($PageTitle) ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='center' valign='top'>
|
|
<br>
|
|
<table cellpadding='5' cellspacing='1' border='0'>
|
|
<?php if ($_SESSION['UserInfo']['type'] == 'SuperUser') { ?>
|
|
<tr>
|
|
<td align='left'>
|
|
Message ID:<br>
|
|
<input type='text' name='text_id' id='text_id' value='<?php echo($text_id) ?>' size='60' readonly>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='left'>
|
|
Code:<br>
|
|
<input type='text' name='data_code' id='data_code' value='<?php echo($data_code) ?>' size='20' readonly>
|
|
</td>
|
|
</tr>
|
|
<?php } else { ?>
|
|
<tr>
|
|
<td align='left'><b>ID: <?php echo($text_id) ?></b></td>
|
|
</tr>
|
|
<?php } ?>
|
|
<tr>
|
|
<td align='left'>
|
|
Text Data: <br>
|
|
<textarea name='text_data' rows='15' cols='100'><?php echo($text_data) ?></textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2' align='center'>
|
|
<br>
|
|
<input type='submit' class='btn btn--primary' value='<?php echo($ButtonText) ?>'>
|
|
<input type='hidden' name='action' value='<?php echo($action) ?>'>
|
|
<input type='hidden' name='naction' value='<?php echo($next_naction) ?>'>
|
|
<input type='hidden' name='record_num' value='<?php echo($record_num) ?>'>
|
|
<input type='hidden' name='date_modifed' value='<?php echo(date("Y-m-d",time())) ?>'>
|
|
<br>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|