123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- 'use strict';
- angular.module('fehlerberichtApp')
- .controller('CustomersCtrl', function ($scope, $http) {
- var webservice = 'db.php?';
- $scope.info = [];
- $scope.error = -1;
- $scope.domain = {
- 'aktiv': {
- '1': 'Aktiv',
- '0': 'Inaktiv'
- },
- 'system': [
- '?',
- 'ARI',
- 'AUDEV',
- 'AUTOLINE',
- 'CARLO',
- 'HS',
- 'LOCOSOFT',
- 'NAVISION',
- 'OPTIMA',
- 'WERWISO',
- 'Autosys',
- 'Filaks',
- 'O21-Light'
- ],
- 'sys': {
- '?': '?',
- 'ARI': 'AI',
- 'AUDEV_CARIT': 'AC',
- 'AUTOLINE': 'AL',
- 'CARLO': 'C',
- 'HS': 'HS',
- 'LOCOSOFT': 'LO',
- 'NAVISION': 'NV',
- 'OPTIMA': 'O',
- 'WERWISO': 'W',
- 'Autosys': 'AS',
- 'Filaks': 'F',
- 'Optima-Light': 'OL'
- },
- 'woche': [
- 'Mo-Fr',
- 'Mo-Sa',
- 'Mo-So',
- 'Di-So'
- ],
- 'bundesland': {
- 'AT': 'Österreich',
- 'BW': 'Baden-Württemberg',
- 'BY': 'Bayern',
- 'BE': 'Berlin',
- 'BB': 'Brandenburg',
- 'HB': 'Bremen',
- 'HH': 'Hamburg',
- 'HE': 'Hessen',
- 'MV': 'Mecklenburg-Vorpommern',
- 'NI': 'Niedersachsen',
- 'NW': 'Nordrhein-Westfalen',
- 'RP': 'Rheinland-Pfalz',
- 'SL': 'Saarland',
- 'SN': 'Sachsen',
- 'ST': 'Sachsen-Anhalt',
- 'SH': 'Schleswig-Holstein',
- 'TH': 'Thüringen'
- }
- };
- $scope.kunden = [];
- $scope.current = {
- 'zeile' : {},
- 'fehler': {}
- };
- $scope.Filter = {
- 'aktiv': '1',
- 'kunde': '',
- 'system': ''
- };
- $scope.removeItem = function (index) {
- // Beispiel
- $scope.Bestellungen = $scope.Bestellungen.splice(index, 1);
- };
- $scope.refresh = function () {
- $http.get(webservice + 'a=kunden').success(function (data) {
- $scope.kunden = data;
- });
- };
- $scope.refresh();
- $scope.firstChar = function (t) {
- if (t === '') {
- return '?';
- }
- return t.substring(0, 1);
- };
- $scope.save = function () {
- $http.put(webservice + 'a=kunden', $scope.kunden).success(function (data) {
- $scope.kunden = data;
- });
- };
- });
|