/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/cartetest.php |
---|
New file |
0,0 → 1,82 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> |
<title>Google Maps JavaScript API Example</title> |
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAnm2MSMmwsDuoh7THcVDnlBSAZKnAlQZLiLpbAbKDMtId8LKOVBT1EbOX0DTIKvay9z_AquSgc2_r9A" |
type="text/javascript"></script> |
<script type="text/javascript"> |
//<![CDATA[ |
var latFr = 47; |
var lonFr = 1.7; |
var latFrMin = 34; |
var latFrMax = 58; |
var lonFrMin = -12; |
var lonFrMax = 15; |
function load() { |
if (GBrowserIsCompatible()) { |
var map = new GMap2(document.getElementById("map")); |
map.setCenter(new GLatLng(latFr, lonFr), 6); |
map.addControl(new GSmallMapControl()); |
map.addControl(new GMapTypeControl()); |
map.setMapType(GMapType.G_SATELLITE_MAP); |
//map.addControl(new GSmallZoomControl()); |
// window.setTimeout(function() { |
GEvent.addListener(map, "moveend", function() { |
var bounds = map.getBounds(); |
var southWest = bounds.getSouthWest(); |
var northEast = bounds.getNorthEast(); |
if (southWest.lng()<lonFrMin || southWest.lat()<latFrMin |
|| northEast.lng()>lonFrMax || northEast.lat()>latFrMax) |
map.returnToSavedPosition(); |
else |
map.savePosition(); |
}, 20); |
// Creates a marker at the given point with the given number label |
function createMarker(point, number) { |
var marker = new GMarker(point); |
GEvent.addListener(marker, "click", function() { |
marker.openInfoWindowHtml("Coordonnées : <b>" + number + "</b>"); |
}); |
return marker; |
} |
<? |
include("traitement.php"); |
?> |
//On définit les puces |
//var icons = new Array(); |
<? for ($i=0; $i<=$nbPuces; $i++) { ?> |
var icon<?= $i ?> = new GIcon(); |
icon<?= $i ?>.image = "puces/<?= $i ?>.gif"; |
icon<?= $i ?>.shadow = "puces/ombre.png"; |
icon<?= $i ?>.iconSize = new GSize(14,14); |
icon<?= $i ?>.shadowSize = new GSize(20,20); |
icon<?= $i ?>.iconAnchor = new GPoint (6,20); |
icon<?= $i ?>.inconWindowAnchor = new GPoint(5,1); |
<? } ?> |
//alert(icons[0].image); |
//on va poser les points des villes |
<? |
include ("../modules/connect.php"); |
$req_communes = mysql_query("SELECT DISTINCT STATION_LATITUDE, STATION_LONGITUDE, STATION_ID FROM STATION"); |
while ($commune = mysql_fetch_row($req_communes)) { |
if (is_numeric($dates[$commune[2]])) { |
?> |
var point = new GLatLng(<?= $commune[0] ?>, <?= $commune[1] ?>); |
map.addOverlay(new GMarker(point, icon<?= $dates[$commune[2]] ?>)); |
<? } } ?> |
} |
} |
//]]> |
</script> |
</head> |
<body onload="load()" onunload="GUnload()"> |
<div id="map" style="width: 600px; height: 600px"></div> |
</body> |
</html> |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/gen_carte.php |
---|
New file |
0,0 → 1,101 |
<? |
if(!@file_exists('car_config.inc.php') ) { |
@include_once 'car_config.inc.php' ; |
} else { |
@include_once 'configuration/car_config.inc.php' ; |
} |
if (PARTICIPANT_EST_ADULTE) { |
?> |
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAnm2MSMmwsDuoh7THcVDnlBQH9AL26AfEfaraxwo1G6_adyVjPRRQE4Gx2u7MomK9DJWf9kMLJ9y-ZA" |
type="text/javascript"></script> |
<? |
} |
else { |
?> |
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAFMANWib9GSm7T4W6AN9qzxRmHYqXwt_BUwczny2vFmnHz3sr3BTy_SMRJ-NzWXDUynHHSWQ7_aEZ6Q" |
type="text/javascript"></script> |
<? |
} |
include("traitement.php"); |
?> |
<script type="text/javascript"> |
//<![CDATA[ |
var latFr = 47; |
var lonFr = 1.7; |
var latFrMin = 34; |
var latFrMax = 58; |
var lonFrMin = -12; |
var lonFrMax = 15; |
function load() { |
if (GBrowserIsCompatible()) { |
var map = new GMap2(document.getElementById("map")); |
map.setCenter(new GLatLng(latFr, lonFr), 6); |
map.addControl(new GSmallMapControl()); |
map.addControl(new GMapTypeControl()); |
map.setMapType(GMapType.G_SATELLITE_MAP); |
//map.addControl(new GSmallZoomControl()); |
// window.setTimeout(function() { |
GEvent.addListener(map, "moveend", function() { |
var bounds = map.getBounds(); |
var southWest = bounds.getSouthWest(); |
var northEast = bounds.getNorthEast(); |
if (southWest.lng()<lonFrMin || southWest.lat()<latFrMin |
|| northEast.lng()>lonFrMax || northEast.lat()>latFrMax) |
map.returnToSavedPosition(); |
else |
map.savePosition(); |
}, 20); |
// Creates a marker at the given point with the given number label |
function createMarker(point, text, licone) { |
var marker = new GMarker(point,licone); |
var html = "<b>" + text + "</b>"; |
GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowHtml(html);}); |
return marker; |
} |
//On définit les puces |
<? for ($i=0; $i<=$nbPuces; $i++) { ?> |
var icon<?= $i ?> = new GIcon(); |
icon<?= $i ?>.image = "modules/cartes/puces/<?= $i ?>.gif"; |
icon<?= $i ?>.shadow = "modules/cartes/puces/ombre.png"; |
icon<?= $i ?>.iconSize = new GSize(14,14); |
icon<?= $i ?>.shadowSize = new GSize(20,20); |
icon<?= $i ?>.iconAnchor = new GPoint (6,20); |
icon<?= $i ?>.infoWindowAnchor = new GPoint(5,1); |
<? } ?> |
//On définit les puces phenoclim |
<? for ($i=0; $i<=$nbPuces; $i++) { ?> |
var icon_phenoclim<?= $i ?> = new GIcon(); |
icon_phenoclim<?= $i ?>.image = "modules/cartes/puces/phenoclim/<?= $i ?>.gif"; |
icon_phenoclim<?= $i ?>.shadow = "modules/cartes/puces/phenoclim/ombre.png"; |
icon_phenoclim<?= $i ?>.iconSize = new GSize(14,14); |
icon_phenoclim<?= $i ?>.shadowSize = new GSize(20,20); |
icon_phenoclim<?= $i ?>.iconAnchor = new GPoint (6,20); |
icon_phenoclim<?= $i ?>.infoWindowAnchor = new GPoint(5,1); |
<? } ?> |
//on va poser les points des villes |
<? |
include ("modules/connect.php"); |
$req_communes = mysql_query("SELECT DISTINCT STATION_LATITUDE, STATION_LONGITUDE, STATION_ID FROM STATION"); |
while ($commune = mysql_fetch_row($req_communes)) { |
if (is_numeric($dates[$commune[2]])) { |
?> |
var point = new GLatLng(<?= $commune[0] ?>, <?= $commune[1] ?>); |
map.addOverlay(createMarker(point, <?= "'".date('d/m/Y',$dates[$commune[2]])."'" ?>, |
icon<?= ($commune[3] ? "_phenoclim".$puces[$commune[2]] : $puces[$commune[2]]) ?>)); |
<? } } ?> |
} |
} |
//]]> |
</script> |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/index.php |
---|
New file |
0,0 → 1,127 |
<script language="javascript"> |
function gotoEtape (numetape) { |
document.navigation.etape.value=numetape; |
document.navigation.submit(); |
} |
</script> |
<? |
$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>"; |
} |
function afficherErreurs($tab_erreurs) { |
if (sizeof($tab_erreurs)>0) { |
echo "<div class='erreurs'>"; |
foreach ($tab_erreurs as $err) |
echo $err."<br>"; |
echo "</div><br>"; |
} |
} |
$erreurs = array(); |
include("modules/connect.php"); |
include("modules/messages.php"); |
$nbEtapes = 2; |
if (isset($_POST['etape'])) |
$etape = $_POST['etape']; |
else if (isset($_GET['etape'])) |
$etape = $_GET['etape']; |
else |
$etape = 1; |
echo "<form name='navigation' method='post' action='$url_page'><input type='hidden' name='etape'></form>"; |
if ($etape==1) { |
if (!isset($_POST['valid_typesp'])) { |
include("modules/observations/type_espece.php"); |
} |
else { |
$requete_comm = mysql_query("select CARACTERISTIQUE_ESP_VALEUR_LIB from CARACTERISTIQUE_ESP_VALEUR where CARACTERISTIQUE_ESP_VALEUR_ID=".$_POST['typespece']); |
$comm_ligne = mysql_fetch_row($requete_comm); |
$_SESSION['observation']['type_espece_id'] = $_POST['typespece']; |
$_SESSION['observation']['type_espece'] = $comm_ligne[0]; |
$etape++; |
} |
} |
if ($etape >1) |
echo "<div class='erreurs'>Pour revenir en arrière, n'utilisez pas le bouton \"précédent\" de votre navigateur, mais cliquez sur le nom à modifier.</div>"; |
if ($etape==2) { |
if (!isset($_POST['valid_espece']) || sizeof($erreurs)>0) { |
echo "<div class='recap'>"; |
echo "Type d'espèce choisi : ".etape($_SESSION['observation']['type_espece'],1)."<br>"; |
echo "</div><br>"; |
include("modules/observations/espece.php"); |
} |
else { |
$requete_comm = mysql_query("select ESPECE_NOM_VERNACULAIRE from ESPECE where ESPECE_ID=".$_POST['espece']); |
$comm_ligne = mysql_fetch_row($requete_comm); |
$_SESSION['observation']['espece_id'] = $_POST['espece']; |
$_SESSION['observation']['espece'] = $comm_ligne[0]; |
$etape++; |
} |
} |
if ($etape==3) { |
echo "<div class='recap'>"; |
echo "Type d'espèce choisi : ".etape($_SESSION['observation']['type_espece'],1)."<br>"; |
echo "Espèce choisie : ".etape($_SESSION['observation']['espece'],2)."<br>"; |
echo "</div><br>"; |
//if (!isset($_POST['valid_evenement']) || sizeof($erreurs)>0) { |
include("modules/observations/evenement.php"); |
if (!isset($_POST['valid_evenement']) || sizeof($erreurs)>0) { |
$requete_evenement = mysql_query("select EVENEMENT.EVENEMENT_ID, EVENEMENT_NOM from EVENEMENT,ESPECE_EVENEMENT where ESPECE_ID=".$_SESSION['observation']['espece_id']." and EVENEMENT.EVENEMENT_ID=ESPECE_EVENEMENT.EVENEMENT_ID and EVENEMENT_ACTIVE=1"); |
$comm_ligne = mysql_fetch_row($requete_evenement); |
$_SESSION['observation']['evenement_id'] = $comm_ligne[0]; |
$_SESSION['observation']['evenement'] = $comm_ligne[1]; |
} |
//} |
else { |
$requete_comm = mysql_query("select EVENEMENT_NOM from EVENEMENT where EVENEMENT_ID=".$_POST['evenement']); |
$comm_ligne = mysql_fetch_row($requete_comm); |
$_SESSION['observation']['evenement_id'] = $_POST['evenement']; |
$_SESSION['observation']['evenement'] = $comm_ligne[0]; |
$etape++; |
} |
/*} |
if ($etape==4) { |
if (!isset($_POST['valid_saisie']) || sizeof($erreurs)>0) { |
echo "<div class='recap'>"; |
echo "Type d'espèce choisi : ".etape($_SESSION['observation']['type_espece'],1)."<br>"; |
echo "Espèce choisie : ".etape($_SESSION['observation']['espece'],2)."<br>"; |
echo "Evènement choisi : ".etape($_SESSION['observation']['evenement'],3)."<br>"; |
echo "</div><br>"; |
*/ |
$nbPuces = 9; |
include ("modules/cartes/gen_carte.php") ; |
if (sizeof($erreurs)>0) { |
echo "<div class='erreurs'>"; |
foreach ($erreurs as $err) |
echo $err."<br>"; |
echo "</div>"; |
} else { |
?> |
<br> |
<center> |
<div id="map" class="carte"></div> |
<br><br> |
<table border="0"> |
<tr><td><?= date('d/m/Y',$dateMin) ?></td> |
<td><img src="modules/cartes/puces/legende.png"></td> |
<td><?= date('d/m/Y',$dateMin+$nbPuces*604800) ?></td> |
</table> |
</center> |
<? |
//} |
} |
} |
?> |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/0.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/0.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/1.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/1.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/2.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/2.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/liste_couleurs.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/liste_couleurs.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/3.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/3.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/4.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/4.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/5.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/5.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/ombre.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/ombre.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/6.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/6.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/7.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/7.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/8.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/8.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/9.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/9.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/liste_couleursv2.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/liste_couleursv2.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/0.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/0.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/1.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/1.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/2.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/2.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/3.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/3.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/4.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/4.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/ombre.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/ombre.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/5.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/5.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/6.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/6.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/7.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/7.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/8.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/8.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/9.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/9.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/contenu_phenoclim.tgz |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/phenoclim/contenu_phenoclim.tgz |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/legende.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/legende.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/ombre.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/puces/ombre.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/local_participants.php |
---|
New file |
0,0 → 1,52 |
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAnm2MSMmwsDuoh7THcVDnlBQH9AL26AfEfaraxwo1G6_adyVjPRRQE4Gx2u7MomK9DJWf9kMLJ9y-ZA" |
type="text/javascript"></script> |
<script type="text/javascript"> |
//<![CDATA[ |
var latFr = 47; |
var lonFr = 1.7; |
var latFrMin = 34; |
var latFrMax = 58; |
var lonFrMin = -12; |
var lonFrMax = 15; |
function load() { |
if (GBrowserIsCompatible()) { |
var map = new GMap2(document.getElementById("map")); |
map.setCenter(new GLatLng(latFr, lonFr), 6); |
map.addControl(new GSmallMapControl()); |
map.addControl(new GMapTypeControl()); |
map.setMapType(GMapType.G_SATELLITE_MAP); |
//map.addControl(new GSmallZoomControl()); |
// window.setTimeout(function() { |
GEvent.addListener(map, "moveend", function() { |
var bounds = map.getBounds(); |
var southWest = bounds.getSouthWest(); |
var northEast = bounds.getNorthEast(); |
if (southWest.lng()<lonFrMin || southWest.lat()<latFrMin |
|| northEast.lng()>lonFrMax || northEast.lat()>latFrMax) |
map.returnToSavedPosition(); |
else |
map.savePosition(); |
}, 20); |
// Creates a marker at the given point with the given number label |
function createMarker(point, text, text2) { |
var marker = new GMarker(point); |
var html = "<b>" + text + "</b> participants inscrits à " + text2; |
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);}); |
return marker; |
} |
//on va poser les points des villes |
<? while ($participants = mysql_fetch_row($req_participants)) { ?> |
var point = new GLatLng(<?= $participants[1] ?>, <?= $participants[2] ?>); |
map.addOverlay(createMarker(point, "<?= $participants[0] ?>", "<?= $participants[3] ?>")); |
<? } ?> |
} |
} |
//]]> |
</script> |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/analyse.php |
---|
New file |
0,0 → 1,128 |
<? |
$erreurs = array(); |
include("modules/connect.php"); |
include("modules/messages.php"); |
$nbEtapes = 3; |
$nom_etape = $provenance."etape"; |
if (isset($_POST[$nom_etape])) |
$etape = $_POST[$nom_etape]; |
else if (isset($_GET[$nom_etape])) |
$etape = $_GET[$nom_etape]; |
else |
$etape = 1; |
/* |
if ($_POST[$provenance]=='1') |
echo "<form name='navigation' method='post' action='$url_page'><input type='hidden' name='etape'> |
<input type='hidden' name='$provenance' value='1'></form>"; |
*/ |
if ($_POST[$provenance]=='1') { |
echo "<script language='javascript'> |
function gotoEtape (numetape) { |
document.navigation.".$provenance."etape.value=numetape; |
document.navigation.submit(); |
} |
</script> |
<form name='navigation' method='post' action='$url_page'><input type='hidden' name='".$provenance."etape'> |
<input type='hidden' name='$provenance' value='1'></form>"; |
} |
if ($etape==1 || $_POST[$provenance]!='1') { |
if ($_POST[$provenance]!='1' || !isset($_POST['valid_typesp'])) { |
include("modules/observations/type_espece.php"); |
} |
else { |
$requete_comm = mysql_query("select CARACTERISTIQUE_ESP_VALEUR_LIB from CARACTERISTIQUE_ESP_VALEUR where CARACTERISTIQUE_ESP_VALEUR_ID=".$_POST['typespece']); |
$comm_ligne = mysql_fetch_row($requete_comm); |
$_SESSION['observation']['type_espece_id'] = $_POST['typespece']; |
$_SESSION['observation']['type_espece'] = $comm_ligne[0]; |
$etape++; |
} |
} |
if ($_POST[$provenance]=='1') { |
if ($etape >1) |
echo "<div class='erreurs'>Pour revenir en arrière, n'utilisez pas le bouton \"précédent\" de votre navigateur, mais cliquez sur le nom à modifier.</div>"; |
if ($etape==2) { |
if (!isset($_POST['valid_espece']) || sizeof($erreurs)>0) { |
echo "<div class='recap'>"; |
echo "Type d'espèce choisi : ".etape($_SESSION['observation']['type_espece'],1)."<br>"; |
echo "</div><br>"; |
include("modules/observations/espece.php"); |
} |
else { |
$requete_comm = mysql_query("select ESPECE_NOM_VERNACULAIRE from ESPECE where ESPECE_ID=".$_POST['espece']); |
$comm_ligne = mysql_fetch_row($requete_comm); |
$_SESSION['observation']['espece_id'] = $_POST['espece']; |
$_SESSION['observation']['espece'] = $comm_ligne[0]; |
$etape++; |
} |
} |
if ($etape==3) { |
if (!isset($_POST['valid_evenement']) || sizeof($erreurs)>0) { |
echo "<div class='recap'>"; |
echo "Type d'espèce choisi : ".etape($_SESSION['observation']['type_espece'],1)."<br>"; |
echo "Espèce choisie : ".etape($_SESSION['observation']['espece'],2)."<br>"; |
echo "</div><br>"; |
include("modules/observations/evenement.php"); |
} |
else { |
$requete_comm = mysql_query("select EVENEMENT_NOM from EVENEMENT where EVENEMENT_ID=".$_POST['evenement']); |
$comm_ligne = mysql_fetch_row($requete_comm); |
$_SESSION['observation']['evenement_id'] = $_POST['evenement']; |
$_SESSION['observation']['evenement'] = $comm_ligne[0]; |
$etape++; |
} |
} |
if ($etape==4) { |
if (!isset($_POST['valid_annee']) || sizeof($erreurs)>0) { |
echo "<div class='recap'>"; |
echo "Type d'espèce choisi : ".etape($_SESSION['observation']['type_espece'],1)."<br>"; |
echo "Espèce choisie : ".etape($_SESSION['observation']['espece'],2)."<br>"; |
echo "Evènement choisi : ".etape($_SESSION['observation']['evenement'],3)."<br>"; |
echo "</div><br>"; |
include("modules/observations/annee.php"); |
} |
else { |
$_SESSION['observation']['annee'] = $_POST['annee']; |
$etape++; |
} |
} |
if ($etape==5) { |
if (!isset($_POST['valid_saisie']) || sizeof($erreurs)>0) { |
echo "<div class='recap'>"; |
echo "Type d'espèce choisi : ".etape($_SESSION['observation']['type_espece'],1)."<br>"; |
echo "Espèce choisie : ".etape($_SESSION['observation']['espece'],2)."<br>"; |
echo "Evènement choisi : ".etape($_SESSION['observation']['evenement'],3)."<br>"; |
echo "Année choisie : ".etape($annee,4)."<br>"; |
echo "</div><br>"; |
$anneeChoisie = true; |
$nbPuces = 9; |
include ("modules/cartes/gen_carte.php") ; |
if (sizeof($erreurs)>0) { |
echo "<div class='erreurs'>"; |
foreach ($erreurs as $err) |
echo $err."<br>"; |
echo "</div>"; |
} else { |
?> |
<center> |
<div id="map" class="carte"></div> |
<br><br> |
<table border="0"> |
<tr><td colspan="2" align="center"><img src="modules/cartes/puces/legende.png"> </td></tr> |
<tr><td><?= date('d/m/Y',$dateMin) ?></td><td align="right"><?= date('d/m/Y',$dateMin+($nbPuces+1)*604800) ?></td></tr> |
</table> |
</center> |
<? |
} |
} |
} |
} |
?> |
/branches/v1.0-Amère nouvelle/SPIP-v1-8-3/modules/cartes/traitement.php |
---|
New file |
0,0 → 1,69 |
<? |
//Définition des points : |
//Nb de semaines qui séparent les couleurs |
$pasSemaines = 2; |
include ("modules/connect.php"); |
//on regarde si une année a été postée ou pas |
if ($anneeChoisie) { |
//si oui, on la prend en compte |
$annee = $_SESSION['observation']['annee']; |
} else { |
//si non, on regarde l'année en cours |
$annee = date('Y'); |
} |
$evenement_id = $_SESSION['observation']['evenement_id']; |
$espece_id=$_SESSION['observation']['espece_id']; |
//echo "ev $evenement_id, espece $espece_id, année $annee"; |
$req_dates = mysql_query("SELECT DATE_FORMAT(MESURE_DATE,'%d%m%Y'), STATION_ID FROM MESURE,SEQUENCE". |
" where SEQUENCE.SEQUENCE_ID=MESURE.SEQUENCE_ID and". |
" EVENEMENT_ID=$evenement_id and ESPECE_ID=$espece_id". |
" AND MESURE_DATE!='0000-00-00' and MESURE_DATE>='$annee-01-01'". |
" and MESURE_DATE<'".($annee+1)."-01-01'". |
" order by STATION_ID"); |
$dates = array(); |
$lastcommune = 0; |
$nbdates = 1; |
echo mysql_error(); |
while ($obs = mysql_fetch_row($req_dates)) { |
$jour_crt = substr($obs[0],0,2); |
$mois_crt = substr($obs[0],2,2); |
$annee_crt = substr($obs[0],4,4); |
if ($obs[1]!=$lastcommune) { |
//on calcule la moyenne pour la commune précédente : |
if ($lastcommune != 0) |
$dates[$lastcommune] = $dates[$lastcommune]/$nbdates; |
//on initialise les variables pour la nouvelle commune |
$nbdates = 1; |
$lastcommune=$obs[1]; |
$dates[$lastcommune] = mktime(0,0,0,$mois_crt,$jour_crt,$annee_crt); |
} else { |
$nbdates++; |
$dates[$lastcommune] += mktime(0,0,0,$mois_crt,$jour_crt,$annee_crt); |
} |
} |
if (mysql_num_rows($req_dates)>0) |
$dates[$lastcommune] = $dates[$lastcommune]/$nbdates; |
if (sizeof($dates)>0) { |
$dateMin = min ($dates); |
$dateMax = max ($dates); |
$nbDates = sizeof ($dates); |
foreach ($dates as $comm => $date) { |
//la date courante est égale à la date min + combien de semaines ? |
$nbSemaines = round(($dates[$comm] - $dateMin)/604800); |
if ($nbSemaines < $nbPuces) |
$puces[$comm] = $nbSemaines; |
else |
$puces[$comm] = $nbPuces; |
} |
} |
else { |
$erreurs[] = "Désolé, il n'y a pas encore eu d'observations cette année pour l'évènement sélectionné ci-dessus. Choisissez un autre évènement."; |
} |
?> |