Viewing file: subir_actualizacion_mastro.php (7.83 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? session_start(); require_once('Connections/campo.php'); if ($_SESSION["cla"]=="") { echo "Acceso Denegado<br>\n"; } else { function saledma($cad2){ $fecha = explode('-',$cad2); $cad = ($fecha[2]."/".$fecha[1]."/".$fecha[0]); return $cad; }
function fechaexit($fecha1,$fecha2){ $trozo1 = explode (":", $fecha1); $trozo2 = explode (":", $fecha2); $fecha1=mktime($trozo1[0]-$trozo2[0],$trozo1[1]-$trozo2[1],$trozo1[2]-$trozo2[2]); $hora = date("H:i:s",$fecha1); return ($hora); } function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; }
$editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $nombre_arc = $_FILES['file']['name']; $tipo_subida=$_POST['tipo']; /* //if ($nombre_arc=="para_subir.zip") //// //me fijo cual fue el ultimo archivo subido, le sumo un dia a la fecha ///// if ($nombre_arc=="chw".$fecha.$num.".zip") {*/ $a=date("Y"); $m=date("m"); $d=date("d"); $fecha=$a."-".$m."-".$d; $hora1=date("H:i:s"); $hora2="02:50:00"; $hora=fechaexit($hora1,$hora2); $tipo = $_FILES['file']['type']; /*if ($tipo=="application/octet-stream") {*/ if (file_exists('extraer/'.$nombre_arc)) {unlink("/home/mastropier/public_html/administrar/extraer/".$nombre_arc);} copy($_FILES['file']['tmp_name'], "extraer/".$nombre_arc); $insertSQL = sprintf("INSERT INTO archivos (nombre_arc, fecha, hora) VALUES (%s, %s, %s)", GetSQLValueString($nombre_arc, "text"), GetSQLValueString($fecha, "text"), GetSQLValueString($hora, "text")); mysql_select_db($database_cam, $campo); $result = mysql_query($insertSQL, $campo) or die(mysql_error()); ?><script language="javascript"> //location.href = "extraer/descomprimir.php?tipo=<? // echo $tipo_subida?>"; location.href = "descomprimir.php"; </script> <? /*}//end if es el tipo de archivo zip else { ?><script language="javascript">alert("El formato de archivo a subir debe ser .ZIP"); </script><? } /*} else { ?><script language="javascript">alert("El nombre del archivo a subir no es el correcto"); </script><? }//end if es el nombre correcto*/ } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Panel Administrador vía Web</TITLE> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="Page-Enter" content="blendTrans(Duration=0.2)"> <META http-equiv="Page-Exit" content="blendTrans(Duration=0.2)"> <link href="casf.css" rel="stylesheet" type="text/css"> </HEAD> <BODY> <TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" align=center border=0> <TBODY> <TR> <TD vAlign=top align=middle> <TABLE width=778 height="100%" border=0 align="center" cellPadding=0 cellSpacing=0> <TBODY> <TR> <TD valign="top" bgcolor="#FFFFFF"><div align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="grafico/cab.jpg" width="970" height="25" /></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="33%" height="48" valign="top"><img src="grafico/logito.jpg" /></td> <td width="65%" align="right" valign="top" class="titu"><a href="panel_administrador.php"><img src="grafico/panel_admin.jpg" border="0" /></a></td> <td width="2%" align="right" valign="top" class="titu"> </td> </tr> <tr> <td height="26" colspan="3" class="titu"> </td> </tr> </table> <table width="970" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="2%" height="42"> </td> <td height="42"><span class="titu"><a href="panel_administrador.php"><a href="panel_administrador.php"><a href="panel_administrador.php"></a></span><span class="titulo"><img src="grafico/flech.gif" width="16" height="22" align="absmiddle" /> Actualizar sistema on-line</span></td> </tr> </table> </div> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="810" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> </table> <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="3" valign="middle"><form action="" method="post" enctype="multipart/form-data" name="form1"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="14%" height="28" align="right" class="tipo"><span class="tex">Seleccionar Archivo</span></td> <td width="1%"> </td> <td width="85%"><span class="noticia"> <input name="file" type="file" class="tex_9" size="34"> </span><span class="titu">.ZIP</span></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><span class="tex_1"> <input type="hidden" name="MM_insert" value="form1"> <input type="hidden" name="tipo" value="<? echo $_GET['tipo']?>"> </span></td> <td> </td> <td><label></label> <label> <input name="Submit" type="submit" class="tex_9" value="Subir"> </label></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> </form></td> </tr> </table></td> </tr> </table></TD> </TR> <TR> <TD height="19" valign="bottom" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="51" align="center"><span class="tex_l">© 2012 - Mastropierro S.A.<br> Creado por <A href="http://www.creadoresdesitios.com.ar" target="_blank">CREADORES DE SITIOS</A></span></td> <td width="2%"> </td> </tr> </table></TD> </TR> </TBODY></TABLE> </TD> </TR></TBODY></TABLE> <map name="Map"><area shape="rect" coords="3,3,57,14" href="#"></map> <map name="Map2"><area shape="rect" coords="50,91,125,107" href="#"></map></BODY></HTML> <? }?>
|