Ignore:
Timestamp:
Jan 4, 2020, 11:59:33 AM (4 years ago)
Author:
chronos
Message:
  • Added: New filter data type Boolean for representing on/off switches.
  • Added: Show only upcoming events. Allow to show also past events.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Event/EventPage.php

    r51 r52  
    3838    $Filter = new Filter();
    3939    $Filter->Items = array(
     40      array('Name' => 'past', 'Type' => 'Boolean', 'DbName' => '', 'Title' => 'Proběhlé'),
    4041      array('Name' => 'title', 'Type' => 'String', 'DbName' => 'Title', 'Title' => 'Titulek'),
    4142      array('Name' => 'description', 'Type' => 'String', 'DbName' => 'Description', 'Title' => 'Popis'),
    42       array('Name' => 'price', 'Type' => 'String', 'DbName' => 'Price', 'Title' => 'Cena'),
     43      array('Name' => 'price', 'Type' => 'Integer', 'DbName' => 'Price', 'Title' => 'Cena'),
    4344      array('Name' => 'location', 'Type' => 'String', 'DbName' => 'Location', 'Title' => 'Umístění'),
    4445      array('Name' => 'source', 'Type' => 'String', 'DbName' => 'SourceName', 'Title' => 'Import'),
     
    5354    $Output .= $Filter->GetOutput($this->System->Link('/udalosti/'));
    5455    $Where = $Filter->GetWhere($this->Database);
     56    if ($_SESSION['past'] != 1) $Where .= ' AND (TimeFrom > NOW())';
    5557
    5658    $DbResult = $this->Database->query('SELECT COUNT(*) FROM (SELECT *, '.
     
    7173      array('Name' => '', 'Title' => 'Detail'),
    7274    );
    73     $Order = GetOrderTableHeader($TableColumns, 'TimeFrom', 1);
     75    $Order = GetOrderTableHeader($TableColumns, 'TimeFrom', 0);
    7476    $Output .= '<table class="WideTable">';
    7577    $Output .= $Order['Output'];
Note: See TracChangeset for help on using the changeset viewer.