Você está na página 1de 63

FASE 5 - PROYECTO FINAL

Programación De Sitios WEB

Preparado por

CARLOS ANDRÉS GUTIERREZ C.C 6.391.734


SEBASTIAN RODRIGUEZ
EDGAR DARIO MUESES
EDWIN DAVID GUERRERO

Grupo

301127_21
Presentado a

FRANCISCO JAVIER HILARION NOVOA

Universidad Nacional Abierta y a Distancia UNAD


CEAD Palmira
Escuela de ciencias básicas tecnología e ingeniería
MAYO DE 2016

1
INTRODUCCIÓN

El siguiente trabajo correspondiente a la fase 5 - proyecto final, el cual busca


fundamentar a los estudiantes en los conocimientos básicos de programación de
php e instalación del mismo. Así como en las estructuras básicas de programación,
motivando los estudiantes en el proceso de comprensión y aprehensión de los
conceptos propios de la programación en php, en el manejo de las sesiones y las
bases de datos mediante una aplicación la cual busca controlar el acceso a una
empresa . Se usarán todos los temas tratados a lo largo del periodo académico

El usuario es Andrés
Contraseña:6391734

2
OBJETIVOS

Fundamentar de forma teórica y práctica, la concepción de la programación php en


el manejo de las sesiones y las bases de datos mysql.
Identificar y se apropiarse de las funciones del en php de mysql y las sesiones.
Manejar imágenes dentro de una base de datos
Manejar archivos guardados en PDF

3
PAGINA PRINCIPAL

Código:
<!DOCTYPE html>

<html>
<head>
<title>Page Title</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
4
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
</style>

</head>

<body>
<br>
<h1><p align="center"> UNAD</h1>
<br>
<h1>CARLOS ANDRES GUTIERREZ </h1>
<br>
<h1>PERSONAL ADMINISTRATIVO GENESYS LAB</h1>
<br><br>
<h1>MENU DE APLICATIVO</h1>
<br>
<FORM action="administrativo.html" method="post">
<p align="center"><input type="submit" value="PERSONAL
ADMINISTRATIVO" class="boton" style="color:BLUE; height:40px; width:200px">
</FORM><br>

5
<FORM action="misional.html" method="post">
<p align="center"><input type="submit" value="PESONAL
MISIONAL" class="boton" style="color:BLUE; height:40px; width:170px">
</FORM><br>
<FORM action="visitante.html" method="post">
<p align="center"><input type="submit" value="VISITANTE"
class="boton" style="color:BLUE; height:40px; width:170px">
</FORM><br>
<FORM action="administrador.html" method="post">
<p align="center"><input type="submit" value="ADMINISTRADOR"
class="boton" style="color:BLUE; height:40px; width:170px">
</FORM><br>
</body>
</html>

MODULO PERSONAL ADMINISTRATIVO

6
Código:
<!DOCTYPE html>

<html>
<head>

<title>ADMINISTRADOR</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;

7
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>

<body>
<br>
<h1><p align="center"> UNAD</h1>
<br>
<h1>CARLOS ANDRES GUTIERREZ</h1>
<br>
<h1>ADMINISTRADOR DEL SISTEMA GENESYS LAB</h1>

8
<br><br><br>

<h1><p align="center">Ingrese su usuario y contraseña</h1><br><br>


<FORM action="proceso.php" method="POST">
<p align="center"><input type="text" name="usuario" value=""
placeholder="usuario..."/><br><br>
<input type="password" name="contrasena" value=""
placeholder="contrasena... "/><br><br>
<input type="submit" value="Aceptar" style="color:BLUE; height:40px;
width:100px"/><br><br>
</FORM>
</body>
<h2><p align="center">RETORNO</a><br></h2>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
</html>

INSERTAR DATOS DE USUARIO

9
Código insertar:
<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<title>Insertar</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{

10
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>

<body>
<center>
<form action="insertar.php" method="post" name="forminsertar">
<br> <br> <br>
<h1><p align="center">Ingrese los datos de la persona a registrar</h1>

<table border="2px">

<tr>
<td><h2>Cedula </h2></td>
<td><input type="text" required name="cedula" placeholder="cedula......"
value=""/><br/><br/></td>

11
</tr>
<tr>
<td><h2>Nombre</h2></td>
<td><input type="text" required name="nombre" placeholder="nombre......"
value=""/><br/><br/></td>

</tr>
<tr>
<td><h2>Apellidos</h2></td>
<td><input type="text" required name="apellidos"
placeholder="apellidos......" value=""/><br/><br/></td>

</tr>
<tr>
<td><h2>Sexo</h2></td>
<td><input type="text" required name="sexo" placeholder="sexo......"
value="" /><br/><br/></td>

</tr>
<tr>
<td><h2>Profesiòn</h2></td>
<td><input type="text" required name="profesion"
placeholder="profesiòn......" value=""/><br/><br/></td>

</tr>
<tr>
<td><h2>Cargo en la empresa</h2></td>
<td><input type="text" required name="cargo" placeholder="cargo en la
empresa......" value=""/><br/><br/></td>

12
</tr>
<tr>
<td><h2>Dependencia</h2></td>
<td><input type="text" required name="dependencia"
placeholder="dependencia......" value=""/><br/><br/></td>

</tr>

</table><br/>
<input type="submit" name="sudmit" value="PULSE PARA INSERTAR DATOS"
style="color:BLUE; height:40px; width:210px" />
<br><br>
</form>
</center>
</body>
<h2><p align="center">RETORNO</a><br></h2>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h2><p align="center">Realizado Por Carlos Andres Gutierrez</h2>
</html>

13
<!DOCTYPE html>

<html>
<head>

<meta charset="UTF-8">
<title>Insertar</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;

14
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: black;
margin-left: 10px;
font-size: 20px;
text-align: center;
}

</style>
</head>

<body>

<br><br><br><br><br><br><br>
<?php

include("conexion.php");

$cedula=$_POST['cedula'];
$nombre=$_POST['nombre'];
$apellidos=$_POST['apellidos'];
$sexo=$_POST['sexo'];

15
$profesion=$_POST['profesion'];
$cargo=$_POST['cargo'];
$dependencia=$_POST['dependencia'];

$query="INSERT INTO
usuarios(cedula,nombre,apellidos,sexo,profesion,cargo,dependencia)
VALUES('$cedula','$nombre','$apellidos','$sexo','$profesion','$cargo','$dependenci
a')";
$resultado= $conexion->query($query);
if ($resultado){

echo "<br><br><h1><center> Insercion De Datos Exitosa</h1>";


}
else
{
echo "<center><h1> Insercion De Datos No Exitosa</h1>";
}

?>

<br><br> <br><br><br><br><h1><p align="center">Ingresar Foto De Usuario


Registrado</h1>
<FORM action="insertar_imagen.php" method="post">
<p align="center"><input type="submit" value="INSERTAR FOTO"
class="boton" style="color:BLUE; height:40px; width:200px">
</FORM><br>

16
</body>
<br><br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

INSERCIÓN DE FOTO

codigo de inserción de foto:


<!DOCTYPE
<html>

17
<head>
<title>Index Imagen</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: black;
margin-left: 10px;
font-size: 20px;
text-align: center;
}

</style>
</head>

18
<body>
<br><br> <br><br> <br><br><h1><p align="center">Ingrese Nuevamente La
cedula del Usuario Que Acabo De Ingresar</h1>
<center><br/><br/><br/>
<form action="guardar_imagen.php" method="POST"
enctype="multipart/form-data">
<input type="text" REQUIRED name="cedula" placeholder="cedula...... "
value=""/><br/><br/>
<input type="file" REQUIRED name="Imagen"/><br/><br/>
<input type="submit" value="aceptar">
</form>
</center>
</body>
</html>

19
Código de guardar imagen
<!DOCTYPE
<html>
<head>
<title>Mostrar Imagen</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: black;
margin-left: 10px;
font-size: 20px;
text-align: center;
}

20
</style>
</head>
<body> <br><br><br> <br><br><br> <br><br><br>
<?php
include("conexion2.php");

$cedula =$_POST['cedula'];
$Imagen =addslashes(file_get_contents($_FILES['Imagen']['tmp_name']));
$query = "INSERT INTO tabla_imagen(Cedula,Imagen) VALUES
('$cedula','$Imagen')";

$resultado=$conexion->query($query);

if($resultado){

echo"<center><h1>Foto Insertada Exitosamente</h1>";


}
else {
echo"<center><h1>Foto No Insertada Con Exito</h1>";
}
?>

</body>
<br><br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>

21
</html>

BUSCAR USUARIO

Código buscar usuario:


<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">
<title>buscar</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);

22
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>

<body>
<br><br><br>
<h1><p align="center">Ingrese el nùmero de cedula de la persona que desea
buscar</h1>
<form action="mostrar.php" method="post" name="formselec">
<p align="center"><input type="text" name="cedula" placeholder="cedula......"
value="" /><br/><br/>
<p align="center"><input type="submit" value="BUSCAR" style="color:BLUE;
height:40px; width:170px"/>

