enhance new PDO Database class; converted admin_cronjobs
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -39,8 +39,9 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
* @TODO Fix sorting
|
||||
*/
|
||||
$crons = '';
|
||||
$result = $db->query("SELECT `c`.* FROM `" . TABLE_PANEL_CRONRUNS . "` `c` ORDER BY `cronfile` ASC");
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$result_stmt = Database::prepare("SELECT `c`.* FROM `" . TABLE_PANEL_CRONRUNS . "` `c` ORDER BY `cronfile` ASC");
|
||||
Database::pexecute($result_stmt);
|
||||
$paging->setEntries(Database::num_rows());
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
@@ -49,7 +50,7 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
|
||||
@@ -72,7 +73,9 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
* @TODO later
|
||||
*/
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `id`='" . (int)$id . "'");
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `id`= :id");
|
||||
Database::pexecute($result_stmt, array('id' => $id));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if ($result['cronfile'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$isactive = isset($_POST['isactive']) ? 1 : 0;
|
||||
@@ -85,10 +88,12 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
|
||||
$interval = $interval_value . ' ' . strtoupper($interval_interval);
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "`
|
||||
SET `isactive` = '".(int)$isactive."',
|
||||
`interval` = '".$interval."'
|
||||
WHERE `id` = '" . (int)$id . "'");
|
||||
$upd = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CRONRUNS . "`
|
||||
SET `isactive` = :isactive, `interval` = :int
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
Database::pexecute($upd, array('isactive' => $isactive, 'int' => $interval, 'id' => $id));
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user