Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UNL_GraduateBulletin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ryan Dee
UNL_GraduateBulletin
Commits
c965e59d
Commit
c965e59d
authored
12 years ago
by
Brett Bieber
Browse files
Options
Downloads
Patches
Plain Diff
Convert course lookup tool to use the new course searcher
parent
3f79eda1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
www/course.php
+16
-14
16 additions, 14 deletions
www/course.php
with
16 additions
and
14 deletions
www/course.php
+
16
−
14
View file @
c965e59d
...
@@ -6,15 +6,17 @@ require_once 'UNL/Catalog.php';
...
@@ -6,15 +6,17 @@ require_once 'UNL/Catalog.php';
$catalog
=
new
UNL_Catalog
();
$catalog
=
new
UNL_Catalog
();
if
(
isset
(
$_GET
[
'subject_id'
])
&&
isset
(
$_GET
[
'number'
]))
{
if
(
isset
(
$_GET
[
'subject_id'
])
&&
isset
(
$_GET
[
'number'
]))
{
$listings
=
$catalog
->
factory
(
'course_listings'
);
$listings
->
subject_id
=
$_GET
[
'subject_id'
];
$search
=
$catalog
->
getCourseSearcher
();
$listings
->
number
=
$_GET
[
'number'
];
if
(
$listings
->
find
())
{
$listings
=
$search
->
byAny
(
$_GET
[
'subject_id'
]
.
' '
.
$_GET
[
'number'
]);
if
(
count
(
$listings
))
{
if
(
!
isset
(
$_GET
[
'format'
]))
{
if
(
!
isset
(
$_GET
[
'format'
]))
{
$catalog
->
p
->
maincontentarea
.
=
'<h1>Course Information</h1>'
;
$catalog
->
p
->
maincontentarea
.
=
'<h1>Course Information</h1>'
;
}
}
while
(
$listings
->
fetch
()
)
{
foreach
(
$listings
as
$course
)
{
$catalog
->
showCourse
(
$
listings
,
true
);
$catalog
->
showCourse
(
$
course
,
true
);
}
}
}
else
{
}
else
{
header
(
'HTTP/1.0 404 Not Found'
);
header
(
'HTTP/1.0 404 Not Found'
);
...
@@ -22,14 +24,14 @@ if (isset($_GET['subject_id']) && isset($_GET['number'])) {
...
@@ -22,14 +24,14 @@ if (isset($_GET['subject_id']) && isset($_GET['number'])) {
}
}
}
elseif
(
isset
(
$_GET
[
'title'
]))
{
}
elseif
(
isset
(
$_GET
[
'title'
]))
{
$catalog
->
p
->
maincontentarea
.
=
'<h1>Course Information</h1>'
;
$catalog
->
p
->
maincontentarea
.
=
'<h1>Course Information</h1>'
;
$title
=
$catalog
->
getDatabaseConnection
()
->
escape
(
$_GET
[
'title'
]);
$
courses
=
$catalog
->
factory
(
'courses'
);
$
search
=
$catalog
->
getCourseSearcher
(
);
$courses
->
whereAdd
(
"title LIKE '%
$title
%'"
);
if
(
$courses
->
find
())
{
$listings
=
$search
->
byTitle
(
$_GET
[
'title'
]);
while
(
$courses
->
fetch
())
{
$listing
=
$catalog
->
factory
(
'course_
listings
'
);
if
(
count
(
$
listings
))
{
$listing
->
get
(
'course_id'
,
$course
s
->
id
);
foreach
(
$listings
as
$course
)
{
$catalog
->
showCourse
(
$
listing
,
true
);
$catalog
->
showCourse
(
$
course
,
true
);
}
}
}
else
{
}
else
{
$catalog
->
p
->
maincontentarea
.
=
'No courses found with a title like that'
;
$catalog
->
p
->
maincontentarea
.
=
'No courses found with a title like that'
;
...
...
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