Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/04/2005, 14:03
dancresi
 
Fecha de Ingreso: marzo-2005
Mensajes: 372
Antigüedad: 19 años, 1 mes
Puntos: 1
Problema con un select

Hola amigos tengo este codigo en php y mysql que se trata de lleno 3 combo box el primero es de direcciones que llena el 2 combobox que son departamentos dependiendo la direccion seleccionada, a su vez el departamento llena el ultimo combo box que son documentos dependiendo el departamento esto si me queda lo que no me sale es mandar imprimir el resultado que seria el combobox de documentos o sea el ultimo, quiero que lo imprima en un pdf que tambien ya lo tengo no se como vincular el id o nombre del documento con mi script de mi pdf. muestro mi codigo de los combobox.


<form name="form1" method="post >
<select name="direccion_lugarhechos" class ="selec" onChange="document.form1.submit()">
<option value="0" label="direccion_lugarhechos"> seleccione una direccion </option>
<?
include("conex_sie.php");
$link=Conectarse();
$querydireccion="select * from cat_direccion order by direccion";
$resultadoquerydireccion=mysql_query($querydirecci on,$link);
while($recorridodireccion=mysql_fetch_array($resul tadoquerydireccion))
{
if($direccion_lugarhechos==$recorridodireccion[id_direccion])
{
print "<option value=$recorridodireccion[id_direccion] selected>$recorridodireccion[direccion]</option>";
$iddireccion=$recorridodireccion[id_direccion];
}
else
{
print "\r\n<option VALUE=$recorridodireccion[id_direccion]>$recorridodireccion[direccion]</OPTION>";
}
}
?>
</select>

<select name="departamento_lugarhechos" class="selec" onChange="document.form1.submit()">
<option value="0" label="departamento_lugarhechos">seleccione un departamento</option>
<?
$querydepartamento="select * from cat_depto where id_direccion='$iddireccion' order by departamento";
$resultadoquerydepartamento=mysql_query($querydepa rtamento,$link);

while($recorridodepartamento=mysql_fetch_array($re sultadoquerydepartamento))
{
if($departamento_lugarhechos==$recorridodepartamen to[id_depto])
{
print "<option value=$recorridodepartamento[id_depto] selected> $recorridodepartamento[departamento]</option>";
$iddepartamento=$recorridodepartamento[id_depto];

}
else
{
print"<option VALUE=$recorridodepartamento[id_depto]>$recorridodepartamento[departamento]</OPTION>";
}
}
?>
</select>

<select name="documento_lugarhechos" class="selec" onChange="document.form1.submit()">
<option value="0" label="documento_lugarhechos" >selecciona un documento</option>
<?
$querydocumento="select distinct distinct * from checkbox where id_depto='$iddepartamento'";
$resultadoquerydocumento=mysql_query($querydocumen to,$link);
while($recorridodocumento=mysql_fetch_array($resul tadoquerydocumento))
{
if($documento_lugarhechos==$recorridodocumento[id_depto])
{
print "<option value=$recorridodocumento[documento] selected>$recorridodocumento[documento]</option>";
$iddocumento=$recorridodocumento[documento];
$documento=$recorridodocumento[documento];
}
else
{
print "<option VALUE=$recorridodocumento[id_depto]>$recorridodocumento[documento]</OPTION>";
}
}

?>
</form>

y el codigo de mi pdf es

<?
include("conex_sie.php");
$link=Conectarse();
$sql="select * from nota_sie";
$res=mysql_query($sql,$link);
$row=mysql_fetch_array($res);
$dir=$row[direccion];
$depto=$row[departamento];
$titular=$row[titular];
$area_solic=$row[area_solic];
$cuerpo=$row[cuerpo];
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_begin_page($pdf, 595, 842);
$font = pdf_findfont($pdf, "Times New Roman", "winansi", 1);
if ($font) {
pdf_setfont($pdf, $font, 10);
}
pdf_set_value($pdf, "textrendering", 0);
pdf_show_xy($pdf, "SECRETARÍA DE EDUCACIÓN", 160, 790);
pdf_show_xy($pdf, "INSTITUTO DE LA EDUCACION BASICA EN EL ESTADO DE MORELOS", 160, 780);
pdf_show_xy($pdf, "$dir", 160, 770);
pdf_show_xy($pdf, "$depto", 160, 760);
pdf_show_xy($pdf, "$titular", 110, 620);
pdf_show_xy($pdf, "$area_solic", 110, 610);
pdf_show_xy($pdf, "P R E S E N T E", 110, 600);
$imagen=pdf_open_jpeg($pdf,"./imagenes/tierra.jpg");
$x1=pdf_get_value($pdf, "imagewidth", $imagen);
$y1=pdf_get_value($pdf, "imageheight", $imagen);
pdf_place_image($pdf, $imagen, 60, 680, 0.50);
pdf_close_image($pdf,$imagen);
$imagen2=pdf_open_jpeg($pdf,"./imagenes/linea.jpg");
$x1=pdf_get_value($pdf, "imagewidth", $imagen2);
$y1=pdf_get_value($pdf, "imageheight", $imagen2);
pdf_place_image($pdf, $imagen2, 50, 5, 0.80);
pdf_close_image($pdf,$imagen2);
$imagen1=pdf_open_jpeg($pdf,"./imagenes/morelos.jpg");
$x1=pdf_get_value($pdf, "imagewidth", $imagen1);
$y1=pdf_get_value($pdf, "imageheight", $imagen1);
pdf_place_image($pdf, $imagen1, 60, 55, 0.55);
pdf_close_image($pdf,$imagen1);
pdf_show_boxed($pdf,$cuerpo,110,400,430,150,"justi fy");
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
header("Content-type: application/pdf");
header("Content-disposition: inline; filename=test.pdf");
header("Content-length: " . strlen($data)); // desplegar los datos del buffer como PDF
echo $data;
?>
por favor si alguin sabe como hacerlo se agradeceria mucho.