- Timestamp:
- Sep 14, 2009, 7:53:21 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/config.sample.php
r630 r634 69 69 'ServerFounded' => '1.1.2000', 70 70 'BankAccount' => '670100-2202937132/6210', 71 'TableRowPerPage' => 20, 71 72 'ServerList' => array( 72 73 1 => array( -
trunk/inc/html.php
r630 r634 301 301 } 302 302 } 303 304 function GetQueryStringArray() 305 { 306 $Result = array(); 307 $Parts = explode('&', $_SERVER['QUERY_STRING']); 308 foreach($Parts as $Part) 309 { 310 if($Part != '') 311 { 312 $Item = explode('=', $Part); 313 $Result[$Item[0]] = $Item[1]; 314 } 315 } 316 return($Result); 317 } 318 319 function SetQueryStringArray($QueryStringArray) 320 { 321 $Parts = array(); 322 foreach($QueryStringArray as $Index => $Item) 323 { 324 $Parts[] = $Index.'='.$Item; 325 } 326 return(implode('&', $Parts)); 327 } 328 329 // Zobrazení číselný seznamu stránek 330 function PageList($QueryStringVar, $Page, $TotalCount, $CountPerPage, $Around = 10) 331 { 332 $QueryStringArray = $this->GetQueryStringArray(); 333 $Count = ceil($TotalCount / $CountPerPage); 334 $Result = ''; 335 if($Count > 1) 336 { 337 if($Page > 0) 338 { 339 $QueryStringArray[$QueryStringVar] = 0; 340 $Result .= '<a href="?'.$this->SetQueryStringArray($QueryStringArray).'"><<</a> '; 341 $QueryStringArray[$QueryStringVar] = $Page - 1; 342 $Result .= '<a href="?'.$this->SetQueryStringArray($QueryStringArray).'"><</a> '; 343 } 344 $PagesMax = $Count - 1; 345 $PagesMin = 0; 346 if($PagesMax > ($Page + $Around)) $PagesMax = $Page + $Around; 347 if($PagesMin < ($Page - $Around)) 348 { 349 $Result .= ' .. '; 350 $PagesMin = $Page - $Around; 351 } 352 for($i = $PagesMin; $i <= $PagesMax; $i++) 353 { 354 if($i == $Page) $Result .= '<strong>'; 355 $QueryStringArray[$QueryStringVar] = $i; 356 $Result .= '<a href="?'.$this->SetQueryStringArray($QueryStringArray).'">'.($i + 1).'</a> '; 357 if($i == $Page) $Result .= '</strong>'; 358 } 359 if($PagesMax < ($Count - 1)) $Result .= ' .. '; 360 if($Page < ($Count - 1)) 361 { 362 $QueryStringArray[$QueryStringVar] = $Page + 1; 363 $Result .= '<a href="?'.$this->SetQueryStringArray($QueryStringArray).'">></a> '; 364 $QueryStringArray[$QueryStringVar] = $Count - 1; 365 $Result .= '<a href="?'.$this->SetQueryStringArray($QueryStringArray).'">>></a>'; 366 } 367 } 368 return($Result); 369 } 303 370 } 304 371 -
trunk/inc/module.php
r630 r634 10 10 { 11 11 $this->Database = $System->Database; 12 $this->Config = $System->Config;12 $this->Config = &$System->Config; 13 13 $this->System = $System; 14 14 } -
trunk/inc/realm.php
r633 r634 1 1 <?php 2 3 include_once(dirname(__FILE__).'/module.php'); 2 4 3 5 class Realm extends Module -
trunk/inc/server.php
r630 r634 1 1 <?php 2 3 include_once(dirname(__FILE__).'/module.php'); 2 4 3 5 function NullErrorHandler() -
trunk/index.php
r633 r634 30 30 include_once('inc/error.php'); 31 31 include_once('inc/database.php'); 32 include_once('inc/module.php');33 32 include_once('inc/html.php'); 34 33 include_once('inc/system.php'); -
trunk/pages/dotation.php
r627 r634 23 23 </p>'; 24 24 25 $operace = array(26 'buy' => 'Nákup',27 'sell' => 'Prodej',28 'consumption' => 'Spotřeba',29 'internet' => 'Internet',30 'contribution' => 'Příspěvek od',31 );32 33 25 $load_money = $db->query('SELECT SUM(`Money`) FROM `Finance`;')->fetch_row(); 34 26 35 27 $Output .= '<p><strong>Aktuální stav financí: '.$load_money[0].' Kč</strong></p>'; 28 29 $Output .= '<h4 class="Center">Roční přehledy financování</h4>'; 36 30 $Output .= '<table class="BaseTable">'. 37 '<tr>'. 38 '<th>Datum</th>'. 39 '<th>Suma</th>'. 40 '<th>Popis</th>'. 41 '<th>Odměna</th>'. 42 '</tr>'; 31 '<tr><th>Rok</th><th>Příjmy</th><th>Výdaje</th><th>Rozdíl</th></tr>'; 32 $DbResult = $db->query('SELECT MAX(Time), MIN(Time) FROM Finance'); 33 $TimeRange = $DbResult->fetch_array(); 43 34 44 $load_dotation = $db->query('SELECT * FROM `Finance` ORDER BY `Id` DESC'); 45 while($row = $load_dotation->fetch_assoc()) 35 $StartDateTimeParts = explode(' ',$TimeRange['MIN(Time)']); 36 $StartDateParts = explode('-',$StartDateTimeParts[0]); 37 $EndDateTimeParts = explode(' ',$TimeRange['MAX(Time)']); 38 $EndDateParts = explode('-',$EndDateTimeParts[0]); 39 40 $TotalIncome = 0; 41 $TotalExpense = 0; 42 for($Year = $EndDateParts[0]; $Year >= $StartDateParts[0]; $Year--) 46 43 { 47 $odmena = $row['Reward']; 48 49 if($row['Time'] != '') 50 { 51 $date = $server->HumanDate($row['Time'], 0); 52 //$date = $row['time']; 53 } else $date = ''; 54 if($row['Money'] > 0) $plus = '+'; 55 else $plus = ''; 56 $Output .= '<tr>'. 57 '<td>'.$date.'</td>'. 58 '<td>'.$plus.$row['Money'].'</td>'. 59 '<td>'.$operace[$row['Operation']].' '.$row['Description'].'</td>'. 60 '<td>'.$odmena.'</td>'. 61 '</tr>'; 44 $DbResult = $db->query('SELECT SUM(Money) AS Income FROM Finance WHERE (Money > 0) AND (Time >= "'.$Year.'-01-01") AND (Time < DATE_ADD("'.$Year.'-01-01", INTERVAL 1 YEAR))'); 45 $Income = $DbResult->fetch_assoc(); 46 $Income = $Income['Income']; 47 $TotalIncome += $Income; 48 $DbResult = $db->query('SELECT -SUM(Money) AS Expense FROM Finance WHERE (Money < 0) AND (Time >= "'.$Year.'-01-01") AND (Time < DATE_ADD("'.$Year.'-01-01", INTERVAL 1 YEAR))'); 49 $Expense = $DbResult->fetch_assoc(); 50 $Expense = $Expense['Expense']; 51 $TotalExpense += $Expense; 52 $Output .= '<tr><td>'.$Year.'</td><td>'.$Income.'</td><td>'.$Expense.'</td><td>'.($Income - $Expense).'</td></tr>'; 62 53 } 54 $Output .= '<tr><th>Celkem</th><th>'.$TotalIncome.'</th><th>'.$TotalExpense.'</th><th>'.($TotalIncome - $TotalExpense).'</th></tr>'; 63 55 $Output .= '</table>'; 56 57 $Output .= '<br/><div class="Center"><a href="?page=dotation_dump">Výpis jednotlivých příspěvků</a></div>'; 64 58 65 59 echo($Output); -
trunk/pages/guilda.php
r632 r634 43 43 <td>'.$total_members.' (Online : '.$online_mem['online_mem'].')</td> 44 44 </tr>'); 45 $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$guild_id );45 $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$guild_id.' AND Realm='.$Realm->Id); 46 46 $DbRow = $DbResult->fetch_assoc(); 47 47 $Homepage = $DbRow['Homepage']; -
trunk/pages/guildy.php
r632 r634 52 52 $DbResult = $db2->query('SELECT COUNT(*) AS online_mem FROM `guild_member`, `characters`, `guild` WHERE guild.guildid = '.$row['guildid'].' AND guild_member.guildid = guild.guildid AND guild_member.guid = characters.guid AND characters.online = 1'); 53 53 $online_mem = $DbResult->fetch_assoc(); 54 $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$row['guildid'] );54 $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$row['guildid'].' AND Realm='.$Realm->Id); 55 55 $DbRow = $DbResult->fetch_assoc(); 56 56 $Homepage = $DbRow['Homepage']; -
trunk/styles/style.css
r624 r634 305 305 } 306 306 307 .Center 308 { 309 margin-left: auto; 310 margin-right: auto; 311 text-align: center; 312 } 313
Note:
See TracChangeset
for help on using the changeset viewer.