<?
ob_start();
session_start();
if($_SESSION['uname']=='' || $_SESSION['pwd']=='')
		{
			header("location:login.php");
		}
 include("../include/db.inc.php");
 include("../include/pager.php"); 
 include("../include/bit_functions.inc.php");
   $db1=new db;
   $db1->open();
    
   
   
   if(isset($_GET['block']))
{
$block=$_GET['block'];


$aid=$_GET['aid'];
$sql="update admin set block='$block' where id='$aid'";
mysql_query($sql);
header("location:subadmin.php");
exit();
}
   	if($_GET['del'])
	{
		
		   $del_query=mysql_query("delete from admin where id=".$_GET['del']);
			
	}
		
		
	

?>

<!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" />
<title>Money Auctions | Admin Controls</title>
<link href="index.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
function veiwmem(id){
			window.open('view_user.php?id='+id,'','width=800,height=800,top=5,left=180');		
	}	
	</script>

</head>
<body bgcolor="#ffffff">
<div class="admin_wrapper">
<div class="logo_show"><? include("minorlogout.php");?></div>
<div style="float:left; width:200px">
<div class="topg_links_show"><? include("left.php");	?></div>
<div class="top_links_show"><? include("belowleft1.php");	?></div></div>
<div style="float:left; width:900px">
<div class="maximum">
<table  width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
  <tr> 
    <td width="15" valign="top">&nbsp;</td>
          <td valign="top"><br> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
        <tr> 
          <td width="33" valign="top"><img src="img/03.gif" width="33" height="23"></td>
                  
                <td background="img/bg01.gif"><strong>SUBADMIN LIST</strong></td>
				<td background="img/bg01.gif" ><a href="admin_type.php">Sub Admin Type</a></td>
				<td background="img/bg01.gif" align="right"><a href="addsubadmin.php">Make Subadmin USer</a></td>
          <td width="35"><img src="img/04.gif" width="35" height="23"></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
        <tr> 
          <td width="22" height="185" valign="top" background="img/tbl-left04.gif">
          <img border='0' src="img/tbl-left04.gif" width="22" height="13"></td>
          <td valign="top" align="center"><br>		  		  		             
	
                    <table width="100%" border="1" cellspacing="1" cellpadding="1" style="border-collapse:collapse; border-color:#FED267">
                      <tr bgcolor="#FED267"> 
					   <td width="4%"  align="center"><strong><font color="#FFFFFF">S.No.</font></strong></td>
                        <td width="21%" >&nbsp;&nbsp;<strong><font color="#FFFFFF">Subadmin Name</font></strong></td>
                        <td width="12%" ><strong><font color="#FFFFFF">Email</font></strong></td>
                        <td width="14%" ><strong><font color="#FFFFFF">Type</font></strong></td>
                        <td width="12%" ><strong><font color="#FFFFFF">Edit | Delete</font></strong></td>
                        <td width="16%" height="21" align="center"><font color="#FFFFFF"><strong>Block</strong>&nbsp;&nbsp;</font></td>
                      </tr>
					  
					  <?
					  $limit=20;
					  $i=getStart($limit);	
					  $sel_query=mysql_query(dopaging("select * from admin where type != 'superadmin'",$limit)) or die(mysql_error());
                      while($myrow=mysql_fetch_array($sel_query)){ 
					  $i++;
					   ?>
                      <tr onMouseOver="this.style.backgroundColor='#FFECBF'" onMouseOut="this.style.backgroundColor='#ffffff'"> 
					  <td  align="center"><?=$i;?></td>
                        <td ><?=$myrow['uname']?></a></td>
                        <td style="padding-left:5px;"><?=$myrow['email'];?></td>
                        <td style="padding-left:5px;"><?=$myrow['type'];?></td>
                        <td style="padding-left:5px;">
						<a href="addsubadmin.php?edit=<?=$myrow['id']?>">Edit </a> | <a href="subadmin.php?del=<?=$myrow['id']?>"  onClick="return confirm('Are you sure to delete this User ?');">Delete</a>
                        </td>
                        <td >&nbsp;&nbsp;&nbsp;&nbsp;
						<?
						if($myrow['block']=='0')
						{
						?>
		<a href="subadmin.php?block=1&aid=<?=$myrow['id']?>">
		<input  name="chk[]" type="checkbox" checked  >
        </a>
		                 <?
                            }
						else
						
						   {
						   ?>
		<a href="subadmin.php?block=0&aid=<?=$myrow['id']?>">
        <input  name="chk[]" type="checkbox"   >
		</a>
                             <?
						   }	
						
						?>
						</td>
                      
                      </tr>
                      <? 
									} if(rightpaging())?>
				<tr><td colspan=6 align=center><br><?=rightpaging()?></td></tr>
                    </table>
      </td>
          <td width="19" valign="top" background="img/tbl-right04.gif"><img src="img/tbl-right04.gif" width="19" height="9"></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bodytxt">
              <tr> 
                <td width="33"><img src="img/tbl-bot01.gif" width="33" height="12"></td>
                <td  width="709" align="right" background="img/tbl-bg.gif"></td>
                <td width="33"><img src="img/tbl-right05.gif" width="35" height="12"></td>
              </tr>
            </table>
      </td>
  </tr>
  </table>


<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::center ends:::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::footer starts:::::::::::::::::::::::::::::::::::::::::::::::::::::-->
</div></div>
<div class="bottom_links_show"><? include("footer.php");	?></div>
</div>
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::footer ends:::::::::::::::::::::::::::::::::::::::::::::::::::::-->
</body>
</html>
