'>
					</td>
					<td  style='width: 50%;  text-align: right;'>
					<input  style='margin-right: 0px;' type='submit' name='semana_siguiente' value='Semana siguiente'>
					</td>
				</tr></table>
				</form>
			</div>
			
			<table class='agenda'>
				<tr><th></th>
				<?php 
        for ($i = 1; $i < 7; $i++) {
            echo "<th>" . $ARRAY_DIAS_SEMANA[$i] . "\n\t\t\t\t\t<br>" . conversion_formato_fecha($fecha[$i], 'd') . " - " . substr($ARRAY_MESES[conversion_formato_fecha($fecha[$i], 'm') - 1], 0, 3) . "\n\t\t\t\t\t</th>";
        }
        echo "<th>" . $ARRAY_DIAS_SEMANA[0] . " <br>" . conversion_formato_fecha($fecha[0], 'd') . " - " . substr($ARRAY_MESES[conversion_formato_fecha($fecha[0], 'm') - 1], 0, 3) . "</th>";
        ?>
				</tr>
				
				<?php 
        $domingo[0] = 'background-color: #afafaf;';
        $domingo[7] = 'background-color: #afafaf;';
        $intervalos = array('00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55');
        for ($i = 7; $i < 22; $i++) {
            foreach ($intervalos as $key => $valor) {
                echo "<tr>";
                if ($valor == '00') {
                    $mostrarhora = $i . ":" . $valor;
                    echo "<th rowspan=12 >{$mostrarhora}</th>";
                    $raya_arriba = " border-top: 1px solid #037500;";
                } else {
///////////////////////////////////////////////////////////////////////////
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=Informe_listado_clientes.xls");
header("Pragma: public");
include "../functions/globales.php";
include "../functions/funciones.php";
$clientes = select_normal("SELECT * FROM kz_te_clientes ORDER BY nombre_comercial");
?>

<table>
	<tr>
		<td colspan=3 style='text-decoration: underline;'>Informe de listado de clientes</td>
	</tr>
	<tr>
		<td colspan=3 style='text-align: right;'>Kz Adeada Talleres El&eacute;ctricos - <?php 
echo conversion_formato_fecha(date('Y-m-d'), 'abreviado') . " -- " . date('H:i:s');
?>
</td>
	</tr>
</table>
<br>


<table class='tabla_resultado_informe' width='100%' border=1>
	<tr>
		<td width=30 style='font-weight:bold; text-align: left; background-color: #C0C0C0;'>Cod.</td>
		<td width=243px style='font-weight:bold; text-align: left; background-color: #C0C0C0;'>Nombre</td>
		<td width=243px style='font-weight:bold; text-align: left; background-color: #C0C0C0;'>Tel&eacute;fono</td>
	</tr>
	
	<?php 
 foreach ($consulta as $key => $valor) {
     echo "<tr>";
     $duracion['total'] = $duracion['total'] + $valor['total_duracion'];
     if ($filtros_columnas) {
         foreach ($filtros_columnas as $key2 => $valor2) {
             switch ($valor2) {
                 case 'id':
                     break;
                 case 'comercial':
                     echo "<td>" . $personal[$valor[$valor2]] . "</td>";
                     break;
                 case 'cliente':
                     echo "<td>" . $clientes[$valor[$valor2]] . "</td>";
                     break;
                 case 'dia':
                     echo "<td>" . conversion_formato_fecha($valor[$valor2], 'abreviado') . "</td>";
                     break;
                 case 'tipo_trabajo':
                     echo "<td>" . $ARRAY_TRABAJOS['trabajos_padre'][$valor[$valor2]] . "</td>";
                     break;
                 case 'subtrabajo':
                     echo "<td>" . $ARRAY_TRABAJOS['trabajos_hijo'][$valor[$valor2]] . "</td>";
                     break;
                 default:
                     echo "<td>" . $valor[$valor2] . "</td>";
                     break;
             }
         }
     }
     echo "</tr>";
 }
function obtener_semana($fecha)
{
    $fechad = desglose_fecha_hora($fecha);
    $diasemana = conversion_formato_fecha($fecha, 'diasemana');
    if ($diasemana == 0) {
        $res[0] = sumar_dias($fecha, '-6');
        $res[1] = $fecha;
    } else {
        if ($diasemana == 1) {
            $res[0] = $fecha;
            $res[1] = sumar_dias($fecha, 6);
        } else {
            $res[0] = sumar_dias($fecha, -($diasemana - 1));
            $res[1] = sumar_dias($res[0], 6);
        }
    }
    return $res;
}
							
							<tr>
								<td><?php 
                echo conversion_formato_fecha($valortemas['fecha'], 'abreviado');
                ?>
</td>
								<td colspan = 9><?php 
                echo $valortemas['tema'];
                ?>
</td>
								<td colspan = 2><?php 
                echo $tecnico['nombre'] . " " . $tecnico['apellidos'];
                ?>
</td>
								<td><?php 
                echo conversion_formato_fecha($valortemas['plazo'], 'abreviado');
                ?>
</td>
								<td><?php 
                echo $ok;
                ?>
</td>
							</tr>
						<?php 
            }
        }
        ?>
</table>
		<?php 
    } else {
        echo "<br><div class='mensaje'>Sin resultados</div>";