Parse error: PHP et SVG viewer

Fermé
wilsonatine - 5 sept. 2011 à 12:56
 Utilisateur anonyme - 5 sept. 2011 à 14:20
Bonjour, Je fais une application en php qui uitilse le Svg pour afficher les carte et quand j'execute on m'affiche
Parse error: parse error, expecting 'T_OLD_FUNCTION' or 'T_FUNCTION' or 'T_VAR' or ''}'' in c:\users\atine\documents\php\projet_mcwill\pages\cartographie_yde\content_svg3.php on line 160
En fait je veux connaitre ce qui ne vas pas.Voilà mon code

<?php
echo '<?xml version="1.0" encoding="iso-8859-1"?>
<svg id="map2svg"
onload="init(evt)"
onzoom="DoOnZoomEvent()"
onmousemove="show_coords(evt)"
onmousedown="setdistance(evt)"
onmouseup="reinit()"
width="1280" height="673" zoomAndPan="magnify"
viewBox="1273047.69 -432332.44 18967.15 9972.56" preserveAspectRatio="xMidYMid meet">
<defs>

<script xlink:href="script/ViewBox.js"/>
<script xlink:href="script/javascript.js"/>

<symbol id="Eqpt_Orange_Symbol" viewBox="-3 -10.5 6 11">
<g><path fill="red" stroke="red" stroke-width="0.3" d="
M -1,-7
L -0.7,-8
L 0.7,-8
L 1,-7
Z "/>

<circle fill="none" cx="0" cy="-9" r="0.9" stroke-width="0.3" stroke="#ff9900"/>
<circle fill="red" cx="0" cy="-9" r="0.5" stroke-width="0.3"/>
<path fill="red" stroke="red" stroke-width="0.3" d="
M -1,-9.7
A 1.4,1.4,0,0,0,-1,-8.3
M -1,-10.5
A 2,2,0,0,0,-1,-7.5
M 1,-9.7
A 1.4,1.4,0,0,1,1,-8.3
M 1,-10.5
A 2,2,0,0,1,1,-7.5" />
<path fill="red" stroke="red" stroke-width="0.3" d="
M -3,0
L -1,-7
L 1,-7
L 1,-7
L 3,0
L -2.3,-2
L 1.8,-4
L -1.3,-6

M 1.3,-6
L -1.8,-4
L 2.3,-2
L -3,0"/></g>
</symbol>
<symbol id="Sante_Symbol" viewBox="-3 -10.5 6 11">
<g><path fill="white" stroke="green" stroke-width="0.3" d="
M -1,-7
L -0.7,-8
L 0.7,-8
L 1,-7
Z "/>
<path fill="white" stroke="green" stroke-width="0.3" d="
M -1,-9.7
A 1.4,1.4,0,0,0,-1,-8.3
M -1,-10.5
A 2,2,0,0,0,-1,-7.5
M 1,-9.7
A 2,2,0,0,1,1,-7.5" />
<path fill="white" stroke="green" stroke-width="0.3" d="
M -3,0
L -1,-7
L 1,-7
L 1,-7
L 3,0
L -2.3,-2
L 1.8,-4
L -1.3,-6

M 1.3,-6
L -1.8,-4
L 2.3,-2
L -3,0"/></g></symbol>

<symbol id="carrefours_Symbol" viewBox="0 0 50 50">
<g>
<circle fill="blue" cx="25" cy="25" r="24" stroke-width="0.3"/>
<!--path fill="#fff" stroke="#fff" stroke-width="0.3" d="
M -3,0
L -1,-7
L 1,-7
L 1,-7
L 3,0
L -2.3,-2
L 1.8,-4
L -1.3,-6

