echo "<h2><span style=\"color:Purple\">{$sitename}</span></h2>\n"; $jmemol = ""; if (strlen($mol) > 10) { $jmemol = tr4jme($mol); } //############################################################################################ $safemol = clean_molfile($mol); echo "<table border=\"1\">\n<tr>\n<td>\n"; echo "<div class=\"moldiv\" id=\"strucdiv\" onclick=\"openeditorwindow()\" >\n"; if ($mol != '') { if ($svg_mode == 1) { if (is_rxnfile($mol)) { $mol2svgopt = "-R " . $mol2svgopt; } if ($ostype == 1) { print filterThroughCmd("{$safemol}", "{$MOL2SVG} {$mol2svgopt} -"); } if ($ostype == 2) { print filterThroughCmd2("{$safemol}", "{$MOL2SVG} {$mol2svgopt} -"); } } else { // use JME/JSME as fallback $jmehitmol = tr4jme($safemol); echo "<{$edtag} code=\"JME.class\" archive=\"JME.jar\" {$codebase}\n"; echo "width=\"250\" height=\"120\">"; echo "<param name=\"options\" value=\"depict\"> \n"; echo "<param name=\"mol\" value=\"{$jmehitmol}\">\n"; if ($edtag == "applet") { echo "</{$edtag}>click here to edit...\n"; } }
function fpsDownload($fullName, $type = "csv") { if (!strcmp($type, "rptCtm")) { $fileName = basename($fullName); } elseif (!strcmp($type, "report")) { $fileName = basename($fullName); chk_pst2pdf($fileName, $fullName); } else { $fileName = basename($fullName) . '.' . $type; } $vtype = array('gif' => 'image', 'png' => 'image', 'jpg' => 'image', 'jpeg' => 'image', 'pdf' => 'application', 'mpeg' => 'audio', 'mp3' => 'audio', 'html' => 'text', 'plain' => 'text', 'csv' => 'application', 'xls' => 'application'); $type = strtolower($type); $ctype = $vtype[$type] ? $vtype[$type] : "octet-stream"; $ct = "Content-Type: " . $type . "/" . $ctype; $cmd = "cat {$fullName}"; header($ct); header('Content-Disposition: attachment; filename="' . $fileName . '"'); //header("Content-Transfer-Encoding: binary"); //header('Expires: 0'); //header('Pragma: no-cache'); echo filterThroughCmd($cmd); }