eof()) { $ProductTypeId = $productType->gcv("ProductTypeId"); } for ($f=0; $f<$productType->fieldCount; $f++) { for ($r=0; $r < $productType->count; $r++) { if (!$productType->gcv(0, $f)) { $productType->scv(0, $productType->gcv($r, $f)); } } } $allProductTypeIds = $productType->getDataAsList(array("ProductTypeId")); } $scripts["/accounts/viewartwork.js"] = 1; $scripts["/_/js/events.js"] = 1; /*$pricelists = sqlr("select ProductTypeId, ProductTypeName from PriceLists where Name like 'hwt' group by ProductTypeId, ProductTypeName order by ProductTypeName"); $pricelistsTb = new Table("pricelists", $pricelists); $pricelistsTb->setFieldTypes(array( "ProductTypeName" => cf('$t,$v',' ?>">setLabels(array("ProductTypeName" => "Product Category"));*/ function doSpecials() { $tppInfo = sqlr("select Specials, SpecialsDate from tppInfo"); if ($tppInfo->gcv("Specials")) { ?>
(gcv("SpecialsDate"));?>)
Please register to receive our weekly specials.
run(); }*/ } //////////////////////////////////////////////////////////////////////// /// Show pricelist //////////////////////////////////////////////////////////////////////// else { $plSb = new SqlBuilder("select PriceLists.ProductId, null as ProductImageUpload, null as ProductImage, ProductTypes.ProductTypeName, min(ProductTypes.Description) as TypeDescription, SubCategoryName, Name, null as Quantity, null as Price, LastUpdate, WebDir, min(ProductWebDetails.HasThumb) as HasThumb, min(PriceLists.WebSpecial) as WebSpecial from ((PriceLists left join ProductWebDetails on PriceLists.ProductId = ProductWebDetails.ProductId) left join ProductTypes on PriceLists.ProductTypeId = ProductTypes.ProductTypeId)", "group by ProductTypes.ProductTypeName, SubCategoryName, Name, PriceLists.ProductId, LastUpdate, WebDir", null, SQLC("and", array( $subsite, "(Name like '".toSqlStringRaw($subsite)."%' or Name like '%[".toSqlStringRaw($subsite)."]%')", !$subsite, "Name not regexp '\\\\[".join($TPP_SUBSITES,"|")."\\\\]'", count($allProductTypeIds) > 0, "ProductTypes.ProductTypeId in (".join($allProductTypeIds, ",").")", $productSearch, keywordSearch($productSearch, array("ProductTypes.ProductTypeName", "Name")), $subcat, "SubCategoryName = ".toSqlString(preg_replace('#_#', ' ', $subcat)), ))); $pricelist = sqlr($plSb->getString(), $pg, 50); $pg_title = $productSearch ? "Product Search Results" : $pricelist->gcv("ProductTypeName"); $pg_nav = array('the print place', $pg_title); function pg_head_next() { global $pricelist; if ($pricelist->gcv("SubCategoryName")=="") { ?>gcv("ProductTypeName"))); function pg_body() { global $vars, $pricelist, $pricelistsTb, $productIndexShown, $productSearch, $APA_imageUpload, $subsite, $TPP_SUBSITES; foreach ($vars as $v) { global $$v; } //doSpecials(); if (!$productIndexShown) { ?>
run();?>
getString()); if ($subcats->count>1) { $subcatMenu = new Lookup(array("id" => "subcat", "rs" => $subcats, "firstOptions" => array("", "Subcategories >"))); $subcatMenu->setProps(array("onchange" => "window.location.href = '".($subsite?"/".$subsite:"")."/products/".$pricelist->gcv("WebDir")."/'+this.value+'/';")); $subcatMenu->run(); ?>moveFirst(); !$subcats->eof(); $subcats->moveNext()) { if (!$first) { echo " · "; } else { $first = false; } ?>/gcv("SubCategoryName")))?>/">gcv("SubCategoryName"))?>gcv("WebDir")."/*.jpg" )); function randomize(&$arr) { for ($i=0; $i

Samples

gcv("WebDir")."/".$entry; $largeImageName = preg_replace('|.jpg|', '-large.jpg', $imageName); $size = getimagesize(mapPath($largeImageName)); ?>
<?echo $pricelist->gcv( Sample " title="gcv("ProductTypeName")?> Sample " />
includeStyle = false; $pricelistTb->hdrRsMoveNext = false; if ($productSearch) { $pricelistTb->setAllGroups(array("ProductTypeName:ProductTypeName:*", "SubCategoryName:SubCategoryName:*")); } else { $pricelistTb->setAllGroups(array("SubCategoryName:SubCategoryName:*")); } $pricelistTb->setTotalsRs("SubCategoryName", new Recordset(array("s_Quantity", "s_Price"), array(-1, -1))); for ($pricelist->moveFirst(); !$pricelist->eof(); $pricelist->moveNext()) { if ($pricelist->gcv("ProductId")==$lastProductId) { $pricelist->scv("ProductTypeName", $pricelist->gcv("Name").'SERVTABLE:((class="blank"))'); $pricelist->scv("Name", $pricelist->gcv("Name").'SERVTABLE:((class="blank"))'); /*$pricelist->scv("Quantity", $pricelist->gcv("Quantity").'SERVTABLE:((class="dashed"))'); $pricelist->scv("Price", $pricelist->gcv("Price").'SERVTABLE:((class="dashed"))');*/ } else { $lastProductId = $pricelist->gcv("ProductId"); } } function pricelist_trHandler($t,$pk) { if ($t->rs->gcv("WebSpecial")) { ?>class="webSpecial"setTrHandler('pricelist_trHandler'); function fWebSpecial($t,$v) { if ($v) { ?>
on special
setFieldTypes(array( "ProductId" => TB_HIDDEN, "Description" => TB_HIDDEN, "ProductTypeId" => TB_HIDDEN, "WebDir" => TB_HIDDEN, "TypeDescription" => TB_HIDDEN, "HasThumb" => TB_HIDDEN, "WebSpecial" => 'fWebSpecial', "ProductImageUpload" => TB_HIDDEN, "SubCategoryName" => ($productSearch ? new Table_Default(' global $pricelist; if ($v) {?>

gcv("ProductTypeName")?> >

gcv("ProductTypeName")?>

count > 1) {?>

gcv("ProductTypeName")?>

($productSearch ? new Table_Default('') : TB_HIDDEN), "LastUpdate" => TB_HIDDEN, "Price" => cf('$t,$v', ' if (isset($t->header)) { ?>
 
rs->gcv("Quantity"); if ($t->rs->gcv("Price")==0 || $t->rs->gcv("Quantity")==0) { ?>&id=rs->gcv("PriceListId")?>">Ask us&id=rs->gcv("PriceListId")?>">Quote/Order cf('$t,$v', ' if (isset($t->header)) { ?>
Qty
rs->gcv("Price")==0 || $t->rs->gcv("Quantity")==0) ? "" : $v); } '), "Name" => new Table_Default(' global $lastProductId; if ($t->rs->gcv("ProductId")!=$lastProductId) { //$d = $t->rs->gcv("Description"); echo $d; echo htmlspecialchars(formatProductName($v)); //echo ($d ? " (".htmlspecialchars($d).")" : ""); echo " "; $lastProductId = $t->rs->gcv("ProductId"); } '), )); if ($APA_imageUpload) { $pricelistTb->setFieldTypes(array( "ProductImageUpload" => new Table_Default(' ?>setFieldTypes(array( "ProductImage" => new Table_Default(' global $subsite; if (in_array($subsite,array("cor","res"))) return; if ($t->rs->gcv("HasThumb")) { $thumbLoc = "/images/tpp/products/".$t->rs->gcv("ProductId").".jpg"; } else { $thumbLoc = "/images/tpp/blankProduct.png"; } /* OLD: ?>&id=rs->gcv("ProductId")?>&noQty=1&noQty=1&catdir=rs->gcv("WebDir"))?>"> - rs->gcv("Name"))?> Sample Image"/>/"> - rs->gcv("Name")))?> Sample Image"/> new Table_Default(' ?>/" title="rs->gcv("SubCategoryName") ? hecho($t->rs->gcv("SubCategoryName")." - ") : null?>">findFirst("HasThumb", 1)==-1) { $pricelistTb->setHidden(array("ProductImage")); }*/ $pricelistTb->addTdClass("Name", "productName"); $pricelistTb->addTdClass("ProductImage", "productImage"); $pricelistTb->setHidden(array("Price","Quantity")); $pricelistTb->setLabels(array("Name" => "", "Price" => "", "Quantity" => "", "ProductTypeName" => "", "ProductImage" => "", "ProductImageUpload" => "", "WebSpecial" => "")); $pricelist->moveFirst(); if ($pricelist->count==0) { ?>

No results. Please try another search.

run(); } if (!$productSearch) { $pricelist->moveFirst(); /*?>
Last updated gcv("LastUpdate"))?>.
gcv("TypeDescription")) { ?>

', preg_split('/\n\n/', $pricelist->gcv("TypeDescription")))?>