Changeset 419
- Timestamp:
- Oct 8, 2012, 11:17:43 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/finance.php
r410 r419 48 48 foreach($this->Tariffs as $Index => $Tariff) 49 49 { 50 $DbResult = $this->Database->select('Member', 'COUNT(*)', ' InternetTariffCurrentMonth='.$Index.' AND (BillingPeriod > 1)');50 $DbResult = $this->Database->select('Member', 'COUNT(*)', '(InternetTariffCurrentMonth='.$Index.') AND (BillingPeriod > 1) AND (Blocked=0)'); 51 51 $Row = $DbResult->fetch_row(); 52 52 $this->Tariffs[$Index]['MemberCount'] = $Row[0]; … … 111 111 $Row = $DbResult->fetch_row(); 112 112 $this->InternetUsers = $Row[0]; 113 114 $this->SpravaUsers = $this->InternetUsers; 113 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Member WHERE (Blocked=0) AND (BillingPeriod > 1)'); 114 $Row = $DbResult->fetch_row(); 115 $this->PayingUsers = $Row[0]; 116 117 $this->SpravaUsers = $this->PayingUsers; 118 115 119 $DbResult = $this->Database->query('SELECT SUM(Consumption) FROM NetworkSegment'); 116 120 $TotalConsumption = $DbResult->fetch_array(); 117 121 $this->TotalConsumption = $TotalConsumption[0]; 118 122 119 $DbResult = $this->Database->query('SELECT SUM(`MonthlyInternet`) AS `MonthlyInternet`, SUM(`MonthlyTotal`) AS `MonthlyTotal` FROM MemberPayment'); 123 $DbResult = $this->Database->query('SELECT SUM(`MemberPayment`.`MonthlyInternet`) AS `MonthlyInternet`, SUM(`MemberPayment`.`MonthlyTotal`) AS `MonthlyTotal` '. 124 'FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member WHERE Member.Blocked=0'); 120 125 $Row = $DbResult->fetch_assoc(); 121 126 $this->TotalInternetPaid = $Row['MonthlyInternet']; -
trunk/finance/index.php
r409 r419 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 />'; 28 29 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Member'); 30 $Row2 = $DbResult->fetch_array(); 31 $Output .= 'Počet registrovaných klientů: <strong>'.$Row2[0].'</strong><br />'; 32 33 $DbResult = $this->Database->query('SELECT COUNT(*) FROM Member WHERE (BillingPeriod > 1) AND (InternetTariffCurrentMonth > 0)'); 34 $Row2 = $DbResult->fetch_array(); 35 $Output .= 'Počet platících klientů: <strong>'.$Row2[0].'</strong><br />'; 28 $Output .= 'Počet registrovaných klientů: <strong>'.$Finance->InternetUsers.'</strong><br />'; 29 $Output .= 'Počet platících klientů: <strong>'.$Finance->PayingUsers.'</strong><br />'; 36 30 37 31 //$DbResult = $this->Database->query('SELECT SUM(Price) FROM Product WHERE Used=1'); … … 39 33 //$Output .= 'Celková cena zařízení sítě: <strong>'.$Row4[0].' Kč</strong><br />'; 40 34 41 $DbResult = $this->Database->query('SELECT SUM(Cash) as Cash FROM MemberPayment'); 35 //$DbResult = $this->Database->query('SELECT SUM(MemberPayment.Cash) AS Cash FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member WHERE Member.Blocked=0'); 36 $DbResult = $this->Database->query('SELECT SUM(Cash) AS Cash FROM MemberPayment'); 42 37 $Row4 = $DbResult->fetch_array(); 43 $Output .= 'Celkem peněz na účtech: <strong>'. $Row4[0].' Kč</strong><br />';38 $Output .= 'Celkem peněz na účtech: <strong>'.round($Row4[0]).' Kč</strong><br />'; 44 39 $Output .= 'Stanovená cena jedné kWh: <strong>'.$Finance->kWh.' Kč</strong><br />'; 45 40 //echo('Komunitou stanovený poplatek za správu sítě pro jednoho uživatele: <strong>'.$Sprava.' Kč</strong><br />'); 46 41 $DbResult = $this->Database->query('SELECT SUM(FamilyMemberCount) AS Family FROM Member'); 47 42 $Family = $DbResult->fetch_assoc(); 48 $Family = $Family['Family'];43 $Family = $Family['Family']; 49 44 $TotalFamily = 600; 50 45 $Output .= 'V připojených domácnostech celkem <strong>'.$Family.'</strong> občanů ze všech <strong>'.$TotalFamily.'</strong> ('.round($Family / $TotalFamily * 100).' %)<br />'; 51 46 $Output .= 'IČ: <strong>75904535</strong><br />'. 52 47 'DIČ: <strong>CZ8303255884</strong><br />'. 53 'Bankovní účet: <strong>218098370 / 0300</strong><br />'. 48 'Bankovní spojení pro platby v CZK v ČR: <strong>2600134781 / 2010</strong><br/>'. 49 'Bankovní spojení pro platby v EUR v SR: <strong>2600134781 / 8330</strong><br/>'. 54 50 '<br />'; 55 51 … … 80 76 $Output .= '<tr><td colspan="2"> </td></tr>'; 81 77 $Output .= '<tr><td><strong>Rozdíl</strong></td><td align="right"><strong>'.($TotalGain - $TotalExpense).'</strong></td></tr>'; 82 $Output .= '<tr><td> Převod do dalšího měsíce</td><td align="right">'.($TotalGain - $TotalExpense).'</td></tr>';78 $Output .= '<tr><td>Investice</td><td align="right">'.($TotalGain - $TotalExpense).'</td></tr>'; 83 79 $Output .= '</table><br />'; 84 80 /* $DbResult = $this->Database->select('', 'cash', 'id='.$Finance->UserIdNetwork); -
trunk/finance/tarify.php
r221 r419 25 25 $Output .= '<tr><td style="color: blue;">'.$Tariff['Name'].'</td><td align="center">'.round($Tariff['SpeedMin'] / 1024).'</td><td align="center" style="color: blue;">'.round($Tariff['SpeedMax'] / 1024).'</td><td align="center">'.$Tariff['Aggregation'].'</td><td align="center">'.$Tariff['MemberCount'].'</td><td align="center" style="color: blue;">'.$Tariff['Price'].'</td><td align="center">'.$Tariff['MemberCount'] * $Tariff['Price'].'</td></tr>'; 26 26 $TotalPrice = $TotalPrice + $Tariff['Price'] * $Tariff['MemberCount']; 27 $TotalMemberCount = $TotalMemberCount + $Tariff['MemberCount']; 27 28 } 28 $Output .= '<tr><td>Součty</td><td colspan="3"> </td><td align="center">'.$ Finance->InternetUsers.'</td><td> </td><td align="center">'.$TotalPrice.'</td></tr>';29 $Output .= '<tr><td>Součty</td><td colspan="3"> </td><td align="center">'.$TotalMemberCount.'</td><td> </td><td align="center">'.$TotalPrice.'</td></tr>'; 29 30 $Output .= '</table>'; 30 31 return($Output); … … 34 35 { 35 36 $Finance = &$this->System->Modules['Finance']; 36 $Output = 'Počet členů s internetovým připojením: <strong>'.$Finance->InternetUsers.'</strong><br /><br />';37 $Output = 'Počet platících členů s internetovým připojením: <strong>'.$Finance->PayingUsers.'</strong><br /><br />'; 37 38 /* 38 39 $Output .= '<table><tr><td valign="top">'; -
trunk/index.php
r417 r419 274 274 // Show pannels 275 275 //if(IsInternetAddr()) echo('Internet'); else echo('LAN'); 276 $Output .= $this->InfoBar();276 //$Output .= $this->InfoBar(); 277 277 $Output .= '<table id="MainTable"><tr>'; 278 278 $DbResult = $Database->select('PanelColumn', '*');
Note:
See TracChangeset
for help on using the changeset viewer.