<?
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();mysql_query("SET NAMES 'utf8'");
   
   
  
   	if($_GET['del']){
		
		   $del_query=mysql_query("delete from discount_mail 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.com | Admin Controls</title>
<link href="index.css" rel="stylesheet" type="text/css" />

<script language="JavaScript" src="../js/common.js"></script>
<script language="JavaScript">
function veiwmem(id){
			window.open('view_user.php?id='+id,'','width=800,height=800,top=5,left=180');		
	}	
	</script>
<style type="text/css">
<!--
.style1 {color: #093A9C}
.style2 {color: #FE6905}
-->
</style>
</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:800px">
<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">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="20%"><strong>Discount List</strong> </td>
                      <td width="54%">&nbsp;</td>
                      <td width="26%" align="right"><a href="bid_discount.php" class="link5">Add Discount Bid</a>
					  </td>
                    </tr>
                  </table></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>  		  		  		             
	
                   <form action="" method="post" enctype="multipart/form-data" name="form1"> 
                    <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">ID</font></strong></td>
                        <td width="11%" >&nbsp;&nbsp;<strong><font color="#FFFFFF">UserImage</font></strong></td>
                        <td width="11%" >&nbsp;&nbsp;<strong><font color="#FFFFFF">Username</font></strong></td>
                        
                        <td width="25%" ><strong><font color="#FFFFFF"> Discount(%)</font></strong></td>
                        <td width="26%" height="21" align="center"><font color="#FFFFFF"><strong>Status</strong>&nbsp;&nbsp;  </font></td>
                        <td width="9%" height="21" align="center"><strong><font color="#FFFFFF">Delete</font></strong></td>
                      </tr>
					  
					  <?
					  
					  $i=1;
					  $sel_query=mysql_query(dopaging("select * from discount_mail",20)) or die(mysql_error());
					  
                      while($myrow=mysql_fetch_array($sel_query)){  ?>
                      <tr <?php /*?><? if($i%2==0)echo 'bgcolor="#E6E4E3"';?><?php */?> onMouseOver="this.style.backgroundColor='#FFECBF'" onMouseOut="this.style.backgroundColor='#ffffff'"> 
					  <td  align="center"> <?=$i?></td>
                      <td > <?=get_user_image_admin(get_fieldval(id,image,user,$myrow['uid']),50,50)?></td>	
                              
                        <td >&nbsp;&nbsp;
						<a class="link5" style="font-size:12px;"  href="javascript:veiwmem(<?=$myrow['uid']?>)" title="Click To View User Information" ><?=get_fieldval(id,uname,user,$myrow['uid'])?></a></td>
                       
                        <td style="padding-left:5px;"><?=$myrow['discount'];?></td>
                        <td >&nbsp;&nbsp;&nbsp;&nbsp;
						<?
						if($myrow['status']=='1')
						{
						echo "Already Used";
						}
						else
						
						   {
						   echo "Still Not Used";
						   }	
						
						?>
						</td>
                      
                       
						  
						  
          <td><a href="bid_disc.php?del=<?=$myrow['id']?>"  onClick="return confirm('Are you sure to delete this User ?');"><img src="../images/category/imgdelete.gif" border="0"></a>
                        </td>
                      </tr>
                      <? $i++;
									} if(rightpaging())?>
				<tr><td colspan=6 align=center><br><?=rightpaging()?></td></tr>
                    </table>
                 
      </form>
          <td width="19" valign="top" background="img/tbl-right04.gif"><img src="img/tbl-right04.gif" width="19" height="9"></td>
        
      </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> 

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