Skip to content

Commit

Permalink
future deadlines online
Browse files Browse the repository at this point in the history
  • Loading branch information
joelsalisbury committed Feb 9, 2024
1 parent b90ad4c commit 56031d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function get_all_users()
function get_all_crops()
{
global $db;
$results = $db->query('SELECT * FROM crops');
$results = $db->query('SELECT * FROM crops ORDER BY crop ASC');
$crops = [];
while ($row = $results->fetchArray()) {
$crops[] = $row;
Expand Down Expand Up @@ -384,7 +384,8 @@ function get_deadline($id)
function get_all_deadlines()
{
global $db;
$results = $db->query('SELECT * FROM crops_states_deadlines');
$results = $db->query('SELECT * FROM crops_states_deadlines WHERE strftime("%Y-%m-%d", deadline) >= date("now")
ORDER BY deadline ASC');
$deadlines = [];
while ($row = $results->fetchArray()) {
$row['state'] = get_state_name($row['state_id']);
Expand Down

0 comments on commit 56031d2

Please sign in to comment.