浏览代码

Various improvements

boutils 10 年之前
父节点
当前提交
bf94b2cdcc
共有 7 个文件被更改,包括 90 次插入64 次删除
  1. 7 1
      ajax/datastores.php
  2. 0 0
      css/main.css
  3. 8 1
      css/main.less
  4. 2 1
      data/dictionary.json
  5. 8 0
      html/form.html
  6. 12 10
      index.html
  7. 53 51
      js/app.js

+ 7 - 1
ajax/datastores.php

@@ -1,4 +1,8 @@
 <?php
 <?php
+
+ini_set("SMTP", "mail.manchenumerique.fr");
+ini_set("sendmail_from", "ftth@manchenumerique.fr");
+
 function connect(){
 function connect(){
 
 
   $link = mysql_connect('127.0.0.1','eligibilite','B3Kg7z6d') or die(mysql_error());
   $link = mysql_connect('127.0.0.1','eligibilite','B3Kg7z6d') or die(mysql_error());
@@ -38,8 +42,10 @@ if($_POST['mail']) {
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
      $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
 
 
+     $email = $_POST['siteEmail'] || 'ftth@manchenumerique.fr';
+
      // En-têtes additionnels
      // En-têtes additionnels
-     $headers .= 'From: Manche Numérique <ffth@manchenumerique.fr>' . "\r\n";
+     $headers .= 'From: Manche Numérique <'.$email.'>' . "\r\n";
 
 
      // Envoi
      // Envoi
      $to=$_POST['mail']['to'];
      $to=$_POST['mail']['to'];

文件差异内容过多而无法显示
+ 0 - 0
css/main.css


+ 8 - 1
css/main.less

@@ -65,6 +65,14 @@ a {
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 
 
+.note {
+  font-size: 11px;
+}
+
+.modal-dialog {
+  width: 770px !important;
+}
+
 .other-radio {
 .other-radio {
   border: none;
   border: none;
   border-bottom: 1px solid #ddd;
   border-bottom: 1px solid #ddd;
@@ -99,7 +107,6 @@ a {
 }
 }
 
 
 .box-eligibilite-title .btn{
 .box-eligibilite-title .btn{
-  float: right;
   z-index: 1000;
   z-index: 1000;
   position: relative;
   position: relative;
 }
 }

+ 2 - 1
data/dictionary.json

@@ -19,5 +19,6 @@
   "DB_MIN"                 : "Affaiblissement minimum (db)",
   "DB_MIN"                 : "Affaiblissement minimum (db)",
   "DB_MAX"                 : "Affaiblissement maximum (db)",
   "DB_MAX"                 : "Affaiblissement maximum (db)",
   "KM²"                    : "Surface zone (km²))",
   "KM²"                    : "Surface zone (km²))",
-  "CODE_NRA"               : "Identifiant NRA"
+  "CODE_NRA"               : "Identifiant NRA",
+  "ID_ZAPM_PARTIELLE"      : "Identifiant ZAPM partielle"
 }
 }

+ 8 - 0
html/form.html

@@ -87,11 +87,19 @@
             </md-radio-button>
             </md-radio-button>
 
 
             <md-radio-button
             <md-radio-button
+              ng-if     = "ctrl.other"
               value     = "autre"
               value     = "autre"
               class     = "md-primary">
               class     = "md-primary">
 
 
               Autre:
               Autre:
             </md-radio-button>
             </md-radio-button>
+
+            <div
+              class = "note"
+              ng-if = "ctrl.note">
+                <br><br>
+                {{ctrl.note}}
+            </div>
           </md-radio-group>
           </md-radio-group>
 
 
           <!-- Type checkbox -->
           <!-- Type checkbox -->

+ 12 - 10
index.html

@@ -268,16 +268,18 @@
                   NON
                   NON
                 </span>
                 </span>
 
 
-                <button
-                  ng-if       = "results.ftth.date"
-                  type        = "button"
-                  class       = "btn btn-primary btn-lg"
-                  data-toggle = "modal"
-                  ng-click    = "initPopup()"
-                  data-target = "#mn_inscription">
-
-                  Inscription
-                </button>
+                <div ng-if = "results.ftth.date" style="text-align: center; margin-top: 14px;">
+
+                  <button
+                    type        = "button"
+                    class       = "btn btn-primary btn-lg"
+                    data-toggle = "modal"
+                    ng-click    = "initPopup()"
+                    data-target = "#mn_inscription">
+
+                    Inscription
+                  </button>
+                </div>
               </span>
               </span>
             </div>
             </div>
 
 

+ 53 - 51
js/app.js

@@ -21,6 +21,7 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
       siteUrl              = 'http://eligibilite.manchenumerique.fr',
       siteUrl              = 'http://eligibilite.manchenumerique.fr',
       siteEmail            = 'ftth@manchenumerique.fr',
       siteEmail            = 'ftth@manchenumerique.fr',
       siteAddresse         = '235, rue Joseph Cugnot Zone Delta, 50000 SAINT LÔ',
       siteAddresse         = '235, rue Joseph Cugnot Zone Delta, 50000 SAINT LÔ',
+      siteTel              = '02.33.77.83.60',
       layer                = {},
       layer                = {},
       currentMarker, searchExtent;
       currentMarker, searchExtent;
 
 
@@ -117,6 +118,17 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
     }
     }
   ];
   ];
 
 
