blob: 2d7c89615657890637b1a0e4433d8f6f16f31d05 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2004-2015 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Denis Roy (Eclipse Foundation)- initial API and implementation
*******************************************************************************/
ob_start();
?>
<link rel="stylesheet" type="text/css" href="../css/stylesheet.css" />
<div id="maincontent" style="padding:8px;">
<h1 style="padding-top:10px;"><?= $pageTitle ?></h1>
<?php include("inc/en_stats_criteria.php"); ?>
<table width="100%">
<tr class="datahdr">
<td>File</td>
<td>Code</td>
<td>Country</td>
<td align="right">Count</td>
</tr>
<?php
$i = 0;
$dl_count = 0;
$file_dl_count = 0;
$file = "";
$prev_file = "";
foreach ($objJSON->rows as $row) {
$i++;
$file = $row->file_name;
$dl_count += $row->file_count;
$CountryDescription = $row->CountryDescription;
if($CountryDescription == "") {
$CountryDescription = "Unknown";
}
if($file == $prev_file) {
$file = "";
$file_dl_count += $row->file_count;
}
else {
if($i > 1) {
?>
<tr class="datahdr">
<td colspan="3"><b>Total for <?= $prev_file ?></b></td>
<td align="right"><b><?= $file_dl_count ?><b></td>
</tr>
<tr>
<td colspan="3">&#160;</td
</tr>
<?php
# sum for this file
}
$prev_file = $file;
$file_dl_count = $row->file_count;
}
?>
<tr class="data<?= $i % 2 ?>">
<td><?= $file ?></td>
<td><?= $row->ccode ?></td>
<td><?= $CountryDescription ?></td>
<td align="right"><?= $row->file_count ?></td>
</tr>
<?php
}
# Sum up the last file
if($i > 0) {
?>
<tr class="datahdr">
<td colspan="3"><b>Total for <?= $prev_file ?></b></td>
<td align="right"><b><?= $file_dl_count ?><b></td>
</tr>
<tr>
<td colspan="3">&#160;</td
</tr>
<?php
}
?>
<tr>
<td height="7"></td>
<td align="right"></td>
</tr>
<tr class="datahdr">
<td colspan="3"><?= $i ?> record<?= $i > 1 ? "s" : "" ?> found.</td>
<td align="right"><?= $dl_count ?></td>
</tr>
</table>
</div>