Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/02/2015, 12:07
el__tamer
 
Fecha de Ingreso: diciembre-2013
Mensajes: 81
Antigüedad: 12 años, 10 meses
Puntos: 1
exportacion a excel guardado en html

Hola, tengo una duda y no se como solucionarlo.
resulta que tengo una exportación todo bien pero cuando pongo guardar como me lo tira como en html.

¿como podria hacerlo para que se guarde como libro de excel?

Código PHP:
<?php
require("../../../conf/_config.php");
validar_sesion();


$date = date("d-m-Y H:i:s");
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition:  attachment; filename=\".$date.Reclamos.xls\";");



$condicion = $_GET["condicion"];
$res = sel_reclamos_enviados("*"," $condicion ORDER BY recl.REC_ID asc","",""); 
$num = mysql_num_rows($res); 





if(
$num > 0){
    
?>
    <table border="1">
        <thead>
            <tr> 
                <th>Num</th>
                <th>Emisi&oacute;n</th>
                <th>local Reclamante</th>
                <th>Proveedor Reclamado</th>
                <th>Producto</th>
                <th>Descripci&oacute;n del Reclamo</th>
                <th>Gravedad</th>
                <th>Tipo</th>
                <th>Autorizaci&oacute;n</th>
                <th>Respuesta</th>
        <th>Atraso</th>
            </tr>
        </thead>
        <tbody> 
            <?php 
            
while($row = mysql_fetch_array($res)){ 
            
$rojo = "";
                    switch(
$row["REC_AUTORIZADO"]){
                        case 
0:
                            
$autorizacion_texto = "Pendiente";
                            
$aprobacion_texto = "-";
                            
$estado_texto = "-";
                            
$rojo = 'style="background-color:#E7F4AE; color:#990000; font-weight:bold;"';
                            break;
                        case 
1:
                            
$autorizacion_texto = "Autorizado";
                            switch(
$row["REC_RECHAZO"]){
                                case 
0: $aprobacion_texto = "Rechazado"; break;
                                case 
1: $aprobacion_texto = "Aceptado"; break;
                                case 
2: $aprobacion_texto = "Pendiente"; break;
                                case 
3: $aprobacion_texto = "Mas Informacion"; break;
                            }
                            
$estado_texto = ($row["REC_ATRASADO"])?"Atraso":"No"; 
                            
                            if(
$row["REC_RESPONDIDO"] == 0){ 
                                
$rojo = 'style="background-color:#FDDBDB; color:#990000;"';
                            }
                            if(
$row["REC_RECHAZO"] == 3){
                                
$rojo = 'style="background-color:#C8F7AC; font-weight:bold;"';
                            }
                            break;
                        case 
2:
                            
$autorizacion_texto = "Rechazado";
                            
$aprobacion_texto = "-";
                            
$estado_texto = "-";
                            break;    
                            } 
            
            
                
?>
                <tr>
                    <td><?php echo _t($row["REC_ID"]); ?></td> 
                    <td><?php echo _fecSQL($row["REC_FECHA_SOLICITUD"]); ?></td>
                    <td><?php echo $row["LOC_NOMBRE"]; ?></td>
            <td><?php echo $row["EMP_NOMBRE"]; ?></td>
                    <td><?php
                
if($row["PRO_NOMBRE"] <> ""){
                    echo 
$row["PRO_NOMBRE"];
                    }else{
                    echo 
$row["REC_PRO_NOMBRE"];
                    }
?></td>
            <td><?php echo $row["REC_DESCRIPCION"]; ?></td>
            <td><?php echo _t($row["GRA_NOMBRE"]); ?></td>
            <td><?php echo _t($row["TIP_NOMBRE"]); ?></td>
            
            <td <?php echo $rojo; ?> align="center"><strong><? echo $autorizacion_texto; ?></strong></td>
            <td <?php echo $rojo; ?> align="center"><? echo $aprobacion_texto; ?></td>
            <td <?php echo $rojo; ?> align="center"><? echo $estado_texto; ?></td>
            
        </tr>
                <?php } 
                
?>
                    
                
               
            </tbody> 
        </table>
        <?php }
        
?>