Esempio n. 1
0
# =============================================
# EGSO 2003,2004 - by Max Jurcev
# INAF - Trieste Astronomical Observatory
# ---------------------------------------------
# SEC - SOAP client for the web user
# sec_soap.php
# last update 09-feb-2005
# =============================================
if (PHP_VERSION >= '5') {
    require_once 'domxml-php4-to-php5.php';
}
require_once 'nusoap.php';
require "sec_global.php";
require "sec_votable.php";
import_request_variables("pg");
echo sec_header("HELIO HEC - Results");
$xmldate = date("Ymd_His");
$xml1 = "hec1_{$xmldate}.xml";
$xml2 = "hec2_{$xmldate}.xml";
$txt1 = "hec1_{$xmldate}.txt";
$txt2 = "hec2_{$xmldate}.txt";
$max_xml_size = 100 * 1024;
// 100 KB is the max XML file size
$max_xml_error = "The VOTable result file is too large to display on this page, but the results can be downloaded from the XML result file link above. It is possible to reduce number of results by shortening the data selection interval or refining your query";
//	$sql=str_replace("\\","",$sql);
// prepare sql query string:
if ($qtype == 0) {
    $s1 = $sql;
} else {
    while (!checkdate($mo_from, $d_from, $y_from) and $d_from > 0) {
        $d_from--;
Esempio n. 2
0
<?php

# =============================================
# HELIO 2009,2011 - by A.Santin
# INAF - Trieste Astronomical Observatory
# ---------------------------------------------
# HEC - UI main page
# hec_gui_fetch.php
# last 11-feb-2011, 18-feb-2011
# =============================================
import_request_variables("g");
require "sec_global.php";
echo sec_header("HELIO HEC - GUI");
//print_r($_GET);
$word = $_GET['q'];
$cmd = "grep -i " . $word . " /var/www/hec/stfc/HEC_ListsAll.html";
$result = shell_exec($cmd);
//print_r($result);
$lines = explode("\n", $result);
foreach ($lines as $line) {
    $line = str_replace($word, "<font style='color:blue; background-color:yellow;'>{$word}</font>", $line);
    echo '<a href="stfc/HEC_ListsAll.html">' . $line . '</a><br>';
}
echo sec_footer();
Esempio n. 3
0
# EGSO 2003 SEC server - by Max Jurcev
# INAF - Trieste Astronomical Observatory
# first 13/feb/2004
# last  12/may/2005 A.Santin
# ---------------------------------------------
# hec_doc_generator.php
# =============================================
require "hec_global.php";
$type = array("i" => "integer", "f" => "float", "t" => "datetime", "b" => "boolean", "s" => "string");
$dbconn = pg_connect("dbname=hec");
if (!$dbconn) {
    echo "Error: unable to connect database";
    die;
}
$f1 = fopen("{$hecdir}/sec_doc.htm", 'w');
$s = sec_header("HEC description");
$s .= "Description of the HEC database architecture.<br>";
$s .= "Cross queries among different catalogues are possible by using common fields.";
// ---------------------------------------
$s .= "<h2>Tables</h2>";
$s .= "<table border=1>\n";
$s .= "<tr class=\"head\"><th>Table name</th><th>List Name</th><th>Description/URL</th></tr>";
//read groups
$sql_string = "SELECT hec_groups_id,hec_group_name FROM hec_groups;";
$result = pg_exec($dbconn, $sql_string);
if ($result) {
    while ($r = pg_fetch_array($result)) {
        $groups[$r['hec_groups_id']] = $r['hec_group_name'];
    }
}
// read database for table list
Esempio n. 4
0
<?php

# =============================================
# EGSO 2003,2004 - by Max Jurcev
# INAF - Trieste Astronomical Observatory
# ---------------------------------------------
require "sec_global.php";
echo sec_header("EGSO SEC test");
# =============================================
# connect db and perform the query
# =============================================
$dbconn = pg_connect("dbname=hec");
if (!$dbconn) {
    sec_error('Unable to connect to the database');
    exit;
}
$result = pg_exec($dbconn, "SELECT * FROM sgas_event ORDER BY time_start");
if (!$result) {
    sec_error('Error while reading the database');
    exit;
}
sec_showresult($result);
pg_close($dbconn);
echo sec_footer();