<?
ob_start();
session_start();

 	include("../include/db.inc.php"); 
	include("../include/bit_functions.inc.php");
 	include("../include/pager.php");	

   $db1=new db;
   $db1->open();
    mysql_query("SET NAMES 'utf8'");
   
   mysql_query("SET NAMES 'utf8'");
   if($_SESSION['uname']=='' || $_SESSION['pwd']=='')
		{
			header("location:login.php");
		}
		 
  if(isset($_GET['status'])) {
	$status=$_GET['status'];
	
	if ($status=='1')
	   $status='0';
	else
	   $status='1';   
	 $id = $_GET['id'];
	 $qu="Update auction_type set status='$status' where id=$id "; 
	mysql_query($qu);
	header("location:auction_increment.php");
	exit();
	} 
	 
     
		if($_GET['del']){  
		
		   $del_query=mysql_query("delete from auction_type where id=".$_GET['del']);
			
		}
		
		
	
	$select="select  * from auction_type ";
	$sel_query=mysql_query(dopaging($select,20));
  $tot=mysql_num_rows($sel_query);
  ?>


<!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" />

</head>
<body>
<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"><br />
<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="40%"><strong>VIEW AUCTION TYPE INCREMENT</strong> </td>
                      <td width="34%">&nbsp;</td>
                      <td width="26%" align="right">
					  <a href="price_time_increment.php" class="link5">Add auction increment</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" valign="top" background="img/tbl-left04.gif"><img 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" bgcolor="#FFFFFF" style="border-collapse:collapse; border-color:#FED267">
                            <tr bgcolor="#FED267"> 
							<td width="50"  ><strong><font color="#FFFFFF" size="+1">S.No.</font></strong></td>
                                <td width="137" ><strong><font color="#FFFFFF" size="+1">No of Bids</font></strong></td>
                              <td width="42"  ><strong><font color="#FFFFFF" size="+1"><?=symbol_currency()?> Increase</font></strong></td>
							   <td width="42" align="center"><strong><font color="#FFFFFF" size="+1">Time Increase(sec)</font></strong></td>
                              <td width="61" align="center"><strong><font color="#FFFFFF" size="+1">Type of Auction</font></strong></td>
							   <td width="61" align="center"><strong><font color="#FFFFFF" size="+1">Status</font></strong></td>
								<td width="62"height="20" align="center"><strong><font color="#FFFFFF" size="+1">Edit</font></strong></td>
                              <td width="74" height="20" align="center"><strong><font color="#FFFFFF" size="+1">Delete</font></strong></td>
							  
                            </tr>
							<?  
								$i=1;	
							
                         while($myrow=mysql_fetch_array($sel_query)){  ?>
                            <tr onMouseOver="this.style.backgroundColor='#FFECBF'" onMouseOut="this.style.backgroundColor='#ffffff'"> 
							 <td ><?=$i;?></td>
                              <td class="normaltextblack" align="center"><?=$myrow['range_min'];?> - <?=$myrow['range_max'];?></td>
                             
                              <td ><?=$myrow['price_increment'];?>p</td>
                              
                              <td ><?=$myrow['time_increment'];?></td>
							   <td align="center"> 
                                
                             <? 
			$type= mysql_fetch_array(mysql_query("select auction_type from t123go_auctiontype where type_id='".$myrow['auction_type']."'")); 
                             echo $type[0];
						
						?>
                        </td>
                              
                              <td align="center"> 
                                 <? //echo mkchkbox('st'.$i,'status[]',$myrow['status'],$myrow['pid']);?>
                             <?  
                               if ($myrow['status']=='1')
						    {
							 ?>
							 <a href="auction_increment.php?status=<?=$myrow['status'];?>&id=<?=$myrow['id']?>">
							on</a>
                             <?
							}
						else
						   {
						   ?>
							 <a href="auction_increment.php?status=<?=$myrow['status'];?>&id=<?=$myrow['id']?>">
							 off</a>
                             <?
						   }	
						
						?>
                        </td>
								<td align="center" >
								<a href="price_time_increment.php?edit=<?=$myrow['id']?>" class="link5" title="Click To Edit">Edit</a>
								  
                              </td>
                              <td align="center">
                           <a href="auction_increment.php?del=<?=$myrow['id']?>" onClick="return confirm('Are you sure to delete this auction increment ?');"><img src="../images/category/imgdelete.gif" border="0"></a>
                            </td>
                            </tr>
                                <?
				$i++;
			}	// end of while loop
		
			if(rightpaging()){	// if there are more than one pages then only display paging
		?>
				<tr>
					<td colspan="9" align="center"><br><? echo rightpaging(); ?></td>
				</tr>
		<?
			}	// end of paging display
		?>
                          </table>
					  
</form>
<!--<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr bgcolor="#FFCA95"> 
    <td align="center" bgcolor="#C6E2FF"> </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>
     
     
     
      
            <br />
<br />

</div></div>
<div class="bottom_links_show"><? include("footer.php");	?></div>

</html>
</div>
</body>
</html>