23
</form>
</body>
<br>
<br>
<h2><p align="center">RETORNO</a><br></h2>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h2><p align="center">Realizado Por Carlos Andres Gutierrez</h2>
</html>

24
LISTAR USUARIOS ADMINISTRATIVO

Código:
<!DOCTYPE html>

<html>
<head>

<meta charset="UTF-8">
<title>tabla</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}

25
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: black;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>
<body>
<center>
<table bgcolor="White" border="3">
<thead>
<br><br><br>
<h1><p align="center">Usuarios registrados en el sistema</h1>
<tr><br><br><br>

<th colspan="9">Lista de usuarios</th>


</tr>
</thead>
<tbody>

26
<tr>
<td>Cedula</td>
<td>Nombre</td>
<td>Apellidos</td>
<td>Sexo</td>
<td>Profesion</td>
<td>Cargo</td>
<td>Dependencia</td>
<td>Fecha y hora de entrada</td>

</tr>
<?php

include ("conexion.php");
$query="SELECT * FROM usuarios WHERE dependencia='administrativa'";
$resultado=$conexion->query($query);
while ($row=$resultado->fetch_assoc()){

?>
<tr>
<td><?php echo $row['cedula']; ?></td>
<td><?php echo $row['nombre']; ?></td>
<td><?php echo $row['apellidos']; ?></td>
<td><?php echo $row['sexo']; ?></td>
<td><?php echo $row['profesion']; ?></td>
<td><?php echo $row['cargo']; ?></td>

27
<td><?php echo $row['dependencia']; ?></td>
<td><?php echo $row['fecha_hora_entrada']; ?></td>

</tr>
<?php
}
?>
</tbody>
</table>
</center>
</body>
<br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='administrativo.html'><img src="retorno.jpg"
border='10' width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

MOSTRAR FOTO DE LOS USUARIOS INGRESADOS

28
Código
<!DOCTYPE
<html>
<head>
<title>Mostrar Imagen</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}

29
</style>
</head>
<body>
<br><br> <br><br><h1><p align="center">Cedulas y Fotos De Los Usuarios
Ingresados</h1>
<center><br/><br/><br/><br/>
<table border="2">
<thead>
<tr>
<td><h2>Id</h2></td>
<td><h2>Cedula</h2></td>
<td><h2>Imagen</h2></td>
</tr>
</thead>
<tbody>
<?php
include("conexion2.php");
$query = "SELECT * FROM tabla_imagen";
$resultado = $conexion->query($query);
while ($row=$resultado->fetch_assoc()){
?>
<tr>
<td><h2><?php echo $row['Id'];?></h2></td>
<td><h2><?php echo $row['Cedula'];?></h2></td>
<td><h2><img height="120px" src="data:image/jpg;base64,<?php
echo base64_encode($row['Imagen']);?>"</h2></td>
</tr>
<?php

30
}
?>
</tbody>
</table>

</center>
</body>
<br><br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

REGISTRAR SALIDA DE USUARIO

31
Código:
<!DOCTYPE html>

<html>
<head>

<meta charset="UTF-8">
<title>Insertar</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;

32
text-align: center;
}
</style>
</head>

<body>
<center>
<form action="usuario_fuera.php" method="post" name="forminsertar">
<br> <br> <br><br><br> <br> <br> <br><br><br>
<h1><p align="center">Ingrese el número de documento de la persona a la
cual se le dara salida</h1>
<br><br>
<table border="2px">

<tr>
<td><h2>Cedula</h2></td>
<td><input type="text" required name="cedula" placeholder="cedula......"
value=""/><br/><br/></td>

</tr>

</table><br/>
<input type="submit" name="sudmit" value="PULSE PARA INSERTAR DATOS"
style="color:BLUE; height:40px; width:210px" />
</form>
</center>
</body>
<br>
<h2><p align="center">RETORNO</a><br></h2>

33
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='100' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

Código:
<!DOCTYPE html>

<html>
<head>

<meta charset="UTF-8">
<title>Insertar</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}

34
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: black;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>

<body><br><br><br><br><br><br>
<?php

include("conexion.php");

$cedula=$_POST['cedula'];

$query="INSERT INTO hora_salida(cedula) VALUES('$cedula')";

