load('pages/export.html')->run()->getData('')); $a = Provider::get('cine')->query(sprintf( 'SELECT * FROM %3$s WHERE "%1$s" <= date AND date <= "%2$s ORDER BY date DESC";', $_GET['begin'], $_GET['end'], $_GET['model'] )); if ( !$a[0] ) { die(EngineSystem::get('back')->load('pages/error.html')->run(array( 'message' => "Aucun contact enregistré entre les dates selectionnées." ))->getData('')); } $schema = array_keys($a[0][0]); header("Content-disposition: attachment; filename=export.xls"); header("Content-Type: application/force-download"); echo "
| %1$s | ' . "\n", $field); echo "\t
|---|
| %2$s%1$s | ', utf8_decode($v), $k === 'codepostal' ? "'" : "" ); echo "\t