Browse Source

Fixed bugs

Jeroen De Meerleer 1 year ago
parent
commit
21cfb4da52
3 changed files with 3 additions and 3 deletions
  1. 1 1
      addjob.php
  2. 1 1
      editjob.php
  3. 1 1
      webcron.php

+ 1 - 1
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;
     }

+ 1 - 1
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;
     }

+ 1 - 1
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();