Skip to content

Commit

Permalink
Fixed #28.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Kim authored and Karl Kim committed Jun 12, 2016
1 parent 0ce0075 commit f67aa84
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
Binary file modified psd/logo2.psd
Binary file not shown.
22 changes: 22 additions & 0 deletions server/calcrating.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ function read() {
return '{"error":{"text":'. $e->getMessage() .'}}';
}

$sql = "SELECT DISTINCT tree.food from note join tree on note.tree = tree.id WHERE note.rate > 3 and datediff(note.date,CURRENT_DATE) < 30";
try {
$pdo = getConnection();
$stmt = $pdo->prepare($sql);
$stmt->execute();
$result = $stmt->fetchAll();
$trees = [];
foreach ($result as $tree) {
array_push($trees, $tree['food']);
}
$sql = "UPDATE `food` SET `season` = 1 WHERE `id` IN (" . implode(",", $trees) . ")";
try {
$pdo = getConnection();
$stmt = $pdo->prepare($sql);
$stmt->execute();
} catch(PDOException $e) {
return '{"error":{"text":'. $e->getMessage() .'}}';
}
} catch(PDOException $e) {
return '{"error":{"text":'. $e->getMessage() .'}}';
}


}
?>
Binary file modified serverconfig/errorlist.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion src/constraints/localization-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

"e706": "Press the button to <strong>delete</strong> this donation.",

"e730": "search by id or street address…",
"e730": "Search by id or street address…",

"e900": "Not logged in.",
"e901": "Access is not authorized.",
Expand Down

0 comments on commit f67aa84

Please sign in to comment.