21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: carto_carte.class.php,v 1.1 2005-02-22 12:02:57 jpm Exp $ |
// CVS : $Id: carto_carte.class.php,v 1.2 2005-02-22 16:35:16 jpm Exp $ |
/** |
* Classe Carto_Carte. |
* |
34,7 → 34,7 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2005-02-22 12:02:57 $ |
*@version $Revision: 1.2 $ $Date: 2005-02-22 16:35:16 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
48,9 → 48,15 |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
/** |
* Classe Carto_Carte() - Classe principale de la cartographie. |
* |
* La classe Carto_Carte permet de travailler les fichiers images des cartes. |
*/ |
class Carto_Carte |
{ |
// +--------------------------------------------------------------------------------------------------+ |
// LES ATTRIBUTS DE LA CLASSE |
var $id; |
var $_id_zone_geo_carte; |
var $nom; |
86,6 → 92,7 |
var $_formule_coloriage; |
//L'action à réaliser |
var $_action; |
|
// +--------------------------------------------------------------------------------------------------+ |
// Conifugration de la carto |
var $_maxiB; |
92,7 → 99,8 |
|
|
// +--------------------------------------------------------------------------------------------------+ |
function Carto_Carte($id, $id_zone_geo_carte, $nom, $masque, $fond, $chemin, $info_table) |
// LE CONSTRUCTEUR DE LA CLASSE |
function Carto_Carte($id, $id_zone_geo_carte, $nom, $masque, $fond, $chemin, $info_table_zg, $info_table_action) |
{ |
$this->id = $id; |
$this->_id_zone_geo_carte = $id_zone_geo_carte; |
100,10 → 108,9 |
$this->masque = $chemin.$masque; |
$this->fond = $chemin.$fond; |
$this->chemin = $chemin; |
$this->_info_table_zg = $info_table; |
$this->_info_table_zg = $info_table_zg; |
|
$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_zg, $info_table_action); |
$this->fils = array(); |
$this->filiation = $id; |
$this->historique_cartes = ''; |
111,8 → 118,9 |
$this->definirCouleurs(); |
$this->definirFormuleColoriage(); |
} |
|
// +--------------------------------------------------------------------------------------------------+ |
|
// LES METHODES PUBLIQUES |
function definirCouleurs ( |
$couleur_zero_R = '255', $couleur_zero_V = '255', $couleur_zero_B = '255', |
$couleur_mini_R = '210', $couleur_mini_V = '230', $couleur_mini_B = '210', |
180,10 → 188,9 |
// -soit une nouvelle carte coloriée |
// -soit false. |
//********************************************************************************************************** |
|
function donnerFormulaireImage () |
{ |
global $GS_GLOBAL; |
//global $GS_GLOBAL; |
$res = ''; |
|
// Nous commençons par tester tout d'abords si nous venons d'une autre carte. Pour cela nous vérifions, |
202,7 → 209,7 |
|
// Quoi qu'il arrive, on ouvre la balise formulaire |
$res = '<form action="'.$this->url.'" method="post">'."\n"; |
$res .= '<p>'.CAR_CLIQUER_ACCEDER ; |
$res .= '<p>'; |
if (isset ($this->image_x) && ($this->image_x != '') && isset ($this->image_y) && ($this->image_y != '')) { |
// on regarde ici si l'on a pas un objet de plus bas niveau présent dans la variable de session carte |
//a charger a la place de l'objet de plus haut niveau |
321,7 → 328,7 |
|
$_SESSION['carte'] = $obj ; |
} |
$res .= CAR_CHEMIN_LIBRAIRIE.'/lib.carto.extractimg.php?fichier='.$this->id.$id_image.'"'; |
$res .= sprintf(CAR_CHEMIN_CARTE, urlencode(CAR_CHEMIN_TMP), $this->id.$id_image).'"'; |
$res .= ' name="image" onmouseover="javascript:show(\'d\');" onmouseout="javascript:show(\'d\');" />'."\n"; |
$res .= '<input type="hidden" name="historique_cartes" value="'.$this->historique.'" /></p>'; |
$res .= '</form>'."\n"; |
328,9 → 335,8 |
return $res; |
} |
|
/*|=============================================================================================|*/ |
/*| LES METHODES PRIVEES |*/ |
/*|---------------------------------------------------------------------------------------------|*/ |
// +--------------------------------------------------------------------------------------------------+ |
// LES METHODES PRIVÉES |
function _donnerListeZoneCarte($zone_par_defaut = '') |
{ |
$retour = ''; |
350,7 → 356,7 |
} |
$requete .= |
' ORDER BY '.$this->_info_table_zg['nom_chp_nom_zone'].' ASC'; |
echo $requete; |
|
$resultat = mysql_query ($requete) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Requete : </b>'.$requete. |
393,11 → 399,11 |
$this->_info_table_zg['nom_chp_vert'], $this->_info_table_zg['nom_chp_bleu'], $this->_info_table_zg['nom_chp_zone_sup'], |
$this->_info_table_zg['tableau_valeurs_zone'], $id_zone_a_reperer) ; |
if ($nom_fichier != '') { |
imagepng(&$this->image,'tmp/carto/'.$nom_fichier.'.png'); |
imagepng(&$this->image, CAR_CHEMIN_TMP.$nom_fichier.'.png'); |
//$this->image = imagepng(&$this->image); |
} |
else { |
imagepng(&$this->image,'tmp/carto/'.$this->id.$id_image.'.png'); |
imagepng(&$this->image, CAR_CHEMIN_TMP.$this->id.$id_image.'.png'); |
//imagepng(&$this->image); |
} |
} |
780,18 → 786,7 |
|
}//Fin de la classe Carto_Carte() |
|
|
// +------------------------------------------------------------------------------------------------------+ |
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
|
|
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|