Changeset 154 for www/index.php


Ignore:
Timestamp:
Feb 16, 2009, 7:54:34 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Postupné odstraňování odkazů na tabulku users.
  • Upraveno: Některé stránky přepracovány do nového zobrazovacího systému.
  • Přidáno: Tabulka Subject rozdělena na tabulky Subject a Member. Transformační skript upraven.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/index.php

    r153 r154  
    104104    $Output = '<img alt="" src="images/favicons/comp.gif" width="16" height="16" /> '.$OnlineComputers.' / '.$TotalComputers.' &nbsp;  &nbsp; ';
    105105
    106     $DbResult = $this->Database->select('users', 'COUNT(*)', 'role=2');
     106    $DbResult = $this->Database->select('Member', 'COUNT(*)', 'MemberState=0');
    107107    $DbRow = $DbResult->fetch_array();
    108108    $TotalUser = $DbRow[0];
     
    121121    if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    122122    {
    123       $DbResult = $this->Database->select('users', 'cash', 'User='.$this->System->Modules['User']->User['Id']);
     123      $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Modules['User']->User['Id'].'))');
    124124      if($DbResult->num_rows > 0)
    125125      {
    126         $DbRow = $DbResult->fetch_array();
    127         $Finance = $DbRow[0];
    128         $Output2 .= ' &nbsp;  &nbsp; <img alt="" src="images/favicons/money.gif" width="16" height="16" /> '.$Finance.' Kč';
     126        $DbRow = $DbResult->fetch_assoc();
     127        $Output2 .= ' &nbsp;  &nbsp; <img alt="" src="images/favicons/money.gif" width="16" height="16" /> '.$DbRow['Money'].' Kč';
    129128      }
    130129    }
     
    157156  }
    158157
    159   // Zobrazení seznamu online počítačů
    160158  function OnlineHostList()
    161159  {
     
    172170  }
    173171
    174   // Zobrazení seznamu neplaticich uzivatelu
    175172  function ShowBadPayerList()
    176173  {
    177174    $Output .= '<div class="PanelTitle">Dlužníci:</div><span style="font-size: smaller;">';
    178     $DbResult = $Database->select('users', 'CONCAT(second_name, " ", first_name) as fullname', 'cash<0 AND role=2 ORDER BY cash');
     175    $DbResult = $Database->select('Subject', 'Name', 'Money < 0 ORDER BY Money');
    179176    while($Row = $DbResult->fetch_array())
    180177    {
    181       $Output .= $Row['fullname'].'<br />';
     178      $Output .= $Row['Name'].'<br />';
    182179    }
    183180    $Output .= '</span>';
     
    185182  }
    186183
    187   // Zobrazení času běhu počítače
    188184  function GetServerUptime()
    189185  {
    190186    $Data = explode(' ',exec('uptime'));
    191     $Data = array_slice($Data,3,-8);
     187    $Data = array_slice($Data, 3, -8);
    192188    $Uptime = '';
    193189    foreach($Data as $Item)
    194190    {
    195       if(strpos($Item,':')) $Uptime .= substr($Item,0,-1).' hodin';
     191      if(strpos($Item, ':')) $Uptime .= substr($Item, 0, -1).' hodin';
    196192      else $Uptime .= $Item.' ';
    197193    }
    198     $Uptime = str_replace('2 days,','2 dny a',$Uptime);
    199     $Uptime = str_replace('3 days,','3 dny a',$Uptime);
    200     $Uptime = str_replace('4 days,','4 dny a',$Uptime);
    201     $Uptime = str_replace('days,','dní a',$Uptime);
    202     $Uptime = str_replace('day,','den a',$Uptime);
    203     $Uptime = str_replace('min,','minut',$Uptime);
     194    $Uptime = str_replace('2 days,', '2 dny a', $Uptime);
     195    $Uptime = str_replace('3 days,', '3 dny a', $Uptime);
     196    $Uptime = str_replace('4 days,', '4 dny a', $Uptime);
     197    $Uptime = str_replace('days,', 'dní a', $Uptime);
     198    $Uptime = str_replace('day,', 'den a', $Uptime);
     199    $Uptime = str_replace('min,', 'minut', $Uptime);
    204200    return($Uptime);
    205201  }
     
    209205    global $Database, $Config, $User;
    210206
    211     //$Database->select_db('share');
    212     //$Output = $this->InfoBar();
    213     // Process cookies
    214207        $Output = '';
    215208    if(array_key_exists('Action', $_GET))
     
    301294    $Database->select_db('is');
    302295
     296    $Output .= $this->InfoBar();
    303297    $Output .= '<table id="MainTable"><tr><td valign="top">';
    304298    $Output .= '<div class="Panel">'.$this->ShowLinks($this->Links['main']).'</div>';
Note: See TracChangeset for help on using the changeset viewer.