diff --git a/Praktikum2/AufgabePrak2A.pdf b/Praktikum2/AufgabePrak2A.pdf index 37d4990..a875c5b 100644 Binary files a/Praktikum2/AufgabePrak2A.pdf and b/Praktikum2/AufgabePrak2A.pdf differ diff --git a/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc b/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc index 6a35050..e74ac05 100644 Binary files a/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc and b/Praktikum2/ppm1/app/__pycache__/application.cpython-35.pyc differ diff --git a/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc b/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc index e5665dd..64a1314 100644 Binary files a/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc and b/Praktikum2/ppm1/app/__pycache__/database.cpython-35.pyc differ diff --git a/Praktikum2/ppm1/app/application.py b/Praktikum2/ppm1/app/application.py index 15d0869..4accc55 100644 --- a/Praktikum2/ppm1/app/application.py +++ b/Praktikum2/ppm1/app/application.py @@ -1,6 +1,9 @@ import cherrypy from .database import Database_cl from .view import View_cl +import collections +orderedDict = collections.OrderedDict() +from collections import OrderedDict #---------------------------------------------------------- class Application_cl(object): @@ -29,6 +32,7 @@ class Application_cl(object): def category(self, cat=None): #------------------------------------------------------- print("Category: ", cat, "\n") + self.db.ReadAll() if(cat==None): return self.GenerateIndex() else: @@ -39,6 +43,7 @@ class Application_cl(object): def choice(self): #------------------------------------------------------- print("Choice \n") + self.db.ReadAll() return self.GenerateListChoice() @cherrypy.expose @@ -46,6 +51,8 @@ class Application_cl(object): def eval(self, cat): #------------------------------------------------------- print("Eval \n") + self.db.ReadAll() + self.db.CheckDates() return self.GenerateListEval(cat) @cherrypy.expose @@ -79,6 +86,14 @@ class Application_cl(object): return self.GenerateSave(dataTmp, cat) @cherrypy.expose + #------------------------------------------------------- + def saveChoice(self, **data): + #------------------------------------------------------- + print("Save: Choice") + dataTmp = data + return self.GenerateSaveChoice(dataTmp) + @cherrypy.expose + #------------------------------------------------------- def delete(self, cat=None, id=None): #------------------------------------------------------- @@ -161,7 +176,7 @@ class Application_cl(object): data['id'] = id data = self.db.data['Angebote'][id] data['Studenten'] = self.db.data['Studenten'] - data['Lehrende'] = self.db.data['Lehrende'] + data['Lehrender'] = self.db.data['Lehrender'] print(data, "\n") return self.view.CreateDetailChoice(data) @@ -170,54 +185,68 @@ class Application_cl(object): #------------------------------------------------------- data = {} Studenten = self.db.data['Studenten'] - Lehrende = self.db.data['Lehrende'] + Lehrender = self.db.data['Lehrender'] Firmen = self.db.data['Firmen'] Angebote = self.db.data['Angebote'] data['category'] = cat if(cat == 'Firmen'): - for keyFirma, valueFirma in Firmen.items(): + for keyFirma, valueFirma in sorted(Firmen.items()): data[valueFirma['Name']] = {} data[valueFirma['Name']]['Name'] = valueFirma['Name'] + data[valueFirma['Name']]['Angebote'] = {} + data[valueFirma['Name']]['Angebote']['Angebot'] = {} + data[valueFirma['Name']]['Angebote']['aktuell'] = {} + data[valueFirma['Name']]['Angebote']['abgeschlossen'] = {} for keyAngebote, valueAngebote in Angebote.items(): - data[valueFirma['Name']]['Angebote'] = {} - data[valueFirma['Name']]['Angebote']['Angebot'] = {} - data[valueFirma['Name']]['Angebote']['aktuell'] = {} - data[valueFirma['Name']]['Angebote']['abgeschlossen'] = {} - if(valueAngebote['Firma'] == valueFirma['Name']): data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']] = {} data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['Name'] = valueAngebote['Name'] - data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['Student'] = Studenten[valueAngebote['Student']]['Name'] - data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['Lehrende'] = Lehrende[valueAngebote['Lehrende']]['Name'] + if(valueAngebote['Student'] != ''): + data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['Student'] = Studenten[valueAngebote['Student']]['Name'] + else: + data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['Student'] = '' + if(valueAngebote['Lehrender'] != ''): + data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['Lehrender'] = Lehrender[valueAngebote['Lehrender']]['Name'] + else: + data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['Lehrender'] = '' data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['ZeitraumVon'] = valueAngebote['ZeitraumVon'] data[valueFirma['Name']]['Angebote'][valueAngebote['Status']][valueAngebote['Name']]['ZeitraumBis'] = valueAngebote['ZeitraumBis'] + print(data) + return self.view.CreateListEval(data) elif(cat == 'Studenten'): for keyStudent, valueStudent in Studenten.items(): data[valueStudent['Name']] = {} - data[valueStudent['Name']]['Name'] = valueStudent['Name'] + data[valueStudent['Name']]['Angebote'] = {} + data[valueStudent['Name']]['Angebote']['Angebot'] = {} + data[valueStudent['Name']]['Angebote']['aktuell'] = {} + data[valueStudent['Name']]['Angebote']['abgeschlossen'] = {} for keyAngebot, valueAngebot in Angebote.items(): if(valueAngebot['Student'] == valueStudent['id']): - data[valueStudent['Name']]['Lehrende'] = Lehrende[valueAngebot['Lehrende']]['Name'] - data[valueStudent['Name']]['Status'] = valueAngebot['Status'] - data[valueStudent['Name']]['Praxisphase'] = valueAngebot['Name'] - data[valueStudent['Name']]['Firma'] = valueAngebot['Firma'] - data[valueStudent['Name']]['ZeitraumVon'] = valueAngebot['ZeitraumVon'] - data[valueStudent['Name']]['ZeitraumBis'] = valueAngebot['ZeitraumBis'] - elif(cat == 'Lehrende'): - for keyLehrende, valueLehrende in Lehrende.items(): + data[valueStudent['Name']]['Angebote'][valueAngebot['Status']][keyAngebot] = {} + data[valueStudent['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Lehrender'] = Lehrender[valueAngebot['Lehrender']]['Name'] + data[valueStudent['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Status'] = valueAngebot['Status'] + data[valueStudent['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Praxisphase'] = valueAngebot['Name'] + data[valueStudent['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Firma'] = valueAngebot['Firma'] + data[valueStudent['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['ZeitraumVon'] = valueAngebot['ZeitraumVon'] + data[valueStudent['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['ZeitraumBis'] = valueAngebot['ZeitraumBis'] + elif(cat == 'Lehrender'): + for keyLehrende, valueLehrende in Lehrender.items(): data[valueLehrende['Name']] = {} - data[valueLehrende['Name']]['Name'] = valueLehrende['Name'] + data[valueLehrende['Name']]['Angebote'] = {} + data[valueLehrende['Name']]['Angebote']['Angebot'] = {} + data[valueLehrende['Name']]['Angebote']['aktuell'] = {} + data[valueLehrende['Name']]['Angebote']['abgeschlossen'] = {} for keyAngebot, valueAngebot in Angebote.items(): - if(valueAngebot['Lehrende'] == valueLehrende['id']): - data[valueLehrende['Name']]['Student'] = Studenten[valueAngebot['Student']]['Name'] - data[valueLehrende['Name']]['Status'] = valueAngebot['Status'] - data[valueLehrende['Name']]['Praxisphase'] = valueAngebot['Name'] - data[valueLehrende['Name']]['Firma'] = valueAngebot['Firma'] - data[valueLehrende['Name']]['ZeitraumVon'] = valueAngebot['ZeitraumVon'] - data[valueLehrende['Name']]['ZeitraumBis'] = valueAngebot['ZeitraumBis'] + if(valueAngebot['Lehrender'] == valueLehrende['id']): + data[valueLehrende['Name']]['Angebote'][valueAngebot['Status']][keyAngebot] = {} + data[valueLehrende['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Student'] = Studenten[valueAngebot['Student']]['Name'] + data[valueLehrende['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Status'] = valueAngebot['Status'] + data[valueLehrende['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Praxisphase'] = valueAngebot['Name'] + data[valueLehrende['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['Firma'] = valueAngebot['Firma'] + data[valueLehrende['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['ZeitraumVon'] = valueAngebot['ZeitraumVon'] + data[valueLehrende['Name']]['Angebote'][valueAngebot['Status']][keyAngebot]['ZeitraumBis'] = valueAngebot['ZeitraumBis'] - print(data) return self.view.CreateListEval(data) @@ -230,6 +259,17 @@ class Application_cl(object): self.db.Save(dataTmp, category) return self.GenerateList(category) + #------------------------------------------------------- + def GenerateSaveChoice(self, dataTmp): + #------------------------------------------------------- + if(dataTmp['Student'] != ''): + angebote = self.db.CheckOfferings(dataTmp['Student']) + print(angebote) + if(angebote == 0): + print("Save") + self.db.Save(dataTmp, 'Angebote') + return self.GenerateListChoice() + #------------------------------------------------------- def GenerateDelete(self, category, id): #------------------------------------------------------- diff --git a/Praktikum2/ppm1/app/database.py b/Praktikum2/ppm1/app/database.py index 462e665..41e1ca2 100644 --- a/Praktikum2/ppm1/app/database.py +++ b/Praktikum2/ppm1/app/database.py @@ -4,6 +4,7 @@ import os import os.path import codecs import json +from datetime import datetime, timedelta #---------------------------------------------------------- class Database_cl(object): @@ -21,7 +22,7 @@ class Database_cl(object): #------------------------------------------------------- self.data = {} self.data['Studenten'] = {} - self.data['Lehrende'] = {} + self.data['Lehrender'] = {} self.data['Firmen'] = {} self.data['Angebote'] = {} self.ReadAll() @@ -45,7 +46,7 @@ class Database_cl(object): def ReadAll(self): #------------------------------------------------------- self.Read('Studenten') - self.Read('Lehrende') + self.Read('Lehrender') self.Read('Firmen') self.Read('Angebote') @@ -94,18 +95,27 @@ class Database_cl(object): if(category == 'Studenten'): for angebote in self.data['Angebote']: if(self.data['Angebote'][angebote]['Student'] == id): - os.remove(os.path.join('data', 'Angebote', angebote+'.json')) - elif(category == 'Lehrende'): + try: + os.remove(os.path.join('data', 'Angebote', angebote+'.json')) + except OSError: + pass + elif(category == 'Lehrender'): for angebote in self.data['Angebote']: - if(self.data['Angebote'][angebote]['Lehrende'] == id): - os.remove(os.path.join('data', 'Angebote', angebote+'.json')) + if(self.data['Angebote'][angebote]['Lehrender'] == id): + try: + os.remove(os.path.join('data', 'Angebote', angebote+'.json')) + except OSError: + pass elif(category == 'Firmen'): for firmen in self.data['Firmen']: if(firmen == id): fn = self.data['Firmen'][firmen]['Name'] for angebote in self.data['Angebote']: if(self.data['Angebote'][angebote]['Firma'] == fn): - os.remove(os.path.join('data', 'Angebote', angebote+'.json')) + try: + os.remove(os.path.join('data', 'Angebote', angebote+'.json')) + except OSError: + pass if id in self.data[category]: os.remove(os.path.join('data', category, id+'.json')) @@ -113,12 +123,45 @@ class Database_cl(object): return status_b + #------------------------------------------------------- + def CheckOfferings(self, id): + #------------------------------------------------------- + print("Offerings: ", id) + for offerings in self.data['Angebote']: + if(self.data['Angebote'][offerings]['Student'] != id): + return 0 + else: + return 1 + + #------------------------------------------------------- + def CheckDates(self): + #------------------------------------------------------- + now = datetime.now() + for offerings in self.data['Angebote']: + if(self.data['Angebote'][offerings]['ZeitraumBis'] != ''): + zeitraumBis = datetime.strptime(self.data['Angebote'][offerings]['ZeitraumBis'], "%d.%m.%Y") + if(zeitraumBis <= now): + self.data['Angebote'][offerings]['Status'] = 'abgeschlossen' + data = {} + data['Status'] = 'abgeschlossen' + data['id'] = offerings + data['Name'] = self.data['Angebote'][offerings]['Name'] + data['Firma'] = self.data['Angebote'][offerings]['Firma'] + data['Beschreibung'] = self.data['Angebote'][offerings]['Beschreibung'] + data['Voraussetzungen'] = self.data['Angebote'][offerings]['Voraussetzungen'] + data['Firmenbetreuer'] = self.data['Angebote'][offerings]['Firmenbetreuer'] + data['Lehrender'] = self.data['Angebote'][offerings]['Lehrender'] + data['ZeitraumVon'] = self.data['Angebote'][offerings]['ZeitraumVon'] + data['ZeitraumBis'] = self.data['Angebote'][offerings]['ZeitraumBis'] + data['Student'] = self.data['Angebote'][offerings]['Student'] + self.Save(data, 'Angebote') + #------------------------------------------------------- def GetDefault(self, category): #------------------------------------------------------- if(category == 'Studenten'): return {'Name':'', 'Vorname':'', 'Matrikelnummer':''} - elif(category == 'Lehrende'): + elif(category == 'Lehrender'): return {'Titel':'', 'Name':'', 'Vorname':'', 'Lehrgebiet':''} elif(category == 'Firmen'): return {'Name':'', 'Branche':'', 'Schwerpunkt':'', 'Sitz':'', 'Anzahl Mitarbeiter':''} diff --git a/Praktikum2/ppm1/data/Angebote/10.json b/Praktikum2/ppm1/data/Angebote/10.json deleted file mode 100644 index e6fb3db..0000000 --- a/Praktikum2/ppm1/data/Angebote/10.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ZeitraumVon": "01.01.2000", - "Beschreibung": "Beschreibung", - "Voraussetzungen": "Voraussetzungen", - "id": "10", - "Firmenbetreuer": "Firmenbetreuer", - "ZeitraumBis": "02.02.2000", - "Student": "2", - "Name": "Name", - "Status": "aktuell", - "Lehrende": "2", - "Firma": "Name" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Angebote/23.json b/Praktikum2/ppm1/data/Angebote/23.json new file mode 100644 index 0000000..b28de59 --- /dev/null +++ b/Praktikum2/ppm1/data/Angebote/23.json @@ -0,0 +1,13 @@ +{ + "Name": "Angebot IBM 1", + "ZeitraumBis": "01.01.2018", + "id": "23", + "Firmenbetreuer": "Sepp Meine", + "Firma": "IBM", + "Voraussetzungen": "Keine", + "Lehrender": "7", + "Status": "aktuell", + "Beschreibung": "Praxisphasenplatz bei IBM", + "ZeitraumVon": "01.01.2017", + "Student": "9" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Angebote/last.json b/Praktikum2/ppm1/data/Angebote/last.json index 9a03714..410b14d 100644 --- a/Praktikum2/ppm1/data/Angebote/last.json +++ b/Praktikum2/ppm1/data/Angebote/last.json @@ -1 +1 @@ -10 \ No newline at end of file +25 \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Firmen/2.json b/Praktikum2/ppm1/data/Firmen/2.json deleted file mode 100644 index 760bbe7..0000000 --- a/Praktikum2/ppm1/data/Firmen/2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Sitz": "Sitz", - "Name": "Name", - "id": "2", - "Anzahl Mitarbeiter": "10", - "Schwerpunkt": "Schwerpunkt", - "Branche": "Branche" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Firmen/4.json b/Praktikum2/ppm1/data/Firmen/4.json new file mode 100644 index 0000000..98b84ab --- /dev/null +++ b/Praktikum2/ppm1/data/Firmen/4.json @@ -0,0 +1,8 @@ +{ + "id": "4", + "Branche": "IT", + "Sitz": "Cupertino", + "Schwerpunkt": "Informatik", + "Anzahl Mitarbeiter": "110000", + "Name": "Apple" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Firmen/5.json b/Praktikum2/ppm1/data/Firmen/5.json new file mode 100644 index 0000000..28aecae --- /dev/null +++ b/Praktikum2/ppm1/data/Firmen/5.json @@ -0,0 +1,8 @@ +{ + "id": "5", + "Branche": "IT", + "Sitz": "Redmond", + "Schwerpunkt": "Informatik", + "Anzahl Mitarbeiter": "114000", + "Name": "Microsoft" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Firmen/6.json b/Praktikum2/ppm1/data/Firmen/6.json new file mode 100644 index 0000000..cd2cba7 --- /dev/null +++ b/Praktikum2/ppm1/data/Firmen/6.json @@ -0,0 +1,8 @@ +{ + "id": "6", + "Branche": "IT", + "Sitz": "Armonk", + "Schwerpunkt": "Elektrotechnik", + "Anzahl Mitarbeiter": "377000", + "Name": "IBM" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Firmen/last.json b/Praktikum2/ppm1/data/Firmen/last.json index d8263ee..62f9457 100644 --- a/Praktikum2/ppm1/data/Firmen/last.json +++ b/Praktikum2/ppm1/data/Firmen/last.json @@ -1 +1 @@ -2 \ No newline at end of file +6 \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Lehrende/2.json b/Praktikum2/ppm1/data/Lehrende/2.json deleted file mode 100644 index 6e8840d..0000000 --- a/Praktikum2/ppm1/data/Lehrende/2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "2", - "Name": "Name", - "Lehrgebiet": "Lehrgebiet", - "Titel": "Titel", - "Vorname": "Vorname" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Lehrende/last.json b/Praktikum2/ppm1/data/Lehrende/last.json deleted file mode 100644 index d8263ee..0000000 --- a/Praktikum2/ppm1/data/Lehrende/last.json +++ /dev/null @@ -1 +0,0 @@ -2 \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Lehrender/5.json b/Praktikum2/ppm1/data/Lehrender/5.json new file mode 100644 index 0000000..cee342e --- /dev/null +++ b/Praktikum2/ppm1/data/Lehrender/5.json @@ -0,0 +1,7 @@ +{ + "Titel": "Prof", + "id": "5", + "Lehrgebiet": "Informatik", + "Name": "Heiner", + "Vorname": "Theodor" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Lehrender/6.json b/Praktikum2/ppm1/data/Lehrender/6.json new file mode 100644 index 0000000..bb4eb50 --- /dev/null +++ b/Praktikum2/ppm1/data/Lehrender/6.json @@ -0,0 +1,7 @@ +{ + "Titel": "Prof Dr", + "id": "6", + "Lehrgebiet": "Elektrotechnik", + "Name": "Anton", + "Vorname": "Emanuel" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Lehrender/7.json b/Praktikum2/ppm1/data/Lehrender/7.json new file mode 100644 index 0000000..2f4b91f --- /dev/null +++ b/Praktikum2/ppm1/data/Lehrender/7.json @@ -0,0 +1,7 @@ +{ + "Titel": "Prof", + "id": "7", + "Lehrgebiet": "Informatik", + "Name": "Adalbert", + "Vorname": "Bastian" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Lehrender/8.json b/Praktikum2/ppm1/data/Lehrender/8.json new file mode 100644 index 0000000..62b79b3 --- /dev/null +++ b/Praktikum2/ppm1/data/Lehrender/8.json @@ -0,0 +1,7 @@ +{ + "Titel": "Dr", + "id": "8", + "Lehrgebiet": "Elektrotechnik", + "Name": "Leberecht", + "Vorname": "Egon" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Lehrender/last.json b/Praktikum2/ppm1/data/Lehrender/last.json new file mode 100644 index 0000000..301160a --- /dev/null +++ b/Praktikum2/ppm1/data/Lehrender/last.json @@ -0,0 +1 @@ +8 \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/10.json b/Praktikum2/ppm1/data/Studenten/10.json new file mode 100644 index 0000000..31ac8db --- /dev/null +++ b/Praktikum2/ppm1/data/Studenten/10.json @@ -0,0 +1,6 @@ +{ + "Vorname": "Timo", + "Name": "Ben", + "Matrikelnummer": "3", + "id": "10" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/11.json b/Praktikum2/ppm1/data/Studenten/11.json new file mode 100644 index 0000000..2ccc813 --- /dev/null +++ b/Praktikum2/ppm1/data/Studenten/11.json @@ -0,0 +1,6 @@ +{ + "Vorname": "Korbinian", + "Name": "Moritz", + "Matrikelnummer": "6", + "id": "11" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/12.json b/Praktikum2/ppm1/data/Studenten/12.json new file mode 100644 index 0000000..406f91d --- /dev/null +++ b/Praktikum2/ppm1/data/Studenten/12.json @@ -0,0 +1,6 @@ +{ + "Vorname": "Alfons", + "Name": "Meine", + "Matrikelnummer": "4", + "id": "12" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/13.json b/Praktikum2/ppm1/data/Studenten/13.json new file mode 100644 index 0000000..e463503 --- /dev/null +++ b/Praktikum2/ppm1/data/Studenten/13.json @@ -0,0 +1,6 @@ +{ + "id": "13", + "Name": "Edmund", + "Vorname": "Adalbert", + "Matrikelnummer": "1" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/14.json b/Praktikum2/ppm1/data/Studenten/14.json new file mode 100644 index 0000000..000a4b7 --- /dev/null +++ b/Praktikum2/ppm1/data/Studenten/14.json @@ -0,0 +1,6 @@ +{ + "id": "14", + "Name": "test", + "Vorname": "test", + "Matrikelnummer": "2" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/2.json b/Praktikum2/ppm1/data/Studenten/2.json deleted file mode 100644 index 0eb9459..0000000 --- a/Praktikum2/ppm1/data/Studenten/2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "Name": "Name", - "id": "2", - "Matrikelnummer": "1234", - "Vorname": "Vorname" -} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/9.json b/Praktikum2/ppm1/data/Studenten/9.json new file mode 100644 index 0000000..a4bd70d --- /dev/null +++ b/Praktikum2/ppm1/data/Studenten/9.json @@ -0,0 +1,6 @@ +{ + "Vorname": "Gregor", + "Name": "Klemens", + "Matrikelnummer": "2", + "id": "9" +} \ No newline at end of file diff --git a/Praktikum2/ppm1/data/Studenten/last.json b/Praktikum2/ppm1/data/Studenten/last.json index d8263ee..da2d398 100644 --- a/Praktikum2/ppm1/data/Studenten/last.json +++ b/Praktikum2/ppm1/data/Studenten/last.json @@ -1 +1 @@ -2 \ No newline at end of file +14 \ No newline at end of file diff --git a/Praktikum2/ppm1/templates/detail.tpl b/Praktikum2/ppm1/templates/detail.tpl index d776ce4..1fa65ec 100644 --- a/Praktikum2/ppm1/templates/detail.tpl +++ b/Praktikum2/ppm1/templates/detail.tpl @@ -40,6 +40,7 @@ + % for field in data['content']: % if field!='id' and field!='Status' and field!='ZeitraumVon' and field!='ZeitraumBis' and field!='Lehrender' and field!='Student':
diff --git a/Praktikum2/ppm1/templates/detailChoice.tpl b/Praktikum2/ppm1/templates/detailChoice.tpl index 7ccac4c..1451eae 100644 --- a/Praktikum2/ppm1/templates/detailChoice.tpl +++ b/Praktikum2/ppm1/templates/detailChoice.tpl @@ -14,7 +14,7 @@ Praxisphasenmanager (PPM) -
+