M 1.3,-6
L -1.8,-4
L 2.3,-2
L -3,0"/--></g>
</symbol>
<symbol id="Ecole_Symbol" viewBox="-4.5 -7.5 8 7.5">
<g><path fill="#green" stroke="green" stroke-width="0.1" d="
M -3.5,-5.5
L 0,-6.5
L 3.5,-5.5
Z
M -3.5,-0.5
L 3.5,-0.5
L 3.5,0
L -3.5,0
Z
"/>
<path fill="green" stroke="green" stroke-width="0.5" d="
M -2.5,-5.5
L -2.5,-0.5

M -1.5,-0.5
L -1.5,-5.5

M -0.5,-5.5
L -0.5,-0.5

M 0.5,-0.5
L 0.5,-5.5

M 1.5,-5.5
L 1.5,-0.5

M 2.5,-0.5
L 2.5,-5.5"
/></g>
</symbol>



</defs>';

echo'<filter id="dropshadow">
<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>
<feOffset in="blur" dx="10" dy="10" result="offsetBlur"/>
<feMerge>
<feMergeNode in="offsetBlur"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
<linearGradient id="Orange_Yellow">
<stop offset="5%" stop-color="#F60" />
<stop offset="95%" stop-color="#FF6" />
</linearGradient>';


//require_once 'Ecole.php';


$sql=mysql_pconnect('localhost','root','')or die("erreur de connexion");
mysql_select_db('sig_svg',$sql)or die("erreur de connexion");




/* Classe Cameroun */
class CamerounSVG{
/*1.Trac� Cameroun*/
public function afficherCamerounSVG(){

echo "\n".'<g id="Cameroun" style="display:inline;">';
echo "\n";
$req1="SELECT * FROM 'tblcameroun'";
$queryCameroun=mysql_query($req1); //requ�te MySQL

while($row=mysql_fetch_assoc($queryCameroun))
{
$idCameroun=$row["IdCameroun"];
$geometry=$row["SVG_Geom"];
$province=$row["Province"];
$departement=$row["Departement"];
$arrondissement=$row["Arrondissement"];
echo "\n".'<g id="Cameroun_'.$idCameroun.'"'.' infotext="Province:'.$province.'#'.$departement.'#'.$arrondissement.'"'.' onclick="showdetail('."'Cameroun_".$idCameroun."'".')" onmouseover="mouseover('."'".'Cameroun_'.$idCameroun."'".');setToolTipText2()"'.' onmouseout ="mouseout ('."'".'Cameroun_'.$idCameroun."'".');clearToolTipText()"'.' style="fill:#FFFFFF;stroke:#000000;fill-opacity:1;stroke-width:1px;">';
echo "\n".$geometry."\n";
echo '</g>'."\n";
}
echo ' </g>'."\n";
}

}

$cameroun= new CamerounSVG();
$cameroun->afficherCamerounSVG();



En fait ce n'est qu'une partie du code jusqu'ou il ya erreur





1 réponse

Utilisateur anonyme
5 sept. 2011 à 13:35
Bonjour,

Dans cette partie du code il ne semble pas y avoir d'erreur, je l'ai exécuté en ajoutant un ?> à la fin. A part la connexion à la base, tout semble fonctionner.
C'est sans doute plus bas, sans doute un ' ou " ou un ; manquant.
1
<?php
echo '<?xml version="1.0" encoding="iso-8859-1"?>
<svg id="map2svg"
onload="init(evt)"
onzoom="DoOnZoomEvent()"
onmousemove="show_coords(evt)"
onmousedown="setdistance(evt)"
onmouseup="reinit()"
width="1280" height="673" zoomAndPan="magnify"
viewBox="1273047.69 -432332.44 18967.15 9972.56" preserveAspectRatio="xMidYMid meet">
<defs>

<script xlink:href="script/ViewBox.js"/>
<script xlink:href="script/javascript.js"/>

<symbol id="Eqpt_Orange_Symbol" viewBox="-3 -10.5 6 11">
<g><path fill="red" stroke="red" stroke-width="0.3" d="
M -1,-7
L -0.7,-8
L 0.7,-8
L 1,-7
Z "/>

