Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Man</title> <link href="estilos/estilos.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- body { background-color: #CCCCCC; } --> </style> </head> <body> <body> <table width="737" height="500" border="0" align="center" bordercolor="#CCCCCC"> <tr> <td colspan="3"> <?php include("headercomun.php"); ?> </td> </tr> <tr> <td width="112" bordercolor="#333333" bgcolor="#999999"> </td> <td width="490" rowspan="2" valign="top" bgcolor="#CCCCCC"><table width="482" border="0"> <tr> <th width="470" scope="row"><div align="left"><span class="style14">Catálogo de Estatus</span></div></th> </tr> </table> <table width="482" height="151" border="0"> <tr> <th width="11" scope="row"><span class="style11"></span></th> <td width="139"><div align="right" class="style12"><span class="style1">Estatus</span></div></td> <td width="300"><div align="left" class="style11"> <input name="estatus" type="text" id="estatus" /> </div></td> <td width="14"><span class="style11"></span></td> </tr> <tr> <th scope="row"><span class="style11"></span></th> <td><div align="right" class="style12">Descripción</div></td> <td> <textarea name="descripcion" id="descripcion" cols="45" rows="5"></textarea> </form> </td> <td><span class="style11"></span></td> </tr> <tr> <th colspan="4" scope="row"><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span><span class="style11"></span></th> </tr> <tr> <th scope="row"><span class="style11"></span></th> <td colspan="2"> </td> <td><span class="style11"></span></td> </tr> <tr> <th scope="row"> </th> <td> </td> <td> <input type="submit" value="Modificar" /><form action="Cat_estatus.php" method="post"> </span> <span class="style32 style1"> <input type="submit" value="Eliminar" /><form action="Cat_estatus.php" method="post"> </span> <span class="style32 style1"> <input type="submit" value="Agregar" /><form action="Cat_estatus.php" method="post"> </span> </form></td> <td></td> </tr> </table> <p class="style32 style1"> </p> <p class="style31 style1"> <span class="style1"></span> <td width="121" height="124" colspan="2" valign="middle" bgcolor="#999999"> <tr bgcolor="#333333"> <td width="112" bordercolor="#CCCCCC" bgcolor="#999999"> </td> <td height="169" colspan="2" align="center" valign="middle" bgcolor="#999999"> </tr> <tr> <td height="23" colspan="4" bgcolor="#999999"><div align="center" class="style7">Derechos reservados</div></td> </tr> </table> </body> </html> <?php include("MySQLBD.php"); class Estatus { var $_estatus; var $_descripcion; var $conn; public function __construct() { $this->conn = new MySqlBD(); $this->conn->Open(); } function SetEstatus( $st ) { $this->_estatus = $st; } function GetEstatus() { return $this->_estatus; } function SetDescripcion( $desc ) { $this->_descripcion = $desc; } function GetDescripcion() { return $this->_descripcion; } function InsertaRegistro() { $query="INSERT INTO estatus (estatus, descripcion) VALUES ('$this->_estatus','$this->_descripcion')"; //echo "$query"; $this->conn->EjecutaTransaccion( $query ); } function ModificaRegistro() { $query="UPDATE estatus SET descripcion = '$this->_descripcion' WHERE estatus = '$this->_estatus'"; $this->conn->EjecutaTransaccion( $query ); } function EliminaRegistro() { $query="DELETE FROM estatus WHERE estatus = '$this->_estatus'"; $this->conn->EjecutaTransaccion( $query ); } function DespliegaInfo( $maxrows ) { $query="SELECT * FROM estatus"; $result = $this->conn->ExecuteSQL( $query, $maxrows ); echo "$result"; } public function __destruct() { $this->conn->Close(); } } ?>