} elseif (in_array($table[$i], $tab_no_fusion) and $field_and_or[$i] != "" and isset($sql_seach[$operation][$table[$i]])) {
     $sql_seach[$operation][$table[$i]][$k] .= $field_and_or[$i] . $field[$i] . $field_compar[$i] . $field_value[$i] . $field_value_complement[$i];
     $trait_cache = traitement_cache($sql_temp, $field_modif, $field_value[$i], $field_value_complement[$i]);
     $sql_cache[$operation][$table[$i]][$k] .= $field_and_or[$i] . $field[$i] . $field_compar[$i] . $trait_cache['field_value'] . $trait_cache['field_value_complement'];
 } else {
     //si la requête existe déjà
     if (isset($sql_seach[$operation][$table[$i]])) {
         //si le champ "AND/OR" est vide, on doit concat des champs différents de la même table
         //				if ($field_and_or[$i] == "")
         //					$field_and_or[$i]="AND";
         $sql_seach[$operation][$table[$i]][$k] .= $field_and_or[$i] . $field[$i] . $field_compar[$i] . $field_value[$i] . $field_value_complement[$i];
         $trait_cache = traitement_cache($sql_temp, $field_modif, $field_value[$i], $field_value_complement[$i]);
         $sql_cache[$operation][$table[$i]][$k] .= $field_and_or[$i] . $field[$i] . $field_compar[$i] . $trait_cache['field_value'] . $trait_cache['field_value_complement'];
     } else {
         //on la crée
         $traitement = generate_sql($table[$i]);
         $sql_seach[$operation][$table[$i]][$i] = $traitement['sql_temp'] . " ( " . $field[$i] . $field_compar[$i] . $field_value[$i] . $field_value_complement[$i];
         $trait_cache = traitement_cache($sql_temp, $field_modif, $field_value[$i], $field_value_complement[$i]);
         $sql_cache[$operation][$table[$i]][$i] = $traitement['sql_cache'] . " ( " . $field[$i] . $field_compar[$i] . $trait_cache['field_value'] . $trait_cache['field_value_complement'];
     }
 }
 //stockage de la table sur laquelle on requete
 //pour afficher les champs correspondant
 $list_tables_request[$table[$i]] = $table[$i];
 //si une erreur a été rencontrée
 //le traitement est arrêté (gain de temps)
 //		if (isset($ERROR)){
 //			echo "ATTENTION: ERREUR ".$ERROR;
 //			break;
 //		}
 $i++;
