-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.php
192 lines (177 loc) · 6.23 KB
/
upload.php
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?
session_start();
?>
<?php
if(isset($HTTP_SESSION_VARS['usuario_registrado'])&&
isset($HTTP_SESSION_VARS['password_registrado']))
{?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="favicon.ico" rel="icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/main.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/Button.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/mensajes.css" media="all" />
<link rel="stylesheet" href="menu/menu_style.css" type="text/css" />
<link type="text/css" rel="stylesheet" href="css/797khaox.css">
<link href="css/6maw1ulv.css" media="all" type="text/css" rel="stylesheet">
<link href="css/6mpli0u9.css" media="all" type="text/css" rel="stylesheet">
<script type="text/javascript" src="javascript/jquery.js"></script>
<script type="text/javascript">
/*
Es para solucionar el problema del conflicto :)
*/
var q = jQuery.noConflict();
q(document).ready(function(){
setTimeout(function(){ q(".mensajes").fadeOut(800);}, 3000);
});
</script>
<script type="text/javascript" src="javascript/prototype.js"></script>
<script type="text/javascript">
<!--
//<![CDATA[
function comprobar(nick)
{
var url = 'ajax_comprobar_catalogo.php';
var pars= ("id_catalogo=" + nick);
var myAjax = new Ajax.Updater( 'comprobar_mensaje', url, { method: 'get', parameters: pars});
}
// -->
</script>
<script language="javascript" type="text/javascript">
function NuevoAjax(){
var xmlhttp=false;
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp = false;
}
}
if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function Cargar(url){
var contenido, preloader;
contenido = document.getElementById('contenido');
preloader = document.getElementById('preloader');
ajax=NuevoAjax();
ajax.open("GET", url,true);
ajax.onreadystatechange=function(){
if(ajax.readyState==1){
preloader.innerHTML = "<p> </p><p> </p><p><h1><br>Cargando ...</h1></p>";
preloader.style.background = "url('loading.gif') no-repeat";
}else if(ajax.readyState==4){
if(ajax.status==200){
contenido.innerHTML = ajax.responseText;
preloader.innerHTML = "Cargado.";
preloader.style.background = "url('loaded.gif') no-repeat";
}else if(ajax.status==404){
preloader.innerHTML = "La página no existe";
}else{
preloader.innerHTML = "Error:".ajax.status;
}
}
}
ajax.send(null);
}
</script>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Agregar Catálogo</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="98" colspan="8" align="left" valign="bottom" class="Estilo1">
<img src="imagenes/banner.jpg" title="" alt="" style="height:98px;border:0px;"></td>
</tr>
<tr align="center" valign="middle" class="Estilo22">
</tr>
<div id="sidebar">
</div>
<tr valign="middle">
<td valign="top" bgcolor="#c2c2da" class="Estilo1">
<!--la columna debajo del menu-->
<div class="menubg">
<ul id="menu">
<li><a href="upload.php" target="_self">Agregar Catálogo</a></li>
<li><a href="gestion_catalogos.php" target="_self">Gestión Catálogos</a></li>
<li><a href="ingresar_peliculas.php" target="_self">Agregar Película</a></li>
<li><a href="listar_peliculas.php" target="_self">Gestión Películas</a></li>
<li><a href="usuarios.php" target="_self">Configuración</a></li>
<li><a target='blank' href="index.php" target="_self">Ir a BuscaF</a></li>
<li><a target='blank' href="../info_rep" target="_self">InfoRep</a></li>
<li><a href="salir_admin.php" target="_self">Cerrar sesión</a></li>
</ul>
</div>
</td>
<td colspan="6" align="center" valign="top" bgcolor="#eaeaf2" class="Estilo1">
<table width="715" border="0" align="center">
<!--DWLayoutTable-->
<tr>
<td width="700" align="left" valign="top"bgcolor="#FFFFFF">
<!-- InstanceBeginEditable name="contenido" -->
<table width="700" height="483" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="700" height="509" align="center" valign="top">
<?
require "funciones.php";
if(isset($HTTP_SESSION_VARS['usuario_registrado']))
{
if($_GET['accion'] == agregar)
{
//Agrega el catalogo
//Bug, no tengo idea por que ingresa un catalogo vacio,
//esto es una solucion muy pero muy chanta , evita que ingrese el catalogo fantasma ""
if ( !empty( $_POST['id_catalogo'] ) )
{
if ( agregarCatalogo2( $HTTP_SESSION_VARS['id_usuario'], limpia( $_POST['id_catalogo'] ), limpia( $_POST['ubicacion'] ) ) )
mensaje( "¡Error!","El catálogo ".limpia( $_POST['id_catalogo'] )." ya existe en la base de datos" );
else
{
//echo $_POST['id_ruta'];
//Agrega los archivos al catalogo
listar_directorios_ruta( limpia( $_POST['id_catalogo'] ), $_POST['id_ruta']);
//mensaje( "¡Confirmado!","Catálogo <b>".limpia( $_POST['id_catalogo'] )."</b> ingresado exitosamente" );
echo '<div class="exito mensajes">¡Confirmado! Catálogo <b>'.limpia( $_POST['id_catalogo'] ).'</b> ingresado exitosamente</div>';
}
}
}
}
FormularioCargarCatalogo();
?>
<script type="text/javascript" language="javascript">
<!--
var uname = document.forms['FormularioCargarCatalogo'].elements['id_catalogo'];
if (uname.value == '') {
uname.focus();
}
//-->
</script>
</td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
}//Cierre del if
else
{
header ("location: admin.php");
exit;
}
?>