Subversion Repositories Sites.obs-saisons.fr

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 aurelien 1
<script language="javascript">
2
function gotoEtape (numetape) {
3
  document.navigation.etape.value=numetape;
4
  document.navigation.submit();
5
}
6
</script>
7
 
8
<?
9
 
10
include("login.php");
11
 
12
  function afficherErreurs($tab_erreurs) {
13
    if (sizeof($tab_erreurs)>0) {
14
      echo "<div class='erreurs'>";
15
      foreach ($tab_erreurs as $err)
16
        echo $err."<br>";
17
      echo "</div><br>";
18
    }
19
  }
20
 
21
if ($_SESSION['participant']) {
22
$CHEMIN_DOCS="/home/fiastre/depot";
23
$URL_DOCS = "http://shiva/depot";
24
 
25
  function etape($nom_etape,$num_etape) {
26
    global $url_page;
27
    return"<a href='javascript:gotoEtape($num_etape);'>$nom_etape</a>";
28
  }
29
 
30
$erreurs = array();
31
 
32
include("modules/connect.php");
33
include("modules/messages.php");
34
 
35
 
36
echo "<form name='navigation' method='post' action='$url_page'><input type='hidden' name='etape'></form>";
37
 
38
 
39
{
40
 
41
    $requete_obs_annee = mysql_query("select distinct SEQUENCE.SEQUENCE_ID, STATION_NOM, ESPECE_NOM_VERNACULAIRE, SEQUENCE.STATION_ID".
42
" from SEQUENCE,STATION,MESURE, ESPECE ".
43
"where ".
44
 
45
//"where ESPECE_ID=".$_SESSION['observation']['espece_id'].
46
"  SEQUENCE.PARTICIPANT_ID=".$_SESSION['participant'].
47
" and STATION.STATION_ID=SEQUENCE.STATION_ID".
48
" and SEQUENCE.SEQUENCE_ID=MESURE.SEQUENCE_ID".
49
" and SEQUENCE.ESPECE_ID=ESPECE.ESPECE_ID".
50
//" and MESURE.MESURE_DATE >='$annee-01-01'".
51
//" and MESURE_DATE<'".($annee+1)."-01-01'".
52
//" AND MESURE_DATE!='0000-00-00' and MESURE_DATE>'".($annee-1)."-$mois-01'".
53
//" and MESURE_DATE<'$annee-$mois-01'".
54
" order by SEQUENCE.STATION_ID");
55
    //if (mysql_num_rows($requete_obs_annee)==0)
56
      //$erreurs[] = "Tu n'as fait aucune observation sur cette espèce cette année-là";
57
 
58
if (mysql_num_rows($requete_obs_annee)==0) {
59
  "Vous n'avez fait aucune observation.";
60
}
61
 
62
    if (sizeof($erreurs)>0) {
63
      echo "<div class='erreurs'>";
64
      foreach ($erreurs as $err)
65
        echo $err."<br>";
66
      echo "</div>";
67
    } else {
68
 
69
 
70
    $station_encours = "";
71
$l = 0;
72
?>
73
<form name="form_modif_obs" method="post" action="<?= $url_page ?>">
74
<table border="0">
75
<?
76
      while ($obs = mysql_fetch_row($requete_obs_annee)) {
77
      	    $entete_tab = "<table><tr style='font-weight: bold; font-size: 11px;'><td>".$obs[2]."</td><td>1er ind.</td><td>2ème ind.</td>
78
<td>3ème ind.</td><td>4ème ind.</td><td>5ème ind.</td></tr>";
79
 
80
$l=0;
81
        if ($obs[3]!=$station_encours) {
82
	  echo "</table>".$obs[1];
83
	  echo $entete_tab;
84
          $station_encours=$obs[3];
85
        }
86
        $requete_obs_seq = mysql_query("select distinct DATE_FORMAT(MESURE_DATE,'%d/%m/%Y'),".
87
			" MESURE_INDIVIDU, EVENEMENT_NOM from MESURE,EVENEMENT".
88
			" where MESURE.SEQUENCE_ID=".$obs[0].
89
			" and MESURE.EVENEMENT_ID=EVENEMENT.EVENEMENT_ID".
90
			//" and MESURE.MESURE_DATE >='$annee-01-01'".
91
			//" and MESURE_DATE<'".($annee+1)."-01-01'".
92
			" order by EVENEMENT_NOM, MESURE_INDIVIDU");
93
	unset($mesures);
94
	while ($mes = mysql_fetch_row($requete_obs_seq)) {
95
	  $mesures[$mes[2]][$mes[1]] = $mes[0];
96
	}
97
	foreach ($mesures as $evenement => $mesure) {
98
          echo "<tr>".
99
	  	"<td style='font-weight: bold; font-size: 11px;'>".$evenement."</td>";
100
	  for ($ind=1; $ind<=5; $ind++) {
101
	    if (isset($mesure[$ind]))
102
	      echo "<td>".$mesure[$ind]."</td>";
103
	    else
104
	      echo "<td>&nbsp;</td>";
105
	    $l++;
106
	    if ($l==2)
107
	      $l=0;
108
	  }
109
	  echo "</tr>";
110
	}
111
      }
112
?>
113
</table>
114
</form>
115
<?  }
116
}
117
 
118
}
119
?>