Classified ads for antique radios,
televisions, phonographs,
radio-related stuff, tubes, parts, memorabilia, and OTR.
";
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
foreach($row as $adModelFirstChar):
echo "$adModelFirstChar ";
endforeach;
}
mysqli_free_result($result);
echo " ";
echo " |
";
$today = date("Y-m-d");
$todayPlusSixty = date("Y-m-d", strtotime($today . " +60 days"));
$openEndDate = date("n/d/Y", strtotime("$todayPlusSixty"));
$firstChar = "";
$query = "SELECT * FROM wantedads WHERE ad_status = 'P' ORDER BY ad_model";
$result = mysqli_query($link,$query) or die("Query failed : " . mysqli_error($link));
$numRows = mysqli_num_rows($result);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
$adId = $row["ad_id"];
$adName = $row["ad_name"];
$adNameShow = $row["ad_name_show"];
$adEmail = $row["ad_email"];
$adEmailShow = $row["ad_email_show"];
$adPhone = $row["ad_phone"];
$adPhoneShow = $row["ad_phone_show"];
$adModel = $row["ad_model"];
$adText = $row["ad_text"];
$adStatus = $row["ad_status"];
$adIsitNew = $row["ad_isit_new"];
$adPostDate = $row["ad_post_date"];
$adEndDate = $row["ad_end_date"];
$postDatePlusSixty = date("Y-m-d", strtotime($adPostDate . " +60 days"));
$endingDate = date("F j", strtotime("$adEndDate"));
if ($adEndDate == '0000-00-00') {
$endDate = date("n/d/Y", strtotime("$postDatePlusSixty"));
} else {
$endDate = date("n/d/Y", strtotime("$adEndDate"));
}
$formatedAdId = "W".substr("0000000".$adId, -7);
$saleText = "";
$newText = "";
if ($adIsitNew == 'Y') {
$newText = '
';
}
if ($firstChar <> substr($adModel,0,1)) {
$firstChar = substr($adModel,0,1);
echo "";
echo "
$firstChar ";
echo "";
echo "";
}
echo "| ";
echo "$adModel. $newText ";
echo $adText;
if ($adNameShow == 'Y'){
echo " ".$adName;
}
if ($adEmailShow == 'Y') {
echo " ";
echo " E-mail: ".$adEmail;
}
if ($adPhoneShow == 'Y') echo " ".$adPhone;
echo " (ends ".$endDate.")";
echo " (".$formatedAdId.")";
echo " |
";
}
echo "
";
echo "
";
include "pagebottom.htm";
function countWantedAds($link) {
$query = "SELECT count(1) FROM wantedads WHERE (ad_status = 'P') ";
$result = mysqli_query($link,$query) or die("Query failed : " . mysqli_error($link));
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$ad_count = $row["count(1)"];
return $ad_count;
}
?>