Retrouver un projet
|
$numproj = isset($_GET['numproj']) ? $_GET['numproj'] : '';
$requete = "SELECT projet_id, acronyme, thematique, type_action, cofinancement, appartenance, resp1, date_d, date_f, duree, etat, financeur, intitule_fr, demarche, coordination, zone_etude, projet_id, transfert, objectifs, budget, motscles_fr, adapt, imp, att, pec_foret, portee, partenaire, site_web FROM projets WHERE projet_id=$numproj";
$res = pg_query($requete);
$data = pg_fetch_array($res);
$coord = $data['coordination'];
$resp1 = $data['resp1'];
$financeur = $data['financeur'];
$appart = $data['appartenance'];
if ($appart != ''){
$req_app = "SELECT acronyme, detail FROM prog_appartenance WHERE id_prog = '$appart'";
$res_app = pg_query($req_app);
$data_app = pg_fetch_array($res_app);
$ap_acro = $data_app['acronyme'];
$ap_detail = $data_app['detail'];
}
else {
$ap_acro = '';
$ap_detail = '';
}
$erreur = array('{','}');
$correction = array('','');
$thematique = str_replace($erreur,$correction,$data['thematique']);
if ($thematique == '') { $them = '---';}
else {
$th = explode(",",$thematique);
foreach ($th as $choix){
$req6 = "SELECT intitule_th from thematique where id_thematique = $choix";
$res6 = pg_query($req6);
$data6 = pg_fetch_array($res6);
if ($them == ''){
$them = $data6['intitule_th'];
} else {
$them .= '
'.$data6['intitule_th'];
}
}
}
if ($coord != ''){
$requete1 = "SELECT acronyme, labo from organisme where id_organisme = $coord";
$res1 = pg_query($requete1);
$data1 = pg_fetch_array($res1);}
if ($financeur != ''){
$requete5 = "SELECT nom from financeur where id_financeur = $financeur";
$res5 = pg_query($requete5);
$data5 = pg_fetch_array($res5);}
$erreur = array("{","}",",");
$correction = array("","",", ");
$partenaire = str_replace($erreur,$correction,$data['partenaire']);
$zonetab = $data['zone_etude'];
$date = $data['date_d'];
if (($date == '') OR ($date == '1900-01-01')) { $debut = '---';}
else {
$dated = explode("-",$date);
$y=$dated[0];
$m=$dated[1];
$d=$dated[2];
$date_debut = $d.'/'.$m.'/'.$y; }
$zone = $data['zone_etude'];
include "test_etat.php";
echo '
';
// on affiche les informations de l'enregistrements en cours
echo '
';
echo ' Nom du projet : | ';
echo ''.$data['intitule_fr'].' | ';
echo ' Acronyme : | ';
echo ''.$data['acronyme'].' | ';
echo ' Objectifs : | ';
echo ''.$data['objectifs'].' | ';
echo ' Appartenance : | ';
echo ''.$ap_acro.' '.$ap_detail.' | ';
echo ' Coordination : | ';
echo ''.$data1['acronyme'].' - '.$data1['labo'].' | ';
echo ' Responsable : | ';
echo ''.$data['resp1'].' | ';
echo ' Financeur principal : | ';
echo ''.$data5['nom'].' | ';
echo ' Budget total : | ';
echo ''.$data['budget'].' € | ';
echo ' Thématique(s) : | ';
echo ''.$them.' | ';
echo ' Démarche sc. : | ';
echo ''.$data['demarche'].' | ';
echo ' Transfert : | ';
echo ''.$data['transfert'].' | ';
echo ' Prise en compte de la forêt : | ';
echo ''.$data['pec_foret'].' | ';
echo ' |
Impact
Adaptation
Atténuation
|
État : '.$etat.'
Date de lancement : '.$date_debut.'
Durée : '.$data['duree'].' mois
|
';
echo '
';
echo '
Mots clés : '.$data['motscles_fr'].'
Site Web :
'.$data['site_web'].'';
?>