This content can be found at the Digitalfire Reference Library'; $link = SECUREURL.'/material/'.intval($_GET['matid']); echo '

Click here to go there.

'; } elseif(isset($_GET['goto'])) { echo '

This content can be found at the Digitalfire Reference Library

'; $link = SECUREURL.'/material/'.urlencode(substr(strtolower($_GET['goto']), 0, 60)); echo '

Click here to go there.

'; } elseif(isset($_GET['z'])) { $row = GetSQLRecordi($sql="SELECT * FROM MATERIALS WHERE z='".FilterZ($_GET['z'],10)."'"); $mid=$row['matid']; if($mid) { echo '

This content can be found at the Digitalfire Reference Library

'; $link = SECUREURL.'/material/'.$mid; echo '

Click here to go there.

'; } } else { echo '

Digitalfire Refernce Library Jump Error

This content was not found

'; } echo '

Other links:

'; die; # old material pages at ceramic-materials.com pass matid here, visitor must login again # material jumper there also comes here, it checks for out-of-date INSIGHT # New INSIGHT also routes its requests for material info through here session_start(); define('START', microtime()); # in other files start with if(!defined('START')) die; define('PAGENAME', 'Material Jumper'); include '../inc/init-4sight.php'; include("/var/www/mastercopies/reference_utilities.php"); include("../inc/areafunctions.php"); # $_GET['s'] = str(intN)+str(val(snum.product)-intN)+str(val(snum.personid)+intN) if($_GET['goto'] != NULL) $_POST['goto'] = urldecode($_GET['goto']); if($_GET['s'] != NULL) $_POST['s'] = $_GET['s']; $_POST['goto'] = FSTsanitize($_POST['goto'], 50); # this comes from individual pages at cermat if(isset($_GET['matid'])) { showheader('Jump to New Material Information Page at '.SECUREURL, 'Jump to a Material'); $temp = new LinkLabel(AreaNum('materials'), intval($_GET['matid']), $row, 'linktemplate'); $temp->linktext = $row['name']; if(strpos($temp->ShowIt(true), 'UnNamed')!==false) { echo '

Material name may have changed, cannot link. '; echo '
Try the material index to find it. '; } else { echo '

Go directly to '.$temp->ShowIt(true).'

'; } } elseif(isset($_GET['z'])) { $row = GetSQLRecordi($sql="SELECT * FROM MATERIALS WHERE z='".FilterZ($_GET['z'],10)."'"); $mid=$row['matid']; if($mid) { $temp = new LinkLabel(AreaNum('materials'), $mid, $row, 'linktemplate'); header("Location: ".$temp->url); } } elseif($_POST['goto'] == '') { showheader('Search Failed', 'Search Failed', false); echo "

Cannot jump, no material search term provided

"; } else { $getonly = 50; # request may be from insight where lookup has more than one value list($mid) = GetSQLRecordi($sql = "SELECT matid FROM MATERIALS WHERE name='".before($_POST['goto'],",")."'", true); if(strpos($_POST['goto'],",")!==false || !$mid) { $temp = explode(',', $_POST['goto']); # $temp = explode(',', after($_POST['goto'],",")); foreach($temp as $thisone) { $thisone = trim($thisone); $result = ExecuteSQLi($sql = 'SELECT matid, name, keywords, searchkey FROM MATERIALS WHERE concat(searchkey," ",name) RLIKE "'.$thisone.'" LIMIT 0,'.$getonly); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { if($mats == NULL || !in_array($_POST['goto'], $mats)) { if($_POST['goto']) $mats[] = array($row["matid"], $row["name"], $row["keywords"], $row['searchkey']); } } } } } if($mid) { $temp = new LinkLabel(AreaNum('materials'), $mid, $row, 'linktemplate'); #if(strpos($temp->ShowIt(true), 'UnNamed')!==false) { header("Location: ".$temp->url); #} } elseif($mats) { showheader('Primary search failed, secondary search successful', 'Primary name search failed'); echo '

INSIGHT has called this page requesting info on a material but none with this exact name was found.

'; echo '

Seconary search successful with in these

'; if(count($mats) > 40) echo '

(up to '.$getonly.' are shown)

'; echo "

'; } else { showheader('Search for failed', 'Material Not Found'); echo '

INSIGHT has called this page requesting information on a specific material, however it was not found here (either as an exact or partial match).

'; } } function showheader($title, $header, $showlink = true) { global $checksum; echo ''.$title.''; echo ''; echo ''; echo ''; # echo ''; echo ''; echo ''; echo ''; echo '

Ceramic Materials Database

'; if($showlink) { echo '
Go to Material index for a list of all materials
'; } else echo '
'; echo '

'.$header."

"; } ?>