Esempio n. 1
0
 static function GetTotalMoney($filter)
 {
     $sql = "SELECT SUM(Amount) AS TotalMoney FROM detail ";
     $sql .= $filter->GetWhereClauseCommand();
     $result = CDataManager::ExercuseQuery($sql);
     $first_row = mysql_fetch_array($result);
     return $first_row['TotalMoney'];
 }
Esempio n. 2
0
 static function GetConnection()
 {
     if (!self::$connection) {
         // open the connection
         self::$connection = mysql_connect(Config::SERVER_NAME, Config::USERNAME, Config::PASSWORD);
         if (!self::$connection) {
             die('Could not connect: ' . mysql_error());
         }
         // pick the database to use
         mysql_select_db(Config::DATABASE_NAME, self::$connection);
     }
     return self::$connection;
 }
 static function DropTable()
 {
     $sql = "DROP TABLE IF EXISTS setting";
     return CDataManager::ExercuseQuery($sql);
 }