You are not allowed access to this resource

'); $id = 0; if ( isset( $_GET['id'] ) ) $id = intval ($_GET['id']); header ("Content-Type: application/vnd.ms-excel"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past function escape ($value) { // Escape any special values $double = false; if (strpos ($value, ',') !== false) $double = true; if (strpos ($value, '"') !== false) { $double = true; $value = str_replace ('"', '""', $value); } if ($double) $value = '"'.$value.'"'; return $value; } header ('Content-Disposition: attachment; filename="audit-trail.csv"'); $trail = AT_Audit::get_everything (); if (count ($trail) > 0) { echo "Date,Time,User,Operation,Item,IP\r\n"; foreach ($trail AS $item) { $csv = array(); $csv[] = escape( date ('Y-m-d', $item->happened_at)); $csv[] = escape( date ('H:i', $item->happened_at)); $csv[] = escape( $item->username ); $csv[] = escape( strip_tags ($item->get_operation ())); $csv[] = escape( strip_tags ($item->get_item ())); $csv[] = escape( long2ip ($item->ip)); echo implode( ',', $csv )."\r\n"; } }