diff options
author | Phil Davis <phil.davis@inf.org> | 2015-05-15 11:40:50 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-05-15 11:40:50 +0545 |
commit | 42b0c92129b93ca6d182f4904ec92708c9a8c750 (patch) | |
tree | 7d396b83ba7920878bb6e8f42ae5907e9518c003 /usr/local/www/status_captiveportal_voucher_rolls.php | |
parent | c8f1c7bd70cd156f23a59400e5c738ef8bf5281b (diff) | |
download | pfsense-42b0c92129b93ca6d182f4904ec92708c9a8c750.zip pfsense-42b0c92129b93ca6d182f4904ec92708c9a8c750.tar.gz |
Code style WWW Status
Diffstat (limited to 'usr/local/www/status_captiveportal_voucher_rolls.php')
-rw-r--r-- | usr/local/www/status_captiveportal_voucher_rolls.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/usr/local/www/status_captiveportal_voucher_rolls.php b/usr/local/www/status_captiveportal_voucher_rolls.php index 7d54645..feada71 100644 --- a/usr/local/www/status_captiveportal_voucher_rolls.php +++ b/usr/local/www/status_captiveportal_voucher_rolls.php @@ -46,16 +46,18 @@ require("captiveportal.inc"); require_once("voucher.inc"); $cpzone = $_GET['zone']; -if (isset($_POST['zone'])) +if (isset($_POST['zone'])) { $cpzone = $_POST['zone']; +} if (empty($cpzone)) { header("Location: services_captiveportal_zones.php"); exit; } -if (!is_array($config['captiveportal'])) +if (!is_array($config['captiveportal'])) { $config['captiveportal'] = array(); +} $a_cp =& $config['captiveportal']; $pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Voucher Rolls"), $a_cp[$cpzone]['zone']); $shortcut_section = "captiveportal-vouchers"; @@ -99,12 +101,13 @@ include("head.inc"); </tr> <?php $voucherlck = lock("vouche{$cpzone}r"); - $i = 0; foreach($a_roll as $rollent): - $used = voucher_used_count($rollent['number']); - $active = count(voucher_read_active_db($rollent['number']),$rollent['minutes']); - $ready = $rollent['count'] - $used; - /* used also count active vouchers, remove them */ - $used = $used - $active; + $i = 0; + foreach($a_roll as $rollent): + $used = voucher_used_count($rollent['number']); + $active = count(voucher_read_active_db($rollent['number']),$rollent['minutes']); + $ready = $rollent['count'] - $used; + /* used also count active vouchers, remove them */ + $used = $used - $active; ?> <tr> <td class="listlr"> @@ -129,7 +132,11 @@ include("head.inc"); <?=htmlspecialchars($ready); ?> </td> </tr> - <?php $i++; endforeach; unlock($voucherlck); ?> + <?php + $i++; + endforeach; + unlock($voucherlck); + ?> </table> </td> </tr> |