<?
	include("connect.php");
	include("admin.config.inc.php");
	include("security.php");
	$type1 = "1";
	$type3 = "3";
	include("pagepermission.php");

	/*function getHours($aucstartdate,$aucenddate,$aucstarthour,$aucendhour,$aucstartmin,$aucendmin,$aucstartsec,$aucendsec)
		{
			$newstartdate = substr($aucstartdate,6)."-".substr($aucstartdate,3,2)."-".substr($aucstartdate,0,2);
			$newstarttime = $aucstarthour.":".$aucstartmin.":".$aucstartsec;

			$newenddate = substr($aucenddate,6)."-".substr($aucenddate,3,2)."-".substr($aucenddate,0,2);
			$newendtime = $aucendhour.":".$aucendmin.":".$aucendsec;
			
			$newstarttimestamp = strtotime($newstartdate." ".$newstarttime);
			$newendtimestamp = strtotime($newenddate." ".$newendtime);
			$finalsec = $newendtimestapm - $newstarttimestamp;
			return $finalsec;
		}*/
	
	$categoryID = $_REQUEST["category"];
	$productID = $_REQUEST["product"];
	$auc_start_price = $_REQUEST["aucstartprice"];
	//$auc_fixed_price = $_REQUEST["aucfixedprice"];
	//if($auc_fixed_price=="")
	//{
	//	$auc_fixed_price = 0;
	//}
	//if($_POST["startimmidiate"]!="")
	//{
	//	$auc_start_date_ex = explode("/",date("d/m/Y"));
	//}
	//else
	//{
	$auc_start_date_ex = explode("/",$_REQUEST["aucstartdate"]);
	//}
	
	$auc_start_date = $auc_start_date_ex[2]."-".$auc_start_date_ex[1]."-".$auc_start_date_ex[0];
	$auc_end_date_ex = explode("/",$_REQUEST["aucenddate"]);
	$auc_end_date =  $auc_end_date_ex[2]."-".$auc_end_date_ex[1]."-".$auc_end_date_ex[0];

	$aucstartdate = $_REQUEST["aucstartdate"];
	$aucenddate = $_REQUEST["aucenddate"];
	$aucstarthour = $_REQUEST["aucstarthours"];
	$aucendhour = $_REQUEST["aucendhours"];
	$aucstartmin = $_REQUEST["aucstartminutes"];
	$aucendmin = $_REQUEST["aucendminutes"];
	$aucstartsec = $_REQUEST["aucstartseconds"];
	$aucendsec = $_REQUEST["aucendseconds"]; 
	//if($_POST["startimmidiate"]!="")
	//{
	//	$auc_start_time = $_REQUEST["curtime"];
	//	$auctionsplittime = explode(":",$auc_start_time);
	//	$aucstarthour = $auctionsplittime[0];
	//	$aucstartmin = $auctionsplittime[1];
	//	$aucstartsec = $auctionsplittime[2];	
	//}
	//else
	//{
	$auc_start_time=$_REQUEST["aucstarthours"].":".$_REQUEST["aucstartminutes"].":".$_REQUEST["aucstartseconds"];
	//}
	$auc_end_time=$_REQUEST["aucendhours"].":".$_REQUEST["aucendminutes"].":".$_REQUEST["aucendseconds"];

	$newstarttime = strtotime($auc_start_date." ".$auc_start_time);
	$newendtime = strtotime($auc_end_date." ".$auc_end_time);

	$auc_status = $_REQUEST["aucstatus"];
	$auc_type = $_REQUEST["auctype"];
	$auc_recu = $_REQUEST["aucrec"];
	//$fpa = $_REQUEST["fpa"];
	//$pa = $_REQUEST["pa"];
	//$nba = $_REQUEST["nba"];
	//$off = $_REQUEST["off"];
	//$na = $_REQUEST["na"];
	//$oa = $_REQUEST["oa"];
	$duration = $_REQUEST["auctionduration"];
	
	$changesval = $_REQUEST['changestatusval'];
	$shippingmethod = $_REQUEST["shippingmethod"];
