$price) { $q[$n][1] = $qty; $p[$n] = $price; ++$n; } for ($i = 1; $i <= count($q); $i++) { $n = $i + 1; $q[$i][2] = $q[$n][1] - 1; } $query = 'select s.`group_fk`, s.`prodid_fk`, p.`pname`, p.`pimage`, g.`gdir` from `zsf_products` p, `zsf_specials` s, `zsf_groups` g where s.`prodid_fk` = p.`id` and p.`group_fk` = g.`id` order by s.`group_fk`, p.`pname`'; $res = mysql_query($query, $conn); while ($row = mysql_fetch_assoc($res)) { extract($row); $arr[$group_fk][] = array($prodid_fk, $pname, $pimage, $gdir, $group_fk); } $query = 'select sum(`qty`) from `zsf_inventory`'; $res = mysql_query($query, $conn); list ($totqty) = mysql_fetch_row($res); $query = 'select sum(o.`item_qty`) AS `item_qty`, o.`pname` AS `pname`, o.`item_id` AS `prodid_fk`, p.`pimage` AS `pimage` from `zsf_ordered` o, `zsf_products` p where o.`item_qty` = p.`id` and p.`group_fk` = 1 and `trans_date` > date_sub(curdate(), interval 7 day) group by o.`pname` order by 1 desc, 2 limit 8'; $res = mysql_query($query, $conn); while ($row = mysql_fetch_assoc($res)) { extract($row); $temps[$pname] = array($prodid_fk, $pname, $pimage, $gdir, 19); } if ($temps) { ksort($temps); foreach($temps as $varr) { list($prodid_fk, $pname, $pimage, $gdir, $group_fk) = $varr; // $arr[$group_fk][] = array($prodid_fk, $pname, $pimage, $gdir, $group_fk); $insert_top_sellers_of_the_week[] = "('', 19, '$prodid_fk')"; } $query = 'delete from `zsf_specials` where `group_fk` = 19'; $res = mysql_query($query, $conn); $query = 'insert into `zsf_specials` values '; $query .= implode(', ', $insert_top_sellers_of_the_week); $res = mysql_query($query, $conn); } #print_r($temps); #asort($arr[19]); if (count($arr[7]) >= 8) { foreach (array_rand($arr[7], 8) as $prodkey) { $newprods[] = $arr[7][$prodkey]; } } $query = 'select `pdate`, `name`, `bcopy` from `zsf_fishpiccontest` order by `pdate` desc'; $res = mysql_query($query, $conn); list ($fpdate, $fpname, $fpcopy) = mysql_fetch_row($res); $fpimg = substr($fpdate, 0, 4) . substr($fpdate, 5, 2) . '.jpg'; ?>
Welcome to StreamFlies.comYour source for premium fishing flies at rock bottom prices!At Stream Flies, our mission for the past six years has been to supply the fly fishing community with the finest fishing flies at the best possible prices. A successful fly fishing experience depends greatly on the quality and diversity of the fishing flies in your fly box. No matter what type of fish you’re pursuing, chances are you’ll find the right fly pattern on our Quick View Page. We offer a wide selection of premium trout flies, salmon flies and custom steelhead flies. Most of our flies are 50 cents each. Please check back often for your favorite fly patterns as our inventory is constantly changing. NEW PRODUCTS!' . "\n"; $n = 0; while ($n < count($newprods)) { echo '"; // $href = '"/images/products/fullsize/'. $pdir . '/' . $pimage . '.jpg" target="_blank"'; // $href = '"/products/detail.html?i=' . $id . '&c=' . $group_fk . '"';// target="_blank"'; $href = '"/products/?s=s7"';// target="_blank"'; echo ' | ";
++$n;
}
}
echo ''; echo '' . $pname . " |
'; echo '' . $pname . " | ";
++$n;
}
}
echo '
© 2014 Stream Flies. All Rights Reserved.
Customer Service:
(432) 247-5531
Sorry, we do not accept
phone orders.
Customer Service Hours:
Monday – Friday,
noon – 6 p.m. CT
Email:
philip@streamflies.com