Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MySchoolday
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheDutchProgrammers
MySchoolday
Commits
c58b23b9
Commit
c58b23b9
authored
3 years ago
by
Miniontoby
Browse files
Options
Downloads
Patches
Plain Diff
Quick fix becuase I changed database
parent
86f38516
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
public/objects/homework.php
+20
-19
20 additions, 19 deletions
public/objects/homework.php
public/objects/roster.php
+5
-5
5 additions, 5 deletions
public/objects/roster.php
with
25 additions
and
24 deletions
public/objects/homework.php
+
20
−
19
View file @
c58b23b9
...
...
@@ -8,12 +8,12 @@ class Homework {
// object properties
public
int
$id
;
public
string
$title
;
public
$start
;
public
$end
;
public
string
$description
;
public
string
$location
;
public
string
$allDay
=
"0"
;
public
string
$type
=
"0"
;
public
$start
;
public
$end
;
public
$allDay
=
0
;
public
$type
;
// constructor
public
function
__construct
(
$db
){
...
...
@@ -31,31 +31,31 @@ class Homework {
$this
->
allDay
=
htmlspecialchars
(
strip_tags
(
$this
->
allDay
));
$this
->
type
=
htmlspecialchars
(
strip_tags
(
$this
->
type
));
$result
=
$this
->
conn
->
query
(
$query
,
$this
->
title
,
$this
->
start
,
$this
->
end
,
$this
->
description
,
$this
->
location
,
$this
->
allDay
,
$this
->
type
);
$this
->
id
=
$
result
->
lastInsertId
();
$this
->
conn
->
query
(
$query
,
$this
->
title
,
$this
->
start
,
$this
->
end
,
$this
->
description
,
$this
->
location
,
$this
->
allDay
,
$this
->
type
);
$this
->
id
=
$
this
->
conn
->
lastInsertId
();
if
(
$
result
->
affectedRows
()
!=
0
)
return
true
;
if
(
$
this
->
conn
->
affectedRows
()
!=
0
)
return
true
;
return
false
;
}
public
function
getHomework
(
$start
,
$end
)
{
public
function
getHomework
(
$start
,
$end
,
int
$school
=
1
)
{
$this
->
conn
->
query
(
"SELECT * FROM
{
$this
->
table_name
}
WHERE NOT ((end <= ?) OR (start >= ?))"
,
$start
,
$end
);
$num
=
$this
->
conn
->
numRows
();
if
(
$num
>
0
){
$output
=
array
();
$result
=
$this
->
conn
->
fetchAll
();
foreach
(
$result
as
$row
)
{
$
hw
=
new
Homework
(
$this
->
conn
);
$
hw
->
id
=
$row
[
'id'
];
$
hw
->
title
=
$row
[
'name'
];
$
hw
->
start
=
$row
[
'start'
];
$
hw
->
end
=
$row
[
'end'
];
$
hw
->
description
=
$row
[
'description'
];
$
hw
->
location
=
$row
[
'location'
];
$
rost
=
new
Roster
(
$this
->
conn
);
$
rost
->
id
=
$row
[
'id'
];
$
rost
->
title
=
$row
[
'name'
];
$
rost
->
start
=
$row
[
'start'
];
$
rost
->
end
=
$row
[
'end'
];
$
rost
->
description
=
$row
[
'description'
];
$
rost
->
location
=
$row
[
'location'
];
$allday
=
0
;
if
(
$row
[
'allday'
]
==
"1"
)
$allday
=
1
;
$
hw
->
allDay
=
$allday
;
$output
[]
=
$
hw
;
$
rost
->
allDay
=
$allday
;
$output
[]
=
$
rost
;
}
return
$output
;
}
...
...
@@ -71,8 +71,9 @@ class Homework {
$this
->
description
=
htmlspecialchars
(
strip_tags
(
$this
->
description
));
$this
->
id
=
htmlspecialchars
(
strip_tags
(
$this
->
id
));
$result
=
$this
->
conn
->
query
(
$query
,
$this
->
start
,
$this
->
end
,
$this
->
name
,
$this
->
description
,
$this
->
id
);
if
(
$
result
->
affectedRows
()
!=
0
)
return
true
;
$this
->
conn
->
query
(
$query
,
$this
->
start
,
$this
->
end
,
$this
->
name
,
$this
->
description
,
$this
->
id
);
if
(
$
this
->
conn
->
affectedRows
()
!=
0
)
return
true
;
return
false
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
public/objects/roster.php
+
5
−
5
View file @
c58b23b9
...
...
@@ -31,10 +31,10 @@ class Roster {
$this
->
allDay
=
htmlspecialchars
(
strip_tags
(
$this
->
allDay
));
$this
->
type
=
htmlspecialchars
(
strip_tags
(
$this
->
type
));
$result
=
$this
->
conn
->
query
(
$query
,
$this
->
title
,
$this
->
start
,
$this
->
end
,
$this
->
description
,
$this
->
location
,
$this
->
allDay
,
$this
->
type
);
$this
->
id
=
$
result
->
lastInsertId
();
$this
->
conn
->
query
(
$query
,
$this
->
title
,
$this
->
start
,
$this
->
end
,
$this
->
description
,
$this
->
location
,
$this
->
allDay
,
$this
->
type
);
$this
->
id
=
$
this
->
conn
->
lastInsertId
();
if
(
$
result
->
affectedRows
()
!=
0
)
return
true
;
if
(
$
this
->
conn
->
affectedRows
()
!=
0
)
return
true
;
return
false
;
}
...
...
@@ -71,8 +71,8 @@ class Roster {
$this
->
description
=
htmlspecialchars
(
strip_tags
(
$this
->
description
));
$this
->
id
=
htmlspecialchars
(
strip_tags
(
$this
->
id
));
$result
=
$this
->
conn
->
query
(
$query
,
$this
->
start
,
$this
->
end
,
$this
->
name
,
$this
->
description
,
$this
->
id
);
if
(
$
result
->
affectedRows
()
!=
0
)
return
true
;
$this
->
conn
->
query
(
$query
,
$this
->
start
,
$this
->
end
,
$this
->
name
,
$this
->
description
,
$this
->
id
);
if
(
$
this
->
conn
->
affectedRows
()
!=
0
)
return
true
;
return
false
;
}
...
...
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