Changeset 39 for trunk/www/index.php
- Timestamp:
- Jun 16, 2009, 6:11:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/index.php
r36 r39 49 49 function ShowServer($Id) 50 50 { 51 global $Config; 52 51 53 $Server = new Server($this->Database, $Id); 52 54 $Output = '<h4>Podrobnosti serveru</h4>'; 53 $Form = new Form(' EditServer');55 $Form = new Form('ServerView'); 54 56 $Form->LoadValuesFromDatabase($Id); 57 $Form->Definition['Items']['Realmlist'] = array('Type' => 'String', 'Caption' => 'Adresa k připojení', 'Default' => ''); 58 $Form->Definition['Items']['Uptime'] = array('Type' => 'String', 'Caption' => 'Doba běhu', 'Default' => ''); 59 $Form->Definition['Items']['UsedMemory'] = array('Type' => 'String', 'Caption' => 'Použitá paměť', 'Default' => ''); 60 $Form->Definition['Items']['AccountCount'] = array('Type' => 'String', 'Caption' => 'Počet účtů', 'Default' => ''); 61 $Form->Definition['Items']['CharacterCount'] = array('Type' => 'String', 'Caption' => 'Počet postav', 'Default' => ''); 62 $Form->Definition['Items']['CharacterOnlineCount'] = array('Type' => 'String', 'Caption' => 'Počet hráčů online', 'Default' => ''); 63 $ServerStatus = $Server->GetState(); 64 $Form->Values['Realmlist'] = $Config['Web']['Host'].':'.$Form->Values['NetworkPortRealmd']; 65 unset($Form->Values['NetworkPortRealmd']); 66 $Form->Values['Uptime'] = $this->System->AddPrefixMultipliers($ServerStatus['Uptime'], '', 4, 'Time'); 67 $Form->Values['UsedMemory'] = $this->System->AddPrefixMultipliers($ServerStatus['UsedMemory'] * 1024, 'B', 4, 'Binary'); 68 $Form->Values['AccountCount'] = $ServerStatus['AccountCount']; 69 $Form->Values['CharacterCount'] = $ServerStatus['CharacterCount']; 70 $Form->Values['CharacterOnlineCount'] = $ServerStatus['CharacterOnlineCount']; 55 71 $Output .= $Form->ShowTable(); 56 72 $Output .= '<div style="text-align: center">'; … … 60 76 if(array_key_exists('Id', $Server->Server['Database']) and ($Server->Server['Lock'] == 0)) 61 77 { 62 $ServerStatus = $Server->GetState();63 78 if($ServerStatus['RealmdPortState'] == true) $Output .= ' <a href="?Action=ServerStop&Id='.$Server->Id.'">Zastavit</a> <a href="?Action=ServerRestart&Id='.$Server->Id.'">Restartovat</a>'; 64 79 else $Output .= ' <a href="?Action=ServerStart&Id='.$Server->Id.'">Spustit</a>'; … … 457 472 else 458 473 { 459 $Form = new Form(' NewServer');474 $Form = new Form('ServerCreate'); 460 475 $Form->LoadValuesFromForm(); 461 476 $Form->OnSubmit = '?Action=ServerCreate'; … … 482 497 if($NewPortWorldd < $Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd']; 483 498 484 $Form = new Form(' NewServer', array());499 $Form = new Form('ServerCreate', array()); 485 500 $Form->LoadValuesFromForm(); 486 $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => 1, 'NetworkPortWorldd' => $NewPortWorldd, 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1 ));501 $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => 1, 'NetworkPortWorldd' => $NewPortWorldd, 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1, 'TimeCreate' => 'NOW()')); 487 502 $LastInsertId = $this->Database->insert_id; 488 503 $Server = new Server($this->Database, $LastInsertId); … … 506 521 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 507 522 { 508 $Form = new Form(' EditServer');523 $Form = new Form('ServerEdit'); 509 524 $Form->LoadValuesFromDatabase($_GET['Id']); 510 525 $Form->Values['ServerId'] = $_GET['Id']; … … 518 533 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 519 534 { 520 $Form = new Form(' EditServer', array());535 $Form = new Form('ServerEdit', array()); 521 536 $Form->LoadValuesFromForm(); 522 537 $ServerId = $_POST['ServerId'];
Note:
See TracChangeset
for help on using the changeset viewer.