Changeset 2


Ignore:
Timestamp:
Aug 4, 2018, 1:08:58 AM (6 years ago)
Author:
chronos
Message:
  • Added: New page Meet where items from external webs will be imported.
Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      nbproject
      Config.php
      .settings
      .project
      .buildpath
  • trunk/index.php

    r1 r2  
    33include_once('Database.php');
    44include_once('Config.php');
     5include_once('Meet.php');
    56
     7function HumanDate($Time)
     8{
     9  return(date('j.n.Y', $Time));
     10}
     11 
    612class Application
    713{
     
    3036  {
    3137    $Output = '<div>'.
    32       '<a href="'.$this->Link('/tance/').'">Tance</a> ';
    33     $Output .= '<a href="'.$this->Link('/skoly/').'">Školy</a> '.
     38      '<a href="'.$this->Link('/tance/').'">Tance</a> '.
     39      '<a href="'.$this->Link('/skoly/').'">Školy</a> '.
     40      '<a href="'.$this->Link('/seznamka/').'">Seznamka</a> '.
    3441      '</div>';
    3542    return($Output);
     
    100107  }
    101108
     109  function ShowMeetList()
     110  {
     111    $Meet = new Meet();
     112    $Meet->Id = 1;
     113    $Meet->URL = 'https://www.tanecniskola.cz/seznamka/';
     114    $Meet->Database = $this->Database;
     115    $Meet->Parse();
     116   
     117    $Gender = array('Muž', 'Žena');
     118   
     119    $Output = '<h4 style="text-align: center;">Inzeráty:</h4>';
     120    $Output .= '<table class="WideTable">';
     121    $Output .= '<tr><th>Datum</th><th>Jméno</th><th>Výška</th><th>Věk</th><th>Email</th><th>Telefon</th><th>Pohlaví</th><th>Zpráva</th><th>Zdroj</th>';
     122    $Output .= '</tr>';
     123    $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
     124      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '1 ORDER BY `Date` DESC');
     125    while($MeetItem = $DbResult->fetch_assoc())
     126    {
     127      $Output .= '<tr>'.
     128        '<td>'.HumanDate(MysqlDateToTime($MeetItem['Date'])).'</td>'.
     129        '<td>'.$MeetItem['Name'].'</td>'.
     130        '<td>'.$MeetItem['Height'].'</td>'.
     131        '<td>'.$MeetItem['Age'].'</td>'.
     132        '<td>'.$MeetItem['Email'].'</td>'.
     133        '<td>'.$MeetItem['Phone'].'</td>'.
     134        '<td>'.$Gender[$MeetItem['Gender']].'</td>'.
     135        '<td>'.$MeetItem['Message'].'</td>'.
     136        '<td><a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a></td>';     
     137      $Output .= '</tr>';
     138    }
     139    $Output .= '</table>';   
     140
     141    return($Output);
     142  }
     143
    102144  function ShowPage($Content)
    103145  {
     
    131173    if(count($this->PathItems) > 0) {
    132174      if($this->PathItems[0] == 'skoly') $Output .= $this->ShowSchoolList();
    133       else if($this->PathItems[0] == 'skoly') $Output .= $this->ShowDanceList();
     175      else if($this->PathItems[0] == 'tance') $Output .= $this->ShowDanceList();
     176      else if($this->PathItems[0] == 'seznamka') $Output .= $this->ShowMeetList();
    134177      else $Output .= $this->ShowDanceList();
    135178    } else $Output .= $this->ShowDanceList();
Note: See TracChangeset for help on using the changeset viewer.