<?php session_start();  //Developed by ITechScripts
error_reporting(0);
?>
>
<style type="text/css">
<!--
.style1 {
	color: #666666;
	font-weight: bold;
}
.style3 {color: #666666; font-size: 11px; font-family:Arial, Helvetica, sans-serif}
-->
</style><?php
require 'include/configurations.php'; // ITECHBIDS Configuration File
require 'include/header.php';
if(isset($_REQUEST['memberlevel_modify']))
{
$total=$_REQUEST[total_records];
for($i=1;$i<=$total;$i++)
{
 $records_id="records_id".$i;
 $score=$_REQUEST["score".$i];
 $records_id=$_REQUEST[$records_id];
 $query="update auction_duration set duration='$score' where duration_id= $records_id";
 $upquery=mysql_query($query);
}
}
elseif(isset($_REQUEST['memberlevel_delete']))
{
$total=$_REQUEST[total_records];
for($i=1;$i<=$total;$i++)
{
 $records_id="records_id".$i;
 $records_id=$_REQUEST[$records_id];
 $memberlevel_del=$_REQUEST["memberlevel_del".$i];
if($memberlevel_del=="0")
{
 $del="delete from auction_duration where duration_id='$records_id'";
 $delsql=mysql_query($del);
}
}
}
elseif(isset($_REQUEST['memberlevel_add']))
{
$score=$_REQUEST['score'];
$in="insert into auction_duration(duration)values($score)";
$insql=mysql_query($in);
}

	
	
	
?>

<form  action="<? $_SERVER['PHP_SELF']?>" method="post" name="frm13">
<table border="0" align="center" cellpadding="5" cellspacing="2" width="600" class="ft">
<tr class="ct" height="25">
<td colspan="4"> Auction Duration Settings</td>
</tr>
<?
$auction_query="select * from auction_duration";
$table=mysql_query($auction_query);
$total=mysql_num_rows($table);
$i=1;
?>
<tr height="25">
  <td colspan="2"><strong>Duration(Days) </strong></td>
  <td align="center"> Delete</td>
</tr>
<?
while($row=mysql_fetch_array($table))
{
?>
<input type="hidden" name="records_id<?= $i ?>" value="<?= $row['duration_id'] ?>" />
	 <tr >
	 
     <td width="25%" colspan="2">
	 
	 <input class="smalltxt" type="text" class="bluetext"name="score<?= $i ?>" value="<?= $row['duration'] ?>" >  &nbsp;(Days) </td>
	 
     <td width="25%" align="center"> 
	 <input type="checkbox" name="memberlevel_del<?= $i++ ?>" value="0">
	 </td>
     </tr>
<?
 }
?>
<tr  >
<td align="center" colspan="2">
<input type="hidden" name="total_records" value="<?= $total?>" />
<input type="submit" class="button"   value=" Modify " name="memberlevel_modify" ></td>
<td align="center"><input type="submit" class="button"   value=" Delete " name="memberlevel_delete" ></td>
</tr>
     <tr   >
     <td width="25%" colspan="2"><input  class="smalltxt" type="text" class="bluetext"name="score" >&nbsp;(Days)</td>
	 <td width="25%" align="center">
	 <input type="submit" class="button"   value=" Add " name="memberlevel_add" ></td>
	 </tr> 
</table>
</form>
<br>
<script language="javascript">
function checkpermission(val,tot)
{
//alert('hai');
//alert(tot);
//alert(document.forms[0].elements.length);
var coun=document.forms[0].elements.length;
	for(i=0;i<coun;i++)
	{
		if(val=="yes")
		{
			if(document.forms[0].elements[i].type=="text")
			{
				document.forms[0].elements[i].disabled=true;
			}
		}
		if(val=="no")
		{
			if(document.forms[0].elements[i].type=="text")
			{
				document.forms[0].elements[i].disabled=false;
			}
		}
	}

}

</script>
<?
require 'include/footer.php';
?>