35
$resultado= $conexion->query($query);
if ($resultado){

echo "<h1><center> Insercion Exitosa</h1><br><br><br>";


}
else
{
echo "<h1><center> Insercion No Exitosa</h1>";
}

?>
</body>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

36
ELIMINAR USUARIO

Código
<!DOCTYPE html>

<html>
<head>

<meta charset="UTF-8">
<title>Page Title</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}

37
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: black;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>

<body>
<br> <br> <br><br><br>
<h1><p align="center">Ingrese la cedula de la persona a eliminar</h1>
<form action="eliminar.php" method="post" name="formeliminar"><br><br>
<p align="center"><input type="text" name="cedula" placeholder="cedula......"
value=""/><br/><br/>
<p align="center"><input type="submit" value="BORRAR" style="color:BLUE;
height:40px; width:210px"/>

</form>
</body>

38
<br><br><br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

Código
<!DOCTYPE html>

<html>
<head>

<meta charset="UTF-8">
<title>Page Title</title>
<style type="text/css">

39
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
</style>

</head>

<body> <br> <br> <br> <br>


<?php

include("conexion.php");
$cedula=$_POST['cedula'];

$query="DELETE FROM usuarios WHERE cedula='$cedula'";


$resultado= $conexion->query($query);

40
if ($resultado){

echo "<h1><center> Usuario eliminado exitosamente</h1>";


}
else
{
echo "<h1>Usuario no eliminado</h1>";
}

?>

</body>
<br> <br> <br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='100' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

Para las demás dependencias el código es el mismo lo único que cambia es


la dependencia a la que pertenece.

41
MODULO ADMINISTRADOR

Código:
<!DOCTYPE html>

<html>
<head>

<title>ADMINISTRADOR</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
}

42
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>

<body>
<br>
<h1><p align="center"> UNAD</h1>
<br>
<h1>CARLOS ANDRES GUTIERREZ</h1>
<br>
<h1>ADMINISTRADOR DEL SISTEMA GENESYS LAB</h1>
<br><br><br>

43
<h1><p align="center">Ingrese su usuario y contraseña</h1><br><br>
<FORM action="proceso.php" method="POST">
<p align="center"><input type="text" name="usuario" value=""
placeholder="usuario..."/><br><br>
<input type="password" name="contrasena" value=""
placeholder="contrasena... "/><br><br>
<input type="submit" value="Aceptar" style="color:BLUE; height:40px;
width:100px"/><br><br>
</FORM>
</body>
<h2><p align="center">RETORNO</a><br></h2>
<p align="center"><a href ='index.html'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
</html>

PANTALLA CUANDO ENTRA CON EL ADMINISTRADOR

44
Código:
<!DOCTYPE html>

<html>
<head>

<title>SESION</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;

45
text-align: center;
}
</style>
</head>

<body>
<br>
<h1><p align="center"> UNAD </h1>
<br>
<h1>CARLOS ANDRES GUTIERREZ </h1>
<br>
<h1>ADMINISTRADOR </h1>
<br>
<h1>MENU </h1>
<br>

<?php
session_start();
if (isset($_SESSION ['u_usuario'])){
echo "<center>";
echo " <h2>Generar Copia De Seguridad De Usuarios Ingresado </h2>" ;
echo " <a href ='backup.php'><img src=\"backup.jpg\" border='10' width='50'
height='50'></a>";
echo " <h2>Generar Copia De Seguridad Usuarios Del Sistema </h2>" ;
echo " <a href ='backup2.php'><img src=\"backup.jpg\" border='10' width='50'
height='50'></a>";
echo " <h2>Generar Copia De Seguridad De Fotos Usuarios </h2>" ;
echo " <a href ='backup3.php'><img src=\"backup.jpg\" border='10' width='50'
height='50'></a>";

46
echo " <h2>Listar Todas Las Personas Que Han ingresado </h2>" ;
echo" <a href ='listar_administrador.php'><img src=\"personas.jpg\"
border='10' width='50' height='50'></a>";
echo " <h2>Listar Todos Los Usuarios Que Han Salido </h2>" ;
echo" <a href ='listar_usuario_fuera_administrador.php'><img
src=\"salida.jpg\" border='10' width='50' height='50'></a>";
echo " <h2>Mostrar Fotos de Usuarios Ingresados </h2>" ;
echo" <a href ='mostrar_imagen2.php'><img src=\"foto.jpg\" border='10'
width='50' height='50'></a>";
echo " <h2>Generar Informes PDF Por Dependencia </h2>" ;
echo" <a href ='mostrarform_administrador.php'><img src=\"informes.jpg\"
border='10' width='50' height='50'></a>";
echo " <h2>Generar Informes PDF Por persona </h2>" ;
echo" <a href ='reporteform.php'><img src=\"informes2.jpg\" border='10'
width='50' height='50'></a>";
echo " <h2>Generar Informe PDF De Ingreso De Personas </h2>" ;
echo" <h1><a href ='Informe_pdf.php'><img src=\"informe3.jpg\" border='10'
width='50' height='50'></a>";
echo " <h2>cerrar sesion </h2>" ;
echo"<a href='cerra_sesion.php'><img src=\"cerrar.jpg\" border='10' width='50'
height='50'></a>";
echo "</center>";
}
else{
header("Location: administrador.html");
}

