$settings = array(); $settings[0] = $_POST['InitialMoney']; $time_maked = mktime($_POST['setting_lastchecktime_hour'], $_POST['setting_lastchecktime_minute'], $_POST['setting_lastchecktime_second'], $_POST['setting_lastchecktime_month'], $_POST['setting_lastchecktime_day'], $_POST['setting_lastchecktime_year']); $settings[1] = date("Y-m-d H:i:s", $time_maked); return edit_setting($config, $settings); } //********************* // MAIN PROCESS //********************* $action_type = "list"; if (isset($_REQUEST['action_type'])) { $action_type = $_REQUEST['action_type']; } switch ($action_type) { case "list": list_setting($config); break; case "submit_edit": $isSuccess = submit_edit_setting($config); if ($isSuccess) { echo "<p>The setting is saved</p>"; } else { echo "<p>CAN NOT save setting</p>"; } list_setting($config); break; } ?> </body> </html>
$initial_money = $_POST['InitialMoney']; DLOG("initial_money={$initial_money}"); $last_check_time = mktime($_POST['setting_lastchecktime_hour'], $_POST['setting_lastchecktime_minute'], $_POST['setting_lastchecktime_second'], $_POST['setting_lastchecktime_month'], $_POST['setting_lastchecktime_day'], $_POST['setting_lastchecktime_year']); DLOG("last_check_time={$last_check_time}"); return CSettingManager::SaveSetting($initial_money, $last_check_time); } //********************* // MAIN PROCESS //********************* $action_type = "list"; if (isset($_REQUEST['action_type'])) { $action_type = $_REQUEST['action_type']; } switch ($action_type) { case "list": list_setting(); break; case "submit_edit": $isSuccess = submit_edit_setting(); if ($isSuccess) { echo "<p>The setting is saved</p>"; } else { echo "<p>CAN NOT save setting</p>"; } list_setting(); break; } ?> </body> </html>