webcron-site/api/crontab_view.php

30 lines
583 B
PHP
Raw Permalink Normal View History

2023-05-15 21:45:18 +00:00
<?php
/*
GET Variables
Optional:
id: id of the crontab
2023-05-15 21:45:18 +00:00
*/
$GLOBALS['db'] = new SQLite3('../../webcron.db');
if (!array_key_exists("id", $_GET)) {
2023-05-15 21:45:18 +00:00
$name = "";
} else {
$id = $_GET["id"];
2023-05-15 21:45:18 +00:00
}
$db = $GLOBALS['db'];
if (empty($id)){
echo "$name is not a valid crontab";
} else {
$data = $db->querySingle("SELECT crontab_data FROM crontabs WHERE crontab_id = $id;");
$lines = explode("\n", $data);
foreach ($lines as $line){
echo "$line<br>";
}
2023-05-15 21:45:18 +00:00
}
?>