|
|
@@ -41,8 +41,11 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
|
|
|
$scope.title = "Manche Numerique";
|
|
|
$scope.$sce = $sce;
|
|
|
|
|
|
+//DATE_DEB_ETUDES_PREV
|
|
|
+
|
|
|
var getGeoCodeInProgress = false,
|
|
|
nbJoursFTTH = 244,
|
|
|
+ nbJoursInscription = 60,
|
|
|
siteName = 'Eligibilité Manche Numérique',
|
|
|
siteUrl = 'http://eligibilite.manchenumerique.fr',
|
|
|
siteEmail = 'ftth@manchenumerique.fr',
|
|
|
@@ -587,11 +590,10 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
|
|
|
|
|
|
//[{"ID_ZAPM_PARTIELLE":"119CP0","DATE_OUV_SERVICE_REEL":null,"DATE_OUV_SERVICE_PREV":null,"DATE_FIN_TRAV_PREV":null}]
|
|
|
// Debug without Oracle access
|
|
|
- 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"}],"adsl":[{"ID_FT_ADSL":"656","LEGENDE":"TV sur ADSL","NATURE":"0 - 37"}],"mimo":null}');
|
|
|
+ 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}');
|
|
|
})
|
|
|
.done(function( msg ) {
|
|
|
onResults(msg);
|
|
|
-
|
|
|
});
|
|
|
|
|
|
var onResults = function(results) {
|
|
|
@@ -608,9 +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);
|
|
|
@@ -1078,6 +1084,15 @@ app.controller('mainController', function($scope, $detection, $http, $mdSidenav,
|
|
|
return isValid;
|
|
|
};
|
|
|
|
|
|
+ $scope.isInscriptionOpen = function() {
|
|
|
+ if(!$scope.results.ftth || !$scope.results.ftth.DATE_DEB_ETUDES_PREV) {return false;}
|
|
|
+ var dateDebEtudes = moment($scope.results.ftth.DATE_DEB_ETUDES_PREV, 'DD/MM/YY');
|
|
|
+ var now = moment();
|
|
|
+ var diffDays = now.diff(dateDebEtudes) / 1000 / 3600 / 24;
|
|
|
+
|
|
|
+ return diffDays > nbJoursInscription;
|
|
|
+ };
|
|
|
+
|
|
|
$scope.onSubmitAddress = function($item, $model, $label) {
|
|
|
|
|
|
// console.log('onSubmitAddress address', $scope.address);
|