<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../window/dhtmlwindow.css" type="text/css" />
<link rel="stylesheet" href="../window/modal.css" type="text/css" />

<!--jscript-->
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<script language="JavaScript" src="../jscript/confirm_exit.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script> 

<script type="text/javascript" src="../window/dhtmlwindow.js"></script>
<script type="text/javascript" src="../window/modal.js"></script>
<script language="JavaScript" src="../jscript/show_hide_layers.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>
 
<script type="text/javascript" src="../jscript/jquery.1.4.2.js"></script>
<script language="JavaScript" src="../jscript/no_spaces.js"  type="text/javascript"></script> 
<?php
include('../include/session.php');
$e = $_GET['e'];
?>
</head>



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

if ($permission_num==1) {
	include ("../navigation/admin_sidebar.php");
?>
<body onload="<?php if ($e==1) { ?>alertMessage(1, 'User name already exists', 'User name already exists');<?php } ?>">
<div class="main_frame">

  <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>
<div class="page_middle_frame">  
  
    <div class="page_inside_frame">
        <form id="form1" name="form1" method="get" action="save_user.php">
          <br />
          <table width="624" border="0" cellspacing="0" cellpadding="0">
            <tr >
              <td height="40" colspan="3" align="left"><label class="label_std">Enter a user name and password for the new user.</label></td>
              </tr>
            <tr>
              <td width="130" height="40" align="left" ><label class="label_std">user name:<br /></label></td>
              <td width="195" ><input name="user_name_text" type="text" class="text150" id="user_name_text" onKeyUp="nospaces(this); ToLower(this)" />
                <br /></td>
              <td width="299" >(min 6 characters, no capital, no spaces)</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="nospaces(this); ToLower(this)"/></td>
              <td >(min 6 characters, no capital, no spaces, not the same as user name)</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="nospaces(this); ToLower(this)"/></td>
              <td >(copy of the password above)</td>
              </tr>
            <tr>
              <td colspan="3" 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?date=0');"/></td>
              </tr>
            </table>
         
        </form>
        
        <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("user_name_text","req","- a user name.");
  frmvalidator.addValidation("user_name_text","minlen=6","- mininum length for a user name is 6 characters.");
  frmvalidator.addValidation("user_password_text","req","- a password.");
  frmvalidator.addValidation("user_password_text2","req","- confirm 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","- password should not be same as user name");
  </script>
      </div>
      <br />
<br />


   
</div>
</div>


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

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

</body>
</html>