Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1687 → Rev 1688

/branches/livraison_aha/client/bottin/squelettes/donnees_googlemap.php
New file
0,0 → 1,49
<?php
$requete = 'select * from annuaire where a_est_structure=1';
$resultat = $GLOBALS['ins_db']->query ($requete);
 
if (DB::isError ($resultat)) {
echo $resultat->getMessage().'<br />'.$resultat->getDebugInfo();
}
 
$donnees = array();
$script_marker = '';
if ($resultat->numRows() != 0) {
$script_marker = '';
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
if ($ligne['a_latitude'] == 0 && $ligne['a_longitude'] == 0) continue;
$cle = $ligne['a_latitude'].'-'.$ligne['a_longitude'];
$donnees[$cle][] = $ligne;
}
foreach ($donnees as $valeur) {
// cas un : une seule entree pour le point de coordonnees
$script_icon = 'var icon = new GIcon();
icon.image = "'.INS_CHEMIN_APPLI.'presentation/marker.png";
icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
icon.iconSize = new GSize(20, 34);
icon.shadowSize = new GSize(37, 34);
icon.iconAnchor = new GPoint(6, 34);
icon.infoWindowAnchor = new GPoint(5, 1);';
if (count ($valeur) == 1) {
$chaine = $valeur[0];
$script_marker .= $script_icon;
$script_marker .= "\t".'point = new GLatLng('.$chaine['a_latitude'].','.$chaine['a_longitude'].');'."\n"
."\t".'map.addOverlay(createMarker(point, \''.
preg_replace ('/\n/', '', str_replace ("\r\n", '',
str_replace ("'", "\'", info($chaine['a_id'], 'info')))).'\', icon));'."\n";
} else { // Cas 2 plusieurs entrees
$tableau_id = array();
$script_marker .= "\t".'point = new GLatLng('.$val['a_latitude'].','.$val['a_longitude'].');'."\n"
."\t".'map.addOverlay(createMarker(point, \'';
foreach ($valeur as $val) {
$script_marker .= preg_replace ('/\n/', '', str_replace ("\r\n", '',
str_replace ("'", "\'", info($val['a_id'], 'info'))));
}
$script_marker .= '\', icon));'."\n";
}
}
} else {
$script_marker = '';
}
 
?>
/branches/livraison_aha/client/bottin/squelettes/annuaire_backoffice_moteur_recherche.tpl.html
New file
0,0 → 1,39
<form action="<?=$url;?>" method="post">
<table summary="recherche">
<tr>
<td><?=AM_L_RECHERCHER; ?></td><td><input type="text" size="15" value="<?=$recherche;?>" name="recherche" /></td>
<td><?=AM_L_PAYS; ?></td>
<td>
<select name="pays">
<option value="tous">Tous les pays</option>
<?php foreach ($tableau_pays as $codeIso => $labelPays) : ?>
<option value="<?=$codeIso;?>"
<?php if (!empty($pays)) : ?>
<?php if ($pays == $codeIso) : ?> selected <? endif; ?>
<?php endif ; ?>
><?=$labelPays;?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr>
<td><?=AM_L_DEPARTEMENT;?></td>
<td>
<select name="dept">
<option value="tous">tous</option>
<?php foreach ($tableau_dpt as $num_dpt => $label_dpt) : ?>
<option value="<?=$num_dpt;?>"
<?php if (!empty($dpt)) : ?>
<?php if ($dpt == $num_dpt) : ?> selected <? endif ; ?>
<?php endif ; ?>
><?=$num_dpt ;?> - <?=$label_dpt;?>
</option>
<?php endforeach ; ?>
</select>
</td>
<td><?= AM_L_GRP_RES; ?></td><td><?=$pager_select_box;?>
</td>
</tr>
<tr><td colspan="4"><input type="submit" value="<?=AM_L_RECHERCHER; ?>" name ="bouton" /></td></tr>
</table>
</form>
/branches/livraison_aha/client/bottin/squelettes/script_googlemap.tpl.js
New file
0,0 → 1,56
// Variables globales
var map = null;
var lat = document.getElementById("latitude");
var lon = document.getElementById("longitude");
// Pour gerer la taille
var winW = 630, winH = 560;
var deltaH = 50;
var deltaW = 30;
function setWinHW() {
if (window.innerHeight) {
winW = window.innerWidth - deltaW;
winH = window.innerHeight - deltaH;
} else {
winW = document.documentElement.offsetWidth - 20 - deltaW;
winH = document.documentElement.offsetHeight - 20 - deltaH ;
}
var me = document.getElementById("map");
if (me != null) {
me.style.width= '' + winW + 'px';
me.style.height= '' + winH + 'px';
}
}
 
window.onresize = function () {
setWinHW();
if (map) map.checkResize();
}
 
function createMarker(point, chaine, icon) {
var marker = new GMarker(point, icon);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(chaine);
});
return marker;
}
function load() {
if (GBrowserIsCompatible()) {
setWinHW();
map = new GMap2(document.getElementById("map"));
var geoXml = new GGeoXml("<?='http://.kml';?>");
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.enableContinuousZoom();
map.enableScrollWheelZoom();
// On centre la carte
center = new GLatLng(<?=INS_GOOGLE_CENTRE_LAT;?>, <?=INS_GOOGLE_CENTRE_LON;?>);
map.setCenter(center, <?=INS_GOOGLE_ALTITUDE;?>);
map.setMapType(<?=INS_GOOGLE_TYPE_DE_VUE;?>);
<?=$script_marker;?>
map.addOverlay(geoXml);
}
}