Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
ee9d5a04
Commit
ee9d5a04
authored
8 years ago
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clarify scholars query and make 'ego' first
parent
5d420438
clinicaltrials
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
print_scholar_directory.php
print_scholar_directory.php
+6
-12
No files found.
print_scholar_directory.php
View file @
ee9d5a04
...
...
@@ -60,7 +60,7 @@ function is_utf8($string) {
}
//phpinfo();
//echo $_GET['query']."<br/>";
$
login
=
$_GET
[
'query'
];
$
userid
=
$_GET
[
'query'
];
// $base = new PDO("sqlite:" . $dbname);
...
...
@@ -70,15 +70,8 @@ $base = new PDO($dsn, $user, $pass, $opt);
// liste des chercheurs
$scholar_array
=
array
();
if
(
$login
)
{
if
(
sizeof
(
$login
)
>
0
)
{
// nom du chercheur $target_name
$sql0
=
"SELECT last_name,first_name FROM scholars WHERE luid='"
.
$login
.
"'"
;
foreach
(
$base
->
query
(
$sql0
)
as
$row
)
{
// always one record by design of uid
$target_name
=
$row
[
'first_name'
]
.
' '
.
$row
[
'last_name'
];
}
if
(
$userid
)
{
if
(
sizeof
(
$userid
)
>
0
)
{
// old way in two steps without a scholars <=> keywords table
// $sql1 = "SELECT keywords,last_name,first_name FROM scholars WHERE luid='" . $login . "'";
...
...
@@ -91,10 +84,11 @@ if ($login) {
LEFT
JOIN
sch_kw
AS
second_level
ON
sch_kw
.
kwid
=
second_level
.
kwid
WHERE
sch_kw
.
uid
=
"
{
$login
}
"
WHERE
sch_kw
.
uid
=
{
$userid
}
--
(
uncomment
if
ego
not
self
-
neighboor
)
--
AND
second_level
.
uid
!=
sch_kw
.
uid
GROUP
BY
second_level
.
uid
;
GROUP
BY
second_level
.
uid
ORDER
BY
second_level
.
uid
!=
{
$userid
}
;
--
allows
ego
to
be
first
HERE_QUERY
;
foreach
(
$base
->
query
(
$sql1
)
as
$row
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment