Está en la página 1de 14

CENTRO DE ESTUDIOS TECNOLOGICOS INDUSTRIAL Y DE SERVICIOS No.

50

BASE DE DATOS

SISTEMA DE CONTROL DE PRODUCTOS

SAETI

ALUMNO:

__________________________________

05 DE OCTUBRE DE 2012. ESTRUCTURA DE LA BASE DE DATOS NOMBRE DE LA BASE DE DATOS: ControlProd Nombre de la Tabla de Datos: tipoproducto PK=primary key TIPOPRODUCTO PK Id_prod int Nomprod char 20 2

Nombre de la Tabla de Datos: productos

PK=primary key PRODUCTOS CAMPOS TIPO DE PK codigo Nomprod Char Marca Char Tipoprod Fabricante Correo char CONEX.PHP <?php function Connectto() { if (!($link=mysql_connect("localhost","root",""))) { echo "Error Coneccion a la Base de Datos . . ."; exit(); } if (!mysql_select_db("ControlProd",$link)) { echo "Select Error . . ."; exit(); } return $link; } ?> DATOS int 30 20 Int Char 35 TAMA O 3 2 30

INICIO.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Documento sin t&iacute;tulo</title> </head> <body bgcolor="#000000"> <marquee behavior="alternate" direction="left" bgcolor="#000000"> <font face="Arial" color="#FFFFFF" size="+4">CONTROL DE BIBLIOTECA</font></marqu ee> <hr size="3" color="#000099" noshade><br/> <font face="Arial"size="+3" color="#FFFFFF"> <center> <a href="captipoprod.php"><h2>ALTAS DE PRODUCTOS</h2></a> <a href="elitipoprod.php"><h2>BAJAS DE PRODUCTOS</h2></a> <a href="moditipoprod.php"><h2>MODIFICAR DATOS DE PRODUCTOS</h2></a> <a href="captipoprod.php"><h2>ALTAS DE TIPO DE PRODUCTOS</h2></a> <a href="elittipoprod.php"><h2>BAJAS DE TIPO DE PRODUCTOS</h2></a> <a href="moditipoprod.php"><h2>MODIFICAR DATOS DE TIPO DE PRODUCTOS</h2></a> </center></font> <br /><br /><hr size="3" color="#FF0000" noshade> </body>

</html> CAPTIPOPROD.PHP <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Control de productos</title> </head> <body bgcolor="#006666"> <center> <font face="Arial" size="5"> <table><tr> <td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Altas</font></td> <td>|</td> <td class="PestanaPorDefecto"><a href="elitipoprod.php">Bajas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="moditipoprod.php">Modificaciones</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="mostipoprod.php">Mostrar Registros</a></t d> </tr> </table> </font> </center> <br/> <br/> <marquee behavior="alternate" direction="left" bgcolor="#66CCFF"><font face="Ari al" color="#FFFFFF" size="5"> <h1>Introducir Datos</h1></font></marquee><br/> <hr size="3" color="#000099" noshade><br/><br/> <center> <form action="insertar_tipoprod.php"> <b><font face="Arial" size="4" color="#FFFFFF"><table> <tr> <td width="185"><span class="Estilo4">Clave Tipo de Producto:</span></td > <td width="180"><input type="text" name="id_prod" size="2" maxlength="2" ></td> </tr> <tr> <td><span class="Estilo4">Tipo de producto:</span></td> <td><input type="text" name="tipoprod" size="20" maxlength="20"></td> </tr> </table> </font></b> <input type="submit" name="accion" value="Guardar Datos"> </form></center> <center> </center> <hr size="3" color="#000099" noshade> </body> </html> INSERTAR_TIPOPROD.PHP <?php

include("conex.php"); $link=Connectto(); $id_prod=$_GET['id_prod']; $tipoprod=$_GET['nomprod']; mysql_query("Insert into tipoproducto (id_prod, nomprod) values('$id_pro d', '$nomprod')", $link); header("location:captipoprod.php") ?> ELITIPOPROD.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Control de Productos</title> </head> <body bgcolor="#000000"> <center> <font face="Arial" size="5"> <table><tr> <td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="captipoprod.php">Altas</a></td> <td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Bajas</font></td> <td>|</td> <td class="PestanaPorDefecto"><a href="modtipoprod.php">Modificaciones</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="mostipoprod.php">Mostrar Registros</a></t d> </tr> </table> </font> </center> <br/> <br/> <marquee behavior="alternate" direction="left" bgcolor="#000000"><font face="Ari al" color="#FFFFFF" size="6"> <h1>Eliminar Registros</h1></font></marquee><br/> <hr size="3" color="#000099" noshade> <?php include("conex.php"); $link=Connectto(); $result=mysql_query("select * from genero",$link); ?> <font face="Arial" color="#FFFFFF" size="4"> <div align="center" class="Estilo4"> <TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3> <TR> <TD><span class="Estilo4">&nbsp;Clave del Tipo de Producto</span></TD> <TD><span class="Estilo4">&nbsp;Tipo de Producto</span></TD> </TR>

