<?php
   //solicitamos archivo de conexion a mysql
  // require_once('connection.php');
   //si an pulsado el boton de enviar
 $conexion=mysql_connect('localhost','educaci6_alhue','chile2020');
 mysql_select_db('educaci6_sistemas',$conexion);

       $codigo=stripslashes($_POST["codigo"]);
	  $nombre =stripslashes($_POST["nombre"]);
	  $rut=stripslashes($_POST["rut"]);
	  $cancela_por=stripslashes($_POST["cancela_por"]);
	  $detalle=stripslashes($_POST["detalle"]);
	  $fecha=stripslashes($_POST["fecha"]);
	  $ingresado_por=stripslashes($_POST["ingresado_por"]);
	  
	  //$enviar=$_POST["enviar"];
 // if(isset($enviar))
  {
  //grupo de variables enviadas mediante metodo post desde el formulario
	  //comprobamos si el numero de folio de la solicitud existe en la base de datos
	  //si existiera no haremos nada!. Mediante un query
	  $comprobar="select * from   ingresos where codigo=\"$codigo\"";
	  //Enviamos el query a Mysql mediante la funcion de PHP mysql_query()
	  $r_ide=mysql_query($comprobar,$conexion) or die("Error en el query: ".mysql_error());
	  //Vemos si el query nos mando registros y cuantos mediante mysql_num_rows()
	  $nr_ide=mysql_num_rows($r_ide);
	    //Es decir si devolvio registros
		if($nr_ide>0)
		{
			//Mandamos un script java con notificacion
      echo"<script type=\"text/javascript\">alert(' Error al hacer el ingreso . Intente nuevamente.'); window.location='nuevabitacoras.php';</script>"; 
		}
		//procedemos a guardar el registro
		else
		{
			//Construimos el query!
			$insertar="insert into ingresos(codigo,nombre,rut,cancela_por,detalle,fecha,ingresado_por) 
			values (";
			$insertar.="\"$codigo\",\"$nombre\",\"$rut\",\"$cancela_por\",\"$detalle\",\"$fecha\",\"$ingresado_por\")";
			
			//enviamos el query mediante la funcion mysql_query()
			mysql_query($insertar, $conexion) or die("Error en el query: ".mysql_error());
			mysql_close($conexion);
			
	
	
			
		}
  }

?>
<html> 
<head> 
<title>Reporte :: I.Municipalidad de Alhué</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 

	
		<link  href="reportes.css" rel="stylesheet" type="text/css" media="screen"/>
<style type="text/css"> 
<!--  
.tit { 
 font-family: Verdana, Arial, Helvetica, sans-serif; 
 font-size: 9px; 
 color: #FFFFFF; 
} 
.prod { 
 font-family: Verdana, Arial, Helvetica, sans-serif; 
 font-size: 9px; 
 color: #333333; 
} 
h1 { 
 font-family: Verdana, Arial, Helvetica, sans-serif; 
 font-size: 20px; 
 color: #990000; 
} 
.catalogo {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
	color: #333333;
}
.Estilo10 {	font-size: 18px;
	color: #000000;
}
.Estilo12 {
	font-size: 12;
	font-weight: bold;
}
.Estilo14 {font-size: 12}
.Estilo17 {
	font-size: 12px;
	font-weight: bold;
}
--> 
</style> 
<script type="text/javascript">
function mostrar(id) {
	if (id == "Correo") {
		$("#Correo").show();
		$("#Correo_postal").hide();
	
	}
	
	if (id == "Correo_postal") {
		$("#Correo").hide();
		$("#Correo_postal").show();
		
	}
	
	if (id == "selecciona4") {
		$("#Correo").hide();
		$("#Correo_postal").hide();
		
	}
	
	if (id == "paro") {
		$("#estudiante").hide();
		$("#trabajador").hide();
		$("#autonomo").hide();
		$("#paro").show();
	}
}
</script>
 <script type="text/javascript">
function mostrarenvio(id) {
	if (id == "Envio_Correo") {
		$("#Envio_Correo").show();
		$("#Recepcion_Correo_Postal").hide();
	
	}
	
	if (id == "Recepcion_Correo_Postal") {
		$("#Envio_Correo").hide();
		$("#Recepcion_Correo_Postal").show();
		
	}
	
	
	
	
}
</script>
<script type="text/javascript">
imprime_reclamo = function()

{
	window.alert('Gracias!!');
	setTimeout("location.href='solicitar.php'", 10000);
    window.print();
    document.getElementById('area_opcion_imprimir').style.display='none'; 
}
</script>
</head> 
 
<body>
<p align="center">

<div id="area_opcion_imprimir" style="margin-bottom:2px;"> 
  <div align="center"><img src="http://municipalidadalhue.cl/infotransparencia/imprimir.png" id="print" height="50" width="50" border="0" title="Imprimir Reclamo" alt="Imprimir" style="cursor:pointer" onClick="imprime_reclamo();"/>&nbsp;</div>
</div>
<table width="763" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr bgcolor="#333333" class="tit">
    <td width="171">&nbsp;</td>
    <td width="201">&nbsp;</td>
    <td colspan="2" align="center">&nbsp;</td>
    <td width="67" align="center">&nbsp;</td>
    <td width="133" align="center">&nbsp;</td>
  </tr>
  
  
  <tr bgcolor="" class='prod'>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="118" align="center">&nbsp;</td>
    <td colspan="3" align="center">&nbsp;</td>
  </tr>
  <tr bgcolor="" class='prod'>
    <td colspan="6"><div align="center"><span class="trabajadorPic Estilo10"> I.Municipalidad de Alhu&eacute; </span>
    </div>      
      <div align="left"></div></td>
  </tr>
  <tr bgcolor="" class='prod'>
    <td colspan="6"><div align="center"><span class="trabajadorPic Estilo10">Direcci&oacute;n de Administraci&oacute;n y Finanzas</span></div>
      <div align="center"></div>      <div align="center"></div></td>
  </tr>
  <tr bgcolor="" class='prod'>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td align="center">&nbsp;</td>
    <td colspan="3" align="center">&nbsp;</td>
  </tr>
  <tr bgcolor="" class='prod'>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td align="center">&nbsp;</td>
    <td colspan="3" align="center"><div align="left"></div></td>
  </tr>
</table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr bgcolor="#333333" class="tit">
      <td width="174">&nbsp;</td>
      <td width="133">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
      <td width="55" align="center">&nbsp;</td>
      <td width="62" align="center">&nbsp;</td>
    </tr>
    <form name="solicitud" action="actualizaregistro.php" method="post">
    
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="3" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td><span class="Estilo12">N&deg; de Folio : </span></td>
      <td><span class="Estilo14">
      <?php  echo $codigo; ?>
      </span></td>
      <td align="center"><span class="Estilo14"><strong>Fecha Ingreso:</strong></span></td>
      <td colspan="3" align="center"><div align="left" class="Estilo14"><?php  echo $fecha; ?>
      </div></td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="3" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="#333333" class="tit">
      <td colspan="2">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="3" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td><span class="Estilo12">Cedula de identidad  : </span></td>
      <td><span class="Estilo14">
     <?php  echo $rut; ?>
      </span></td>
      <td width="181" align="center"><div align="center" class="Estilo14"><strong>Nombres:</strong></div></td>
      <td colspan="3" align="center"><div align="left" class="Estilo14">
       <?php  echo $nombre; ?>
      </div></td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td height="13">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="3" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td width="145">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>

    </tr>
    <tr bgcolor="" class='prod'>
      <td><span class="Estilo12">Concepto de ingreso: </span></td>
      <td colspan="2"><span class="Estilo14">
      <?php  echo $cancela_por; ?>
      </span></td>
      <td colspan="3" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="#333333" class="tit">
      <td colspan="4"><span class="Estilo17">Detalle:</span></td>
      <td align="center">&nbsp;</td>
      <td align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="4" rowspan="5"><span class="Estilo14">
     <?php  echo $detalle; ?>
      </span></td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="#333333" class="tit">
      <td colspan="4">&nbsp;</td>
      <td align="center">&nbsp;</td>
      <td align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="4">&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td><span class="Estilo12">Ingresado Por  :</span></td>
      <td><span class="Estilo14">
        <?php  echo $ingresado_por; ?>
      </span></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="2"><div align="center" class="Estilo17">Timbre / Firma </div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="2" align="center" bgcolor="#333333" class="tit">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
    <tr bgcolor="" class='prod'>
      <td colspan="6"><p>&nbsp;</p></td>
    </tr>
    
    <tr bgcolor="" class='prod'>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2" align="center">&nbsp;</td>
    </tr>
</table>
  
  
  <p>&nbsp;</p>
<div align="center"><br>
</div>
<div align="center"></div> 
</body> 
</html> 