function htmldecode($encoded) {
return strtr($encoded,array_flip(get_html_translation_table(HTML_ENTITIES)));
}
$link = mysql_connect("mysql3.ezhostingserver.com", "evildj", "pbhell");
mysql_select_db("myhnt4b054");
$max_display = 25;
$start = (empty($_GET[start])) ? 0 : $_GET[start];
$query1 = "SELECT ID FROM products WHERE whats_hot = 'y'";
$query2 = "SELECT * FROM products WHERE whats_hot = 'y' ORDER BY ID DESC";
$result = mysql_query($query1);
$num_records = mysql_num_rows($result);
if (!$num_records) {
header("Location:custom_requests.php");
exit;
}
if ($num_records > $max_display) {
$z = 1;
for ($x = 0; $x < $num_records; $x += $max_display) {
if ($x == $start) {
$pages .= "
";
} else {
$pages .= "
";
}
$z++;
}
if ($start + $max_display < $num_records) {
$next = "
";
}
if ($start - $max_display >= 0) {
$prev = "
";
}
$links = $prev . $pages . $next;
}
$result = mysql_query($query2);
$rows = mysql_num_rows($result);
if ($rows) {
$x = 0;
$per_row = 3;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$img = (empty($line[photo])) ? " " :
"" .
"
";
if ($x % $per_row == 0) $listings .= "
";
$listings .= "| " .
"$line[title] | " .
" " . htmldecode(nl2br($line[description])) . " " .
" | " .
"$img |
| ";
$x++;
if ($x % $per_row == 0) $listings .= "
\n\n";
}
if ($x % $per_row != 0) $listings .= "\n\n";
} else {
$listings = "| No Matching Listings - Please Call for Availability |
";
}
$query = "SELECT * FROM subcategories WHERE cat = '6' AND searchable = 'y' ORDER BY subcat";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$types[] = "$line[ID]^$line[subcat]";
}
$query = "SELECT * FROM buckle_sizes";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$sizes[] = "$line[ID]^$line[size]";
}
$query = "SELECT * FROM buckle_materials";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$materials[] = "$line[ID]^$line[material]";
}
$query = "SELECT * FROM artists";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$artists[] = "$line[initials]^$line[artist]";
}
function buckle_colors($ex_color_code) {
global $colors, $buckle_size;
$color_options = "\n";
return $color_options;
}
function buckle_sizes($size_ids) {
global $sizes;
$selected = (empty($size_ids)) ? " selected" : "";
$size_str = (empty($size_ids)) ? "" : $size_ids;
$size_options = "\n";
return $size_options;
}
function buckle_types($type_id) {
global $types, $buckle_size;
$type_options = "\n";
return $type_options;
}
function buckle_materials($material_id) {
global $materials, $buckle_size;
$materials_options = "\n";
return $materials_options;
}
function artists($artist_id) {
global $artists, $buckle_size;
$artists_options = "\n";
return $artists_options;
}
?>
:: Welcome to Falconhead - Boots - Belts - Buckles ::