SlideShare a Scribd company logo
1 of 24
INSTITUTO SUPERIOR TECNOLÓGICO
        UNITEK - IDAT
  CARRERA PROFESIONAL DE
Desarrollo de portales web
COMPUTACIÓN E INFORMÁTICA
        Profesor:
   Pablo cesar ttito c.
          Curso:
Desarrollo de portales web

         Alumno:
    Bendezu Martínez
      Dorian Xavier
        Semestre:

            V

     AREQUIPA – PERÚ

           2012
URL DE LA PAGINA: http://xavier.systemsecret.net/
USUARIO: xavier
CONTRASEÑA: bendezu



DOCUMENTACION DE LA PAGINA
CODIGO :
INDEX:
<!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>Documento sin título</title>
</head>

<body background="imagenes/fondo.jpg">
<div align="center">
 <table width="800" border="0">
   <tr>
    <td colspan="5"><img src="imagenes/1.jpg" width="868" height="165" /></td>
   </tr>
   <tr bgcolor="#FFFF00">
   <td width="200" bgcolor="#FFFF00"><div
align="center"><strong>Inicio</strong></div></td>
   <td width="200" bgcolor="#FFFF00"><div align="center"><strong>Quienes
somos</strong></div></td>
   <td width="200" bgcolor="#FFFF00"><div
align="center"><strong>Productos</strong></div></td>
   <td width="200" bgcolor="#FFFF00"><div
align="center"><strong>Registro</strong></div></td>
   <td width="200" bgcolor="#FFFF00"><div
align="center"><strong>Contacto</strong></div></td>
   </tr>
   <tr>
    <td colspan="5" bgcolor="">
    &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"><h1><strong>Iniciar Sesion</strong></h1>
          </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>Contraseña</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="yellow" >
   <td colspan="5" bgcolor="#FFFF00"><div align="center"><strong><em>Derechos
Reservados - 2011</em></strong></div></td>
  </tr>
 </table>
</div>
</body>
</html>



MENU:
<?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>SEMANA 15</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/1.jpg" width="868" height="165"
/></div></td>
 </tr>
 <tr bgcolor="#0033CC">
   <td width="200" bgcolor="#00FFFF"><div align="center"><strong><a
href="index.php">Inicio</a></strong></div></td>
   <td width="200" bgcolor="#00FFFF"><div align="center"><strong>Quienes
somos</strong></div></td>
   <td width="200" bgcolor="#00FFFF"><div
align="center"><strong>Productos</strong></div></td>
   <td width="200" bgcolor="#00FFFF"><div
align="center"><strong>Registro</strong></div></td>
   <td width="200" bgcolor="#00FFFF"><div
align="center"><strong>Contacto</strong></div></td>
 </tr>
 <tr>
         <td colspan="5" bgcolor="#333333"> &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" bgcolor="#00FFFF"><div align="center"><strong><em>Derechos
Reservados - 2011</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.phINSp");
  }
}else{
?>
<script type="text/javascript">
         window.alert("Llene los campos")
</script>
<?Php
         header("Location : index.php");
}
?>

INSERTAR:
<?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");
         }

?>

LISTADO:
<?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>Documento sin título</title>
</head>
<body>
<center>
 <h1><strong>Listado de Alumnos</strong></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 bgcolor="#FF0000">Id</td>
          <td bgcolor="#FF0000">Dni</td>
          <td bgcolor="#FF0000">Apellidos</td>
          <td bgcolor="#FF0000">Nombres</td>
<td bgcolor="#FF0000">Email</td>
     <td bgcolor="#FF0000">Especialidad </td>
           <td bgcolor="#FF0000">Turno</td>
                 <td bgcolor="#FF0000">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:

<!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>Documento sin título</title>
</head>
<body>
<table align="center">
         <form id="form1" name="form1" method="post" action="insertar.php">
     <tr>
      <td colspan="2" bgcolor="#FF0000"><div align="center"><strong>MATRICULAS DE
