Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WS23 EWA Praktikum Pizzaservice
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Omar Ibrahim Arfa
WS23 EWA Praktikum Pizzaservice
Commits
a3f71259
Commit
a3f71259
authored
1 year ago
by
Omar Ibrahim Arfa
Browse files
Options
Downloads
Patches
Plain Diff
fix versioning issue
parent
151ccfd0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Praktikum/Prak4/JS/BestellScript.js
+4
-4
4 additions, 4 deletions
src/Praktikum/Prak4/JS/BestellScript.js
src/Praktikum/Prak4/JS/Kunde.js
+62
-5
62 additions, 5 deletions
src/Praktikum/Prak4/JS/Kunde.js
with
66 additions
and
9 deletions
src/Praktikum/Prak4/JS/BestellScript.js
+
4
−
4
View file @
a3f71259
...
@@ -59,9 +59,9 @@ function selectOrder() {
...
@@ -59,9 +59,9 @@ function selectOrder() {
function
checkInputs
()
{
function
checkInputs
()
{
"
use strict
"
;
"
use strict
"
;
const
selectInput
=
document
.
getElementById
(
'
warenkorb
'
);
const
selectInput
=
document
.
getElementById
(
"
warenkorb
"
);
const
address
=
document
.
getElementById
(
'
address
'
);
const
address
=
document
.
getElementById
(
"
address
"
);
const
button
=
document
.
getElementById
(
'
submitButton
'
);
const
button
=
document
.
getElementById
(
"
submitButton
"
);
// Check conditions
// Check conditions
const
selectHasOptions
=
selectInput
.
options
.
length
>
0
;
const
selectHasOptions
=
selectInput
.
options
.
length
>
0
;
...
@@ -75,7 +75,7 @@ function checkInputs() {
...
@@ -75,7 +75,7 @@ function checkInputs() {
window
.
onload
=
function
init
()
{
window
.
onload
=
function
init
()
{
"
use strict
"
;
"
use strict
"
;
document
.
getElementById
(
'
address
'
).
addEventListener
(
'
input
'
,
checkInputs
);
document
.
getElementById
(
"
address
"
).
addEventListener
(
"
input
"
,
checkInputs
);
};
};
document
.
addEventListener
(
document
.
addEventListener
(
...
...
This diff is collapsed.
Click to expand it.
src/Praktikum/Prak4/JS/Kunde.js
+
62
−
5
View file @
a3f71259
console
.
log
(
"
Loading Kunde.js ...
"
);
function
loadData
()
{
function
loadData
()
{
"
use strict
"
;
"
use strict
"
;
var
url
=
"
./Kundenstatus.php
"
;
var
url
=
"
./Kundenstatus.php
"
;
...
@@ -16,6 +14,7 @@ function loadData() {
...
@@ -16,6 +14,7 @@ function loadData() {
if
(
request
.
responseText
!=
null
)
{
if
(
request
.
responseText
!=
null
)
{
var
responseData
=
JSON
.
parse
(
request
.
responseText
);
var
responseData
=
JSON
.
parse
(
request
.
responseText
);
console
.
log
(
responseData
);
process
(
responseData
);
process
(
responseData
);
}
else
{
}
else
{
console
.
error
(
"
Dokument ist leer
"
);
console
.
error
(
"
Dokument ist leer
"
);
...
@@ -27,7 +26,7 @@ function loadData() {
...
@@ -27,7 +26,7 @@ function loadData() {
request
.
onerror
=
function
()
{
request
.
onerror
=
function
()
{
"
use strict
"
;
"
use strict
"
;
console
.
error
(
'
Netzwerkfehler
'
)
console
.
error
(
"
Netzwerkfehler
"
);
};
};
//request.onreadystatechange = processData;
//request.onreadystatechange = processData;
...
@@ -83,10 +82,68 @@ function process(data) {
...
@@ -83,10 +82,68 @@ function process(data) {
}
}
window
.
onload
=
function
()
{
window
.
onload
=
function
()
{
"
use strict
"
;
"
use strict
"
;
loadData
();
loadData
();
}
window
.
setInterval
(
loadData
,
2000
);
function
buildOrder
(
parentNode
,
id
,
pizzaObj
)
{
"
use strict
"
;
let
orderMainNode
=
document
.
createElement
(
"
fieldset
"
);
orderMainNode
.
id
=
id
;
let
orderLegend
=
document
.
createElement
(
"
legend
"
);
orderLegend
.
id
=
id
+
"
.legend
"
;
orderLegend
.
innerText
=
"
Bestellung
"
+
id
;
orderMainNode
.
append
(
orderLegend
);
buildPizza
(
orderMainNode
,
pizzaObj
);
parentNode
.
append
(
orderMainNode
);
}
function
buildPizza
(
orderMainNode
,
pizzaObj
)
{
"
use strict
"
;
let
pizzaList
=
pizzaObj
.
pizzaList
;
for
(
let
pizza
of
pizzaList
)
{
let
pizzaName
=
pizza
.
name
;
let
orderedArticleID
=
pizza
.
orderedArticleID
;
let
pizzaStatus
=
pizza
.
status
;
let
pizzaNode
=
document
.
createElement
(
"
fieldset
"
);
let
pizzaLegend
=
document
.
createElement
(
"
legend
"
);
pizzaNode
.
id
=
"
pizzaNode.
"
+
orderedArticleID
;
pizzaLegend
.
innerText
=
"
Pizza
"
+
pizzaName
;
pizzaNode
.
append
(
pizzaLegend
);
buildInputs
(
pizzaNode
,
orderedArticleID
,
pizzaStatus
);
orderMainNode
.
append
(
pizzaNode
);
}
}
function
buildInputs
(
pizzaNode
,
orderedArticleID
,
status
)
{
"
use strict
"
;
let
statusArray
=
[
"
Bestellt
"
,
"
Im Ofen
"
,
"
Fertig
"
,
"
Unterwegs
"
,
"
Geliefert
"
];
for
(
let
value
=
0
;
value
<
5
;
value
++
)
{
let
inputLabel
=
document
.
createElement
(
"
label
"
);
pizzaNode
.
append
(
inputLabel
);
inputLabel
.
innerText
=
statusArray
[
value
];
let
inputRadio
=
document
.
createElement
(
"
input
"
);
inputLabel
.
append
(
inputRadio
);
inputRadio
.
type
=
"
radio
"
;
inputRadio
.
name
=
orderedArticleID
;
inputRadio
.
value
=
value
.
toString
();
inputRadio
.
disabled
=
true
;
if
(
value
===
status
)
{
inputRadio
.
checked
=
true
;
}
}
}
}
window
.
setInterval
(
loadData
,
2000
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment