'200'){ $buffer = home(); echo $buffer; exit; } $ziplength = strlen($searchzip); if($ziplength>'50'){ $buffer = home(); echo $buffer; exit; } $citylength = strlen($searchcity); if($citylength>'100'){ $buffer = home(); echo $buffer; exit; } ////// set video player var based on company ////// if (preg_match("/634-Polymag-Tek/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Polymag Tek Generic Water Wash Animation

View More Videos

'; } if (preg_match("/320-Franklin-Adhesives--Polymers/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Franklin\'s Diverse Range of Pressure Sensitive Adhesives

View More Videos

'; } if (preg_match("/590-NRD/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Alpha Ionizing Gun by NRD

View More Videos

'; } if (preg_match("/663-QuadTech-Inc/i", $searchcompany)) { $videocode = '

PFFC Video Channel

It\'s What\'s on the Outside that Counts

View More Videos

'; } if (preg_match("/525-Meech-Static-Eliminators-USA/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Meech Intl. Introduces Unique Features to Hyperion Static Controllers

View More Videos

'; } if (preg_match("/611-Parkland-Intl/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Parkland TC40 Series R Automatic Core Cutter

View More Videos

'; } if (preg_match("/1084-Parkland-International---USA-S-America/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Parkland TC40 Series R Automatic Core Cutter

View More Videos

'; } if (preg_match("/789-Titan-Atlas-Converting-North-America-Inc/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Titan SR9-DS Duplex Shaft Slitter Rewinder

View More Videos

'; } if (preg_match("/67-Atlas-Converting-North-America-Inc/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Atlas CW1040 Series Primary Slitter Rewinder

View More Videos

'; } if (preg_match("/66-Atlas-Converting-Equipment/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Atlas CW3600 Series Slitter Rewinder

View More Videos

'; } if (preg_match("/478-Lemtech-Intl-Inc/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Lemex polyband spreader roll

View More Videos

'; } if (preg_match("/527-Menges-Roller-Co/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Menges Roller Company - Heat Transfer & Chill Rollers

View More Videos

'; } if (preg_match("/609-Parkinson-Technologies/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Parkinson Winders Turret Winders

View More Videos

'; } if (preg_match("/1198-Roll-2-Roll-Technologies-LLC/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Web Position Sensor for Center and Edge Guiding from Roll-2-Roll Technologies
ARIS Web Guiding System with Multiple Materials

View More Videos

'; } if (preg_match("/810-Unilux/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Confirm quality at full speed with brighter, lighter LED strobe

View More Videos

'; } if (preg_match("/263-Elite-Cameron/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Elite Cameron Slitter Rewinder: CW800HD

View More Videos

'; } if (preg_match("/657-Pro-Tapes--Specialties/i", $searchcompany)) { $videocode = '

PFFC Video Channel

G&A RT 800 K Wide Web Slitter

View More Videos

'; } if (preg_match("/886-MOISTTECH/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Moisture & Thickness in Wax Coating
Coating Weight Measurement with MoistTech Corp

View More Videos

'; } if (preg_match("/304-Flex-America/i", $searchcompany)) { $videocode = '

PFFC Video Channel

FlexFilms USA Corporate Film

View More Videos

'; } if (preg_match("/1414-WebTech-LLC/i", $searchcompany)) { $videocode = '

PFFC Video Channel

Precision Roll Coater Gap Adjuster

View More Videos

'; } if (preg_match("/1254-Advanced-Greig-Laminator-Inc-AGL/i", $searchcompany)) { $videocode = '

PFFC Video Channel

AGL 76 Industrial Laminator
AGL 72in Industrial Converting Laminator
AGL Patriot

View More Videos

'; } ///// SUBCONDITIONALS ///// if($searchcategory){ $buffer = subcats($searchcategory); echo $buffer; } elseif($taxonomy){ $buffer = compcats($taxonomy,$limit,$start,$page); echo $buffer; } elseif($searchcompany){ $buffer = comppage($searchcompany,$videocode); echo $buffer; } elseif($alpha){ $buffer = alpha($alpha,$limit,$start,$page); echo $buffer; } elseif($searchcity|$searchstate|$searchcountry|$searchzip){ $buffer = searchpage($searchcity,$searchstate,$searchcountry,$searchzip,$limit,$start,$page); echo $buffer; } elseif($keywords&&$directorytype){ $buffer = searchkeyword($keywords,$directorytype,$limit,$start,$page); echo $buffer; } else{ $buffer = home(); echo $buffer; } //// function home(){ $query = mysql_query("SELECT * FROM `categories` WHERE `Level` = '1'"); if(mysql_num_rows($query) == 0) { //$emptymessage = '

No matches found

