|
|
@@ -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 = {
|