function show_setting_form() { $initialMoney = CSettingManager::GetSetting(CSettingManager::INITIAL_MONEY); $lastCheckTime = CSettingManager::GetSetting(CSettingManager::LAST_CHECK_TIME); $settingForm = new SettingForm($initialMoney, $lastCheckTime); $settingForm->Show(); }
static function GetAvailableMoney() { $initial_money = CSettingManager::GetSetting(CSettingManager::INITIAL_MONEY); $total_payment = self::GetTotalPayment(); $total_receipt = self::GetTotalReceipt(); return $initial_money - $total_payment + $total_receipt; }
function submit_edit_setting() { DLOG("submit_edit_setting()"); $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); }
static function LoadData() { self::$data = 0; self::$count = 0; $sql = "SELECT * FROM setting"; $settings = CDataManager::ExercuseQuery($sql); // Fetch data while ($row = mysql_fetch_array($settings)) { if (!self::$data) { self::$data = array(); } self::$data[self::$count]['Name'] = $row['Name']; self::$data[self::$count]['Value'] = $row['Value']; self::$data[self::$count]['Description'] = $row['Description']; self::$count++; } }
function submit_save_setting($initial_money, $last_check_time) { return CSettingManager::SaveSetting($initial_money, $last_check_time); }
echo "Error has occured while drop table Setting</p>"; } //********************* // CREATE TABLE //********************* echo "<p>Creating table...</p>"; echo "<p>"; // Create Category table if (CCategoryManager::CreateTable()) { echo "Created <b>Category</b> table<br/>"; } else { echo "Error has occured while create table Category<br/>"; } // Create Detail table if (CRecordManager::CreateTable()) { echo "Created <b>Record</b> table<br/>"; } else { echo "Error has occured while create table Record<br/>"; } // Create Setting table if (CSettingManager::CreateTable()) { echo "Created <b>Setting</b> table<br/>"; } else { echo "Error has occured while create table Setting<br/>"; } echo "</p>"; echo "<p>Finish.</p>"; ?> </body> </html>