ESTUDIANTES</strong></div></td>
     </tr>
     <tr>
      <td bgcolor="#666666"><div align="right">Dni:</div></td>
      <td><input name="txtDni" type="text" id="txtDni" size="30" maxlength="8"/></td>
     </tr>
     <tr>
      <td bgcolor="#666666"><div align="right">Apellidos:</div></td>
      <td><input name="txtApellidos" type="text" id="txtApellidos" size="50" maxlength="40"
/></td>
     </tr>
     <tr>
      <td bgcolor="#666666"><div align="right">Nombres:</div></td>
      <td><input name="txtNombres" type="text" id="txtNombres" size="50" maxlength="50"
/></td>
     </tr>
     <tr>
      <td bgcolor="#666666"><div align="right">Email:</div></td>
      <td><input name="txtEmail" type="text" id="txtEmail" size="40" maxlength="50"
/></td>
     </tr>
     <tr>
      <td bgcolor="#666666"><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 bgcolor="#666666"><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 bgcolor="#666666"><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" bgcolor="#FFFF00"><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>
PRINCIPAL:
<!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>Documento sin título</title>
</head>

<body background="imagenes/fondo.gif">
<div align="center">
 <table width="800" border="0">
   <tr>
    <td colspan="5"><img src="imagenes/11.jpg" width="868" height="254" /></td>
   </tr>
   <tr bgcolor="#0033FF">
   <td width="200" bgcolor="#CCCCCC"><div
align="center"><strong>Inicio</strong></div></td>
   <td width="200" bgcolor="#CCCCCC"><div align="center"><strong>Quienes
somos</strong></div></td>
   <td width="200" bgcolor="#CCCCCC"><div
align="center"><strong>Productos</strong></div></td>
   <td width="200" bgcolor="#CCCCCC"><div
align="center"><strong>Registro</strong></div></td>
   <td width="200" bgcolor="#CCCCCC"><div
align="center"><strong>Contacto</strong></div></td>
   </tr>
   <tr>
    <td colspan="5" bgcolor="#333333">
     <div align="center">
     &nbsp;
     <table width="50%" border="0">
         <form id="form1" name="form1" method="post" action="verificar.php">
     <tr>
       <td colspan="2" bgcolor="#FF0000"><div align="center"><strong>MATRICULAS DE
ESTUDIANTES</strong></div></td>
     </tr>
     <tr>
       <td width="23%" bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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 height="64" colspan="2" bgcolor="#999999"><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="#0033FF" >
    <td colspan="5" bgcolor="#999999"><div align="center"><strong><em>Derechos
Reservados - 2012</em></strong></div></td>
   </tr>
 </table>
</div>
</body>
</html>

VER:
<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 colspan=4 align="center" bgcolor="#999999">Buscar Estudiantes</td></tr>
  <tr><td align="center" bgcolor="#999999"><b>Especialidad</li></b>
    </td><td align="center" bgcolor="#999999"><b>Turno</li></b>
     </td><td align="center" bgcolor="#999999"><b>Semestre</li></b>
      </td><td bgcolor="#999999"><b>Dni del Estudiante</li></b>
       </td>
    </tr>
  <tr>
    <td align="center" bgcolor="#000000">
     <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" bgcolor="#000000">
    <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" bgcolor="#000000">
     <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 bgcolor="#000000">
    <input type="text" name="txtDni" size=25 maxlength=8 />
    </td>
   </tr>
         <tr>
    <td colspan="4" align="center" bgcolor="#333333"><br/><input type="submit"
name="btnBuscar" value="Buscar" /></td>
         </tr>
 </table>
</div>
</body>

</Html>



ELIMINAR:

<?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");
         }

?>

CONSULTA:
<?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="#ffffff"
align="center">
        <tr>
        <?php echo "<input name='txtId' type='hidden' value='$Registro[0]'>";?>
        </tr>
   <tr>
        <td align="right" bgcolor="#999999">Dni</td>
                <td><?php echo "<input name='txtDni' type='text' size='30'