<?php while($row = mysql_fetch_array($result)) { printf(" <tr> <td>&nbsp;%s</td> <td>&nbsp;%s&nbsp;</td> <td><a href=\"eliminar_gen.php?id_prod=%s\">Eliminar</a></td> </tr> ", $row["id_prod"], $row["nomprod"], $row["id_prod"] ); } mysql_free_result($result); mysql_close($link); ?> </table> </div> </font> </center> <td>&nbsp;</td> <hr size="3" color="#FF0000" noshade> </body> </html> ELIMINAR_TIPOPROD.PHP <?php include("conex.php"); $link=Connectto(); $id_prod=$_GET['id_prod']; mysql_query("delete from tipoproducto where id_prod= '$id_prod'",$link); header("location: Elitipoprod.php"); ?> MODITIPOPROD.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Control de Productos</title> </head> <body bgcolor="#000000"> <center> <font face="Arial" size="5"> <table><tr> <td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="captipoprod.php">Altas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="elitipoprod.php">Bajas</a></td> <td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Modificaciones</font></td>

<td>|</td> <td class="PestanaPorDefecto"><a href="mostipoprod.php">Mostrar Registros</a></t d> </tr> </table> </font> </center> <br/> <br/> <marquee behavior="alternate" direction="left" bgcolor="#000000"><font face="Ari al" color="#FFFFFF" size="6"> <h1>Modificar Registros</h1></font></marquee><br/> <hr size="3" color="#000099" noshade><br/><br/> <center> <form action="modificar_tipoprod.php"> <b><font face="Arial" size="4" color="#FFFFFF"><table> <tr> <td width="185"><span class="Estilo4">Clave de Tipo Producto:</span></td > <td width="180"><input type="text" name="id_prod" size="2" maxlength="2" ></td> </tr> <tr> <td><span class="Estilo4">Tipo de Producto:</span></td> <td><input type="text" name="tipoprod" size="20" maxlength="20"></td> </tr> </table> </font></b> <input type="submit" name="accion" value="Guardar Datos"> </form></center> <hr size="3" color="#000099" noshade> </body> </html> MODIFICAR_TIPOPROD.PHP <?php include("conex.php"); $link=Connectto(); $id_prod = $_GET['id_prod']; $tipoprod=$_GET['tipoprod']; mysql_query("update tipoproducto set tipoprod = '$tipoprod' where id_prod = ' $id_prod' ",$link); header("Location: moditipoprod.php"); ?> MOSTIPOPROD.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Control de Productos</title> </head>

<body bgcolor="#000000"> <center> <font face="Arial" size="5"> <table><tr><td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="captipoprod.php">Altas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="elitipoprod.php">Bajas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="moditipoprod.php">Modificaciones</a></td> <td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Mostrar Registros</font></td > </tr> </table> </font> </center> <br/> <br/> <marquee behavior="alternate" direction="left" bgcolor="#000000"><font face="Ari al" color="#FFFFFF" size="6"> <h1>Generos Registrados</h1></font></marquee><br/> <hr size="3" color="#FF0000" noshade> <?php include("conex.php"); $link=Connectto(); $result=mysql_query("select * from tipoproducto order by id_prod",$link); ?> <font face="Arial" color="#FFFFFF" size="4"> <div align="center" class="Estilo4"> <table border="1" cellspacing="1" cellpadding="1"> <tr> <td class="Estilo4"><span class="Estilo6 Estilo1 Estilo10">&nbsp;<span cla ss="Estilo8">Clave de Tipo de Genero</span></span></td> <td class="Estilo3"><span class="Estilo6 Estilo1">&nbsp;Tipo de Producto</ span></td> </tr> <?php while($row = mysql_fetch_array($result)) { printf(" <tr> <td>&nbsp;%s</td> <td>&nbsp;%s&nbsp;</td> </tr>", $row["tipo_prod"], $row["id_prod"] ); } mysql_free_result($result); mysql_close($link); ?> </table> </div> </font> <hr size="3" color="#FF0000" noshade> </body> </html>

