<?php
include_once("include/db_connection.php");
session_start();
if($_SESSION["adminloggedIn"] == FALSE){
header("Location:admin_login.php");
exit;
}
include_once("config_admin.php");
checkLoggedIn("yes");
include('header.php');
include('left1.php');
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>create associates</title>
<meta name="keywords" content="" />
<meta name="Premium Series" content="" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />
<script language="JavaScript" src="gen_validatorv31.js" type="text/javascript"></script>
<title>Untitled Document</title>
</head>
<body>
<div id="wrapper">
<!-- start page -->
<div id="page">
<!-- start content -->
<div id="prtCnt" align="center">
<div id="content" align="center">
<div class="post">
<h2 class="title"> </h2>
<div class="entry">
<?php
include_once("config_admin.php");
if(isset($_POST['EventAssociate']))
{
$EventAssociate = $_POST['EventAssociate'];
$Password = $_POST['Password'];
$query = "INSERT INTO users(`UserName`, `Password`,`Type`) VALUES ('$EventAssociate', '$Password','1')";
$result = mysql_query($query);
if($result){
echo "EventAssociate successfully added!!";?>
<script type="text/javascript">
<!--
window.location = "admin_assignEventsToAssociate.php<?php echo "?EventAssociate="."$EventAssociate" ;?>";
//-->
</script>
<?php
}
else{
?>
<script type="text/javascript">
<!--
window.location = "erroradmin.php?error=<?php echo "associate could not be added as associate with the username already exists" ;?>";
//-->
</script>
<?php
}
}
?>
<table width="424" border="0">
<tr>
<td width="68" height="260" class="matter"><?php $query= "SELECT * FROM users "; $result=@mysql_query($query) or die(" checkPass fatal error: ".mysql_error());
// Check exactly one row is found:
//for($i=1;$i<=mysql_num_rows($result);$i++)
//{
//$row=mysql_fetch_array($result);
//echo $row[1]."<br>";
//}?> </td>
<td width="346" >
<form id="form2" name="createEventAssociate" method="post" action="<?php print $_SERVER["PHP_SELF"]; ?>">
<span class="style1">Associate Name</span>
<p>
<label for="UserName"> <input name="EventAssociate" type="text" size="45" maxlength="45" /></label>
</p>
<p> </p>
<span class="style1">Password</span>
<p><label for="Password"> <input name="Password" type="Password" size="45" maxlength="45" /></label>
</p>
<p> </p>
<p>
<label for="submit"></label>
</p>
<div align="right"></div><p align="right"><input type="submit" name="submit" id="submit" value="Submit" />
</p>
</form>
</table>
</p>
</div>
</div>
</div>
</div>
<!-- end content -->
<!-- start sidebars -->
<!-- end sidebars -->
<div style="clear: both;"> </div>
</div>
<!-- end page -->
</div>
</body>
</html>
<script language="JavaScript" type="text/javascript">
var frmvalidator = new Validator("createEventAssociate");
frmvalidator.addValidation("EventAssociate","req","Please enter EventAssociate");
frmvalidator.addValidation("EventAssociate","maxlen=45","Max length for EventAssociate name is 45");
frmvalidator.addValidation("EventAssociate","alpha_s");
frmvalidator.addValidation("Password","req","Please enter Password");
frmvalidator.addValidation("Password","maxlen=45","Max length for Password is 45");
</script>
<?php
include('footer.php');
?>