<?php
//    return a parameter file for an instrument   (todo=61)

require("phpVars.php");


  $afile='';
  $aname='';
  foreach ($_GET as $vname=>$oof) {
     $avar=trim(strtoupper($vname)) ;
     if ($avar=='FILE') $afile=trim($oof) ;
     if ($avar=='NAME') $aname=trim($oof);
  }

if ($afile=='' || $aname=='') {
  print '<h3>Sorry</h3>No NAME=, or no FILE= argument, in call to   returnInstParams.php ';
  print '<p><a target="_top" href="/dsurvey/admin.htm">Return to survey admin page</a>';
  exit ;
}

if (strpos($afile,'.')===false) $afile= $afile . '.XML';

$dafile=$instruments_dir . $aname . '/' . $afile    ;

$isfile=file_exists($dafile);
if (!$isfile) {
  print "<h3>Sorry</h3>No such (instrument) parameter  file $dafile  (returnInstParams.php) ";
  print '<p><a target="_top" href="/dsurvey/admin.htm">Return to survey admin page</a>';
  exit ;
}

$stuff=file_get_contents($dafile);

header('Content-Type: text/xml; charset=iso-8859-1');
echo $stuff;
exit;


?>

