SlideShare uma empresa Scribd logo
1 de 25
INTERFAZ
Usuario   :   fredy
Clave     :   guzman
CODIGOS


Conexión.php

<?php
  $host = "localhost";
  $user = "system_user";
  $password = "12345*";
  $db   = "system_colegio";
?>

Eliminar.php


<?php
        include("conexion.php");

        if(isset($_POST['chkRegistro']))
        {
                        $valor=$_POST['chkRegistro'];
                        $conexion = mysql_connect($host, $user, $password) or die("Problemas
con Server");
                        mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona
la base de datos
                        mysql_query("DELETE FROM Matriculas WHERE Id =$valor");
                        header ("Location: listado.php");

        }else{

?>
<script type="text/javascript">
         window.alert("Seleccione un Registro")
</script>
<?Php
                header("refresh:0; url = listado.php");
         }

?>
Insertar.php

<?php
        include("conexion.php");

        $strDni=$_POST['txtDni'];
        $strApellidos=$_POST['txtApellidos'];
        $strNombres=$_POST['txtNombres'];
        $strEmail=$_POST['txtEmail'];
        $strEspecialidad=$_POST['cboEspecialidad'];
        $strTurno=$_POST['cboTurno'];
        $strSemestre=$_POST['cboSemestre'];

        $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server");
        mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de
datos

        if(isset($strDni) && !empty($strDni) &&
        isset($strApellidos) && !empty($strApellidos) &&
        isset($strNombres) && !empty($strNombres) &&
        isset($strEmail) && !empty($strEmail) &&
        isset($strEspecialidad) && !empty($strEspecialidad) &&
        isset($strTurno) && !empty($strTurno) &&
        isset($strSemestre) && !empty($strSemestre))
        {
                 $Sql="INSERT INTO Matriculas (Id, Dni, Apellidos, Nombres, Email, Especialidad,
Turno, Semestre)".
                 " VALUES (NULL, '$strDni', '$strApellidos', '$strNombres', '$strEmail',
'$strEspecialidad', '$strTurno', '$strSemestre')";
                 mysql_query($Sql);
                 header ("Location: listado.php");

        }else{
?>
<script type="text/javascript">
         window.alert("Es necesario que llene todos los campos")
</script>
<?Php
                header("refresh:0; url = mostrar.php");
         }

?>
Menu.php