<circle fill="none" cx="0" cy="-9" r="0.9" stroke-width="0.3" stroke="#ff9900"/>
<circle fill="red" cx="0" cy="-9" r="0.5" stroke-width="0.3"/>
<path fill="red" stroke="red" stroke-width="0.3" d="
M -1,-9.7
A 1.4,1.4,0,0,0,-1,-8.3
M -1,-10.5
A 2,2,0,0,0,-1,-7.5
M 1,-9.7
A 1.4,1.4,0,0,1,1,-8.3
M 1,-10.5
A 2,2,0,0,1,1,-7.5" />
<path fill="red" stroke="red" stroke-width="0.3" d="
M -3,0
L -1,-7
L 1,-7
L 1,-7
L 3,0
L -2.3,-2
L 1.8,-4
L -1.3,-6

M 1.3,-6
L -1.8,-4
L 2.3,-2
L -3,0"/></g>
</symbol>
<symbol id="Sante_Symbol" viewBox="-3 -10.5 6 11">
<g><path fill="white" stroke="green" stroke-width="0.3" d="
M -1,-7
L -0.7,-8
L 0.7,-8
L 1,-7
Z "/>
<path fill="white" stroke="green" stroke-width="0.3" d="
M -1,-9.7
A 1.4,1.4,0,0,0,-1,-8.3
M -1,-10.5
A 2,2,0,0,0,-1,-7.5
M 1,-9.7
A 2,2,0,0,1,1,-7.5" />
<path fill="white" stroke="green" stroke-width="0.3" d="
M -3,0
L -1,-7
L 1,-7
L 1,-7
L 3,0
L -2.3,-2
L 1.8,-4
L -1.3,-6

M 1.3,-6
L -1.8,-4
L 2.3,-2
L -3,0"/></g></symbol>

<symbol id="carrefours_Symbol" viewBox="0 0 50 50">
<g>
<circle fill="blue" cx="25" cy="25" r="24" stroke-width="0.3"/>
<!--path fill="#fff" stroke="#fff" stroke-width="0.3" d="
M -3,0
L -1,-7
L 1,-7
L 1,-7
L 3,0
L -2.3,-2
L 1.8,-4
L -1.3,-6

M 1.3,-6
L -1.8,-4
L 2.3,-2
L -3,0"/--></g>
</symbol>
<symbol id="Ecole_Symbol" viewBox="-4.5 -7.5 8 7.5">
<g><path fill="#green" stroke="green" stroke-width="0.1" d="
M -3.5,-5.5
L 0,-6.5
L 3.5,-5.5
Z
M -3.5,-0.5
L 3.5,-0.5
L 3.5,0
L -3.5,0
Z
"/>
<path fill="green" stroke="green" stroke-width="0.5" d="
M -2.5,-5.5
L -2.5,-0.5

M -1.5,-0.5
L -1.5,-5.5

M -0.5,-5.5
L -0.5,-0.5

M 0.5,-0.5
L 0.5,-5.5

M 1.5,-5.5
L 1.5,-0.5

M 2.5,-0.5
L 2.5,-5.5"
/></g>
</symbol>



</defs>';

echo'<filter id="dropshadow">
<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>
<feOffset in="blur" dx="10" dy="10" result="offsetBlur"/>
<feMerge>
<feMergeNode in="offsetBlur"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
<linearGradient id="Orange_Yellow">
<stop offset="5%" stop-color="#F60" />
<stop offset="95%" stop-color="#FF6" />
</linearGradient>';


//require_once 'Ecole.php';


$sql=mysql_pconnect('localhost','root','')or die("erreur de connexion");
mysql_select_db('sig_svg',$sql)or die("erreur de connexion");




