Index: /trunk/docs/VOrequirements.tex
===================================================================
--- /trunk/docs/VOrequirements.tex	(revision 81)
+++ /trunk/docs/VOrequirements.tex	(revision 82)
@@ -266,4 +266,5 @@
  fileloc   & varchar(100)         & YES  &     & NULL    &\\
  hdrver    & varchar(10)          & YES  &     & NULL    &\\
+ survey    & varchar(10)          & YES  &     & NULL    &\\
  src\_name & varchar(20)          & YES  &     & NULL    &\\
  raj       & varchar(15)          & YES  &     & NULL    &\\
Index: /trunk/new-htdocs/conequery-vo.php
===================================================================
--- /trunk/new-htdocs/conequery-vo.php	(revision 81)
+++ /trunk/new-htdocs/conequery-vo.php	(revision 82)
@@ -13,5 +13,10 @@
 	// Using Albert Teoh's query.php as a template
 ?>
-<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ?>
+<?php 
+//
+//Need to enclose the following in a <?php structure else the <?xml will confuse things
+//
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+?> 
 <!DOCTYPE VOTABLE SYSTEM "http://us-vo.org/xml/VOTable.dtd">
 <VOTABLE version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ivoa.net/xml/VOTable/VOTable/v1.1">
@@ -20,4 +25,5 @@
 	include_once("../../utils.php");
 	include_once("loadS70.php");
+	include_once("xmlFunctions.php");
 
 	$raj_degs         = trim(get_param('RA', $HTTP_GET_VARS));
@@ -116,5 +122,5 @@
 
 echo "<TABLE>\n";
-print_column_headers($result);
+print_column_headers_VO($result);
 
 
@@ -155,71 +161,8 @@
 ///////////////////////////////////////////////////////////////////////////
 
-
-	print_data($all_results);
+	print_data_VO($all_results);
 
 echo "</TABLE>\n";
 echo"</RESOURCE>\n";
 echo"</VOTABLE>\n";
-	?>
-<?php
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-//
-// Function definitions
-// --------------------
-//
-///////////////////////////////////////////////////////////////////////////////////////////////
-
-function print_column_headers() {
-
-/// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
-
-	echo "<FIELD name=\"Filename\" ID=\"col1\" ucd=\"meta.id;meta.main\" datatype=\"char\" arraysize=\"30\"/>\n";
-	echo "<FIELD name=\"Field Name\" ID=\"col2\" ucd=\"obs.field;meta.id\" datatype=\"char\" arraysize=\"20\"/>\n";
-        echo "<FIELD name=\"Survey\" ID=\"col3\" ucd=\"obs;meta.dataset;meta.id\" datatype=\"char\" arraysize=\"10\"/>\n";
-	echo "<FIELD name=\"RA\" ID=\"col4\" ucd=\"pos.eq.ra;meta.main\" ref=\"J2000\" datatype=\"float\" width=\"10\" precision=\"6\" unit=\"deg\"/>\n";
-	echo "<FIELD name=\"DEC\" ID=\"col5\" ucd=\"pos.eq.dec;meta.main\" ref=\"J2000\" datatype=\"float\" width=\"11\" precision=\"6\" unit=\"deg\"/>\n";
-	echo "<FIELD name=\"BMAJ\" ID=\"col6\" ucd=\"pos.angResolution;phys.angSize.smajAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\"/>\n";
-	echo "<FIELD name=\"BMIN\" ID=\"col7\" ucd=\"pos.angResolution;phys.angSize.sminAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\"/>\n";
-	echo "<FIELD name=\"BPA\" ID=\"col8\" ucd=\"pos.angResolution;pos.posAng\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\"/>\n";
-	echo "<FIELD name=\"UT Date/Time of Observations\" ID=\"col9\" ucd=\"time.start\" datatype=\"char\" arraysize=\"30\"/>\n";
-	echo "<FIELD name=\"ObsFreq\" ID=\"col10\" ucd=\"em.freq.central\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"MHz\"/>\n";
-	echo "<FIELD name=\"Channel Bandwidth\" ID=\"col11\" ucd=\"spect.binSize;em.freq\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"MHz\"/>\n";
-	echo "<FIELD name=\"Number of Channels\" ID=\"col12\" ucd=\"em.bin;meta.number\" datatype=\"int\" width=\"6\"/>\n";
-	echo "<FIELD name=\"Scan length\" ID=\"col13\" ucd=\"obs.exposure;time.duration\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"s\"/>\n";
-	echo "<FIELD name=\"Sample time\" ID=\"col14\" ucd=\"time.resolution\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"ms\"/>\n";
-
-}
-
-function print_data($all_results) {
-  
-  echo "<DATA>\n<TABLEDATA>\n";
-  for ($i=0; $i < count($all_results); $i++) {
-    $line = $all_results[$i];
-    print_data_line($line);
-  }
-  echo "</TABLEDATA>\n</DATA>\n";
-
-}
-
-function print_data_line($line) {
-/// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
-	echo "<TR>\n ";
-	printf("<TD>%s</TD>",$line['filename']);
-	printf("<TD>%s</TD>",$line['src_name']);
-	printf("<TD>%s</TD>",$line['survey']);
-	printf("<TD>%10.6f</TD>",$line['rajd']);
-	printf("<TD>%+11.6f</TD>",$line['decjd']);
-	printf("<TD>%6.4f</TD>",$line['bmaj']);
-	printf("<TD>%6.4f</TD>",$line['bmin']);
-	printf("<TD>%6.4f</TD>",$line['bpa']);
-	printf("<TD>%s</TD>",$line['date_obs']);
-	printf("<TD>%9.4f</TD>",$line['obsfreq']);
-	printf("<TD>%9.4f</TD>",$line['chanbw']);
-	printf("<TD>%d</TD>",$line['nchan']);
-	printf("<TD>%9.4f</TD>",$line['scanlen']);
-	printf("<TD>%9.4f</TD>",$line['tbin']);
-	echo "\n</TR>\n";
-}
-
 ?>
