Merge branch 'master' of ssh://maxious.lambdacomplex.org/git/disclosr
[disclosr.git] / alaveteli / exportCategories.rb.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
 
include_once("../include/common.inc.php");
setlocale(LC_CTYPE, 'C');
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="public_body_categories_en.rb"');
header('Pragma: no-cache');
header('Expires: 0');
echo 'PublicBodyCategories.add(:en, [' . PHP_EOL;
echo '    "Portfolios",' . PHP_EOL;
$db = $server->get_db('disclosr-agencies');
 
try {
    $rows = $db->get_view("app", "byDeptStateName", null, true)->rows;
    //print_r($rows);
    foreach ($rows as $row) {
        echo '        [ "' . phrase_to_tag(dept_to_portfolio($row->key)) . '","' . dept_to_portfolio($row->key) . '","part of the ' . dept_to_portfolio($row->key) . ' portfolio" ],' . PHP_EOL;
    }
} catch (SetteeRestClientException $e) {
    setteErrorHandler($e);
}
echo '])';
?>