?>
</body>
</html>

47
GENERAR BACKUP

Código:
<!DOCTYPE html>

<html>

48
<head>
<title>tabla</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>

</head>
<body>

49
<br><br><h1><p align="center">copia de seguridad generada
exitosamente</h1><br><br>
<?php
$dbhost="localhost";
$dbuser="root";
$dbpass="6391734";
$dbname="genesys";

$mysqldump='"E:\xampp\mysql\bin\mysqldump.exe"';
$backup_file=$dbname;
$backup_path='"C:\Users\gutierrez\Desktop\trabajos_php\genesys.sql"';
system ("$mysqldump --no-defaults -u $dbuser -p$dbpass $dbname >
$backup_path");

?>
</body>
<h2><p align="center">RETORNO</a><br></h2>
<p align="center"><a href ='sesion.php'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

LISTAR PERSONAS QUE HAN INGRESADO

50
Código

<!DOCTYPE html>

<html>
<head>
<title>tabla</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{

51
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>
<body >
<center>
<table bgcolor="White" border="3">
<thead>
<br><br><br>
<h1><p align="center">Usuarios registrados en el sistema</h1>
<tr>

<th colspan="9">Lista de usuarios</th>


</tr>
</thead>
<tbody>
<tr>

52
<td>Cedula</td>
<td>Nombre</td>
<td>Apellidos</td>
<td>Sexo</td>
<td>Profesion</td>
<td>Cargo</td>
<td>Dependencia</td>
<td>Fecha y hora de entrada</td>
<td>Fecha y hora de salida</td>

</tr>
<?php

include ("conexion.php");
$query="SELECT
usuarios.cedula,usuarios.nombre,usuarios.apellidos,usuarios.sexo,usuarios.profesi
on,usuarios.cargo,usuarios.dependencia,usuarios.fecha_hora_entrada,hora_salida
.fecha_hora_salida FROM usuarios,hora_salida WHERE hora_salida.cedula and
hora_salida.id=usuarios.id";
$resultado=$conexion->query($query);
while ($row=$resultado->fetch_assoc()){

?>
<tr>
<td><?php echo $row['cedula']; ?></td>
<td><?php echo $row['nombre']; ?></td>
<td><?php echo $row['apellidos']; ?></td>

53
<td><?php echo $row['sexo']; ?></td>
<td><?php echo $row['profesion']; ?></td>
<td><?php echo $row['cargo']; ?></td>
<td><?php echo $row['dependencia']; ?></td>
<td><?php echo $row['fecha_hora_entrada']; ?></td>
<td><?php echo $row['fecha_hora_salida']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</center>
</body>
<br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='sesion.php'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h2><p align="center">Realizado Por Carlos Andres Gutierrez</h2>
</html>

54
MOSTRAR FOTOS DE TODOS LO QUE HAN INGRESADO

Código
<!DOCTYPE
<html>
<head>
<title>Mostrar Imagen</title>
<meta charset="UTF-8">
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);

55
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}

</style>
</head>
<body>
<br><br> <br><br><h1><p align="center">Cedulas y Fotos De Los Usuarios
Ingresados</h1>
<center><br/><br/><br/><br/>
<table border="2">
<thead>
<tr>
<td><h2>Id</h2></td>
<td><h2>Cedula</h2></td>
<td><h2>Imagen</h2></td>
</tr>

56
</thead>
<tbody>
<?php
include("conexion2.php");
$query = "SELECT * FROM tabla_imagen";
$resultado = $conexion->query($query);
while ($row=$resultado->fetch_assoc()){
?>
<tr>
<td><h2><?php echo $row['Id'];?></h2></td>
<td><h2><?php echo $row['Cedula'];?></h2></td>
<td><h2><img height="120px" src="data:image/jpg;base64,<?php
echo base64_encode($row['Imagen']);?>"</h2></td>
</tr>
<?php
}
?>
</tbody>
</table>

</center>
</body>
<br><br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='sesion.php'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h1><p align="center">Realizado Por Carlos Andres Gutierrez</h1>
</html>

57
GENERAR INFORME POR PERSONA

Código:
<!DOCTYPE html>

<html>
<head>

<meta charset="UTF-8">
<title>buscar</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
body{
background:url(Desktop.jpg);
}
h1{
font-family: 'Shadows Into Light', arial;
color: white;
margin-left: 10px;
font-size: 30px;
text-align: center;
}
h2{
font-family: 'Shadows Into Light', arial;

58
color: white;
margin-left: 10px;
font-size: 20px;
text-align: center;
}
</style>
</head>

<body>
<br><br><br>
<h1><p align="center">Ingrese La Cedula De La Persona A
Buscar</h1><br/><br/>
<form action="reporte_persona.php" method="post" name="formselec">
<p align="center"><input type="text" name="cedula" placeholder="cedula......"
value=""/><br/><br/>
<p align="center"><input type="submit" value="BUSCAR" style="color:BLUE;
height:40px; width:100px"/>

</form>
</body>
<br>
<br><br>
<h1><p align="center">RETORNO</a><br></h1>
<p align="center"><a href ='sesion.php'><img src="retorno.jpg" border='10'
width='50' height='50'></a>
<br><br><h2><p align="center">Realizado Por Carlos Andres Gutierrez</h2>
</html>

59
Código

<?php
$cedula=$_POST['cedula'];
require("conexion.php");
require("fpdf/fpdf.php");
$query="SELECT * FROM usuarios WHERE cedula='$cedula'";
$resultado=$conexion->query($query);
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetXY(50,30);
$pdf->SetFont('Arial','B',8);
$pdf->Cell(100, 5, 'LISTA DE USUARIOS QUE HAN VISITADO LA EMPRESA',0);
$pdf->SetXY(5,30);
$pdf->Ln(10);
$pdf->SetFont('Arial','B',6);
$pdf->Cell(15, 5, 'Cant visitas', 1,0);
$pdf->Cell(15, 5, 'Cedula', 1,0);
$pdf->Cell(15, 5, 'Nombre', 1,0);
$pdf->Cell(15, 5, 'Apellidos', 1,0);
$pdf->Cell(15, 5, 'Sexo', 1,0);
$pdf->Cell(25, 5, 'Profesion', 1,0);
$pdf->Cell(20, 5, 'Cargo', 1,0);
$pdf->Cell(20, 5, 'Dependencia', 1,0);

60
$pdf->Ln(5);

$item=0;

while ($row=$resultado->fetch_array()){
$item=$item+1;
$pdf->SetX(10);
$pdf->Cell(15,5,$item,1,0);
$pdf->Cell(15,5,$row['cedula'],1,0,'C');
$pdf->Cell(15,5,$row['nombre'],1,0,'C');
$pdf->Cell(15,5,$row['apellidos'],1,0,'C');
$pdf->Cell(15,5,$row['sexo'],1,0,'C');
$pdf->Cell(25,5,$row['profesion'],1,0,'C');
$pdf->Cell(20,5,$row['cargo'],1,0,'C');
$pdf->Cell(20,5,$row['dependencia'],1,0,'C');

$pdf->Ln();
}

$pdf->Output();
?>

61
CONCLUSIONES

Reconocimos la fundamentación teórica y conceptual de la Programación en PHP


para el manejo de bases de datos
Diseñamos un programa de computación con manejo de tablas, las cuales estaban
unidas para poder insertar, modificar, eliminar, ver la información suministrada y
otras funciones agregando que se aprendió a que la información suministrada se
guardara en un pdf al igual que la inclusión de imágenes y copias de seguridad o
backups.

62
BIBLIOGRAFIA

Capítulo 7: Gestores de bases de datos, instrucciones básicas SQL y bases de


datos en php recuperado el 25 de abril de 2016 de
http://campus19.unad.edu.co/ecbti03/mod/lesson/view.php?id=5906

Capítulo 8: Gráficos en php recuperado el 25 de abril de 2016 de


http://campus19.unad.edu.co/ecbti03/mod/lesson/view.php?id=5906&pageid=1969

Capítulo 9: Sesiones recuperado el 25 de abril de 2016 de


http://campus19.unad.edu.co/ecbti03/mod/lesson/view.php?id=5906&pageid=1970

63

Você também pode gostar