Пример #1
0
                $fields_to_print[] = $field;
            }
        }
        $sql_query = 'SELECT ' . implode(',', $fields_to_print) . ' ' . $sql_query_from;
        break;
    case "sql":
        $filename = "hfc_freequery";
        break;
    default:
        exit(0);
}
// retreive comments from all the tables
$query_comment = "SHOW TABLES FROM " . $global['TBSP'];
$res = execute_query($query_comment);
$field = 'TABLES_IN_' . strtoupper($global['TBSP']);
$tab_comment = get_tables_comments($res[$field]);
//$sql_query = strtoupper($_SESSION['query'][$what]);
//print_r($sql_query);
if (strlen($sql_query)) {
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, no-store, must-revalidate");
    header("Pragma: No-Cache");
    header("Content-type: application/octet-stream");
    header("Content-Disposition: attachment; filename=\"{$filename}.{$ofmt}\"");
    // use STILTS to make a SQL query with votable as output format
    //$cmd = "/var/www/cgi-bin/stilts/stilts ";
    $cmd = $global['STILTS_EXE'];
    //$cmd = $cmd."-classpath /home/renie/develop/workspace/lib/mysql-connector-java-5.0.8-bin.jar -Djdbc.drivers=com.mysql.jdbc.Driver sqlclient ";
    $cmd = $cmd . "db='jdbc:mysql://" . $global['MYSQL_HOST'] . ":3306/" . $global['TBSP'] . "' user='******'MYSQL_USER'] . "' password='******'MYSQL_PASS'] . "' ";
    switch ($ofmt) {
Пример #2
0
<?php

session_start();
//print_r($_SESSION);
require_once "functions.php";
include "header.php";
// retreive comment from database for description of the fields
$table_fil_comments = get_tables_comments(array("VIEW_FIL_HQI"));
//$table_fil_comments['PHENOM'] = "Phenomen";
$table_pro_comments = get_tables_comments(array("VIEW_PRO_HQI"));
$table_ar_comments = get_tables_comments(array("VIEW_AR_HQI"));
$table_ch_comments = get_tables_comments(array("VIEW_CH_HQI"));
$table_sp_comments = get_tables_comments(array("VIEW_SP_HQI"));
$table_t3_comments = get_tables_comments(array("TYPE_III"));
//$table_t2_comments = get_tables_comments(array("TYPE_II"));
$table_rs_comments = get_tables_comments(array("RADIOSOURCES"));
$start = time();
// Traitement de la partie upload VOTable
// renseigne les variables $_SESSION['par_post']['from'] et $_SESSION['par_post']['to'] en fonction des dates figurant dans le fichier VOTable
if (count($_FILES)) {
    if ($_FILES['upload_file']['error']) {
        switch ($_FILES['nom_du_fichier']['error']) {
            case 1:
                // UPLOAD_ERR_INI_SIZE
                print_error_message("File size limit exceeded!");
                break;
            case 2:
                // UPLOAD_ERR_FORM_SIZE
                print_error_message("File size limit exceeded!");
                break;
            case 3: