Código HTML:
$resultadoMod=$xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("tabla")." WHERE mem_num = $palabra"); if ($xoopsDB->getRowsNum($resultadoMod) == 1){ $row=$xoopsDB->fetchBoth($resultadoMod); $txt_NumMem=$row['mem_num']; $txt_FechaMem=fsalida($row['mem_fecha']); $txt_DestinatarioMemo=$row['mem_destino']; $txt_RemitenteMemo=$row['mem_rem']; $txt_AsuntoMem=$row['mem_asunto']; $txt_ContMem=$row['mem_cont']; }else { echo "<div align="center"><a href="?op=Buscar">Regresar al Buscador</a></div>"; } if (($xoopsUser->isOnline())||$xoopsUser->isAdmin()){ $shtml= "<table border=1 align=center>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td rowspan=2 align=center valign=middle width=482><strong>MEMORANDO</strong></td>"; $shtml=$shtml."<td width=119><strong>N°:</strong>$txt_NumMem</td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td align=left width=119><strong>Fecha:</strong>$txt_FechaMem</td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td valign=top align=left colspan=2>Para: $txt_DestinatarioMemo </td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td valign=top align=left colspan=2>De: $txt_RemitenteMemo </td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td valign=top align=left colspan=2>Asunto: $txt_AsuntoMem </td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td align=justify valign=top class=normal colspan=2 rowspan=43>Contenido:"; $shtml=$shtml."$txt_ContMem"; $shtml=$shtml."</td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."</table>"; $filename = date("d-m-Y")."-Memo-".$txt_NumMem.".xls"; //ruta del archivo a generar $sfile=DIRECTORIO.'/CARPETA/'.$filename; $fp=fopen($sfile,"w"); fwrite($fp,$shtml); fclose($fp); }else{ echo 'negativo'; }
Código HTML:
$resultadoMod=$xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("memos")." WHERE mem_num = $palabra"); if ($xoopsDB->getRowsNum($resultadoMod) == 1){ $row=$xoopsDB->fetchBoth($resultadoMod); $txt_NumMem=$row['mem_num']; $txt_FechaMem=fsalida($row['mem_fecha']); $txt_DestinatarioMemo=$row['mem_destino']; $txt_RemitenteMemo=$row['mem_rem']; $txt_AsuntoMem=$row['mem_asunto']; $txt_ContMem=$row['mem_cont']; }else { echo "<div align="center"><a href="?op=Buscar">Regresar al Buscador</a></div>"; } if (($xoopsUser->isOnline())||$xoopsUser->isAdmin()){ $shtml= "<table border=1 align=center>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td rowspan=2 align=center valign=middle width=482><strong>MEMORANDO</strong></td>"; $shtml=$shtml."<td width=119><strong>N°:</strong>$txt_NumMem</td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td align=left width=119><strong>Fecha:</strong>$txt_FechaMem</td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td valign=top align=left colspan=2>Para: $txt_DestinatarioMemo </td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td valign=top align=left colspan=2>De: $txt_RemitenteMemo </td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td valign=top align=left colspan=2>Asunto: $txt_AsuntoMem </td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."<tr>"; $shtml=$shtml."<td align=justify valign=top class=normal colspan=2 rowspan=43>Contenido:"; $shtml=$shtml."$txt_ContMem"; $shtml=$shtml."</td>"; $shtml=$shtml."</tr>"; $shtml=$shtml."</table>"; $filename = date("d-m-Y")."-Memo-".$txt_NumMem.".xls"; header("Content-Type: application/download"); header("Content-Disposition: attachment; filename="$filename""); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); header("Pragma: public"); print $shtml;
Hay alguna forma de filtrar la salida producida por la funcion header de manera que pueda descargar el archivo exportado para usarlo posteriormente???
apreciaria mucho la ayuda...gracias..!!!!