Ojala me puedan ayudar, de antemano muchas gracias
Código:
[code]
<html>
<head>
<script type="text/javascript" src="js/raphael-min.js"></script>
<script type="text/javascript" src="js/dracula_graffle.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/dracula_graph.js"></script>
</head>
<body>
<?PHP
$link=mysql_connect("localhost", "root", "");
mysql_select_db("metrobus", $link);
//$result=mysql_query("select nombre from parada", $link);
$result=mysql_query("select parada.nombre as origen, est.nombre as destino from parada, parada as est, adyacencias where parada.id=adyacencias.origen and est.id=adyacencias.destino;", $link);
$i=0;
$ao=array();
$ad=array();
while($row=mysql_fetch_array($result))
{
$ao[$i]=$row['origen'];
$ad[$i]=$row['destino'];
//echo"$o[$i]";
//echo"<br>$d[$i]<br>";
$i++;
}
mysql_close($link);
?>
<script>
var g, render, redraw, j=0;
var i = "<?php echo $i?>";
var origen= new Array();
var destino= new Array();
origen = "<?php echo $ao;?>";
origen = "<?php echo $ao;?>";
window.onload = function()
{
g = new Graph();
for (j = 0 ; j < i ; j++)
g.addEdge(origen[j], origen[j]);
layouter = new Graph.Layout.Spring(g);
layouter.layout();
renderer = new Graph.Renderer.Raphael('canvas', g, 600, 300);
redraw = function() {
layouter.layout();
renderer.draw();
};
}
</script>
<div id="canvas"></div>
<button id="redraw" onclick="redraw();">Repintar</button>
</body>
</html>