Index: unk/new-htdocs/index.html
===================================================================
--- /trunk/new-htdocs/index.html	(revision 81)
+++ 	(revision )
@@ -1,208 +1,0 @@
-<?php	session_start(); ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
-<?php
-	// index.html
-	// Matthew Whiting June 18 2007
-	// 
-	// A test of a conesearch webpage for new data.
-	// Using Albert Teoh's index.html as a template
-/*
-<!-- BEGIN Javascript for expansion blocks -->
-<!-- Thanks to: -->
-<!-- http://assn9.blogspot.com/ -->
-<!-- Douglas Bowman
-     URL:      www.stopdesign.com
-     Used in: http://www.bloggerforum.com/modules/newbb/viewtopic.php?topic_id=8725&forum=6
-     Date:     26 Feb 2004
--->
-*/
-?>
-<head>
-<link rel="stylesheet" type="text/css" href="../../styles/style.css" />
-<link rel="stylesheet" type="text/css" href="../../styles/query.css" />
-<link rel="stylesheet" type="text/css" href="../../styles/results.css" />
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8759-1" />
-<meta name="DC.Creator" lang="en" content="personalName=Teoh,Albert" />
-<meta name="ATNF.Maintainer" content="contactName=Webmaster,the" />
-<meta name="DC.Title.alt" lang="en" content="" />
-<meta name="DC.Subject" lang="en" content="pulsar" />
-<meta name="DC.Description" lang="en" content="Searches the data archives at the ATNF" />
-<meta name="DC.Date.created" scheme="ISO8601" content="2002-12-12" />
-<meta name="ATNF.Site" content="Marsfield" />
-<meta name="ATNF.AccessPermission" content="Public" />
-<meta name="ATNF.MetaVersion" content="1.0" />
-</head>
-<script type="text/javascript" language="javascript1.2"><!--
-function togglecomments (id1,id2) {
-
-		var obj1 = document.getElementById(id1);
-		var obj2 = document.getElementById(id2);
-		(obj1.className=="commentshown") ? obj1.className="commenthidden" : obj1.className="commentshown"; 
-		(obj1.className=="commentshown") ? obj2.innerHTML="<< Hide" : obj2.innerHTML="Show all >>"; 
-
-}
-
-function checkAll(objName, FormName, FieldName ) {
-
-	var obj = document.getElementsByName(objName);
-	var CheckValue = obj[0].checked;
-
-	if(!document.forms[FormName])
-		return;
-	var objCheckBoxes = document.forms[FormName].elements[FieldName];
-	if(!objCheckBoxes)
-		return;
-	var countCheckBoxes = objCheckBoxes.length;
-	if(!countCheckBoxes)
-		objCheckBoxes.checked = CheckValue;
-	else
-		// set the check value for all check boxes
-		for(var i = 0; i < countCheckBoxes; i++)
-			objCheckBoxes[i].checked = CheckValue;
-}
-
-function updateSelectAll(objId, allId) {
-	var obj = document.getElementById(objId);
-	var allCheckbox = document.getElementById(allId);	
-	
-	if (!objId.checked && allCheckbox.checked) {
-		allCheckbox.checked = false;
-	}
-		
-		
-}
-//--></script>
-
-<title>ATNF Pulsar Data Archive Testing</title>
-
-<!-- Start Content -->
-<?php
-	
-include_once("../../constants.php");
-include_once("../../security.php");
-include_once("../../database.php");
-include_once("../../date.php");
-
-$now_day = date("j");
-$now_month = date("n");
-$now_year = date("Y");
-
-$all_params_id = "all_params";
-$all_others_id = "all_others";
-
-//$link = db_connect();
-
-///////////////////////////////////////////////////////////////////////////
-
-		$link = db_connect_admin();
-
-$createTable = "CREATE TEMPORARY TABLE s70 (file_id SMALLINT UNSIGNED AUTO_INCREMENT,filename VARCHAR(30),fileloc VARCHAR(100),hdrver VARCHAR(10),src_name VARCHAR(20),raj VARCHAR(15),decj VARCHAR(15),rajd FLOAT,decjd FLOAT,bmaj FLOAT,bmin FLOAT,bpa FLOAT,date_obs VARCHAR(30),obsfreq FLOAT,chanbw FLOAT,nchan FLOAT,scanlen FLOAT,tbin FLOAT,PRIMARY KEY (file_id))";
-
-$result = mysql_query($createTable) or die('Query failed #1: ' . mysql_error());
-
-$loadTable = "LOAD DATA LOCAL INFILE \"/DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary.csv\" INTO TABLE s70 FIELDS TERMINATED BY \",\" OPTIONALLY ENCLOSED BY \"\\\"\" IGNORE 1 LINES (filename,fileloc,hdrver,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,obsfreq,chanbw,nchan,scanlen,tbin)";
-//"
-$result = mysql_query($loadTable) or die('Query failed #2: ' . mysql_error());
-
-//////////////////////////////////////////////
-// Get the field names to fill form checkboxes
-
-$query = "SHOW COLUMNS FROM s70";
-$result = mysql_query($query) or die ('Query failed: ' . mysql_error());
-
-$fields = array();
-if (mysql_num_rows($result)) {
-	while($row = mysql_fetch_assoc($result)) {
-		array_push($fields, $row);
-	}
-}
-
-///////////////////////////////////////////////////////////////////////////
-
-?>
-
-<body class="atoa">
-
-<form action="conequery-basic.php" method="GET" name="data_archive_form" id="data_archive_form">
-<input type="hidden" name="state" value="results">
-
-<table class="noborder">
-
-	<tr>
-	
-	<td valign="top" class="form_field" rowspan="1">
-	
-	<fieldset>
-		<legend>Display Parameters</legend>
-		<input type="checkbox" name="<?php echo $all_params_id; ?>" id="<?php echo $all_params_id; ?>" onClick="checkAll('<?php echo $all_params_id; ?>', 'data_archive_form', 'params[]')" checked="true">Select all<br>
-			<font size="-1"><a href="javascript:togglecomments('params', 'toggler1')" id="toggler1">Show all >></a></font><br>
-			<span class="commenthidden" id="params">
-			<div id="list">
-				<?php
-				// Special case for ra and dec
-				$raj_count = 0;
-				$decj_count = 0;
-				$raj_field = "";
-				$decj_field = "";
-
-				foreach ($fields as $field) {
-					if (ereg("raj_.+", $field['Field'] )) {
-						$raj_field .= "," . $field['Field'];
-						$raj_count++;
-						if ($raj_count == 3) {
-							$raj_field = trim($raj_field, " ,");
-							echo "<input onClick=\"updateSelectAll('ra',
-'$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"$raj_field\" id=\"RA\" checked=\"true\">RA<br>\n";
-						}
-					}
-					else if (ereg("decj_.+", $field['Field'] ) ){
-						$decj_field .= "," . $field['Field'];
-						$decj_count++;
-						if ($decj_count == 3) {
-							$decj_field = trim($decj_field, " ,");
-							echo "<input onClick=\"updateSelectAll('dec', '$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"$decj_field\" id=\"dec\" checked=\"true\">DecJ<br>\n";
-						}
-					}
-					else {
-						echo "<input
-onClick=\"updateSelectAll('".$field['Field']."', '$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"".$field['Field']."\" id=\"".$field['Field']."\" checked=\"true\">".$field['Field']."<br>\n";
-					}
-				}
-				?>
-			</div>
-			</span>
-	</fieldset>
-	</td>
-
-	<td class="form_field" height="10%">
-	<!-- Filter Options -->
-	<fieldset id="flsPosition">
-				
-		<legend>Filter Options</legend>
-
-
-		<!-- Coordinates -->
-		<fieldset>
-			<legend>Coordinates</legend>
-
-			RAJ [deg]: <input type="text" name="raj_degs" size="10">
-			DecJ [deg]: <input type="text" name="decj_degs" size="10">
-			Search radius [deg]: <input type="text" name="radius" size="10">
-
-
-		</fieldset>	
-
-	</fieldset>
-	<br>
-	<input type="submit" value="submit" name="submit_button">
-	</td>
-	</tr>	
-</table>
-
-
-</form>
-
-
-</body>
-
-</html>
Index: /trunk/new-htdocs/index.php
===================================================================
--- /trunk/new-htdocs/index.php	(revision 82)
+++ /trunk/new-htdocs/index.php	(revision 82)
@@ -0,0 +1,208 @@
+<?php	session_start(); ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
+<?php
+	// index.html
+	// Matthew Whiting June 18 2007
+	// 
+	// A test of a conesearch webpage for new data.
+	// Using Albert Teoh's index.html as a template
+/*
+<!-- BEGIN Javascript for expansion blocks -->
+<!-- Thanks to: -->
+<!-- http://assn9.blogspot.com/ -->
+<!-- Douglas Bowman
+     URL:      www.stopdesign.com
+     Used in: http://www.bloggerforum.com/modules/newbb/viewtopic.php?topic_id=8725&forum=6
+     Date:     26 Feb 2004
+-->
+*/
+?>
+<head>
+<link rel="stylesheet" type="text/css" href="../../styles/style.css" />
+<link rel="stylesheet" type="text/css" href="../../styles/query.css" />
+<link rel="stylesheet" type="text/css" href="../../styles/results.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8759-1" />
+<meta name="DC.Creator" lang="en" content="personalName=Teoh,Albert" />
+<meta name="ATNF.Maintainer" content="contactName=Webmaster,the" />
+<meta name="DC.Title.alt" lang="en" content="" />
+<meta name="DC.Subject" lang="en" content="pulsar" />
+<meta name="DC.Description" lang="en" content="Searches the data archives at the ATNF" />
+<meta name="DC.Date.created" scheme="ISO8601" content="2002-12-12" />
+<meta name="ATNF.Site" content="Marsfield" />
+<meta name="ATNF.AccessPermission" content="Public" />
+<meta name="ATNF.MetaVersion" content="1.0" />
+</head>
+<script type="text/javascript" language="javascript1.2"><!--
+function togglecomments (id1,id2) {
+
+		var obj1 = document.getElementById(id1);
+		var obj2 = document.getElementById(id2);
+		(obj1.className=="commentshown") ? obj1.className="commenthidden" : obj1.className="commentshown"; 
+		(obj1.className=="commentshown") ? obj2.innerHTML="<< Hide" : obj2.innerHTML="Show all >>"; 
+
+}
+
+function checkAll(objName, FormName, FieldName ) {
+
+	var obj = document.getElementsByName(objName);
+	var CheckValue = obj[0].checked;
+
+	if(!document.forms[FormName])
+		return;
+	var objCheckBoxes = document.forms[FormName].elements[FieldName];
+	if(!objCheckBoxes)
+		return;
+	var countCheckBoxes = objCheckBoxes.length;
+	if(!countCheckBoxes)
+		objCheckBoxes.checked = CheckValue;
+	else
+		// set the check value for all check boxes
+		for(var i = 0; i < countCheckBoxes; i++)
+			objCheckBoxes[i].checked = CheckValue;
+}
+
+function updateSelectAll(objId, allId) {
+	var obj = document.getElementById(objId);
+	var allCheckbox = document.getElementById(allId);	
+	
+	if (!objId.checked && allCheckbox.checked) {
+		allCheckbox.checked = false;
+	}
+		
+		
+}
+//--></script>
+
+<title>ATNF Pulsar Data Archive Testing</title>
+
+<!-- Start Content -->
+<?php
+	
+include_once("../../constants.php");
+include_once("../../security.php");
+include_once("../../database.php");
+include_once("../../date.php");
+
+$now_day = date("j");
+$now_month = date("n");
+$now_year = date("Y");
+
+$all_params_id = "all_params";
+$all_others_id = "all_others";
+
+//$link = db_connect();
+
+///////////////////////////////////////////////////////////////////////////
+
+		$link = db_connect_admin();
+
+$createTable = "CREATE TEMPORARY TABLE s70 (file_id SMALLINT UNSIGNED AUTO_INCREMENT,filename VARCHAR(30),fileloc VARCHAR(100),hdrver VARCHAR(10),src_name VARCHAR(20),raj VARCHAR(15),decj VARCHAR(15),rajd FLOAT,decjd FLOAT,bmaj FLOAT,bmin FLOAT,bpa FLOAT,date_obs VARCHAR(30),obsfreq FLOAT,chanbw FLOAT,nchan FLOAT,scanlen FLOAT,tbin FLOAT,PRIMARY KEY (file_id))";
+
+$result = mysql_query($createTable) or die('Query failed #1: ' . mysql_error());
+
+$loadTable = "LOAD DATA LOCAL INFILE \"/DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary.csv\" INTO TABLE s70 FIELDS TERMINATED BY \",\" OPTIONALLY ENCLOSED BY \"\\\"\" IGNORE 1 LINES (filename,fileloc,hdrver,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,obsfreq,chanbw,nchan,scanlen,tbin)";
+//"
+$result = mysql_query($loadTable) or die('Query failed #2: ' . mysql_error());
+
+//////////////////////////////////////////////
+// Get the field names to fill form checkboxes
+
+$query = "SHOW COLUMNS FROM s70";
+$result = mysql_query($query) or die ('Query failed: ' . mysql_error());
+
+$fields = array();
+if (mysql_num_rows($result)) {
+	while($row = mysql_fetch_assoc($result)) {
+		array_push($fields, $row);
+	}
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+?>
+
+<body class="atoa">
+
+<form action="conequery-basic.php" method="GET" name="data_archive_form" id="data_archive_form">
+<input type="hidden" name="state" value="results">
+
+<table class="noborder">
+
+	<tr>
+	
+	<td valign="top" class="form_field" rowspan="1">
+	
+	<fieldset>
+		<legend>Display Parameters</legend>
+		<input type="checkbox" name="<?php echo $all_params_id; ?>" id="<?php echo $all_params_id; ?>" onClick="checkAll('<?php echo $all_params_id; ?>', 'data_archive_form', 'params[]')" checked="true">Select all<br>
+			<font size="-1"><a href="javascript:togglecomments('params', 'toggler1')" id="toggler1">Show all >></a></font><br>
+			<span class="commenthidden" id="params">
+			<div id="list">
+				<?php
+				// Special case for ra and dec
+				$raj_count = 0;
+				$decj_count = 0;
+				$raj_field = "";
+				$decj_field = "";
+
+				foreach ($fields as $field) {
+					if (ereg("raj_.+", $field['Field'] )) {
+						$raj_field .= "," . $field['Field'];
+						$raj_count++;
+						if ($raj_count == 3) {
+							$raj_field = trim($raj_field, " ,");
+							echo "<input onClick=\"updateSelectAll('ra',
+'$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"$raj_field\" id=\"RA\" checked=\"true\">RA<br>\n";
+						}
+					}
+					else if (ereg("decj_.+", $field['Field'] ) ){
+						$decj_field .= "," . $field['Field'];
+						$decj_count++;
+						if ($decj_count == 3) {
+							$decj_field = trim($decj_field, " ,");
+							echo "<input onClick=\"updateSelectAll('dec', '$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"$decj_field\" id=\"dec\" checked=\"true\">DecJ<br>\n";
+						}
+					}
+					else {
+						echo "<input
+onClick=\"updateSelectAll('".$field['Field']."', '$all_params_id')\" type=\"checkbox\" name=\"params[]\" value=\"".$field['Field']."\" id=\"".$field['Field']."\" checked=\"true\">".$field['Field']."<br>\n";
+					}
+				}
+				?>
+			</div>
+			</span>
+	</fieldset>
+	</td>
+
+	<td class="form_field" height="10%">
+	<!-- Filter Options -->
+	<fieldset id="flsPosition">
+				
+		<legend>Filter Options</legend>
+
+
+		<!-- Coordinates -->
+		<fieldset>
+			<legend>Coordinates</legend>
+
+			RAJ [deg]: <input type="text" name="raj_degs" size="10">
+			DecJ [deg]: <input type="text" name="decj_degs" size="10">
+			Search radius [deg]: <input type="text" name="radius" size="10">
+
+
+		</fieldset>	
+
+	</fieldset>
+	<br>
+	<input type="submit" value="submit" name="submit_button">
+	</td>
+	</tr>	
+</table>
+
+
+</form>
+
+
+</body>
+
+</html>
Index: /trunk/new-htdocs/xmlFunctions.php
===================================================================
--- /trunk/new-htdocs/xmlFunctions.php	(revision 82)
+++ /trunk/new-htdocs/xmlFunctions.php	(revision 82)
@@ -0,0 +1,89 @@
+<?php
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Function definitions necessary to create XML/VOTABLE files.
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+function print_column_headers_VO() {
+
+/// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
+
+	echo "<FIELD name=\"Filename\" ID=\"col1\" ucd=\"meta.id;meta.main\" datatype=\"char\" arraysize=\"30\">\n";
+	echo " <DESCRIPTION>\n  This is the name of the PSRFITS file at this position.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"Target Name\" ID=\"col2\" ucd=\"obs.field;meta.id\" datatype=\"char\" arraysize=\"20\">\n";
+	echo " <DESCRIPTION>\n  This is the name of the PSRFITS file at this position.\n </DESCRIPTION>\n</FIELD>\n";
+
+        echo "<FIELD name=\"Survey\" ID=\"col3\" ucd=\"obs;meta.dataset;meta.id\" datatype=\"char\" arraysize=\"10\">\n";
+	echo " <DESCRIPTION>\n  The short code for the survey type: S70=70cm Parkes Southern Pulsar Survey; PM=Parkes Multibeam Pulsar Survey, PH=Parkes High-Latitude Pulsar Survey; blank means not part of a survey or unknown.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"RA\" ID=\"col4\" ucd=\"pos.eq.ra;meta.main\" ref=\"J2000\" datatype=\"float\" width=\"10\" precision=\"6\" unit=\"deg\">\n";
+	echo " <DESCRIPTION>\n  The Right Ascension of the central position of the pointing.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"DEC\" ID=\"col5\" ucd=\"pos.eq.dec;meta.main\" ref=\"J2000\" datatype=\"float\" width=\"11\" precision=\"6\" unit=\"deg\">\n";
+	echo " <DESCRIPTION>\n  The Declination of the central position of the pointing.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"BMAJ\" ID=\"col6\" ucd=\"pos.angResolution;phys.angSize.smajAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
+	echo " <DESCRIPTION>\n  The full-width-half-maximum (FWHM) of the major-axis of the beam.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"BMIN\" ID=\"col7\" ucd=\"pos.angResolution;phys.angSize.sminAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
+	echo " <DESCRIPTION>\n  The full-width-half-maximum (FWHM) of the minor-axis of the beam.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"BPA\" ID=\"col8\" ucd=\"pos.angResolution;pos.posAng\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
+	echo " <DESCRIPTION>\n  The position angle of the beam.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"UT Date/Time of Observations\" ID=\"col9\" ucd=\"time.start\" datatype=\"char\" arraysize=\"30\">\n";
+	echo " <DESCRIPTION>\n  The UT Date and Time of the start of the observations, in FITS DATE-OBS format.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"ObsFreq\" ID=\"col10\" ucd=\"em.freq.central\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"MHz\">\n";
+	echo " <DESCRIPTION>\n  The central observing frequency.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"Channel Bandwidth\" ID=\"col11\" ucd=\"spect.binSize;em.freq\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"MHz\">\n";
+	echo " <DESCRIPTION>\n  The frequency width of each channel.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"Number of Channels\" ID=\"col12\" ucd=\"em.bin;meta.number\" datatype=\"int\" width=\"6\">\n";
+	echo " <DESCRIPTION>\n  The number of frequency channels.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"Scan length\" ID=\"col13\" ucd=\"obs.exposure;time.duration\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"s\">\n";
+	echo " <DESCRIPTION>\n  The total length of time taken for this observation.\n </DESCRIPTION>\n</FIELD>\n";
+
+	echo "<FIELD name=\"Sample time\" ID=\"col14\" ucd=\"time.resolution\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"ms\">\n";
+	echo " <DESCRIPTION>\n  The time for each sample in the observation.\n </DESCRIPTION>\n</FIELD>\n";
+
+
+}
+
+function print_data_VO($all_results) {
+  
+  echo "<DATA>\n<TABLEDATA>\n";
+  for ($i=0; $i < count($all_results); $i++) {
+    $line = $all_results[$i];
+    print_data_line_VO($line);
+  }
+  echo "</TABLEDATA>\n</DATA>\n";
+
+}
+
+function print_data_line_VO($line) {
+/// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
+	echo "<TR>\n ";
+	printf("<TD>%s</TD>",$line['filename']);
+	printf("<TD>%s</TD>",$line['src_name']);
+	printf("<TD>%s</TD>",$line['survey']);
+	printf("<TD>%10.6f</TD>",$line['rajd']);
+	printf("<TD>%+11.6f</TD>",$line['decjd']);
+	printf("<TD>%6.4f</TD>",$line['bmaj']);
+	printf("<TD>%6.4f</TD>",$line['bmin']);
+	printf("<TD>%6.4f</TD>",$line['bpa']);
+	printf("<TD>%s</TD>",$line['date_obs']);
+	printf("<TD>%9.4f</TD>",$line['obsfreq']);
+	printf("<TD>%9.4f</TD>",$line['chanbw']);
+	printf("<TD>%d</TD>",$line['nchan']);
+	printf("<TD>%9.4f</TD>",$line['scanlen']);
+	printf("<TD>%9.4f</TD>",$line['tbin']);
+	echo "\n</TR>\n";
+}
+
+?>
Index: /trunk/set_php_files.sh
===================================================================
--- /trunk/set_php_files.sh	(revision 82)
+++ /trunk/set_php_files.sh	(revision 82)
@@ -0,0 +1,15 @@
+#!/bin/tcsh 
+#
+# A script to install the files etc into the correct directory,
+# changing their suffixes so that it matches the PSR standards (ie. as
+# expected by the makefiles and so on).
+
+set HOST=herschel
+
+set PHPDEST=/var/www/vhosts/pulsararchive.atnf.csiro.au/htdocs
+
+set MYDIR=test/whi550
+
+set LOCALDIR=$PVO/new-htdocs
+
+ssh $HOST -x cp -f --reply=yes $LOCALDIR/*.php $PHPDEST/$MYDIR
Index: /trunk/sql/create_table_s70.sql
===================================================================
--- /trunk/sql/create_table_s70.sql	(revision 81)
+++ /trunk/sql/create_table_s70.sql	(revision 82)
@@ -8,4 +8,5 @@
 	fileloc VARCHAR(100),
 	hdrver VARCHAR(10),
+	survey VARCHAR(10),
 	src_name VARCHAR(20),
 	raj VARCHAR(15),
@@ -35,3 +36,3 @@
 OPTIONALLY ENCLOSED BY "\""
 IGNORE 1 LINES  -- this ignores the first line in the csv file which contains the column headers.
-(filename,fileloc,hdrver,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,obsfreq,chanbw,nchan,scanlen,tbin);
+(filename,fileloc,hdrver,survey,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,obsfreq,chanbw,nchan,scanlen,tbin);