CAPPRODUCTOS.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Control de Productos</title> </head> <body bgcolor="#000000"> <center> <font face="Arial" size="5"> <table><tr> <td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Altas</font></td> <td>|</td> <td class="PestanaPorDefecto"><a href="elilibros.php">Bajas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="modilibros.php">Modificaciones</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="moslibros.php">Mostrar Registros</a></td> </tr> </table> </font> </center> <br/> <br/> <marquee behavior="alternate" direction="left" bgcolor="#000000"><font face="Ari al" color="#FFFFFF" size="5"> <h1>Introducir Datos</h1></font></marquee><br/> <hr size="3" color="#000099" noshade><br/><br/> <center> <form action="insertar_productos.php"> <b><font face="Arial" size="4" color="#FFFFFF"><table> <tr> <td width="185"><span class="Estilo4">Codigo del Producto:</span></td> <td width="180"><input type="text" name="codigo" size="3" maxlength="3"> </td> </tr> <tr> <td><span class="Estilo4">Nombre del Producto:</span></td> <td><input type="text" name="nomprod" size="30" maxlength="30"></td> </tr> <tr> <td><span class="Estilo4">Marca:</span></td> <td><input type="text" name="marca" size="20" maxlength="20"></td> </tr> <tr> <td><span class="Estilo4">Tipo de Producto:</span></td> <td><input type="text" name="editorial" size="2" maxlength="2"></td> </tr> <tr> <td><span class="Estilo4">Fabricante:</span></td> <td><input type="text" name="fabricante" size="30" maxlength="30"></td> </tr> <tr> <td><span class="Estilo4">Correo Electronico:</span></td>

<td><input type="text" name="correo" size="35" maxlength="35"></td> </tr> </table> </font></b> <input type="submit" name="accion" value="Guardar Datos"> </form></center> <center> </center> <hr size="3" color="#000099" noshade> </body> </html> INSERTAR_PRODUCTOS.PHP <?php include("conex.php"); $link=Connectto(); $codigo=$_GET['codigo']; $nomprod=$_GET['nomprod']; $marca=$_GET['marca']; $tipoprod=$_GET['tipoprod']; $fabricante=$_GET['fabricante']; $correo=$_GET['correo']; mysql_query("Insert into productos (codigo, nomprod, marca, tipoprod, fa bricante, correo) values('$codigo', '$nomprod', '$marca', '$tipoprod', '$fabrica nte', '$correo')", $link); header("location:capproductos.php") ?> MODIPRODUCTOS.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Control de Productos</title> </head> <body bgcolor="#000000"> <center> <font face="Arial" size="5"> <table><tr> <td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="capproductos.php">Altas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="eliproductos.php">Bajas</a></td> <td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Modificaciones</font></td> <td>|</td> <td class="PestanaPorDefecto"><a href="mosproductos.php">Mostrar Registros</a></ td> </tr> </table> </font> </center> <br/> <br/>

<marquee behavior="alternate" direction="left" bgcolor="#000000"><font face="Ari al" color="#FFFFFF" size="6"> <h1>Modificar Registros</h1></font></marquee><br/> <hr size="3" color="#000099" noshade><br/><br/> <center> <form action="modificar_productos.php"> <b><font face="Arial" size="4" color="#FFFFFF"><table> <tr> <td width="185"><span class="Estilo4">Codigo del Producto:</span></td> <td width="180"><input type="text" name="codigo" size="3" maxlength="3"> </td> </tr> <tr> <td><span class="Estilo4">Nombre del Producto:</span></td> <td><input type="text" name="nomprod" size="30" maxlength="30"></td> </tr> <tr> <td><span class="Estilo4">Marca:</span></td> <td><input type="text" name="marca" size="20" maxlength="20"></td> </tr> <tr> <td><span class="Estilo4">Tipo de Producto:</span></td> <td><input type="text" name="tipoprod" size="2" maxlength="2"></td> </tr> <tr> <td><span class="Estilo4">Fabricante:</span></td> <td><input type="text" name="fabricante" size="30" maxlength="30"></td> </tr> <tr> <td><span class="Estilo4">Correo Electronico:</span></td> <td><input type="text" name="correo" size="35" maxlength="35"></td> </tr> </table> </font></b> <input type="submit" name="accion" value="Guardar Datos"> </form></center> <hr size="3" color="#000099" noshade> </body> </html> MODIFICAR_PRODUCTOS.PHP <?php include("conex.php"); $link=Connectto(); $codigo = $_GET['codigo']; $nomprod=$_GET['nomprod']; $marca=$_GET['marca']; $tipoprod = $_GET['tipoprod']; $fabricante=$_GET['fabricante']; $correo = $_GET['correo']; mysql_query("update productos set nomprod = '$nomprod' , marca = '$marca', ti poprod = '$tipoprod', fabricante = '$fabricante', correo = '$correo' where codig o = '$codigo' ",$link); header("Location: modiproductos.php"); ?>

