Skip to content
Permalink
Browse files

Check for cause area filter

For #108.
  • Loading branch information...
riceissa committed Apr 8, 2019
1 parent eefc025 commit 6f873d4e494b0fcf7c21efbf9986e00586c8e0c9
Showing with 6 additions and 2 deletions.
  1. +6 −2 access-portal/backend/donorDoneeStatistics.inc
@@ -23,10 +23,14 @@ function print_stats($amountList, $rowName) {
echo "</tr>\n";
}
$query = "select donor,amount,substring_index(cause_area,'/',1) as cause_area from donations where donor = ? and donee = ? order by amount asc";
$query = "select donor,amount,substring_index(cause_area,'/',1) as cause_area from donations where donor = ? and donee = ?" . ($causeAreaFilterString ? " and cause_area REGEXP ?" : "") . " order by amount asc";
if ($stmt = $mysqli->prepare($query)) {
$stmt->bind_param("ss", $donor, $donee);
if ($causeAreaFilterString) {
$stmt->bind_param("sss", $donor, $donee, $causeAreaFilterString);
} else {
$stmt->bind_param("ss", $donor, $donee);
}
$stmt->execute();
$result = $stmt->get_result();
$amountList = array();

0 comments on commit 6f873d4

Please sign in to comment.
You can’t perform that action at this time.