Cleaned up the HTML for adding users

这个提交包含在:
Peter Goodhall 2020-09-16 21:00:16 +01:00
父节点 305f8d3eb6
当前提交 b5774a76b0

查看文件

@ -19,82 +19,81 @@
<form method="post" action="<?php echo site_url('user/add'); ?>" name="users"> <form method="post" action="<?php echo site_url('user/add'); ?>" name="users">
<div class="form-group"> <div class="form-group">
<label>Username</label> <label>Username</label>
<input class="form-control" type="text" name="user_name" value="<?php if(isset($user_name)) { echo $user_name; } ?>" /> <input class="form-control" type="text" name="user_name" value="<?php if(isset($user_name)) { echo $user_name; } ?>" />
<?php if(isset($username_error)) { echo "<div class=\"small error\">".$username_error."</div>"; } ?> <?php if(isset($username_error)) { echo "<div class=\"small error\">".$username_error."</div>"; } ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>User Role</label> <label>User Role</label>
<select class="custom-select" name="user_type"> <select class="custom-select" name="user_type">
<?php <?php
$levels = $this->config->item('auth_level');
$levels = $this->config->item('auth_level'); while (list($key, $val) = each($levels)) {
while (list($key, $val) = each($levels)) { ?>
?> <option value="<?php echo $key; ?>" <?php if(isset($user_type)) { if($user_type == $key) { echo "selected=\"selected\""; } } ?>><?php echo $val; ?></option>
<option value="<?php echo $key; ?>" <?php if(isset($user_type)) { if($user_type == $key) { echo "selected=\"selected\""; } } ?>><?php echo $val; ?></option> <?php } ?>
<?php } ?> </select>
</select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Email Address</label> <label>Email Address</label>
<input class="form-control" type="text" name="user_email" value="<?php if(isset($user_email)) { echo $user_email; } ?>" /> <input class="form-control" type="text" name="user_email" value="<?php if(isset($user_email)) { echo $user_email; } ?>" />
<?php if(isset($email_error)) { echo "<div class=\"small error\">".$email_error."</div>"; } ?> <?php if(isset($email_error)) { echo "<div class=\"small error\">".$email_error."</div>"; } ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Password</label> <label>Password</label>
<input class="form-control" type="password" name="user_password" value="<?php if(isset($user_password)) { echo $user_password; } ?>" /> <input class="form-control" type="password" name="user_password" value="<?php if(isset($user_password)) { echo $user_password; } ?>" />
<?php if(isset($password_error)) { echo "<div class=\"small error\">".$password_error."</div>"; } ?> <?php if(isset($password_error)) { echo "<div class=\"small error\">".$password_error."</div>"; } ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>First Name</label> <label>First Name</label>
<input class="form-control" type="text" name="user_firstname" value="<?php if(isset($user_firstname)) { echo $user_firstname; } ?>" /> <input class="form-control" type="text" name="user_firstname" value="<?php if(isset($user_firstname)) { echo $user_firstname; } ?>" />
<?php if(isset($firstname_error)) { echo "<div class=\"small error\">".$firstname_error."</div>"; } ?> <?php if(isset($firstname_error)) { echo "<div class=\"small error\">".$firstname_error."</div>"; } ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Last Name</label> <label>Last Name</label>
<input class="form-control" type="text" name="user_lastname" value="<?php if(isset($user_lastname)) { echo $user_lastname; } ?>" /> <input class="form-control" type="text" name="user_lastname" value="<?php if(isset($user_lastname)) { echo $user_lastname; } ?>" />
<?php if(isset($lastname_error)) { echo "<div class=\"small error\">".$lastname_error."</div>"; } ?> <?php if(isset($lastname_error)) { echo "<div class=\"small error\">".$lastname_error."</div>"; } ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Callsign</label> <label>Callsign</label>
<input class="form-control" type="text" name="user_callsign" value="<?php if(isset($user_callsign)) { echo $user_callsign; } ?>" /> <input class="form-control" type="text" name="user_callsign" value="<?php if(isset($user_callsign)) { echo $user_callsign; } ?>" />
<?php if(isset($callsign_error)) { echo "<div class=\"small error\">".$callsign_error."</div>"; } ?> <?php if(isset($callsign_error)) { echo "<div class=\"small error\">".$callsign_error."</div>"; } ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Locator</label> <label>Locator</label>
<input class="form-control" type="text" name="user_locator" value="<?php if(isset($user_locator)) { echo $user_locator; } ?>" /> <input class="form-control" type="text" name="user_locator" value="<?php if(isset($user_locator)) { echo $user_locator; } ?>" />
<?php if(isset($locator_error)) { echo "<div class=\"small error\">".$locator_error."</div>"; } ?> <?php if(isset($locator_error)) { echo "<div class=\"small error\">".$locator_error."</div>"; } ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Timezone</label> <label>Timezone</label>
<?php <?php
if(!isset($user_timezone)) { $user_timezone = 0; } if(!isset($user_timezone)) { $user_timezone = 0; }
echo form_dropdown('user_timezone', $timezones, $user_timezone); echo form_dropdown('user_timezone', $timezones, $user_timezone);
?> ?>
</div> </div>
<div class="form-group">
<label for="SelectDateFormat">Date Format</label>
<select name="user_date_format" class="custom-select" id="SelectDateFormat" aria-describedby="SelectDateFormatHelp">
<option value="d/m/y"><?php echo date('d/m/y'); ?></option>
<option value="d/m/Y"><?php echo date('d/m/Y'); ?></option>
<option value="m/d/y"><?php echo date('m/d/y'); ?></option>
<option value="m/d/Y"><?php echo date('m/d/Y'); ?></option>
<option value="d.m.Y"><?php echo date('d.m.Y'); ?></option>
<option value="Y-m-d"><?php echo date('Y-m-d'); ?></option>
</select>
<div class="form-group"> <small id="SelectDateFormatHelp" class="form-text text-muted">Select how you would like dates shown when logged into your account.</small>
<label for="SelectDateFormat">Date Format</label> </div>
<select name="user_date_format" class="custom-select" id="SelectDateFormat" aria-describedby="SelectDateFormatHelp">
<option value="d/m/y"><?php echo date('d/m/y'); ?></option>
<option value="d/m/Y"><?php echo date('d/m/Y'); ?></option>
<option value="m/d/y"><?php echo date('m/d/y'); ?></option>
<option value="m/d/Y"><?php echo date('m/d/Y'); ?></option>
<option value="d.m.Y"><?php echo date('d.m.Y'); ?></option>
<option value="Y-m-d"><?php echo date('Y-m-d'); ?></option>
</select>
<small id="SelectDateFormatHelp" class="form-text text-muted">Select how you would like dates shown when logged into your account.</small>
</div>
<div class="form-group"> <div class="form-group">
@ -108,8 +107,8 @@
<small id="user_measurement_base_Help" class="form-text text-muted">Choose which unit distances will be shown in.</small> <small id="user_measurement_base_Help" class="form-text text-muted">Choose which unit distances will be shown in.</small>
</div> </div>
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" /> <input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<button type="submit" class="btn btn-primary">Create Account</button> <button type="submit" class="btn btn-primary">Create Account</button>
</form> </form>
</div> </div>
</div> </div>