File: /home/asjudine/www/acorreos/subir_contrato_guia_correos_coas.php
<?PHP extract($_POST,EXTR_SKIP); ?>
<?php
global $dbi;
require_once("../Conectarse.php");
$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (Cargo!="ABOGADO" and Cargo!="ABOGADA" and Cargo!= "MANTENIMIENTO ELECTRONICO" and Cargo!= "SECRETARIA TESORERIA" and Cargo!="Ingeniero de sistemas" and Cargo!="ARCHIVO Y CORRESPONDENCIA" and Cargo!="ASISTENTE COBRANZAS" and Cargo!="ASISTENTE COBRANZAS DOS" and Cargo!="ASISTENTE DE PRESIDENCIA" and Cargo!="ASISTENTE DIRECTOR DE SERVICIOS" and Cargo!="BANCOS" and Cargo!="CARTERA NOMINAS" and Cargo!="COBRANZAS" and Cargo!="CONSULTORIO JURIDICO" and Cargo!="CONTADOR" and Cargo!="CONTROL INTERNO" and Cargo!="DIRECTOR COMERCIAL" and Cargo!="DIRECTORA ACTUACIONES JURIDICAS" and Cargo!= "GERENTE ADMINISTRATIVA" and Cargo!= "Gerente Control de Calidad" and Cargo!= "GERENTE GENERAL" and Cargo!= "HISTOSER" and Cargo!= "JEFE COBRANZAS" and Cargo!="FINANCIERA" and Cargo!="JEFE MANTENIMIENTO LOCATIVO" and Cargo!="MENSAJES DE TEXTO" and Cargo!="POSTVENTA" and Cargo!="PRESIDENTE SERVIASJUDINET" and Cargo!="ASISTENTE COBRANZAS" and Cargo!="ASESOR COMERCIAL" and Cargo!="RECEPCION" and Cargo!= "DIRECTOR REGIONAL" and codigo!="472" and codigo!="547" and codigo!="555" and codigo!="570" and codigo!="499" and codigo!="564" || codigo="703") order by Nombre_Completo');
if (!$Recordset1)
{
die('Invalid query: ' . mysql_error());
}
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$Recordset2 = mysql_query('SELECT * FROM sucursal order by nombre');
if (!$Recordset2) {
die('Invalid query: ' . mysql_error());
}
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
///////////////////////////ENVIADO ESTADO 0
if ($_POST[guardar])
{
$nombre_titular = strtoupper($nombre_titular);
$convocada = strtoupper($convocada);
$asunto = strtoupper($asunto);
$texto = strtoupper($texto);
$archivo = $_FILES["archivito"]["tmp_name"];
$tamanio = $_FILES["archivito"]["size"];
$tipo = $_FILES["archivito"]["type"];
$nombre = $_FILES["archivito"]["name"];
$fechast = date("y").'-'.date("m").'-'.date("d");
$succ = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' .$_POST[sucursal].'" ');
if (!$succ) {
die('Invalid query succ: ' . mysql_error());
}
list($nombresucursal) = mysql_fetch_row($succ);
if ( $archivo != "none" )
{
$fp = fopen($archivo, "rb");
$contenido = fread($fp, $tamanio);
$contenido = addslashes($contenido);
fclose($fp);
$csqle1 = mysql_query("INSERT INTO consulta_contratos (cedula,
nombre_titular,nombre,contenido,tipo,sucursal,funcionario,empresa,estado,seguimiento,fecha_envio) VALUES ('".$_POST[cedula]."','".$_POST[nombres]."','".$nombre."','".$contenido."','".$tipo."','".$_POST[sucursal]."','".$_POST[funcionario]."','COASJUDINET','0','".$_POST[seguimiento]."' ,'".$fechast."')");
if (!$csqle1) {
die('Invalid query actas : ' . mysql_error());
}
echo "<script>alert('Registro guardado correctamente');</script>";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>Ingresar Contrato Coasjudinet</title>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
*{margin: 0;padding: 0;}
body{background-color:#EAEAEA;font-family:Geneva, Arial, Helvetica, sans-serif;}
header {background-color: #B7271F; text-align: center;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
.divirmenu{text-align: center;}
.irmenu{width: 150px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
.irmenu:hover{background-color: #67a0d9; color: #000;}
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
td{padding: 1px; border: 1px solid #a0a0a0;}
.td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
.tdizq{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
.tdcen{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
.tdder{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: right;}
.exp{color:#8A0000; font-size:10px;}
.boton1{width:150px;;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{border-radius: 5px; padding: 3px;background-color: #fffde8;}
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px;}
.tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
.botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
.botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
</style>
<script languaje="JavaScript">
function Mostrar_Fecha()
{
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}
</script>
<script languaje="JavaScript">
function validar_campos(formulario)
{
if (formulario.guia.value == "")
{
alert("Escriba el número de Guia");
formulario.guia.focus();
return (false);
}
if (formulario.cedula.value == "")
{
alert("Escriba El Numero De Cedula");
formulario.cedula.focus();
return (false);
}
if (formulario.fecha.value == "0000-00-00")
{
alert("Escriba La Fecha De Envio");
formulario.fecha.focus();
return (false);
}
if (formulario.apellidos.value == "")
{
alert("Escriba Los Apellidos");
formulario.apellidos.focus();
return (false);
}
if (formulario.nombre.value == "")
{
alert("Escriba Los Nombres");
formulario.ano.focus();
return (false);
}
if (formulario.nombre_titular.value == "")
{
alert("Escriba el nombre del titular");
formulario.nombre_titular.focus();
return (false);
}
if (formulario.numero_contrato.value == "")
{
alert("Escriba el numero de contrato");
formulario.numero_contrato.focus();
return (false);
}
if (formulario.archivito.value == "")
{
alert("Falta adjuntar el archivo");
formulario.archivito.focus();
return (false);
}
if (confirm("Los datos de la consulta son correctos"))
{
return (true);
}
else
{
return (false);
}
return (true);
}
//-->
</script>
</head>
<body onload="document.formulario.numero.focus()" topmargin="0">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">FORMULARIO INGRESO CONTRATO COASJUDINET</h3>
<form name="formulario" method="post" action="" enctype="multipart/form-data" onSubmit="return validar_campos(this)">
<script>
<!--
var from = 2;
var to = 12;
var delay = 55;
var glowColor = "#0000ff";
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i < to)
{
TexteBat.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
}
//-->
</script>
<table width="691" border="4" cellpadding="2" cellspacing="2">
<tr>
<td class="fecha" colspan="2">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</td>
</tr>
<tr>
<td class="tdder">Cedula:</td>
<td class="tdizq"><input type="text" name="cedula" value=""size="15"></td>
</tr>
<tr>
<td class="tdder">Nombres Y Apellidos:</td>
<td class="tdizq"><input type="text" name="nombres" value=""size="50"></td>
</tr>
<tr>
<td class="tdder">Sucursal:</td>
<td class="tdizq"><SELECT NAME="sucursal">
<OPTION value="">--Sucursal--</OPTION>
<?php
do {
?>
<option value="<?php echo $row_Recordset2['codigo']?>"><?php echo $row_Recordset2['nombre']?></option>
<?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$rows = mysql_num_rows($Recordset2);
if($rows > 0) {
mysql_data_seek($Recordset2, 0);
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
}
?>
</SELECT></td>
</tr>
<tr>
<td class="tdder">Funcionario:</td>
<td class="tdizq"><SELECT NAME="funcionario">
<OPTION value="">--Nombre Funcionario--</OPTION>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['codigo']?>"><?php echo $row_Recordset1['Nombre_Completo']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</SELECT></td>
</tr>
<tr>
<td class="tdder">Seguimiento:</td>
<td class="tdizq"><textarea name="seguimiento" cols="60" rows="4"></textarea></td>
</tr>
<tr>
<td class="tdder">Adjuntar archivo del Contrato:</td>
<td class="tdizq"><input name="archivito" type="file" class="Estilo1" size="40" maxlength="40"></td>
</tr>
<tr>
<td class="tdcen" colspan="2">
<input name="guardar" type="submit" class="boton1" id="guardar" value="ENVIAR">
<input name="button" type="button" class="irmenu" onClick="window.location.href='menu_guias_correo.php'" value="REGRESAR">
</td>
</tr>
</table>
</form>
</body>
</html>