<?php
session_start();
include("conexion.php");
if(isset($_POST['txtUsser']) && !empty($_POST['txtUsser']) && isset($_POST['txtPass']) &&
!empty($_POST['txtPass']))
{
$con = mysql_connect($host, $user, $password) or die("Problemas con Server");
         mysql_select_db($db, $con) or die("Ploblemas con BD");
   $seleccion = mysql_query("SELECT Usuario, Clave FROM Registros WHERE Usuario =
'$_POST[txtUsser]'", $con);
   $sesion = mysql_fetch_array($seleccion);
if($_POST['txtPass'] == $sesion['Clave'])
{
?>
<!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=utf-8" />
<title>Fredy Guzman Cusihunca</title>
</head>

<body background="imagenes/fondo.jpg" link="#FF0000" vlink="#FFFF00" alink="#CC00FF">
<center>
<table width="800" border="0">
<tr>
<td colspan="5"><div align="center"><img src="imagenes/banner.gif" width="800" height="250"
/></div></td>
</tr>
<tr bgcolor="#0033CC">
<td width="200"><div align="center"><strong><a
href="index.php">Inicio</a></strong></div></td>
<td width="200"><div align="center"><strong>Quienes somos</strong></div></td>
<td width="200"><div align="center"><strong>Productos</strong></div></td>
<td width="200"><div align="center"><strong>Registro</strong></div></td>
<td width="200"><div align="center"><strong>Contacto</strong></div></td>
</tr>
<tr>
         <td colspan="5">&nbsp;
<div align="center">
<table width="200">
<tr>
<td colspan="2"><div align="center">
<h1><strong>Menu</strong></h1>
</div></td>
</tr>
<tr>
<td align="center"><a href="listado.php"><h2>ADMINISTRAR</h2></a></td>
</tr>
<tr>
<td align="center"><a href="ver.php"><h2>CONSULTAR</h2></a></td>
</tr>
</table>
&nbsp;
</div></td>
</tr>

<tr bgcolor="#0000CC">
<td colspan="5"><div align="center"><strong><em>IDAT - Fredy Guzman
2012</em></strong></div></td>
</tr>
</table>
</center>
</body>
</html>
<?Php
}else{
?>
<script type="text/javascript">
         window.alert("Usuario o Clave incorrecta")
</script>
<?Php
         header("Location : index.php");
  }
}else{
?>
<script type="text/javascript">
         window.alert("Llene los campos")
</script>
<?Php
         header("Location : index.php");
}
?>
Principal.php

<!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=utf-8" />
<title>Fredy Guzman Cusihunca</title>
</head>

<body background="imagenes/fondo.gif">
<div align="center">
<table width="800" border="0">
<tr>
<td colspan="5"><img src="imagenes/banner.gif" width="800" height="250"/></td>
</tr>
<tr bgcolor="#ccddff">
<td width="200"><div align="center"><strong>Inicio</strong></div></td>
<td width="200"><div align="center"><strong>Quienes somos</strong></div></td>
<td width="200"><div align="center"><strong>Productos</strong></div></td>
<td width="200"><div align="center"><strong>Registro</strong></div></td>
<td width="200"><div align="center"><strong>Contacto</strong></div></td>
</tr>
<tr>
<td colspan="5">
<div align="center">
&nbsp;
<table width="50%" border="0">
         <form id="form1" name="form1" method="post" action="verificar.php">
<tr>
<td colspan="2"><div align="center"><strong>MATRICULA DE ESTUDIANTE</strong></div></td>
</tr>
<tr>
<td width="23%"><div align="right"><strong>Dni:</strong></div></td>
<td width="77%"><div align="left">
<strong>
<input name="txtDni" type="text" id="txtDni" size="30" maxlength="100" />
</strong></div></td>
</tr>
<tr>
<td><div align="right"><strong>Apellidos:</strong></div></td>
<td><div align="left">
<strong>
<input name="txtApellidos" type="text" id="txtApellidos" size="50" maxlength="40" />
</strong></div></td>
</tr>
<tr>
<td><div align="right"><strong>Nombres:</strong></div></td>
<td><div align="left">
<strong>
<input name="txtNombres" type="text" id="txtNombres" size="50" maxlength="50" />
</strong></div></td>
</tr>
<tr>
<td><div align="right"><strong>Email:</strong></div></td>
<td><div align="left">
<strong>
<input name="txtEmail" type="text" id="txtEmail" size="40" maxlength="50" />
</strong></div></td>
</tr>
<tr>
<td><div align="right"><strong>Especialidad:</strong></div></td>
<td><div align="left">
<strong>
<select name="cboEspecialidad" id="cboEspecialidad">
<option>Elegir Especialidad</option>
<option value="Computacion e Informatica">Computacion e Informatica</option>
<option value="Contabilidad">Contabilidad</option>
<option value="Secretariado;">Secretariado</option>
<option value="Administracion">Administracion</option>
<option value="Enfemeria">Enfermeria</option>
<option value="Diseño Grafico">Diseño Grafico</option>
<option value="Electronica">Electronica</option>
<option value="Cursos corto">Cursos cortos</option>
</select>
</strong></div></td>
</tr>
<tr>
<td><div align="right"><strong>Turno:</strong></div></td>
<td><div align="left">
<strong>
<select name="cboTurno" id="cboturno">
<option value="M">Mañana</option>
<option value="T">Tarde</option>
<option value="N;">Nocturna</option>
</select>
</strong></div></td>
</tr>
<tr>
<td><div align="right"><strong>Semestre:</strong></div></td>
<td><div align="left">
<strong>
<select name="cboSemestre" id="cboSemestre">
<option value="1">Semestre 1</option>
<option value="2">Semestre 2</option>
<option value="3;">Semestre 3</option>
<option value="4;">Semestre 4</option>
<option value="5;">Semestre 5</option>
<option value="6;">Semestre 6</option>
</select>
</strong></div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<p>
<input type="submit" name="btnEnviar" id="btnEnviar" value="Inscripcion" />&nbsp; &nbsp;
&nbsp; &nbsp;
<input type="reset" name="btnRestablecer" id="btnRestablecer" value="Restablecer" />
</p>
<p>&nbsp;</p>
</div></td>
</tr>
</form>
</table>
&nbsp;
</div>
</tr>
<tr bgcolor="#ccddff" >
<td colspan="5"><div align="center"><strong><em>IDAT - Fredy Guzman Cusihunca
2012</em></strong></div></td>
</tr>
</table>
</div>
</body>
</html>
Ver.php

<html>
<head>
<title>Consulta</title>
</head>
<body>
<center>
<form id="form1" name="form1" method="post" action="buscar.php">
<div align="center">
<table width="700">
<tr>
<td align="center" colspan=4>Busqueda de Estudiantes</td></tr>
<tr><td align="center"><b>Especialidad</li></b>
</td><td align="center"><b>Turno</li></b>
</td><td align="center"><b>Semestre</li></b>
</td><td><b>Dni del Estudiante</li></b>
</td>
</tr>
<tr>
<td align="center">
<select name="cboEspecialidad" id="cboEspecialidad">
<option value="Computacion e Informatica">Computacion e Informatica</option>
<option value="Contabilidad">Contabilidad</option>
<option value="Secretariado;">Secretariado</option>
<option value="Administracion">Administracion</option>
<option value="Enfemeria">Enfermeria</option>
<option value="Diseño Grafico">Diseño Grafico</option>
<option value="Electronica">Electronica</option>
<option value="Cursos corto">Cursos cortos</option>
</select></td>

<td align="center">
<select name="cboTurno" id="cboturno">
<option value="M">Mañana</option>
<option value="T">Tarde</option>
<option value="N;">Nocturna</option>
</select>
</td><td align="center">
<select name="cboSemestre" id="cboSemestre">
<option value="1">Semestre 1</option>
<option value="2">Semestre 2</option>
<option value="3;">Semestre 3</option>
<option value="4;">Semestre 4</option>
<option value="5;">Semestre 5</option>
<option value="6;">Semestre 6</option>
</select>
</td>
<td>
<input type="text" name="txtDni" size=25 maxlength=8 />
</td>
</tr>
        <tr>
<td align="center" colspan="4"><br/><input type="submit" name="btnBuscar" value="Buscar"
/></td>
        </tr>
</table>
</div>
</body>

</Html>
Actualizar.php

<?php
        include("conexion.php");

        $Id=$_POST['txtId'];
        $strDni=$_POST['txtDni'];
        $strApellidos=$_POST['txtApellidos'];
        $strNombres=$_POST['txtNombres'];
        $strEmail=$_POST['txtEmail'];
        $strEspecialidad=$_POST['txtEspecialidad'];
        $strTurno=$_POST['txtTurno'];
        $strSemestre=$_POST['txtSemestre'];


        $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server");
        mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de
datos

        if(isset($strDni) && !empty($strDni) &&
        isset($strApellidos) && !empty($strApellidos) &&
        isset($strNombres) && !empty($strNombres) &&
        isset($strEmail) && !empty($strEmail) &&
        isset($strEspecialidad) && !empty($strEspecialidad) &&
        isset($strTurno) && !empty($strTurno) &&
        isset($strTurno) && !empty($strTurno))
        {
                 $Sql="UPDATE Matriculas SET Dni='$strDni',
                                                                     Apellidos='$strApellidos',
                                                                     Nombres='$strNombres',
                                                                     Email='$strEmail',

Especialidad='$strEspecialidad',
                                                                     Turno='$strTurno',
                                                                     Semestre='$strSemestre'
                                                                     WHERE Id='$Id'";
                 mysql_query($Sql);
                 header ("Location: listado.php");
        }else{
                 echo "Es necesario que llene todos los campos";

        }
?>
Buscar.php

<?php
        include("conexion.php");
        $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server");
        mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de
datos


        $especialidad = $_POST["cboEspecialidad"];
        $turno = $_POST['cboTurno'];
        $semestre = $_POST['cboSemestre'];
        $dni = $_POST['txtDni'];

        $tabla = mysql_query("SELECT * FROM Matriculas WHERE Especialidad =$especialidad ");
// Selecciono todos los registros de la tabla
?>

<!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=utf-8" />
<title>Fredy Guzman Cusihunca</title>
</head>
<body>
<div align="center">
<table border="1" width="700">
<tr align="center">
<td>Id</td>
<td width="100">Dni</td>
<td>Apellidos y Nombres</td>
<td>Email</td>
</tr>
<?php
         while ($Registro = mysql_fetch_array($tabla))
         {
?>
<tr>
         <td><?php echo $Registro['Id'];?></td>
<td><?php echo $Registro['Dni'];?></td>
<td><?php echo $Registro['Apellidos']." ". $Registro['Nombres'];?></td>
<td><?php echo $Registro['Email'];?></td>
         </tr>
<?php
         } // Fin del bucle de ordenes
         mysql_free_result($tabla); // Libera los registros de la tabla
         mysql_close($conexion); // Cierra la conexion con la base de datos
?>
</table>
</div>
</body>
</html>
Consulta.php

<?php
        if(isset($_POST['chkRegistro']))
        {
                 include("conexion.php");
                 $conexion = mysql_connect($host, $user, $password) or die("Problemas con
Server");
                 mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base
de datos
                 $Id=$_POST['chkRegistro'];
                 $sql=mysql_query("SELECT * FROM Matriculas WHERE Id=$Id");
                 $Registro = mysql_fetch_array($sql);
?>
<html>
        <head>
        <title>Actualizar Registros</title>
</head>

<body text="#000000">
<center>
<h1> Actualizar Matricula</h1></center>
<form id="form1" name="form1" method="post" action="actualizar.php">
<table width="35%" border="0" cellpadding="2" cellspacing="2" bgcolor="#ccddff"
align="center">
        <tr>
        <?php echo "<input name='txtId' type='hidden' value='$Registro[0]'>";?>
        </tr>
<tr>
        <td align="right">Dni</td>
                <td><?php echo "<input name='txtDni' type='text' size='30'
value='$Registro[1]'>";?></td>
        </tr>
<tr>
        <td align="right">Apellidos</td>
<td><?php echo "<input name='txtApellidos' type='text' size='30' value='$Registro[2]'>";?></td>
        </tr>
        <tr>
        <td align="right">Nombres</td>
<td><?php echo "<input name='txtNombres' type='text' size='30' value='$Registro[3]'>";?></td>
        </tr>
<tr>
        <td align="right">Email</td>
<td><?php echo "<input name='txtEmail' type='text' size='30' value='$Registro[4]'>";?></td>
        </tr>
<tr>
        <td align="right">Especialidad</td>
<td><?php echo "<input name='txtEspecialidad' type='text' size='30'
value='$Registro[5]'>";?></td>
        </tr>
<tr>
         <td align="right">Turno</td>
<td><?php echo "<input name='txtTurno' type='text' size='30' value='$Registro[6]'>";?></td>
         </tr>
<tr>
         <td align="right">Semestre</td>
<td><?php echo "<input name='txtSemestre' type='text' size='30' value='$Registro[7]'>";?></td>
         </tr>
<tr>
         <td colspan="2" align="center">
         <input type="submit" name="Submit" value="Actualizar" />
                 </td>
         </tr>
</table>
</form>
</body>
</html>
<?Php
         }else{
?>
<script type="text/javascript">
         window.alert("Seleccione un Registro")
</script>
<?Php
                 header("refresh:0; url = listado.php");
         }

?>
Index.php

<!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=utf-8" />
<title>Fredy Guzman Cusihunca</title>
</head>

<body background="imagenes/fondo.jpg">
<div align="center">
<table width="800" border="0">
<tr>
<td colspan="5"><img src="imagenes/banner.gif" width="800" height="250"/></td>
</tr>
<tr bgcolor="#ccddff">
<td width="200"><div align="center"><strong>Inicio</strong></div></td>
<td width="200"><div align="center"><strong>Quienes somos</strong></div></td>
<td width="200"><div align="center"><strong>Productos</strong></div></td>
<td width="200"><div align="center"><strong>Registro</strong></div></td>
<td width="200"><div align="center"><strong>Contacto</strong></div></td>
</tr>
<tr>
<td colspan="5">
&nbsp;
<div align="center">
<table width="200" height="150" border="0" background="imagenes/sesion.jpg">
<form action="menu.php" method="post">
<tr>
<td colspan="2"><div align="center"><h2><strong>INICIAR SESION</strong></h2>
</div></td>
</tr>
<tr>
<td width="60%"><div align="right"><strong>USUARIO</strong></div></td>
<td width="35%"><input type="text" name="txtUsser" id="txtUsser"/></td>
</tr>
<tr>
<td><div align="right"><strong>CLAVE</strong></div></td>
<td><input type="password" name="txtPass" id="txtPass" /></td>
</tr>
<tr>
<td colspan="2"><div align="right">
<input type="submit" name="btnEnviar" id="btnEnviar" value="Enviar" />
</div></td>
</tr>
</form>
</table>
&nbsp;
</div></td>
</tr>
<tr bgcolor="#ccddff" >
<td colspan="5"><div align="center"><strong><em>IDAT - Fredy Guzman
2012</em></strong></div></td>
</tr>
</table>
</div>
</body>
</html>
Listado.php

<?php
        include("conexion.php");
        $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server");
        mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de
datos
        $tabla = mysql_query("SELECT * FROM Matriculas"); // Selecciono todos los registros de la
tabla
?>
<!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=utf-8" />
<title>Fredy Guzman Cusihunca</title>
</head>
<body>
<center>
<h1>Lista de Alumnos</h1>
</center>
<form id="MyForm" name="MyForm" method="post" action="">
<table align="Center" border="1" width="60%" cellspacing="0" cellpadding="2">
        <tr align="center">
        <td>Id</td>
        <td>Dni</td>
        <td>Apellidos</td>
        <td>Nombres</td>
                 <td>Email</td>
<td>Especialidad </td>
        <td>Turno</td>
                 <td>Semestre</td>
        </tr>

<?php
        while ($Registro = mysql_fetch_array($tabla))
        {
?>
        <tr>
                 <td>
<?php
                        $Id=$Registro['Id'];
                        echo "<input type='checkbox' id='chkRegistro' name='chkRegistro'
value='$Id'>";
                        echo $Registro['Id'];
                 ?>
</td>

<td><?php echo $Registro['Dni'];?></td>
<td><?php echo $Registro['Apellidos'];?></td>
<td><?php echo $Registro['Nombres'];?></td>
<td><?php echo $Registro['Email'];?></td>
<td><?php echo $Registro['Especialidad'];?></td>
<td><?php echo $Registro['Turno'];?></td>
<td><?php echo $Registro['Semestre'];?></td>
        </tr>
<?php
        } // Fin del bucle de ordenes
        mysql_free_result($tabla); // Libera los registros de la tabla
        mysql_close($conexion); // Cierra la conexion con la base de datos
?>
</table>
<center>
        <p>
        <input type="button" onclick="this.form.action='eliminar.php' ;this.form.submit();"
name="btnEliminar" value="Eliminar" />&nbsp;&nbsp;&nbsp;
<input type="button" onclick="this.form.action='consulta.php' ;this.form.submit();"
name="btnActualizar" value="Actualizar" />&nbsp;&nbsp;&nbsp;
        <input type="button" onclick="this.form.action='mostrar.php' ;this.form.submit();"
name="btnInsertar" value="Insertar" />
</p>
</center>
</form>
</body>
</html>
Mostrar.php

<!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=utf-8" />
<title>Fredy Guzman Cusihunca</title>
</head>
<body>
<table align="center">
        <form id="form1" name="form1" method="post" action="insertar.php">
<tr>
<td colspan="2"><div align="center"><strong>MATRICULA DE ESTUDIANTES</strong></div></td>
</tr>
<tr>
<td><div align="right">Dni:</div></td>
<td><input name="txtDni" type="text" id="txtDni" size="30" maxlength="8"/></td>
</tr>
<tr>
<td><div align="right">Apellidos:</div></td>
<td><input name="txtApellidos" type="text" id="txtApellidos" size="50" maxlength="40" /></td>
</tr>
<tr>
<td><div align="right">Nombres:</div></td>
<td><input name="txtNombres" type="text" id="txtNombres" size="50" maxlength="50" /></td>
</tr>
<tr>
<td><div align="right">Email:</div></td>
<td><input name="txtEmail" type="text" id="txtEmail" size="40" maxlength="50" /></td>
</tr>
<tr>
<td><div align="right">Especialidad:</div></td>
<td>
<select name="cboEspecialidad" id="cboEspecialidad">
<option value="Computacion e Informatica">Computacion e Informatica</option>
<option value="Contabilidad">Contabilidad</option>
<option value="Secretariado">Secretariado</option>
<option value="Administracion">Administracion</option>
<option value="Enfemeria">Enfermeria</option>
<option value="Diseño Grafico">Diseño Grafico</option>
<option value="Electronica">Electronica</option>
<option value="Cursos corto">Cursos cortos</option>
</select>
</td>
</tr>
<tr>
<td><div align="right">Turno:</div></td>
<td>
<select name="cboTurno" id="cboturno">
<option value="M">Mañana</option>
<option value="T">Tarde</option>
<option value="N;">Nocturna</option>
</select>
</td>
</tr>
<tr>
<td><div align="right">Semestre:</div></td>
<td>
<select name="cboSemestre" id="cboSemestre">
<option value="1">Semestre 1</option>
<option value="2">Semestre 2</option>
<option value="3;">Semestre 3</option>
<option value="4;">Semestre 4</option>
<option value="5;">Semestre 5</option>
<option value="6;">Semestre 6</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><div align="center">
<p>
<input type="submit" name="btnEnviar" id="btnEnviar" value="Matricular" />&nbsp; &nbsp;
&nbsp; &nbsp;
<input type="reset" name="btnRestablecer" id="btnRestablecer" value="Restablecer" />
</p>
</div></td>
</tr>
        </form>
</table>
</body>
</html>
BASE DE DATOS

CREATE DATABASE `system_colegio` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci;

CREATE TABLE `Colegio`.`Registros` (
`Id` INT NOT NULL AUTO_INCREMENT ,
`Usuario` VARCHAR( 25 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`Clave` VARCHAR( 30 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
PRIMARY KEY ( `Id` )
) ENGINE = MYISAM ;

INSERT INTO `colegio` .`registros` (`Id` ,`Usuario` ,`Clave`)
VALUES ( NULL ,'Adminstrador','Adminstrador');


CREATE TABLE `Colegio` .`Matriculas` (
`Id` INT NOT NULL AUTO_INCREMENT ,
`Dni` CHAR( 8 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`Apellidos` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`Nombres` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`Email` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`Especialidad` VARCHAR( 30 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`Turno` CHAR( 1 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`Semestre` CHAR( 1 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
PRIMARY KEY ( `Id` )
) ENGINE = MYISAM ;


INSERT INTO `colegio`.`registros` (`Id` ,`Usuario` ,`Clave`)
VALUES (NULL , 'a', 'a');


INSERT INTO `colegio` .`matriculas`
(`Id`, `Dni`, `Apellidos`, `Nombres`, `Email`, `Especialidad`, `Turno`, `Semestre`)
VALUES (NULL, '12345678', 'Gonzales', 'Juan', 'juan123@gmail.com', 'Computacion', 'M', '4');
Php codigos interfaces   fredy guzman cusihunca

Mais conteúdo relacionado

Mais procurados

Sumahexavector
SumahexavectorSumahexavector
Sumahexavectorjbersosa
 
Simular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentariaSimular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentariajbersosa
 
Javascript and jQuery for Mobile
Javascript and jQuery for MobileJavascript and jQuery for Mobile
Javascript and jQuery for MobileIvano Malavolta
 
Working With Ajax Frameworks
Working With Ajax FrameworksWorking With Ajax Frameworks
Working With Ajax FrameworksJonathan Snook
 
Estandarizacion de macros
Estandarizacion de macrosEstandarizacion de macros
Estandarizacion de macrosgerariel
 
Jquery Introduction Hebrew
Jquery Introduction HebrewJquery Introduction Hebrew
Jquery Introduction HebrewAlex Ivy
 
Crud secara simultan ala php myadmin
Crud secara simultan ala php myadminCrud secara simultan ala php myadmin
Crud secara simultan ala php myadminRizal Di Caprio
 
Юнит тестирование в Zend Framework 2.0
Юнит тестирование в Zend Framework 2.0Юнит тестирование в Zend Framework 2.0
Юнит тестирование в Zend Framework 2.0zfconfua
 
nose ponerle
nose ponerlenose ponerle
nose ponerleSilverKB
 
KvZ Web Tasarım Hizmetleri
KvZ Web Tasarım HizmetleriKvZ Web Tasarım Hizmetleri
KvZ Web Tasarım HizmetleriAhmet Öztaş
 

Mais procurados (17)

Sumahex
SumahexSumahex
Sumahex
 
Sumahexavector
SumahexavectorSumahexavector
Sumahexavector
 
Clase 10 electiva profesional 3 aws rds php y mysql
Clase 10 electiva profesional 3 aws rds php y mysqlClase 10 electiva profesional 3 aws rds php y mysql
Clase 10 electiva profesional 3 aws rds php y mysql
 
Simular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentariaSimular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentaria
 
With enter
With enterWith enter
With enter
 
Javascript and jQuery for Mobile
Javascript and jQuery for MobileJavascript and jQuery for Mobile
Javascript and jQuery for Mobile
 
Jsoon
JsoonJsoon
Jsoon
 
Working With Ajax Frameworks
Working With Ajax FrameworksWorking With Ajax Frameworks
Working With Ajax Frameworks
 
A z railphp v1.0
A z railphp v1.0A z railphp v1.0
A z railphp v1.0
 
Estandarizacion de macros
Estandarizacion de macrosEstandarizacion de macros
Estandarizacion de macros
 
Wek14 mysql 2
Wek14 mysql 2Wek14 mysql 2
Wek14 mysql 2
 
Alaindavila
AlaindavilaAlaindavila
Alaindavila
 
Jquery Introduction Hebrew
Jquery Introduction HebrewJquery Introduction Hebrew
Jquery Introduction Hebrew
 
Crud secara simultan ala php myadmin
Crud secara simultan ala php myadminCrud secara simultan ala php myadmin
Crud secara simultan ala php myadmin
 
Юнит тестирование в Zend Framework 2.0
Юнит тестирование в Zend Framework 2.0Юнит тестирование в Zend Framework 2.0
Юнит тестирование в Zend Framework 2.0
 
nose ponerle
nose ponerlenose ponerle
nose ponerle
 
KvZ Web Tasarım Hizmetleri
KvZ Web Tasarım HizmetleriKvZ Web Tasarım Hizmetleri
KvZ Web Tasarım Hizmetleri
 

Destaque

Imee D. Darimbang Resume_3.10.2016
Imee D. Darimbang Resume_3.10.2016Imee D. Darimbang Resume_3.10.2016
Imee D. Darimbang Resume_3.10.2016idd123
 
Semantic Web introduction
Semantic Web introductionSemantic Web introduction
Semantic Web introductionGraphity
 
man-machine communication:controls
man-machine communication:controlsman-machine communication:controls
man-machine communication:controlsjoanrosedelacruz
 
Preparing to Hand Over the Keys - Succession Planning for Automotive Dealers
Preparing to Hand Over the Keys - Succession Planning for Automotive DealersPreparing to Hand Over the Keys - Succession Planning for Automotive Dealers
Preparing to Hand Over the Keys - Succession Planning for Automotive DealersWelch LLP
 
TED Slideshow - Brian Cox
TED Slideshow - Brian CoxTED Slideshow - Brian Cox
TED Slideshow - Brian CoxJustin Togail
 
Forgiveness in Interpersonal Relationships - Cole Connor
Forgiveness in Interpersonal Relationships - Cole ConnorForgiveness in Interpersonal Relationships - Cole Connor
Forgiveness in Interpersonal Relationships - Cole Connorceconno
 
Creating powerful beginnings and satisfying endings
Creating powerful beginnings and satisfying endingsCreating powerful beginnings and satisfying endings
Creating powerful beginnings and satisfying endingsJacqui_Dornbrack
 
Linked Data success stories
Linked Data success storiesLinked Data success stories
Linked Data success storiesGraphity
 
2013 siryabe - holes effects in plane periodic multilayered viscoelastic media
2013   siryabe - holes effects in plane periodic multilayered viscoelastic media2013   siryabe - holes effects in plane periodic multilayered viscoelastic media
2013 siryabe - holes effects in plane periodic multilayered viscoelastic mediaPierre Maréchal
 
Forgiveness In Interpersonal Relationships
Forgiveness In Interpersonal RelationshipsForgiveness In Interpersonal Relationships
Forgiveness In Interpersonal Relationshipsceconno
 
Disturbi del-movimento
Disturbi del-movimentoDisturbi del-movimento
Disturbi del-movimentomaurogerman
 

Destaque (18)

Imee D. Darimbang Resume_3.10.2016
Imee D. Darimbang Resume_3.10.2016Imee D. Darimbang Resume_3.10.2016
Imee D. Darimbang Resume_3.10.2016
 
Semantic Web introduction
Semantic Web introductionSemantic Web introduction
Semantic Web introduction
 
Notebooksummary
NotebooksummaryNotebooksummary
Notebooksummary
 
man-machine communication:controls
man-machine communication:controlsman-machine communication:controls
man-machine communication:controls
 
...
......
...
 
Jd quick writes
Jd quick writesJd quick writes
Jd quick writes
 
Preparing to Hand Over the Keys - Succession Planning for Automotive Dealers
Preparing to Hand Over the Keys - Succession Planning for Automotive DealersPreparing to Hand Over the Keys - Succession Planning for Automotive Dealers
Preparing to Hand Over the Keys - Succession Planning for Automotive Dealers
 
TED Slideshow - Brian Cox
TED Slideshow - Brian CoxTED Slideshow - Brian Cox
TED Slideshow - Brian Cox
 
Hardy_Justin_PPP
Hardy_Justin_PPPHardy_Justin_PPP
Hardy_Justin_PPP
 
Forgiveness in Interpersonal Relationships - Cole Connor
Forgiveness in Interpersonal Relationships - Cole ConnorForgiveness in Interpersonal Relationships - Cole Connor
Forgiveness in Interpersonal Relationships - Cole Connor
 
Creating powerful beginnings and satisfying endings
Creating powerful beginnings and satisfying endingsCreating powerful beginnings and satisfying endings
Creating powerful beginnings and satisfying endings
 
Linked Data success stories
Linked Data success storiesLinked Data success stories
Linked Data success stories
 
2013 siryabe - holes effects in plane periodic multilayered viscoelastic media
2013   siryabe - holes effects in plane periodic multilayered viscoelastic media2013   siryabe - holes effects in plane periodic multilayered viscoelastic media
2013 siryabe - holes effects in plane periodic multilayered viscoelastic media
 
Forgiveness In Interpersonal Relationships
Forgiveness In Interpersonal RelationshipsForgiveness In Interpersonal Relationships
Forgiveness In Interpersonal Relationships
 
Disturbi del-movimento
Disturbi del-movimentoDisturbi del-movimento
Disturbi del-movimento
 
Ppp
PppPpp
Ppp
 
Adjectives presentation
Adjectives presentationAdjectives presentation
Adjectives presentation
 
Genre based writing
Genre based writingGenre based writing
Genre based writing
 

Último

، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ، راپورتا مێژوی ، ژ...
، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ،    راپورتا مێژوی ، ژ...، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ،    راپورتا مێژوی ، ژ...
، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ، راپورتا مێژوی ، ژ...Idrees.Hishyar
 
أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....
أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....
أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....سمير بسيوني
 
French Revolution (फ्रेंच राज्यक्रांती)
French Revolution  (फ्रेंच राज्यक्रांती)French Revolution  (फ्रेंच राज्यक्रांती)
French Revolution (फ्रेंच राज्यक्रांती)Shankar Aware
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...Nguyen Thanh Tu Collection
 
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...Nguyen Thanh Tu Collection
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...Nguyen Thanh Tu Collection
 

Último (6)

، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ، راپورتا مێژوی ، ژ...
، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ،    راپورتا مێژوی ، ژ...، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ،    راپورتا مێژوی ، ژ...
، ژیانا ئینگلیزا ب کوردی ، ئینگلیزەکان ، راپورتی کوردی ، راپورتا مێژوی ، ژ...
 
أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....
أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....
أَسَانِيدُ كُتُبِ وَأُصُولِ النَّشْرِ لِابْنِ الْجَزَرِيِّ وَالْوَصْلُ بِهَا....
 
French Revolution (फ्रेंच राज्यक्रांती)
French Revolution  (फ्रेंच राज्यक्रांती)French Revolution  (फ्रेंच राज्यक्रांती)
French Revolution (फ्रेंच राज्यक्रांती)
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
 
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
30 ĐỀ PHÁT TRIỂN THEO CẤU TRÚC ĐỀ MINH HỌA BGD NGÀY 22-3-2024 KỲ THI TỐT NGHI...
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
 

Php codigos interfaces fredy guzman cusihunca

  • 1. INTERFAZ Usuario : fredy Clave : guzman
  • 2.
  • 3.
  • 4. CODIGOS Conexión.php <?php $host = "localhost"; $user = "system_user"; $password = "12345*"; $db = "system_colegio"; ?> Eliminar.php <?php include("conexion.php"); if(isset($_POST['chkRegistro'])) { $valor=$_POST['chkRegistro']; $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server"); mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de datos mysql_query("DELETE FROM Matriculas WHERE Id =$valor"); header ("Location: listado.php"); }else{ ?> <script type="text/javascript"> window.alert("Seleccione un Registro") </script> <?Php header("refresh:0; url = listado.php"); } ?>
  • 5. Insertar.php <?php include("conexion.php"); $strDni=$_POST['txtDni']; $strApellidos=$_POST['txtApellidos']; $strNombres=$_POST['txtNombres']; $strEmail=$_POST['txtEmail']; $strEspecialidad=$_POST['cboEspecialidad']; $strTurno=$_POST['cboTurno']; $strSemestre=$_POST['cboSemestre']; $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server"); mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de datos if(isset($strDni) && !empty($strDni) && isset($strApellidos) && !empty($strApellidos) && isset($strNombres) && !empty($strNombres) && isset($strEmail) && !empty($strEmail) && isset($strEspecialidad) && !empty($strEspecialidad) && isset($strTurno) && !empty($strTurno) && isset($strSemestre) && !empty($strSemestre)) { $Sql="INSERT INTO Matriculas (Id, Dni, Apellidos, Nombres, Email, Especialidad, Turno, Semestre)". " VALUES (NULL, '$strDni', '$strApellidos', '$strNombres', '$strEmail', '$strEspecialidad', '$strTurno', '$strSemestre')"; mysql_query($Sql); header ("Location: listado.php"); }else{ ?> <script type="text/javascript"> window.alert("Es necesario que llene todos los campos") </script> <?Php header("refresh:0; url = mostrar.php"); } ?>
  • 6. Menu.php <?php session_start(); include("conexion.php"); if(isset($_POST['txtUsser']) && !empty($_POST['txtUsser']) && isset($_POST['txtPass']) && !empty($_POST['txtPass'])) { $con = mysql_connect($host, $user, $password) or die("Problemas con Server"); mysql_select_db($db, $con) or die("Ploblemas con BD"); $seleccion = mysql_query("SELECT Usuario, Clave FROM Registros WHERE Usuario = '$_POST[txtUsser]'", $con); $sesion = mysql_fetch_array($seleccion); if($_POST['txtPass'] == $sesion['Clave']) { ?> <!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=utf-8" /> <title>Fredy Guzman Cusihunca</title> </head> <body background="imagenes/fondo.jpg" link="#FF0000" vlink="#FFFF00" alink="#CC00FF"> <center> <table width="800" border="0"> <tr> <td colspan="5"><div align="center"><img src="imagenes/banner.gif" width="800" height="250" /></div></td> </tr> <tr bgcolor="#0033CC"> <td width="200"><div align="center"><strong><a href="index.php">Inicio</a></strong></div></td> <td width="200"><div align="center"><strong>Quienes somos</strong></div></td> <td width="200"><div align="center"><strong>Productos</strong></div></td> <td width="200"><div align="center"><strong>Registro</strong></div></td> <td width="200"><div align="center"><strong>Contacto</strong></div></td> </tr> <tr> <td colspan="5">&nbsp; <div align="center"> <table width="200"> <tr> <td colspan="2"><div align="center"> <h1><strong>Menu</strong></h1> </div></td> </tr> <tr> <td align="center"><a href="listado.php"><h2>ADMINISTRAR</h2></a></td>
  • 7. </tr> <tr> <td align="center"><a href="ver.php"><h2>CONSULTAR</h2></a></td> </tr> </table> &nbsp; </div></td> </tr> <tr bgcolor="#0000CC"> <td colspan="5"><div align="center"><strong><em>IDAT - Fredy Guzman 2012</em></strong></div></td> </tr> </table> </center> </body> </html> <?Php }else{ ?> <script type="text/javascript"> window.alert("Usuario o Clave incorrecta") </script> <?Php header("Location : index.php"); } }else{ ?> <script type="text/javascript"> window.alert("Llene los campos") </script> <?Php header("Location : index.php"); } ?>
  • 8. Principal.php <!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=utf-8" /> <title>Fredy Guzman Cusihunca</title> </head> <body background="imagenes/fondo.gif"> <div align="center"> <table width="800" border="0"> <tr> <td colspan="5"><img src="imagenes/banner.gif" width="800" height="250"/></td> </tr> <tr bgcolor="#ccddff"> <td width="200"><div align="center"><strong>Inicio</strong></div></td> <td width="200"><div align="center"><strong>Quienes somos</strong></div></td> <td width="200"><div align="center"><strong>Productos</strong></div></td> <td width="200"><div align="center"><strong>Registro</strong></div></td> <td width="200"><div align="center"><strong>Contacto</strong></div></td> </tr> <tr> <td colspan="5"> <div align="center"> &nbsp; <table width="50%" border="0"> <form id="form1" name="form1" method="post" action="verificar.php"> <tr> <td colspan="2"><div align="center"><strong>MATRICULA DE ESTUDIANTE</strong></div></td> </tr> <tr> <td width="23%"><div align="right"><strong>Dni:</strong></div></td> <td width="77%"><div align="left"> <strong> <input name="txtDni" type="text" id="txtDni" size="30" maxlength="100" /> </strong></div></td> </tr> <tr> <td><div align="right"><strong>Apellidos:</strong></div></td> <td><div align="left"> <strong> <input name="txtApellidos" type="text" id="txtApellidos" size="50" maxlength="40" /> </strong></div></td> </tr> <tr> <td><div align="right"><strong>Nombres:</strong></div></td> <td><div align="left"> <strong>
  • 9. <input name="txtNombres" type="text" id="txtNombres" size="50" maxlength="50" /> </strong></div></td> </tr> <tr> <td><div align="right"><strong>Email:</strong></div></td> <td><div align="left"> <strong> <input name="txtEmail" type="text" id="txtEmail" size="40" maxlength="50" /> </strong></div></td> </tr> <tr> <td><div align="right"><strong>Especialidad:</strong></div></td> <td><div align="left"> <strong> <select name="cboEspecialidad" id="cboEspecialidad"> <option>Elegir Especialidad</option> <option value="Computacion e Informatica">Computacion e Informatica</option> <option value="Contabilidad">Contabilidad</option> <option value="Secretariado;">Secretariado</option> <option value="Administracion">Administracion</option> <option value="Enfemeria">Enfermeria</option> <option value="Diseño Grafico">Diseño Grafico</option> <option value="Electronica">Electronica</option> <option value="Cursos corto">Cursos cortos</option> </select> </strong></div></td> </tr> <tr> <td><div align="right"><strong>Turno:</strong></div></td> <td><div align="left"> <strong> <select name="cboTurno" id="cboturno"> <option value="M">Mañana</option> <option value="T">Tarde</option> <option value="N;">Nocturna</option> </select> </strong></div></td> </tr> <tr> <td><div align="right"><strong>Semestre:</strong></div></td> <td><div align="left"> <strong> <select name="cboSemestre" id="cboSemestre"> <option value="1">Semestre 1</option> <option value="2">Semestre 2</option> <option value="3;">Semestre 3</option> <option value="4;">Semestre 4</option> <option value="5;">Semestre 5</option> <option value="6;">Semestre 6</option> </select>
  • 10. </strong></div></td> </tr> <tr> <td colspan="2"><div align="center"> <p> <input type="submit" name="btnEnviar" id="btnEnviar" value="Inscripcion" />&nbsp; &nbsp; &nbsp; &nbsp; <input type="reset" name="btnRestablecer" id="btnRestablecer" value="Restablecer" /> </p> <p>&nbsp;</p> </div></td> </tr> </form> </table> &nbsp; </div> </tr> <tr bgcolor="#ccddff" > <td colspan="5"><div align="center"><strong><em>IDAT - Fredy Guzman Cusihunca 2012</em></strong></div></td> </tr> </table> </div> </body> </html>
  • 11. Ver.php <html> <head> <title>Consulta</title> </head> <body> <center> <form id="form1" name="form1" method="post" action="buscar.php"> <div align="center"> <table width="700"> <tr> <td align="center" colspan=4>Busqueda de Estudiantes</td></tr> <tr><td align="center"><b>Especialidad</li></b> </td><td align="center"><b>Turno</li></b> </td><td align="center"><b>Semestre</li></b> </td><td><b>Dni del Estudiante</li></b> </td> </tr> <tr> <td align="center"> <select name="cboEspecialidad" id="cboEspecialidad"> <option value="Computacion e Informatica">Computacion e Informatica</option> <option value="Contabilidad">Contabilidad</option> <option value="Secretariado;">Secretariado</option> <option value="Administracion">Administracion</option> <option value="Enfemeria">Enfermeria</option> <option value="Diseño Grafico">Diseño Grafico</option> <option value="Electronica">Electronica</option> <option value="Cursos corto">Cursos cortos</option> </select></td> <td align="center"> <select name="cboTurno" id="cboturno"> <option value="M">Mañana</option> <option value="T">Tarde</option> <option value="N;">Nocturna</option> </select> </td><td align="center"> <select name="cboSemestre" id="cboSemestre"> <option value="1">Semestre 1</option> <option value="2">Semestre 2</option> <option value="3;">Semestre 3</option> <option value="4;">Semestre 4</option> <option value="5;">Semestre 5</option> <option value="6;">Semestre 6</option> </select> </td> <td> <input type="text" name="txtDni" size=25 maxlength=8 />
  • 12. </td> </tr> <tr> <td align="center" colspan="4"><br/><input type="submit" name="btnBuscar" value="Buscar" /></td> </tr> </table> </div> </body> </Html>
  • 13. Actualizar.php <?php include("conexion.php"); $Id=$_POST['txtId']; $strDni=$_POST['txtDni']; $strApellidos=$_POST['txtApellidos']; $strNombres=$_POST['txtNombres']; $strEmail=$_POST['txtEmail']; $strEspecialidad=$_POST['txtEspecialidad']; $strTurno=$_POST['txtTurno']; $strSemestre=$_POST['txtSemestre']; $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server"); mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de datos if(isset($strDni) && !empty($strDni) && isset($strApellidos) && !empty($strApellidos) && isset($strNombres) && !empty($strNombres) && isset($strEmail) && !empty($strEmail) && isset($strEspecialidad) && !empty($strEspecialidad) && isset($strTurno) && !empty($strTurno) && isset($strTurno) && !empty($strTurno)) { $Sql="UPDATE Matriculas SET Dni='$strDni', Apellidos='$strApellidos', Nombres='$strNombres', Email='$strEmail', Especialidad='$strEspecialidad', Turno='$strTurno', Semestre='$strSemestre' WHERE Id='$Id'"; mysql_query($Sql); header ("Location: listado.php"); }else{ echo "Es necesario que llene todos los campos"; } ?>
  • 14. Buscar.php <?php include("conexion.php"); $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server"); mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de datos $especialidad = $_POST["cboEspecialidad"]; $turno = $_POST['cboTurno']; $semestre = $_POST['cboSemestre']; $dni = $_POST['txtDni']; $tabla = mysql_query("SELECT * FROM Matriculas WHERE Especialidad =$especialidad "); // Selecciono todos los registros de la tabla ?> <!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=utf-8" /> <title>Fredy Guzman Cusihunca</title> </head> <body> <div align="center"> <table border="1" width="700"> <tr align="center"> <td>Id</td> <td width="100">Dni</td> <td>Apellidos y Nombres</td> <td>Email</td> </tr> <?php while ($Registro = mysql_fetch_array($tabla)) { ?> <tr> <td><?php echo $Registro['Id'];?></td> <td><?php echo $Registro['Dni'];?></td> <td><?php echo $Registro['Apellidos']." ". $Registro['Nombres'];?></td> <td><?php echo $Registro['Email'];?></td> </tr> <?php } // Fin del bucle de ordenes mysql_free_result($tabla); // Libera los registros de la tabla mysql_close($conexion); // Cierra la conexion con la base de datos ?> </table>
  • 16. Consulta.php <?php if(isset($_POST['chkRegistro'])) { include("conexion.php"); $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server"); mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de datos $Id=$_POST['chkRegistro']; $sql=mysql_query("SELECT * FROM Matriculas WHERE Id=$Id"); $Registro = mysql_fetch_array($sql); ?> <html> <head> <title>Actualizar Registros</title> </head> <body text="#000000"> <center> <h1> Actualizar Matricula</h1></center> <form id="form1" name="form1" method="post" action="actualizar.php"> <table width="35%" border="0" cellpadding="2" cellspacing="2" bgcolor="#ccddff" align="center"> <tr> <?php echo "<input name='txtId' type='hidden' value='$Registro[0]'>";?> </tr> <tr> <td align="right">Dni</td> <td><?php echo "<input name='txtDni' type='text' size='30' value='$Registro[1]'>";?></td> </tr> <tr> <td align="right">Apellidos</td> <td><?php echo "<input name='txtApellidos' type='text' size='30' value='$Registro[2]'>";?></td> </tr> <tr> <td align="right">Nombres</td> <td><?php echo "<input name='txtNombres' type='text' size='30' value='$Registro[3]'>";?></td> </tr> <tr> <td align="right">Email</td> <td><?php echo "<input name='txtEmail' type='text' size='30' value='$Registro[4]'>";?></td> </tr> <tr> <td align="right">Especialidad</td> <td><?php echo "<input name='txtEspecialidad' type='text' size='30' value='$Registro[5]'>";?></td> </tr>
  • 17. <tr> <td align="right">Turno</td> <td><?php echo "<input name='txtTurno' type='text' size='30' value='$Registro[6]'>";?></td> </tr> <tr> <td align="right">Semestre</td> <td><?php echo "<input name='txtSemestre' type='text' size='30' value='$Registro[7]'>";?></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" name="Submit" value="Actualizar" /> </td> </tr> </table> </form> </body> </html> <?Php }else{ ?> <script type="text/javascript"> window.alert("Seleccione un Registro") </script> <?Php header("refresh:0; url = listado.php"); } ?>
  • 18. Index.php <!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=utf-8" /> <title>Fredy Guzman Cusihunca</title> </head> <body background="imagenes/fondo.jpg"> <div align="center"> <table width="800" border="0"> <tr> <td colspan="5"><img src="imagenes/banner.gif" width="800" height="250"/></td> </tr> <tr bgcolor="#ccddff"> <td width="200"><div align="center"><strong>Inicio</strong></div></td> <td width="200"><div align="center"><strong>Quienes somos</strong></div></td> <td width="200"><div align="center"><strong>Productos</strong></div></td> <td width="200"><div align="center"><strong>Registro</strong></div></td> <td width="200"><div align="center"><strong>Contacto</strong></div></td> </tr> <tr> <td colspan="5"> &nbsp; <div align="center"> <table width="200" height="150" border="0" background="imagenes/sesion.jpg"> <form action="menu.php" method="post"> <tr> <td colspan="2"><div align="center"><h2><strong>INICIAR SESION</strong></h2> </div></td> </tr> <tr> <td width="60%"><div align="right"><strong>USUARIO</strong></div></td> <td width="35%"><input type="text" name="txtUsser" id="txtUsser"/></td> </tr> <tr> <td><div align="right"><strong>CLAVE</strong></div></td> <td><input type="password" name="txtPass" id="txtPass" /></td> </tr> <tr> <td colspan="2"><div align="right"> <input type="submit" name="btnEnviar" id="btnEnviar" value="Enviar" /> </div></td> </tr> </form> </table> &nbsp; </div></td>
  • 19. </tr> <tr bgcolor="#ccddff" > <td colspan="5"><div align="center"><strong><em>IDAT - Fredy Guzman 2012</em></strong></div></td> </tr> </table> </div> </body> </html>
  • 20. Listado.php <?php include("conexion.php"); $conexion = mysql_connect($host, $user, $password) or die("Problemas con Server"); mysql_select_db($db, $conexion) or die("Ploblemas con BD");// Selecciona la base de datos $tabla = mysql_query("SELECT * FROM Matriculas"); // Selecciono todos los registros de la tabla ?> <!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=utf-8" /> <title>Fredy Guzman Cusihunca</title> </head> <body> <center> <h1>Lista de Alumnos</h1> </center> <form id="MyForm" name="MyForm" method="post" action=""> <table align="Center" border="1" width="60%" cellspacing="0" cellpadding="2"> <tr align="center"> <td>Id</td> <td>Dni</td> <td>Apellidos</td> <td>Nombres</td> <td>Email</td> <td>Especialidad </td> <td>Turno</td> <td>Semestre</td> </tr> <?php while ($Registro = mysql_fetch_array($tabla)) { ?> <tr> <td> <?php $Id=$Registro['Id']; echo "<input type='checkbox' id='chkRegistro' name='chkRegistro' value='$Id'>"; echo $Registro['Id']; ?> </td> <td><?php echo $Registro['Dni'];?></td> <td><?php echo $Registro['Apellidos'];?></td>
  • 21. <td><?php echo $Registro['Nombres'];?></td> <td><?php echo $Registro['Email'];?></td> <td><?php echo $Registro['Especialidad'];?></td> <td><?php echo $Registro['Turno'];?></td> <td><?php echo $Registro['Semestre'];?></td> </tr> <?php } // Fin del bucle de ordenes mysql_free_result($tabla); // Libera los registros de la tabla mysql_close($conexion); // Cierra la conexion con la base de datos ?> </table> <center> <p> <input type="button" onclick="this.form.action='eliminar.php' ;this.form.submit();" name="btnEliminar" value="Eliminar" />&nbsp;&nbsp;&nbsp; <input type="button" onclick="this.form.action='consulta.php' ;this.form.submit();" name="btnActualizar" value="Actualizar" />&nbsp;&nbsp;&nbsp; <input type="button" onclick="this.form.action='mostrar.php' ;this.form.submit();" name="btnInsertar" value="Insertar" /> </p> </center> </form> </body> </html>
  • 22. Mostrar.php <!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=utf-8" /> <title>Fredy Guzman Cusihunca</title> </head> <body> <table align="center"> <form id="form1" name="form1" method="post" action="insertar.php"> <tr> <td colspan="2"><div align="center"><strong>MATRICULA DE ESTUDIANTES</strong></div></td> </tr> <tr> <td><div align="right">Dni:</div></td> <td><input name="txtDni" type="text" id="txtDni" size="30" maxlength="8"/></td> </tr> <tr> <td><div align="right">Apellidos:</div></td> <td><input name="txtApellidos" type="text" id="txtApellidos" size="50" maxlength="40" /></td> </tr> <tr> <td><div align="right">Nombres:</div></td> <td><input name="txtNombres" type="text" id="txtNombres" size="50" maxlength="50" /></td> </tr> <tr> <td><div align="right">Email:</div></td> <td><input name="txtEmail" type="text" id="txtEmail" size="40" maxlength="50" /></td> </tr> <tr> <td><div align="right">Especialidad:</div></td> <td> <select name="cboEspecialidad" id="cboEspecialidad"> <option value="Computacion e Informatica">Computacion e Informatica</option> <option value="Contabilidad">Contabilidad</option> <option value="Secretariado">Secretariado</option> <option value="Administracion">Administracion</option> <option value="Enfemeria">Enfermeria</option> <option value="Diseño Grafico">Diseño Grafico</option> <option value="Electronica">Electronica</option> <option value="Cursos corto">Cursos cortos</option> </select> </td> </tr> <tr> <td><div align="right">Turno:</div></td> <td> <select name="cboTurno" id="cboturno">
  • 23. <option value="M">Mañana</option> <option value="T">Tarde</option> <option value="N;">Nocturna</option> </select> </td> </tr> <tr> <td><div align="right">Semestre:</div></td> <td> <select name="cboSemestre" id="cboSemestre"> <option value="1">Semestre 1</option> <option value="2">Semestre 2</option> <option value="3;">Semestre 3</option> <option value="4;">Semestre 4</option> <option value="5;">Semestre 5</option> <option value="6;">Semestre 6</option> </select> </td> </tr> <tr> <td colspan="2"><div align="center"> <p> <input type="submit" name="btnEnviar" id="btnEnviar" value="Matricular" />&nbsp; &nbsp; &nbsp; &nbsp; <input type="reset" name="btnRestablecer" id="btnRestablecer" value="Restablecer" /> </p> </div></td> </tr> </form> </table> </body> </html>
  • 24. BASE DE DATOS CREATE DATABASE `system_colegio` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci; CREATE TABLE `Colegio`.`Registros` ( `Id` INT NOT NULL AUTO_INCREMENT , `Usuario` VARCHAR( 25 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `Clave` VARCHAR( 30 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , PRIMARY KEY ( `Id` ) ) ENGINE = MYISAM ; INSERT INTO `colegio` .`registros` (`Id` ,`Usuario` ,`Clave`) VALUES ( NULL ,'Adminstrador','Adminstrador'); CREATE TABLE `Colegio` .`Matriculas` ( `Id` INT NOT NULL AUTO_INCREMENT , `Dni` CHAR( 8 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `Apellidos` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `Nombres` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `Email` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `Especialidad` VARCHAR( 30 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `Turno` CHAR( 1 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `Semestre` CHAR( 1 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , PRIMARY KEY ( `Id` ) ) ENGINE = MYISAM ; INSERT INTO `colegio`.`registros` (`Id` ,`Usuario` ,`Clave`) VALUES (NULL , 'a', 'a'); INSERT INTO `colegio` .`matriculas` (`Id`, `Dni`, `Apellidos`, `Nombres`, `Email`, `Especialidad`, `Turno`, `Semestre`) VALUES (NULL, '12345678', 'Gonzales', 'Juan', 'juan123@gmail.com', 'Computacion', 'M', '4');