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/www/informe_imprimir_certificado.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;

function Conectarse()
	{
	   if (!($link=@mysql_connect("localhost","asjudine","as2006")))
	   {
		  echo "Error conectando con el servidor.";
		  exit();
	   }
	   $dbname = "asjudinet";
	   if (!@mysql_select_db($dbname,$link))
	   {
		  echo "Error seleccionando la base de datos.";
		  exit();
	   }
	   return $link;
	}
	Conectarse();


$dia = date("d");
$mes = date("m"); 
$ano = date("Y");


$res = mysql_query('SELECT cedula, razon,  sigla, direccion, telefono, celular , email, representante, veedor, descripcion_actividad, zona, gestion, fecha_cita , hora_cita, sucursal, receptividad, instalaciones, numero_empleados, problematica_jur, agremiacion, contacto, plan_sugerido, cantidad_sucursales FROM telemaprueba  WHERE cedula =  "' . $HTTP_GET_VARS["ced"]  . '"  ');
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			} 

 				list($cedula, $razon, $sigla, $direc, $tel, $celular, $email, $repre, $veedor, $descri, $zona, $gestion, $fechavis, $hora, $sucursal, $recep, $instala, $empleado, $proble, $agremiacion, $contacto, $plansuge, $cansu) = mysql_fetch_row($res);

  $contro2 = mysql_query('SELECT cedula, razon, sigla, direccion, telefono, email, representante, veedor,  descripcion_actividad, zona, fecha_asignacion, gestion, fecha_visita, hora_visita,  fecha_certificacion, sucursal FROM veeduria WHERE cedula =  "' . $HTTP_GET_VARS["ced"]  . '" and  estado  = "3" order by fecha_certificacion');
			if (!$contro2) {
				die('Invalid query: ' . mysql_error());
			}
	list($cedula, $razon, $sigla, $direc, $tel, $email,  $repre, $veedor, $descri, $zona,  $fechages, $acuer, $fechavis, $hora, $certi, $sucursal,) = mysql_fetch_row($contro2);


$rest= mysql_query('SELECT nombre FROM sucursal  WHERE codigo =  "' ."$sucursal". '" ');
			if (!$rest) {
				die('Invalid query: ' . mysql_error());
			} 

 				list($sucursal) = mysql_fetch_row($rest);
	


if(isset($_POST["atras"]))
{

echo "<SCRIPT LANGUAGE='javascript'>window.location.href='listado_asignar_asesor.php?zona=$zona'</SCRIPT>";
}


if(isset($_POST["concretado"]))
{

$dia = date("d");
$mes = date("m"); 
$ano = date("Y");

$fechaweb = $ano.'-'.$mes.'-'.$dia;


	 $modificarcob = mysql_query("UPDATE veeduria   set fecha_web_cooveeduria = '" ."$fechaweb". "',   estado = '5'  WHERE cedula = '" . $_POST["cedul"]  . "' ");
			if (! $modificarcob) {
				die('Invalid query: ' . mysql_error());
			}
			
		

	 echo "<script>alert('Certificado impreso correctamente');</script>";
	 	echo "<SCRIPT LANGUAGE='javascript'>window.open('http://www.cooveeduria.org.co/ingresar_certificado_asjudinet.php')</SCRIPT>"; 
	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='listado_imprimir_certidicado.php?'</SCRIPT>"; 

}

if(isset($_POST["reasignar"]))
{

	 $modificarcob = mysql_query("UPDATE telemaprueba set fecha_cita = '0000-00-00', hora_cita = '00-00', veedor = '', estado = '0'  WHERE cedula = '" . $_POST["cedul"]  . "' ");
			if (! $modificarcob) {
				die('Invalid query: ' . mysql_error());
			}
	$modifica = mysql_query("UPDATE veeduria set fecha_visita = '0000-00-00', hora_visita = '00-00', veedor = '', estado = '0'  WHERE cedula = '" . $_POST["cedul"]  . "' ");
			if (! $modifica) {
				die('Invalid query: ' . mysql_error());
			}
			
    echo "<script>alert('Certificado expedido correctamente');</script>";
	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='listado_certificado.php?'</SCRIPT>"; 

}


