Changeset 4 for www/finance/include.php
- Timestamp:
- Jan 14, 2008, 9:48:39 PM (17 years ago)
- Location:
- www
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
www
-
Property svn:ignore
set to
config.php
php_script_error.log
-
Property svn:ignore
set to
-
www/finance/include.php
r1 r4 1 <? 1 <?php 2 2 NactiMesicniParametry(); 3 3 4 4 function RecalculateTariffs($Period = 1) 5 5 { 6 global $Tarify, $MaxSpeed, $Internet, $SpeedElement ;6 global $Tarify, $MaxSpeed, $Internet, $SpeedElement, $Database; 7 7 8 8 $Tarify = array(); 9 DB_Select('finance_tariffs', '*', 'period='.$Period.' ORDER BY speed_factor');10 while($Tariff = DB_Row())9 $DbResult = $Database->select('finance_tariffs', '*', 'period='.$Period.' ORDER BY speed_factor'); 10 while($Tariff = $DbResult->fetch_array()) 11 11 { 12 12 $Tarify[$Tariff['id']] = $Tariff; … … 20 20 foreach($Tarify as $Index => $Tarif) 21 21 { 22 DB_Select('users', 'COUNT(*)', 'inet_tarif_'.$Column.'='.$Index.' AND inet=1 AND role=0');23 $Row = DB_Row();22 $DbResult = $Database->select('users', 'COUNT(*)', 'inet_tarif_'.$Column.'='.$Index.' AND inet=1 AND role=0'); 23 $Row = $DbResult->fetch_array(); 24 24 $Tarify[$Index]['user_count'] = $Row[0]; 25 25 $TotalUserCount = $TotalUserCount + $Tarify[$Index]['user_count']; … … 49 49 { 50 50 global $kWh, $Internet, $Sprava, $DatumOdecteni, $InternetUsers, $SpravaUsers, $InternetSegmentId, 51 $MaxSpeed, $RealMaxSpeed, $SpeedReserve ;51 $MaxSpeed, $RealMaxSpeed, $SpeedReserve, $Database; 52 52 53 DB_Query("SELECT * FROM finance_charge WHERE period=".$Period);54 $Row = DB_Row();53 $DbResult = $Database->query("SELECT * FROM finance_charge WHERE period=".$Period); 54 $Row = $DbResult->fetch_array(); 55 55 $kWh = $Row['kWh']; 56 56 $Internet = $Row['internet']; … … 60 60 $MaxSpeed = $RealMaxSpeed - $SpeedReserve; 61 61 62 DB_Query("SELECT COUNT(*) FROM users WHERE inet=1 AND role=0");63 $Row = DB_Row();62 $DbResult = $Database->query("SELECT COUNT(*) FROM users WHERE inet=1 AND role=0"); 63 $Row = $DbResult->fetch_array(); 64 64 $InternetUsers = $Row[0]; 65 65 66 DB_Query("SELECT COUNT(*) FROM users WHERE overheads=1 AND role=0");67 $SpravaUsers = DB_Row();66 $DbResult = $Database->query("SELECT COUNT(*) FROM users WHERE overheads=1 AND role=0"); 67 $SpravaUsers = $DbResult->fetch_array(); 68 68 $SpravaUsers = $SpravaUsers[0]; 69 69 $InternetSegmentId = 21;
Note:
See TracChangeset
for help on using the changeset viewer.