From f14550a5a73939550b708cf128e52d181078caa5 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 22 Jun 2012 12:08:26 +0300 Subject: [PATCH] cron add page --- web/add/cron/index.php | 78 ++++++++++++++++++++++++++ web/templates/admin/add_cron.html | 57 +++++++++++++++++++ web/templates/admin/menu_add_cron.html | 15 +++++ 3 files changed, 150 insertions(+) create mode 100644 web/add/cron/index.php create mode 100644 web/templates/admin/add_cron.html create mode 100644 web/templates/admin/menu_add_cron.html diff --git a/web/add/cron/index.php b/web/add/cron/index.php new file mode 100644 index 000000000..01e24b673 --- /dev/null +++ b/web/add/cron/index.php @@ -0,0 +1,78 @@ + $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = "Error: field ".$error_msg." can not be blank."; + } else { + // Add Cron Job + exec (VESTA_CMD."v_add_cron_job ".$user." ".$v_min." ".$v_hour." ".$v_day." ".$v_month." ".$v_wday." ".$v_cmd, $output, $return_var); + $v_type = $_POST['v_type']; + $v_charset = $_POST['v_charset']; + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + unset($v_password); + unset($output); + } else { + $_SESSION['ok_msg'] = "OK: cron job has been created successfully."; + unset($v_min); + unset($v_hour); + unset($v_day); + unset($v_month); + unset($v_wday); + unset($v_cmd); + unset($output); + } + } + } + exec (VESTA_CMD."v_list_database_types 'json'", $output, $return_var); + $db_types = json_decode(implode('', $output), true); + unset($output); + + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_cron.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html'); + unset($_SESSION['error_msg']); + unset($_SESSION['ok_msg']); +} + +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/templates/admin/add_cron.html b/web/templates/admin/add_cron.html new file mode 100644 index 000000000..e128b370a --- /dev/null +++ b/web/templates/admin/add_cron.html @@ -0,0 +1,57 @@ + + + + + + + + +
+ + +
+
+ + +
+ + + + + + + + + +
Minute
Hour
Day
Month
Day of Week
Command
+ + +
+
diff --git a/web/templates/admin/menu_add_cron.html b/web/templates/admin/menu_add_cron.html new file mode 100644 index 000000000..fb865752f --- /dev/null +++ b/web/templates/admin/menu_add_cron.html @@ -0,0 +1,15 @@ + + + + +