Esempio n. 2
0
include $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
include $phpbb_root_path . 'includes/functions_shoutbox.' . $phpEx;
include $phpbb_root_path . 'install/functions.' . $phpEx;
// Start session management
$user->session_begin(false);
$auth->acl($user->data);
$user->setup('mods/shout');
if ($user->data['user_type'] != USER_FOUNDER) {
    trigger_error('NO_FOUNDER');
}
if (isset($config['as_version'])) {
    trigger_error('ONLY_INSTALL');
}
$dbms = $db->sql_layer;
$table = '';
generate_sql($table, $dbms);
if (empty($table)) {
    // Should never happen.
    trigger_error('This error should not happen');
}
$config_items = array('as_interval' => 3600, 'as_prune' => 24 * 14, 'as_max_posts' => 0, 'as_flood_interval' => 15, 'as_version' => VERSION, 'as_ie_nr' => 5, 'as_non_ie_nr' => 20);
$config_items_dyn = array('last_as_run' => 0);
$permissions = array('global' => array('u_as_post', 'u_as_view', 'u_as_info', 'u_as_delete', 'u_as_edit', 'u_as_smilies', 'u_as_bbcode', 'u_as_mod_edit', 'u_as_ignore_flood', 'a_as_manage'));
if (!function_exists('get_available_dbms')) {
    global $phpbb_root_path, $phpEx;
    include $phpbb_root_path . 'includes/functions_install.' . $phpEx;
}
$available_dbms = get_available_dbms();
if ($dbms == 'mysql4' || $dbms == 'mysql') {
    if (version_compare($db->mysql_version, '4.1.3', '>=')) {
        $available_dbms['mysql']['SCHEMA'] .= '_41';
$ttop = isset($_GET['ttop']) ? $_GET['ttop'] : '3663787.8365148474';
$selector = isset($_GET['selector']) ? $_GET['selector'] : 'all';
$format = isset($_GET['format']) ? $_GET['format'] : 'xml';
//$access = isset($_GET['access']) ? $_GET['access'] : '0';
//$housename = isset($_GET['housename']) ? $_GET['housename'] : '0';
//$housenumber = isset($_GET['housenumber']) ? $_GET['housenumber'] : '0';
//$admin_level = isset($_GET['admin_level']) ? $_GET['admin_level'] : '0';
//$aerialway = isset($_GET['aerialway']) ? $_GET['aerialway'] : '0';
//echo $format;
$query_array = array("osm_id" => isset($_GET['osm_id']) ? $_GET['osm_id'] : false, "access" => isset($_GET['access']) ? $_GET['access'] : false, "addr:housename" => isset($_GET['addr_housename']) ? $_GET['addr_housename'] : false, "addr:housenumber" => isset($_GET['addr_housenumber']) ? $_GET['addr_housenumber'] : false, "addr:interpolation" => isset($_GET['addr_interpolation']) ? $_GET['addr_interpolation'] : false, "admin_level" => isset($_GET['admin_level']) ? $_GET['admin_level'] : false, "aerialway" => isset($_GET['aerialway']) ? $_GET['aerialway'] : false, "aeroway" => isset($_GET['aeroway']) ? $_GET['aeroway'] : false, "amenity" => isset($_GET['amenity']) ? $_GET['amenity'] : false, "area" => isset($_GET['area']) ? $_GET['area'] : false, "barrier" => isset($_GET['barrier']) ? $_GET['barrier'] : false, "bicycle" => isset($_GET['bicycle']) ? $_GET['bicycle'] : false, "brand" => isset($_GET['brand']) ? $_GET['brand'] : false, "bridge" => isset($_GET['bridge']) ? $_GET['bridge'] : false, "boundary" => isset($_GET['boundary']) ? $_GET['boundary'] : false, "building" => isset($_GET['building']) ? $_GET['building'] : false, "capital" => isset($_GET['capital']) ? $_GET['capital'] : false, "construction" => isset($_GET['construction']) ? $_GET['construction'] : false, "covered" => isset($_GET['covered']) ? $_GET['covered'] : false, "culvert" => isset($_GET['culvert']) ? $_GET['culvert'] : false, "cutting" => isset($_GET['cutting']) ? $_GET['cutting'] : false, "denomination" => isset($_GET['denomination']) ? $_GET['denomination'] : false, "disused" => isset($_GET['disused']) ? $_GET['disused'] : false, "ele" => isset($_GET['ele']) ? $_GET['ele'] : false, "embankment" => isset($_GET['embankment']) ? $_GET['embankment'] : false, "foot" => isset($_GET['foot']) ? $_GET['foot'] : false, "generator:source" => isset($_GET['generator_source']) ? $_GET['generator_source'] : false, "harbour" => isset($_GET['harbour']) ? $_GET['harbour'] : false, "highway" => isset($_GET['highway']) ? $_GET['highway'] : false, "historic" => isset($_GET['historic']) ? $_GET['historic'] : false, "horse" => isset($_GET['horse']) ? $_GET['horse'] : false, "intermittent" => isset($_GET['intermittent']) ? $_GET['intermittent'] : false, "junction" => isset($_GET['junction']) ? $_GET['junction'] : false, "landuse" => isset($_GET['landuse']) ? $_GET['landuse'] : false, "layer" => isset($_GET['layer']) ? $_GET['layer'] : false, "leisure" => isset($_GET['leisure']) ? $_GET['leisure'] : false, "lock" => isset($_GET['lock']) ? $_GET['lock'] : false, "man_made" => isset($_GET['man_made']) ? $_GET['man_made'] : false, "military" => isset($_GET['military']) ? $_GET['military'] : false, "motorcar" => isset($_GET['motorcar']) ? $_GET['motorcar'] : false, "name" => isset($_GET['name']) ? $_GET['name'] : false, "natural" => isset($_GET['natural']) ? $_GET['natural'] : false, "office" => isset($_GET['office']) ? $_GET['office'] : false, "oneway" => isset($_GET['oneway']) ? $_GET['oneway'] : false, "operator" => isset($_GET['operator']) ? $_GET['operator'] : false, "place" => isset($_GET['place']) ? $_GET['place'] : false, "poi" => isset($_GET['poi']) ? $_GET['poi'] : false, "population" => isset($_GET['population']) ? $_GET['population'] : false, "power" => isset($_GET['power']) ? $_GET['power'] : false, "power_source" => isset($_GET['power_source']) ? $_GET['power_source'] : false, "public_transport" => isset($_GET['public_transport']) ? $_GET['public_transport'] : false, "railway" => isset($_GET['railway']) ? $_GET['railway'] : false, "ref" => isset($_GET['ref']) ? $_GET['ref'] : false, "religion" => isset($_GET['religion']) ? $_GET['religion'] : false, "route" => isset($_GET['route']) ? $_GET['route'] : false, "service" => isset($_GET['service']) ? $_GET['service'] : false, "shop" => isset($_GET['shop']) ? $_GET['shop'] : false, "sport" => isset($_GET['sport']) ? $_GET['sport'] : false, "surface" => isset($_GET['surface']) ? $_GET['surface'] : false, "toll" => isset($_GET['toll']) ? $_GET['toll'] : false, "tourism" => isset($_GET['tourism']) ? $_GET['tourism'] : false, "tower:type" => isset($_GET['tower_type']) ? $_GET['tower_type'] : false, "tracktype" => isset($_GET['tracktype']) ? $_GET['tracktype'] : false, "tunnel" => isset($_GET['tunnel']) ? $_GET['tunnel'] : false, "water" => isset($_GET['water']) ? $_GET['water'] : false, "waterway" => isset($_GET['waterway']) ? $_GET['waterway'] : false, "wetland" => isset($_GET['wetland']) ? $_GET['wetland'] : false, "width" => isset($_GET['width']) ? $_GET['width'] : false, "wood" => isset($_GET['wood']) ? $_GET['wood'] : false, "z_order" => isset($_GET['z_order']) ? $_GET['z_order'] : false, "way_area" => isset($_GET['way_area']) ? $_GET['way_area'] : false, "tags" => isset($_GET['tags']) ? $_GET['tags'] : false, "way" => isset($_GET['way']) ? $_GET['way'] : false, "way_area" => isset($_GET['way_area']) ? $_GET['way_area'] : false);
$conn_string = "host=dmb.tongji.edu.cn port=5432 dbname=osm user=postgres password=429jhguan";
$dbconn = pg_connect($conn_string);
if (!$dbconn) {
    die(json_encode(array("message" => "failed")));
}
$query = generate_sql($query_array);
if ($selector != 'All') {
    $query = $query . "from planet_osm_" . $selector . " Where ST_within(way,ST_MakeEnvelope(" . $left . "," . $bottom . "," . $right . "," . $ttop . ",900913));";
} else {
    //echo "coming soon...";
    /*此处写所有数据一起导出时的语句*/
}
//$query = "Select * from query_to_xml(Select ST_Astext(way) as point from planet_osm_point Where ST_within(way,ST_MakeEnvelope(".$left.",".$bottom.",".$right.",".$ttop.",900913)),true,false,'')";
//$query = "Select ST_Astext(way) as point from planet_osm_point Where ST_within(way,ST_MakeEnvelope(".$left.",".$bottom.",".$right.",".$ttop.",900913))";
//echo $query;
$result = pg_query($query);
$arr = array();
$data = array();
$Item = array();
$Column = array();
$resultCount = 0;
Esempio n. 4
0
<?php 
include "lib/autoload.php";
if (file_exists("schema.php")) {
    include "schema.php";
    if (isset($config) && isset($schema)) {
        echo "<p>Base de datos <b>{$config['db']}</b></p>";
        echo "<ul>";
        generate_conection($config);
        generate_sql($config, $schema);
        foreach ($schema as $tablename => $tabledata) {
            generate_form($tablename, $tabledata);
            generate_form_edit($tablename, $tabledata);
            generate_adder($tablename, $tabledata);
            generate_editer($tablename, $tabledata);
            generate_list($tablename, $tabledata);
            generate_deleter($tablename, $tabledata);
        }
        echo "<li>Finalizado</li>";
        echo "</ul>";
    }
}