/* Classe Cameroun */
class CamerounSVG{
/*1.Trac� Cameroun*/
public function afficherCamerounSVG(){

echo "\n".'<g id="Cameroun" style="display:inline;">';
echo "\n";
$req1="SELECT * FROM 'tblcameroun'";
$queryCameroun=mysql_query($req1); //requ�te MySQL

while($row=mysql_fetch_assoc($queryCameroun))
{
$idCameroun=$row["IdCameroun"];
$geometry=$row["SVG_Geom"];
$province=$row["Province"];
$departement=$row["Departement"];
$arrondissement=$row["Arrondissement"];
echo "\n".'<g id="Cameroun_'.$idCameroun.'"'.' infotext="Province:'.$province.'#'.$departement.'#'.$arrondissement.'"'.' onclick="showdetail('."'Cameroun_".$idCameroun."'".')" onmouseover="mouseover('."'".'Cameroun_'.$idCameroun."'".');setToolTipText2()"'.' onmouseout ="mouseout ('."'".'Cameroun_'.$idCameroun."'".');clearToolTipText()"'.' style="fill:#FFFFFF;stroke:#000000;fill-opacity:1;stroke-width:1px;">';
echo "\n".$geometry."\n";
echo '</g>'."\n";
}
echo ' </g>'."\n";
}

}

$cameroun= new CamerounSVG();
$cameroun->afficherCamerounSVG();




class ProvinceSVG{

public function afficherProvinceCentreSVG(){

echo "\n".'<g id="Couverture" style="display:inline;">';
echo "\n";

$req1="SELECT * FROM 'new_pops' ";
$queryRingo=mysql_query($req1); //requ�te MySQL

while($row=mysql_fetch_assoc($queryRingo))
{
$id_npop=$row["id_npop"];
$latitude=$row["lat_npop"];
$longitude=$row["lon_npop"];
$cx=$row["CX_npop"];
$cy=$row["CY_npop"];
$Allinfo=$id_npop.'#'.$latitude.'#'.$longitude;

echo '<circle id="CercleArrond_'.$id_npop.'" cx="'.$cx.'" cy="'.$cy.'" r="890" fill="red" stroke="#000000" stroke-width="25" opacity=".3" infotext="Couverture: '.$Allinfo.'"'.' onclick="showdetail('."'Couverture_".$id_npop."'".')" onmouseover="mouseover('."'".'Couverture_'.$id_npop."'".');setToolTipText2()"'.' onmouseout ="mouseout ('."'".'Couverture_'.$id_npop."'".');clearToolTipText()"'.' />';
echo "\n".'<text x="'.$cx.'" y="'.$cy.'" id="Couverture_'.$id_npop.'"'.' font-family="Verdana" font-size="150" fill="black">'."\n";
echo '</text>'."\n";

}
echo ' </g>'."\n";

}

}

$centre=new ProvinceSVG();
$centre->afficherProvinceCentreSVG();


////couche des fréquences
class frequenceSVG{

public function afficherfrequenceSVG(){

echo "\n".'<g id="frequence" style="display:inline;">';
echo "\n";

$req1="SELECT * FROM 'pointfreq' ";
$queryRingo=mysql_query($req1); //requ�te MySQL

while($row=mysql_fetch_assoc($queryRingo))
{
$id_point=$row["id_point"];
$cx=$row["cx_point"];
$cy=$row["cy_point"];
$color=$row["couleur"];
$Allinfo=$id_point;

echo '<circle id="CercleArrond_'.$id_point.'" cx="'.$cx.'" cy="'.$cy.'" r="890" fill="'.$color.'" stroke="#000000" stroke-width="25" opacity=".3" infotext="Couverture: '.$Allinfo.'"'.' onclick="showdetail('."'Couverture_".$id_point."'".')" onmouseover="mouseover('."'".'Couverture_'.$id_point."'".');setToolTipText2()"'.' onmouseout ="mouseout ('."'".'Couverture_'.$id_point."'".');clearToolTipText()"'.' />';
echo "\n".'<text x="'.$cx.'" y="'.$cy.'" id="Couverture_'.$id_point.'"'.' font-family="Verdana" font-size="150" fill="black">'."\n";
echo '</text>'."\n";

}
echo ' </g>'."\n";

}

}

