<? ob_start();
session_start();
require_once("../dbconnect.php");
?>
<!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=iso-8859-1" />
<?php include_once("title.php");?>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="ajaxvalid.js"></script>

<style type="text/css">
<!--
.style2 {
	color: #21262A;
	font-size: 12px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><? require_once("header.php"); ?></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="30" class="cate_pro">Admin Settings</td>
                    <td>&nbsp;</td>
                    <td class="index_text" align="right">&nbsp;</td>
                    <td width="20">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="72%" valign="top" style="padding-right:1px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="35" colspan="5"><table border="0" cellpadding="2" cellspacing="0" width="100%">
                          <tr class="dataTableHeadingRow">
                            <td width="148" align="left" bgcolor="#D7D6CC" class="dataTableHeadingContent">ID</td>
                            <td width="114" align="left" bgcolor="#D7D6CC" class="dataTableHeadingContent">Admins Name</td>
                            <td width="46" align="left" bgcolor="#D7D6CC" class="dataTableHeadingContent">&nbsp;</td>
                            <td width="64" align="left" bgcolor="#D7D6CC" class="dataTableHeadingContent">&nbsp;</td>
                            <td width="172" align="left" bgcolor="#D7D6CC" class="dataTableHeadingContent">Email</td>
                            <td width="23" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent">&nbsp;</td>
                            <td width="96" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent">Action&nbsp;</td>
                          </tr>
                          <? 
			$sql="Select * from admin"; 
			$sqlexe=mysql_query($sql);
										
			while($admin=mysql_fetch_array($sqlexe))
		      {
					 ?>
						  
                      
                          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
                            <td width="148" height="30" align="ledt" class="dataTableContent" >
							<?php echo $admin['admin_id'] ?></td>
                            <td align="left" class="dataTableContent">
						<?php echo $admin['username'] ?>	</td>
                            <td align="left" class="dataTableContent">&nbsp;</td>
                            <td class="dataTableContent" align="left">&nbsp;</td>
                            <td class="dataTableContent" align="left"><?php echo $admin['email'] ?>&nbsp;</td>
                            <td class="dataTableContent" align="center">&nbsp;</td>
                            <td class="dataTableContent" align="center">	
                <a href="adminsettings.php?edit=edit&admid=<? echo $admin['admin_id']; ?>">
		<img src="images/icon_edit.gif" alt="Edit" title="Edit" border="0" style="padding-left:5px; padding-right:5px;" />		</a> 
		<a href="adminsettings.php?reset=reset&adminid=<? echo $admin['admin_id']; ?>" >
	<img src="images/icon_reset.gif"  title="Reset Password" border="0" style="padding-left:5px; padding-right:5px;" />	</a></td>
                          </tr>
                         
                          <? } ?>
                        </table></td>
                      </tr>
                      <tr>
                        <td width="22%" height="35">&nbsp;</td>
                        <td width="16%" align="center"></td>
                        <td width="16%" align="center"></td>
                        <td width="23%">&nbsp;</td>
                        <td width="23%">&nbsp;</td>
                      </tr>
                    </table></td>
                    <td width="28%" valign="top">
                    
                    <? if($_GET['edit']=="edit")
					{
		$sql1="Select * from admin where admin_id=".$_GET['admid']; 
			$sqlexe1=mysql_query($sql1);
			$admin1=mysql_fetch_array($sqlexe1);
						
						?>
                       <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">
             <form method="post" name="frm" action="custmerinsert.php?action=adminsettings" enctype="multipart/form-data" onsubmit="return changepass(this);">
                        <tr>
                          <td height="17" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent">Edit</td>
                        </tr>
                        <tr>
                          <td align="center" style="padding-left:5px;"><strong>Please make any necessary changes</strong></td>
                        </tr>
                        <tr>
                          <td align="left"><strong><span id="errorMessage9"></span></strong>&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="20" align="left">User  Name:</td>
                        </tr>
                        <tr>
                          <td align="left">
 <input name="adminname" type="text" class="admin" id="adminname" value="<? echo $admin1['username'];?>" size="22" />
 <input type="hidden" name="admid" value="<? echo $admin1['admin_id']; ?>" />
                      </td>
                        </tr>
                        <tr>
                          <td align="left"><?php if($_GET['up'])
				  {
				  echo "<font color=#FF0000>";
				     echo 'sdsad';
					  echo "</font>";
					 
					 } ?>&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">Email:</td>
                        </tr>
                        <tr>
                          <td align="left">
				<input name="email" type="text" class="admin"  value="<? echo $admin1['email'];?>" size="22"/></td>
                        </tr>
                        <tr>
                          <td align="center">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left" style="padding-left:20px;">
                          <input name="image" type="image" src="images/button_save.gif" width="65" height="22" />
                         	<a href="adminsettings.php"><img src="images/button_cancel.gif" border="o"/></a>	
                         </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr>
                    	</form>
                    </table>
                    <? } else if($_GET['up']=="up")
					{?>
                    
                    
                      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">
             <form method="post" name="frm" action="custmerinsert.php?action=adminsettings" enctype="multipart/form-data" onsubmit="return validate(this);">
                        <tr>
                          <td height="17" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent"><span class="style2">successfully</span></td>
                        </tr>
                        <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="20" align="center"><span class="style2"><img src="images/tick.gif" />successfully modified.</span>&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="center">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left" style="padding-left:20px;">&nbsp;</td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr>
                    	</form>
                    </table>
                    <? } 
					
					 else if($_GET['reset']=="reset"){ 
					 $QUERYADMIN="Select * from admin where admin_id=".$_GET['adminid'];
					  $EXEADMIN=mysql_query($QUERYADMIN);
			         $ROWADMIN=mysql_fetch_array($EXEADMIN); 
					
					   ?>
					
					
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">
             <form method="post" name="frm" action="custmerinsert.php?action=password" enctype="multipart/form-data" onsubmit="return password(this);">
                        <tr>
                          <td height="17" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent">Reset Password</td>
                        </tr>
                        <tr>
                          <td align="center" style="padding-left:5px;"><strong>Please make any necessary changes</strong></td>
                        </tr>
                        <tr>
                          <td align="left"><strong><span id="errorMessage10"></span></strong></td>
                        </tr>
                        <tr>
                          <td height="21" align="left">Password:</strong> <? echo $ROWADMIN['password']; ?></td>
                        </tr>
						 <tr>
                          <td align="left"><strong><span id="errorMessage9"></span></strong> </td>
                        </tr>
                        <tr>
                          <td align="left">New Password:                      </td>
                        </tr>
                        <tr>
                          <td align="left"><input type="password" name="new_password" value="" id="new_password">
						  <input type="hidden" name="admid" value="<? echo $ROWADMIN['admin_id']; ?>" />
						  </td>
                        </tr>
                        <tr>
                          <td align="left">Confirm Password:				</td>
                        </tr>
                        <tr>
                          <td align="left"><input type="password" name="conpassword" id="conpassword" value="" /></td>
                        </tr>
						   <tr>
                          <td align="left"></td>
                        </tr>
                        <tr>
                          <td align="left" style="padding-left:20px;">
                          <input type="submit" name="submit" value="submit" />
                         	
                         </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr>
                    	</form>
                    </table>	
					  <? } else if($_GET['cp']=="cp")
					{?>
					
					
					<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">
             <form method="post" name="frm" action="custmerinsert.php?action=adminsettings" enctype="multipart/form-data" onsubmit="return validate(this);">
                        <tr>
                          <td height="17" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent"><span class="style2">successfully</span></td>
                        </tr>
                        <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="20" align="center"><span class="style2"><img src="images/tick.gif" />Password changed Successfully.</span>&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="center">&nbsp;</td>
                        </tr>
                        <tr>
                          <td align="left" style="padding-left:20px;">&nbsp;</td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr>
                    	</form>
                    </table>
					
					
					<? } ?>
					
	 </td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><? require_once("footer.php"); ?></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