value='$Registro[1]'>";?></td>
        </tr>
   <tr>
        <td align="right" bgcolor="#999999">Apellidos</td>
     <td><?php echo "<input name='txtApellidos' type='text' size='30'
value='$Registro[2]'>";?></td>
        </tr>
        <tr>
        <td align="right" bgcolor="#999999">Nombres</td>
     <td><?php echo "<input name='txtNombres' type='text' size='30'
value='$Registro[3]'>";?></td>
        </tr>
   <tr>
        <td align="right" bgcolor="#999999">Email</td>
     <td><?php echo "<input name='txtEmail' type='text' size='30'
value='$Registro[4]'>";?></td>
        </tr>
<tr>
         <td align="right" bgcolor="#999999">Especialidad</td>
     <td><?php echo "<input name='txtEspecialidad' type='text' size='30'
value='$Registro[5]'>";?></td>
         </tr>
  <tr>
         <td align="right" bgcolor="#999999">Turno</td>
     <td><?php echo "<input name='txtTurno' type='text' size='30'
value='$Registro[6]'>";?></td>
         </tr>
  <tr>
         <td align="right" bgcolor="#999999">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");
         }

?>

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

BUSCAR:
<?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'];

         if($Dni=="" && $Especialidad=="Seleccione Especialidad" && $Semestre=="Seleccione
Semestre" && $Turno=="Seleccione Turno")
         {
?>
<script type="text/javascript">
         window.alert("Seleccione un criterio de Busqueda")
</script>
<?Php

               header ("refresh:0; url = ver.php");
        }

        else
        {
                if($Dni!="" && ($Especialidad=="Seleccione Especialidad" &&
$Semestre=="Seleccione Semestre" && $Turno=="Seleccione Turno" ) ||
                                          ($Especialidad!="Seleccione Especialidad" ||
$Semestre!="Seleccione Semestre" || $Turno!="Seleccione Turno" ))
                {
                        $query = "SELECT * FROM Matriculas WHERE Dni='$Dni'";//        Caso
que Dni este lleno
                }
                if($Especialidad!="Seleccione Especialidad" && $Semestre=="Seleccione
Semestre" && $Turno=="Seleccione Turno" && $Dni=="")
                {
                        $query = "SELECT * FROM Matriculas WHERE
Especialidad='$Especialidad'";// Caso que Especialidad este Seleccionada
                }
                if($Semestre!="Seleccione Semestre" && $Especialidad=="Seleccione
Especialidad" && $Turno=="Seleccione Turno" && $Dni=="")
                {
                        $query = "SELECT * FROM Matriculas WHERE
Semestre='$Semestre'";// Caso que Semestre este Seleccionada
                }
if($Turno!="Seleccione Turno" && $Especialidad=="Seleccione Especialidad"
&& $Semestre=="Seleccione Semestre" && $Dni=="")
               {
                        $query = "SELECT * FROM Matriculas WHERE Turno='$Turno'";// Caso
que Turno este Seleccionada
               }
               if($Turno=="Seleccione Turno" && $Especialidad!="Seleccione Especialidad"
&& $Semestre!="Seleccione Semestre" && $Dni=="")
               {
                        $query = "SELECT * FROM Matriculas WHERE
Especialidad='$Especialidad' AND Semestre='$Semestre'";// Especialidad y Semestre
               }
               if($Turno!="Seleccione Turno" && $Especialidad!="Seleccione Especialidad"
&& $Semestre=="Seleccione Semestre" && $Dni=="")
               {
                        $query = "SELECT * FROM Matriculas WHERE
Especialidad='$Especialidad' AND Turno='$Turno'";// Especialidad y Turno
               }
               if($Turno!="Seleccione Turno" && $Especialidad=="Seleccione Especialidad"
&& $Semestre!="Seleccione Semestre" && $Dni=="")
               {
                        $query = "SELECT * FROM Matriculas WHERE Semestre='$Semestre'
AND Turno='$Turno'";// Semestre y Turno
               }
               if($Turno!="Seleccione Turno" && $Especialidad!="Seleccione Especialidad"
&& $Semestre!="Seleccione Semestre" && $Dni=="")
               {
                        $query = "SELECT * FROM Matriculas WHERE
Especialidad='$Especialidad' AND Semestre='$Semestre' AND Turno='$Turno'";// Especialidad,
Semestre y Turno
               }



               $result = mysql_query($query) or die("ERROR...");
               $numero = 0;
?>
<!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>Documento sin título</title>
</head>

<body background="imagenes/fondo.gif" link="#FF0000" vlink="#FFFF00" alink="#CC00FF">
<div align="center">
 <table width="800" border="0">
   <tr>
    <td colspan="5"><img src="imagenes/banner.jpg" width="900" height="250"/></td>
   </tr>
   <tr bgcolor="#0033FF">
   <td width="200"><div align="center"><strong><a
href="menu.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">
 <h1>Resultados</h1>
 <table border="1" width="900">
   <tr align="center" bgcolor="#CC0000">
    <td>Id</td>
    <td width="100">Dni</td>
    <td>Apellidos y Nombres</td>
    <td>Email</td>
    <td>Especialidad</td>
    <td>Turno</td>
    <td>Semestre</td>
   </tr>
<?Php
 while($row = mysql_fetch_array($result))
 {
?>
          <tr>
          <td><?Php echo $row["Id"];?></td>
          <td><?Php echo $row["Dni"]; ?></td>
          <td><?Php echo $row["Apellidos"]." ".$row["Nombres"]; ?></td>
          <td><?Php echo $row["Email"];?></td>
     <td><?Php echo $row["Especialidad"];?></td>
     <td><?Php echo $row["Turno"];?></td>
     <td><?Php echo $row["Semestre"];?></td>
   </tr>
<?Php
   $numero++;
 }
 mysql_free_result($result);
mysql_close($conexion);
?>
</table>
</div>&nbsp;
</td>
   </tr>
   <tr bgcolor="#0033FF" >
    <td colspan="5"><div align="center"><strong><em>Derechos Reservados -
2012</em></strong></div></td>
   </tr>
 </table>
</div>
</body>
</html>
<?Php
 }
?>

ACTUALIZAR :
<?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";

        }
?>

More Related Content

What's hot

WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説Takashi Uemura
 
Allow remote conne
Allow remote conneAllow remote conne
Allow remote conneSiraj Ahmed
 
Un juego creado en php
Un juego creado en phpUn juego creado en php
Un juego creado en phpErwin Lobo
 
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
 
Estandarizacion de macros
Estandarizacion de macrosEstandarizacion de macros
Estandarizacion de macrosgerariel
 
Javascript and jQuery for Mobile
Javascript and jQuery for MobileJavascript and jQuery for Mobile
Javascript and jQuery for MobileIvano Malavolta
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2raj lex
 

What's hot (16)

WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説
 
A z railphp v1.0
A z railphp v1.0A z railphp v1.0
A z railphp v1.0
 
Admin login oes
Admin login oesAdmin login oes
Admin login oes
 
Allow remote conne
Allow remote conneAllow remote conne
Allow remote conne
 
Phpex3
Phpex3Phpex3
Phpex3
 
Sis quiz
Sis quizSis quiz
Sis quiz
 
Un juego creado en php
Un juego creado en phpUn juego creado en php
Un juego creado en php
 
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
 
Crud secara simultan ala php myadmin
Crud secara simultan ala php myadminCrud secara simultan ala php myadmin
Crud secara simultan ala php myadmin
 
New 3
New  3New  3
New 3
 
Jsoon
JsoonJsoon
Jsoon
 
Test
TestTest
Test
 
Estandarizacion de macros
Estandarizacion de macrosEstandarizacion de macros
Estandarizacion de macros
 
Javascript and jQuery for Mobile
Javascript and jQuery for MobileJavascript and jQuery for Mobile
Javascript and jQuery for Mobile
 
With enter
With enterWith enter
With enter
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2
 

Viewers also liked

Documentacion de pagina web php
Documentacion de  pagina web phpDocumentacion de  pagina web php
Documentacion de pagina web phpjonathan02591
 
Documentacion de pagina web
Documentacion de  pagina webDocumentacion de  pagina web
Documentacion de pagina webjonathan02591
 
Proyecto siga web terminado
Proyecto siga web terminadoProyecto siga web terminado
Proyecto siga web terminadoammielpt
 
PROYECTO PAGINA WEB
PROYECTO PAGINA WEB PROYECTO PAGINA WEB
PROYECTO PAGINA WEB JM3D
 
Proyecto del diseño de la pagina web
Proyecto del diseño de la pagina webProyecto del diseño de la pagina web
Proyecto del diseño de la pagina webbrahcris
 

Viewers also liked (6)

Documentacion de pagina web php
Documentacion de  pagina web phpDocumentacion de  pagina web php
Documentacion de pagina web php
 
Documentacion de pagina web
Documentacion de  pagina webDocumentacion de  pagina web
Documentacion de pagina web
 
Proyecto siga web terminado
Proyecto siga web terminadoProyecto siga web terminado
Proyecto siga web terminado
 
PROYECTO PAGINA WEB
PROYECTO PAGINA WEB PROYECTO PAGINA WEB
PROYECTO PAGINA WEB
 
Proyecto del diseño de la pagina web
Proyecto del diseño de la pagina webProyecto del diseño de la pagina web
Proyecto del diseño de la pagina web
 
Roles y funciones
Roles y funcionesRoles y funciones
Roles y funciones
 

DOCUMENTACION PAGINA WEB PHP

  • 1. INSTITUTO SUPERIOR TECNOLÓGICO UNITEK - IDAT CARRERA PROFESIONAL DE Desarrollo de portales web COMPUTACIÓN E INFORMÁTICA Profesor: Pablo cesar ttito c. Curso: Desarrollo de portales web Alumno: Bendezu Martínez Dorian Xavier Semestre: V AREQUIPA – PERÚ 2012
  • 2. URL DE LA PAGINA: http://xavier.systemsecret.net/ USUARIO: xavier CONTRASEÑA: bendezu DOCUMENTACION DE LA PAGINA
  • 3.
  • 4.
  • 5. CODIGO : INDEX: <!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>Documento sin título</title> </head> <body background="imagenes/fondo.jpg"> <div align="center"> <table width="800" border="0"> <tr> <td colspan="5"><img src="imagenes/1.jpg" width="868" height="165" /></td> </tr> <tr bgcolor="#FFFF00"> <td width="200" bgcolor="#FFFF00"><div align="center"><strong>Inicio</strong></div></td> <td width="200" bgcolor="#FFFF00"><div align="center"><strong>Quienes somos</strong></div></td> <td width="200" bgcolor="#FFFF00"><div align="center"><strong>Productos</strong></div></td> <td width="200" bgcolor="#FFFF00"><div align="center"><strong>Registro</strong></div></td> <td width="200" bgcolor="#FFFF00"><div align="center"><strong>Contacto</strong></div></td> </tr> <tr> <td colspan="5" bgcolor=""> &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"><h1><strong>Iniciar Sesion</strong></h1> </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>Contraseña</strong></div></td> <td><input type="password" name="txtPass" id="txtPass" /></td>
  • 6. </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="yellow" > <td colspan="5" bgcolor="#FFFF00"><div align="center"><strong><em>Derechos Reservados - 2011</em></strong></div></td> </tr> </table> </div> </body> </html> MENU: <?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>SEMANA 15</title> </head> <body background="imagenes/fondo.jpg" link="#FF0000" vlink="#FFFF00" alink="#CC00FF">
  • 7. <center> <table width="800" border="0"> <tr> <td colspan="5"><div align="center"><img src="imagenes/1.jpg" width="868" height="165" /></div></td> </tr> <tr bgcolor="#0033CC"> <td width="200" bgcolor="#00FFFF"><div align="center"><strong><a href="index.php">Inicio</a></strong></div></td> <td width="200" bgcolor="#00FFFF"><div align="center"><strong>Quienes somos</strong></div></td> <td width="200" bgcolor="#00FFFF"><div align="center"><strong>Productos</strong></div></td> <td width="200" bgcolor="#00FFFF"><div align="center"><strong>Registro</strong></div></td> <td width="200" bgcolor="#00FFFF"><div align="center"><strong>Contacto</strong></div></td> </tr> <tr> <td colspan="5" bgcolor="#333333"> &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" bgcolor="#00FFFF"><div align="center"><strong><em>Derechos Reservados - 2011</em></strong></div></td> </tr> </table> </center> </body>
  • 8. </html> <?Php }else{ ?> <script type="text/javascript"> window.alert("Usuario o Clave incorrecta") </script> <?Php header("Location : index.phINSp"); } }else{ ?> <script type="text/javascript"> window.alert("Llene los campos") </script> <?Php header("Location : index.php"); } ?> INSERTAR: <?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)) {
  • 9. $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"); } ?> LISTADO: <?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>Documento sin título</title> </head> <body> <center> <h1><strong>Listado de Alumnos</strong></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 bgcolor="#FF0000">Id</td> <td bgcolor="#FF0000">Dni</td> <td bgcolor="#FF0000">Apellidos</td> <td bgcolor="#FF0000">Nombres</td>
  • 10. <td bgcolor="#FF0000">Email</td> <td bgcolor="#FF0000">Especialidad </td> <td bgcolor="#FF0000">Turno</td> <td bgcolor="#FF0000">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>
  • 11. </body> </html> MOSTRAR: <!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>Documento sin título</title> </head> <body> <table align="center"> <form id="form1" name="form1" method="post" action="insertar.php"> <tr> <td colspan="2" bgcolor="#FF0000"><div align="center"><strong>MATRICULAS DE ESTUDIANTES</strong></div></td> </tr> <tr> <td bgcolor="#666666"><div align="right">Dni:</div></td> <td><input name="txtDni" type="text" id="txtDni" size="30" maxlength="8"/></td> </tr> <tr> <td bgcolor="#666666"><div align="right">Apellidos:</div></td> <td><input name="txtApellidos" type="text" id="txtApellidos" size="50" maxlength="40" /></td> </tr> <tr> <td bgcolor="#666666"><div align="right">Nombres:</div></td> <td><input name="txtNombres" type="text" id="txtNombres" size="50" maxlength="50" /></td> </tr> <tr> <td bgcolor="#666666"><div align="right">Email:</div></td> <td><input name="txtEmail" type="text" id="txtEmail" size="40" maxlength="50" /></td> </tr> <tr> <td bgcolor="#666666"><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>
  • 12. <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 bgcolor="#666666"><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 bgcolor="#666666"><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" bgcolor="#FFFF00"><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>
  • 13. PRINCIPAL: <!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>Documento sin título</title> </head> <body background="imagenes/fondo.gif"> <div align="center"> <table width="800" border="0"> <tr> <td colspan="5"><img src="imagenes/11.jpg" width="868" height="254" /></td> </tr> <tr bgcolor="#0033FF"> <td width="200" bgcolor="#CCCCCC"><div align="center"><strong>Inicio</strong></div></td> <td width="200" bgcolor="#CCCCCC"><div align="center"><strong>Quienes somos</strong></div></td> <td width="200" bgcolor="#CCCCCC"><div align="center"><strong>Productos</strong></div></td> <td width="200" bgcolor="#CCCCCC"><div align="center"><strong>Registro</strong></div></td> <td width="200" bgcolor="#CCCCCC"><div align="center"><strong>Contacto</strong></div></td> </tr> <tr> <td colspan="5" bgcolor="#333333"> <div align="center"> &nbsp; <table width="50%" border="0"> <form id="form1" name="form1" method="post" action="verificar.php"> <tr> <td colspan="2" bgcolor="#FF0000"><div align="center"><strong>MATRICULAS DE ESTUDIANTES</strong></div></td> </tr> <tr> <td width="23%" bgcolor="#999999"><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>
  • 14. <tr> <td bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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 bgcolor="#999999"><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>
  • 15. <option value="N;">Nocturna</option> </select> </strong></div></td> </tr> <tr> <td bgcolor="#999999"><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 height="64" colspan="2" bgcolor="#999999"><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="#0033FF" > <td colspan="5" bgcolor="#999999"><div align="center"><strong><em>Derechos Reservados - 2012</em></strong></div></td> </tr> </table> </div> </body> </html> VER:
  • 16. <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 colspan=4 align="center" bgcolor="#999999">Buscar Estudiantes</td></tr> <tr><td align="center" bgcolor="#999999"><b>Especialidad</li></b> </td><td align="center" bgcolor="#999999"><b>Turno</li></b> </td><td align="center" bgcolor="#999999"><b>Semestre</li></b> </td><td bgcolor="#999999"><b>Dni del Estudiante</li></b> </td> </tr> <tr> <td align="center" bgcolor="#000000"> <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" bgcolor="#000000"> <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" bgcolor="#000000"> <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>
  • 17. </td> <td bgcolor="#000000"> <input type="text" name="txtDni" size=25 maxlength=8 /> </td> </tr> <tr> <td colspan="4" align="center" bgcolor="#333333"><br/><input type="submit" name="btnBuscar" value="Buscar" /></td> </tr> </table> </div> </body> </Html> ELIMINAR: <?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"); } ?> CONSULTA: <?php
  • 18. 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="#ffffff" align="center"> <tr> <?php echo "<input name='txtId' type='hidden' value='$Registro[0]'>";?> </tr> <tr> <td align="right" bgcolor="#999999">Dni</td> <td><?php echo "<input name='txtDni' type='text' size='30' value='$Registro[1]'>";?></td> </tr> <tr> <td align="right" bgcolor="#999999">Apellidos</td> <td><?php echo "<input name='txtApellidos' type='text' size='30' value='$Registro[2]'>";?></td> </tr> <tr> <td align="right" bgcolor="#999999">Nombres</td> <td><?php echo "<input name='txtNombres' type='text' size='30' value='$Registro[3]'>";?></td> </tr> <tr> <td align="right" bgcolor="#999999">Email</td> <td><?php echo "<input name='txtEmail' type='text' size='30' value='$Registro[4]'>";?></td> </tr>
  • 19. <tr> <td align="right" bgcolor="#999999">Especialidad</td> <td><?php echo "<input name='txtEspecialidad' type='text' size='30' value='$Registro[5]'>";?></td> </tr> <tr> <td align="right" bgcolor="#999999">Turno</td> <td><?php echo "<input name='txtTurno' type='text' size='30' value='$Registro[6]'>";?></td> </tr> <tr> <td align="right" bgcolor="#999999">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"); } ?> CONEXION: <?php $host = "localhost"; $user = "system_user"; $password = "12345*"; $db = "system_colegio"; ?> BUSCAR:
  • 20. <?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']; if($Dni=="" && $Especialidad=="Seleccione Especialidad" && $Semestre=="Seleccione Semestre" && $Turno=="Seleccione Turno") { ?> <script type="text/javascript"> window.alert("Seleccione un criterio de Busqueda") </script> <?Php header ("refresh:0; url = ver.php"); } else { if($Dni!="" && ($Especialidad=="Seleccione Especialidad" && $Semestre=="Seleccione Semestre" && $Turno=="Seleccione Turno" ) || ($Especialidad!="Seleccione Especialidad" || $Semestre!="Seleccione Semestre" || $Turno!="Seleccione Turno" )) { $query = "SELECT * FROM Matriculas WHERE Dni='$Dni'";// Caso que Dni este lleno } if($Especialidad!="Seleccione Especialidad" && $Semestre=="Seleccione Semestre" && $Turno=="Seleccione Turno" && $Dni=="") { $query = "SELECT * FROM Matriculas WHERE Especialidad='$Especialidad'";// Caso que Especialidad este Seleccionada } if($Semestre!="Seleccione Semestre" && $Especialidad=="Seleccione Especialidad" && $Turno=="Seleccione Turno" && $Dni=="") { $query = "SELECT * FROM Matriculas WHERE Semestre='$Semestre'";// Caso que Semestre este Seleccionada }
  • 21. if($Turno!="Seleccione Turno" && $Especialidad=="Seleccione Especialidad" && $Semestre=="Seleccione Semestre" && $Dni=="") { $query = "SELECT * FROM Matriculas WHERE Turno='$Turno'";// Caso que Turno este Seleccionada } if($Turno=="Seleccione Turno" && $Especialidad!="Seleccione Especialidad" && $Semestre!="Seleccione Semestre" && $Dni=="") { $query = "SELECT * FROM Matriculas WHERE Especialidad='$Especialidad' AND Semestre='$Semestre'";// Especialidad y Semestre } if($Turno!="Seleccione Turno" && $Especialidad!="Seleccione Especialidad" && $Semestre=="Seleccione Semestre" && $Dni=="") { $query = "SELECT * FROM Matriculas WHERE Especialidad='$Especialidad' AND Turno='$Turno'";// Especialidad y Turno } if($Turno!="Seleccione Turno" && $Especialidad=="Seleccione Especialidad" && $Semestre!="Seleccione Semestre" && $Dni=="") { $query = "SELECT * FROM Matriculas WHERE Semestre='$Semestre' AND Turno='$Turno'";// Semestre y Turno } if($Turno!="Seleccione Turno" && $Especialidad!="Seleccione Especialidad" && $Semestre!="Seleccione Semestre" && $Dni=="") { $query = "SELECT * FROM Matriculas WHERE Especialidad='$Especialidad' AND Semestre='$Semestre' AND Turno='$Turno'";// Especialidad, Semestre y Turno } $result = mysql_query($query) or die("ERROR..."); $numero = 0; ?> <!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>Documento sin título</title> </head> <body background="imagenes/fondo.gif" link="#FF0000" vlink="#FFFF00" alink="#CC00FF">
  • 22. <div align="center"> <table width="800" border="0"> <tr> <td colspan="5"><img src="imagenes/banner.jpg" width="900" height="250"/></td> </tr> <tr bgcolor="#0033FF"> <td width="200"><div align="center"><strong><a href="menu.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"> <h1>Resultados</h1> <table border="1" width="900"> <tr align="center" bgcolor="#CC0000"> <td>Id</td> <td width="100">Dni</td> <td>Apellidos y Nombres</td> <td>Email</td> <td>Especialidad</td> <td>Turno</td> <td>Semestre</td> </tr> <?Php while($row = mysql_fetch_array($result)) { ?> <tr> <td><?Php echo $row["Id"];?></td> <td><?Php echo $row["Dni"]; ?></td> <td><?Php echo $row["Apellidos"]." ".$row["Nombres"]; ?></td> <td><?Php echo $row["Email"];?></td> <td><?Php echo $row["Especialidad"];?></td> <td><?Php echo $row["Turno"];?></td> <td><?Php echo $row["Semestre"];?></td> </tr> <?Php $numero++; } mysql_free_result($result);
  • 23. mysql_close($conexion); ?> </table> </div>&nbsp; </td> </tr> <tr bgcolor="#0033FF" > <td colspan="5"><div align="center"><strong><em>Derechos Reservados - 2012</em></strong></div></td> </tr> </table> </div> </body> </html> <?Php } ?> ACTUALIZAR : <?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',
  • 24. 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"; } ?>