$centre=new frequenceSVG();
$centre->afficherfrequenceSVG();

///fin de la couche des fréquences

/* classe de gestion des quartiers pollués ***/

class QuartierSVG {

public function afficherQuartierSVG(){

echo "\n".'<g id="Quartier1" style="display:inline;">';
echo "\n";

$req3="SELECT * FROM 'tblquartier'";
$queryQuartier=mysql_query($req3); //requête MySQL




while($row1=mysql_fetch_assoc($queryQuartier))
{
$idQuartier=$row1["IdQuartier"];
$geometry=$row1["SVG_Geom"];
$nom=$row1["Nom"];
$CX=$row1["CX"];
$CY=$row1["CY"];




$req31="SELECT c.IdCarrefour FROM tblcarrefour_yde c, tblquartier q WHERE c.IdQuartier=q.IdQuartier and c.IdQuartier=".$idQuartier." ";

$queryCarrefour=mysql_query($req31); //requête MySQL



$nombre_enrg = mysql_num_rows($queryCarrefour);

if($nombre_enrg>=1){

while($row2=mysql_fetch_assoc($queryCarrefour))
{



$idCarrefour=$row2["IdCarrefour"];


$req32="SELECT * FROM tblcarrefour_yde where IdCarrefour=".$idCarrefour." ";



$queryCarrefour1=mysql_query($req32) or exit (mysql_error().".<br/>$req32"); //requ�te MySQL

//echo "La requète est bien passée ++++";
$num=mysql_num_rows($queryCarrefour1);
//if()

while($row=mysql_fetch_assoc($queryCarrefour1))
{

$idCarrefour=$row["IdCarrefour"];
$Cx=$row["Cx"];
$Cy=$row["Cy"];
$Nom=$row["Nom"];
$Longitude=$row["Longitude"];
$Latitude=$row["Latitude"];



}

echo "\n".'<g id="Quartier1_'.$idQuartier.'"'.' infotext="Quartier:'.$nom.'"'.' onclick="showdetail('."'Quartier1_".$idQuartier."'".')" onmouseover="mouseover('."'".'Quartier1_'.$idQuartier."'".');setToolTipText2()"'.' onmouseout ="mouseout ('."'".'Quartier1_'.$idQuartier."'".');clearToolTipText()"'.' style="fill:#FFFFFF;stroke:#000000;fill-opacity:1;stroke-width:1px;opacity:.01">';
echo "\n".$geometry."\n";
echo '</g>'."\n";

}
}

}
echo ' </g>'."\n";

}

}








class NomQuartierSVG {

/*2.Tracé Quartier*/
public function afficherNomQuartierSVG(){

echo "\n".'<g id="NomQuartier" style="display:inline;">';
echo "\n";

$req3="SELECT * FROM 'tblnom_quartier'";
$queryQuartier=mysql_query($req3); //requête MySQL

while($row=mysql_fetch_assoc($queryQuartier))
{
$idQuartier=$row["IdNom_Quartier"];
//$geometry=$row["SVG_Geom"];
$nom=$row["Nom"];
$CX=$row["Cx"];
$CY=$row["Cy"];

if(($CX!=0)&&($CY!=0)){

$CX=$row["Cx"]-100;
$CY=$row["Cy"]-100;

/* echo "\n".'<g id="nomQuartier" transform="matrix(1 0 0 1 100 75)" onmouseover="zoom_text(evt)" onmouseout="normal(evt)">';*/
echo '<circle id="CercleArrond_'.$idQuartier.'" cx="'.$CX.'" cy="'.$CY.'" r="30" fill="red" stroke="#000000" stroke-width="25" opacity=".3" />';
echo "\n".'<text x="'.$CX.'" y="'.$CY.'" id="NomQuartier_'.$idQuartier.'"'.' font-family="verdana" font-size="100" fill="black">'."\n";
echo $nom."\n";
echo '</text>'."\n";
/* echo '</g>'."\n";*/


} else {

}


}
echo ' </g>'."\n";

}

}




