Changeset 164


Ignore:
Timestamp:
Feb 21, 2009, 11:04:42 AM (16 years ago)
Author:
george
Message:
  • Opraveno: Mazání položek ze seznamu online uživatelů.
  • Upraveno: Zobrazování členů sítě správcům financí.
  • Opraveno: Další menší opravy v souvislosti s předěláváním tabulky users.
Location:
www
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • www/finance/clenove.php

    r163 r164  
    1111    $Finance = $this->System->Modules['Finance'];
    1212        $this->System->Modules['Finance']->RecalculateTariffs(1);
    13         if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList'))
     13        if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');
     14
     15        // Seznam členů
     16    $Output = 'Seznam účastníků:<br>'.
     17    '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'.
     18    '<tr><th>JZástupce</th><th>Subjekt</th>';
     19    //<th>Cena za zařízení [Kč]</th>
     20    $Output .= '<th>Měsíční poplatek [Kč]</th><th>Stav účtu [Kč]</th><th>Běžící tarif</th><th>Příští tarif</th><th>Poznámky</th></tr>';
     21    $TotalDevice = 0;
     22    $TotalMonth = 0;
     23    $TotalCash = 0;
     24    $DbResult = $this->Database->query('SELECT MonthlyTotal, Cash, Subject.Id, Subject.Name, NetworkDevice, InternetTariffCurrentMonth, InternetTariffNextMonth, CONCAT(User.SecondName, " ", User.FirstName) AS FullName FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member JOIN Subject ON Subject.Id=Member.Subject JOIN User ON User.Id=Member.ResponsibleUser ORDER BY FullName');
     25    while($Row = $DbResult->fetch_assoc())
    1426    {
    15       // Seznam členů
    16       $Output = 'Seznam účastníků:<br>'.
    17       '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'.
    18       '<tr><th>Jméno</th>';
    19       //<th>Cena za zařízení [Kč]</th>
    20       $Output .= '<th>Měsíční poplatek [Kč]</th><th>Stav účtu [Kč]</th><th>Běžící tarif</th><th>Příští tarif</th><th>Poznámky</th></tr>';
    21       $TotalDevice = 0;
    22       $TotalMonth = 0;
    23       $TotalCash = 0;
    24       $DbResult = $this->Database->query('SELECT * FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member JOIN Subject ON Subject.Id=Member.Subject ORDER BY Name');
    25       while($Row = $DbResult->fetch_array())
    26       {
    27        //$Row['cash'] = $Row['AdvancesIn'] - $Row['AdvancesOut'] + $Row['Liabilities'] - $Row['Claims'];
    28         $TotalCash += $Row['Cash'];
    29         if($Row['Cash'] < 0) $Row['Cash'] = '<span style="color: red;">'.$Row['Cash'].'</span>';
    30         $Tarif = $Finance->Tarify[$Row['InternetTariffCurrentMonth']]['name'];
    31         $PristiTarif = $Finance->Tarify[$Row['InternetTariffNextMonth']]['name'];
    32         $Output .= '<tr><td><a href="user_state.php?id='.$Row['Id'].'">'.$Row['Name'].'</a></td>';
    33         //<td align="right">'.$Row['network_device'].'</td>
    34         $Output .= '<td align="right">'.$Row['MonthlyTotal'].'</td><td align="right">'.$Row['Cash'].'</td><td align="center">'.$Tarif.'</td><td align="center">'.$PristiTarif.'</td></tr>';
    35         $TotalDevice += $Row['NetworkDevice'];
    36         $TotalMonth += ($Row['MonthlyTotal']);
    37       }
    38       $Output .= '<tr><td><strong>Celkem</strong></td>';
    39       //<td align="right"><strong>'.$TotalDevice.'</strong></td>
    40       $Output .= '<td align="right"><strong>'.$TotalMonth.'</strong></td><td align="right"><strong>'.$TotalCash.'</strong></td><td align="right">&nbsp;</td><td align="right">&nbsp;</td><td align="right">&nbsp;</td></tr>';
    41       $Output .= '</table>';
    42     } else $Output = 'Nemáte oprávnění';
     27     //$Row['cash'] = $Row['AdvancesIn'] - $Row['AdvancesOut'] + $Row['Liabilities'] - $Row['Claims'];
     28      $TotalCash += $Row['Cash'];
     29      if($Row['Cash'] < 0) $Row['Cash'] = '<span style="color: red;">'.$Row['Cash'].'</span>';
     30      $Tarif = $Finance->Tarify[$Row['InternetTariffCurrentMonth']]['name'];
     31      $PristiTarif = $Finance->Tarify[$Row['InternetTariffNextMonth']]['name'];
     32      $Output .= '<tr><td>'.$Row['FullName'].'</td><td><a href="user_state.php?userid='.$Row['Id'].'">'.$Row['Name'].'</a></td>';
     33      //<td align="right">'.$Row['network_device'].'</td>
     34      $Output .= '<td align="right">'.$Row['MonthlyTotal'].'</td><td align="right">'.$Row['Cash'].'</td><td align="center">'.$Tarif.'</td><td align="center">'.$PristiTarif.'</td></tr>';
     35      $TotalDevice += $Row['NetworkDevice'];
     36      $TotalMonth += ($Row['MonthlyTotal']);
     37    }
     38    $Output .= '<tr><td><strong>Celkem</strong></td><td>&nbsp;</td>';
     39    //<td align="right"><strong>'.$TotalDevice.'</strong></td>
     40    $Output .= '<td align="right"><strong>'.$TotalMonth.'</strong></td><td align="right"><strong>'.$TotalCash.'</strong></td><td align="right">&nbsp;</td><td align="right">&nbsp;</td><td align="right">&nbsp;</td></tr>';
     41    $Output .= '</table>';
    4342    return($Output);
    4443  }
  • www/finance/finance.php

    r163 r164  
    113113   
    114114    $this->SpravaUsers = $this->InternetUsers;
    115     $DbResult = $this->Database->query("SELECT SUM(consumption) FROM network_segments");
     115    $DbResult = $this->Database->query('SELECT SUM(consumption) FROM network_segments');
    116116    $TotalConsumption = $DbResult->fetch_array();
    117117    $this->TotalConsumption = $TotalConsumption[0];
  • www/finance/manage.php

    r157 r164  
    4949        break;
    5050      default:
    51         $Output = '<a href="?Operation=NewDeviceForm">Přidat nové zařízení</a><br>';
    52         $Output .= '<a href="?Operation=NewDeviceHistoryForm">Přidat nový záznam historie zařízení</a><br>';
    53         $Output .= '<a href="?Operation=NewPaymentForm">Přidat novou platbu</a><br>';
    54         $Output .= '<a href="?Operation=NewInvoiceForm">Přidat novou fakturu</a><br>';
    55         $Output .= '<a href="?Operation=ImportOldData">Importovat stará data</a><br>';
    56         $Output .= '<a href="?Operation=ConvertPDFToFile">Převést data z databáze do souborů</a><br>';
    57         $Output .= '<a href="?Operation=Bills">Správa dokladů</a><br>';
    58                 $Output .= '<a href="prepocet.php">Přepočet financí</a><br>';
     51        $Output = '<a href="?Operation=NewDeviceForm">Přidat nové zařízení</a><br />';
     52        $Output .= '<a href="?Operation=NewDeviceHistoryForm">Přidat nový záznam historie zařízení</a><br />';
     53        $Output .= '<a href="?Operation=NewPaymentForm">Přidat novou platbu</a><br />';
     54        $Output .= '<a href="?Operation=NewInvoiceForm">Přidat novou fakturu</a><br />';
     55        $Output .= '<a href="?Operation=ImportOldData">Importovat stará data</a><br />';
     56        $Output .= '<a href="?Operation=ConvertPDFToFile">Převést data z databáze do souborů</a><br />';
     57        $Output .= '<a href="?Operation=Bills">Správa dokladů</a><br />';
     58                $Output .= '<a href="prepocet.php">Přepočet financí</a><br />';
     59                $Output .= '<a href="clenove.php">Seznam subjektů</a><br />';
     60                $Output .= '<a href="zivnost.php">Živnost</a><br />';
    5961    }
    6062    return($Output);
     
    244246      $Row = $DbResult2->fetch_row();
    245247      $TotalAdvance = $Row[0];
    246       //echo($User['second_name'].' '.$User['first_name'].' '.$TotalAdvance.'<br>');
     248      //echo($User['second_name'].' '.$User['first_name'].' '.$TotalAdvance.'<br />');
    247249      // Záloha
    248250      if($TotalAdvance > 0)
     
    254256      {
    255257        $this->InsertLiability($Subject['Id'], (-$Row[0]), mktime(0, 0, 0, 12, 1, 2007), 0, 'Připojení k síti (z období před daňovou evidencí)');
    256         //echo($Database->LastQuery.'<br>');
     258        //echo($Database->LastQuery.'<br />');
    257259      }
    258260    }
     
    265267    while($Operation = $DbResult2->fetch_assoc())
    266268    {
    267       //echo($Operation['comment'].'<br>');
     269      //echo($Operation['comment'].'<br />');
    268270      if(substr($Operation['comment'], 0, 19) == 'Poplatek za měsíc')
    269271      {
     
    274276      {
    275277        $this->InsertMoney($Operation['user'], $Operation['money'], 0, 1, MysqlDateToTime($Operation['date']), 'Přijatá záloha');
    276         //echo($Operation['user'].' '.$Operation['money'].' Přijatá záloha<br>');
     278        //echo($Operation['user'].' '.$Operation['money'].' Přijatá záloha<br />');
    277279      } else
    278280      if($Operation['comment'] == 'Internet')
  • www/finance/prepocet.php

    r163 r164  
    4040      //if($Row['inet'] == 1)
    4141          $Monthly += $MonthlyInet;
    42       $Monthly -= $ConsumptionPlus;
     42      $Monthly -= $Finance->W2Kc($ConsumptionPlus);
    4343      //if($Row['overheads'] == 1) $Monthly += $Sprava; // + W2Kc($Consumption);
    4444      //echo($Row['fullname'].' '.$Row['inet'].' '.$Monthly.'<br>');
  • www/finance/zivnost.php

    r157 r164  
    77  var $ShortTitle = 'Daňová evidence';
    88
    9   function TransformFinance()
     9  /*function TransformFinance()
    1010  {
    1111    //$Database->Query('SELECT user as Subject, date as TimeCreation, date as TimeDue, date as TimePayment, -money as Value, bill_id as Bill, comment as Text FROM `finance_operations` WHERE Comment LIKE "Poplatek za měsíc%" AND date >= "2007-12-01"');
     
    2626      }
    2727    }
    28   }
     28  }*/
    2929
    3030  function Show()
     
    156156        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    157157        $Output .= '<tr><th>Čas</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Daňový</th><th>Hotovost</th></tr>';
    158         $DbResult = $this->Database->query('SELECT *, CONCAT(users.second_name, " ", users.first_name) as Name FROM FinanceCashFlow JOIN users ON users.id = FinanceCashFlow.Subject ORDER BY Time');
     158        $DbResult = $this->Database->query('SELECT * FROM FinanceCashFlow JOIN Subject ON Subject.Id = FinanceCashFlow.Subject ORDER BY Time');
    159159        while($Row = $DbResult->fetch_array())
    160160        {
     
    168168        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    169169        $Output .= '<tr><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>';
    170         $DbResult = $this->Database->query('SELECT *, CONCAT(users.second_name, " ", users.first_name) as Name FROM FinanceClaimsLiabilities JOIN users ON users.id = FinanceClaimsLiabilities.Subject WHERE Value > 0 ORDER BY TimeCreation');
     170        $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject WHERE Value > 0 ORDER BY TimeCreation');
    171171        while($Row = $DbResult->fetch_array())
    172172        {
     
    179179        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    180180        $Output .= '<tr><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>';
    181         $DbResult = $this->Database->query('SELECT *, CONCAT(users.second_name, " ", users.first_name) as Name FROM FinanceClaimsLiabilities JOIN users ON users.id = FinanceClaimsLiabilities.Subject WHERE Value < 0 ORDER BY TimeCreation');
     181        $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject WHERE Value < 0 ORDER BY TimeCreation');
    182182        while($Row = $DbResult->fetch_array())
    183183        {
     
    192192        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    193193        $Output .= '<tr><th>Subjekt</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas uzavření</th></tr>';
    194         $DbResult = $this->Database->query('SELECT *, CONCAT(users.second_name, " ", users.first_name) as Name FROM FinanceAdvances JOIN users ON users.id = FinanceAdvances.Subject WHERE Direction = "In" ORDER BY TimeCreation');
     194        $DbResult = $this->Database->query('SELECT * FROM FinanceAdvances JOIN Subject ON Subject.Id = FinanceAdvances.Subject WHERE Direction = "In" ORDER BY TimeCreation');
    195195        while($Row = $DbResult->fetch_array())
    196196        {
     
    203203        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    204204        $Output .= '<tr><th>Subjekt</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas uzavření</th></tr>';
    205         $DbResult = $this->Database->query('SELECT *, CONCAT(users.second_name, " ", users.first_name) as Name FROM FinanceAdvances JOIN users ON users.id = FinanceAdvances.Subject WHERE Direction = "Out" ORDER BY TimeCreation');
     205        $DbResult = $this->Database->query('SELECT * FROM FinanceAdvances JOIN Subject ON Subject.Id = FinanceAdvances.Subject WHERE Direction = "Out" ORDER BY TimeCreation');
    206206        while($Row = $DbResult->fetch_array())
    207207        {
     
    215215        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    216216        $Output .= '<tr><th>Jméno</th><th>Závazky [Kč]</th><th>Pohledávky [Kč]</th><th>Příjmy [Kč]</th><th>Výdaje [Kč]</th><th>Zálohy [Kč]</th><th>Stav účtu</th><th>Starý systém</th></tr>';
    217         $DbResult = $this->Database->query('SELECT id, CONCAT(users.second_name, " ", users.first_name) as Fullname, cash, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value > 0) as Claims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value > 0 AND TimePayment IS NULL) as OpenedClaims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value < 0) as Liabilities, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value < 0 AND TimePayment IS NULL) as OpenedLiabilities, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = users.id AND FinanceCashFlow.Value > 0) as Gains, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = users.id AND FinanceCashFlow.Value < 0) as Spends, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = users.id AND FinanceAdvances.Direction="In") as AdvancesIn, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = users.id AND FinanceAdvances.Direction="Out") as AdvancesOut FROM users ORDER BY fullname');
     217        $DbResult = $this->Database->query('SELECT Id, Name, 0 AS Cash, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value > 0) as Claims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value > 0 AND TimePayment IS NULL) as OpenedClaims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0) as Liabilities, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0 AND TimePayment IS NULL) as OpenedLiabilities, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = Subject.Id AND FinanceCashFlow.Value > 0) as Gains, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = Subject.Id AND FinanceCashFlow.Value < 0) as Spends, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = Subject.Id AND FinanceAdvances.Direction="In") as AdvancesIn, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = Subject.Id AND FinanceAdvances.Direction="Out") as AdvancesOut FROM Subject ORDER BY Name');
    218218        while($Row = $DbResult->fetch_array())
    219219        {
    220220          $Advances = ($Row['AdvancesIn'] - $Row['AdvancesOut']);
    221           $Output .= '<tr><td><a href="?table=SubjectAccount&Id='.$Row['id'].'">'.$Row['Fullname'].'</a></td><td>'.$Row['Liabilities'].'/'.$Row['OpenedLiabilities'].'</td><td>'.$Row['Claims'].'/'.$Row['OpenedClaims'].'</td><td>'.$Row['Gains'].'</td><td>'.$Row['Spends'].'</td><td>'.$Advances.'</td><td>'.($Advances - $Row['OpenedClaims'] + Abs($Row['OpenedLiabilities'])).'</td><td>'.$Row['cash'].'</td></tr>';
     221          $Output .= '<tr><td><a href="?table=SubjectAccount&Id='.$Row['Id'].'">'.$Row['Name'].'</a></td><td>'.$Row['Liabilities'].'/'.$Row['OpenedLiabilities'].'</td><td>'.$Row['Claims'].'/'.$Row['OpenedClaims'].'</td><td>'.$Row['Gains'].'</td><td>'.$Row['Spends'].'</td><td>'.$Advances.'</td><td>'.($Advances - $Row['OpenedClaims'] + Abs($Row['OpenedLiabilities'])).'</td><td>'.$Row['Cash'].'</td></tr>';
    222222        }
    223223        $Output .= '</table>';
     
    265265        $Output .= '</table>';
    266266
    267         $DbResult = $this->Database->query('SELECT id, CONCAT(users.second_name, " ", users.first_name) as Fullname, cash, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value > 0) as Claims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value > 0 AND TimePayment IS NULL) as OpenedClaims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value < 0) as Liabilities, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = users.id AND FinanceClaimsLiabilities.Value < 0 AND TimePayment IS NULL) as OpenedLiabilities, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = users.id AND FinanceCashFlow.Value > 0) as Gains, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = users.id AND FinanceCashFlow.Value < 0) as Spends, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = users.id AND FinanceAdvances.Direction="In") as AdvancesIn, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = users.id AND FinanceAdvances.Direction="Out") as AdvancesOut FROM users WHERE id='.$_GET['Id']);
     267        $DbResult = $this->Database->query('SELECT Id, 0 AS Cash, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value > 0) as Claims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value > 0 AND TimePayment IS NULL) as OpenedClaims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0) as Liabilities, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0 AND TimePayment IS NULL) as OpenedLiabilities, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = Subject.Id AND FinanceCashFlow.Value > 0) as Gains, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = Subject.Id AND FinanceCashFlow.Value < 0) as Spends, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = Subject.Id AND FinanceAdvances.Direction="In") as AdvancesIn, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = Subject.Id AND FinanceAdvances.Direction="Out") as AdvancesOut FROM Subject WHERE Id='.$_GET['Id']);
    268268        $Row = $DbResult->fetch_array();
    269269        $Output .= 'Stav placení: '.($Row['AdvancesIn'] - $Row['AdvancesOut'] - $Row['OpenedClaims'] + Abs($Row['OpenedLiabilities']));
  • www/otevreno.php

    r153 r164  
    77  var $ShortTitle = 'Otvírací doby';
    88  var $DaysOfWeek = array('Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota', 'Neděle');
     9  var $DayShift = 3;
    910
    1011  function Show()
     
    1516    {
    1617      $Output .= '<strong>'.$Subject['Name'].':</strong><br />';
    17       $DbResult2 = $this->Database->query('SELECT Subject, OpenTime, CloseTime, TIMEDIFF(CloseTime, DATE_FORMAT(NOW(), "0000-01-%w %T")) as RemainTime FROM `SubjectOpenTimeInterval` WHERE DATE_FORMAT(NOW(), "0000-01-%w %T") > OpenTime AND DATE_FORMAT(NOW(), "0000-01-%w %T") < CloseTime AND Subject='.$Subject['Subject']);
     18         
     19      $DbResult2 = $this->Database->query('SELECT Subject, OpenTime, CloseTime, TIMEDIFF(DATE_FORMAT(CloseTime, "0000-01-%w %T"), DATE_FORMAT(NOW(), "0000-01-%w %T")) as RemainTime FROM `SubjectOpenTimeInterval` WHERE DATE_FORMAT(NOW(), "0000-01-%w %T") > OpenTime AND DATE_FORMAT(NOW(), "0000-01-%w %T") < CloseTime AND Subject='.$Subject['Subject']);
    1820      if($DbResult2->num_rows > 0)
    1921      {
     
    2628        $Output .= 'Otevírá za '.$DbRow['RemainTime'];
    2729      }
    28       $Output .= '<table class="WideTable">
     30
     31          $Output .= '<table class="WideTable">
    2932<tr><th>Den</th><th>Čas</th></tr>';
    3033      foreach($this->DaysOfWeek as $DayIndex => $DayOfWeek)
    3134      {
    32         $DbResult2 = $this->Database->query('SELECT *, DATE_FORMAT(OpenTime, "%k:%i") as OpenTime, DATE_FORMAT(CloseTime, "%k:%i") as CloseTime FROM SubjectOpenTimeInterval WHERE SubjectOpenTimeInterval.Subject = '.$Subject['Subject'].' AND ((DAYOFWEEK(OpenTime) + 0) MOD 7)='.$DayIndex);
     35        $DbResult2 = $this->Database->query('SELECT *, DATE_FORMAT(OpenTime, "%k:%i") as OpenTime2, DATE_FORMAT(CloseTime, "%k:%i") as CloseTime2, DAYOFWEEK(OpenTime) as Week FROM SubjectOpenTimeInterval WHERE SubjectOpenTimeInterval.Subject = '.$Subject['Subject'].' AND ((DAYOFWEEK(OpenTime) + 7) MOD 7)='.$DayIndex);
    3336        $Output .= '<tr><td>'.$DayOfWeek.'</td><td align="center">';
    3437        if($DbResult2->num_rows)
     
    3639          while($TimeInterval = $DbResult2->fetch_assoc())
    3740          {
    38             $Output .= $TimeInterval['OpenTime'].' - '.$TimeInterval['CloseTime'].' &nbsp;&nbsp; ';
     41            $Output .= $TimeInterval['OpenTime2'].' - '.$TimeInterval['CloseTime2'].' &nbsp;&nbsp; ';
    3942          }
    4043        } else
  • www/temp/transform.php

    r163 r164  
    3939        array('DayOfWeek' => 4, 'Index' => 0,  'OpenTime' => '8:00:00', 'CloseTime' => '9:30:00'),
    4040        array('DayOfWeek' => 4, 'Index' => 1,  'OpenTime' => '14:30:00', 'CloseTime' => '15:30:00'),
    41         array('DayOfWeek' => 5, 'Index' => 0,  'OpenTime' => '6:00:00', 'CloseTime' => '9:30:00'),
    4241      ),
    4342    ),
     
    222221
    223222    // Init User table from users
    224     $DbResult = $this->Database->select('users', '*');
     223    $DbResult = $this->Database->select('users_old', '*');
    225224    while($DbRow = $DbResult->fetch_array())
    226225    {
  • www/user.php

    r153 r164  
    3232  var $User = array();
    3333  var $DefaultRole = 2;
    34   var $AnonymousUserId = 72;
     34  var $AnonymousUserId = 96;
    3535
    3636  function Check()
     
    6161    }
    6262
    63 
    6463    // Odeber neaktivní uživatele
    6564    $DbResult = $this->Database->select('UserOnline', 'Id, User', 'ActivityTime < DATE_SUB(NOW(), INTERVAL '.USER_TIMEOUT.' SECOND)');
    6665    while($DbRow = $DbResult->fetch_array())
    6766    {
    68       $this->Database->delete('UserOnline', 'Id='.$DbRow['User']);
     67      $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']);
    6968      $this->System->Modules['Log']->NewRecord('User', 'Logout');
    7069    }
Note: See TracChangeset for help on using the changeset viewer.