Projects - Direct Democracy - '.request("d").""; } else { session("menuposition")='Projects - Direct Democracy '; }?>
'.session("budget_year").""; $sOby="department asc"; if (request("d")!="") { $sOby=" sum(amount) desc"; $sSQL = "CALL adds.getDepartmentSpendingbyCategory ('".request("d")."','".$sOby."',".session("budget_year").")"; //rwe(sSQL) $x=$openRS[$sSQL]; if (not $rsTemp.$eof) { $h="

Our spending by '".request("d")."' for ".session("budget_year")."

"; $h=$h.'"; $h=$h.""; $irow=0; do until $rsTemp.$eof; if ($irow $mod 2==1) {$strClass="light_blue_row" } else { $strClass="white_row";} $irow=$irow+1; $sCat=$rstemp["categoryName"]; $h=$h.''; $h=$h.'"; //itotal=itotal+int(rstemp("total_budget")) $rsTemp.$movenext; loop; } } else { $sSQL = "SELECT department, count(*) 'spending categories',sum(amount) 'total_budget' FROM adds.budget_figures "; $sSQl=$sSQL." Where year=".session("budget_year")." "; if (request("f")!="") { $sSQl=$sSQL." and 1=1 "; } $sSQl=$sSQL." group by department order by ".$sOby; $x=$openRS[$sSQL]; //x=rwe(sSQL) $inextyear=session("budget_year")+1; $ilastyear=session("budget_year")-1; $h='

Our spending by department for the << '.session("budget_year").' Year >>

'; $h=$h.'

Data as from https://www.budget.govt.nz/budget/2018/data-library.htm

'; $h=$h."

Please select the area of goverment that you are interested in by clicking on the department title.

"; $h=$h.'
Category and '; $h=$h." Current ScopeDetails of this category
'.$sCat.". "; $h=$h."".$rstemp["Current_Scope"].'
Comments '.$rstemp["comments"]." Votes ".$rstemp["votes"].' Comment or Vote on this.
Classification: '.$rstemp["Functional_Classification"]."
"; $h=$h."Amount Type: ".$rstemp["amount_type"]."
"; $h=$h."Restrictions: ".$rstemp["Restriction_Type"]."
"; $h=$h."Group Type: ".$rstemp["group_type"]."
"; $h=$h."Reason Name: ".$rstemp["AppropriationName"]."
"; $h=$h."Reason Category: ".$rstemp["Appropriation_or_Category_Type"]."
"; $h=$h."Owned By: ".$rstemp["Portfolio_Name"]."
"; $h=$h.'Total Budget $'.formatNumber($rstemp["total_budget"],0).",000
'; $h=$h.""; $h=$h.""; $irow=0; if (not $rsTemp.$eof) { do until $rsTemp.$eof; if ($irow $mod 2==1) {$strClass="light_blue_row" } else { $strClass="white_row";} $irow=$irow+1; $sDept=$rstemp["department"]; $h=$h.'"; $h=$h.'"; $h=$h.'"; $itotal=$itotal+floor(str_replace(",","",$rstemp["total_budget"])); $icats=$icats+CINT($rstemp["spending categories"]); $rsTemp.$movenext; loop; $h=$h.''; $h=$h.'"; $h=$h.'"; } } //rwb(sSQL) $h=$h.''; $h=$h."
DepartmentSpending CategoriesTotal
'; $h=$h.$sDept."'.$rstemp["spending categories"]."'.formatNumber($rstemp["total_budget"],0).",000
Total Spending.
'.$icats."** $'.formatNumber($itotal,0).",000
** Data source https://www.budget.govt.nz/budget/excel/data/b18-expenditure-data.xls
"; $rw[$h]; ?>