$quartier =new QuartierSVG();
$quartier->afficherQuartierSVG();


$nomquartier=new NomQuartierSVG();
$nomquartier->afficherNomQuartierSVG();




class Rue{


/*6.Tracé Rue_Yde*/

public function afficherRueYaoundeSVG(){

echo "\n".'<g id="Rue_Yde" style="display:inline;">';
echo "\n";

$req7="SELECT * FROM 'tblrue_yde'";
$queryRue_Yde=mysql_query($req7); //requête MySQL

while($row=mysql_fetch_assoc($queryRue_Yde))
{
$idRue_Yde=$row["IdRue_Yde"];
$geometry=$row["SVG_Geom"];
$NomRue=$row["NomRue"];
$Fnode=$row["Fnode"];
$Tnode=$row["Tnode"];
$Lpoly=$row["Lpoly"];
$Rpoly=$row["Rpoly"];
$Length=$row["Length"];
$Voirie=$row["Voirie"];
$NumRue=$row["NumRue"];
$Allinfo=$NomRue.'#'.$NumRue.'#'.$Length.'#'.$Voirie.'#'.$Fnode.'#'.$Tnode.'#'.$Lpoly.'#'.$Rpoly;
echo "\n".'<g id="Rue_Yde_'.$idRue_Yde.'"'.' infotext="Rue Yde: '.$Allinfo.'"'.' onclick="showdetail('."'Rue_Yde_".$idRue_Yde."'".')" onmouseover="mouseover('."'".'Rue_Yde_'.$idRue_Yde."'".');setToolTipText2()"'.' onmouseout ="mouseout ('."'".'Rue_Yde_'.$idRue_Yde."'".');clearToolTipText()"'.' style="fill:none;opacity:1;stroke-linejoin:round;stroke:#569000;stroke-width:1px;">';
echo "\n".$geometry."\n";
echo '</g>'."\n";
}
echo ' </g>'."\n";

}

}

$rueYaounde=new Rue();
$rueYaounde->afficherRueYaoundeSVG();


class RouteNationale {


/*7.Tracé Route_Nationale*/
public function afficherRouteNationaleSVG(){
echo "\n".'<g id="Route_Nationale" style="display:inline;">';
echo "\n";

$req8="SELECT * FROM 'tblroute_nationale'";
$queryRoute_Nationale=mysql_query($req8); //requête MySQL

while($row=mysql_fetch_assoc($queryRoute_Nationale))
{
$idRoute_Nationale=$row["IdRoute_Nationale"];
$geometry=$row["SVG_Geom"];
$Origine=$row["N_Origine"];
$ShapeLength=$row["Shape_Length"];
$Allinfo=$Origine.'#'.$ShapeLength;
echo "\n".'<g id="Route_Nationale_'.$idRoute_Nationale.'"'.' infotext="Route Nationale: '.$Allinfo.'" onclick="showdetail('."'Route_Nationale_".$idRoute_Nationale."'".')" onmouseover="mouseover('."'".'Route_Nationale_'.$idRoute_Nationale."'".');setToolTipText2()"'.' onmouseout ="mouseout ('."'".'Route_Nationale_'.$idRoute_Nationale."'".');clearToolTipText()"'.' style="fill:none;opacity:1;stroke-linejoin:round;stroke:#0000FF;stroke-width:20px;">';
echo "\n".$geometry."\n";
echo '</g>'."\n";
}
echo ' </g>'."\n";

}

}

$route=new RouteNationale();
$route->afficherRouteNationaleSVG();


