AW: Falsche Datum/Zeitanzeige
Hallo,
danach kommt dieses hier:
$auctionends = $time;
$auctionends = date("YmdHis", $auctionends);
$item_seller = $Auction["user"];
$old_quantity = $Auction["quantity"];
$item_title = $Auction["title"];
$item_description = $Auction["description"];
$AuctionIsClosed = false;
$closed = intval($Auction["closed"]);
$store_ends = $Auction["ends"];
$store_starts = $Auction["starts"];
$buy_now = $Auction["buynow"];
$cat_id = $Auction["category"];
$atype = $Auction["auction_type"];
if (mktime(substr($store_ends, 11, 2),
substr($store_ends, 14, 2),
substr($store_ends, 17, 2),
substr($store_ends, 5, 2),
substr($store_ends, 8, 2),
substr($store_ends, 0, 4)) <= time())
#$AuctionIsClosed = true;
if (($closed==1) || ($AuctionIsClosed))
{
include("header3.php");
$TPL_errmsg = $ERR_614;
include("templates/tpl_buynow.html");
include("footer2.php");
exit;
}
$result = mysql_query("SELECT * FROM users WHERE id='".$Auction["user"]."'");
$n = 0;
if ($result)
$n = mysql_num_rows($result);
if ($n > 0)
$Seller = mysql_fetch_array($result);
else
$Seller = array();
unset($display_bid_form);
if (empty($action))
{
$display_bid_form = true;
}
else
{
unset($ERR);
if (!isset($ERR))
{
if ( strlen($nick)==0 || strlen($password)==0 )
$ERR = "610";
}
if (!isset($ERR))
{
$query = "SELECT * FROM users WHERE nick='".addslashes($nick)."'";
$result = mysql_query($query);
$n = 0;
if ($result)
$n = mysql_num_rows($result);
else
$ERR = "001";
if (!isset($ERR))
{
if ($n==0)
$ERR = "609";
}
if($n > 0)
$bidder_id = mysql_result($result,0,"id");
}
if (!isset($ERR))
{
$pwd = mysql_result($result,0,"password");
if ($pwd != md5($MD5_PREFIX.$password))
{
$ERR = "611";
}
else
{
if(mysql_result($result,0,"suspended") > 0)
{
$ERR = "618";
}
}
}
if (!isset($ERR))
{
$query2 = "SELECT suspended FROM auctions WHERE id='$id'";
$result2 = mysql_query($query2);
if (mysql_result($result2, 0, "suspended") > 0)
{
$ERR = "619";
}
}
// Ist der Bieter der Verkäufer?
if (!isset($ERR))
{
$bidderID = mysql_result($result,0,"id");
if ($bidderID == $Seller["id"] )
$ERR = "612";
}
if (!isset($ERR))
{
if ($old_quantity < $qty)
$ERR = "608";
}
if (isset($ERR))
{
$display_bid_form = true;
$TPL_errmsg = ${"ERR_".$ERR};
}
else
{
unset($ERR);
$maxbid = $bid;
$bid = $next_bid;
}
if (!isset($ERR))
{
$bid = doubleval($bid);
if ($qty == 0)
$qty = 1;
$quantity = $qty;
$new_quantity = $old_quantity - $qty;
if ($atype == 1)
$new_quantity = 0;
if ($new_quantity == 0 && $atype == 2)
{
$query = "UPDATE auctions SET quantity='$new_quantity', current_bid='$buy_now', starts='$store_starts', ends='$auctionends', closed='1' WHERE id='$id'";
do
{
$c_query = "SELECT * FROM categories WHERE cat_id='$cat_id'";
$c_result = mysql_query($c_query);
if ($c_result)
{
if (mysql_num_rows($c_result)>0)
{
$R_parent_id = mysql_result($c_result,0,"parent_id");
$R_cat_id = mysql_result($c_result,0,"cat_id");
$R_counter = intval(mysql_result($c_result,0,"counter"));
$R_sub_counter = intval(mysql_result($c_result,0,"sub_counter"));
$R_sub_counter--;
if ($cat_id == $root_cat)
--$R_counter;
if($R_counter < 0)
$R_counter = 0;
if($R_sub_counter < 0)
$R_sub_counter = 0;
$c2_query = "UPDATE categories SET counter='$R_counter', sub_counter='$R_sub_counter' WHERE cat_id=\"$cat_id\"";
if (!mysql_query($c2_query))
print "Datenbankfehler!!";
$cat_id = $R_parent_id;
}
}
}
while ($cat_id != 0);
$c3_query = "SELECT * FROM counters";
$c3_result = mysql_query($c3_query);
if ($c3_result)
{
if (mysql_num_rows($c3_result)>0)
{
$auctions = mysql_result($c3_result,0,"auctions");
if ($auctions > 0)
--$auctions;
$c4_query = "UPDATE counters SET auctions=$auctions";
if (!mysql_query($c4_query))
print "Fehler im System!";
}
else
{
$c4_query = "INSERT INTO counters VALUES (0,0)";
if (!mysql_query($c4_query))
print "Fehler im System!";
}
}
else
print "Fehler im System!";
}
else
{
$time = time();
$auctionends = $time;
$auctionends = date("YmdHis", $auctionends);
if ($atype == 1)
$query = "UPDATE auctions SET current_bid='$buy_now',quantity='$new_quantity', starts='$store_starts', ends='$auctionends' WHERE id=\"$id\"";
else
$query = "UPDATE auctions SET current_bid='$buy_now',quantity='$new_quantity', starts='$store_starts' WHERE id=\"$id\"";
}
if (!mysql_query($query))
{
print $ERR_001."<BR>$query<BR>".mysql_error();
exit;
}
$query = "INSERT INTO bids VALUES('$id','$bidder_id','$buy_now','$buy_now',NULL,'".intval($qty)." ','0')";
if (!mysql_query($query))
{
print $ERR_001."<BR>$query<BR>".mysql_error();
exit;
}
}
$win_res = mysql_query("SELECT * FROM users WHERE id='$bidder_id'");
if ($win_res)
{
$Winner = mysql_fetch_array($win_res);
}
// Endpreis für die eMail zur Verfügung stellen
$price = print_money($buy_now);
// String der Endzeit erstellen
$year = substr($Auction['ends'], 0, 4);
$month = substr($Auction['ends'], 5, 2);
$day = substr($Auction['ends'], 8, 2);
$hours = substr($Auction['ends'], 11, 2);
$minutes = substr($Auction['ends'], 14, 2);
$ends_string = $day.".".$month.".".$year." ".$hours.":".$minutes." Uhr";
if (isset($ERR))
{
$display_bid_form = true;
}
else
{
if ($atype == 2)
{
// eMail an den Verkäufer
include "./includes/buynow_winner.inc.php";
// eMail an den Käufer
include "./includes/buynow_youwin.inc.php";
// Bewertungstemplate eintragen (1x Käufer, 1x Verkäufer)
$fb1_sql = "INSERT INTO openfeedbacks (auction_id, auction_title, rater_id, rated_id)
VALUES ('$id', '$item_title', '$bidder_id', '$item_seller')";
$fb1_res = mysql_query($fb1_sql);
$fb2_sql = "INSERT INTO openfeedbacks (auction_id, auction_title, rater_id, rated_id)
VALUES ('$id', '$item_title', '$item_seller', '$bidder_id')";
$fb2_res = mysql_query($fb2_sql);
// abgeschlossenen Vorgang erzeugen
$item_end = $Auction["ends"];
$bid_when = date("YmdHis");
$item_price = $buy_now;
$item_qty = intval($qty);
$deal_sql = "INSERT INTO deals (auction, title, ends, bidwhen, seller, buyer, bid, quantity)
VALUES ('$id', '$item_title', '$item_end', '$bid_when',
'$item_seller', '$bidder_id', '$item_price', '$item_qty')";
$deal_res = mysql_query($deal_sql);
// Verkaufsprovision ermitteln
$last_bid = $item_price*$item_qty;
$my_query = "SELECT * FROM provisions WHERE".
"((min_val<=$last_bid AND max_val>=$last_bid) OR".
"(min_val<$last_bid AND max_val<$last_bid)) ORDER BY id DESC";
$my_result = mysql_query($my_query);
if (mysql_num_rows($my_result)>0)
$provision_value = mysql_result($my_result,0,"provision");
else
$provision_value = 0;
// Benutzergruppe feststellen
$benutzername = $nick;
$user_id = $password;
$TPL_nick = $benutzername;
$status_query = "SELECT * FROM users WHERE nick='$benutzername'";
$status_result = mysql_query($status_query);
if (!$status_result)
{
print "<H1>Fehler beim Bestimmen der Benutzergruppe!</H1>";
exit;
}
else
{
$benutzergruppe = mysql_result($status_result,0,"status");
}
// Wer wird berechnet? Private und/oder Gewerbliche?
$bill_query = "SELECT * FROM settings";
$bill_result = mysql_query($bill_query);
if (!$bill_result)
{
print "<H1>Fehler beim Lesen von Tabelle Settings!</H1>";
exit;
}
else
{
bitte um Info
mfg
Space7
Geändert von Space7 (11.02.2009 um 16:26:03 Uhr)
|