customers.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. 'use strict';
  2. angular.module('fehlerberichtApp')
  3. .controller('CustomersCtrl', function ($scope, $http) {
  4. var webservice = 'db.php?';
  5. $scope.info = [];
  6. $scope.error = -1;
  7. $scope.domain = {
  8. 'aktiv': {
  9. '1': 'Aktiv',
  10. '0': 'Inaktiv'
  11. },
  12. 'system': [
  13. '?',
  14. 'ARI',
  15. 'AUDEV',
  16. 'AUTOLINE',
  17. 'CARLO',
  18. 'HS',
  19. 'LOCOSOFT',
  20. 'NAVISION',
  21. 'OPTIMA',
  22. 'WERWISO',
  23. 'Autosys',
  24. 'Filaks',
  25. 'O21-Light'
  26. ],
  27. 'sys': {
  28. '?': '?',
  29. 'ARI': 'AI',
  30. 'AUDEV_CARIT': 'AC',
  31. 'AUTOLINE': 'AL',
  32. 'CARLO': 'C',
  33. 'HS': 'HS',
  34. 'LOCOSOFT': 'LO',
  35. 'NAVISION': 'NV',
  36. 'OPTIMA': 'O',
  37. 'WERWISO': 'W',
  38. 'Autosys': 'AS',
  39. 'Filaks': 'F',
  40. 'Optima-Light': 'OL'
  41. },
  42. 'woche': [
  43. 'Mo-Fr',
  44. 'Mo-Sa',
  45. 'Mo-So',
  46. 'Di-So'
  47. ],
  48. 'bundesland': {
  49. 'AT': 'Österreich',
  50. 'BW': 'Baden-Württemberg',
  51. 'BY': 'Bayern',
  52. 'BE': 'Berlin',
  53. 'BB': 'Brandenburg',
  54. 'HB': 'Bremen',
  55. 'HH': 'Hamburg',
  56. 'HE': 'Hessen',
  57. 'MV': 'Mecklenburg-Vorpommern',
  58. 'NI': 'Niedersachsen',
  59. 'NW': 'Nordrhein-Westfalen',
  60. 'RP': 'Rheinland-Pfalz',
  61. 'SL': 'Saarland',
  62. 'SN': 'Sachsen',
  63. 'ST': 'Sachsen-Anhalt',
  64. 'SH': 'Schleswig-Holstein',
  65. 'TH': 'Thüringen'
  66. }
  67. };
  68. $scope.kunden = [];
  69. $scope.current = {
  70. 'zeile' : {},
  71. 'fehler': {}
  72. };
  73. $scope.Filter = {
  74. 'aktiv': '1',
  75. 'kunde': '',
  76. 'system': ''
  77. };
  78. $scope.removeItem = function (index) {
  79. // Beispiel
  80. $scope.Bestellungen = $scope.Bestellungen.splice(index, 1);
  81. };
  82. $scope.refresh = function () {
  83. $http.get(webservice + 'a=kunden').success(function (data) {
  84. $scope.kunden = data;
  85. });
  86. };
  87. $scope.refresh();
  88. $scope.firstChar = function (t) {
  89. if (t === '') {
  90. return '?';
  91. }
  92. return t.substring(0, 1);
  93. };
  94. $scope.save = function () {
  95. $http.put(webservice + 'a=kunden', $scope.kunden).success(function (data) {
  96. $scope.kunden = data;
  97. });
  98. };
  99. });