if(isset($_POST["rechazada"]))
{

 $modificarcob = mysql_query("UPDATE veeduria   set estado = '4'  WHERE cedula = '" . $_POST["cedul"]  . "' ");
			if (! $modificarcob) {
				die('Invalid query: ' . mysql_error());
			}
			
    echo "<script>alert('Certificado rechazado correctamente');</script>";
	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='listado_certificado.php?'</SCRIPT>";  
}
   
 $sql = mysql_query('SELECT * FROM sucursal  order by nombre ');
		  if (!$sql) {
				die('Invalid query 12: ' . mysql_error());
			}
	$row_sql = mysql_fetch_assoc($sql);
	$totalRows_sql = mysql_num_rows($sql); 
 
  $sql1 = mysql_query('SELECT * FROM vendedores WHERE tipo = "AE" AND estado = "1" order by vendedor ');
		  if (!$sql1) {
				die('Invalid query 12: ' . mysql_error());
			}
	$row_sql1 = mysql_fetch_assoc($sql1);
	$totalRows_sql1 = mysql_num_rows($sql1);    
?>
<html>
<head>
<title>Aprovacion Certificado</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton {  background-color: #FFCCCC; color:#FFFFFF; width:150px; border: 4px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #FFFFCC; font-size: 13px; font-family: Arial; color:#0000CC; display: block;}
.fecha {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #000099; width:10px display: block;}
.campo {background-color: #99FFCC; border:1px solid #990000;}
.lista { background-color:#99FFFF; font-family: Arial; font-size: 11px;	color: #990000;}
.label {background-color: #CCFFFF ; font-size: 14px; font-family: Arial; color:#0000CC; display: block;}
.labe2 {background-color: #CCFFFF ; font-size: 14px; font-family: Arial; color:#0000CC; }
.area {background-color: #CCFFCC; font-size: 13px; width:40px font-family: Arial; color:#0000CC; display: block;}
.variables {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #003333 ; width:10px display: block; border: 2px solid #006633;}
.sel { background-color:#DDFFFF; width:400px; border: 1px solid #0099FF; font-family:Arial; font-style:italic; color:#990000 }
.seleccion { background-color: #CCFFCC; width:340px; border: 1px solid #0099FF; font-family:Arial; color:#990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; }
body {
	background-image: url(fondo_argollado.gif);
}
.boton1 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.Estilo1 {color: #00CCFF}
.Estilo2 {color: red}
.Estilo3 {color: #0000CC}
.Estilo8 {background-color: #CCFFFF; font-size: 14px; font-family: Arial; color: #003366; display: block; }
.Estilo10 {background-color: #FFFFCC; font-size: 13px; font-family: Arial; color: #990066; display: block; }
.Estilo12 {
	font-weight: bold;
	color: #003366;
}
.Estilo14 {background-color: #CCFFFF; font-size: 14px; font-family: Arial; color: #003366; display: block; font-weight: bold; }
.Estilo16 {background-color: #CCFFFF; font-size: 14px; font-family: Arial; color: #FF0000; display: block; font-weight: bold; }

-->
</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 validar()
{

	var uf, pf, sf=0;
	uf = formulario.ultimo_folio.value;
	pf = formulario.folio1.value;
	sf = parseInt(formulario.ultimo_folio.value)+1;

	if(!(pf == uf || pf == sf))
	{	 
     	   alert('El folio ingresado debe ser igual o inmediatamente posterior al último');
           formulario.folio1.focus();
           return (false);	
	}

  if (formulario.folio2.value == "")
  {
    alert("Falta ingresar el Folio2");
    formulario.folio2.focus();
    return (false);
  }   

	if(formulario.folio2.value < pf)
	{	 
     	   alert('El folio2 no debe ser menor que el folio1');
           formulario.folio2.focus();
           return (false);	
	}	

  if (formulario.actuacion.value == "")
  {
    alert("Falta ingresar la actuación");
    formulario.actuacion.focus();
    return (false);
  }

  if (formulario.codigo_funcionario.value == "")
  {
    alert("Falta seleccionar el nombre del funcionario");
    formulario.codigo_funcionario.focus();
    return (false);
  }

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

<SCRIPT LANGUAGE='JavaScript'>
var default1 = "Aprovacion Certificado"; // only shown once at page load
var text1 = "El primer encabezado muestra en detalle los datos del proceso seleccionado";
var text2 = "la segunda parte muestra el record de actuaciones";
var text3 = "Revise bien las actuaciones y los número de folios";
var changeRate = 3000; // 1000 = 1 second
var messageNumber = 0;

function changeStatus()
{
  if (messageNumber == 0) {
     window.status=default1;
     document.title=default1;
    }
  else if (messageNumber == 1) {
     window.status=text1;
    }
  else if (messageNumber == 2) {
     window.status=text2;
     }
  else if (messageNumber == 3) {
     window.status=text3;
     messageNumber = 0;
     }
  messageNumber++;
  setTimeout("changeStatus();",changeRate);
}
changeStatus(); // leave here to run right away
// -->
</SCRIPT>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="document.formulario.folio1.focus()">
<form name="consulta" action="" method="post">
<table width="758" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr bgcolor="#CCFFFF">
    <td width="750" class="titulos"><div align="center">IMPRESION CERTIFICADO </div></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td height="19" class="fecha"><span class="Estilo1"></span>
      <div align="center">
        <script languaje="JavaScript">Mostrar_Fecha()</script>
      </div></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td height="20" bgcolor="#FFFFFF"><fieldset>
   <legend><span class="Estilo10">Datos del Empresario:</span></legend>
    <table width="741" border="0" cellspacing="1" cellpadding="0">
      <tr bgcolor="#FFFFFF">
        <th width="109" colspan="1" align="left"><span class="Estilo8">Nit</span></th>
        <td width="305" align="left"><input name="cedul" type="text" class="campo" id="cedul" value="<?php echo $cedula; ?>" size="15" maxlength="15" readonly="" >  </td>
        <th width="143"  align="left"><span class="Estilo8" > Sigla:</span></th>
        <td width="152" ><span class="Estilo2"></span>
            <input name="sigla" type="text" class="campo" id="sigla" value="<?php echo $sigla; ?>" size="25" maxlength="25"  readonly=""></td>
      </tr>
      <tr bgcolor="#FFFFFF">
        <th align="left"><span class="Estilo8">Razon Social:</span></th>
        <td ><input name="razon" type="text" class="campo" id="razon" value="<?php echo $razon; ?>" size="50" maxlength="50" readonly="" ></td>
		<th align="left" bordercolor="#E2E2E2"><span class="Estilo8">Zona:</span></th>
        <td><input name="zona" type="text" class="campo" id="zona" value="<?php echo $zona; ?>" size="10" maxlength="10" readonly="" ></td>
      </tr>
      <tr bgcolor="#FFFFFF">
        <th align="left"><span class="Estilo8">Dirección:</span></th>
        <td colspan="1"><input name="direc" type="text" class="campo" id="direc" value="<?php echo $direc; ?>" size="50" maxlength="50" readonly=""></td>
        <th align="left" bordercolor="#E2E2E2"><span class="Estilo8">Telefono:</span></th>
        <td><input name="tel" type="text" class="campo" id="tel" value="<?php echo $tel; ?>" size="10" maxlength="10" readonly="" ></td>
      </tr>
	  
      <tr bgcolor="#FFFFFF">
        <th align="left"><span class="Estilo8">Representante Legal:</span></th>
        <td colspan="1"><input name="repre" type="text" class="campo" id="repre" value="<?php echo $repre; ?>" size="50" maxlength="50" readonly="" ></td>
		<th align="left" bordercolor="#E2E2E2"><span class="Estilo8">Fecha Cita: </span></th>
        <td ><input name="fechavis" type="text" class="campo" id="fechavis" value="<?php echo $fechavis; ?>" size="12" maxlength="14"  readonly="">	 </td>
      </tr>
	   <tr bgcolor="#FFFFFF">
        <th align="left"><span class="Estilo8">Email:</span></th>
        <td colspan="1"><input name="email" type="text" class="campo" id="email" value="<?php echo $email; ?>" size="50" maxlength="50" readonly=""></td>
		<th align="left" bordercolor="#E2E2E2"><span class="Estilo8">Hora Cita: </span></th>
        <td ><input name="horavis" type="text" class="campo" id="horavis" value="<?php echo $hora; ?>" size="12" maxlength="14" readonly="" ></td>
      </tr> <tr bgcolor="#FFFFFF">
        <th align="left"><span class="Estilo8">Representante Legal:</span></th>
        <td colspan="1"><input name="repre" type="text" class="campo" id="repre" value="<?php echo $repre; ?>" size="50" maxlength="50" readonly=""></td>
		<th width="166"><span class="Estilo8">Sucursal : </span></th>
        <td width="186"><input name="sucursal" type="text" class="campo" id="sucursal" value="<?php echo $sucursal; ?>" size="20" maxlength="20" readonly="" ></td>
      </tr>
      <tr>
        <th align="left" ><span class="Estilo8">Objeto Social:</span></th>
        <td  colspan="3"  align="left"><input name="descri" cols="70" rows="5" type="text" class="campo" id="descri" value="<?php echo $descri; ?>" size="100" maxlength="90" ></td>
      </tr>
	  
	  <tr>
	   
        <th><span class="Estilo8"> Nombre Veedor:</span> </th>
        <td colspan="2" ><input name="veedor" type="text" class="campo" id="veedor" value="<?php echo $veedor; ?>" size="40" maxlength="40" readonly="" ></td>
	  </tr>
	    <tr>
	   <th width="115"><span class="Estilo8">Receptividad </span></th>
	   <td><input name="recep" type="text" class="campo" id="recep" value="<?php echo $recep; ?>" size="14" maxlength="14" readonly="" >	    </td>
		 <th width="145"><span class="Estilo8">N&deg; de Empleados </span></th>
         <td width="189"><input name="empleado" type="text" class="campo" id="empleado" value="<?php echo $empleado; ?>" size="5" maxlength="5" readonly=""></td>
	    </tr>
		    <tr>
	 
		 <th width="145"><span class="Estilo8">Agreamiación </span></th>
         <td width="189"><input name="agremiacion" type="text" class="campo" id="agremiacion" value="<?php echo $agremiacion; ?>" size="20" maxlength="20" readonly=""></td>
		 <th ><span class="Estilo8">N° de Sucursales </span></th>
          <td width="189"><input name="cansu" type="text" class="campo" id="cansu" value="<?php echo $cansu; ?>" size="5" maxlength="5" ></td>
	    </tr>
		 <tr>
	   <th width="115"><span class="Estilo8">Contacto</span></th>
	   <td><input name="contacto" type="text" class="campo" id="contacto" value="<?php echo $contacto; ?>" size="50" maxlength="50" readonly="" ></td>
  <th width="115"><span class="Estilo8">Celular </span></th>
	   <td><input name="celular" type="text" class="campo" id="celular" value="<?php echo $celular; ?>" size="10" maxlength="10" readonly="" ></td>
	    </tr>
		
		<tr>
	   <th  align="left" ><span class="Estilo8">Instalaciones</span></th>
        <td><input name="instala" type="text" class="campo" id="instala" value="<?php echo $instala; ?>" size="14" maxlength="14" readonly="" ></td>
		<td align="left"><span class="Estilo14"> Problematica Juridica</span> </td>
        <td  ><input name="proble" type="text" class="campo" id="proble" value="<?php echo $proble; ?>"size="20" maxlength="20" readonly="" ></td>
		</tr>
	 <tr>
	 <td align="left"><span class="Estilo16"> Fecha Certificado</span> </td>
        <td  ><input name="proble" type="text" class="campo" id="proble" value="<?php echo $certi; ?>"size="10" maxlength="10" readonly="" ></td>
	 </tr>
  		<TR>
	   <th  align="left" ><span class="Estilo8">Gestion Veedor:</span></th>
<td colspan="3" align="center" ><div align="justify" class="Estilo23">
  <textarea name="gestion" cols="90" rows="6" class="Estilo2" readonly="readonly"><?php echo $gestion ?>
    </textarea>
</div></td>
	</TR>
    </table>
    </fieldset></td>
  </tr>

</table> 

    
  <tr bgcolor="#FFCC99">
    <td height="20" bgcolor="#99CCFF"><div align="center">
<input name="concretado" type="submit"  class="Estilo2"  value ="GUARDAR CERTIFICADO" >	

    </div></td>
  </tr>
<br>
<br>

</table>
</form>
</body>


	<p align="center">
	 <input name="menu" type="button" class="Estilo3" id="menu" onClick="window.location.href='menu_telemercadeo.php'" value="MENU TELEMERCADEO" />
	 	
	 	</p>