Changeset 407
- Timestamp:
- Oct 4, 2012, 8:12:31 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/finance.php
r327 r407 96 96 $this->BillingPeriods[$BillingPeriod['Id']] = $BillingPeriod; 97 97 98 $DbResult = $this->Database->query('SELECT * FROM finance_charge WHERE period='.$Period);98 $DbResult = $this->Database->query('SELECT * FROM FinanceCharge WHERE Period='.$Period); 99 99 $Row = $DbResult->fetch_array(); 100 100 $this->kWh = $Row['kWh']; 101 $this->Internet = $Row[' internet'];102 $this->Sprava = $Row[' administration_per_user'];103 $this->RealMaxSpeed = $Row[' internet_speed'];104 $this->SpeedReserve = $Row[' internet_speed_reserve'];105 $this->BaseSpeedElement = $Row[' base_speed_element'];101 $this->Internet = $Row['Internet']; 102 $this->Sprava = $Row['AdministrationPerUser']; 103 $this->RealMaxSpeed = $Row['InternetSpeed']; 104 $this->SpeedReserve = $Row['InternetSpeedReserve']; 105 $this->BaseSpeedElement = $Row['BaseSpeedElement']; 106 106 $this->MaxSpeed = $this->RealMaxSpeed - $this->SpeedReserve; 107 107 $this->TopTariffPrice = $Row['TopTariffPrice']; -
trunk/finance/index.php
r294 r407 23 23 $Output .= '<br /><strong>Souhrn:</strong><br />'; 24 24 25 $DbResult = $this->Database->query('SELECT * FROM finance_monthly_overall ORDER BY date DESC LIMIT 0,1');25 $DbResult = $this->Database->query('SELECT * FROM FinanceMonthlyOverall ORDER BY Date DESC LIMIT 0,1'); 26 26 $Row = $DbResult->fetch_array(); 27 27 $Output .= 'Platba za internetovou linku ('.$Finance->RealMaxSpeed.'/'.$Finance->RealMaxSpeed.' kbit/s): <strong>'.$Finance->Internet.' Kč</strong><br />'; -
trunk/finance/manage.php
r396 r407 280 280 281 281 // Načti poslední měsíční přehled a nastavení 282 $DbResult = $this->Database->select(' finance_monthly_overall', '*', '1 ORDER BY date DESC LIMIT 1');282 $DbResult = $this->Database->select('FinanceMonthlyOverall', '*', '1 ORDER BY Date DESC LIMIT 1'); 283 283 $Overall = $DbResult->fetch_array(); 284 284 285 285 $Output -= 'Datum: '.date('j.n.Y').'<br />'; 286 286 287 $Datum = explode('-', $Overall[' date']);287 $Datum = explode('-', $Overall['Date']); 288 288 $Mesic = date('m') + 0; 289 289 … … 360 360 // Update finance charge 361 361 $Output .= 'Měním aktuální parametry sítě...<br>'; 362 $this->Database->delete(' finance_charge', 'period = 0');363 $DbResult = $this->Database->select(' finance_charge', '*', 'period = 1');362 $this->Database->delete('FinanceCharge', 'Period = 0'); 363 $DbResult = $this->Database->select('FinanceCharge', '*', 'Period = 1'); 364 364 $Charge = $DbResult->fetch_assoc(); 365 365 //print_r($Charge); 366 $DbResult = $this->Database->insert(' finance_charge', array('period' => 0, 'internet' => $Charge['internet'], 'internet_speed' => $Charge['internet_speed'], 'internet_speed_reserve' => $Charge['internet_speed_reserve'], 'administration_per_user' => $Charge['administration_per_user'], 'kWh' => $Charge['kWh'], 'base_speed_element' => $Charge['base_speed_element'], 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice']));366 $DbResult = $this->Database->insert('FinanceCharge', array('Period' => 0, 'Internet' => $Charge['Internet'], 'InternetSpeed' => $Charge['InternetSpeed'], 'InternetSpeedReserve' => $Charge['InternetSpeedReserve'], 'AdministrationPerUser' => $Charge['AdministrationPerUser'], 'kWh' => $Charge['kWh'], 'BaseSpeedElement' => $Charge['BaseSpeedElement'], 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'])); 367 367 368 368 $Output .= 'Přidávám měsíční přehled...<br />'; 369 $this->Database->insert(' finance_monthly_overall', array('date' => 'NOW()', 'money' => $Finance->Internet, 'kWh' => $Finance->kWh, 'administration' => $Finance->Sprava, 'administration_total' => $SpravaCelkem, 'consumption_total' => $TotalConsumptionCost, 'total_paid' => $Finance->TotalPaid, 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'], 'member_count' => $Finance->InternetUsers));369 $this->Database->insert('FinanceMonthlyOverall', array('Date' => 'NOW()', 'Money' => $Finance->Internet, 'kWh' => $Finance->kWh, 'Administration' => $Finance->Sprava, 'AdministrationTotal' => $SpravaCelkem, 'ConsumptionTotal' => $TotalConsumptionCost, 'TotalPaid' => $Finance->TotalPaid, 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'], 'MemberCount' => $Finance->InternetUsers)); 370 370 371 371 // Update tarrifs -
trunk/finance/monthly_overall.php
r157 r407 12 12 13 13 $Output = '<table class="WideTable"><tr><th>Rok</th><th>Měsíc</th><th>Internet [Kč]</th><th>Účastníků</th><th>Správa [Kč/účastníka]</th><th>Správa [Kč]</th><th>Spotřeba [Kč/kWh]</th><th>Spotřeba [Kč]</th><th>Obrat [Kč]</th><th>Průměrná cena [Kč/účastníka]</th><th align="center">Investice [Kč]</th></tr>'; 14 $Total = array(' money' => 0, 'administration_total' => 0, 'consumption_total' => 0, 'total_paid' => 0, 'investment' => 0);15 $DbResult = $this->Database->select(' finance_monthly_overall', '*', '1 ORDER BY date DESC');14 $Total = array('Money' => 0, 'AdministrationTotal' => 0, 'ConsumptionTotal' => 0, 'TotalPaid' => 0, 'Investment' => 0); 15 $DbResult = $this->Database->select('FinanceMonthlyOverall', '*', '1 ORDER BY Date DESC'); 16 16 while($Month = $DbResult->fetch_array()) 17 17 { 18 $DateParts = explode('-', $Month[' date']);19 $Output .= '<tr><td>'.$DateParts[0].'</td><td align="center">'.$MonthNames[$DateParts[1] * 1].'</td><td align="center">'.$Month[' money'].'</td><td align="center">'.$Month['member_count'].'</td><td align="center">'.$Month['administration'].'</td><td align="center">'.$Month['administration_total'].'</td><td align="center">'.$Month['kWh'].'</td><td align="center">'.$Month['consumption_total'].'</td><td align="center">'.$Month['total_paid'].'</td><td align="center">'.round($Month['total_paid'] / $Month['member_count']).'</td><td align="center">'.$Month['investment'].'</td></tr>';18 $DateParts = explode('-', $Month['Date']); 19 $Output .= '<tr><td>'.$DateParts[0].'</td><td align="center">'.$MonthNames[$DateParts[1] * 1].'</td><td align="center">'.$Month['Money'].'</td><td align="center">'.$Month['MemberCount'].'</td><td align="center">'.$Month['Administration'].'</td><td align="center">'.$Month['AdministrationTotal'].'</td><td align="center">'.$Month['kWh'].'</td><td align="center">'.$Month['ConsumptionTotal'].'</td><td align="center">'.$Month['TotalPaid'].'</td><td align="center">'.round($Month['TotalPaid'] / $Month['MemberCount']).'</td><td align="center">'.$Month['Investment'].'</td></tr>'; 20 20 21 $Total[' money'] += $Month['money'];22 $Total[' administration_total'] += $Month['administration_total'];23 $Total[' consumption_total'] += $Month['consumption_total'];24 $Total[' total_paid'] += $Month['total_paid'];25 $Total['investment'] += $Month['investment'];21 $Total['Money'] += $Month['Money']; 22 $Total['AdministrationTotal'] += $Month['AdministrationTotal']; 23 $Total['ConsumptionTotal'] += $Month['ConsumptionTotal']; 24 $Total['TotalPaid'] += $Month['TotalPaid']; 25 $Total['Investment'] += $Month['Investment']; 26 26 //if($DateParts[1] == '01') echo('<tr><td style="font-size: 4;" colspan="10"> </td></tr>'); 27 27 } 28 $Output .= '<tr><th colspan="2">Celkem</th><th>'.$Total[' money'].'</th><th> </th><th> </th><th>'.$Total['administration_total'].'</th><th> </th><th>'.$Total['consumption_total'].'</th><th>'.$Total['total_paid'].'</th><th> </th><th>'.$Total['investment'].'</th>';28 $Output .= '<tr><th colspan="2">Celkem</th><th>'.$Total['Money'].'</th><th> </th><th> </th><th>'.$Total['AdministrationTotal'].'</th><th> </th><th>'.$Total['ConsumptionTotal'].'</th><th>'.$Total['TotalPaid'].'</th><th> </th><th>'.$Total['Investment'].'</th>'; 29 29 $Output .= '</table>'; 30 30 return($Output);
Note:
See TracChangeset
for help on using the changeset viewer.