Exemplo n.º 1
0
function show_setting_form()
{
    $initialMoney = CSettingManager::GetSetting(CSettingManager::INITIAL_MONEY);
    $lastCheckTime = CSettingManager::GetSetting(CSettingManager::LAST_CHECK_TIME);
    $settingForm = new SettingForm($initialMoney, $lastCheckTime);
    $settingForm->Show();
}
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
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);
}
Exemplo n.º 4
0
 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++;
     }
 }
Exemplo n.º 5
0
function submit_save_setting($initial_money, $last_check_time)
{
    return CSettingManager::SaveSetting($initial_money, $last_check_time);
}
Exemplo n.º 6
0
    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>