29,11 → 29,11 |
*@version 01 juillet 2002 |
// +-----------------------------------------------------------------------------------------------+ |
// |
// $Id: lib.carto.php,v 1.5 2006-12-01 13:23:16 florian Exp $ |
// $Id: lib.carto.php,v 1.6 2006-12-12 10:37:45 alexandre_tb Exp $ |
// FICHIER : $RCSfile: lib.carto.php,v $ |
// AUTEUR : $Author: florian $ |
// VERSION : $Revision: 1.5 $ |
// DATE : $Date: 2006-12-01 13:23:16 $ |
// AUTEUR : $Author: alexandre_tb $ |
// VERSION : $Revision: 1.6 $ |
// DATE : $Date: 2006-12-12 10:37:45 $ |
// |
// +-----------------------------------------------------------------------------------------------+ |
// A FAIRE : |
98,8 → 98,8 |
if (!empty($this->class_css)) { |
$res.='class="'.$this->class_css.'" '; |
} |
|
$res.='href="'.$this->url.'&historique_cartes='.$chemin.'"> '.$this->caractere_separation.' '.$tabnom[$key].'</a>'; |
$GLOBALS['ins_url']->addQueryString('historique_cartes', $chemin); |
$res.='href="'.$GLOBALS['ins_url']->getURL().'"> '.$this->caractere_separation.' '.$tabnom[$key].'</a>'; |
} |
$res.= '</div>'."\n"; |
return $res; |
202,6 → 202,8 |
$action['id_carte_destination'] = $ligne->$chp_id_carte_destination; |
|
return $action; |
} else { |
return array ('type_action' => 'Recharger'); |
} |
}//Fin de la méthode _consulterActionImage(). |
|
317,8 → 319,11 |
$this->chemin = $chemin; |
$this->_info_table_zg = $info_table; |
|
$this->_action = new Carto_Action($info_table['nom_table_zone'],$info_table['nom_chp_id_zone'], $info_table['nom_chp_rouge'], $info_table['nom_chp_vert'], $info_table['nom_chp_bleu'], |
'carto_ACTION', 'CA_ID_Carte', 'CA_ID_Zone_geo', 'CA_Type_zone', 'CA_Action', 'CA_ID_Carte_destination'); |
|
$this->_action = new Carto_Action($info_table['nom_table_zone'],$info_table['nom_chp_id_zone'], |
$info_table['nom_chp_rouge'], $info_table['nom_chp_vert'], $info_table['nom_chp_bleu'], |
'carto_ACTION', 'CA_ID_Carte', 'CA_ID_Zone_geo', 'CA_Type_zone', |
'CA_Action', 'CA_ID_Carte_destination'); |
$this->fils = array(); |
$this->filiation = $id; |
$this->historique_cartes = ''; |
400,7 → 405,6 |
|
function donnerFormulaireImage () |
{ |
global $GS_GLOBAL; |
$res = ''; |
|
// Nous commençons par tester tout d'abords si nous venons d'une autre carte. Pour cela nous vérifions, |
443,7 → 447,7 |
// on regarde qu'est-ce qu'on doit faire grace a la methode _consulterAction() de l'objet Carto_Action |
|
$action = $this->_action->_consulterActionImage($this->image_x, $this->image_y, $this->masque, $this->id); |
|
|
// Nous distinguons 2 cas : |
//le cas ou il faut afficher une nouvelle carte ... : |
if ($action['type_action'] == 'Aller_a') { |
510,6 → 514,7 |
else if ($this->historique_cartes) { |
// Nous chargons alors l'ojet approprié en descendant grâce a la généalogie |
$historique_cartes = explode('*',$this->historique_cartes); |
|
foreach ($historique_cartes as $key => $value) { |
if ($key != 0) { |
$this = $this->fils[$value]; |
557,7 → 562,7 |
$requete = |
'SELECT '.$this->_info_table_zg['nom_chp_id_zone'].', '.$this->_info_table_zg['nom_chp_nom_zone']. |
' FROM '.$this->_info_table_zg['nom_table_zone']; |
if ($this->_info_table_zg['nom_chp_zone_sup'] != ''){ |
if ($this->_info_table_zg['nom_chp_zone_sup'] != '' && $this->_id_zone_geo_carte != ''){ |
if(ereg("[a-z]+",$this->_id_zone_geo_carte)){ |
$requete .= |
' WHERE '.$this->_info_table_zg['nom_chp_zone_sup'].' = "'.$this->_id_zone_geo_carte.'"'; |
569,9 → 574,11 |
} |
$requete .= |
' ORDER BY '.$this->_info_table_zg['nom_chp_nom_zone'].' ASC'; |
$resultat = mysql_query ($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, |
'', $requete)); |
|
$resultat = $GLOBALS['ins_db']->query ($requete) ; |
if (DB::isError($resultat)) { |
echo BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete) ; |
} |
|
$i=0; |
|
$retour = '<select name="liste_zone_carte" style="float:right;" onchange="javascript:this.form.submit();">'."\n"; |
580,7 → 587,7 |
$nom_chp_nom_zone = $this->_info_table_zg['nom_chp_nom_zone']; |
$nom_chp_id_zone = $this->_info_table_zg['nom_chp_id_zone']; |
|
while ($ligne = mysql_fetch_object ($resultat)) { |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) { |
if ($zone_par_defaut == $ligne->$nom_chp_id_zone){ |
$retour .= '<option value="'.$ligne->$nom_chp_id_zone.'" selected="selected">'.$ligne->$nom_chp_nom_zone.'</option>'."\n"; |
} |
636,7 → 643,7 |
$requete_01 = |
'SELECT *'. |
' FROM '.$table_zone_geo; |
if ($chp_zone_sup != ''){ |
if ($chp_zone_sup != '' && $this->_id_zone_geo_carte != ''){ |
if(ereg("[a-z]+",$this->_id_zone_geo_carte)){ |
$requete_01 .= |
' WHERE '.$chp_zone_sup.' = "'.$this->_id_zone_geo_carte.'"'; |
792,7 → 799,7 |
//echo $this->fond.'<BR>'; |
$image_fond = imagecreatefrompng($this->fond); |
$taille_palette = imagecolorstotal ($image_fond); |
if (!$image_fond) echo 'erreur fond : '.$this->fond; |
if (!$image_fond) echo 'erreur fond'; |
// Pour chaque couleur contenue dans l'image, nous cherchons l'objet correspondant |
// dans le tableau $att, qui contient des informations sur chaque zone de l'image, |
// et nous attribuons à l'objet la valeur de l'index de sa couleur dans l'image. |