+  var catAccord = [
+    {
+      "name": "J’ai l’intention de souscrire à une offre Très Haut Débit après \r\n le pré-raccordement",
+      "id"  : "avec_souscription"
+    },
+    {
+      "name": "Je n’ai pas l’intention de souscrire à une offre Très Haut Débit après<br> le pré-raccordement",
+      "id"  : "sans_souscription"
+    }
+  ];
+
   $scope.formulaires = {
   $scope.formulaires = {
     "eligibilite": {
     "eligibilite": {
       "sections": [
       "sections": [
@@ -315,6 +327,7 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
                   "type"   : "radio",
                   "type"   : "radio",
                   "width"  : null,
                   "width"  : null,
                   "require": true,
                   "require": true,
+                  "other"  : true,
                   "options": {
                   "options": {
                     "categories": catVousEtes,
                     "categories": catVousEtes,
                     "alertes": {
                     "alertes": {
@@ -336,6 +349,7 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
                   "type"   : "radio",
                   "type"   : "radio",
                   "width"  : null,
                   "width"  : null,
                   "require": true,
                   "require": true,
+                  "other"  : true,
                   "options": {
                   "options": {
                     "categories": catCeLogementEst
                     "categories": catCeLogementEst
                   },
                   },
@@ -358,14 +372,18 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
                   {
                   {
                     "name"   : "Accord",
                     "name"   : "Accord",
                     "id"     : "accord",
                     "id"     : "accord",
-                    "libelle": "Je souhaite être pré-raccordé au réseau de fibre optique et accepte les conditions de paiement de 50€. IMPORTANT : le règlement ne vous sera demandé qu’après travaux effectués",
-                    "type"   : "checkbox",
+                    "options": {
+                      "categories": catAccord,
+                    },
+                    "type"   : "radio",
                     "width"  : null,
                     "width"  : null,
                     "require": true,
                     "require": true,
+                    "other"  : false,
                     "isValid": function(value) {
                     "isValid": function(value) {
                       return !!value;
                       return !!value;
                     },
                     },
-                    "msg"    : 'Vous devez doner votre accord.'
+                    "msg"    : 'Choix incorrect.',
+                    "note"   : 'IMPORTANT : le règlement ne vous sera demandé qu’après travaux effectués'
                   }
                   }
                ]
                ]
             }
             }
@@ -392,34 +410,12 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
                ]
                ]
             }
             }
           ]
           ]
-        },
-        {
-          "name": "Souscription",
-          "visible": false,
-          "lines": [
-            {
-              "ctrls": [
-                  {
-                    "name"   : "Souscription",
-                    "id"     : "souscription_engagement",
-                    "libelle": 'Vous vous engagez à souscrire un abonnement chez un operateur 50 euros, sinon 400 euros.',
-                    "type"   : "checkbox",
-                    "width"  : null,
-                    "require": true,
-                    "isValid": function(value) {
-                      return !!value;
-                    },
-                    "msg"    : 'Vous devez accepter.'
-                  }
-               ]
-            }
-          ]
         }
         }
       ]
       ]
     }
     }
   };
   };
 
 
