<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<?php

include ("../navigation/header.php");
$page_name = "AD-new user";
include ("../navigation/access.php");

$s=1;
$e = $_GET["e"];


?>

<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script> 
<script language="JavaScript" src="../jscript/show_hide_layers.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/confirm_exit.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/no_spaces.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/lower_case.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/alert_message.js"  type="text/javascript"></script>
</head>

<?php 
if ($permission_num==1) {
	include ("../navigation/admin_sidebar.php");
?>

<body  onload="<?php if ($e==2) { ?> alertMessage(1, '', 'The user was already registered and not added to the system.<br><br>You can try again with a different user name.'); <?php } ?>" >
<div class="main_frame">
<table id="tableMain" > <!--begin of tableMain-->
    <tr>
      <td width="830" height="125" valign="top" >
  <div class="page_head_frame">
    <table width="809" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="385"><label class="label_page_head">New user</label></td>
        <td align="right">&nbsp;</td>
      </tr>
    </table>
  </div>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table width="800" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="right" valign="top">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" valign="top">
      <div class="page_middle_frame">
      <?php if ($s==1) { ?> <div class="page_inside_frame">
        <form id="form1" name="form1" method="get" action="save_user.php">
          <br />
          <table width="300" border="0" cellspacing="0" cellpadding="0">
            <tr >
              <td height="40" colspan="2" align="left"><label class="label_std">Enter a user name and password for the new user.</label></td>
              </tr>
            <tr>
              <td width="127" height="40" align="left" ><label class="label_std">user name:<br /></label></td>
              <td width="173" ><input name="user_name_text" type="text" class="text150" id="user_name_text" onkeyup="ToLower(this); nospaces(this)"/>
                <br /></td>
              </tr>
            <tr>
              <td height="40" align="left" ><label class="label_std">password:<br /></label></td>
              <td ><input name="user_password_text" type="password" class="text150" id="user_password_text" onkeyup="ToLower(this); nospaces(this)"/></td>
              </tr>
            <tr>
              <td height="40" align="left" ><label class="label_std">confirm password: &nbsp;</label><br /></td>
              <td ><input name="user_password_text2" type="password" class="text150" id="user_password_text2" onkeyup="ToLower(this); nospaces(this)" /></td>
              </tr>
            <tr>
              <td colspan="2" align="center"><br />
                <br />
                <input name="button" type="submit" class="imagebutton" id="button" value="Add new user" onClick="needToConfirm = false; "/>
                <input name="button2" type="reset" class="imagebutton" id="button2" value="Cancel" onclick="cancel_confirmation(3, '../admin_module/user_list.php');"/></td>
              </tr>
            </table>
         
        </form>
        </div>
        <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("user_name_text","req","- user name.");
  frmvalidator.addValidation("user_name_text","minlen=5","- mininum length for a user name is 5 characters.");
  frmvalidator.addValidation("user_password_text","req","- password.");
  frmvalidator.addValidation("user_password_text2","req","- re-type the password.");
  frmvalidator.addValidation("user_password_text","minlen=6","- mininum length for a password is 6 characters.");
  frmvalidator.addValidation("user_password_text","eqelmnt=user_password_text2","- confirmed password is not same as password");
  frmvalidator.addValidation("user_password_text","neelmnt=user_name_text","- the password should not be same as user name");
  </script>
      </div>
      <?php } ?><br />
<br />

  
   </td>
      </tr>
  </table>
  </td> 
      <!--center of tableMain-->
</tr>
<tr>
<td> <!--center of tableMain-->


  <p>&nbsp;</p>
</td>
</tr>
</table>  <!--end of tableMain-->  
</div>


<?php include ('../navigation/side_bar.php'); ?>
</body>

<?php } else {
$_SESSION['denied_return'] = "admin_module/user_list.php";	
include ("../navigation/admin_sidebar.php");
include ('../navigation/side_bar.php');
?>
	<body onload="needToConfirm = false; accessdenied(); return false">
	</body>
<?php }
?>
</html>