From 0809cd3c4b252ded0caab104ffe4969b93c57c25 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Fri, 24 May 2019 18:41:28 +0200 Subject: [PATCH] Fixed bugs --- addjob.php | 2 +- editjob.php | 2 +- webcron.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addjob.php b/addjob.php index 44b60ca..a74c4a3 100644 --- a/addjob.php +++ b/addjob.php @@ -70,7 +70,7 @@ elseif ($_SERVER["REQUEST_METHOD"] == "POST") { if (!$eternal) { $lastrunObj = DateTime::createFromFormat("d/m/Y H:i:s", $_POST['lastrun']); - $lastrun = $nextrunObj->getTimestamp(); + $lastrun = $lastrunObj->getTimestamp(); } else { $lastrun = -1; } diff --git a/editjob.php b/editjob.php index e2858c5..168ba2c 100644 --- a/editjob.php +++ b/editjob.php @@ -81,7 +81,7 @@ elseif ($_SERVER["REQUEST_METHOD"] == "POST") { if (!$eternal) { $lastrunObj = DateTime::createFromFormat("d/m/Y H:i:s", $_POST['lastrun']); - $lastrun = $nextrunObj->getTimestamp(); + $lastrun = $lastrunObj->getTimestamp(); } else { $lastrun = -1; } diff --git a/webcron.php b/webcron.php index 7a554f8..eb18749 100644 --- a/webcron.php +++ b/webcron.php @@ -67,7 +67,7 @@ if (file_exists("cache/get-services.trigger")) { } } -$stmt = $db->prepare('SELECT * FROM jobs WHERE nextrun <= 1558742600 and (nextrun <= lastrun OR lastrun = -1)'); +$stmt = $db->prepare('SELECT * FROM jobs WHERE nextrun <= ? and (nextrun <= lastrun OR lastrun = -1)'); $stmt->execute(array(time())); $results = $stmt->fetchAll(PDO::FETCH_ASSOC); $client = new \GuzzleHttp\Client();