\n"; echo "\n"; echo "\n"; echo "\n"; echo "$Titel - DeineWelt"; echo "\n"; echo "\">\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } elseif ( empty($id) && !empty($sessionVars["CURRENT_ITEM"]) ) { $id = $sessionVars["CURRENT_ITEM"]; } elseif ( empty($id) && empty($sessionVars["CURRENT_ITEM"]) ) { // error message include "header_auktion.php"; print "
$std_font $ERR_605
"; include "footer2.php"; exit; } require("header_auktion.php"); // now check if requested auction exists and is/isn't closed $AuctionIsClosed = false; $query = "SELECT * FROM auctions WHERE id='$id'"; $result = mysql_query ($query); if ( $result ) { // look if such auction exists if ( mysql_num_rows($result)>0 ) { $closed = intval(mysql_result($result,0,"closed")); // look if auction has a "closed" flag if ( $closed==1 ) { $AuctionIsClosed = true; } else { // look if auction isn't closed $c = mysql_result($result,0,"ends"); $c = strtotime($c); if ( $c<=time() ) { // auction is closed - set flag $AuctionIsClosed = true; } } } else { print "
".$std_font." $ERR_606
"; include "footer2.php"; exit; } } else { print "
".$std_font." $ERR_001
"; include "footer2.php"; exit; } $sessionVars["CURRENT_ITEM"] = $id; //putSessionVars(); /* $query = "select bid from bids where auction=\"$id\""; $result = mysql_query($query); if ( mysql_num_rows($result ) > 0) { $TPL_BIDS_value = "$MSG_105 | "; } */ /* $query = "select * from auctions where id='$id'"; $result = mysql_query($query); if ( !$result ) { print $ERR_001; exit; } */ $user = stripslashes(mysql_result ( $result, 0, "user" )); $title = strip_tags(stripslashes(mysql_result ( $result, 0, "title" ))); $date = mysql_result ( $result, 0, "starts" ); $description = stripslashes(mysql_result ( $result, 0, "description" )); $pict_url = mysql_result ( $result, 0, "pict_url" ); $pict_url2 = mysql_result ( $result, 0, "pict_url2" ); $pict_url3 = mysql_result ( $result, 0, "pict_url3" ); $num_bids = mysql_result ( $result, 0, "numbids" ); $category = mysql_result ( $result, 0, "category" ); $category2 = mysql_result ( $result, 0, "category2" ); $minimum_bid = mysql_result ( $result, 0, "minimum_bid" ); $reserve_price = mysql_result ( $result, 0, "reserve_price" ); $auction_type = mysql_result ( $result, 0, "auction_type" ); $location = mysql_result ( $result, 0, "location" ); $location_zip = mysql_result ( $result, 0, "location_zip" ); $shipping = mysql_result ( $result, 0, "shipping" ); $payment = mysql_result ( $result, 0, "payment" ); $international = mysql_result ( $result, 0, "international" ); #$ends = mysql_result ( $result, 0, "ends" ); $ends = strtotime(mysql_result($result,0,"ends")); $current_bid = mysql_result ( $result, 0, "current_bid" ); $phu = intval(mysql_result( $result,0,"photo_uploaded")); $atype = intval(mysql_result($result,0,"auction_type")); $iquantity = mysql_result ($result,0,"quantity"); $izustand = mysql_result ($result,0,"zustand"); $iartnr = mysql_result ($result,0,"artnr"); $izustand = mysql_result ($result,0,"zustand"); $buy_now = mysql_result ($result,0,"buynow"); $TPL_auction_type = $auction_types[$atype]; /* if ($atype==2) { */ $TPL_auction_quantity = $iquantity; /* } */ /* //-- Get RESERVE PRICE information if ($reserve_price > 0) { $TPL_reserve_price = "$MSG_030 "; //-- Has someone reached the reserve price? if($current_bid <= $reserve_price) { $TPL_reserve_price .= " ($MSG_514)"; } else { $TPL_reserve_price .= " ($MSG_515) "; } } else { $TPL_reserve_price = "$MSG_029"; } */ $TPL_id_value = $id; $TPL_artnr_value = $iartnr; $TPL_zustand_value = $izustand; $TPL_title_value = $title; $TPL_description_value = $description; $TPL_buy_now = $buy_now; $TPL_current_bid = $current_bid; $TPL_iquantity = $iquantity; if ($phu!=0) { $thumb_url = $thumb_path.$pict_url; $pict_url = $uploaded_path.$pict_url; } if ($phu!=0 && $pict_url2 <> "") { $thumb_url2 = $thumb_path.$pict_url2; $pict_url2 = $uploaded_path.$pict_url2; } if ($phu!=0 && $pict_url3 <> "") { $thumb_url3 = $thumb_path.$pict_url3; $pict_url3 = $uploaded_path.$pict_url3; } $query = "SELECT id,nick,certified,country,company,signature,status FROM users WHERE id='$user'"; $result_usr = mysql_query ( $query ); if ( !$result_usr ) { print $MSG_001; exit; } $user_nick = mysql_result ( $result_usr, 0, "nick"); $user_id = mysql_result ( $result_usr, 0, "id"); $status = mysql_result ( $result_usr, 0, "status"); $TPL_company = mysql_result ( $result_usr, 0, "company"); $TPL_stnr = mysql_result ( $result_usr, 0, "signature"); $status = mysql_result ( $result_usr, 0, "status"); $seller_cert = mysql_result ( $result_usr, 0, "certified"); $TPL_country = mysql_result ( $result_usr, 0, "country"); $TPL_user_nick_value = $user_nick; if ($status <> 0) { $tpl_status ="Gewerblicher Benutzer"; } else { $tpl_status ="Privater Benutzer"; } // Höchstgebot ermitteln //$query = "SELECT MAX(bid) AS maxbid FROM bids WHERE auction='$id' GROUP BY auction"; $query = "SELECT * FROM bids WHERE auction='$id' ORDER BY bidnum DESC"; $result_bids = mysql_query ( $query) ; if ( !$result_bids ) { print $MSG_001; exit; } if ( mysql_num_rows($result_bids ) > 0) { $high_bid = mysql_result ( $result_bids, 0, "bid" ); //$query = "select bidder from bids where bid=$high_bid and auction='$id'"; //$result_bidder = mysql_query ( $query ); $high_bidder_id = mysql_result ( $result_bids, 0, "bidder" ); } if ( !mysql_num_rows($result_bids) ) { $num_bids = 0; $high_bid = 0; } else { /* Get bidder nickname */ $query = "select id,nick,certified from users where id='$high_bidder_id'"; $result_bidder = mysql_query($query); if ( !$result_bidder ) { print $ERR_001; exit; } $high_bidder_id = mysql_result ( $result_bidder, 0, "id" ); $high_bidder_nick = mysql_result ( $result_bidder, 0, "nick" ); $high_bidder_cert = mysql_result ( $result_bidder, 0, "certified" ); } /* Get bid increment for current bis and calculate minimum bid */ $query = "SELECT increment FROM increments WHERE". "((low<=$high_bid AND high>=$high_bid) OR". "(low<$high_bid AND high<$high_bid)) ORDER BY increment DESC"; $result_incr = mysql_query ( $query ); if(mysql_num_rows($result_incr) != 0) { $increment = mysql_result ( $result_incr, 0, "increment" ); } if ($high_bid == 0) { $query = "SELECT increment FROM increments WHERE". "((low<=$minimum_bid AND high>=$minimum_bid) OR". "(low<$minimum_bid AND high<$minimum_bid)) ORDER BY increment DESC"; $result_incr = mysql_query ( $query ); $increment = mysql_result ( $result_incr, 0, "increment" ); $next_bid = $minimum_bid; } else { $next_bid = $high_bid + $increment; } if ( $pict_url ) { $TPL_pict_url_value = "" ."$MSG_108" .""; } $year = intval ( date("Y")); $month = intval ( date("m")); $day = intval ( date("d")); $hours = intval ( date("H")); $minutes = intval ( date("i")); $seconds = intval ( date("s")); $difference = $ends-time(); #$difference = intval( mktime( $ends_hours,$ends_minutes,$ends_seconds,$ends_month,$ends_day,$ends_year)) - time(); #test $testdifference=$difference; if ($difference > 0) { $TPL_days_difference_value = intval($difference / 86400).$MSG_126; $difference = $difference - ($TPL_days_difference_value * 86400); $hours_difference = intval($difference / 3600); if(strlen($hours_difference) == 1) { $hours_difference = "0".$hours_difference; } $TPL_hours_difference_value = $hours_difference.":"; $difference = $difference - ($hours_difference * 3600); $minutes_difference = intval($difference / 60); if (strlen($minutes_difference) == 1) { $minutes_difference = "0".$minutes_difference; } $TPL_minutes_difference_value = $minutes_difference.":"; $difference = $difference - ($minutes_difference * 60); $seconds_difference = $difference; if (strlen($seconds_difference) == 1) { $seconds_difference = "0".$seconds_difference; } $TPL_seconds_difference_value = $seconds_difference; } else { if (($buy_now == $current_bid) && ($current_bid <> 0)) $TPL_days_difference_value = " beendet "; else $TPL_days_difference_value = " $MSG_911 "; $TPL_hours_difference_value = ""; $TPL_minutes_difference_value = ""; $TPL_seconds_difference_value = ""; } $TPL_num_bids_value = $num_bids; $TPL_currency_value1 = print_money($minimum_bid); $TPL_currency_value2 = print_money($high_bid); $TPL_currency_value3 = print_money($increment); $TPL_currency_value4 = print_money($next_bid); $TPL_minimum_bid = $minimum_bid; // $TPL_next_bid = str_replace(".",",",$next_bid); $TPL_next_bid = number_format($next_bid,2,",",""); /* Bidding table */ $TPL_next_bid_value = $next_bid; $TPL_user_id_value = $user_id; $TPL_title_value = $title; $TPL_category_value = $category; $TPL_category_value2 = $category2; $TPL_id_value = $id; $TPL_artnr_value = $iartnr; $TPL_zustand_value = $izustand; $TPL_description_value = stripslashes($description); if ( $pict_url && file_exists($pict_url)) { $info1 = getimagesize($pict_url); if (intval($info1[0]) < 200) $breite1 = intval($info1[0]); else $breite1 = 200; $TPL_pict_url = $pict_url; $TPL_thumb_url = $thumb_url; } if ( $pict_url2 && file_exists($pict_url2)) { $info1 = getimagesize($pict_url2); if (intval($info1[0]) < 200) $breite1 = intval($info1[0]); else $breite1 = 200; $TPL_pict_url2 = $pict_url2; $TPL_thumb_url2 = $thumb_url2; } if ( $pict_url3 && file_exists($pict_url3)) { $info1 = getimagesize($pict_url3); if (intval($info1[0]) < 200) $breite1 = intval($info1[0]); else $breite1 = 200; $TPL_pict_url3 = $pict_url3; $TPL_thumb_url3 = $thumb_url3; } $TPL_location_name_value = $location; $TPL_location_zip_value = $location_zip; if ( $shipping == '1' ) { $TPL_shipping_value = $MSG_038; } else { $TPL_shipping_value = $MSG_032; } if ( $international ) { $TPL_international_value = ", $MSG_033"; } else { $TPL_international_value = ", $MSG_043"; } /* Get Payment methods */ $payment_methods = explode("\n",$payment); $i = 0; $c = count($payment_methods); $began = false; while ($i<$c) { if (strlen($payment_methods[$i])!=0 ) { if ($began) $TPL_payment_value .= ", "; else $began = true; $TPL_payment_value .= trim($payment_methods[$i]); } $i++; } $year = substr($date,0,4); $month = substr($date,5,2); $day = substr($date,8,2); $hours = substr($date,11,2); $minutes = substr($date,14,2); $seconds = substr($date,17,2); #$date_string = ArrangeDate($day,$month,$year,$hours,$minutes); $date_string = ArrangeDate($day,$month,$year,$hours,$minutes); $TPL_date_string1 = $date_string; $date = mysql_result($result,0,"ends"); $year = substr($date,0,4); $month = substr($date,5,2); $day = substr($date,8,2); $hours = substr($date,11,2); $minutes = substr($date,14,2); $date_string = ArrangeDate($day,$month,$year,$hours,$minutes); #$date_string = mysql_result($result,0,"ends"); $TPL_date_string2 = $date_string; $c_name[] = array(); $c_id[] = array(); $TPL_cat_value = ""; $query = "SELECT cat_id,parent_id,cat_name FROM categories WHERE cat_id='$category'"; $result = mysql_query($query); if ( !$result ) { print $ERR_001; exit; } $result = mysql_fetch_array ( $result ); $parent_id = $result[parent_id]; $cat_id = $categories; $j = $category; $i = 0; do { $query = "SELECT cat_id,parent_id,cat_name FROM categories WHERE cat_id='$j'"; $result = mysql_query($query); if ( !$result ) { print $ERR_001; exit; } $result = mysql_fetch_array ( $result ); if ( $result ) { $parent_id = $result[parent_id]; $c_name[$i] = $result[cat_name]; $c_id[$i] = $result[cat_id]; $i++; $j = $parent_id; } else { // error message print "
$err_font $ERR_620
"; include "footer2.php"; exit; } } while ( $parent_id != 0 ); for ($j=$i-1; $j>=0; $j--) { if ( $j == 0) { $TPL_cat_value .= "".$c_name[$j].""; } else { $TPL_cat_value .= "".$c_name[$j]." / "; } } //kategorie2 $TPL_cat_value2 = ""; $query = "SELECT cat_id,parent_id,cat_name FROM categories WHERE cat_id='$category2'"; $result = mysql_query($query); if ( !$result ) { print $ERR_001; exit; } $result = mysql_fetch_array ( $result ); $parent_id = $result[parent_id]; $cat_id = $categories; $j = $category2; if ($category2 != 0) { $i = 0; do { $query = "SELECT cat_id,parent_id,cat_name FROM categories WHERE cat_id='$j'"; $result = mysql_query($query); if ( !$result ) { print $ERR_001; exit; } $result = mysql_fetch_array ( $result ); if ( $result ) { $parent_id = $result[parent_id]; $c_name[$i] = $result[cat_name]; $c_id[$i] = $result[cat_id]; $i++; $j = $parent_id; } else { // error message print "
$err_font $ERR_620
"; include "footer2.php"; exit; } } while ( $parent_id != 0 ); for ($j=$i-1; $j>=0; $j--) { if ( $j == 0) { $TPL_cat_value2 .= "".$c_name[$j].""; } else { $TPL_cat_value2 .= "".$c_name[$j]." / "; } } } //ENDE Kategorie 2 $tabelle = "counter_auc"; $seite = $TPL_id_value; $sql = "SELECT * from $tabelle WHERE seite = '$seite'"; // Tabelle auslesen $result = mysql_query($sql); $werte = mysql_num_rows($result); if ($werte == 0) { $sql2 = "INSERT INTO $tabelle (seite,stand)"; // neu anlegen $sql2 .= "VALUES "; $sql2 .= "('$seite', '3')"; $result2 = mysql_query($sql2); if ($result2) { $TPL_counter = 1; } } else { $daten = mysql_fetch_array($result); $zaehler = $daten[stand]; $zaehler++; $sql3 = "UPDATE $tabelle SET stand='$zaehler' WHERE seite = '$seite'"; $result3 = mysql_query($sql3); if ($result3) { $TPL_counter = $zaehler; // Wert ausgeben } } $query = "SELECT * FROM users WHERE id='$user_id'"; $result = mysql_query ( $query ); if ($result) { if (mysql_num_rows($result)>0) { // Mitglied seit... $reg_date = mysql_result($result,0,"reg_date"); $MEMBER_SINCE = substr($reg_date,8,2); $MEMBER_SINCE.= ".".substr($reg_date,5,2); $MEMBER_SINCE.= ".".substr($reg_date,0,4); $user_nick = mysql_result($result,0,"nick"); } } // Anzahl positiver Bewertungen $pos_sql = "SELECT COUNT(*) AS total FROM auc_feedback WHERE user_id='$user_id' AND rating='1'"; $pos_res = mysql_query($pos_sql); if ($pos_res) $pos_feedbacks = mysql_result($pos_res,0,"total"); else $pos_feedbacks = 0; // Anzahl negativer Bewertungen $neg_sql = "SELECT COUNT(*) AS total FROM auc_feedback WHERE user_id='$user_id' AND rating='-1'"; $neg_res = mysql_query($neg_sql); if ($neg_res) $neg_feedbacks = mysql_result($neg_res,0,"total"); else $neg_feedbacks = 0; // Anzahl neutraler Bewertungen $neut_sql = "SELECT COUNT(*) AS total FROM auc_feedback WHERE user_id='$user_id' AND rating='0'"; $neut_res = mysql_query($neut_sql); if ($neut_res) $neut_feedbacks = mysql_result($neut_res,0,"total"); else $neut_feedbacks = 0; // tp 26.10.2005 Weitere Auktionen des Verkäufers Anfang mt_srand((double)microtime()*1000000); $zufall = mt_rand(0, 7); if ($zufall == 0) $order = "id"; elseif ($zufall == 1) $order = "title"; elseif ($zufall == 2) $order = "ends"; elseif ($zufall == 3) $order = "current_bid"; elseif ($zufall == 4) $order = "starts"; else $order = "user"; $query = "SELECT * FROM auctions WHERE closed='0' AND user = '$user' ORDER BY ".$order." desc LIMIT 0 , 10"; $result = mysql_query($query); if ($result) { $num_auction = mysql_num_rows($result); $i = 0; while ($i<$num_auction) { $galerie_ort[$i] = mysql_result($result,$i,"location"); $galerie_id[$i] = mysql_result($result, $i, "id"); $galerie_pic[$i] = mysql_result($result, $i, "pict_url"); $galerie_title[$i] = strip_tags(stripslashes(mysql_result($result, $i, "title"))); $galerie_price[$i] = mysql_result($result, $i, "current_bid"); $galerie_phu[$i] = mysql_result($result, $i, "photo_uploaded"); if ($galerie_price[$i]==0) $galerie_price[$i] = mysql_result($result, $i, "minimum_bid"); if ($galerie_pic[$i]=="") $galerie_pic[$i] = "no_pic.gif"; if (!$galerie_phu[$i]) $galerie_pic[$i] = "no_preview.gif"; $galerie_pic[$i] = $thumb_path.$galerie_pic[$i]; $i++; } $tpl = ""; // 1. Zeile -------------------------------------------- if ($num_auction>=1) { $scale1 = get_imageprops($galerie_pic[0],100); $tpl_bild1 = ""; $tpl_bild1.= "
\n"; if (strlen($galerie_title[0])>22) $galerie_title[0] = substr($galerie_title[0],0,22)."..."; $tpl_txt1.= "".$galerie_title[0]."
\n"; $tpl_txt12.= print_money($galerie_price[0])."
\n"; $tpl_txt13.= $galerie_ort[0]. " "; $tpl_txt1.= "
\n"; } else { $tpl_bild1 = ""; $tpl_txt1 = ""; } if ($num_auction>=2) { $scale2 = get_imageprops($galerie_pic[1],100); $tpl_bild2 = ""; $tpl_bild2.= "
\n"; if (strlen($galerie_title[1])>22) $galerie_title[1] = substr($galerie_title[1],0,22)."..."; $tpl_txt2.= "".$galerie_title[1]."
\n"; $tpl_txt22.= print_money($galerie_price[1])."
\n"; $tpl_txt23.= $galerie_ort[1]. " "; $tpl_txt2.= "
\n"; } else { $tpl_bild2 = ""; $tpl_txt2 = ""; } if ($num_auction>=3) { $scale3 = get_imageprops($galerie_pic[2],100); $tpl_bild3 = ""; $tpl_bild3.= "
\n"; if (strlen($galerie_title[2])>22) $galerie_title[2] = substr($galerie_title[2],0,22)."..."; $tpl_txt3.= "".$galerie_title[2]."
\n"; $tpl_txt32.= print_money($galerie_price[2])."
\n"; $tpl_txt33.= $galerie_ort[2]. " "; $tpl_txt3.= "
\n"; } else { $tpl_bild3 = ""; $tpl_txt3 = ""; } // 2. Zeile -------------------------------------------- if ($num_auction>=4) { $scale4 = get_imageprops($galerie_pic[3],100); $tpl_bild4 = ""; $tpl_bild4.= "
\n"; if (strlen($galerie_title[3])>22) $galerie_title[3] = substr($galerie_title[3],0,22)."..."; $tpl_txt4.= "".$galerie_title[3]."
\n"; $tpl_txt42.= print_money($galerie_price[3])."
\n"; $tpl_txt43.= $galerie_ort[3]. " "; $tpl_txt4.= "
\n"; } else { $tpl_bild4 = ""; $tpl_txt4 = ""; } if ($num_auction>=5) { $scale5 = get_imageprops($galerie_pic[4],100); $tpl_bild5 = ""; $tpl_bild5.= "
\n"; if (strlen($galerie_title[4])>22) $galerie_title[4] = substr($galerie_title[4],0,22)."..."; $tpl_txt5.= "".$galerie_title[4]."
\n"; $tpl_txt52.= print_money($galerie_price[4])."
\n"; $tpl_txt53.= $galerie_ort[4]. " "; $tpl_txt5.= "
\n"; } else { $tpl_bild5 = ""; $tpl_txt5 = ""; } if ($num_auction>=6) { $scale6 = get_imageprops($galerie_pic[5],100); $tpl_bild6 = ""; $tpl_bild6.= "
\n"; if (strlen($galerie_title[5])>22) $galerie_title[5] = substr($galerie_title[5],0,22)."..."; $tpl_txt6.= "".$galerie_title[5]."
\n"; $tpl_txt62.= print_money($galerie_price[5])."
\n"; $tpl_txt63.= $galerie_ort[5]. " "; $tpl_txt6.= "
\n"; } else { $tpl_bild6 = ""; $tpl_txt6 = ""; } // 3. Zeile -------------------------------------------- if ($num_auction>=7) { $scale7 = get_imageprops($galerie_pic[6],100); $tpl_bild7 = ""; $tpl_bild7.= "
\n"; if (strlen($galerie_title[6])>22) $galerie_title[6] = substr($galerie_title[6],0,22)."..."; $tpl_txt7.= "".$galerie_title[6]."
\n"; $tpl_txt72.= print_money($galerie_price[6])."
\n"; $tpl_txt73.= $galerie_ort[6]. " "; $tpl_txtd7.= "
\n"; } else { $tpl_bild7 = ""; $tpl_txt7 = ""; } if ($num_auction>=8) { $scale8 = get_imageprops($galerie_pic[7],70,70); $tpl_bild8 = ""; $tpl_bild8.= "
\n"; if (strlen($galerie_title[7])>22) $galerie_title[7] = substr($galerie_title[7],0,22)."..."; $tpl_txt8.= "".$galerie_title[7]."
\n"; $tpl_txt82.= print_money($galerie_price[7])."
\n"; $tpl_txt83.= $galerie_ort[7]. " "; $tpl_txt8.= "
\n"; } else { $tpl_bild8 = ""; $tpl_txt8 = ""; } if ($num_auction>=9) { $scale9 = get_imageprops($galerie_pic[8],70,70); $tpl_bild9 = ""; $tpl_bild9.= "
\n"; if (strlen($galerie_title[8])>22) $galerie_title[8] = substr($galerie_title[8],0,22)."..."; $tpl_txt9.= "".$galerie_title[8]."
\n"; $tpl_txt92.= print_money($galerie_price[8])."
\n"; $tpl_tx93.= $galerie_ort[8]. " "; $tpl_txt9.= "
\n"; } else { $tpl_bild9 = ""; $tpl_txt9 = ""; } } // ENDE tp 26.10.05 include ("./templates/tpl_item.html"); require("footer2.php"); # tests: /*$idabfrage= "SELECT * FROM auctions WHERE id='$id'"; $ergebnis= mysql_query($query); $ablaufdat = mysql_result($result,0,"ends"); echo "
    "; echo "
  1. "; echo $ablaufdat; echo " Ablaufdatum
    "; echo "
  2. "; echo $testdifference; echo "
  3. "; echo $hours_difference; echo "
  4. "; echo $minutes_difference; echo "
  5. "; echo $seconds_difference; echo "
  6. "; #$buy_now == $current_bid) echo $buy_now."
    "; echo $current_bid; if (($buy_now == $current_bid) && ($current_bid <> 0)) $TPL_days_difference_value = " beendet "; else $TPL_days_difference_value = " $MSG_911 "; echo ""; */ ?>