Changeset 415 for trunk/index.php


Ignore:
Timestamp:
Oct 7, 2012, 8:37:15 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Optimalizace kontroly oprávnění operací.
  • Upraveno: Načítání skupin odkazů na hlavní stránce.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        66postfixadmin
        77backup
         8.project
         9.buildpath
         10.settings
  • trunk/index.php

    r305 r415  
    99  var $ShortTitle = '';
    1010 
    11   function ShowLinks($GroupId)
    12   {
    13     global $Database;
    14    
    15     $DbResult = $Database->query('SELECT * FROM `HyperlinkGroup` WHERE `Id`='.$GroupId);
    16     $HyperlinkGroup = $DbResult->fetch_assoc();
    17 
     11  function ShowLinks($HyperlinkGroup)
     12  {
    1813    $Output = '';
    19     $DbResult = $Database->query('SELECT * FROM `Hyperlink` WHERE (`Group`='.$GroupId.') AND (`Enable` = 1)');
     14    $DbResult = $this->Database->query('SELECT * FROM `Hyperlink` WHERE (`Group`='.$HyperlinkGroup['Id'].') AND (`Enable` = 1)');
    2015    while($HyperLink = $DbResult->fetch_assoc())
    2116    {
    2217      if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png';
    2318        if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL'];
    24         if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Modules['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
     19        if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Modules['User']->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
    2520        $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />';
    2621    }
     
    6358    if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    6459    {
    65       $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'].'))');
     60      $DbResult = $this->Database->select('MemberPayment', 'Cash', 'Member=(SELECT Customer FROM UserCustomerRel WHERE Id='.$this->System->Modules['User']->User['Id'].')');
    6661      if($DbResult->num_rows > 0)
    6762      {
    6863        $DbRow = $DbResult->fetch_assoc();
    69         $Output2 .= ' &nbsp;  &nbsp; <img alt="" src="images/favicons/money.png" width="16" height="16" /> '.$DbRow['Money'].' Kč';
     64        $Output2 .= ' &nbsp;  &nbsp; <img alt="" src="images/favicons/money.png" width="16" height="16" /> '.$DbRow['Cash'].' Kč';
    7065      }
    7166    }
     
    273268    $Database->select_db($Config['Database']['Database']);
    274269
     270    $DbResult = $Database->query('SELECT * FROM `HyperlinkGroup`');
     271    while($DbRow = $DbResult->fetch_assoc())
     272      $HyperlinkGroups[$DbRow['Id']] = $DbRow;
     273
    275274    // Show pannels
    276275    //if(IsInternetAddr()) echo('Internet'); else echo('LAN');
    277     //$Output .= $this->InfoBar();
     276    $Output .= $this->InfoBar();
    278277    $Output .= '<table id="MainTable"><tr>';
    279278    $DbResult = $Database->select('PanelColumn', '*');
     
    283282        else $Width = '';
    284283      $Output .= '<td valign="top"'.$Width.'>';
    285       $DbResult2 = $Database->query('SELECT * FROM  `Panel` WHERE `PanelColumn`='.$PanelColumn['Id'].' ORDER BY `Order`');
     284      $DbResult2 = $Database->query('SELECT * FROM `Panel` WHERE `PanelColumn`='.$PanelColumn['Id'].' ORDER BY `Order`');
    286285      while($Panel = $DbResult2->fetch_assoc())
    287286      {
    288         if($Panel['Module'] == 'HyperlinkGroup') $Output .= $this->ShowLinks($Panel['Parameters']);
     287        if($Panel['Module'] == 'HyperlinkGroup') $Output .= $this->ShowLinks($HyperlinkGroups[$Panel['Parameters']]);
    289288        else if($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList());
    290289        else if($Panel['Module'] == 'UserOptions')
Note: See TracChangeset for help on using the changeset viewer.