Changeset 20 for trunk/index.php


Ignore:
Timestamp:
Dec 26, 2018, 11:55:16 AM (6 years ago)
Author:
chronos
Message:
  • Added: Meet list filtering by name, location and message text.
  • Fixed: Amblar meet source date parsing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r19 r20  
    127127    {
    128128      $this->NoFullPage = true;
     129      if (array_key_exists('name', $_GET) ) $_SESSION['name'] = $_GET['name'];
     130      if (array_key_exists('location', $_GET) ) $_SESSION['location'] = $_GET['location'];
     131      if (array_key_exists('message', $_GET) ) $_SESSION['message'] = $_GET['message'];
    129132      if (array_key_exists('vekod', $_GET) ) $_SESSION['vekod'] = $_GET['vekod'];
    130133      if (array_key_exists('vekdo', $_GET) ) $_SESSION['vekdo'] = $_GET['vekdo'];
     
    184187    $Output .= '<h4 style="text-align: center;">Inzeráty:</h4>';
    185188    $Output .= '<div class="btn-group ma3">'.
     189      '<div class="label-box">Pohlaví</div>'.
    186190      '<button class="btn btn-filter cpohlavi btn-ico" onclick="upf(\'pohlavi\',0)" id="pohlavi0" data-toggle="tooltip" '.
    187       'data-placement="top" title="Obě pohlaví"><span class="icon-both"></span></button>'.
     191      'data-placement="top" title="Obě"><span class="icon-both"></span></button>'.
    188192      '<button class="btn btn-filter cpohlavi btn-ico" onclick="upf(\'pohlavi\',1)" id="pohlavi1" data-toggle="tooltip" '.
    189       'data-placement="top" title="Jen muži"><span class="icon-man"></span></button>'.
     193      'data-placement="top" title="Muži"><span class="icon-man"></span></button>'.
    190194      '<button class="btn btn-filter cpohlavi btn-ico" onclick="upf(\'pohlavi\',2)" id="pohlavi2" data-toggle="tooltip" '.
    191       'data-placement="top" title="Jen ženy"><span class="icon-woman"></span></button>'.
    192       '</div>';
     195      'data-placement="top" title="Ženy"><span class="icon-woman"></span></button>'.
     196      '</div> ';
     197    $Output .= '<div class="filter-num-box">'.
     198      '<div class="label-box">Jméno</div>'.
     199      '<input value="'.$_SESSION['name'].'" onkeyup="if(event.keyCode!=9) upf(\'name\',$(this).val(),(event.keyCode==13?0:1)); '.
     200      '" id="name" autocomplete="off" type="text">'.
     201      '</div> ';
    193202    $Output .= '<div class="filter-num-box">'.
    194203      '<div class="label-box">Věk</div>'.
     
    198207      '<input value="'.$_SESSION['vekdo'].'" onkeyup="'.
    199208      'if(event.keyCode!=9) upf(\'vekdo\',$(this).val(),(event.keyCode==13?0:1));" '.
    200       'id="vekdo" autocomplete="off" type="text"><div class="label-box">let</div></div>'.
     209      'id="vekdo" autocomplete="off" type="text">'.
     210      '<div class="label-box">let</div>'.
    201211      '</div> ';
    202212    $Output .= '<div class="filter-num-box">'.
     
    207217      '<input value="'.$_SESSION['vyskado'].'" onkeyup="'.
    208218      'if(event.keyCode!=9) upf(\'vyskado\',$(this).val(),(event.keyCode==13?0:1));" '.
    209       'id="vyskado" autocomplete="off" type="text"><div class="label-box">cm</div></div>'.
     219      'id="vyskado" autocomplete="off" type="text">'.
     220      '<div class="label-box">cm</div>'.
    210221      '</div> ';
    211222    $Output .= '<div class="filter-num-box">'.
     
    216227      '<input value="'.$_SESSION['vahado'].'" onkeyup="'.
    217228      'if(event.keyCode!=9) upf(\'vahado\',$(this).val(),(event.keyCode==13?0:1));" '.
    218       'id="vahado" autocomplete="off" type="text"><div class="label-box">cm</div></div>'.
    219       '</div>';
     229      'id="vahado" autocomplete="off" type="text">'.
     230      '<div class="label-box">Kg</div>'.
     231      '</div> ';
     232    $Output .= '<div class="filter-num-box">'.
     233      '<div class="label-box">Umístění</div>'.
     234      '<input value="'.$_SESSION['location'].'" onkeyup="if(event.keyCode!=9) upf(\'location\',$(this).val(),(event.keyCode==13?0:1)); '.
     235      '" id="location" autocomplete="off" type="text">'.
     236      '</div> ';   
     237    $Output .= '<div class="filter-num-box">'.
     238      '<div class="label-box">Zpráva</div>'.
     239      '<input value="'.$_SESSION['message'].'" onkeyup="if(event.keyCode!=9) upf(\'message\',$(this).val(),(event.keyCode==13?0:1)); '.
     240      '" id="message" autocomplete="off" type="text">'.
     241      '</div> ';   
    220242    }
    221243
    222244    $Where = '';
     245    if (array_key_exists('name', $_SESSION) and ($_SESSION['name'] != '')) $Where .= ' AND (Name LIKE "%'.$_SESSION['name'].'%")';
     246    if (array_key_exists('location', $_SESSION) and ($_SESSION['location'] != '')) $Where .= ' AND (Location LIKE "%'.$_SESSION['location'].'%")';
     247    if (array_key_exists('message', $_SESSION) and ($_SESSION['message'] != '')) $Where .= ' AND (Message LIKE "%'.$_SESSION['message'].'%")';
    223248    if (array_key_exists('vekod', $_SESSION) and ($_SESSION['vekod'] != '')) $Where .= ' AND (Age >= '.$_SESSION['vekod'].')';
    224249    if (array_key_exists('vekdo', $_SESSION) and ($_SESSION['vekdo'] != '')) $Where .= ' AND (Age <= '.$_SESSION['vekdo'].')';
Note: See TracChangeset for help on using the changeset viewer.