New file |
0,0 → 1,119 |
<script language="javascript"> |
function gotoEtape (numetape) { |
document.navigation.etape.value=numetape; |
document.navigation.submit(); |
} |
</script> |
|
<? |
|
include("login.php"); |
|
function afficherErreurs($tab_erreurs) { |
if (sizeof($tab_erreurs)>0) { |
echo "<div class='erreurs'>"; |
foreach ($tab_erreurs as $err) |
echo $err."<br>"; |
echo "</div><br>"; |
} |
} |
|
if ($_SESSION['participant']) { |
$CHEMIN_DOCS="/home/fiastre/depot"; |
$URL_DOCS = "http://shiva/depot"; |
|
function etape($nom_etape,$num_etape) { |
global $url_page; |
return"<a href='javascript:gotoEtape($num_etape);'>$nom_etape</a>"; |
} |
|
$erreurs = array(); |
|
include("modules/connect.php"); |
include("modules/messages.php"); |
|
|
echo "<form name='navigation' method='post' action='$url_page'><input type='hidden' name='etape'></form>"; |
|
|
{ |
|
$requete_obs_annee = mysql_query("select distinct SEQUENCE.SEQUENCE_ID, STATION_NOM, ESPECE_NOM_VERNACULAIRE, SEQUENCE.STATION_ID". |
" from SEQUENCE,STATION,MESURE, ESPECE ". |
"where ". |
|
//"where ESPECE_ID=".$_SESSION['observation']['espece_id']. |
" SEQUENCE.PARTICIPANT_ID=".$_SESSION['participant']. |
" and STATION.STATION_ID=SEQUENCE.STATION_ID". |
" and SEQUENCE.SEQUENCE_ID=MESURE.SEQUENCE_ID". |
" and SEQUENCE.ESPECE_ID=ESPECE.ESPECE_ID". |
//" and MESURE.MESURE_DATE >='$annee-01-01'". |
//" and MESURE_DATE<'".($annee+1)."-01-01'". |
//" AND MESURE_DATE!='0000-00-00' and MESURE_DATE>'".($annee-1)."-$mois-01'". |
//" and MESURE_DATE<'$annee-$mois-01'". |
" order by SEQUENCE.STATION_ID"); |
//if (mysql_num_rows($requete_obs_annee)==0) |
//$erreurs[] = "Tu n'as fait aucune observation sur cette espèce cette année-là"; |
|
if (mysql_num_rows($requete_obs_annee)==0) { |
"Vous n'avez fait aucune observation."; |
} |
|
if (sizeof($erreurs)>0) { |
echo "<div class='erreurs'>"; |
foreach ($erreurs as $err) |
echo $err."<br>"; |
echo "</div>"; |
} else { |
|
|
$station_encours = ""; |
$l = 0; |
?> |
<form name="form_modif_obs" method="post" action="<?= $url_page ?>"> |
<table border="0"> |
<? |
while ($obs = mysql_fetch_row($requete_obs_annee)) { |
$entete_tab = "<table><tr style='font-weight: bold; font-size: 11px;'><td>".$obs[2]."</td><td>1er ind.</td><td>2ème ind.</td> |
<td>3ème ind.</td><td>4ème ind.</td><td>5ème ind.</td></tr>"; |
|
$l=0; |
if ($obs[3]!=$station_encours) { |
echo "</table>".$obs[1]; |
echo $entete_tab; |
$station_encours=$obs[3]; |
} |
$requete_obs_seq = mysql_query("select distinct DATE_FORMAT(MESURE_DATE,'%d/%m/%Y'),". |
" MESURE_INDIVIDU, EVENEMENT_NOM from MESURE,EVENEMENT". |
" where MESURE.SEQUENCE_ID=".$obs[0]. |
" and MESURE.EVENEMENT_ID=EVENEMENT.EVENEMENT_ID". |
//" and MESURE.MESURE_DATE >='$annee-01-01'". |
//" and MESURE_DATE<'".($annee+1)."-01-01'". |
" order by EVENEMENT_NOM, MESURE_INDIVIDU"); |
unset($mesures); |
while ($mes = mysql_fetch_row($requete_obs_seq)) { |
$mesures[$mes[2]][$mes[1]] = $mes[0]; |
} |
foreach ($mesures as $evenement => $mesure) { |
echo "<tr>". |
"<td style='font-weight: bold; font-size: 11px;'>".$evenement."</td>"; |
for ($ind=1; $ind<=5; $ind++) { |
if (isset($mesure[$ind])) |
echo "<td>".$mesure[$ind]."</td>"; |
else |
echo "<td> </td>"; |
$l++; |
if ($l==2) |
$l=0; |
} |
echo "</tr>"; |
} |
} |
?> |
</table> |
</form> |
<? } |
} |
|
} |
?> |