'') $query = 'select `id`, `pname`, `pimage` from `zsf_products` where `group_fk` = ' . $cat . ' order by `pname`'; else $query = 'select `id`, `pname`, `pimage` from `zsf_products` where `id` in (select `prodid_fk` from `zsf_specials` where `group_fk` = ' . $cat . ') order by `pname`'; $res = mysql_query($query, $conn); while ($row = mysql_fetch_array($res)) { $itemids[] = $row[0]; $products[$row[0]] = $row[1]; $imgs[$row[0]] = $row[2]; } $prodmenu = ''; $key = array_search($item, $itemids); $previd = $itemids[($key - 1)]; $nextid = $itemids[($key + 1)]; $prev = ($previd) ? '<< prev' : '<< prev'; $next = ($nextid) ? 'next >>' : 'next >>'; $query = 'select `pname`, `pimage`, `description`, `price`, `size`, `gname`, `gdir`, g.`id` from `zsf_products` p, `zsf_groups` g where p.`id` = ' . $item . ' and p.`group_fk` = g.`id`'; $res = mysql_query($query, $conn); list ($pname, $pimage, $description, $price, $size, $gname, $gdir, $gid) = mysql_fetch_row($res); if ($cat > 6) { $query = 'select `gname` from `zsf_groups` where `id` = ' . $cat; $res = mysql_query($query, $conn); list ($gname) = mysql_fetch_row($res); } if ($price == 0) { $query = 'select m.qty, m.price from zsf_products p, zsf_prices m where p.id = ' . $item . ' and p.price_fk = m.keyf'; $res = mysql_query($query, $conn); while ($row = mysql_fetch_assoc($res)) { extract($row); $prices[$qty] = $price; } } $query = 'select `sort`, `iname` from `zsf_images` where `prodid_fk` = ' . $item . ' order by sort'; $res = mysql_query($query, $conn); while ($row = mysql_fetch_assoc($res)) { extract($row); $images[$sort] = $iname; } $query = 'select `size` is_size, `qty` is_avail from `zsf_inventory` where `prodid_fk` = ' . $item; $res = mysql_query($query, $conn); while ($row = mysql_fetch_assoc($res)) { extract($row); $is_size = ($is_size) ? $is_size : 0; $instock[$is_size] = $is_avail; } $query = 'SELECT `phpsessid` pndg_sessid, `size` pndg_size, `qty` pndg_qty FROM `zsf_pending` where `prodid_fk` = ' . $item; $res = mysql_query($query, $conn); while ($row = mysql_fetch_assoc($res)) { extract($row); $pndg_size = ($pndg_size) ? $pndg_size : 0; $pending[$pndg_size] += $pndg_qty; if ($pndg_sessid == $_COOKIE['PHPSESSID']) { if ($pndg_size) { $basket[$pndg_size] = $pndg_qty; } else { $basket = $pndg_qty; } } } $query = 'select `size` csize, `price` cprice from `zsf_clearance` where `prodid_fk` = ' . $item . ' order by `size`'; $res = mysql_query($query, $conn); while ($row = mysql_fetch_assoc($res)) { extract($row); $clearprods[$csize] = $cprice; } } else { header('Location: ../index.html'); } //print_arr($pending); $enlarge = ($gdir == 'books') ? false : true; if (is_array($basket)) { $sizevals = array(); for ($i = 4; $i <= 24; $i += 2) { $sizevals[$i] = 0; } foreach($basket as $svsize => $svqty) { $svsize = ($svsize) ? $svsize : 0; $sizevals[$svsize] = $svqty; } } else { $sqty = ($basket) ? $basket : 0; } ?> <?php if ($pname) { echo $pname . ' / '; } ?>StreamFlies.com / 541-218-1994
' . $gname . ' : ' . $pname . '[back]

' . "\n"; echo ''; #echo '' . "\n"; echo '' . "\n"; echo '
' . $prev . '     ' . $prodmenu . '     ' . $next . '
' . "\n"; if ($enlarge) { echo '

Click the image to enlarge
' . $pname . '.jpg

' . "\n"; } else { echo '

' . $pname . '.jpg

' . "\n"; } if ($images) { echo '' . $pimage . '.jpg'; $imgno = 1; foreach($images as $img) { echo '' . $img . '.jpg'; } } echo '
'; echo 'Name: ' . $pname; if ($price > 0) { echo '
Price:'; } if (!($prices)) { if ($price > 0) { echo ' $' . $price; $iprice = $price; } } else { if ($prices[1] > 0) { echo ' $' . $prices[1]; $iprice = $prices[1]; } } if ($description) { echo '

Description:
' . $description . '

' . "\n"; } echo '

[back]

' . "\n"; $img_no = mt_rand(1, 4); ?>