'; } else{ while($r=mysql_fetch_array($query)) { $catid=$r["id"]; $catname=$r["CategoryName"]; $catalias=$r["CategoryAlias"]; $catlevel=$r["Level"]; $catparent=$r["ParentID"]; $querya = mysql_query("SELECT * FROM `compcats` WHERE `CategoryID` = '$catid'"); $subcats = mysql_num_rows($querya); $queryb = mysql_query("SELECT * FROM `categories` WHERE `ParentID` = '$catid'"); while($s=mysql_fetch_array($queryb)) { $subcatid=$s["id"]; $subcatname=$s["CategoryName"]; $queryc = mysql_query("SELECT * FROM `compcats` WHERE `CategoryID` = '$subcatid'"); $subcatcomps = (mysql_num_rows($queryc))+($subcatcomps); } $content .= '
'. $catname . ' ('.$subcatcomps.')
'; $subcatcomps = ""; $subcats = ""; } // begin featured companies box $queryc = mysql_query("SELECT * FROM `companies` WHERE `Package` LIKE '%Platinum%' ORDER BY RAND() LIMIT 4"); $featuredcompanies .= '
Featured Companies
'; $featuredcompanies .= '
'; $featuredcompanies .= ' '; while($t=mysql_fetch_array($queryc)) { $compid=$t["id"]; $compname=$t["CompanyName"]; $compalias=$t["Alias"]; $imagesmall=$t["ImageSmall"]; $featuredcompanies .= ''; } $featuredcompanies .= ' '; $featuredcompanies .= '
'; $featuredcompanies .= '
'; $featuredcompanies .= '
'; // end featured companies box $template = file_get_contents('https://directory.pffc-online.com/templates/template1.html'); $template = preg_replace("//", "$content", $template); $template = preg_replace("//", "$featuredcompanies", $template); echo $template; } }///// end function home //// function subcats($searchcategory){ $searchcategory = preg_replace("/^(\d+)-(.*)/", "$1", $searchcategory); $query = mysql_query("SELECT * FROM `categories` WHERE `id` = '$searchcategory' AND `Level` = '1'"); if(mysql_num_rows($query) == 0) { $emptymessage = '

No matches found

'; } else{ while($r=mysql_fetch_array($query)) { $catid=$r["id"]; $catname=$r["CategoryName"]; $catalias=$r["CategoryAlias"]; $catlevel=$r["Level"]; $catparent=$r["ParentID"]; $queryb = mysql_query("SELECT * FROM `categories` WHERE `ParentID` = '$catid' ORDER BY `CategoryName`"); while($s=mysql_fetch_array($queryb)) { $subcatid=$s["id"]; $subcatname=$s["CategoryName"]; $subcatalias=$s["CategoryAlias"]; $queryc = mysql_query("SELECT * FROM `compcats` WHERE `CategoryID` = '$subcatid'"); $subcatcomps = mysql_num_rows($queryc); $topcatcount = (mysql_num_rows($queryc))+($topcatcount); $content .= '
' . $subcatname . ' (' . $subcatcomps . ')
'; } } } // begin featured companies box $queryc = mysql_query("SELECT * FROM `companies` WHERE `Package` LIKE '%Platinum%' ORDER BY RAND() LIMIT 4"); $featuredcompanies .= '
Featured Companies
'; $featuredcompanies .= '
'; $featuredcompanies .= ' '; while($t=mysql_fetch_array($queryc)) { $compid=$t["id"]; $compname=$t["CompanyName"]; $compalias=$t["Alias"]; $imagesmall=$t["ImageSmall"]; $featuredcompanies .= ''; } $featuredcompanies .= ' '; $featuredcompanies .= '
'; $featuredcompanies .= '
'; $featuredcompanies .= '
'; // end featured companies box if($emptymessage){$content = $emptymessage;} else{$content = $content;} $title = $catname . ' | PFFC Online Buyers Guide'; $breadcrumbs = 'PFFC Online Buyers Guide » ' . $catname; if($emptymessage){ $cattop = '
Categories
'; } else{ $cattop = '
'.$catname.' ('.$topcatcount.')
'; } $catbottom = '
'; $template = file_get_contents('https://directory.pffc-online.com/templates/template2.html'); $template = preg_replace("//", "$title", $template); $template = preg_replace("//", "$breadcrumbs", $template); $template = preg_replace("//", "$cattop$content$catbottom", $template); $template = preg_replace("//", "$featuredcompanies", $template); echo $template; }///// end function subcats //// function compcats($taxonomy,$limit,$start,$page){ $taxonomy = preg_replace("/^(\d+)-(.*)/", "$1", $taxonomy); if(!$limit){$limit = "20";} if(!$start){$start = "0";} //how many items to show per page if($page) $start = ($page - 1) * $limit; //first item to display on this page else{ $start = 0; } /// for breadcrumbs $querybread = mysql_query("SELECT * FROM `categories` WHERE `id` = '$taxonomy' LIMIT 1"); while($a=mysql_fetch_array($querybread)) { $breadparent=$a["ParentID"]; } $querybreada = mysql_query("SELECT * FROM `categories` WHERE `id` = '$breadparent'"); while($b=mysql_fetch_array($querybreada)) { $breadcatid=$b["id"]; $breadcatname=$b["CategoryName"]; $breadcatalias=$b["CategoryAlias"]; } /// main queries $query = mysql_query("SELECT * FROM `categories` WHERE `id` = '$taxonomy'"); if(mysql_num_rows($query) == 0) { $emptymessage = '