Praxisphasenangebots Auswahl

@@ -31,29 +31,27 @@
- + % for option in data['Lehrender']: + % endfor
- +
- +
diff --git a/Praktikum2/ppm1/templates/index.tpl b/Praktikum2/ppm1/templates/index.tpl index 54ef5c1..e7094e5 100644 --- a/Praktikum2/ppm1/templates/index.tpl +++ b/Praktikum2/ppm1/templates/index.tpl @@ -17,14 +17,14 @@

Module

Datenpflege: Studenten - Datenpflege: Lehrende + Datenpflege: Lehrender Datenpflege: Firmenverzeichnis Datenpflege: Praxisphasen Auswahl: Praxisphasen Auswertung: Studenten - Auswertung: Lehrenden + Auswertung: Lehrenden Auswertung: Firmen
diff --git a/Praktikum2/ppm1/templates/list.tpl b/Praktikum2/ppm1/templates/list.tpl index 3765e90..0b51888 100644 --- a/Praktikum2/ppm1/templates/list.tpl +++ b/Praktikum2/ppm1/templates/list.tpl @@ -24,7 +24,7 @@ % if data['content']!= None: % for heading in data['headings']: - % if heading!='id' and heading!='Status' and heading!='ZeitraumVon' and heading!='ZeitraumBis' and heading!='Student' and heading!='Lehrende': + % if heading!='id' and heading!='Status' and heading!='ZeitraumVon' and heading!='ZeitraumBis' and heading!='Student' and heading!='Lehrender': ${heading} % endif % endfor @@ -36,9 +36,17 @@ % for entries in data['content']: - % if data['category'] == 'Angebote' and data['content'][entries]['Status'] == 'Angebot': + % if data['category'] == 'Angebote': + % if data['content'][entries]['Status'] == 'Angebot': + % for entry in data['content'][entries]: + % if entry!='id' and entry!='Status' and entry!='ZeitraumVon' and entry!='ZeitraumBis' and entry!='Student' and entry!='Lehrender': + ${data['content'][entries][entry]} + % endif + % endfor + % endif + % else: % for entry in data['content'][entries]: - % if entry!='id' and entry!='Status' and entry!='ZeitraumVon' and entry!='ZeitraumBis' and entry!='Student' and entry!='Lehrende': + % if entry!='id': ${data['content'][entries][entry]} % endif % endfor diff --git a/Praktikum2/ppm1/templates/listEval.tpl b/Praktikum2/ppm1/templates/listEval.tpl index b414074..0bab960 100644 --- a/Praktikum2/ppm1/templates/listEval.tpl +++ b/Praktikum2/ppm1/templates/listEval.tpl @@ -32,11 +32,22 @@ Zeitraum: Bis % for aktuell in data[firmen]['Angebote']['aktuell']: - Aktuell - ${data[firmen]['Angebote']['aktuell'][aktuell]['Student']} - ${data[firmen]['Angebote']['aktuell'][aktuell]['Lehrende']} - ${data[firmen]['Angebote']['aktuell'][aktuell]['ZeitraumVon']} - ${data[firmen]['Angebote']['aktuell'][aktuell]['ZeitraumBis']} + + Aktuell + ${data[firmen]['Angebote']['aktuell'][aktuell]['Student']} + ${data[firmen]['Angebote']['aktuell'][aktuell]['Lehrender']} + ${data[firmen]['Angebote']['aktuell'][aktuell]['ZeitraumVon']} + ${data[firmen]['Angebote']['aktuell'][aktuell]['ZeitraumBis']} + + % endfor + % for abgeschlossen in data[firmen]['Angebote']['abgeschlossen']: + + Abgeschlossen + ${data[firmen]['Angebote']['abgeschlossen'][abgeschlossen]['Student']} + ${data[firmen]['Angebote']['abgeschlossen'][abgeschlossen]['Lehrender']} + ${data[firmen]['Angebote']['abgeschlossen'][abgeschlossen]['ZeitraumVon']} + ${data[firmen]['Angebote']['abgeschlossen'][abgeschlossen]['ZeitraumBis']} + % endfor % endif @@ -56,22 +67,37 @@ Zeitraum: Von Zeitraum: Bis + % for angebote in data[studenten]['Angebote']['aktuell']: - ${data[studenten]['Lehrende']} - ${data[studenten]['Firma']} - ${data[studenten]['Praxisphase']} - ${data[studenten]['Status']} - ${data[studenten]['ZeitraumVon']} - ${data[studenten]['ZeitraumBis']} + ${data[studenten]['Angebote']['aktuell'][angebote]['Lehrender']} + ${data[studenten]['Angebote']['aktuell'][angebote]['Firma']} + ${data[studenten]['Angebote']['aktuell'][angebote]['Praxisphase']} + ${data[studenten]['Angebote']['aktuell'][angebote]['Status']} + ${data[studenten]['Angebote']['aktuell'][angebote]['ZeitraumVon']} + ${data[studenten]['Angebote']['aktuell'][angebote]['ZeitraumBis']} + + % endfor + % for angebote in data[studenten]['Angebote']['abgeschlossen']: + + ${data[studenten]['Angebote']['abgeschlossen'][angebote]['Lehrender']} + ${data[studenten]['Angebote']['abgeschlossen'][angebote]['Firma']} + ${data[studenten]['Angebote']['abgeschlossen'][angebote]['Praxisphase']} + ${data[studenten]['Angebote']['abgeschlossen'][angebote]['Status']} + ${data[studenten]['Angebote']['abgeschlossen'][angebote]['ZeitraumVon']} + ${data[studenten]['Angebote']['abgeschlossen'][angebote]['ZeitraumBis']} + + % endfor + + % endif % endfor % endif - % if data['category'] == 'Lehrende': - % for lehrende in data: - % if lehrende != 'category': -