class Equipement{

public function afficherEquipementOrangeSVG(){

echo "\n".'<g id="Eqpt_Orange" style="display:inline;" transform="translate(0,0) scale(1)">';
echo "\n";

$req1="SELECT * FROM 'pops'";
$queryRingo=mysql_query($req1); //requ�te MySQL

while($row=mysql_fetch_assoc($queryRingo))
{
$nom_pop=$row["nom_pop"];
$latitude=$row["dlat_pop"];
$longitude=$row["dlon_pop"];
$type=$row["type_pop"];
$cx=$row["CX_pop"];
$cy=$row["CY_pop"];
$Allinfo=$nom_pop.'#'.$latitude.'#'.$longitude.'#'.$type;
echo "\n".'<g id="Eqpt_Orange_'.$nom_pop.'"'.' infotext="'.'pop ringo: '.$Allinfo.'"'.' onclick="showdetail('."'Eqpt_Orange_".$nom_pop."'".')" onmouseover="mouseover('."'".'Eqpt_Orange_'.$nom_pop."'".');setToolTipText2('."'black'".')"'.' onmouseout ="mouseout ('."'".'Eqpt_Orange_'.$nom_pop."'".');clearToolTipText()"'.' transform="translate('.$cx.','.$cy.') scale(30,40)">';
echo "\n".'<use x="-3" y="-10.5" width="6" height="11" xlink:href="#Eqpt_Orange_Symbol" />'."\n";
echo '</g>'."\n";
}
echo ' </g>'."\n";

}

}

$orange=new Equipement();
$orange->afficherEquipementOrangeSVG();




class nEquipement{

public function affichernEquipementOrangeSVG(){

echo "\n".'<g id="Sante" style="display:inline;" transform="translate(0,0) scale(1)">';
echo "\n";

$req1="SELECT * FROM 'new_pops' ";
$queryRingo=mysql_query($req1); //requ�te MySQL

while($row=mysql_fetch_assoc($queryRingo))
{
$id_npop=$row["id_npop"];
$latitude=$row["lat_npop"];
$longitude=$row["lon_npop"];
$cx=$row["CX_npop"];
$cy=$row["CY_npop"];
$Allinfo=$id_npop.'#'.$latitude.'#'.$longitude;
echo "\n".'<g id="Sante_'.$id_npop.'"'.' infotext="'.'pop ringo: '.$Allinfo.'"'.' onclick="showdetail('."'Sante_".$id_npop."'".')" onmouseover="mouseover('."'".'Sante_'.$id_npop."'".');setToolTipText2('."'black'".')"'.' onmouseout ="mouseout ('."'".'Sante_'.$id_npop."'".');clearToolTipText()"'.' transform="translate('.$cx.','.$cy.') scale(30,40)">';
echo "\n".'<use x="-3" y="-10.5" width="9" height="20" xlink:href="#Sante_Symbol" />'."\n";
echo '</g>'."\n";
}
echo ' </g>'."\n";

}

}

$nringo=new nEquipement();
$nringo->affichernEquipementOrangeSVG();



/*$req1="DELETE * FROM 'new_pops' ";
$queryRingo=mysql_query($req1);*/

class Carrefour{

/*20.Trac� Carrefour*/
public function afficherCarrefourSVG(){

echo "\n".'<g id="carrefours" style="display:inline;">';
echo "\n";

$req20="SELECT * FROM 'tblcarrefour'";

try{

$queryCarrefour=mysql_query($req20); //requ�te MySQL

//echo "La requête est bien passée ++++";

while($row=mysql_fetch_assoc($queryCarrefour))
{
$idCarrefour=$row["IdCarrefour"];
$Cx=$row["Cx"];
$Cy=$row["Cy"];
$Nom=$row["Nom"];
$Longitude=$row["Longitude"];
$Latitude=$row["Latitude"];
$Altitude=$row["Altitude"];

$Allinfo=$Nom.'#'.$Longitude.'#'.$Latitude.'#'.$Altitude;

echo "\n".'<g id="carrefours_'.$idCarrefour.'"'.' infotext="Carrefour: '.$Allinfo.'"'.' onclick="showdetail('."'carrefours_".$idCarrefour."'".')" onmouseover="mouseover('."'".'carrefours_'.$idCarrefour."'".');setToolTipText2('."'black'".')"'.' onmouseout ="mouseout ('."'".'carrefours_'.$idCarrefour."'".');clearToolTipText()"'.' transform="translate('.$Cx.','.$Cy.') scale(1.12797)">';
echo "\n".'<use x="0" y="0" width="50" height="50" xlink:href="#carrefours_Symbol" />'."\n";
echo '</g>'."\n";
}
echo ' </g>'."\n";

}catch(SQLException $e){

}

}

}

