"; // To disable the site, uncomment the following block by removing the slash-star /* echo "

Our site is currently down for repairs.
Please call 315-253-9545 for orders or questions.
Or email quiltedtoatee@a-znet.com
Happy Quilting!

"; die(); */ // End of site disabling block mark_hit($hdrPage); } function left_bar(){ $sql = new MySql_class; $sql->Connect(); echo "








































































"; /* show all categories */ $sql->Query("select * from categories"); for ($i = 0 ; $i < $sql->rows ; $i++) { $sql->Fetch($i); category_show_style($sql, "featured", "1"); } /* */ /* Show featured items echo "

Featured Items


"; $sql->Query("select products.* from products,catprodmap,categories where categories.Name=\"Featured Items\" and categories.ID=catprodmap.cID and catprodmap.pID=products.ID"); for ($i = 0 ; $i < $sql->rows ; $i++) { $sql->Fetch($i); product_show_style($sql, "featured", "1"); } */ echo "
"; } function footer() { echo " "; } function mark_hit($pageName) { $sql = new MySQL_class; $sql->Connect(""); $sql->Query("update hits set numhits=numhits+1, today=today+1, week=week+1, mnth=mnth+1, yr=yr+1 where page='".$pageName."'"); } function fmqkpage() { $fmqkteaser = "What exactly is the Free-Motion Quilt Kit and how does it work? Click now to find out!"; return "onClick=\"popUp('http://www.quiltedtoatee.com/fmqk.php')\""; } function category_show($sqlclass) { return category_show_style($sqlclass, "store", "1"); } function category_show_style($sqlclass, $style, $numpics) { $othersqlclass = new MySQL_class; $othersqlclass->Connect(); switch ($style) { case "featured": $picsize = "tiny"; break; case "store": $picsize = "tiny"; break; case "detail": $picsize = "scaled"; break; case "large": $picsize = "full"; break; } $id = $sqlclass->data['ID']; //$desc = $sqlclass->data['Desc']; $name = $sqlclass->data['Name']; $picarray = array(); $othersqlclass->Query("SELECT pictures.ID, pictures.filename, pictures.desc\n". "FROM pictures, picprodmap, catprodmap, categories\n". "WHERE pictures.ID = picprodmap.picID and ". "picprodmap.prodID = catprodmap.pID and ". "catprodmap.cID = '".$id."'\n". "LIMIT ".$numpics); for ($i = 0 ; $i < $othersqlclass->rows ; $i++) { $othersqlclass->Fetch($i); $pictureid = $othersqlclass->data['filename']; $picturedesc = $othersqlclass->data['desc']; $picarray[$pictureid] = $picturedesc; //if ($othersqlclass->[preffered] == "yes") $showpic = $pictureid; } if ($style == "featured") { echo "\n$name
"; foreach ($picarray as $picid => $blah) { echo "\n
"; } echo "
"; } echo "

"; } function show_ship_date($stock) { $tomorrow = time() + 111600; if (date("w", $tomorrow) == "0") $tomorrow += 86400; //give her sunday off if ($stock > 0) { //blah } else { $tomorrow += 518400; } echo "\n
This item will ship on or before " . date("D\, M j", $tomorrow) . "\n"; } function product_show($sqlclass) { return product_show_style($sqlclass, "store", "1"); } function getProductInfo($id) { $sql = new MySQL_class; $sql->connect(""); $query=" SELECT Name, Stock, Price, invblocker, pictures.filename FROM pictures, products, picprodmap WHERE pictures.ID = picprodmap.picID AND picprodmap.prodID = products.ID AND products.ID = '" . $id . "' "; $sql->QueryRow($query); $returnarray = array(); $returnarray['name'] = $sql->data['Name']; $returnarray['price'] = $sql->data['Price']; $returnarray['thumb'] = "/images/products/" . $sql->data['filename'] . ".tiny.jpg"; $returnarray['inventory'] = $sql->data['Stock']; if (! $sql->data['invblocker']) { // Prevent rmbcart from blocking low-inventory items $returnarray['inventory'] = 10000; //Whoever put 10000 widgits in their cart first wins! } return $returnarray; } function product_show_style($sqlclass, $style, $pictargetid) { $othersqlclass = new MySQL_class; $othersqlclass->Connect(""); switch ($style) { case "featured": $picsize = "tiny"; break; case "store": $picsize = "tiny"; break; case "detail": $picsize = "scaled"; break; case "large": $picsize = "full"; break; } $id = $sqlclass->data['ID']; $desc = $sqlclass->data['Desc']; $stock = $sqlclass->data['Stock']; $price = $sqlclass->data['Price']; $ship = $sqlclass->data['Shipping']; $name = $sqlclass->data['Name']; $picarray = array(); $othersqlclass->Query("SELECT pictures.ID, pictures.filename, pictures.desc FROM pictures, picprodmap WHERE picprodmap.picID = pictures.ID and picprodmap.prodID = '$id'"); for ($i = 0 ; $i < $othersqlclass->rows ; $i++) { $othersqlclass->Fetch($i); $pictureid = $othersqlclass->data['filename']; $picturedesc = $othersqlclass->data['desc']; $picarray[$pictureid] = $picturedesc; //if ($othersqlclass->[preffered] == "yes") $showpic = $pictureid; } if ($style == "featured") { echo "\n$name
"; if ((strstr(strtolower($name), "combo")) || (strstr(strtolower($name), "christmas card"))) { foreach ($picarray as $picid => $blah) { echo "\n
"; } } else { echo "\n
"; } } if ($style == "store") { if ((strstr(strtolower($name), "combo")) || (strstr(strtolower($name), "christmas card"))) { foreach ($picarray as $picid => $blah) { echo ""; } } else { echo ""; } } if ($style == "detail") { echo "
"; foreach ($picarray as $pictureid => $picturedesc) { if ($pictureid == $pictargetid) echo "\"".$picturedesc."\""; else echo " "; } echo "
"; } if ($style == "large") { echo ""; } if (($style != "large") && ($style != "featured")) { echo "

$name

"; if ($name == "Free-Motion Quilting Kit") echo "
".$desc."
"; else echo $desc; if ($style == "store") show_ship_date($stock); if ($style != "store") echo "


"; echo "
\$$price
Shipping: \$$ship
"; /************Paypal Shopping Cart echo "
"; ************End Paypal Shopping Cart */ echo " Click here to add to cart "; echo "
"; echo getCurrentOrder()->sayquan($id); echo "
"; echo "
"; if ($style == "store") echo "


"; } } function view_cart() { /************** Paypal View Cart echo "
"; *************** End Paypal View Cart */ echo " View Cart "; } function make_link($sqlclass) { $linktext = $sqlclass->data[text]; $linkhref = $sqlclass->data[href]; $linkdesc = $sqlclass->data[desc]; if ($linktext == "") $linktext = $linkhref; $linktext = str_replace(" ", " ", $linktext); return "".$linktext.""; } /* function
*/ function isValidEmail($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } ?>