Foros del Web » Programando para Internet » PHP »

Ayuda con cun form

Estas en el tema de Ayuda con cun form en el foro de PHP en Foros del Web. Lo siento amigos si este tema no va en esta seccion es que la puse en script y nadie me responde U_u lo que necesito ...
  #1 (permalink)  
Antiguo 10/12/2009, 12:36
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Ayuda con cun form

Lo siento amigos si este tema no va en esta seccion
es que la puse en script y nadie me responde U_u

lo que necesito es tener un boton de imprecion
que mande a imprimir los datos ingresados en un formaulario de registro en una hoja diseñada con espacios en balnco donde estaran esos datos

aparte de eso tengo una hoja de exel que ya usava antes en la que se llenaban las datos y se mandaba imprimir ene tas hojas diseñadas sin prblemas

entonces quiero emplearla

deseo poder mandar los datos que se rellenan en el form a los campos en la hoja de excel y que la imprima

estoy intentando utilizar esto


Código:
   $success = "ok";
    $error = "error";
    
    $lbChar = "new line";        
    
    if($_POST){
        $array = $_POST;
    } else if($_GET){            
        $array = $_GET;
    } else {
            die("You must Access this file through a form.");    
    }    
    if(!$array['filename']){
        $array['filename'] = "form.xls";
    } else {
        if(!(stristr($array['filename'],".xls"))){
            $array['filename'] = $array['filename'] . ".xls";
        }
    }
    
    $tab = "\t";    //chr(9);
    $cr = "\n";        //chr(13);
    
    if($array){
            
            $keys = array_keys($array);
            foreach($keys as $key){
                if(strtolower($key) != 'filename' && strtolower($key) != 'title'){ 
                    $header .= $key . $tab;
                }
            }
            $header .= $cr;
            
            //Make the line with the contents to write to the excel file.
            foreach($keys as $key){
                if(strtolower($key) != 'filename' && strtolower($key) != 'title'){ 

                    $array[$key] = str_replace("\n",$lbChar,$array[$key]);
                    $array[$key] = preg_replace('/([\r\n])/e',"ord('$1')==10?'':''",$array[$key]);
                    $array[$key] = str_replace("\\","",$array[$key]);
                    $array[$key] = str_replace($tab, "    ", $array[$key]);
                    $data .= $array[$key] . $tab ;
                }
            }
            $data .= $cr;
            
            if (file_exists($array['filename'])) {
                $final_data = $data;        
            } else {
                $final_data = $header . $data;        
            }
            // open the file and write to it
            
            $fp = fopen($array['filename'],"a");
            
            if($fp){
                
                fwrite($fp,$final_data);    
                fclose($fp);        
                // Success
                header("Location: $success");
            } else {
                // Error
                header("Location: $error");
            }
    }

es de un archivo de internet que encontre espero me pueda ayudar
  #2 (permalink)  
Antiguo 10/12/2009, 12:48
Avatar de jackson666  
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Ayuda con cun form

Cita:
Iniciado por rastafinis Ver Mensaje

[...]
lo que necesito es tener un boton de imprecion

[...]

aparte de eso tengo una hoja de exel que ya usava antes en la que se llenaban las datos y se mandaba imprimir ene tas hojas diseñadas sin prblemas

[...]
Hombre, por favor, la ortografia... Yo no soy profesor de lengua y literatura pero te pasaste!

Lo que queres hacer se hace con javascript me parece, y si necesitas chequear los datos, con AJAX

PHP no puede imprimir directamente
  #3 (permalink)  
Antiguo 10/12/2009, 13:03
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

descuida con el teclado escribo por escribir me lo han dicho muchas veces si es cierto para mi trabajo tengo mas cuidado.

pero ya lo mande ahi man y nadie dice nada ni se inmutan U_U
  #4 (permalink)  
Antiguo 10/12/2009, 13:24
Avatar de jackson666  
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Ayuda con cun form

