if ($operacion == "borrar") { $teatro = new teatro(); $teatro->del_teatro($id); //$teatro->_teatro(); } else { if ($operacion == "buscar") { $teatro = new teatro(); $teatro->mostrarBusqueda($_POST['busqueda']); // $teatro->_teatro(); } } } } echo "<CENTER><P>\n\t <TABLE border='0' width='600'>\n\t <TR>\n\t <TD valign=top align=CENTER colspan=2>\n\t \t<FORM name='form1' METHOD='POST' ACTION='index2.php?operacion=buscar'>\n\t \t <b>Buscar teatro</b>"; if (!isset($busqueda)) { $busqueda = ""; } echo "<INPUT TYPE='TEXT' NAME='busqueda' value='{$busqueda}' size='20'> "; echo "<INPUT TYPE='SUBMIT' NAME='boton_buscar' VALUE='¡Buscar!'>\n\t \t</FORM>\n\t </TD></TR>\n\n\t <TR><TD align=right>\n\t <FORM name='form2' METHOD='POST' ACTION='index2.php?operacion=introducir'>\n\t <INPUT TYPE='SUBMIT' NAME='alta' VALUE='Nuevo teatro'>\n\t </FORM>\n\t </TD>\n\t <TD width=100 align=left>\n\t <FORM name='form3' METHOD='POST' ACTION='index2.php?operacion=listado'>\n\t <INPUT TYPE='SUBMIT' NAME='alta' VALUE='Listado completo'>\n\t </FORM>\n\t </TD>\n\t <TD align=right>\n\t <FORM name='editar' METHOD='POST' ACTION='perfil.php'>\n\t <INPUT TYPE='SUBMIT' NAME='editar' VALUE='Editar perfil'>\n\t </FORM>\n\t </TD>\n\t </TR></TABLE>"; $teatro = new teatro(); $nObras = $teatro->nume_obras(); echo "\n\t <table border='0' width='800' >\n\t <tr> <td bgcolor='green' width ='150'align='center'><font color='FFFFFF' bgcolor='green'> Nombre teatro </font></td>\n\t <td bgcolor='green' width='150'align='center'><font color='FFFFFF' bgcolor='green' > Obra </font> </td>\n\t <td bgcolor='green' width='250'align='center'><font color='FFFFFF' bgcolor='green'> Descripción</font> </td>\n\t <td bgcolor='green' width='250'align='center'><font color='FFFFFF' bgcolor='green'> Operaciones </font></td></tr>"; $lista = $teatro->listar(); while ($row = mysql_fetch_row($lista)) { echo "\n\t <tr> <td> <b>{$row['1']}</b> </td><td> <b> {$row['2']}</b> </td><td><b>{$row['3']}</b> </td><td > <table border='0' width='100''> <center>\n\t <tr><td><form name='form4' method='post' action='consulta.php?bus={$row['2']}'>\n\t <input type='submit' name= 'consulta'style=' color:green;font-weight:bold;text-decoration:underline' value='Consulta'> </form></td>\n\t <td><form name='form5' method='post' action='editar.php?bus={$row['2']}'>\n\t <input type='submit' name= 'editar' style=' color:green;font-weight:bold;text-decoration:underline' value='Editar'> </form></td>\n\t <td><form name='form6' method='post' action='comprar.php?bus={$row['2']}'>\n\t <input type='submit' name= 'comprar' style=' color:green;font-weight:bold;text-decoration:underline' value='Comprar'> </form> </td> \n\t <td> <form name='form7' method='post' action='index2.php?operacion=borrar&id={$row['0']}'>\n\t <input type='submit' name='borrar' style=' color:green ; font-weight:bold;text-decoration:underline'value='Borrar' > </form></td></tr> </center> </table> </td></tr>\n\t "; } echo "</table>\n\t <FONT COLOR= 'green'>El nº total de obras es : {$nObras} </FONT></CENTER>\n\t "; $teatro->_teatro(); ?> </BODY> </HTML>