//	$auccode = $_REQUEST["auctioncode"];

	if($_POST["minimum_auction"]!="")
	{
		$minimumaucprice = $_POST["auctionminimumprice"];
		$minwinprice = $_POST["minwinprice"];
	}
	else
	{
		$minimumaucprice = "0.00";
		$minwinprice = "0.00";
	}
	if($_POST["is_hot"]!="")
	{
		$is_hot=1;
	}
	else{
	  $is_hot=0;
	}
	if($_POST["is_exprice"]!="")
	{
		$is_exprice=1;
	}
	else{
	  $is_exprice=0;
	}
	$showpoint = $_REQUEST["showpoint"]; 
	
	//$auc_due_time = getHours($aucstartdate,$aucenddate,$aucstarthour,$aucendhour,$aucstartmin,$aucendmin,$aucstartsec,$aucendsec);
	
	if($_REQUEST["addauction"]!="")
	{		
			$futuretstamp = mktime($aucstarthour,$aucstartmin,$aucstartsec,$auc_start_date_ex[1],$auc_start_date_ex[0],$auc_start_date_ex[2]);

		$qrycode = "select auction_code from auction where auction_code!='' order by auctionID desc limit 0,1";
		$rscode = mysql_query($qrycode);
		$totalcode = mysql_num_rows($rscode);
		$objcode = mysql_fetch_object($rscode);

		if($totalcode>0)
		{
			$str=substr($objcode->auction_code,1);
	
			$s=explode('0',$str);
			
			for($i=0;$i<2;$i++)
			{
				if($s[$i]=="")
				{
					$temp.="0";
				}
			}
			$auccode="S".$temp.($str+1);
		}
		else
		{
			$auccode = "S0001";
		}
		if($changesval=="1" && $auc_status=="2")
		{
			$auc_status = 1;
		}
		$auc_status=2;
		$qryins = "Insert into auction (categoryID,productID,auc_start_price,auc_final_price,auc_start_time,auc_end_time,auc_status,time_duration,auc_recurr,shipping_id,auction_code,future_tstamp,auction_min_price,min_win_price,is_hot,is_exprice,showpoint) values('$categoryID','$productID',$auc_start_price,'','$newstarttime','$newendtime','$auc_status','$duration','$auc_recu','$shippingmethod','$auccode','$futuretstamp','$minimumaucprice','".$minwinprice."',".$is_hot.",".$is_exprice.",$showpoint)";
		mysql_query($qryins) or die(mysql_error());
		$auctionID = mysql_insert_id();
		//if($auc_status==2)
		//{
			$qry = "Insert into auc_due_table (auction_id,auc_due_time,auc_due_price) values($auctionID,'$newendtime',$auc_start_price)";
			mysql_query($qry) or die(mysql_error());
		//}

		header("location: message.php?msg=14");
		exit;
	}
	
	if($_REQUEST["editauction"] && $_REQUEST["edit_auction"])
	{
		$futuretstamp = mktime($aucstarthour,$aucstartmin,$aucstartsec,$auc_start_date_ex[1],$auc_start_date_ex[0],$auc_start_date_ex[2]);
			
		/*if($changesval=="1")
		{
			$auc_status = 1;
		}	
		
		if($_REQUEST["aucstatus"]=="4")
		{
			$auc_status = 4;
		}*/
		
		$editid = $_REQUEST["edit_auction"];
		$userid = $_REQUEST["userid"];
		if($_REQUEST["auc_back_status"]=="3" and $userid==3)
		{
			//delete record from won_auctions and bid_account and 
			$delwonentry = "delete from won_auctions where userid='3' and auction_id='".$editid."'";
			mysql_query($delwonentry) or die(mysql_error());

			$delbidaccentry = "delete from bid_account where user_id='3' and auction_id='".$editid."'";
			mysql_query($delbidaccentry) or die(mysql_error());

			$delaucdueentry = "delete from auc_due_table where auction_id='".$editid."'";			
			mysql_query($delaucdueentry) or die(mysql_error());
			//end 
			$auc_due_time = getHours($aucstartdate,$aucenddate,$aucstarthour,$aucendhour,$aucstartmin,$aucendmin,$aucstartsec,$aucendsec);
			
		//if($auc_status==2)
		//{	
			$q = "select * from auc_due_table where auction_id=$editid";
			$r = mysql_query($q);
			$to = mysql_num_rows($r);
			
			if($to>0)
			{
				$qry = "update auc_due_table set auc_due_time=$newendtime, auc_due_price=$auc_start_price where auction_id=$editid";
			}
			else
			{	
				$qry = "Insert into auc_due_table(auction_id,auc_due_time,auc_due_price) values($editid,'$newendtime',$auc_start_price)";
			}
			mysql_query($qry) or die(mysql_error());
		//}
			//$auc_status=2;
			$qryupd = "update auction set categoryID='$categoryID', productID='$productID',auc_start_price='$auc_start_price',auc_start_time='$newstarttime', auc_end_time='$newendtime', auc_status='$auc_status', time_duration='$duration', auc_recurr='$auc_recu',buy_user='',auc_final_end_date='0000-00-00 00:00:00',auc_final_price='0',shipping_id='$shippingmethod',future_tstamp='$futuretstamp',auction_min_price='$minimumaucprice',min_win_price='$minwinprice' ,is_hot=$is_hot,is_exprice=$is_exprice ,showpoint=$showpoint where auctionID='$editid'";
			mysql_query($qryupd) or die(mysql_error());
			header("location: message.php?msg=15");
			exit;
		}
		else
		{
			if($_REQUEST["auc_back_status"]!=2)
			{
				$q = "select * from auc_due_table where auction_id=$editid";
				$r = mysql_query($q);
				$to = mysql_num_rows($r);
		
				//if($auc_status==2)
				//{
				//	$auc_due_time = getHours($aucstartdate,$aucenddate,$aucstarthour,$aucendhour,$aucstartmin,$aucendmin,$aucstartsec,$aucendsec);
		
					if($to>0)
					{
						$qry = "update auc_due_table set auc_due_time=$newendtime, auc_due_price=$auc_start_price where auction_id=$editid";
					}
					else
					{	
						$qry = "Insert into auc_due_table (auction_id,auc_due_time,auc_due_price) values($editid,'$newendtime',$auc_start_price)";
					}
				mysql_query($qry) or die(mysql_error());
				//}
			}
	
			$qryupd = "update auction set categoryID='$categoryID', productID='$productID',auc_start_price='$auc_start_price',auc_start_time='$newstarttime', auc_end_time='$newendtime', auc_status='$auc_status', time_duration='$duration', auc_recurr='$auc_recu',buy_user='',auc_final_end_date='0000-00-00 00:00:00',auc_final_price='0',shipping_id='$shippingmethod',future_tstamp='$futuretstamp',auction_min_price='$minimumaucprice',min_win_price='$minwinprice' ,is_hot=$is_hot,is_exprice=$is_exprice ,showpoint=$showpoint where auctionID='$editid'";
			mysql_query($qryupd) or die(mysql_error());
			header("location: message.php?msg=15");
			exit;
		}	
	}
	
	if($_REQUEST["delete_auction"])
	{
		$delid = $_REQUEST["delete_auction"];

		$qryseld = "select auc_start_time from auction where auctionID=".$delid;
		$resseld = mysql_query($qryseld);
		$totalrow = mysql_affected_rows();
		$del = mysql_fetch_object($resseld);
		if($del->auc_start_time < time())
		{
			header("location: message.php?msg=16");
			exit;
		}

		$qrydel = "delete from auction where auctionID='$delid'";
		mysql_query($qrydel) or dir(mysql_error());
		header("location: message.php?msg=13");
	}
	
	if($_REQUEST["auction_edit"]!="" or $_REQUEST["auction_delete"]!="" or $_REQUEST["auction_clone"])
	{
		if($_REQUEST["auction_edit"]!=""){$aid=$_REQUEST["auction_edit"];}
		if($_REQUEST["auction_delete"]!=""){$aid=$_REQUEST["auction_delete"];}
		if($_REQUEST["auction_clone"]!=""){$aid=$_REQUEST["auction_clone"];}
		$qrys = "select * from auction a left join products p on a.productID=p.productID where auctionID=".$aid;
		$ress = mysql_query($qrys);
		$total = mysql_affected_rows();
		$rows = mysql_fetch_object($ress);
		if($total>0)
		{
			$category = $rows->categoryID;		
 			$product = $rows->productID;
			$pprice = $rows->price;
 			$aucstartprice = $rows->auc_start_price;		
 			
			$aucstarttime = $rows->auc_start_time;
			    $auc_start_time=date('Y-m-d H:i:s',$aucstarttime);
                $aucstartdate = substr($auc_start_time,0,10);
				$aucsthours = substr($auc_start_time,11,2);
				$aucstmin =  substr($auc_start_time,14,2);
				$aucstsec =  substr($auc_start_time,17,2);
 			
			$aucendtime = $rows->auc_end_time;
                $auc_end_time=date('Y-m-d H:i:s',$aucendtime);
 
			    $aucenddate =substr($auc_end_time,0,10);
				$aucendhours = substr($auc_end_time,11,2);
				$aucendmin =  substr($auc_end_time,14,2);
				$aucendsec =  substr($auc_end_time,17,2);
			//$aucstartdate = $rows->auc_start_date;
				//$aucstartyear =  substr($aucstartdate,0,4);
				//$aucstartmonth = substr($aucstartdate,5,2);
				//$aucstartdate =  substr($aucstartdate,8,2);
 			//$aucenddate = $rows->auc_end_date;
				//$aucendyear =  substr($aucenddate,0,4);
				//$aucendmonth = substr($aucenddate,5,2);
				//$aucenddate =  substr($aucenddate,8,2);
 			
 			$aucstatus = $rows->auc_status;
 			$auctype = $rows->auc_type;
 			$aucrecu = $rows->auc_recurr;
			//$aucfixedprice = $rows->auc_fixed_price;
			$userid = $rows->buy_user;
			$shippingchargeid = $rows->shipping_id;
			$auccode = $rows->auction_code;
		}
	}