Cita:
Iniciado por rastafinis Ver Mensaje
descuida con el teclado escribo por escribir me lo han dicho muchas veces si es cierto para mi trabajo tengo mas cuidado.

pero ya lo mande ahi man y nadie dice nada ni se inmutan U_U
Y bue.... somos nos tomamos tranka el laburo che... tampoco vamos a ir a las corridas (?)

Código HTML:
<script language='javascript'>
var xhr;
function startAjax(){
    if(window.XMLHttpRequest){
        xhr=new XMLHttpRequest();
    }else if(window.ActiveXobject){
        xhr=new ActiveXObject("Microsoft.XMLHTTP");
    }
    
var v1=document.getElementById("idDeTuInputAChequear").value;
var v2=document.getElementById("idDeTuInputAChequear").value;
var v3=document.getElementById("idDeTuInputAChequear").value;

xhr.open("GET","check.php?v1="+v1+"&v2="+v2+"&v3="+v3);
xhr.onreadystatechange=function(){
                        	if(xhr.readyState==4){
	                           if(xhr.status==200){
	                               if(xhr.responseText=="el echo del php"){
                                            /* lanzas la funcion de imprimir javascript 
                                                 que calculo q se llama print() =P */
                                      }else{
                                              //avisas que los datos estan mal
                                        }
                                   }
                              }
                         }
xhr.send(null);
}
</script> 
NOTA: en tu boton que hace submit al form ponele onclick="startAjax()"

NOTA2: te dejo de regalo la funcion imprimir en js y la del chequeo en php =)

NOTA3: en el php haces $_GET['v1'], idem con las demas
  #5 (permalink)  
Antiguo 10/12/2009, 13:45
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

Gracias lo veo y te aviso buena bribra man
  #6 (permalink)  
Antiguo 10/12/2009, 13:48
Avatar de jackson666  
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Ayuda con cun form

Cita:
Iniciado por rastafinis Ver Mensaje
Gracias lo veo y te aviso buena bribra man
No hay porque loco! Si te sobra un karma, bienvenido sea! =P
  #7 (permalink)  
Antiguo 10/12/2009, 14:28
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

bueno lo probe

ise el submit al form como me disjite

Código:
<input type="submit" value="Imprimir" onclick="startAjax()">
pero me temo que me falta check.php

por que el boton guardo lo insertado en la base de datos y no mando a imprimir
  #8 (permalink)  
Antiguo 10/12/2009, 14:33
Avatar de jackson666  
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Ayuda con cun form

es q el type del input debe ser button, no submit
ponete el codigo del formulario q lo vemos
  #9 (permalink)  
Antiguo 10/12/2009, 14:47
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

bueno aqui el code es largo si no da lo pondre en dos post

Código:
<?
include("Configuracionweb.php");
?>

<?
if (empty($lang['securitylevel'])) { $lang['securitylevel'] = 'LOW'; }
if ($lang['securitylevel'] == 'HIGH') {
include("validate.php"); }
?>


<style type="text/css">
<!--
.generalNews { font-size: 13px; padding:5px 10px 10px 10px; }
tr.embedd td { border-right: 0; border-top: 0; }
div.hdl { position: relative; padding-bottom: 1px; padding-top: 1px; padding-left: 5px; }
div.boton1 {
	position: static;
	padding-bottom: 1px;
	padding-top: 1px;
	padding-left: 5px;
	height: 15px;
	width: 65px;
	background-color: #31ADBB;
	left: 55px;
	background-position: center center;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	color: #FFF;
}

div.bloqueinsertar {
	position: fixed;
	padding-bottom: 1px;
	padding-top: 3px;
	padding-left: 3px;
	height: auto;
	width: 555px;
	background-color: #FFF;
	background-position: left top;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	color: #999;
}


