omassot 6 anni fa
parent
commit
dc77e801b7
5 ha cambiato i file con 163 aggiunte e 61 eliminazioni
  1. 3 0
      .gitignore
  2. 5 0
      .settings/.gitignore
  3. 69 61
      ajax/geocode.php
  4. 28 0
      create_table.sql
  5. 58 0
      dump-eligibilite-201904110937.sql

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/.buildpath
+/.project
+/.pydevproject

+ 5 - 0
.settings/.gitignore

@@ -0,0 +1,5 @@
+/.jsdtscope
+/org.eclipse.php.core.prefs
+/org.eclipse.wst.common.project.facet.core.xml
+/org.eclipse.wst.jsdt.ui.superType.container
+/org.eclipse.wst.jsdt.ui.superType.name

+ 69 - 61
ajax/geocode.php

@@ -1,63 +1,71 @@
 <?php
-  ini_set('display_errors', 1);
-  ini_set('display_startup_errors', 1);
-  error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
-  
-  if(isset($_GET['text'])) {
+ini_set('display_errors', 1);
+ini_set('display_startup_errors', 1);
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
 
-      $url = 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest';
-      $data = array('f' => 'pjson', 
-                    'searchExtent' => '{"xmin":-0.5,"ymin":49.732307856286,"xmax":-1.97117692088061,"ymax":48.4,"spatialReference":{"wkid":84}}',
-          'text' => $_GET['text']
-      );
-      
-      //url-ify the data for the POST
-      $url_data = http_build_query($data);
-      
-      $ch = curl_init();
-      //set the url, number of POST vars, POST data
-      curl_setopt($ch,CURLOPT_URL, $url);
-      curl_setopt($ch,CURLOPT_POST, true);
-      curl_setopt($ch,CURLOPT_POSTFIELDS, $url_data);
-      
-      //So that curl_exec returns the contents of the cURL; rather than echoing it
-      curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
-      
-      //execute post
-      $result = curl_exec($ch);
-      
-      echo $result;
-  }
-  
-  if(isset($_GET['address'])|isset($_GET['magicKey'])) {
-      
-      $url = 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find';
-      
-      $data = array('f' => 'pjson',
-          'searchExtent' => '{"xmin":-0.5,"ymin":49.732307856286,"xmax":-1.97117692088061,"ymax":48.4,"spatialReference":{"wkid":84}}',
-          'magicKey' => $_GET['magicKey'],
-          'text' => $_GET['address']
-      );
-      
-      //url-ify the data for the POST
-      $url_data = http_build_query($data);
-      
-//       var_dump($url_data);
-      
-      $ch = curl_init();
-      //set the url, number of POST vars, POST data
-      curl_setopt($ch,CURLOPT_URL, $url);
-      curl_setopt($ch,CURLOPT_POST, true);
-      curl_setopt($ch,CURLOPT_POSTFIELDS, $url_data);
-      
-      //So that curl_exec returns the contents of the cURL; rather than echoing it
-      curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
-      
-      //execute post
-      $result = curl_exec($ch);
-      
-      echo $result;
-  }
-  
-  
-?>
+if(isset($_GET['text'])) {
+    
+    $url = 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest';
+    $data = array('f' => 'pjson',
+        'searchExtent' => '{"xmin":-0.5,"ymin":49.732307856286,"xmax":-1.97117692088061,"ymax":48.4,"spatialReference":{"wkid":84}}',
+        'text' => $_GET['text']
+    );
+    
+    //url-ify the data for the POST
+    $url_data = http_build_query($data);
+    
+    $ch = curl_init();
+    //set the url, number of POST vars, POST data
+    curl_setopt($ch,CURLOPT_URL, $url);
+    curl_setopt($ch,CURLOPT_POST, true);
+    curl_setopt($ch,CURLOPT_POSTFIELDS, $url_data);
+    
+//     $fp = fopen(dirname(__FILE__).'/suggest.log', 'w');
+//     curl_setopt($ch, CURLOPT_VERBOSE, 1);
+//     curl_setopt($ch, CURLOPT_STDERR, $fp);
+    
+    //So that curl_exec returns the contents of the cURL; rather than echoing it
+    curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
+    
+    //execute post
+    $result = curl_exec($ch);
+    
+    echo $result;
+}
+
+if(isset($_GET['address'])|isset($_GET['magicKey'])) {
+    
+    $url = 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find';
+    
+    $data = array('f' => 'pjson',
+        'searchExtent' => '{"xmin":-0.5,"ymin":49.732307856286,"xmax":-1.97117692088061,"ymax":48.4,"spatialReference":{"wkid":84}}',
+        'magicKey' => $_GET['magicKey'],
+        'text' => $_GET['address']
+    );
+    
+    //url-ify the data for the POST
+    $url_data = http_build_query($data);
+    
+    //       var_dump($url_data);
+    
+    $ch = curl_init();
+    //set the url, number of POST vars, POST data
+    curl_setopt($ch,CURLOPT_URL, $url);
+    curl_setopt($ch,CURLOPT_POST, true);
+    curl_setopt($ch,CURLOPT_POSTFIELDS, $url_data);
+    
+//     $fp = fopen(dirname(__FILE__).'/find.log', 'w');
+//     curl_setopt($ch, CURLOPT_VERBOSE, 1);
+//     curl_setopt($ch, CURLOPT_STDERR, $fp);
+    
+    //So that curl_exec returns the contents of the cURL; rather than echoing it
+    curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
+    
+    //execute post
+    $result = curl_exec($ch);
+    
+    echo $result;
+}
+
+
+?>

+ 28 - 0
create_table.sql

@@ -0,0 +1,28 @@
+CREATE TABLE IF NOT EXISTS sig_ant.ftth_smmn_preinscriptions (
+  "id" int NOT NULL,
+  "date" date NOT NULL,
+  "nom" varchar(50) NOT NULL,
+  "prenom" varchar(50) NOT NULL,
+  "email" varchar(100) NOT NULL,
+  "telephone_fixe" varchar(10) NOT NULL,
+  "telephone_portable" varchar(10) NOT NULL,
+  "numero_voie" varchar(10) NOT NULL,
+  "type_voie" varchar(40) NOT NULL,
+  "nom_voie" varchar(120) NOT NULL,
+  "complement_addresse" varchar(250) NOT NULL,
+  "batiment" varchar(30) NOT NULL,
+  "cage_escalier" varchar(10) NOT NULL,
+  "etage" varchar(10) NOT NULL,
+  "numero_appartement" varchar(10) NOT NULL,
+  "code_postal" varchar(5) NOT NULL,
+  "ville" varchar(250) NOT NULL,
+  "geo_code" varchar(250) NOT NULL,
+  "vous_etes" varchar(250) NOT NULL,
+  "ce_logement_est" varchar(250) NOT NULL,
+  "accord" varchar(30) NOT NULL,
+  "info_et_libertes" bool NOT NULL,
+  "id_zapm_partielle" varchar(25) NOT NULL
+);
+
+ALTER TABLE sig_ant.ftth_smmn_preinscriptions
+    ADD PRIMARY KEY (id);

File diff suppressed because it is too large
+ 58 - 0
dump-eligibilite-201904110937.sql


Some files were not shown because too many files changed in this diff