-  var addCurrentMarker = function() {
+  var addCurrentMarker = function(withReverse) {
     if(currentMarker) {
     if(currentMarker) {
       map.removeLayer(currentMarker);
       map.removeLayer(currentMarker);
     }
     }
@@ -428,16 +424,16 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
 
 
     currentMarker.bindPopup("L'adresse que vous nous avez fournie est localisée sur la carte. Il se peut que la position réelle de votre logement soit un peu différente. Dans ce cas, merci de déplacer le pointeur sur la carte pour le positionner à l'emplacement de votre logement.").openPopup();
     currentMarker.bindPopup("L'adresse que vous nous avez fournie est localisée sur la carte. Il se peut que la position réelle de votre logement soit un peu différente. Dans ce cas, merci de déplacer le pointeur sur la carte pour le positionner à l'emplacement de votre logement.").openPopup();
 
 
-    reverseLocation($scope.geoCode, null, function(address) {
-      $scope.address = address;
-    });
+     if(withReverse) {
+       reverseLocation($scope.geoCode, null, function(address) {
+        $scope.address = address;
+      });
+    }
 
 
     currentMarker.on('dragend', function(event) {
     currentMarker.on('dragend', function(event) {
       var p = currentMarker.getLatLng();
       var p = currentMarker.getLatLng();
       //console.log('dragend', p);
       //console.log('dragend', p);
 
 
-
-
       $scope.geoCode = {
       $scope.geoCode = {
         x: p.lng,
         x: p.lng,
         y: p.lat
         y: p.lat
@@ -560,7 +556,7 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
         x: p.lng,
         x: p.lng,
         y: p.lat
         y: p.lat
       };
       };
-      addCurrentMarker();
+      addCurrentMarker(true);
       $scope.showResultPane();
       $scope.showResultPane();
       getResults();
       getResults();
     });
     });
@@ -914,7 +910,8 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
 
 
     _.each(record, function(value, property) {
     _.each(record, function(value, property) {
       if(property.charAt(0) === '_' ||
       if(property.charAt(0) === '_' ||
-         value === null |
+        (property === 'date' && identifier === 'ftth') ||
+         value === null ||
          typeof value === 'undefined') {
          typeof value === 'undefined') {
 
 
         return;
         return;
@@ -932,7 +929,7 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
     });
     });
 
 
     if(identifier === 'adsl') {
     if(identifier === 'adsl') {
-      tooltip = '<a style="float: right;" href ="http://www.ariase.com" target="_blank">Tester mon éligibilité ADSL avec Ariase.com</a>';
+      tooltip = '<a style="float: right;" href="http://www.ariase.com/fr/eligibilite/test.html" target="_blank">Tester mon éligibilité ADSL avec Ariase.com</a>';
     }
     }
     return tooltip;
     return tooltip;
   };
   };
@@ -964,22 +961,22 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
       $scope.result = {eligibilite: {}, autres: {}};
       $scope.result = {eligibilite: {}, autres: {}};
 
 
       // Debug
       // Debug
-      $scope.result.eligibilite.prenom                  = 'Francois';
-      $scope.result.eligibilite.nom                     = 'Beaufils';
-      $scope.result.eligibilite.email                   = 'francoisbeaufils@zeno-labs.com';
-      $scope.result.eligibilite.vous_etes               = 'locataire';
-      $scope.result.eligibilite.ce_logement_est         = 'residence_principale';
-      $scope.result.eligibilite.info_et_libertes        = true;
-      $scope.result.eligibilite.accord                  = true;
-      $scope.result.eligibilite.souscription_engagement = true;
-
-      $scope.result.eligibilite.geo_code            = JSON.stringify($scope.geoCode);
-      $scope.result.eligibilite.code_postal         = address.Postal;
-      $scope.result.eligibilite.complement_addresse = address.Match_addr;
-      $scope.result.eligibilite.nom_voie            = address.Address;
-      $scope.result.eligibilite.numero_voie         = address.StreetNumber;
-      $scope.result.eligibilite.type_voie           = address.StreetType;
-      $scope.result.eligibilite.ville               = address.City;
+      // $scope.result.eligibilite.prenom                  = 'Francois';
+      // $scope.result.eligibilite.nom                     = 'Beaufils';
+      // $scope.result.eligibilite.email                   = 'francoisbeaufils@zeno-labs.com';
+      // $scope.result.eligibilite.vous_etes               = 'locataire';
+      // $scope.result.eligibilite.ce_logement_est         = 'residence_principale';
+      // $scope.result.eligibilite.info_et_libertes        = true;
+      // $scope.result.eligibilite.accord                  = 'avec_souscription';
+      // $scope.result.eligibilite.souscription_engagement = true;
+
+      // $scope.result.eligibilite.geo_code            = JSON.stringify($scope.geoCode);
+      // $scope.result.eligibilite.code_postal         = address.Postal;
+      // $scope.result.eligibilite.complement_addresse = address.Match_addr;
+      // $scope.result.eligibilite.nom_voie            = address.Address;
+      // $scope.result.eligibilite.numero_voie         = address.StreetNumber;
+      // $scope.result.eligibilite.type_voie           = address.StreetType;
+      // $scope.result.eligibilite.ville               = address.City;
     });
     });
   };
   };
 
 
@@ -1015,6 +1012,8 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
 
 
     if(!item) {
     if(!item) {
       item           = $scope.suggestions[0];
       item           = $scope.suggestions[0];
+      console.log('3 $scope.address', $scope.address);
+      console.log('3 address', item.text);
       $scope.address = item.text;
       $scope.address = item.text;
     }
     }
     $scope.magicKey = item.magicKey;
     $scope.magicKey = item.magicKey;
@@ -1183,6 +1182,7 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
                 '<div style="">' +
                 '<div style="">' +
                 ' Email: ' + siteEmail + '<br>' +
                 ' Email: ' + siteEmail + '<br>' +
                 ' Adresse: ' + siteAddresse + '<br>' +
                 ' Adresse: ' + siteAddresse + '<br>' +
+                ' Tel: ' + siteTel + '<br>' +
                 '</div><br><br>';
                 '</div><br><br>';
 
 
         body += 'A bientôt sur:  <a href="' + siteUrl + '">' + siteName + '</a>';
         body += 'A bientôt sur:  <a href="' + siteUrl + '">' + siteName + '</a>';
@@ -1196,7 +1196,9 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
         $.ajax({
         $.ajax({
           method : "POST",
           method : "POST",
           url    : "ajax/datastores.php",
           url    : "ajax/datastores.php",
-          data   :  {mail: mail}
+          data   :  {
+            siteEmail: siteEmail,
+            mail     : mail}
         })
         })
         .done(function( msg ) {
         .done(function( msg ) {
           console.log('Mail result', msg);
           console.log('Mail result', msg);

部分文件因为文件数量过多而无法显示