query($query)){
$chaninfo = "
\n";
$chaninfo .= "$tablename,Channel |
";
while($row = $res->fetch(PDO::FETCH_ASSOC)){
foreach($row as $col => $val){
$chaninfo .= "\n";
$chaninfo .= "$col | \n";
$chaninfo .= ": | \n";
$chaninfo .= "$val | \n";
$chaninfo .= "
\n";
if($col=="name") $channelname = $val;
if($col=="moduleid") $moduleid = $val;
if($col=="channel") $channel = $val;
}
}
$chaninfo .= "
\n";
}else{
$chaninfo = "Error: bad result from \"$query\"
";
}
// If no "name" field found, then use the tablename and channel id for title
if($channelname == ""){
$channelname = "$tablename.$chan $chanid";
}else{
// Use tablename/chanid as subtitle
$subtitle = "($tablename.$chan $chanid)";
}
// Get crate and module information
if($moduleid != ""){
$query = "SELECT * FROM Crate,Module WHERE Crate.crateid=Module.crateid AND Module.moduleid=$moduleid";
if($res = $db->query($query)){
$modinfo = "\n";
$modinfo .= "Module,Crate |
";
while($row = $res->fetch(PDO::FETCH_ASSOC)){
foreach($row as $col => $val){
if($col=="name") $channelname = $val;
if($col=="moduleid") $moduleid = $val;
if($col=="channel") $channel = $val;
if($col=="area") $area = $val;
$content = $val;
if($col == "rack"){
$content = "$val";
}
if($col == "area"){
$content = "$val";
}
if($col == "crateid"){
$content = "$val";
}
$modinfo .= "\n";
$modinfo .= "$col | \n";
$modinfo .= ": | \n";
$modinfo .= "$content | \n";
$modinfo .= "
\n";
}
}
$modinfo .= "
\n";
}else{
$modinfo = "Error: bad result from \"$query\"
";
}
}
?>
Hall-D Translation Table Channel Viewer
= "$channelname
$subtitle" ?>
= $chaninfo ?> |
= $modinfo ?> |