PHP Classes

File: ejemplo.php

Recommend this page to a friend!
  Classes of Oscar Miranda   Malla   ejemplo.php   Download  
File: ejemplo.php
Role: Example script
Content type: text/plain
Description: example
Class: Malla
Draw entity-relationship diagram images
Author: By
Last change: change class name
Date: 19 years ago
Size: 2,138 bytes
 

Contents

Class file image Download
<?PHP
include("entidad_img.inc.php");

$image = imagecreate(800, 600);

// fill the background color
$bg = imagecolorallocate($image, 255,255,255);

// choose a color for the ellipse
$prueba[0] = new entidad_img($image,250,100);
$prueba[0]->tipo=2;
$prueba[0]->texto="FLAMINGO";
$prueba[0]->url="http//:flamingo.uis.edu.co";
$prueba[0]->graficar_entidad();


$prueba[1] = new entidad_img($image,400,10);
$prueba[1]->texto="CIDLIS";
$prueba[1]->url="http://www.cidlisuis.org";
$prueba[1]->graficar_entidad();

$prueba[2] = new entidad_img($image,125,25);
$prueba[2]->texto="UIS";
$prueba[2]->url="http://www.uis.edu.co";
$prueba[2]->graficar_entidad();


$prueba[3] = new entidad_img($image,400,150);
$prueba[3]->texto="EISI";
$prueba[3]->url="http://www.sistemas.uis.edu.co";
$prueba[3]->graficar_entidad();

$prueba[4] = new entidad_img($image,20,150);
$prueba[4]->texto="ELECTRONICA";
$prueba[4]->url="http://www.eiiesi.uis.edu.co";
$prueba[4]->graficar_entidad();



// CREACIÓN DE LAS RELACIONES
$prueba[0]->agregar_relacion($prueba[1],"depende de ..");
$prueba[0]->agregar_relacion($prueba[2],"para");
$prueba[0]->graficar_relaciones();

$prueba[1]->agregar_relacion($prueba[2],"es");
$prueba[1]->graficar_relaciones();


$prueba[3]->agregar_relacion($prueba[0],"parte de...");
$prueba[3]->graficar_relaciones();

$prueba[4]->agregar_relacion($prueba[0]);
$prueba[4]->graficar_relaciones();

imagejpeg($image,"tmp/imagen.gif");

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<img src="tmp/imagen.gif" usemap="#Map" border="0">
<map name="Map">
 <?php
    
foreach($prueba as $una_prueba){
        
$finx=$una_prueba->posx+$una_prueba->ancho;
        
$finy=$una_prueba->posy+$una_prueba->alto;
         echo
"<area shape='rect' coords='{$una_prueba->posx} ,{$una_prueba->posy},{$finx},{$finy}' href='{$una_prueba->url}'>\n";
     }
 
?>
</map>
<br>

<body>
</body>
</html>