Código PHP:
Ver original<?php
function Conectarse()
{
{
echo "Error conectando a la base de datos.";
}
{
echo "Error seleccionando la base de datos.";
}
return $link;
}
$link=Conectarse();
$puntos = "";
$sql="select * from lotes";
$libre="fill:#0080C0;stroke:black;stroke-width:0.5; opacity:0.3;";
$apartado="fill:yellow;stroke:black;stroke-width:1; opacity:0.3;";
$vendido="fill:red;stroke:black;stroke-width:1; opacity:0.3;";
$class="Libre";
$points[1]="145,258,195,249,198,264,191,269,149,275";
$points[2]="142,240,163,236,192,232,195,249,145,258";
$points[3]="138,222,159,218,188,214,191,231,141,240";
$points[4]="135,205,156,201,185,197,188,214,138,223";
$points[5]="134,205,131,191,182,182,184,193,184,196";
$points[6]="132,192,129,178,180,169,182,180,182,183";
$points[7]="130,179,127,165,176,156,178,167,178,170";
$points[8]="127,165,124,153,175,144,177,154,177,156";
$points[9]="124,153,121,141,172,132,174,142,174,144";
$points[10]="121,140,118,128,169,119,171,129,171,132";
$points[11]="118,128,115,115,166,107,168,117,168,120";
$points[12]="115,116,107,76,167,93,166,100,167,107";
$points[13]="109,76,138,52,188,87,176,88,168,95";
$points[14]="185,120,197,105,191,89,221,111,191,150";
$points[15]="194,159,192,152,221,112,236,123,203,168";
$points[16]="203,167,237,124,251,134,218,178";
$points[17]="218,178,252,134,265,145,232,188";
$points[18]="233,188,266,145,282,155,248,200";
$points[19]="249,200,282,156,295,166,264,210";
$points[20]="264,210,296,167,311,177,278,220";
$points[21]="278,220,310,177,326,188,294,231";
$points[22]="293,232,326,188,341,198,309,242";
$points[23]="309,243,342,199,354,208,320,251";
$points[24]="320,252,354,208,367,216,334,260";
$points[25]="334,261,367,216,378,225,346,269";
$points[26]="345,269,378,225,390,234,356,278";
$points[27]="357,277,390,233,402,242,369,285";
$points[28]="369,285,402,242,416,252,392,286";
$points[29]="392,286,417,252,431,263,415,285";
$points[30]="522,354,506,330,511,323,513,321,558,354";
$points[31]="487,353,486,321,496,332,505,330,521,353";
$points[32]="468,353,467,305,472,309,487,321,487,353";
$points[33]="454,354,454,300,462,301,465,304,467,353";
$points[34]="440,302,454,302,454,355,441,355";
$points[35]="427,302,440,302,441,355,427,355";
$points[36]="414,302,427,302,427,355,414,355";
$points[37]="401,302,414,302,414,355,401,355";
$points[38]="389,302,401,302,401,355,389,355";
$points[39]="376,301,390,301,390,355,376,355";
$points[40]="358,301,377,301,377,355,358,355";
$points[41]="340,301,358,301,358,355,340,355";
$points[42]="321,301,340,301,340,355,321,355";
$points[43]="302,301,321,301,321,355,302,355";
$points[44]="284,301,302,301,302,355,284,355";
$points[45]="266,300,284,300,284,355,266,355";
$points[46]="247,300,266,300,266,355,247,355";
$points[47]="228,300,247,300,247,355,228,355";
$points[48]="209,300,228,300,228,355,210,355";
$points[49]="193,300,209,300,210,355,194,355";
$points[50]="180,300,194,298,193,353,198,366,179,366";
$points[51]="165,305,179,301,179,355,178,366,166,365";
$points[52]="151,310,165,306,165,360,165,366,152,366";
?>
<style>
polygon:hover { fill:#804040; opacity:0.5; }
circle:hover { fill:#804040; opacity:0.5; }
polygon.Libre{
fill:#0080C0;stroke:black;stroke-width:0.5; opacity:0.3;
}
polygon.Libre:hover{ fill:#5B060F;stroke:black;stroke-width:0.5; opacity:0.3; }
rect.Libre{
fill:#0080C0;stroke:black;stroke-width:0.5; opacity:0.3;
}
rect.Libre:hover{ fill:#5B060F;stroke:black;stroke-width:0.5; opacity:0.3; }
polygon.Apartado{
fill:yellow;stroke:black;stroke-width:1; opacity:0.3;
}
polygon.Apartado:hover{ fill:#5B060F;stroke:black;stroke-width:1; opacity:0.3; }
rect.Apartado{
fill:yellow;stroke:black;stroke-width:1; opacity:0.3;
}
rect.Apartado:hover{ fill:#5B060F;stroke:black;stroke-width:1; opacity:0.3; }
polygon.Vendido{
fill:red;stroke:black;stroke-width:1; opacity:0.3;
}
polygon.Vendido:hover{ fill:#5B060F;stroke:black;stroke-width:1; opacity:0.3; }
rect.Vendido{
fill:red;stroke:black;stroke-width:1; opacity:0.3;
}
rect.Vendido:hover{ fill:#5B060F;stroke:black;stroke-width:1; opacity:0.3; }
</style>
<html>
<div id="mapa" style="position: absolute; left: 350px; top: 80px;z-index: 1; background-color:#FFFFFF;"><center><img src="sembrado.png" width="625" height="510" alt="" border="0"></center></div>
<div id="svgmapa" style="position: absolute; left: 350px; top: 80px;z-index: 2">
<svg height="800" width="600">
<a xlink:href="#" xlink:title="AREAS VERDES"><polygon points="219,284,319,285,325,279,322,272,216,193,208,193,201,198" stroke="black" stroke-linejoin="round" stroke-width="2" fill="#349A4B" style="opacity:0.8;"/></a>
<a xlink:href="#" xlink:title="AREA DE JUEGOS INFANTILES"><circle cx="227" cy="227" r="11" stroke="black" stroke-width="2" fill="#FF0080" style="opacity:0.6;" /></a>
<a xlink:href="#" xlink:title="AREA DE GIMNASIO MIXTO"><polygon points="258,269,265,277,274,269,267,261" stroke=" black" stroke-width="2" fill="#205CCC" style="opacity:0.8;"/></a>
<?php
$puntos=$points[ $row['lote'] ];
?>
<a xlink:href="#" xlink:title='Lote <?php echo $row['lote'];?>
Frente: <?php echo $row['frente'];?>m
Fondo: <?php echo $row['fondo'];?>m
Superficie: <?php echo$row['m2'];?>m2'><polygon class='<?php echo $class;?>' id=<?php echo $row['lote'];?> points='<?php print($puntos);?>' /></a>
<?php
}
?>
</svg>
</div>