// -*- mode: php -*-
require('html.php');
require("postgres.php");
//
// SQL connection
// If connection fails, redirect to site root
//
$db = pg_Connect("dbname=intranet host=olan user=verimag password=verimag");
if (!$db) {
return(false);
}
//
// Categories
//
// $status_desc = array(
// "en" => array(
// "PER" => "Researchers and Professors",
// "ING" => "Engineers & Postdocs",
// "THE" => "PhD STUDENTS",
// "DEA" => "MASTERS",
// "VIS" => "Visitors",
// "OLD" => "Former Members",
// "POSTDOC" => "ATER and Post-Doc"
// ),
// "fr" => array(
// "PER" => "Chercheurs et Enseignants-Chercheurs",
// "ECH" => "Enseignants Chercheurs",
// "ING" => "Ingenieurs & Postdocs",
// "THE" => "Doctorants",
// "DEA" => "Master recherche",
// "VIS" => "VISITEURS",
// "OLD" => "Anciens membres",
// "POSTDOC" => "ATER et Post-Doc"
// ));
$status_desc = array(
"PER" => "Researchers and Professors",
"ING" => "Engineers & Postdocs",
"THE" => "PhD STUDENTS",
"DEA" => "MASTERS",
"VIS" => "Visitors",
"OLD" => "Former Members",
"POSTDOC" => "ATER and Post-Doc"
);
// rajouter "DEA" quand ca marchera. Le pb, c'est qu'il faut que je trie
//
$status_order = array("PER", "POSTDOC", "THE","DEA","OLD" );
$query = array(
"PER" => "
SELECT p.name,p.surname,p.email,p.url,p.organisation,p.work,t.id,t.acronym
FROM adm_person p, adm_team t, adm_team_person m
WHERE p.status = 'PERMANENT' AND p.function <> 'ETUDIANT' AND t.id = m.team AND m.person = p.id
ORDER BY name,surname",
// "ING" => "
// SELECT DISTINCT p.name,p.surname,p.email,p.url,p.organisation,p.work,p.id
// FROM adm_person p
// WHERE (p.function = 'INGENIEUR' AND p.status <> 'ANCIEN')
// OR (p.function = 'CHERCHEUR' AND p.status = 'TEMPORAIRE')
// ORDER BY name,surname",
"THE" => "
SELECT DISTINCT p.name,p.surname,p.email,p.url,p.organisation,p.work,t.id,t.acronym
FROM adm_person p, adm_employment e, adm_team t, adm_team_person m
WHERE p.function = 'ETUDIANT' AND t.id = m.team AND m.person = p.id
AND e.supplier = p.id
AND e.type = 'THESE'
AND p.status <> 'ANCIEN'
ORDER BY name,surname",
"POSTDOC" => "
SELECT DISTINCT p.name,p.surname,p.email,p.url,p.organisation,p.work,t.id,t.acronym
FROM adm_person p, adm_employment e, adm_team t, adm_team_person m
WHERE t.id = m.team AND m.person = p.id AND p.status <> 'PERMANENT'
AND e.supplier = p.id
AND (e.type = 'CONTRAT' OR e.type = 'POSTDOC' OR e.type = 'ATER')
AND p.status <> 'ANCIEN'
ORDER BY name,surname",
"DEA" => "
SELECT DISTINCT p.name,p.surname,p.email,p.url,p.organisation,p.work,t.id,t.acronym
FROM adm_person p, adm_employment e, adm_team t, adm_team_person m
WHERE p.function = 'ETUDIANT'
AND e.ended > now()
AND t.id = m.team AND m.person = p.id
AND e.supplier = p.id
AND (e.type = 'MASTER' OR e.type = 'STAGE' OR e.type = 'DEA')
AND p.status <> 'ANCIEN'
ORDER BY name,surname",
"OLD" => "
SELECT p.name,p.surname,'' AS email,p.url,'' AS organisation, '' AS work,t.id,t.acronym
FROM adm_person p, adm_employment e, adm_team t, adm_team_person m
WHERE p.status = 'ANCIEN' AND t.id = m.team AND m.person = p.id
AND e.supplier = p.id
AND p.function = 'ETUDIANT'
AND e.type = 'THESE'
UNION
SELECT p.name,p.surname,p.email,p.url,'' AS organisation, '' AS work,t.id,t.acronym
FROM adm_person p, adm_team t, adm_team_person m
WHERE p.status = 'ANCIEN' AND t.id = m.team AND m.person = p.id
AND (p.function = 'CHERCHEUR' OR p.function = 'ENSEIGNANT-CHERCHEUR' OR p.function = 'INGENIEUR')
AND p.id NOT IN (SELECT supplier FROM adm_employment
WHERE type = 'VISITE')
ORDER BY name,surname"
);
$no_employer = array("OLD", "DEA");
$no_phone = array("OLD", "DEA");
$col_size = array (
"NOM" => 250,
"MAIL" => 250,
"PHO" => 150,
"SUP" => 75);
$col_name = array(
"fr" => array("NOM" => "Nom",
"MAIL" => "Email",
"PHO" => "Téléphone",
"SUP" => "Tutelle"),
"en" => array("NOM" => "Name",
"MAIL" => "Email",
"PHO" => "Phone",
"SUP" => "Employer"));
// if ($lang == "en") {
// img_link("$PHP_SELF?page=$page&lang=fr",
// "images/france_a.gif", "Version Française", 0);
// } else {
// img_link("$PHP_SELF?page=$page&lang=en",
// "images/uk_3a.gif", "English version", 0);
// }
/*
if ($lang == "fr") {
print "
";
print("
L'équipe est menée par Florence Maraninchi.
\n");
print("Des photos sont visibles dans le
Trombinoscope Synchrone.");
} else {
print "
";
print("
The Team is led by Florence Maraninchi.
\n");
print("Some Photos are available in the Synchronous
TROMBINOSCOPE.");
}
*/
//
// create users tables
//
print("
Group Members
");
$first = 1;
foreach ($status_order as $status) {
//
// Table change
//
if ($first == 0) {
// print("
\n");
// print("
");
} else {
$first = 0;
}
//
// get members
//
$q = $query[$status];
$members = pg_exec($db,$q);
/*
if ($status == "DEA") {
print(" cf also the