Selaa lähdekoodia

Various improvements

boutils 10 vuotta sitten
vanhempi
commit
c51cf5c4a7
4 muutettua tiedostoa jossa 40 lisäystä ja 20 poistoa
  1. 13 12
      ajax/datastores.php
  2. 0 0
      css/main.css
  3. 10 0
      css/main.less
  4. 17 8
      js/app.js

+ 13 - 12
ajax/datastores.php

@@ -37,22 +37,23 @@ if(isset($_POST['query'])) {
 }
 
 if(isset($_POST['mail'])) {
-    // Pour envoyer un mail HTML, l'en-tête Content-type doit être défini
-     $headers  = 'MIME-Version: 1.0' . "\r\n";
-     $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
+  $email = 'ftth@manchenumerique.fr';
+  $bcc   = 'francoisbeaufils@zeno-labs.com';
 
-     $email = 'ftth@manchenumerique.fr';
+  $headers  = 'MIME-Version: 1.0' . "\r\n";
+  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
+  $headers .= 'Bcc: '.$bcc."\r\n";
 
-     if(isset($_POST['siteEmail'])) {
-      $email = $_POST['siteEmail'];
-     }
+  if(isset($_POST['siteEmail'])) {
+    $email = $_POST['siteEmail'];
+  }
 
-     // En-têtes additionnels
-     $headers .= 'From: Manche Numérique <'.$email.'>' . "\r\n";
+  // En-têtes additionnels
+  $headers .= 'From: Manche Numérique <'.$email.'>' . "\r\n";
 
-     // Envoi
-     $to = $_POST['mail']['to'];
-     $resultat = mail($to, $_POST['mail']['sujet'], $_POST['mail']['message'], $headers);
+  // Envoi
+  $to = $_POST['mail']['to'];
+  $resultat = mail($to, $_POST['mail']['sujet'], $_POST['mail']['message'], $headers);
 }
 
 if(isset($resultat)){

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
css/main.css


+ 10 - 0
css/main.less

@@ -430,6 +430,15 @@ md-radio-button {
 .formulaire md-input-container {
   padding-left: 10px;
   padding-bottom: 20px;
+  text-align: left;
+
+  > * {
+    text-align: justify;
+  }
+
+  > label {
+    text-align: left;
+  }
 }
 
 .formulaire md-select,
@@ -438,6 +447,7 @@ md-radio-button {
 
 .formulaire md-select-value > span,
 .formulaire md-input-container label {
+
   height: 16px;
   margin-bottom: 5px;
 }

+ 17 - 8
js/app.js

@@ -610,13 +610,13 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
         computeDateFTTH();
       }
       catch(e) {
-        /*
+
         console.error(e);
         alert('Probleme de connexion à la base de donnée Oracle.');
         $scope.hideResultPane();
-        */
+        /*
         onResults('{"x":-1.1060984089996,"y":49.119046582,"ftth":[{"ID_ZAPM_PARTIELLE":"203AP0","DATE_OUV_SERVICE_REEL":null,"DATE_OUV_SERVICE_PREV":null,"DATE_FIN_TRAV_PREV":"04\/05\/16","DATE_DEB_ETUDES_PREV":"01\/12\/14"}],"adsl":[{"ID_FT_ADSL":"656","LEGENDE":"TV sur ADSL","NATURE":"0 - 37"}],"mimo":null}');
-
+        */
       }
 
       //console.log('$scope.results', results, '=>', $scope.results);
@@ -1186,7 +1186,15 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
     var values = '';
     _.each($scope.result.eligibilite, function(value, key) {
       keys   += '`' + key + '`, ';
-      values += "'" + mysql_real_escape_string(value) + "', ";
+      if(value === 'undefined' || value === undefined) {
+        value = '';
+      }
+      if(typeof value === 'boolean') {
+        values += value + ', ';
+      }
+      else {
+        values += "'" + mysql_real_escape_string(value) + "', ";
+      }
     });
 
     var dateTime = (new Date ((new Date((new Date(new Date())).toISOString() )).getTime() - ((new Date()).getTimezoneOffset()*60000))).toISOString().slice(0, 19).replace('T', ' ');
@@ -1205,19 +1213,20 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
       if(!isNaN(msg)) {
         $scope.postForm = {ok: true};
 
-        var template = $templateCache.get('nameOfTemplate.html');
+        //var template = $templateCache.get('nameOfTemplate.html');
 
         var numDemande =  moment().format('YYYYMMDD') + msg;
 
         var body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
 
-        body += 'Bonjour ' + $scope.result.eligibilite.prenom + ' ' + $scope.result.eligibilite.nom + ', <br>' +
+        body += '<html><body style="font-size: 14px; font-family: calibri;">' +
+                'Bonjour ' + $scope.result.eligibilite.prenom + ' ' + $scope.result.eligibilite.nom + ', <br>' +
                 'Nous vous confirmons votre demande de pré-raccordement FTTH. <br><br>' +
                 'Cette demande porte le numéro: ' +
                 '<span style="color: #31708f;font-size:17px; font-weight:bold;">' + numDemande + '</span><br><br>' +
                 'Voici le détail de votre demande:' +
                 '<div style="color: #31708f;background-color: #d9edf7;border-color: #bce8f1;padding: 10px;margin: 1em;font-size:14px;">' +
-                '<table style="line-height: 40px;">';
+                '<table style="line-height: 40px;" bgColor="#d9edf7">';
 
         //  _.each($scope.result.eligibilite, function(value, key) {
         //   body += '<tr>';
@@ -1287,7 +1296,7 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
                 '  </tr>' +
                 '</table><br><br>';
 
-        body += 'A bientôt sur:  <a href="' + siteUrl + '">' + siteName + '</a>';
+        body += 'A bientôt sur:  <a href="' + siteUrl + '">' + siteName + '</a></body></html>';
 
         console.log('body', body);
         var mail = {

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä