-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSubirDoc.php
More file actions
executable file
·120 lines (80 loc) · 2.8 KB
/
Copy pathSubirDoc.php
File metadata and controls
executable file
·120 lines (80 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
session_start();
//valida si existe una sesión, si no regresa a la pagina de login
if(empty($_SESSION['access']))
{
header("Location: index.php");
}
if($_SESSION['tipo_usu']==3)
{
header("Location: faltaPermisos.php");
}
//include ("restriccion.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style2.css" media="screen"/>
<title>Subir documento :)</title>
</head>
<body>
<div id="container">
<?php include ("cabecera.php");?>
<?php include ("lateral.php"); ?>
<div id="upload_form">
<form onsubmit="if(document.forms[0].txtDescripcion.value.length> 500){alert('El tamaño de la descripcion supera el permitido, maximo 500 caracteres'); document.forms[0].txtDescripcion.select(); return false}" action='Subir.php' method='post' enctype="multipart/form-data" name="formulario"
id="formulario">
<label>Subir un Documento.</label>
<br />
<br />
<label name='Nombre'> Nombre: </label>
<input name='txtNombre' id='txtNombre' type='text' pattern="\w*" required maxlength='50' />
<br />
<br/>
<?php include("conexion.php");?>
<?php
//Aqui van los departamentos
$qry="SELECT Id_Dpto, Nombre FROM departamento;";
$conexion=mysqli_connect($host,$user,$password,$dbname)
or die("no se pudo contectar al servidor");
$result=mysqli_query($conexion,$qry) or die(mysqli_error($conexion));
echo "<label name='Dpto'> Departamento: </label>";
echo "<select name='listaDpto'>";
while($row=mysqli_fetch_array($result))
{
echo "<option value='".$row["Id_Dpto"]."'>".$row["Nombre"]."</option>";
}
echo "</select>";
echo "<br />";
echo "<br />";
//Aqui para categoria
$qry="SELECT Id_Cat, Nombre FROM categoria_doc;";
$result=mysqli_query($conexion,$qry) or die(mysqli_error($conexion));
echo "<label name ='Categorias'> Categoría: </label>";
echo "<select name='listaCat'>";
while($row=mysqli_fetch_array($result))
{
echo "<option value='".$row["Id_Cat"]."'>".$row["Nombre"]."</option>";
}
echo "</select>";
mysqli_close($conexion);
?>
<br />
<br />
<label name='descripcion'>Descripción:</label>
</br>
</br>
<textarea name='txtDescripcion' cols='' rows='' required="true"></textarea>
<br />
<br />
<label>Selecciona un documento para continuar:</label>
<br />
<input name='file' type='file' id='file' value='Selecciona un Archivo' required="true"/>
<br />
<br />
<input name='btnSubir' type='submit' id='btnSubir' class='menu_button blue' value="Subir" />
</form>
</div>
</div><!--fin del div = container -->
</body>
</html>