First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
require_once("include/globals.php");
|
||||
|
||||
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
||||
header("Location: /");
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
// Setup default values on insert
|
||||
if ($naction == 'add') {
|
||||
$initTableName = $CurrentTable;
|
||||
$tarray = initializeTableArray($initTableName);
|
||||
extract($tarray, EXTR_OVERWRITE);
|
||||
|
||||
$added_date = date("Y-m-d",time());
|
||||
$status = "Verified";
|
||||
$display = 'N';
|
||||
$menu_price_category = 'Regular';
|
||||
$additional_permission = 'N';
|
||||
|
||||
if (array_key_exists('uid',$_GET) && strlen($_GET['uid']) > 0) $user_num = intval($_GET['uid']);
|
||||
if (array_key_exists('status',$_GET) && strlen($_GET['status']) > 0) $status = db_escape_string($_GET['status']);
|
||||
if (array_key_exists('display',$_GET) && strlen($_GET['display']) > 0) $display = db_escape_string($_GET['display']);
|
||||
|
||||
if ($_SESSION['UserInfo']['type'] == 'Parent') $user_num = intval($_SESSION['UserInfo']['record_num']);
|
||||
if (isset($user_num) && (!isset($last_name) && strlen($last_name) == 0)) $last_name = db_getVal("SELECT last_name FROM users WHERE record_num = $user_num");
|
||||
|
||||
$cust_prov = $school_record['province'];
|
||||
$cust_country = $school_record['country'];
|
||||
}
|
||||
else $customer_num = $record_num;
|
||||
|
||||
|
||||
?>
|
||||
<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 colspan='2' align='center' class='heading'><?php echo($PageTitle) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' align='center'> </td>
|
||||
</tr>
|
||||
<?php if (in_array($_SESSION['UserInfo']['type'],array('SuperUser','System Administrator','Application Administrator','Communications Administrator','Administration Team','Schedule Team'))) { ?>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-USER-ACCOUNT'); ?>: </td>
|
||||
<td align='left' valign='top'>
|
||||
<select name='selected_user_num' class='select-width400'>
|
||||
<?php if ($naction == 'search') { ?>
|
||||
<option></option>
|
||||
<?php } else { ?>
|
||||
<option value='0'><?php displayLanguageText('TEXT-SELECT-USER-ID'); ?></option>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if ($_SESSION['mode'] == 'parent' && $naction == 'add') $user_num = intval($_SESSION['UserInfo']['record_num']);
|
||||
$query = "select * from users " .
|
||||
"where school_num = $base_school_num " .
|
||||
"and type in ('Parent','Application Administrator','Administration Team','Schedule Team','Guest') " .
|
||||
"order by last_name,first_name,userid";
|
||||
$results = db_query($query);
|
||||
|
||||
while ($row = db_fetch_array($results)) {
|
||||
$unum = $row['record_num'];
|
||||
$user = $row['userid'] . " - " . $row['first_name'] . " " . $row['last_name'];
|
||||
$selected = "";
|
||||
if (isset($user_num) && $unum == $user_num) $selected = " selected='selected'";
|
||||
if (isset($selected_user_num) && $unum == $selected_user_num) $selected = " selected='selected'";
|
||||
echo(" <option value='$unum'$selected>$user</option>\n");
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td width='30%' align='right' valign='top'><?php displayLanguageText('TEXT-FIRST-NAME'); ?>: </td>
|
||||
<td align='left' width='75%' valign='top'><input type='text' name='first_name' id='first_name' value="<?php echo($first_name) ?>" size='20'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-LAST-NAME'); ?>: </td>
|
||||
<td align='left' valign='top'><input type='text' name='last_name' id='last_name' value="<?php echo($last_name) ?>" size='20'></td>
|
||||
</tr>
|
||||
<?php if (in_array($_SESSION['UserInfo']['type'],array('SuperUser','System Administrator','Application Administrator','Schedule Team','Financial','Financial Team'))) { ?>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-LABEL-NOTE'); ?>: </td>
|
||||
<td align='left' valign='top'>
|
||||
<input type='text' name='label_note' id='last_name' value="<?php echo($label_note) ?>" size='30'><br>
|
||||
<span class='small'><?php displayLanguageText('TEXT-LABEL-NOTE-EXPLANATION'); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if (!in_array($_SESSION['UserInfo']['type'],array('Parent','Staff','Administration Team','Guest')) && $school_record['special_item_prices'] == 'Y') { ?>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-MENU-PRICE-CATEGORY'); ?>: </td>
|
||||
<td align='left' valign='top'>
|
||||
<?php BuildFileRadio("menu_price_category.txt","menu_price_category",$menu_price_category) ?><br>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($school_record['customer_address'] == 'Y') { ?>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-ADDRESS'); ?>: </td>
|
||||
<td align='left' valign='top'><input type='text' name='cust_address' id='cust_address' value="<?php echo($cust_address) ?>" size='40'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-CITY'); ?>: </td>
|
||||
<td align='left' valign='top'><input type='text' name='cust_city' id='cust_city' value="<?php echo($cust_city) ?>" size='40'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-PROVINCE'); ?>: </td>
|
||||
<td align='left' valign='top'>
|
||||
<select name='cust_prov'>
|
||||
<?php BuildFileList("provinces.txt",$cust_prov) ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-COUNTRY'); ?>: </td>
|
||||
<td align='left' valign='top'><input type='text' name='cust_country' id='cust_country' value="<?php echo($cust_country) ?>" size='30'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-POSTAL'); ?>: </td>
|
||||
<td align='left' valign='top'><input type='text' name='cust_postal' id='cust_postal' value="<?php echo($cust_postal) ?>" size='20'></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($school_record['customer_phone'] == 'Y') { ?>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-PHONE'); ?>: </td>
|
||||
<td align='left' valign='top'><input type='text' name='cust_phone' id='cust_phone' value="<?php echo($cust_phone) ?>" size='15'></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($school_record['customer_email'] == 'Y') { ?>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php displayLanguageText('TEXT-EMAIL'); ?>: </td>
|
||||
<td align='left' valign='top'><input type='text' name='cust_email' id='cust_email' value="<?php echo($cust_email) ?>" size='50'></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
for ($f = 0; $f <= 10; $f++) {
|
||||
$ext = "";
|
||||
if ($f > 0) $ext = $f;
|
||||
$ufield = "user_defined_value$ext";
|
||||
$sfield = "user_defined_values$ext";
|
||||
if (!array_key_exists($sfield, $school_record)) continue;
|
||||
?>
|
||||
<?php if (($school_record[$sfield] == 'Y' || $school_record[$sfield] == 'R') && strlen($school_record["user_defined_title$ext"]) > 0) { ?>
|
||||
<tr>
|
||||
<td align='right' valign='top'><?php echo($school_record["user_defined_title$ext"]); ?>: </td>
|
||||
<?php if ($school_record["user_defined_values$ext"] == 'Y') { ?>
|
||||
<td align='left'><input type='text' name='user_defined_value<?php echo($ext) ?>' value="<?php echo($$ufield) ?>" size='15'> <span class='small'><?php displayLanguageText('TEXT-OPTIONAL'); ?></span></td>
|
||||
<?php } else { ?>
|
||||
<td align='left'><?php BuildFileRadio("yn.txt","user_defined_value$ext",$$ufield) ?></td
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($naction == 'edit') {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan='2' align='center'>
|
||||
<?php
|
||||
include "customer.display.orders.php";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<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) ?>'>
|
||||
<?php if (isset($customer_num)) { ?>
|
||||
<input type='hidden' name='record_num' value='<?php echo($customer_num) ?>'>
|
||||
<?php } ?>
|
||||
<?php if (isset($override_naction)) { ?>
|
||||
<input type='hidden' name='override_naction' value='<?php echo($override_naction) ?>'>
|
||||
<?php } ?>
|
||||
<input type='hidden' name='class_num' value='1'>
|
||||
<?php if (in_array($_SESSION['UserInfo']['type'],array('Parent','Administration Team','Staff','Guest')) || $school_record['special_item_prices'] == 'N') { ?>
|
||||
<input type='hidden' name='menu_price_category' value="<?php echo($menu_price_category) ?>">
|
||||
<?php } ?>
|
||||
<input type='hidden' name='type' value="<?php echo($people_type) ?>">
|
||||
<br>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
</form>
|
||||
Reference in new issue
Block a user