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");
if (isset($_GET[id])) {
$max_display = 15;
$start = (empty($_GET[start])) ? 0 : $_GET[start];
$id = (!empty($_GET["id"])) ? $_GET["id"] : $_GET["id"];
if (!$id) {
/*
$pics = $_SERVER["DOCUMENT_ROOT"]."/photos";
chmod($pics, 0777);
chmod("$pics/product_photos", 0777);
chmod("$pics/product_photos/thumbs", 0777);
chmod("$pics/thumbs", 0777);
*/
header("Location:index.php");
exit;
}
$query1 = "SELECT ID FROM products_new WHERE (subcat = '$id' OR subcat LIKE '$id,%' OR subcat LIKE '%,$id' OR subcat LIKE '%,$id,%')";
$query2 = "SELECT * FROM products_new WHERE (subcat = '$id' OR subcat LIKE '$id,%' OR subcat LIKE '%,$id' OR subcat LIKE '%,$id,%')";
if (!empty($_POST[boot_size]) || !empty($_GET[boot_size])) {
$boot_size = (!empty($_POST[boot_size])) ? $_POST[boot_size] : $_GET[boot_size];
$size_query = " AND sizes LIKE '%" . $boot_size . "%'";
} else {
$boot_type = (!empty($_POST[boot_type])) ? $_POST[boot_type] : $_GET[boot_type];
if ($boot_type == 1) {
$type_query = " AND (types = '1' OR types LIKE '1,%')";
} else {
$type_query = (!empty($boot_type)) ? " AND types LIKE '%$boot_type%'" : "";
}
$boot_materials = (!empty($_POST[boot_materials])) ? $_POST[boot_materials] : $_GET[boot_materials];
if ($boot_materials == 1) {
$material_query = " AND (materials = '1' OR materials LIKE '1,%')";
} else {
$material_query = (!empty($boot_materials)) ? " AND materials LIKE '%$boot_materials%'" : "";
}
$boot_color = (!empty($_POST[boot_color])) ? $_POST[boot_color] : $_GET[boot_color];
$color_query = (!empty($boot_color)) ? " AND color LIKE '$boot_color%'" : "";
}
$order_query = " ORDER BY ID DESC";
$limit_query .= " LIMIT $start, $max_display";
$query1 .= $type_query . $material_query . $color_query . $size_query;
$result = mysql_query($query1);
$num_records = mysql_num_rows($result);
// echo $query1."...".$query2;
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;
}
$query2 .= $type_query . $material_query . $color_query . $size_query . $order_query . $limit_query;
$result = mysql_query($query2);
$rows = mysql_num_rows($result);
if ($rows) {
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$img = (empty($line[photo])) ? " " :
"" .
"
" .
"
";
$listings .= "
| " .
"$line[title] |
" .
" " .
htmldecode(nl2br($line[description])) . " " .
" | " .
"$img |
";
}
} else {
$listings = "| No Matching Listings - Please Call for Availability |
";
}
}
$query = "SELECT * FROM boot_types";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$types[] = "$line[ID]^$line[boot_type]";
}
$query = "SELECT * FROM boot_sizes";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$sizes[] = "$line[code]^$line[size]";
}
$query = "SELECT * FROM boot_materials";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$materials[] = "$line[ID]^$line[boot_material]";
}
$query = "SELECT * FROM colors";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$colors[] = "$line[code]^$line[color]";
}
function boot_colors($ex_color_code) {
global $colors, $boot_size;
$color_options = "\n";
return $color_options;
}
function boot_sizes($size_ids) {
global $sizes;
$selected = (empty($size_ids)) ? " selected" : "";
$size_str = (empty($size_ids)) ? "" : $size_ids;
$size_options = "\n";
return $size_options;
}
function boot_types($type_id) {
global $types, $boot_size;
$type_options = "\n";
return $type_options;
}
function boot_materials($material_id) {
global $materials, $boot_size;
$materials_options = "\n";
return $materials_options;
}
?>
:: Welcome to Falconhead - Boots - Belts - Buckles ::