?>
<!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=<?=$lng_characset;?>" />
<title></title>
<LINK href="main.css" type=text/css rel=stylesheet>
<link href="zpcal/themes/aqua.css" rel="stylesheet" type="text/css" media="all" title="Calendar Theme - aqua.css" />
<script type="text/javascript" src="zpcal/src/utils.js"></script>
<script type="text/javascript" src="zpcal/src/calendar.js"></script>
<script type="text/javascript" src="zpcal/lang/calendar-en.js"></script>
<script type="text/javascript" src="zpcal/src/calendar-setup.js"></script>
<script language="javascript">
function delconfirm(loc)
{
	if(confirm("你确定要删除吗?"))
	{
		window.location.href=loc;
	}
	return false;
}

function Check(f1)
{
	if(document.f1.category.value=="none")
	{
		alert("请选择类别!!!");
		document.f1.category.focus();
		return false;
	}

	if(document.f1.product.value=="none")
	{
		alert("请选择商品!!!");
		document.f1.product.focus();
		return false;
	}

	if(document.f1.aucstartprice.value=="")
	{
		alert("请输入拍卖起始价!!!");
		document.f1.aucstartprice.focus();
		return false;
	}

	/*if(document.f1.aucstartmonth.value=="none")
	{
		alert("Please Select Auction Start Month!!!");
		document.f1.aucstartmonth.focus();
		return false;
	}*/

	/*if(document.f1.aucstartyear.value=="none")
	{
		alert("Please Select Auction Start Year!!!");
		document.f1.aucstartyear.focus();
		return false;
	}*/

	/*if(document.f1.aucendmonth.value=="none")
	{
		alert("Please Select Auction End Month!!!");
		document.f1.aucendmonth.focus();
		return false;
	}*/

	if(document.f1.aucstartdate.value=="")
	{
		alert("请输入拍卖起始日期!!!");
		document.f1.aucstartdate.focus();
		return false;
	}
	
	if(document.f1.aucenddate.value=="")
	{
		alert("请输入拍卖结束日期!!!");
		document.f1.aucenddate.focus();
		return false;
	}
	var aucsdate = condate(document.f1.aucstartdate.value);
	var curdate = condate(document.f1.curdate.value); 
	var aucedate = condate(document.f1.aucenddate.value);
	var newaucsdate = new Date(aucsdate);
	var newcurdate = new Date(curdate);
	var newaucedate = new Date(aucedate);
	
	var newtime = document.f1.curtime.value;
	var temptime = newtime.split(":");

	var newtimehour = temptime[0];
	var newtimeminute = temptime[1];
	var newtimeseconds = temptime[2];

<? if($aucstatus==2 || $aucstatus==1 || $aucstatus=="" || $_REQUEST["auction_clone"]!="" || $_REQUEST["auction_edit"]){	?>
	if(newcurdate>newaucsdate)
	{
		alert("拍卖开始日期不能是过去时.")
		document.f1.aucstartdate.focus();
		return false;
	}
	if(newcurdate>newaucedate)
	{
		alert("拍卖结束日期不能是过去时.")
		document.f1.aucenddate.focus();
		return false;
	}
	if(newaucsdate>newaucedate)
	{
		alert("拍卖结束日期必须比起始日期晚");
		document.f1.aucenddate.focus();
		return false;
	}
	if(newaucsdate>newcurdate)
	{
		document.f1.changestatusval.value = "1";
	}
	if(document.f1.startimmidiate.checked==false)
	{
		if(document.f1.changestatusval.value != "1")
		{
			if(Number(newtimehour)<Number(document.f1.aucstarthours.value))	
			{
				document.f1.changestatusval.value = "1";
			}
			else
			{
				if(Number(newtimeminute)<Number(document.f1.aucstartminutes.value))
				{
					document.f1.changestatusval.value = "1";
				}
			}
		}
	if(document.f1.changestatusval.value != "1")
	{
		if(document.f1.aucstarthours.value<newtimehour)
		{
			alert("拍卖开始时间不能是过去的时间");
			document.f1.aucstarthours.focus();
			return false;
		}
		else
		{
			if(document.f1.aucstarthours.value==newtimehour)
			{
				if(document.f1.aucstartminutes.value<newtimeminute)
				{
					alert("拍卖开始时间不能是过去的时间");
					document.f1.aucstartminutes.focus();
					return false;
				}
			}
		}
	
		if(document.f1.aucendhours.value<newtimehour)
		{
			alert("拍卖开始时间不能是过去的时间");
			document.f1.aucendhours.focus();
			return false;
		}
		else
		{
			if(document.f1.aucendminutes.value<newtimeminute)
			{
				if(document.f1.aucendhours.value==newtimehour)
				{
					alert("拍卖开始时间不能是过去的时间");
					document.f1.aucendminutes.focus();
					return false;
				}
			}
			else
			{
				if(document.f1.aucendminutes.value==newtimeminute)
				{
					if(document.f1.aucendseconds.value<newtimeseconds)
					{
						alert("拍卖开始时间不能是过去的时间");
						document.f1.aucendseconds.focus();
						return false;
					}
				}
			}
		}
	}
  }
  else
  {
  	 if(aucsdate==aucedate)
	 {
		if(document.f1.aucendhours.value<newtimehour)
		{
			alert("拍卖开始时间不能是过去的时间");
			document.f1.aucendhours.focus();
			return false;
		}
		else
		{
			if(document.f1.aucendminutes.value<newtimeminute)
			{
				if(document.f1.aucendhours.value==newtimehour)
				{
					alert("拍卖开始时间不能是过去的时间");
					document.f1.aucendminutes.focus();
					return false;
				}
			}
			else
			{
				if(document.f1.aucendminutes.value==newtimeminute)
				{
					if(document.f1.aucendseconds.value<newtimeseconds)
					{
						alert("拍卖开始时间不能是过去的时间");
						document.f1.aucendseconds.focus();
						return false;
					}
				}
			}
		}
	 }
  }
<? } ?>	
	/*if(document.f1.aucendyear.value=="none")
	{
		alert("Please Select Auction End Year!!!");
		document.f1.aucendyear.focus();
		return false;
	}*/
	if(document.f1.aucstarthours.value=="")
	{
		alert("请选择拍卖开始时间!!!");
		document.f1.aucstarthours.focus();
		return false;
	}
	
	if(document.f1.aucstartminutes.value=="")
	{
		alert("请选择拍卖开始时间!!!");
		document.f1.aucstartminutes.focus();
		return false;
	}

	if(document.f1.aucstartseconds.value=="")
	{
		alert("请选择拍卖开始时间!!!");
		document.f1.aucstartseconds.focus();
		return false;
	}

	if(document.f1.aucendhours.value=="")
	{
		alert("请选择拍卖结束时间!!!");
		document.f1.aucendhours.focus();
		return false;
	}
	
	if(document.f1.aucendminutes.value=="")
	{
		alert("请选择拍卖结束时间!!!");
		document.f1.aucendminutes.focus();
		return false;
	}

	if(document.f1.aucendseconds.value=="")
	{
		alert("请选择拍卖结束时间!!!");
		document.f1.aucendseconds.focus();
		return false;
	}

	if(document.f1.fpa.checked==true && document.f1.off.checked==true)
	{
		alert("你不能同时选择100%免费拍和固定价格拍卖!!!");
		return false;
	}
	
	if(aucsdate==aucedate)
	{
		if(Number(document.f1.aucendhours.value)<Number(document.f1.aucstarthours.value))
		{
			alert("拍卖结束时间不能比开始时间早!!!");
			document.f1.aucendhours.focus();
			return false;
		}
		else
		{
			if(Number(document.f1.aucendhours.value)==Number(document.f1.aucstarthours.value))
			{
				if(Number(document.f1.aucendminutes.value)<Number(document.f1.aucstartminutes.value))
				{
					alert("拍卖结束时间不能比开始时间早!!!");
					document.f1.aucendminutes.focus();
					return false;
				}
				else
				{
					if(Number(document.f1.aucendminutes.value)==Number(document.f1.aucstartminutes.value))
					{
						if(Number(document.f1.aucendseconds.value)==Number(document.f1.	aucstartseconds.value))
						{
							alert("拍卖结束时间不能比开始时间早!!!");
							document.f1.aucendseconds.focus();
							return false;
						}
					
					}
				}
			}
		}
	}
	
	if(document.f1.fpa.checked==false && document.f1.pa.checked==false && document.f1.nba.checked==false && document.f1.off.checked==false && document.f1.na.checked==false && document.f1.oa.checked==false)
	{
		alert("请选择拍卖类型");
		return false;
	}
	if(document.f1.shippingmethod.value=="none")
	{
		alert("请选择送货方式");
		document.f1.shippingmethod.focus();
		return false;
	}
	if(document.getElementById('minimum_auction').checked == true)
	{
		if(Number(document.f1.auctionminimumprice.value)>Number(document.getElementById('getprice').innerHTML))
		{
			alert("拍卖最低可接受价格必须小于商品价格!");
			document.f1.auctionminimumprice.focus();
			return false;
		}
	}
	
	if(document.f1.minimum_auction.checked == true)
	{
		if(Number(document.f1.auctionminimumprice.value)<Number(document.f1.aucfixedprice.value))
		{
			alert("拍卖最低价格必须大于设定的固定价格!");
			document.f1.auctionminimumprice.focus();
			return false;
		}
		if(Number(document.f1.auctionminimumprice.value)<Number(document.f1.minwinprice.value))
		{
			alert("拍卖最低获胜价格必须小于拍卖最低可接受价格!");
			document.f1.minwinprice.focus();
			return false;
		}
	}
}
function condate(dt)
{
	var ndate= new String(dt);
	//alert(dt);
	var fdt=ndate.split("/");
	var nday=fdt[0];
	var nmon=fdt[1];
	var nyear=fdt[2];
	
	var finaldate=nmon+"/"+nday+"/"+nyear;
	//alert(finaldate);
	
	return finaldate;
}
function DisabledAuctionTime()
{
	if(document.f1.startimmidiate.checked == true)
	{
		document.f1.aucstarthours.disabled = true;
		document.f1.aucstartminutes.disabled = true;
		document.f1.aucstartseconds.disabled = true;
	}
	if(document.f1.startimmidiate.checked == false)
	{
		document.f1.aucstarthours.disabled = false;
		document.f1.aucstartminutes.disabled = false;
		document.f1.aucstartseconds.disabled = false;
	}
}
function EnableDisableFixAuc(f1)
{
	if(document.f1.fpa.checked==true)
	{
		document.f1.aucfixedprice.disabled = false;
	}
	else
	{
		document.f1.aucfixedprice.disabled = true;
		document.f1.aucfixedprice.value = "0.00";
	}
}
</script>
<script language="javascript">
// USE FOR AJAX //
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function setprice(prid)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("你的浏览器不支持AJAX!");
	  return;
	  } 
	var url="getprice.php";
	url=url+"?prid="+prid
	xmlHttp.onreadystatechange=changedprice;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function changedprice()
{
	if (xmlHttp.readyState==4)
	{ 
		var temp=xmlHttp.responseText
		document.getElementById("getprice").innerHTML = temp;
	}
}

function ChangeProduct(crid)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("你的浏览器不支持AJAX!");
	  return;
	  } 
	var url="getproductlist.php";
	url=url+"?crid="+crid;
	xmlHttp.onreadystatechange=ChangedProduct;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function ChangedProduct()
{
	if (xmlHttp.readyState==4)
	{ 
		var tempproduct=xmlHttp.responseText;				
		document.getElementById("Productlist").innerHTML = tempproduct;
	}
}

function SetAuctinoMinimum()
{
	if(document.getElementById('minimum_auction').checked == true)
	{
			if(navigator.appName!="Microsoft Internet Explorer")
			{
			document.getElementById('auctionminimumpricetr').style.display = 'table-row';
			document.getElementById('auctionminimumpricetr1').style.display = 'table-row';
			}
			else
			{
			document.getElementById('auctionminimumpricetr').style.display = 'block';
			document.getElementById('auctionminimumpricetr1').style.display = 'block';
			}
	}
	else
	{
		document.getElementById('auctionminimumpricetr').style.display = 'none';
		document.getElementById('auctionminimumpricetr1').style.display = 'none';
	}
}
</script>
</head>

<BODY bgColor=#ffffff onload="EnableDisableFixAuc(f1);">   
<form name="f1" action='addauction.php' method='POST' enctype="multipart/form-data" onsubmit="return Check(this)">
<table width="100%" cellpadding="0" cellSpacing="10">
  <tr>
	<td class="H1"><? if($_GET['auction_edit']!="") { ?> 编辑<? } else { if($_GET['auction_delete']!=""){ ?> 确认删除 <? }else { ?> 新增 <? } } ?></td>
  </tr>
  <tr>
	<td background="<?=DIR_WS_ICONS?>vdots.gif"><IMG height=1 src="<?=DIR_WS_ICONS?>spacer.gif" width=1 border=0></td>
  </tr>
  <tr>
	<td class="a" align="right" colspan=2 >* 必填项</td>
  </tr>
  <tr>
 	<td>
 	  <table cellpadding="1" cellspacing="2">
	  <?
	  if($aucstatus=="2")
	  {	
	  ?>
	  	<tr>
			<td colspan="2"><font class="a">(注意: 拍卖已经开始, 现在不能修改.)</font></td>
		</tr>
		<tr>
			<td colspan="2" height="5"></td>
		</tr>
	<?
	  }
	  if($aid!="" && $_REQUEST["auction_clone"]=="")
	  {
	?>	
<!--	    <tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> Auction Code :</td>
		  <td><input type="text" value="<?$auccode;?>" name="auctioncode" maxlength="5" size="8" disabled="disabled" /></td>
		</tr>-->
	<?
	}
	?>
	    <tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> 类别 :</td>
		  <td>
		  	<select name="category" style="100pt;" onchange="ChangeProduct(this.value);">
			<option value="none">选择...</option>
			<?
			$qryc = "select * from categories where status='1'";
			$resc = mysql_query($qryc);
			$totalc = mysql_affected_rows();
			while($namec = mysql_fetch_array($resc))
			{
			?>
			<option <?=$category==$namec["categoryID"]?"selected":"";?> value="<?=$namec["categoryID"];?>"><?=stripslashes($namec["name"]);?></option>
			<?
			}
			?>
			</select></td>
		</tr>
	    <tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> 商品 :</td>
	  	  <td id="Productlist">
		  <select name="product" style="width: 150pt;" onchange="setprice(this.value);">
		  <option value="none">选择...</option>
		  <?
		  	$qryp = "select * from products";
			$resp = mysql_query($qryp);
			$totalp = mysql_affected_rows();
			while($objp = mysql_fetch_array($resp))
			{
		  ?>
		  	<option <?=$product==$objp["productID"]?"selected":"";?> value="<?=$objp["productID"];?>"><?=stripslashes($objp["name"]);?></option>
		  <?
				}
		  ?>
		  </select></td>
 	    </tr>
	    <tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> 商品市场价 :</td>
	  	  <td id="getprice"><?=$pprice!=""?$pprice:"";?></td>
	    </tr>
		<!--<tr>
			<td class="f-c"  align="right">拍卖类型 :</td>
			<td>
				<table border="0">
				<tr>
					<td>
						<input <?=$rows->fixedpriceauction=="1"?"checked":""?> type="checkbox" name="fpa" value="1" onclick="EnableDisableFixAuc(this);"> 固定价拍卖 </td>
					<td>
						<input <?=$rows->pennyauction=="1"?"checked":""?> type="checkbox" name="pa" value="1"> 加一分拍卖 
					</td>
					<td>
						<input <?=$rows->nailbiterauction=="1"?"checked":""?> type="checkbox" name="nba" value="1"> 不许眨眼拍卖 
					</td>
				</tr>
				<tr>
					<td><input <?=$rows->offauction=="1"?"checked":""?> type="checkbox" name="off" value="1"> 100%免费拍卖</td>
					<td><input <?=$rows->nightauction=="1"?"checked":""?> type="checkbox" name="na" value="1"> 晚上拍卖</td>
					<td><input <?=$rows->openauction=="1"?"checked":""?> type="checkbox" name="oa" value="1"> 一般拍卖</td>
				</tr>
				</table>
			</td>
			</tr>!-->
	    <tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> 起拍价 :</td>
          <td><input name="aucstartprice" type="text" class="solidinput" id="member_name" value="<?=$aucstartprice?>" size="12" maxlength="20">&nbsp;<font color="#FF0000"></font></td>
        </tr>
		<tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> 是否热拍 :</td>
          <td align="left"><input <? if($rows->is_hot==1) { echo "checked"; } ?> type="checkbox" value="is_hot" id="is_hot" name="is_hot"  /><font color="#FF0000"></font></td>
        </tr>
		<tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> 是否用户新体验 :</td>
          <td align="left"><input <? if($rows->is_exprice==1) { echo "checked"; } ?> type="checkbox" value="is_exprice" id="is_exprice" name="is_exprice"  /><font color="#FF0000"></font></td>
        </tr>



       
	    <!--<tr valign="middle">
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> 固定价 :</td>
          <td><input name="aucfixedprice" type="text" class="solidinput" value="<?=$aucfixedprice?>" size="12" disabled="disabled" id="aucfixedprice" maxlength="20">&nbsp;<font color="#FF0000"> (注意: 仅限于固定价拍卖)</font></td>
        </tr>!-->
		<tr valign="middle">
          <td class="f-c" align="right" valign="middle" width="191">拍卖日期 :</td>
          <td>
			<?php /*?><select name="aucstartdate">
			<option value="none">--</option>
			<?
				for($i=1;$i<=31;$i++)
				{
					if($i<10)
					{
						$i="0".$i;
					}
					if($aucstatus=="3" and $userid==1)
					{	
					?>
					<option <?=date("d")==$i?"selected":""?> value="<?=$i?>"><?=$i;?></option>
					<?
					}
					else
					{
			?>
			<option <?=$aucstartdate==$i?"selected":""?> value="<?=$i?>"><?=$i;?></option>
			<?		
					}
				}
			?>
			</select>
			<select name="aucstartmonth">
			<option value="none">--</option>
			<?
				for($i=1;$i<=12;$i++)
				{
					if($i<10)
					{
						$i="0".$i;
					}
					if($aucstatus=="3" and $userid==1)
					{
			?>
			<option <?=date("m")==$i?"selected":"";?> value="<?=$i?>"><?=$i;?></option>
			<?
					}
					else
					{
			?>
			<option <?=$aucstartmonth==$i?"selected":"";?> value="<?=$i?>"><?=$i;?></option>
			<?		
					}
				}
			?>
		 	</select>
	
			<select name="aucstartyear">
				<option value="none">----</option>
				<?
					for($i=2010;$i<=2050;$i++)
					{
						if($aucstatus=="3" and $userid==1)
						{
				?>
					<option <?=date("Y")==$i?"selected":""?> value="<?=$i;?>"><?=$i;?></option>
				<?
						}
						else
						{
				?>
					<option <?=$aucstartyear==$i?"selected":""?> value="<?=$i;?>"><?=$i;?></option>
				<?
						}
					}
				?>
			</select><?php */?>
			<input type="text" size="12" name="aucstartdate" id="aucstartdate" value="<?=$aucstartdate!=""?date("d/m/Y",strtotime($aucstartdate)):"";?>" />
			<img src="images/pmscalendar.gif" align="absmiddle" width="20" height="20" id="vfrom">
			 	<B>&nbsp;To&nbsp;</B>
				<input type="text" size="12" name="aucenddate" id="aucenddate" value="<?=$aucenddate!=""?date("d/m/Y",strtotime($aucenddate)):"";?>" />
			<img src="images/pmscalendar.gif" align="absmiddle" width="20" height="20" id="zfrom">
			<?php /*?><select name="aucenddate">
			<option value="none">--</option>
			<?
				for($i=1;$i<=31;$i++)
				{
					if($i<10)
					{
						$i="0".$i;
					}
					if($aucstatus=="3" and $userid==1)
					{
			?>
			<option <?=(date("d")+1)==$i?"selected":""?> value="<?=$i?>"><?=$i;?></option>
			<?
					}
					else
					{
			?>
			<option <?=$aucenddate==$i?"selected":""?> value="<?=$i?>"><?=$i;?></option>
			<?		
					}
				}
			?>
			</select>
			<select name="aucendmonth">
			<option value="none">--</option>
			<?
				for($i=1;$i<=12;$i++)
				{
					if($i<10)
					{
						$i="0".$i;
					}
					if($aucstatus=="3" and $userid==1)
					{
			?>
			<option <?=date("m")==$i?"selected":"";?> value="<?=$i?>"><?=$i;?></option>
			<?
					}
					else
					{
			?>
			<option <?=$aucendmonth==$i?"selected":"";?> value="<?=$i?>"><?=$i;?></option>
			<?		
					}
				}
			?>
		 	</select>
	
			<select name="aucendyear">
				<option value="none">----</option>
				<?
					for($i=2008;$i<=2050;$i++)
					{
						if($aucstatus=="3" and $userid==1)
						{
				?>
					<option <?=date("Y")==$i?"selected":""?> value="<?=$i;?>"><?=$i;?></option>
				<?
						}
						else
						{
				?>
					<option <?=$aucendyear==$i?"selected":""?> value="<?=$i;?>"><?=$i;?></option>
				<?			
						}
					}
				?>
			</select><?php */?>
		</td>
		</tr>
		<tr>
			<td class="f-c"  align="right">拍卖时间 :</td>
			<td>
			<? if($aucstatus=="3" and $userid==3) 
			{
			?>
			<select name="aucstarthours">
			<option value="">hh</option>
			<? for ($h=0;$h<=23;$h++){ ?>
				<option <?=date("H")==$h?"selected":"";?> value="<?=str_pad($h,2,"0",STR_PAD_LEFT);?>"><?=$h;?></option>
			<? } ?>
			</select> :
			<!--<input maxlength="2" type="text" name="aucstarthours" size="2" value="<?//date("H")!=""?date("H"):"";?>">-->
			<? }else{ ?>
			<select name="aucstarthours">
			<option value="">hh</option>
			<? for ($h=0;$h<=23;$h++){ ?>
				<option <?=$aucsthours==$h?"selected":"";?> value="<?=str_pad($h,2,"0",STR_PAD_LEFT);?>"><?=str_pad($h,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select> :
			<?php /*?><input maxlength="2" type="text" name="aucstarthours" size="2" value="<?=$aucsthours!=""?$aucsthours:"";?>"> :<?php */?>
			<? } ?>
			<? if($aucstatus=="3" and $userid==3) 
			{
			?>
			<select name="aucstartminutes">
			<option value="">mm</option>
			<? for ($m=0;$m<=59;$m++){ ?>
				<option <?=date("i")==$m?"selected":"";?> value="<?=str_pad($m,2,"0",STR_PAD_LEFT);?>"><?=str_pad($m,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select> :
			<?php /*?><input maxlength="2" type="text" name="aucstartminutes" size="2" value="<?=date("i")!=""?date("i"):"";?>"> :<?php */?>
			<? }else{ ?>
			<select name="aucstartminutes">
			<option value="">mm</option>
			<? for ($m=0;$m<=59;$m++){ ?>
				<option <?=$aucstmin==$m?"selected":"";?> value="<?=str_pad($m,2,"0",STR_PAD_LEFT);?>"><?=str_pad($m,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select> :
			<?php /*?><input maxlength="2" type="text" name="aucstartminutes" size="2" value="<?=$aucstmin!=""?$aucstmin:"";?>"> :<?php */?>
			<? } ?>
			<? if($aucstatus=="3" and $userid==3) 
			{
			?>
			<select name="aucstartseconds">
			<option value="">ss</option>
			<? for ($s=0;$s<=59;$s++){ ?>
				<option <?=date("s")==$s?"selected":"";?> value="<?=str_pad($s,2,"0",STR_PAD_LEFT);?>"><?=str_pad($s,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select>
			<?php /*?><input maxlength="2" type="text" name="aucstartseconds" size="2" value="<?=date("s")!=""?date("s"):"";?>"><?php */?>
			<? }else{ ?>
			<select name="aucstartseconds">
			<option value="">ss</option>
			<? for ($s=0;$s<=59;$s++){ ?>
				<option <?=$aucstsec==$s?"selected":"";?> value="<?=str_pad($s,2,"0",STR_PAD_LEFT);?>"><?=str_pad($s,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select>
			<?php /*?><input maxlength="2" type="text" name="aucstartseconds" size="2" value="<?=$aucstsec!=""?$aucstsec:"";?>"><?php */?>
			<? } ?>
			 <b>&nbsp;To&nbsp;</b>
			 <? if($aucstatus=="3" and $userid==3) 
			{
			?>
			<select name="aucendhours">
			<option value="">hh</option>
			<? for ($h=0;$h<=23;$h++){ ?>
				<option <?=date("H")==$h?"selected":"";?> value="<?=str_pad($h,2,"0",STR_PAD_LEFT);?>"><?=str_pad($h,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select> :
		    <?php /*?><input maxlength="2" type="text" name="aucendhours" size="2" value="<?=date("H")!=""?date("H"):"";?>"> :<?php */?>
			<? }else{ ?>
			<select name="aucendhours">
			<option value="">hh</option>
			<? for ($h=0;$h<=23;$h++){ ?>
				<option <?=$aucendhours==$h?"selected":"";?> value="<?=str_pad($h,2,"0",STR_PAD_LEFT);?>"><?=str_pad($h,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select> :
			<?php /*?><input maxlength="2" type="text" name="aucendhours" size="2" value="<?=$aucendhours!=""?$aucendhours:"";?>"> :<?php */?>
			<? } ?>
			 <? if($aucstatus=="3" and $userid==3) 
			{
			?>
			<select name="aucendminutes">
			<option value="">mm</option>
			<? for ($m=0;$m<=59;$m++){ ?>
				<option <?=date("i")==$m?"selected":"";?> value="<?=str_pad($m,2,"0",STR_PAD_LEFT);?>"><?=str_pad($m,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select> :
			<?php /*?><input maxlength="2" type="text" name="aucendminutes" size="2" value="<?=date("i")!=""?date("i"):"";?>"> :<?php */?>
			<? }else{ ?>
			<select name="aucendminutes">
			<option value="">mm</option>
			<? for ($m=0;$m<=59;$m++){ ?>
				<option <?=$aucendmin==$m?"selected":"";?> value="<?=str_pad($m,2,"0",STR_PAD_LEFT);?>"><?=str_pad($m,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select> :
			<?php /*?><input maxlength="2" type="text" name="aucendminutes" size="2" value="<?=$aucendmin!=""?$aucendmin:"";?>"> :<?php */?>
			<? } ?>
			 <? if($aucstatus=="3" and $userid==3) 
			{
			?>
			<select name="aucendseconds">
			<option value="">ss</option>
			<? for ($s=0;$s<=59;$s++){ ?>
				<option <?=date("s")==$s?"selected":"";?> value="<?=str_pad($s,2,"0",STR_PAD_LEFT);?>"><?=str_pad($s,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select>
			<?php /*?><input maxlength="2" type="text" name="aucendseconds" size="2" value="<?=date("s")!=""?date("s"):"";?>"><?php */?>
			<? }else{ ?>
			<select name="aucendseconds">
			<option value="">ss</option>
			<? for ($s=0;$s<=59;$s++){ ?>
				<option <?=$aucendsec==$s?"selected":"";?> value="<?=str_pad($s,2,"0",STR_PAD_LEFT);?>"><?=str_pad($s,2,"0",STR_PAD_LEFT);?></option>
			<? } ?>
			</select>
			<?php /*?><input maxlength="2" type="text" name="aucendseconds" size="2" value="<?=$aucendsec!=""?$aucendsec:"";?>"><?php */?>
			<? } ?>	<font class="a">(24小时)</font>
			</td>
		</tr>
		<!--<tr>
			<td>&nbsp;</td>
			<td><input type="checkbox" name="startimmidiate" value="start" onclick="DisabledAuctionTime();" />&nbsp;立即开始
		<tr>
			<td class="f-c"  align="right">拍卖状态 :</td>
			<td>
			<select name="aucstatus">
				<option <?=$aucstatus=="2"?"selected":"";?> value="2">激活</option>
				<option <?=($aucstatus=="4")?"selected":"";?> value="4">暂停</option>
			<?	if($_REQUEST["auction_edit"]!="" && $userid=="")
				{
			?>	
				<option <?=$aucstatus=="3"?"selected":"";?> value="3">Sold</option>
			<?
				}
			?>	
			</select><br /><font class="a">(注意: 状态为“激活”且拍卖时间未到，则该拍卖属于等待上架的拍卖.<br />状态为暂停，该商品则暂存于数据库中, 修改状态为激活后拍卖会在规定的时间内开始.)</font>
			</td>
		</tr>!-->
		<tr>
					<td class="f-c"  align="right">拍卖增加时间  :</td>
					<td>
						<select name="auctionduration">
							<option value="none">默认</option>
							<option value="10sa" <?=$rows->time_duration=="10sa"?"selected":"";?>>10秒拍</option>
							<option value="15sa" <?=$rows->time_duration=="15sa"?"selected":"";?>>15秒拍</option>
							<option value="20sa" <?=$rows->time_duration=="20sa"?"selected":"";?>>20秒拍</option>
						</select>
					</td>
		</tr>
		<tr>
					<td class="f-c"  align="right">快递  :</td>
					<td>
					<select name="shippingmethod" style="width: 180px;">
					<option value="none">选择...</option>
					<?
						$qryshipping = "select * from shipping";
						$resshipping = mysql_query($qryshipping);
						while($objshipping = mysql_fetch_object($resshipping))
						{
					?>
					<option <?=$objshipping->id==$shippingchargeid?"selected":"";?> value="<?=$objshipping->id;?>"><?=stripslashes($objshipping->shipping_title);?></option>
					<?
						}
					?>
						</select>
					</td>
		</tr>

		<tr>
					<td class="f-c"  align="right">晒单获得  :</td>
					<td align="left"><input type="text" name="showpoint" size="10" maxlength="8" value="<?=$rows->showpoint;?>" />个拍币&nbsp;<font class="a"></font><br /><font class="a">竞拍成功者申请晒单，奖励拍点</font></td>
		</tr>
		<tr>
					<td></td>
					<td align="left"></td>
		</tr>
		<tr>
					<td></td>
					<td align="left"><input <? if($rows->auction_min_price>0) { echo "checked"; } ?> type="checkbox" value="minimum" id="minimum_auction" name="minimum_auction" onclick="SetAuctinoMinimum();" />&nbsp;请打勾并输入可以接受的最低拍卖价格.</td>
		</tr>
		<tr id="auctionminimumpricetr" <? if($rows->auction_min_price>0) { } else {  ?> style="display: none;" <? } ?>>
					<td class="f-c"  align="right">最低拍卖价  :</td>
					<td align="left"><input type="text" name="auctionminimumprice" size="10" maxlength="8" value="<?=$rows->auction_min_price>0?$rows->auction_min_price:"";?>" />&nbsp;<font class="a"></font><br /><font class="a">(注意: 拍卖价超过最低拍卖价前，机器人会自动出价和加价.<br />最低拍卖价的计算方法:当前商品价格 + 参与拍卖会员的总出价额</font></td>
		</tr>

		<tr id="auctionminimumpricetr1" <? if($rows->auction_min_price>0) { } else {  ?> style="display: none;" <? } ?>>
					<td class="f-c"  align="right">最低获胜价  :</td>
					<td align="left"><input type="text" name="minwinprice" size="10" maxlength="8" value="<?=$rows->auction_min_price>0?$rows->min_win_price:"";?>" />&nbsp;<font class="a"></font><br /><font class="a">(注意: 最低获胜价应低于最低拍卖价.)</font></td>
		</tr>
<!--		<tr>
			<td class="f-c"  align="right">Recurring :</td>
			<td>
				<select name="aucrec" style="width:50pt;">
				<option <?$aucrecu=="yes"?"selected":"";?> value="yes">Yes</option>
				<option <?$aucrecu=="no"?"selected":"";?> value="no">No</option>
				</select>
			</td>
		</tr>-->
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
		<td align="center" colspan="2">
			<?
			if($_REQUEST["auction_edit"]!="" && $userid!="")
			{
				if($aucstatus=="3")
				{
			?>
			<input type="submit" name="editauction" value="编辑" disabled="disabled" class="bttn" />
			<?
				}
				else
				{
					if($aucstatus=="2")
					{
			?>
			<input type="submit" name="editauction" disabled="disabled" value="编辑" class="bttn" />
			<?
					}
					else
					{
			?>
			<input type="submit" name="editauction" value="编辑" class="bttn" />
			<?			
					}
				}
			?>
			<input type="hidden" name="edit_auction" value="<?=$_REQUEST["auction_edit"];?>" />
			<input type="hidden" name="auc_back_status" value="<?=$aucstatus;?>" />
			<input type="hidden" name="userid" value="<?=$userid;?>" />
			<?
			}
			elseif($_REQUEST["auction_delete"]!="")
			{
				$delid = $_REQUEST["auction_delete"];
			?>
			<input type="button" name="deleteauction" value="删  除" class="bttn" onclick="delconfirm('addauction.php?delete_auction=<?=$delid?>');" <? if($aucstatus=="1" || $aucstatus=="4"){ echo ""; } else { echo "disabled"; } ?>/>
			<?
			}
			else
			{
			?>
			<input type="submit" name="addauction" value="保  存" class="bttn" />
			<?
			}
			?>
		</td>
		</tr>
		</table>
	</td>
	</tr>
</table>
<input type="hidden" name="curdate" value="<?=date("d/m/Y");?>" />
<input type="hidden" name="changestatusval" value="" />
<input type="hidden" name="curtime" value="<?=date("H:i:s");?>" />
</form>
<script type="text/javascript">
var cal = new Zapatec.Calendar.setup({ 
inputField:"aucstartdate",
ifFormat:"%d/%m/%Y",
button:"vfrom",
showsTime:false 
});
</script>
<script type="text/javascript">
var cal = new Zapatec.Calendar.setup({ 
inputField:"aucenddate",
ifFormat:"%d/%m/%Y",
button:"zfrom",
showsTime:false 
});
</script>
</body>
</html>