webcron-site/api/crontab.php

23 lines
560 B
PHP
Raw Permalink Normal View History

2023-05-20 20:07:45 +00:00
<?php
/*
/api/crontab.php
This script is meant to act as a interface for in logic for
*/
if (array_key_exists("action",$_GET)){
$action=$_GET['action'];
}
$db = new SQLite3("../../webcron.db");
switch ($action) {
case "list":
$res = $db->query("SELECT crontab_id, crontab_path FROM crontabs;");
2023-05-20 20:07:45 +00:00
while ($row = $res->fetchArray()){
echo "<button onclick=loadCrontab({$row['crontab_id']})>{$row['crontab_path']}</button><br>";
2023-05-20 20:07:45 +00:00
}
break;
}
?>