This commit is contained in:
xdrm-brackets 2016-05-24 08:59:33 +02:00
parent 09e96266c2
commit 4f27a0f4f9
1 changed files with 5 additions and 4 deletions

View File

@ -86,18 +86,19 @@
/* [2] On rédige les headers /* [2] On rédige les headers
=========================================================*/ =========================================================*/
header('Content-type: text/xml'); header('Content-type: text/xml');
header('Content-Disposition: attachment; filename=call-log.xml');
/* [3] On rédige le contenu du fichier XML /* [3] On rédige le contenu du fichier XML
=========================================================*/ =========================================================*/
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; echo "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\n";
echo '<Logs Date="2014-12-03T17:51:33" ItemCount="863">'; echo "<Logs>\n";
// Pour chaque utilisateur // Pour chaque utilisateur
foreach($logs as $i=>$log) foreach($logs as $i=>$log)
echo "<Item Number='${log['Number']}' Name='${log['Name']}' Date='".correctDates($log['Date'])."' Duration='".strtotime("1970-01-01 ${log['Duration']} UTC")."' Direction='".strtoupper($log['Call Type'])."' Type='PHONE' />"; echo "<Item Number='${log['Number']}' Name='${log['Name']}' Date='".correctDates($log['Date'])."' Duration='".strtotime("1970-01-01 ${log['Duration']} UTC")."' Direction='".strtoupper($log['Call Type'])."' Type='PHONE' />\n";
echo "</Logs>"; echo "</Logs>\n";
// Si aucun fichier // Si aucun fichier
}else{ ?> }else{ ?>