define('START', microtime()); # in other files start with if(!defined('START')) die; include '/var/www/digitalfire/4sight/inc/init-4sight.php'; if(isset($_GET['matid'])) { echo '
Click here to go there.
'; } elseif(isset($_GET['goto'])) { 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 'Click here to go there.
'; } } else { echo 'This content was not found
'; } 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 '(up to '.$getonly.' are shown)
'; 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 '