ELIPRODUCTOS.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Control de Productos</title> </head> <body bgcolor="#000000"> <center> <font face="Arial" size="5"> <table><tr> <td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="caplibros.php">Altas</a></td> <td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Bajas</font></td> <td>|</td> <td class="PestanaPorDefecto"><a href="modilibros.php">Modificaciones</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="moslibros.php">Mostrar Registros</a></td> </tr> </table> </font> </center> <br/> <br/> <marquee behavior="alternate" direction="left" bgcolor="#000000"><font face="Ari al" color="#FFFFFF" size="6"> <h1>Eliminar Registros</h1></font></marquee><br/> <hr size="3" color="#000099" noshade> <?php include("conex.php"); $link=Connectto(); $result=mysql_query("select * from productos",$link); ?> <font face="Arial" color="#FFFFFF" size="4"> <div align="center" class="Estilo4"> <TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3> <TR> <TD><span class="Estilo4">&nbsp;Cdigo del Producto</span></TD> <TD><span class="Estilo4">&nbsp;Nombre del Producto</span></TD> <TD><span class="Estilo4">&nbsp;Marca</span></TD> <TD><span class="Estilo4">&nbsp;Tipo de Producto</span></TD> <TD><span class="Estilo4">&nbsp;Fabricante</span></TD> <TD><span class="Estilo4">&nbsp;Correo Electronico</span></TD> </TR> <?php while($row = mysql_fetch_array($result)) { printf(" <tr> <td>&nbsp;%s</td> <td>&nbsp;%s</td>

<td>&nbsp;%s</td> <td>&nbsp;%s</td> <td>&nbsp;%s</td> <td>&nbsp;%s&nbsp;</td> <td><a href=\"eliminar_productos.php?codigo=%s\">Eliminar</a></td> </tr> ", $row["codigo"], $row["nomprod"], $row["marca"], $row["tipoprod"], $row["fabricante"], $row["correo"], $row["codigo"] ); } mysql_free_result($result); mysql_close($link); ?> </table> </div> </font> </center> <td>&nbsp;</td> <hr size="3" color="#FF0000" noshade> </body> </html> ELIMINAR_PRODUCTOS.PHP <?php include("conex.php"); $link=Connectto(); $codigo=$_GET['codigo']; mysql_query("delete from productos where codigo= '$codigo'",$link); header("location: Eliproductos.php"); ?> MOSTRARPRODUCTOS.PHP <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/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>Control de productos</title> </head> <body bgcolor="#000000"> <center> <font face="Arial" size="5"> <table><tr><td class="PestanaPorDefecto"><a href="Inicio.php">Inicial</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="capproductos.php">Altas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="eliproductos.php">Bajas</a></td> <td>|</td> <td class="PestanaPorDefecto"><a href="modiproductos.php">Modificaciones</a></td >

<td>|</td> <td class="PestanaPorDefecto"><font color="#FFFFFF">Mostrar Registros</font></td > </tr> </table> </font> </center> <br/> <br/> <marquee behavior="alternate" direction="left" bgcolor="#000000"><font face="Ari al" color="#FFFFFF" size="6"> <h1>Productos Registrados</h1></font></marquee><br/> <hr size="3" color="#FF0000" noshade> <?php include("conex.php"); $link=Connectto(); $result=mysql_query("select * from productos order by codigo",$link); ?> <font face="Arial" color="#FFFFFF" size="4"> <div align="center" class="Estilo4"> <table border="1" cellspacing="1" cellpadding="1"> <tr> <td class="Estilo4"><span class="Estilo6 Estilo1 Estilo10">&nbsp;<span cla ss="Estilo8">Codigo del Producto</span></span></td> <td class="Estilo3"><span class="Estilo6 Estilo1">&nbsp;Nombre del Product o</span></td> <td class="Estilo3"><span class="Estilo6 Estilo1">&nbsp;Marca</span></ td> <td class="Estilo3"><span class="Estilo6 Estilo1">&nbsp;Tipo de Produc to</span></td> <td class="Estilo3"><span class="Estilo6 Estilo1">&nbsp;Fabricante</span>< /td> <td class="Estilo3"><span class="Estilo6 Estilo1">&nbsp;Correo Electronico </span></td> </tr> <?php while($row = mysql_fetch_array($result)) { printf(" <tr> <td>&nbsp;%s</td> <td>&nbsp;%s</td> <td>&nbsp;%s</td> <td>&nbsp;%s</td> <td>&nbsp;%s</td> <td>&nbsp;%s&nbsp;</td> </tr>", $row["codigo"], $row["nomprod"], $row["marca"], $row["tipoprod"], $row["fabricante"], $row["correo"] ); } mysql_free_result($result); mysql_close($link); ?> </table>

</div> </font> <hr size="3" color="#FF0000" noshade> </body> </html>

También podría gustarte