Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
ola sou novo aqui, bom to com problema que chato pra mim, procurei esse problema aqui e achei como resolver, pessoal falou que o numero de campos tem que ser igual ao numero de valores, porem nao consegui, eu nao entendo de php e acho que talvez algum outro lugar tambem esteja errado, se alguem puder me ajudar e da uma olhada no codigo e me informar os erros eu agradeceria...
<?
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);
$newendtimestapm = 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"];
$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";
}
$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;
}
$qryins = "Insert into auction (categoryID,productID,auc_start_price,auc_fixed_price,auc_final_price,auc_start_date,auc_end_date,auc_start_time,auc_end_time,auc_status,auc_type,fixedpriceauction,pennyauction,nailbiterauction,offauction,nightauction,openauction,time_duration,auc_recurr,total_time,shipping_id,auction_code,future_tstamp,auction_min_price,min_win_price) values('$categoryID','$productID',$auc_start_price,$auc_fixed_price,'','$auc_start_date','$auc_end_date','$auc_start_time','$auc_end_time','$auc_status','$auc_type','$fpa','$pa','$nba','$off','$na','$oa','$duration','$auc_recu','$auc_due_time','$shippingmethod','$auccode','$futuretstamp','$minimumaucprice','".$minwinprice."')";
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,'$auc_due_time',$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=$auc_due_time, 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,'$auc_due_time',$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_date='$auc_start_date',auc_end_date='$auc_end_date', auc_start_time='$auc_start_time', auc_end_time='$auc_end_time', auc_status='$auc_status', fixedpriceauction='$fpa',pennyauction='$pa',nailbiterauction='$nba',offauction='$off',nightauction='$na',openauction='$oa',time_duration='$duration', auc_recurr='$auc_recu',auc_fixed_price=$auc_fixed_price,total_time='$auc_due_time',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' 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=$auc_due_time, 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,'$auc_due_time',$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_date='$auc_start_date',auc_end_date='$auc_end_date', auc_start_time='$auc_start_time', auc_end_time='$auc_end_time', auc_status='$auc_status', fixedpriceauction='$fpa',pennyauction='$pa',nailbiterauction='$nba',offauction='$off',nightauction='$na',openauction='$oa',time_duration='$duration', auc_recurr='$auc_recu',auc_fixed_price=$auc_fixed_price,total_time='$auc_due_time', shipping_id='$shippingmethod',future_tstamp='$futuretstamp',auction_min_price='$minimumaucprice',min_win_price='$minwinprice' 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_status from auction where auctionID=".$delid;
$resseld = mysql_query($qryseld);
$totalrow = mysql_affected_rows();
$del = mysql_fetch_object($resseld);
if($del->auc_status==2)
{
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;
$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);
$aucstarttime = $rows->auc_start_time;
$aucsthours = substr($aucstarttime,0,2);
$aucstmin = substr($aucstarttime,3,2);
$aucstsec = substr($aucstarttime,6,2);
$aucendtime = $rows->auc_end_time;
$aucendhours = substr($aucendtime,0,2);
$aucendmin = substr($aucendtime,3,2);
$aucendsec = substr($aucendtime,6,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](http://www.w3.org/1999/xhtml)">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<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("Are you sure do you want to delete this?"))
{
window.location.href=loc;
}
return false;
}
function Check(f1)
{
if(document.f1.category.value=="none")
{
alert("Please Select Category!!!");
document.f1.category.focus();
return false;
}
if(document.f1.product.value=="none")
{
alert("Please Select Product!!!");
document.f1.product.focus();
return false;
}
if(document.f1.aucstartprice.value=="")
{
alert("Please Enter Auction Start Price!!!");
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("Please Select Auction Start Date!!!");
document.f1.aucstartdate.focus();
return false;
}
if(document.f1.aucenddate.value=="")
{
alert("Please Select Auction End Date!!!");
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("Auction Start Date should not be past date.")
document.f1.aucstartdate.focus();
return false;
}
if(newcurdate>newaucedate)
{
alert("Auction End Date should not be past date.")
document.f1.aucenddate.focus();
return false;
}
if(newaucsdate>newaucedate)
{
alert("Auction End date should be greater than Auction Start date");
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("Auction start time should not be past time");
document.f1.aucstarthours.focus();
return false;
}
else
{
if(document.f1.aucstarthours.value==newtimehour)
{
if(document.f1.aucstartminutes.value<newtimeminute)
{
alert("Auction start time should not be past time");
document.f1.aucstartminutes.focus();
return false;
}
}
}
if(document.f1.aucendhours.value<newtimehour)
{
alert("Auction end time should not be past time");
document.f1.aucendhours.focus();
return false;
}
else
{
if(document.f1.aucendminutes.value<newtimeminute)
{
if(document.f1.aucendhours.value==newtimehour)
{
alert("Auction end time should not be past time");
document.f1.aucendminutes.focus();
return false;
}
}
else
{
if(document.f1.aucendminutes.value==newtimeminute)
{
if(document.f1.aucendseconds.value<newtimeseconds)
{
alert("Auction end time should not be past time");
document.f1.aucendseconds.focus();
return false;
}
}
}
}
}
}
else
{
if(aucsdate==aucedate)
{
if(document.f1.aucendhours.value<newtimehour)
{
alert("Auction end time should not be past time");
document.f1.aucendhours.focus();
return false;
}
else
{
if(document.f1.aucendminutes.value<newtimeminute)
{
if(document.f1.aucendhours.value==newtimehour)
{
alert("Auction end time should not be past time");
document.f1.aucendminutes.focus();
return false;
}
}
else
{
if(document.f1.aucendminutes.value==newtimeminute)
{
if(document.f1.aucendseconds.value<newtimeseconds)
{
alert("Auction end time should not be past time");
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("Please Select Auction Start Time!!!");
document.f1.aucstarthours.focus();
return false;
}
if(document.f1.aucstartminutes.value=="")
{
alert("Please Select Auction Start Time!!!");
document.f1.aucstartminutes.focus();
return false;
}
if(document.f1.aucstartseconds.value=="")
{
alert("Please Select Auction Start Time!!!");
document.f1.aucstartseconds.focus();
return false;
}
if(document.f1.aucendhours.value=="")
{
alert("Please Select Auction End Time!!!");
document.f1.aucendhours.focus();
return false;
}
if(document.f1.aucendminutes.value=="")
{
alert("Please Select Auction End Time!!!");
document.f1.aucendminutes.focus();
return false;
}
if(document.f1.aucendseconds.value=="")
{
alert("Please Select Auction End Time!!!");
document.f1.aucendseconds.focus();
return false;
}
if(document.f1.fpa.checked==true && document.f1.off.checked==true)
{
alert("You can't select fixed price auction type with 100% off auction type!!!");
return false;
}
if(aucsdate==aucedate)
{
if(Number(document.f1.aucendhours.value)<Number(document.f1.aucstarthours.value))
{
alert("Auction end time should be greater than auctin start time!!!");
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("Auction end time should be greater than auctin start time!!!");
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("Auction end time should be greater than auctin start time!!!");
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("Please select auction type");
return false;
}
if(document.f1.shippingmethod.value=="none")
{
alert("Please select shipping charge method");
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("Auction minimum affordable price must be smaller then the product price!");
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("Auction minimum price must be greater than the auction fixed price!");
document.f1.auctionminimumprice.focus();
return false;
}
if(Number(document.f1.auctionminimumprice.value)<Number(document.f1.minwinprice.value))
{
alert("Auction Minimum Win Price must be less than auction minimum affordable price!");
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 ("Your browser does not support 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 ("Your browser does not support 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']!="") { ?> Editar Leilão <? } else { if($_GET['auction_delete']!=""){ ?> Excluir Leilão <? }else { ?> Adicionar Leilão <? } } ?></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 >* Campos Obrigatorios</td>
</tr>
<tr>
<td>
<table cellpadding="1" cellspacing="2">
<?
if($aucstatus=="2")
{
?>
<tr>
<td colspan="2"><font class="a">(Atenção: Este leilão está aberto, então você não pode modificá-lo no momento.)</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> Categoria :</td>
<td>
<select name="category" style="100pt;" onchange="ChangeProduct(this.value);">
<option value="none">Selecione</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> Produto :</td>
<td id="Productlist">
<select name="product" style="width: 150pt;" onchange="setprice(this.value);">
<option value="none">Selecione</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> Valor de mercado do Produto:</td>
<td id="getprice"><?=$pprice!=""?$pprice:"";?></td>
</tr>
<tr>
<td class="f-c" align="right">Tipo de Leilão :</td>
<td>
<table border="0">
<tr>
<td>
<input <?=$rows->fixedpriceauction=="1"?"checked":""?> type="checkbox" name="fpa" value="1" onclick="EnableDisableFixAuc(this);">
Preço Fixo</td>
<td>
<input <?=$rows->pennyauction=="1"?"checked":""?> type="checkbox" name="pa" value="1">
1 Centavo
</td>
<td>
<input <?=$rows->nailbiterauction=="1"?"checked":""?> type="checkbox" name="nba" value="1">
Pregão
</td>
</tr>
<tr>
<td><input <?=$rows->offauction=="1"?"checked":""?> type="checkbox" name="off" value="1"> 100% off</td>
<td><input <?=$rows->nightauction=="1"?"checked":""?> type="checkbox" name="na" value="1">
Leilão Noturno</td>
<td><input <?=$rows->openauction=="1"?"checked":""?> type="checkbox" name="oa" value="1">
Leilão Aberto</td>
</tr>
</table>
</td>
</tr>
<tr valign="middle">
<td class=f-c align=right valign="middle" width="191"><font class=a>*</font> Preço inicial:</td>
<td><input name="aucstartprice" type="text" class="solidinput" id="member_name" value="<?=$aucstartprice?>" size="12" maxlength="20"> <font color="#FF0000"><?=$Currency;?></font></td>
</tr>
<tr valign="middle">
<td class=f-c align=right valign="middle" width="191"><font class=a>*</font> Preço Fixo:</td>
<td><input name="aucfixedprice" type="text" class="solidinput" value="<?=$aucfixedprice?>" size="12" disabled="disabled" id="aucfixedprice" maxlength="20">
<font color="#FF0000"><?=$Currency;?>
(Obrigatória: Se o tipo de leilão selecionado for preço fixo)</font></td>
</tr>
<tr valign="middle">
<td class="f-c" align="right" valign="middle" width="191">Data :</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=2008;$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> à </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">Horário :</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> To </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 horas)</font>
</td>
</tr>
<tr>
<td> </td>
<td><input type="checkbox" name="startimmidiate" value="start" onclick="DisabledAuctionTime();" />
Iniciar Imediatamente<tr>
<td class="f-c" align="right">Status :</td>
<td>
<select name="aucstatus">
<option <?=$aucstatus=="2"?"selected":"";?> value="2">Ativo</option>
<option <?=($aucstatus=="4")?"selected":"";?> value="4">Pendente</option>
<? if($_REQUEST["auction_edit"]!="" && $userid=="")
{
?>
<option <?=$aucstatus=="3"?"selected":"";?> value="3">Vendido</option>
<?
}
?>
</select><br />
<font class="a">(Nota: Se o status está ativo e data de início é a data do leilão futuro então será considerado como leilão futuro.<br />
Se o status estiver pendente entao o leilão não será salvo para venda, altere o status par ativo para coloca-lo à venda.)</font>
</td>
</tr>
<tr>
<td class="f-c" align="right">Duração :</td>
<td>
<select name="auctionduration">
<option value="none">Padrão</option>
<option value="10sa" <?=$rows->time_duration=="10sa"?"selected":"";?>>10-Segundos</option>
<option value="15sa" <?=$rows->time_duration=="15sa"?"selected":"";?>>15-Segundos</option>
<option value="20sa" <?=$rows->time_duration=="20sa"?"selected":"";?>>20-Segundos</option>
</select>
</td>
</tr>
<tr>
<td class="f-c" align="right">Forma de Entrega:</td>
<td>
<select name="shippingmethod" style="width: 180px;">
<option value="none">Selecione uma</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></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();" />
Definir Preço Minimo.</td>
</tr>
<tr id="auctionminimumpricetr" <? if($rows->auction_min_price>0) { } else { ?> style="display: none;" <? } ?>>
<td class="f-c" align="right">Preço Minimo :</td>
<td align="left"><input type="text" name="auctionminimumprice" size="10" maxlength="8" value="<?=$rows->auction_min_price>0?$rows->auction_min_price:"";?>" /> <font class="a"><?=$Currency;?></font><br />
<font class="a">(Nota: Leilão não fechara enqnto valor dos lances não chegar ao preço minimo.<br />
Calculo para preço minimo:<br />
Definir preço do leilão: preço fixo + valor dos bids dados pelos usuario<br />
100% Off: Valor total real dos bids feitos pelos usuários<br />
Outros Tipos: Preço atual + valor de Bids dados pelos usuarios</font></td>
</tr>
<tr id="auctionminimumpricetr1" <? if($rows->auction_min_price>0) { } else { ?> style="display: none;" <? } ?>>
<td class="f-c" align="right">Preço minimo para ganhar :</td>
<td align="left"><input type="text" name="minwinprice" size="10" maxlength="8" value="<?=$rows->auction_min_price>0?$rows->min_win_price:"";?>" /> <font class="a"><?=$Currency;?></font><br />
<font class="a">(Nota: Preço minimo para ganahr deve ser inferior a preço acessível mínimo.)</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> </td>
</tr>
<tr>
<td align="center" colspan="2">
<?
if($_REQUEST["auction_edit"]!="" && $userid!="")
{
if($aucstatus=="3")
{
?>
<input type="submit" name="editauction" value="Editar" disabled="disabled" class="bttn" />
<?
}
else
{
if($aucstatus=="2")
{
?>
<input type="submit" name="editauction" disabled="disabled" value="Editar" class="bttn" />
<?
}
else
{
?>
<input type="submit" name="editauction" value="Editar" 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="Excluir" 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="Adicionar" 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>Carregando comentários...