1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- 'use strict';
- angular.module('fehlerberichtApp')
- .controller('CustomersCtrl', function ($scope, $http) {
- var webservice = 'http://rbs06:8090/fehlerbericht/db.php?';
- $scope.info = [];
- $scope.error = -1;
- $scope.domain = {
- 'aktiv': {
- '1': 'Aktiv',
- '0': 'Inaktiv'
- },
- 'system': [
- '?',
- 'Autosys',
- 'Autosys-Light',
- 'CarIT-Audev',
- 'EDS',
- 'Filaks',
- 'GlobalCube',
- 'Navision',
- 'Optima',
- 'Optima-Light'
- ],
- '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;
- });
- };
- });
|