Código PHP:
<?
// Definimos que vamos a usar sesiones en este archivo
session_start();
include("funcion_bd.php");
?>
<html>
<head>
<title>Datos Empresas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
.Estilo18 {color: #FF9900}
-->
</style>
</head>
<body bgcolor="#D1D1D1">
<img src="http://www.forosdelweb.com/f18/imagenes/titutlo2.jpg" align="left"/>
<div align="right">
<div id='c_recherche' >
<form method="POST" action="../buscar.php">
<div id='boutonRecherche'><input type='image' src="../imagenes/w_lupa.gif" title="Aceptar" alt="Aceptar" ></div>
<div id='champRecherche'><span class="Estilo14">Buscar cliente </span>
<input size='15' type='text' name='empresa' value='Buscar Cliente' onFocus="this.value='';" ></div>
</form>
<table width="210"><tr><td width="48"><span class="Estilo14">Cliente: </span></td>
<td width="150">
<span class="Estilo18"><?
echo $_SESSION[nombre_empresa];
echo '</span></td>
</tr><tr><td>Estás en:</td><td><strong> BASE DE DATOS</strong></td></tr></table>
</div></div>
<span style="position: absolute; left: 59px; top: 49px; width: 511px; height: 10px; z-index: 5">
';
$codigo=$_SESSION[codigo_empresa];
$bd=$_GET[bd];
$note_change=$_GET[note_change];
if($bd<>null or !note_change!=null)
{ echo '<a href="bd.php">Ir a Base de Datos</a>'; }
else {
echo '<a href="bd.php?bd=1">Añadir Nueva Base de Datos</a>'; }
echo'
<a href="bd.php?bd=change">Modificar Base de Datos</a>
<a href="bd.php?bd=delete">Borrar Base de Datos</a>
</span>
<br><br>';
//Pagina WEB. -------- PARTE PRINCIPAL -----------
//PARTE NUEVA BASE DE DATOS ------------------------------------------------------------------------------------------------
if($bd==1)
{
include("../conec.php");
$link=conectarse(foro);
echo '<div id="Layer1" style="position: absolute; left: 25px; top: 85px; width: 1200px; height: 21px; z-index: 1; vertical-align: middle"><br>';
echo '<table><tr><td>';
echo'<table cellpadding=0 cellspacing=0><tr bgcolor=#FFFFFF>
<form method="POST" action="bd_1.php">
<tr><td bgcolor=#FFFFFF><center><strong> Descripción de B.D. </td><td><input type="text" name="descripcion_bd" size="20" maxlength="15"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Nombre Servidor </td><td>';
$lista=mysql_query("select * from i_servidores WHERE codigo_empresa like'$codigo' order by nombre_servidor", $link);
$lista1=mysql_query("select * from i_maquina WHERE codigo_empresa like'$codigo' order by nmaquina", $link);
//SELECCIONAMOS EL SERVIDOR U ORDENADOR
echo "<select name=nombre_servidor[]>
<option>--- SERVIDORES ---</option>";
while($row=mysql_fetch_array($lista)){
echo "<option value='".$row['nombre_servidor'],"'>",$row['nombre_servidor'],"</option>"; }
echo "<option>--- ORDENADORES ---</option>";
while($row1=mysql_fetch_array($lista1)){
echo "<option value='".$row1['nmaquina'],"'>",$row1['nmaquina'],"</option>"; }
echo'</select></td>
</tr><tr><td bgcolor=#FFFFFF><strong> B.D en </td><td><input type="text" name="bd_en" size="20" maxlength="15"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Nombre B.D. </td><td><input type="text" name="nombre_bd" size="20" maxlength="10"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Tamaño y Fecha </td><td><input type="text" name="tamaño_fecha" size="20" maxlength="20"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Ruta B.D. </td><td><input type="text" name="ruta_bd" size="20" maxlength="40"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Ruta Backup </td><td><input type="text" name="ruta_backup" size="20" maxlength="40"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Nombre Backup </td><td><input type="text" name="nombre_backup" size="20" maxlength="10"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Hora Backup </td><td><input type="text" name="hora_backup" size="20" maxlength="10"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Usuario </td><td><input type="text" name="usuario" size="20" maxlength="15"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> Password </td><td><input type="text" name="password" size="20" maxlength="15"></td>
</tr><tr><td bgcolor=#FFFFFF><strong> S </td><td><input name=tipo_S type=checkbox value=1></td>
</tr><tr><td bgcolor=#FFFFFF><strong> M </td><td><input name=tipo_M type=checkbox value=2></td>
</table><input type="hidden" name="comprobacion_new" value="1">';
echo '<div id="Layer1" style="position: absolute; left: 2px; top: 290px; width: 1200px; height: 21px; z-index: 1; vertical-align: middle">';
echo "<table width=214 border=1 cellpadding=0 cellspacing=0>
<tr bgcolor=#FFFFFF>
<td><center><strong>Notas</strong></center></td></tr>
<tr><td colspan=1 height=27><textarea name=notas cols=55 rows=15></textarea></td>
</tr>
</table>";
echo'<div id="Layer1" style="position: absolute; left: 188px; top: 250px; width: 1200px; height: 21px; z-index: 1; vertical-align: middle">
<input type="submit" value="Aceptar"></div></form>';
echo '</div>';
}
//PARTE DE MODIFICAR --------------------------------------------------------------------------------------------------------------
elseif($bd=="change" or $note_change!=null)
{
echo tabla_bd_change();
}
//PARTE DE BORRAR BASE DE DATOS------------------------------------------------------------------------------------------------------
elseif($bd=="delete")
{
echo tabla_bd_delete();
}else {
//LISTA DE BASES DE DATOS -------------------------------------
echo tabla_bd_1();
}
echo '</table>';
echo '</td><td> </td></tr></table></div>';
echo '</body></html>';
//insertamos la pagina inicio.php para que salgan los menus
include("iniciosoftware.php");
?>