${lehrende}

+ % if data['category'] == 'Lehrender': + % for Lehrender in data: + % if Lehrender != 'category': +

${Lehrender}

@@ -81,15 +107,27 @@ - % if data[lehrende] != NULL: - - - - - - - - + % if data[Lehrender] != NULL: + % for angebote in data[Lehrender]['Angebote']['aktuell']: + + + + + + + + + % endfor + % for angebote in data[Lehrender]['Angebote']['abgeschlossen']: + + + + + + + + + % endfor % endif
StudentZeitraum: Von Zeitraum: Bis
${data[lehrende]['Student']}${data[lehrende]['Firma']}${data[lehrende]['Praxisphase']}${data[lehrende]['Status']}${data[lehrende]['ZeitraumVon']}${data[lehrende]['ZeitraumBis']}
${data[Lehrender]['Angebote']['aktuell'][angebote]['Student']}${data[Lehrender]['Angebote']['aktuell'][angebote]['Firma']}${data[Lehrender]['Angebote']['aktuell'][angebote]['Praxisphase']}${data[Lehrender]['Angebote']['aktuell'][angebote]['Status']}${data[Lehrender]['Angebote']['aktuell'][angebote]['ZeitraumVon']}${data[Lehrender]['Angebote']['aktuell'][angebote]['ZeitraumBis']}
${data[Lehrender]['Angebote']['abgeschlossen'][angebote]['Student']}${data[Lehrender]['Angebote']['abgeschlossen'][angebote]['Firma']}${data[Lehrender]['Angebote']['abgeschlossen'][angebote]['Praxisphase']}${data[Lehrender]['Angebote']['abgeschlossen'][angebote]['Status']}${data[Lehrender]['Angebote']['abgeschlossen'][angebote]['ZeitraumVon']}${data[Lehrender]['Angebote']['abgeschlossen'][angebote]['ZeitraumBis']}
% endif