No matches found

'; } else{ while($r=mysql_fetch_array($query)) { $catid=$r["id"]; $catname=$r["CategoryName"]; $catalias=$r["CategoryAlias"]; $catlevel=$r["Level"]; $catparent=$r["ParentID"]; /// for nav $querynav = mysql_query("SELECT * FROM `compcats` WHERE `CategoryID` = '$catid'"); $navmatches = mysql_num_rows($querynav); $queryb = mysql_query("SELECT * FROM `compcats` WHERE `CategoryID` = '$catid' ORDER BY `Package` DESC, `CompanyName` ASC LIMIT $start, $limit"); $compmatches = mysql_num_rows($queryb); while($s=mysql_fetch_array($queryb)) { $companyid=$s["CompanyID"]; $package=$s["Package"]; $queryc = mysql_query("SELECT * FROM `companies` WHERE `id` = '$companyid'"); if(mysql_num_rows($queryc) == 0) { echo '

No matches found

'; } else{ while($c=mysql_fetch_array($queryc)) { $companyname=$c["CompanyName"]; $companyalias=$c["Alias"]; $city=$c["PublishedCity"]; $state=$c["PublishedState"]; $imagesmall=$c["ImageSmall"]; if (preg_match("/platinum/i", $package)) { $content .= '
'; $content .= ''; $content .= '
'; $content .= '
'; $content .= ''; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= '
'; if($imagesmall){$content .= '';} $content .= ''.$companyname.'
'.$city; if($state){$content .= ', '. $state;} $content .= '
'; $content .= ''; $content .= '
'; } if (preg_match("/gold/i", $package)) { $content .= '
'; $content .= ''; $content .= '
'; $content .= '
'; $content .= ''; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= '
'.$companyname.'
'.$city; if($state){$content .= ', '. $state;} $content .= '
'; $content .= ''; $content .= '
'; } if (preg_match("/basic/i", $package)) { $content .= '
'; $content .= ''; $content .= '
'; $content .= '
'; $content .= ''; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= ' '; $content .= '
'.$companyname.'
'.$city; if($state){$content .= ', '. $state;} $content .= '
'; $content .= ''; $content .= '
'; } } } } } } $title = $catname . ' | PFFC Online Buyers Guide'; $breadcrumbs = 'PFFC Online Buyers Guide » '.$breadcatname.' » '. $catname; $cattop = '
Search results for "'.$catname.'"
Results: '.$navmatches.' Companies
'; $cattop .= '
'; $cattop .= '
'; $cattop = preg_replace('/option value="'.$limit.'"/', 'option value="'.$limit.'" selected="selected"', $cattop); $catbottom = '
'; $pagination = getPaginationString($page, $navmatches, $limit, '3', 'index.html', '?taxonomy='.$catid.'-'.$catalias.'&limit='.$limit.'&page='); $template = file_get_contents('https://directory.pffc-online.com/templates/template2.html'); $template = preg_replace("//", "$title", $template); $template = preg_replace("//", "$breadcrumbs", $template); $template = preg_replace("//", "$cattop$content$catbottom$pagination", $template); echo $template; }///// end function compcats //// function comppage($searchcompany,$videocode){ $searchcompany = preg_replace("/^(\d+)-(.*)/", "$1", $searchcompany); $query = mysql_query("SELECT * FROM `companies` WHERE `id` = '$searchcompany'"); if(mysql_num_rows($query) == 0) { $emptymessage = '

No matches found

'; } else{ while($c=mysql_fetch_array($query)) { $compid=$c["id"]; $compname=$c["CompanyName"]; $compaddress01=$c["PublishedAddress01"]; $compaddress02=$c["PublishedAddress02"]; $compcity=$c["PublishedCity"]; $compstate=$c["PublishedState"]; $compzip=$c["PublishedZip"]; $compphone=$c["PublishedPhone"]; $comptollfreephone=$c["PublishedTollFreePhone"]; $compfax=$c["PublishedFax"]; $compwebsite=$c["Website"]; $compcountry=$c["PublishedCountry"]; $compregionsserved=$c["RegionsServed"]; $compcertificationtype=$c["CertificationType"]; $contactfirstname=$c["FirstName"]; $contactlastname=$c["LastName"]; $companydescription=$c["CompanyDescription"]; $companydescription = preg_replace("/\n/", "
", $companydescription); $companydescription = preg_replace("/(

|<\/p>|