/*20.Tracé Carrefour*/


class Carrefour_1{

/*20.Trac� Carrefour*/
public function afficherCarrefourSVG_1(){

echo "\n".'<g id="carrefours2" style="display:inline;">';
echo "\n";

$req20="SELECT * FROM 'tblcarrefour_yde'";

try{

$queryCarrefour=mysql_query($req20); //requ�te MySQL

//echo "La requête est bien passée ++++";

while($row=mysql_fetch_assoc($queryCarrefour))
{
$idCarrefour=$row["IdCarrefour"];
$Cx=$row["Cx"];
$Cy=$row["Cy"];
$Nom=$row["Nom"];
$Longitude=$row["Longitude"];
$Latitude=$row["Latitude"];
$Altitude=$row["Altitude"];


$Allinfo=$Nom.'#'.$Longitude.'#'.$Latitude.'#'.$Altitude;

echo "\n".'<g id="carrefours2_'.$idCarrefour.'"'.' infotext="Carrefour: '.$Allinfo.'"'.' onclick="showdetail('."'carrefours2_". $idCarrefour."'".')" onmouseover="mouseover('."'".'carrefours2_'.$idCarrefour."'".');setToolTipText2('."'black'".')"'.' onmouseout ="mouseout ('."'".'carrefours2_'.$idCarrefour."'".');clearToolTipText()"'.' transform="translate('.$Cx.','.$Cy.') scale(1.12797)">';
echo "\n".'<use x="0" y="0" width="50" height="50" xlink:href="#carrefours_Symbol" />'."\n";
echo '</g>'."\n";

}
echo ' </g>'."\n";

}catch(SQLException $e){

}

}

}

$carrefour_1=new Carrefour_1();
$carrefour_1->afficherCarrefourSVG_1();





echo '<g id="tooltips">
<rect id="tooltiprect" x="0" y="0" width="0" height="0" style="visibility:hidden;fill:rgb(0,0,0);stroke-width:1; stroke:rgb(0,0,128);opacity:1;pointer-events:none"></rect>

<text x="5pt" y="95%" id="tooltip" pointer-events="none" style="font-family:'."'Arial'".';font-weight:bold; font-size:250; text-anchor:left; fill:black ;visibility:visible;text-rendering:optimizeSpeed"> </text>
</g>'."\n";

echo '<g id="DistanceTool">
<line id="trait" x1="0" y1="0" x2="0" y2="0" stroke="black" stroke-width="20" />
</g>';

echo '</svg>';

// VARIABLES DE CONNEXION

$table_a_vider1 = 'pointfreq';
$table_a_vider2 = 'new_pops'; // Nom de la table que tu veux vider

// ON SE CONNECTE ET ON SELECTIONNE LA BASE

function vider_table($table_a_vider){
$sql = "TRUNCATE TABLE ".$table_a_vider;
mysql_query($sql);
}
voici le code complet et je suis sous php 1.8
// ON VIDE $table_a_vider
vider_table($table_a_vider1);
vider_table($table_a_vider2);
?>
0
PHP combien ? 1.8 ? c'est une plaisanterie ?
La dernière version est 5.3 quelque chose...
0
Utilisateur anonyme
5 sept. 2011 à 14:20
Je n'ai toujours pas d'erreur sur ce code
0