.colortextosnoticia { color: #CCC; }
-->
</style>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "TR/html4/loose.dtd">
<html>
<script type="text/javascript">
<!--
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>

<SCRIPT language="JavaScript">
function verifica2(form)
{
	//validacion de la fecha de nacimiento del evaluado
	if(document.form2.ndi3.value.length==0)
	{
	 alert ("Por favor escriba la fecha de nacimiento del evaluado");
	 document.form2.ndi3.focus();
	}

else document.form2.submit();
}

function verifica3(form)
{
	//validacion de la fecha de nacimiento del evaluado
	if(document.form3.dni.value.length==0)
	{
	 alert ("Por favor escriba la fecha de nacimiento del evaluado");
	 document.form3.dni.focus();
	}

else document.form3.submit();
}

function verifica(form)
{
	//validacion de input numero de informe
	if(document.form1.numerodeinforme.value.length==0)
	{
	 alert ("Por favor escriba el número del informe.");
	 document.form1.numerodeinforme.focus();
	}
	//validacion de fecha de informe
	if(document.form1.fechadeinforme.value.length==0)
	{
	 alert ("Por favor escriba la fecha del informe.");
	 document.form1.fechadeinforme.focus();
	}
	//validacion de fecha de inicio en el cuadro evaluación médica
	if(document.form1.EMfechadeinicio.value.length==0)
	{
	 alert ("Por favor escriba la fecha de inicio en el cuadro Evaluación Médica.");
	 document.form1.EMfechadeinicio.focus();
	}
	//validacion de fecha de término en el cuadro evaluación médica
	if(document.form1.EMfechadetermino.value.length==0)
	{
	 alert ("Por favor escriba la fecha de término en el cuadro Evaluación Médica.");
	 document.form1.EMfechadetermino.focus();
	}
	//validacion del apellido paterno
	if(document.form1.apellidopaterno.value.length==0)
	{
	 alert ("Por favor escriba el apellido paterno del evaluado");
	 document.form1.apellidopaterno.focus();
	}
	//validacion del apellido materno
	if(document.form1.apellidomaterno.value.length==0)
	{
	 alert ("Por favor escriba el apellido materno del evaluado");
	 document.form1.apellidomaterno.focus();
	}
	//validacion del nonbre
	if(document.form1.nombres.value.length==0)
	{
	 alert ("Por favor escriba: nombre(s) del evaluado");
	 document.form1.nombres.focus();
	}
	//validacion del numero de documento
	if(document.form1.numerodedocumento.value.length==0)
	{
	 alert ("Por favor escriba el numero de documento del evaluado");
	 document.form1.numerodedocumento.focus();
	}
	//validacion de la fecha de nacimiento del evaluado
	if(document.form1.fechadenacimiento.value.length==0)
	{
	 alert ("Por favor escriba la fecha de nacimiento del evaluado");
	 document.form1.fechadenacimiento.focus();
	}

else document.form1.submit();

}

function resetar(form)
{
 document.form1.reset();
}

function LP_data(e){
key=(document.all) ? e.keyCode : e.which;
if (key < 48 || key > 57){
alert("solo se pueden ingresar numeros");
return false;
}
return true;
}

function IsNumeric(valor)
{
var log=valor.length; var sw="S";
for (x=0; x<log; x++)
{ v1=valor.substr(x,1);
v2 = parseInt(v1);
//Compruebo si es un valor numérico
if (isNaN(v2)) { sw= "N";}
}
if (sw=="S") {return true; } else {return false; }
}

var primerslap=false;
var segundoslap=false;

function formateanumeros(numeross)
{
var longg = numeross.length;
var nummm;
if ((longg>=8) && (primerslap==false)) { nummm=numeross.substr(0,8);
if ((IsNumeric(nummm)==true) && (nummm<=55555555) && (nummm!="00000000")) { numeross=numeross.substr(0,8); primerslap=true; }
else { numeross=""; primerslap=false;}
}
else
{ nummm=numeross.substr(0,1);
if (IsNumeric(nummm)==false)
{numeross="";}
}
return (numeross);
}

function formatealcohol(numerosss)
{
var longgg = numerosss.length;
var nummmm;
if ((longgg>=1) && (primerslap==false)) { nummmm=numerosss.substr(0,1);
if ((IsNumeric(nummmm)==true) && (nummmm<=8)) { numerosss=numerosss.substr(0,1)+"."; primerslap=true; }
else { numerosss=""; primerslap=false;}
}
else
{ nummmm=numerosss.substr(0,1);
if (IsNumeric(nummmm)==false)
{numerosss="";}
}
return (numerosss);
}

function formateafecha(fecha)
{
var long = fecha.length;
var dia;
var mes;
var ano;

if ((long>=2) && (primerslap==false)) { dia=fecha.substr(0,2);
if ((IsNumeric(dia)==true) && (dia<=31) && (dia!="00")) { fecha=fecha.substr(0,2)+"/"+fecha.substr(3,7); primerslap=true; }
else { fecha=""; primerslap=false;}
}
else
{ dia=fecha.substr(0,1);
if (IsNumeric(dia)==false)
{fecha="";}
if ((long<=2) && (primerslap=true)) {fecha=fecha.substr(0,1); primerslap=false; }
}
if ((long>=5) && (segundoslap==false)) { mes=fecha.substr(3,2);
if ((IsNumeric(mes)==true) &&(mes<=12) && (mes!="00")) { fecha=fecha.substr(0,5)+"/"+fecha.substr(6,4); segundoslap=true; }
else { fecha=fecha.substr(0,3);; segundoslap=false;}
}
else { if ((long<=5) && (segundoslap=true)) { fecha=fecha.substr(0,4); segundoslap=false; } }
if (long>=7) { ano=fecha.substr(6,4);
if (IsNumeric(ano)==false) { fecha=fecha.substr(0,6); }
else { if (long==10){ if ((ano==0) || (ano<1900) || (ano>2100)) { fecha=fecha.substr(0,6); } } }
}

if (long>=10)
{
fecha=fecha.substr(0,10);
dia=fecha.substr(0,2);
mes=fecha.substr(3,2);
ano=fecha.substr(6,4);
// Año no viciesto y es febrero y el dia es mayor a 28
if ( (ano%4 != 0) && (mes ==02) && (dia > 28) ) { fecha=fecha.substr(0,2)+"/"; }
}
return (fecha);
} 

</SCRIPT>
  #10 (permalink)  
Antiguo 10/12/2009, 14:49
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

Código:
<script language='javascript'>
var xhr;
function startAjax(){
    if(window.XMLHttpRequest){
        xhr=new XMLHttpRequest();
    }else if(window.ActiveXobject){
        xhr=new ActiveXObject("Microsoft.XMLHTTP");
    }
    
var v1=document.getElementById("numerodeinforme").value;
var v2=document.getElementById("fechadeinforme").value;
var v3=document.getElementById("EMfechadeinicio").value;

xhr.open("GET","check.php?v1="+v1+"&v2="+v2+"&v3="+v3);
xhr.onreadystatechange=function(){
                        	if(xhr.readyState==4){
	                           if(xhr.status==200){
	                               if(xhr.responseText=="el echo del php"){
                                            /* lanzas la funcion de imprimir javascript 
                                                 que calculo q se llama print() =P */
												print() 
                                      }else{
                                              //avisas que los datos estan mal
                                        }
                                   }
                              }
                         }
xhr.send(null);
}
</script>





<head>
<title>Directorio Médico</title>
<meta http-equiv="Content-Type" content="text/html;charset=Windows_1258">
<link href="interna.css" rel="stylesheet" type="text/css">
</head>

<body>




<table width="700" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td bgcolor="#CCCCCC"><div align="center">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="../../imagenes/ficha_sup.jpg" width="700" height="19"></td>
              </tr>
  


              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="18%"><div align="right"><img src="../../imagenes/logoficha.jpg" width="124" height="78"></div></td>
                        <td width="82%" valign="top" bgcolor="#0061A6">
                        
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="12" bgcolor="#7ED5DE">&nbsp;</td>
                          </tr>
                          <tr>
                            <td height="50"><div align="right"><img src="../../imagenes/impresora_ico.png" width="45" height="45"></div></td>
                          </tr>
                          <tr>
                            <td height="12" bgcolor="#FFFFFF">
                            
                      
                            
                            </td>
                          </tr>
                        </table>
                          
                          
                          
                          
                        </td>
                        
                        
                        </tr>
                      <tr>
                        <td></td>
                        <td rowspan="6" valign="top" bgcolor="#0061A6">
                        
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="2%" height="12"></td>
                            <td width="96%" height="12"></td>
                            <td width="2%" height="12"></td>
                          </tr>
                          <tr>
                            <td height="434" >&nbsp;</td>
                            <td height="434" width="600" align="left" valign="top"><div class="bloqueinsertar" id="bloqueinsertar">
                            
<form name="form1" id="form1" action="new.php" method="post">
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
  <td width="116" height="22" bgcolor="#E8F7F9" class="ficha_desc_izq">Nro. de Informe:</td>
  <td colspan="3"><input name="numerodeinforme" id="numerodeinforme" type="text" style="color:#FF0000" onKeyUp = "this.value=formateanumeros(this.value);" value="" size="8" maxlength="8"></td>
  <td width="20"></td>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Fecha de Informe:</td>
  <td colspan="2"><input style="color:#FF0000" type="text" size="10" name="fechadeinforme" id="fechadeinforme" maxlength="10" onKeyUp = "this.value=formateafecha(this.value);" value=""></td>
  <td width="20"></td>
  <td width="26"></td>
  <td width="24"></td>
  <td width="20"></td>
  </tr>

<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>

  <tr>
    <td colspan="4" class="MVertical2_TITULO">EVALUACI&Oacute;N M&Eacute;DICA:      </td>
    <td></td>
<td colspan="6" class="MVertical2_TITULO">REEVALUACI&Oacute;N JUNTA M&Eacute;DICA:</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
  <td></td>
<td width="1"></td>
<td width="54"></td>
<td width="41"></td>
<td></td>
<td width="95"></td>
<td width="20"></td>
<td width="11"></td>
<td width="46"></td>
<td width="54"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
  <td height="8" bgcolor="#E8F7F9"><span class="ficha_desc_izq">Fecha de inicio:</span></td>
  <td height="8" colspan="3"><span class="MVertical2_TITULO">
    <input style="color:#FF0000" type="text" size="10" name="EMfechadeinicio" id="EMfechadeinicio" maxlength="10" onKeyUp = "this.value=formateafecha(this.value);" value="">
  </span></td>
  <td height="8"></td>
  <td height="8" colspan="3" bgcolor="#E8F7F9"><span class="ficha_desc_izq">Fecha de inicio:</span></td>
  <td height="8" colspan="2"><input style="color:#FF0000" type="text" size="10" name="RMfechadeinicio" maxlength="10" onKeyUp = "this.value=formateafecha(this.value);" value=""></td>
  <td height="8"></td>
  <td height="8"></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Fecha de t&eacute;rmino:</td>
  <td colspan="3"><input style="color:#FF0000" type="text" size="10" name="EMfechadetermino" maxlength="10" onKeyUp = "this.value=formateafecha(this.value);" value=""></td>
  <td></td>
  <td colspan="3" bgcolor="#E8F7F9"><span class="ficha_desc_izq">Fecha de t&eacute;rmino:</span></td>
  <td colspan="2"><input style="color:#FF0000" type="text" size="10" name="RMfechadetermino" maxlength="10" onKeyUp = "this.value=formateafecha(this.value);" value=""></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td colspan="5" class="MVertical2_TITULO">INFORMACI&Oacute;N DEL EVALUADO:</td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>

<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Apellido Paterno:</td>
  <td colspan="3"><span class="ficha_desc_izq">
    <input style="color:#FF0000" type="text" size="15" name="apellidopaterno" value="">
  </span></td>
  <td></td>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Tipo de Documento:</td>
  <td colspan="6" class="MVertical1">DNI:
      <input name="tipodedocumento" type="radio" value="1">
      Carnet Extrang.
      <input name="tipodedocumento" type="radio" value="2">
 </td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Apellido Materno:</td>
  <td colspan="3"><span class="ficha_desc_izq">
    <input style="color:#FF0000" type="text" size="15" name="apellidomaterno" value="">
  </span></td>
  <td></td>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Nro. de Documento:</td>
  <td colspan="2"><span class="ficha_desc_izq">
    <input style="color:#FF0000" type="text" size="8" maxlength="8" name="numerodedocumento" onKeyUp = "this.value=formateanumeros(this.value);" value="">
  </span></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Nombres:</td>
  <td colspan="3"><span class="ficha_desc_izq">
    <input style="color:#FF0000" type="text" size="15" name="nombres" value="">
  </span></td>
  <td></td>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Fecha de Nacimiento:</td>
  <td colspan="2"><span class="ficha_desc_izq">
    <input style="color:#FF0000" type="text" size="10" name="fechadenacimiento" maxlength="10" onKeyUp = "this.value=formateafecha(this.value);" value="">
  </span></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td colspan="10" class="MVertical2_TITULO">CLASE, CATEGOR&Iacute;A Y CONDICI&Ograve;N DEL POSTULANTE:</td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Clase y Categor&iacute;a:</td>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Lic. N&uacute;eva:</td>
  <td>
    <input type="radio" name="licencias" value="1"> 
  </td>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">
  #11 (permalink)  
Antiguo 10/12/2009, 14:50
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

Código:
    Revalidaci&oacute;n:</td>
  <td>
  <input type="radio" name="licencias" value="2">
  </td>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Recategorizaci&oacute;n:</td>
  <td>
  <input type="radio" name="licencias" value="3"> 
  </td>
  <td colspan="2" bgcolor="#E8F7F9" class="ficha_desc_izq">Canje:</td>
  <td>
    <input type="radio" name="licencias" value="4"> 
  </td>
  </tr>
<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Clase:</td>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Categor&iacute;a-AI:</td>
  <td>
  <input type="radio" name="categorias" value="1"> 
  </td>
  <td bgcolor="#E8F7F9"><span class="ficha_desc_izq">Categor&iacute;a-AII:</span></td>
  <td>
  <input type="radio" name="categorias" value="2"> 
  </td>
  <td colspan="3" bgcolor="#E8F7F9"><span class="ficha_desc_izq">Categor&iacute;a-AIII:</span></td>
  <td>
  <input type="radio" name="categorias" value="3"> 
  </td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Dictamen:</td>
  <td colspan="5" class="MVertical1">
    Apto:
    <input type="radio" name="dictamen" value="1">
    No Apto:
    <input type="radio" name="dictamen" value="0">
</td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td bgcolor="#E8F7F9" class="ficha_desc_izq">Restricciones:</td>
  <td colspan="5"><span class="MVertical1">Con lentes:
      <input type="radio" name="restricciones" value="1">
Sin Lentes:
 <input type="radio" name="restricciones" value="0">
  </span></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Observaciones del Director:</td>
  <td colspan="11" class="ficha_desc_izq">
    <input style="color:#FF0000" type="text" size="55" name="observaciones" value="">
  </td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Alcoholimetria (cuantitativo):</td>
  <td colspan="3" align="left" valign="middle"><span class="ficha_desc_izq">
    <input style="color:#FF0000" type="text" size="5" name="alcoholimetria" onKeyUp = "this.value=formatealcohol(this.value);" value="">
  grs/dl</span></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
<tr>
  <td height="2" colspan="14" bgcolor="#A4D8FF"></td>
</tr>
<tr>
  <td colspan="3" bgcolor="#E8F7F9" class="ficha_desc_izq">Habitualidad (Cuantitativa):</td>
  <td colspan="2" class="ficha_desc_izq">Cocaina:</td>
  <td class="MVertical1">
  Positivo:
     <input type="radio" name="cocaina" value="1">
  <br>
      Negativo:
      <input type="radio" name="cocaina" value="0">
   </td>
  <td colspan="3"><span class="ficha_desc_izq">Marihuana:</span></td>
  <td colspan="4"><span class="MVertical1">Positivo:
    <input type="radio" name="marihuana" value="1">
    <br>
    Negativo:
    <input type="radio" name="marihuana" value="0">
  </span></td>
  <td></td>
  </tr>
</table>
<table width="372" height="15" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="15">*</td>
    <td width="243"><a href="javascript: verifica(this)"><img src="../../imagenes/gravar.gif" width="82" height="20" border="0" /></a><input type="button" value="Imprimir" onclick="startAjax()"></td>
    <td width="113"><a href="javascript: resetar(this)"><img src="../../imagenes/reset.gif" width="82" height="20" border="0" /></a></td>
  </tr>
</table>
</form>
                            </div>
                            
                            
                            <div class="bloqueinsertar" id="bloqueieditar" style="visibility:hidden">
                              <table width="400" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
    
    <form name="form2" action="editardatos.php" method="get">
                                <table width="200" border="0" cellspacing="0" cellpadding="0">
								    <tr>
                                    <td class="Contenido" scope="col">
                                    
                                    <table width="200" height="46" border="0" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <td width="114" class="MVertical1"><div align="left">
                                          *N&uacute;mero de Informe:<br>
                                         (Obligatorio)
                                        </div></td>
                                  
                                        <td width="86"><div align="left">
                                          <input name="ndi3" type="text" onKeyUp = "this.value=formateanumeros(this.value);" id="ndi3"  size="22"/>
                                        </div></td>
                                      </tr>
                                    </table>
                                    
                                    </td>
                                  </tr>
								  
                                  <tr>
                                    <td class="Contenido" scope="col">
                                    
                                    <table width="200" height="15" border="0" cellpadding="0" cellspacing="0">
                                      

                                      <tr>
                                        <td width="18">*</td>
                                        <td width="82"><A href="javascript: verifica2(this)"><img src="../../imagenes/buscar_directorio.jpg" width="82" height="20" border="0" /></a></td>
                                        <td width="100"></td>
                                      </tr>
                                    </table></td>
                                  </tr>
                                </table>
                             
                            </form>
    
    </td>
    <td><form name="form3" action="editardatos2.php" method="get">
                                <table width="200" border="0" cellspacing="0" cellpadding="0">
								    <tr>
                                    <td class="Contenido" scope="col">
                                    
                                    <table width="200" height="46" border="0" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <td width="114" class="MVertical1"><div align="left">
                                          *N&uacute;mero de DNI<br>
                                         (Obligatorio)
                                        </div></td>
                                  
                                        <td width="86"><div align="left">
                                       <input name="dni" type="text" id="dni" onKeyUp = "this.value=formateanumeros(this.value);" size="22"/>
                                        </div></td>
                                      </tr>
                                    </table>
                                    
                                    </td>
                                  </tr>
								  
                                  <tr>
                                    <td class="Contenido" scope="col">
                                    
                                    <table width="200" height="15" border="0" cellpadding="0" cellspacing="0">
                                      

                                      <tr>
                                        <td width="18">*</td>
                                        <td width="82"><A href="javascript: verifica3(this)"><img src="../../imagenes/buscar_directorio.jpg" width="82" height="20" border="0" /></a></td>
                                        <td width="100"></td>
                                      </tr>
                                    </table></td>
                                  </tr>
                                </table>
  #12 (permalink)  
Antiguo 10/12/2009, 14:52
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

Código:
</form></td>
  </tr>
</table>
                             
                            </div>
                            
                                                   
                            
                            

                            </td>
                            <td>&nbsp;</td>
                          </tr>
                          </table></td>
                      
                      </tr>
                      <tr>
                        <td height="21" onMouseOver='this.style.background="#0061A6"' onMouseOut='this.style.background=""'>
                          <div class="boton1" id="boton1" onClick="MM_showHideLayers('bloqueinsertar','','show','bloqueieditar','','hide','bloqueborrar','','hide')">Ingresar</div></td>
                        </tr>
                      <tr>
                        <td height="21" onMouseOver='this.style.background="#0061A6"' onMouseOut='this.style.background=""'>
                          <div class="boton1" id="boton2" onClick="MM_showHideLayers('bloqueinsertar','','hide','bloqueieditar','','show','bloqueborrar','','hide')">Editar</div></td>
                        </tr>
                      <tr>
                        <td height="21">&nbsp;</td>
                      </tr>
                        <tr>
                        <td height="370">&nbsp;</td>
                      </tr>
                    </table>
                    
                    </td>
                  </tr>

                </table>
                
                </td>
              </tr>
              <tr>
                <td bgcolor="7ED5DE"><div align="center">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="18%">*</td>
                      <td width="54%">&nbsp;</td>
                      <td width="18%"><div align="right"><img src="../../imagenes/cerrar_ficha.jpg" width="56" height="36" border="0" usemap="#Map"></div></td>
                      <td width="10%">*</td>
                    </tr>
                  </table>
                </div></td>
              </tr>
            </table></td>
          </tr>
        </table>
      </div></td>
    </tr>
</table>
  
  
  

<map name="Map">
  <area shape="rect" coords="3,4,54,24" href="javascript:window.close()">
</map>
</body>
</html>

a los señores moderadores disculpen el multi post es que el code eres realmente grande U_U

y el maximo numero de caracteres por post era 10000 muy poco diria io aconsejaria aunmetarlo a unos 30000 por lo menos
  #13 (permalink)  
Antiguo 10/12/2009, 19:41
Avatar de jackson666  
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Ayuda con cun form

El check.php

Código PHP:
<?php
$var1
=$_GET['v1'];
$var2=$_GET['v2'];
$var3=$_GET['v3'];

if(isset(
$var1) && isset($var2) && isset($var3)){

#haces todas las comprobaciones que quieras



#al final de todo, si esta bien, mandas la respuesta;

echo "true";

}else{

#si hay algo mal

echo "false";

}
?>
Entonces modificamos el AJAX para que responda a estos valores

Código HTML:
<script language='javascript'>
var xhr;
function startAjax(){
    if(window.XMLHttpRequest){
        xhr=new XMLHttpRequest();
    }else if(window.ActiveXobject){
        xhr=new ActiveXObject("Microsoft.XMLHTTP");
    }
    
var v1=document.getElementById("numerodeinforme").value;
var v2=document.getElementById("fechadeinforme").value;
var v3=document.getElementById("EMfechadeinicio").value;

xhr.open("GET","check.php?v1="+v1+"&v2="+v2+"&v3="+v3);
xhr.onreadystatechange=function(){
                        	if(xhr.readyState==4){
	                           if(xhr.status==200){
	                               if(xhr.responseText=="true"){
                                                  //no se si es esto lo que necesitas
                                                  window.print();   
                                                  return true;                                           
                                      }else{
                                              alert("Datos Incorrectos");             
                                              return false; 
                                        }
                                   }
                              }
                         }
xhr.send(null);
}
</script> 
  #14 (permalink)  
Antiguo 11/12/2009, 01:03
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 17 años, 10 meses
Puntos: 0
Respuesta: Ayuda con cun form

En el code no puedo visualizar el llamado a la hoja de exel?

o solo imprime nada mas?
  #15 (permalink)  
Antiguo 11/12/2009, 06:58
Avatar de jackson666  
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Ayuda con cun form

Cita:
Iniciado por rastafinis Ver Mensaje
En el code no puedo visualizar el llamado a la hoja de exel?

o solo imprime nada mas?
Q se yo ajjajaja
Probaste asi? te hizo algo??
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:23.