Changeset 134 for devel


Ignore:
Timestamp:
Jan 14, 2009, 9:46:16 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Přepracována hlavní stránky a přidány další dvě stránky přehledu financí a seznam členů.
  • Upraveno: Kompatibilita s Powtils 1.7.1.
Location:
devel/web
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • devel/web

    • Property svn:ignore set to
      *.ppu
      *.a
      *.o
  • devel/web/UMainPage.pas

    r1 r134  
    11unit UMainPage;
    22
     3{$mode delphi}{$H+}
     4
    35interface
    46
    5 uses
    6   UHtmlClasses;
     7function MainPage: string;
    78 
    89implementation
    910
     11uses
     12  USqlDatabase, UCore, UHtmlClasses, SysUtils;
     13
     14function ShowNews(Category: Integer): string;
    1015var
    11   MainPage: THtmlPage;
     16  DbRows: TDbRows;
     17  Index: Integer;
     18  FontSize: Integer;
     19  I: Integer;
     20  II: Integer;
     21  Enclosures: TArrayOfString;
     22const
     23  NewsCountPerCategory = 3;
     24  UploadedFilesFolder = 'aktuality/uploads/'; 
     25begin
     26//  global $NewsCategoryNames, $NewsCountPerCategory, $UploadedFilesFolder;
     27
     28  DbRows := Database.Select('news_category', '*', 'id=' + IntToStr(Category));
     29
     30  Result := '<table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-size: small; padding-bottom: 5px;"><tr>'+
     31    '<td width="40%">' + DbRows[0].Values['caption'] + '</td><td width="80%" align="right">'+
     32    '<a href="aktuality/index.php?category=' + IntToStr(Category) + '">Zobrazit všechny aktuality</a>&nbsp;';
     33  if StrToInt(DbRows[0].Values['permission']) = 1 then Result := Result + '<a href="aktuality/index.php?action=add&amp;category=' + IntToStr(Category) + '">Přidat aktualitu</a>&nbsp;';
     34  Result := Result + '</td></tr><tr><td colspan="2">'+
     35    '<table cellspacing="0" width="100%" style="padding: 2px 2px 2px 2px; font-size: small; border-style: solid; border-color: red; border-width: 1; background-color: #FFF0F0;">';
     36  Index := 0;
     37  FontSize := 12;
     38  DbRows := Database.Select('news', '*', 'category=' + IntToStr(Category) + ' ORDER BY date DESC LIMIT 0,' + IntToStr(NewsCountPerCategory));
     39  for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
     40    Result := Result + '<tr><td onmouseover="zobraz(''."''new".$Category.$Index."''".'')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%">'+
     41      '<tr><td style="font-size: ' + IntToStr(FontSize) + 'pt"><strong>' + Values['title'] + '</strong></td>'+
     42      '<td align="right" style="font-size: ' + IntToStr(FontSize) + 'pt">' + Values['author'] + ' (' + HumanDate(Values['date']) + ')</td></tr></table>'+
     43      '<div id="new' + IntToStr(Category) + IntToStr(Index) + '" class="skryty" style="display: none; border-width: 1; border-style: solid; border-color: blue; padding: 3px; font-size: 9pt;">' + Values['content'];
     44
     45    if Values['enclosure'] <> '' then begin
     46      Result := Result + '<br>Přílohy: ';
     47      Enclosures := Explode(';', Values['enclosure']);
     48            for II := 0 to High(Enclosures) do begin
     49              // if(file_exists($UploadedFilesFolder.$Enclosure)) echo(' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>')
     50      end;
     51    end;
     52    Result := Result + '</div></td></tr>';
     53    Index := Index + 1;   
     54    FontSize := FontSize - 2;
     55  end;
     56  Result := Result + '</table></td></tr></table>';
     57end;
     58
     59function MainPage: string;
     60var
     61  Output: string;
     62  DbRows: TDbRows;
     63  I: Integer;
     64begin
     65  Output := ShowHeader('<strong>ZděchovNET</strong> - komunitní počítačová síť', 'Rozcestní­k');
     66  Output := Output + '<script type="text/javascript">'+
     67    '<!--'+
     68    'function openClient(client_type)'+
     69    '{'+
     70    'if(client_type=="java")clientWindow = window.open("http://go.icq.com/icq2go/web.html","ICQ2Go","left=20,top=20,width=156,height=446,toolbar=0,resizable=0");'+
     71    'else clientWindow = window.open("http://go.icq.com/icq2go/flicq.html","ICQ2Go","left=20,top=20,width=176,height=441,toolbar=0,resizable=0");'+
     72    '}'+
     73
     74'var predchozi = ''first'';'+
     75''+
     76'function zobraz(idecko)'+
     77'{'+
     78'  skryj(predchozi);'+
     79  'el=document.getElementById(idecko).style;'+
     80  '  el.display=''block'';'+
     81  'predchozi = idecko;'+
     82  '}'+
     83''+
     84'function skryj(idecko)'+
     85'{'+
     86  'if(idecko != ''first'')'+
     87  '{'+
     88  '  el=document.getElementById(idecko).style;'+
     89  '  el.display=''none'';'+
     90  '}'+
     91'}'+
     92'//-->'+
     93'</script>'+
     94''+
     95'<table width="100%"><tr><td valign="top">' +
     96'<table width="100%">' +
     97'<tr><td width="20%" valign="top">' +
     98'<strong>Důležité odkazy:</strong><br>' +
     99InsertIcon('money.gif') + ' <a href="?p=finance">Finance</a><br>' +
     100InsertIcon('chart.gif') + ' <a href="?p=statistic">Statistika</a><br>' +
     101InsertIcon('prohledavac_sdileni.gif') + ' <a href="/share">Prohledat sdílení</a><br>' +
     102InsertIcon('comp.gif') + ' <a href="/userlist.php">Seznam uživatelů</a><br>' +
     103InsertIcon('comp.gif') + ' <a href="/hostlist.php">Seznam počítačù</a><br>' +
     104InsertIcon('sunrisechat.gif') + ' <a href="/sunrisechat/history.php">Historie SunriseChatu</a><br>' +
     105InsertIcon('sunrisechat.gif') + ' <a href="/sunrisechat/webchat.php">Webový SunriseChatu</a><br>' +
     106InsertIcon('discus.gif') + ' <a href="/forum">Diskusní fórum</a><br>' +
     107InsertIcon('openwebmail.gif') + ' <a href="https://centrala.zdechov.net/cgi-bin/openwebmail/openwebmail.pl">WebMail</a><br>' +
     108InsertIcon('apple.gif') + ' <a href="/jidelna">Jídelníček</a><br>' +
     109InsertIcon('clear.gif') + ' <a href="http://tv.zdechov.net/">Televize</a><br>' +
     110InsertIcon('cube.gif') + ' <a href="http://game-server.zdechov.net/">Herní server</a><br>' +
     111InsertIcon('cfix.gif') + ' <a href="/farnost">Rozpis mší</a><br>' +
     112InsertIcon('tel.gif') + ' <a href="/telseznam.php">Telefonní seznam</a><br>' +
     113InsertIcon('pripoj.gif') + ' <a href="/nabidky_pripojeni.php">Nabídky připojení</a><br>' +
     114InsertIcon('zapisy.gif') + ' <a href="/docs/zapisy/zapisy.php">Zápisy ze schůzí</a><br>' +
     115InsertIcon('lear.gif') + ' <a href="/mapy/mapa.php">Mapa Zděchova</a><br>' +
     116InsertIcon('otv_doby.gif') + '<a href="/otevreno.php">Otvírací doby</a><br>' +
     117InsertIcon('topologie.gif') + ' <a href="/is/topologie.php">Topologie sítě</a><br>' +
     118InsertIcon('satellite.gif') + ' <a href="/is/dostupnost.php">Dostupnost sítě</a><br>' +
     119InsertIcon('tech.gif') + ' <a href="/network.php">Technické informace</a><br>' +
     120InsertIcon('socer.gif') + ' <a href="http://fotbal.zdechov.net/">Fotbal Sokol Zděchov</a><br>' +
     121'<br>' +
     122'<strong>Další odkazy:</strong><br>' +
     123InsertIcon('tv.gif') + ' <a href="/tkr.php">Kanály kabelovky</a><br>'+
     124InsertIcon('clear.gif') + ' <a href="/mapy/mapa_nabidka.php">Nabídka mapy</a><br>'+
     125InsertIcon('clear.gif') + ' <a href="/history.php">Historie sítě</a><br>'+
     126InsertIcon('electric.gif') + ' <a href="/merak.php">Měřič spotřeby</a><br>'+
     127InsertIcon('clear.gif') + ' <a href="/sluzby.php">Seznam služeb</a><br>'+
     128InsertIcon('clear.gif') + ' <a href="/ukoly.php">Plány do budoucna</a><br>'+
     129InsertIcon('clear.gif') + ' <a href="/navody.php">Návody</a><br>'+
     130InsertIcon('info.gif') + ' <a href="/infokanal/index.htm">Infokanál</a><br>'+
     131InsertIcon('progman.gif') + ' <a href="/manualy.php">Programátorské manuály</a><br>'+
     132'<br>'+
     133'</td><td width="13%" valign="top">'+
     134'<strong>Vyhledávání:</strong><br>'+
     135InsertIcon('www_google_com.gif') + ' <a href="http://www.google.cz/">Google</a><br>'+
     136InsertIcon('morfeo.png') + ' <a href="http://morfeo.centrum.cz">Morfeo</a><br>'+
     137InsertIcon('www_centrum_cz.gif"') + '<a href="http://www.centrum.cz">Centrum</a><br>'+
     138InsertIcon('www_seznam_cz.gif') + ' <a href="http://www.seznam.cz">Seznam</a><br>'+
     139InsertIcon('www_atlas_cz.gif') + ' <a href="http://www.atlas.cz">Atlas</a><br>'+
     140InsertIcon('www_tiscali_cz.gif') + ' <a href="http://www.tiscali.cz">Tiscali</a><br>'+
     141'<br>'+
     142'<strong>Užitečné:</strong><br>'+
     143InsertIcon('clear.gif') + ' <a href="http://www.zdechov.net">Stránky naší sítě</a><br>'+
     144InsertIcon('www_tvinfo_cz.gif') + ' <a href="http://www.tvinfo.cz/live/televize/cz">Online TV</a><br>'+
     145InsertIcon('www_idos_cz.gif') + ' <a href="http://www.idos.cz/ConnForm.asp?tt=c">Jízdní řády</a><br>'+
     146InsertIcon('www_atlas_cz.gif') + ' <a href="http://tv.atlas.cz">TV programy</a><br>'+
     147InsertIcon('www_icq_com.gif') + ' Web ICQ <a href="javascript:openClient(''flash'')">Flash</a>&nbsp;<a href="javascript:openClient(''java'')">Java</a><br>'+
     148InsertIcon('www_centrum_cz.gif') + ' <a href="http://slovniky.centrum.cz">Slovníky</a><br>'+
     149InsertIcon('pocasi.gif') + ' <a href="http://www.meteopress.cz/">Počasí</a><br>'+
     150InsertIcon('www_tzones_cz.gif') + ' <a href="http://www.tzones.cz/">T-Mobile SMS</a><br>'+
     151InsertIcon('www_mvk_cz.png') + ' <a href="http://www.mvk.cz/">Knihovna&nbsp;Vsetín</a><br>'+
     152'<br>'+
     153'<strong>Prodej počítačů:</strong><br>'+
     154InsertIcon('www_computershop_cz.png') + ' <a href="http://shop.computershop.cz/eshop/">SOFTCOM</a><br>'+
     155InsertIcon('www_alfacomp_cz.gif') + ' <a href="http://www.alfacomp.cz/php/zbozi.php?akc=2">Alfacomp</a><br>'+
     156InsertIcon('www_petracomp_cz.png') + ' <a href="http://www.petracomp.cz/">Petracomp</a><br>'+
     157InsertIcon('www_tsbohemia_cz.png') + ' <a href="http://interlink.tsbohemia.cz/">TS Bohemia</a><br>'+
     158'<br>' +
     159'</td>' +
     160'<td width="15%" valign="top">';
     161  // Zobrazení seznamu online poèítaèù
     162  Output := Output + '<strong>Online počítače:</strong><br><span style="font-size: smaller;">';
     163  DbRows := Database.Select('hosts', 'name', 'online=1 AND show_online=1 ORDER BY name');
     164  for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
     165    Output := Output + Values['name'] + '<br>';
     166  end;
     167  DbRows.Free;
     168  Output := Output + '</span><br>';
     169
     170  // Zobrazení seznamu dlu¾níkù
     171  Output := Output + '<strong>Dlužníci:</strong><br><span style="font-size: smaller;">';
     172  DbRows := Database.Select('users', 'fullname', 'cash<0 ORDER BY cash');
     173  for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
     174    Output := Output + Values['fullname'] + '<br>';
     175  end;
     176  DbRows.Free;
     177  Output := Output + '</span>';
     178  Output := Output + '</td></tr></table>';
     179
     180 (*
     181  // Zobrazení èasu bìhu poèítaèe
     182  Data = explode(' ', exec('uptime'));
     183  Data = array_slice($Data,3,-8);
     184  Uptime = '';
     185  foreach($Data as $Item)
     186  {
     187    if(strpos($Item,':')) $Uptime .= substr($Item,0,-1).' hodin';
     188    else $Uptime .= $Item.' ';
     189  }
     190  $Uptime = str_replace('2 days,','2 dny a',$Uptime);
     191 $Uptime = str_replace('3 days,','3 dny a',$Uptime);
     192$Uptime = str_replace('4 days,','4 dny a',$Uptime);
     193$Uptime = str_replace('days,','dní a',$Uptime);
     194$Uptime = str_replace('day,','den a',$Uptime);
     195$Uptime = str_replace('min,','minut',$Uptime);
     196echo('Server bì¾í '.$Uptime);
     197*)
     198  Output := Output + '</td><td width="50%" valign="top" style="font-size: smaller;">';
     199 
     200(* 
     201$File = fopen('/tmp/temperature2','r');
     202$Teplota = fgets($File);
     203$Teplota = round($Teplota*10)/10;
     204fclose($File);
     205
     206  Output := Output + '<table width="100%"><tr><td><strong>Aktuálnì:</strong></td><td align="right">'+
     207    '<img alt="Teplomer" width="10" height="18" src="images/teplomer3.png"><a href="statistic/trafficview2.php?type=temp">' + Teplota + '°C (mimo provoz)</a></td></tr></table>';
     208*)
     209
     210  Output := Output + '<div onmouseout="skryj(predchozi)">'+ ShowNews(5) + ShowNews(3) + ShowNews(1) + ShowNews(2) + ShowNews(4) + ShowNews(6) + ShowNews(8) + ShowNews(9) + ShowNews(10);
     211
     212  Output := Output + '<a href="aktuality/subscription.php"><img style="margin: 0px 0px 0px 0px;" border="0" src="images/rss20.png" alt="Aktuality pøes RSS"></a>  <a href="aktuality/subscription.php">Automatické sledování novinek</a>'+
     213  '</div></td></tr></table>';
     214  Output := Output + ShowFooter;
     215  Result := Output;
     216end;
     217
     218//var
     219//  MainPage: THtmlPage;
    12220begin
    13221  //MainPage := THtmlPage.Create;
    14  
    15  
     222  RegisterPage('index', @MainPage);   
    16223end.
  • devel/web/USqlDatabase.pas

    r1 r134  
    8484  function MySQLFloatToStr(F: Real): string;
    8585  function MySQLStrToFloat(S: string): Real;
     86  function MySQLDateToDateTime(Date: string): TDateTime;
    8687
    8788implementation
     
    105106
    106107{ TDataModule2 }
     108
     109function MySQLDateToDateTime(Date: string): TDateTime;
     110begin
     111  Result := 0;
     112end;
    107113
    108114function MySQLFloatToStr(F: Real): string;
  • devel/web/backup/index.lpi.bak

    r1 r134  
    22<CONFIG>
    33  <ProjectOptions>
    4     <PathDelim Value="\"/>
    5     <Version Value="5"/>
     4    <PathDelim Value="/"/>
     5    <Version Value="6"/>
    66    <General>
    77      <Flags>
     
    5656        <Filename Value="USqlDatabase.pas"/>
    5757        <UnitName Value="USqlDatabase"/>
    58         <CursorPos X="27" Y="8"/>
     58        <CursorPos X="22" Y="8"/>
    5959        <TopLine Value="1"/>
    6060        <EditorIndex Value="1"/>
     
    6363      </Unit2>
    6464    </Units>
    65     <JumpHistory Count="1" HistoryIndex="0">
     65    <JumpHistory Count="2" HistoryIndex="1">
    6666      <Position1>
    6767        <Filename Value="USqlDatabase.pas"/>
    6868        <Caret Line="1" Column="1" TopLine="1"/>
    6969      </Position1>
     70      <Position2>
     71        <Filename Value="USqlDatabase.pas"/>
     72        <Caret Line="8" Column="27" TopLine="1"/>
     73      </Position2>
    7074    </JumpHistory>
    7175  </ProjectOptions>
    7276  <CompilerOptions>
    73     <Version Value="5"/>
    74     <PathDelim Value="\"/>
    75     <CodeGeneration>
    76       <Generate Value="Faster"/>
    77     </CodeGeneration>
     77    <Version Value="8"/>
    7878    <Other>
    7979      <CompilerPath Value="$(CompPath)"/>
  • devel/web/deploy.sh

    r1 r134  
    11#!/bin/sh
    2 fpc -Fu/a/devel/psp/main/ -Fu/usr/share/fpcsrc/package/base/mysql -Fu/a/devel/psp/extras/ -Fu/a/devel/psp/extras/*/ -Fi/a/devel/psp/main/inc/ -Fu/a/devel/psp/main/zlib/ -Xs -XX -CX index.pas
    3 cp index /var/www/html/pas/index.cgi
     2fpc -Fu/var/www/html/other/powtils/main/ \
     3-Fu/usr/share/fpcsrc/package/base/mysql \
     4-Fu/var/www/html/other/powtils/extras/ \
     5-Fu/var/www/html/other/powtils/extras/*/ \
     6-Fi/var/www/html/other/powtils/main/inc/ \
     7-Fu/var/www/html/other/powtils/main/zlib/ \
     8-Xs -XX -CX index.pas
     9
     10cp index /var/www/cgi-bin/index.cgi
  • devel/web/index.lpi

    r1 r134  
    22<CONFIG>
    33  <ProjectOptions>
    4     <PathDelim Value="\"/>
    5     <Version Value="5"/>
     4    <PathDelim Value="/"/>
     5    <Version Value="6"/>
    66    <General>
    77      <Flags>
     
    7575  </ProjectOptions>
    7676  <CompilerOptions>
    77     <Version Value="5"/>
    78     <PathDelim Value="\"/>
    79     <CodeGeneration>
    80       <Generate Value="Faster"/>
    81     </CodeGeneration>
     77    <Version Value="8"/>
    8278    <Other>
    8379      <CompilerPath Value="$(CompPath)"/>
  • devel/web/index.pas

    r1 r134  
    44
    55uses
    6   USqlDatabase, SysUtils, PwuEnvVar, UMainPage,
    7  {$ifdef STATIC}
    8   pwumain;
    9  {$else}
    10   dynpwu;
    11  {$endif}
    12 
    13 type
    14   TArrayOfString = array of string;
    15 
    16  
    17 var
    18   Database: TSqlDatabase;
    19 
    20 function ShowHeader(Title, Path: string): string;
    21 var
    22   Charset: string;
    23   Navigace: string;
    24 begin
    25   Charset := 'iso-8859-2'; // 'windows-1250';
    26   Navigace := CgiEnvVar.RequestURI;
    27   Result := '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'+
    28     '<html><head>'+
    29     '  <meta http-equiv="Content-Language" content="cs">'+
    30     '  <meta http-equiv="Content-Type" content="text/html; charset='+Charset+'">'+
    31     '  <title>Centrála - '+Path+'</title>'+
    32     '  </head><body style="font-family: sans-serif;">'+
    33     '<div style="padding: 3px; font-size: 20px; border-style: solid; border-color: blue; border-width: 1; background-color: #F0F0FF; margin-bottom: 4px;">'+Title+'</div>'+
    34     '<div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;"><strong>Navigace &gt;&gt;</strong> '+Navigace+'</div>';
    35 end;
    36    
    37 function ShowFooter: string;
    38 var
    39   UpdateDate: string;
    40   GenerateTime: string;
    41 begin
    42   UpdateDate := '2.5.2007';
    43   GenerateTime := '1 s';
    44   Result := '<div style="border-style: solid; border-top-color: gray; border-width: 1 0 0 0; margin-top: 7px; padding-top: 2px;" align="center">'+
    45 '  <i style="font-size: 10;">| Web mistr: Jiøí Hajda | e-mail: robie@centrum.cz | ICQ: 277158770 | Vygenerováno za '+GenerateTime+' s | Verze: 1.0 | Naposledy aktualizováno: '+UpdateDate+' |</i>'+
    46 '  </div>';
    47   //ShowArray($GLOBALS);
    48   Result := Result + '</body></html>';
    49 end;
    50 
    51 function Explode(Separator: Char; Data: string): TArrayOfString;
    52 begin
    53   SetLength(Result,0);
    54   while Pos(Separator,Data)>0 do begin
    55     SetLength(Result, Length(Result)+1);
    56     Result[High(Result)]:= Copy(Data,1,Pos(Separator,Data)-1);
    57     Delete(Data,1,Pos(Separator,Data));
    58   end;
    59   SetLength(Result, Length(Result)+1);
    60   Result[High(Result)]:= Data;
    61 end;
    62 
    63 function HumanDate(Date: string): string;
    64 var
    65   Parts: TArrayOfString;
    66   Parts2: TArrayOfString;
    67 begin
    68   Parts := Explode(' ', Date);
    69 //  Result := Date;
    70   Parts2 := Explode('-', Parts[0]);
    71   if Date <> '0000-00-00' then Result := IntToStr(StrToInt(Parts2[2])*1) + '.' + IntToStr(StrToInt(Parts2[1])*1) + '.' + Parts2[0]
    72     else Result := '&nbsp;';
    73 end;
    74 
    75 function ShowNews(Category: Integer): string;
    76 var
    77   DbRows: TDbRows;
    78   Index: Integer;
    79   FontSize: Integer;
    80   I: Integer;
    81   II: Integer;
    82   Enclosures: TArrayOfString;
    83 const
    84   NewsCountPerCategory = 3;
    85   UploadedFilesFolder = 'aktuality/uploads/'; 
    86 begin
    87 //  global $NewsCategoryNames, $NewsCountPerCategory, $UploadedFilesFolder;
    88 
    89   DbRows := Database.Select('news_category', '*', 'id=' + IntToStr(Category));
    90 
    91   Result := '<table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-size: small; padding-bottom: 5px;"><tr>'+
    92     '<td width="40%">' + DbRows[0].Values['caption'] + '</td><td width="80%" align="right">'+
    93     '<a href="aktuality/index.php?category=' + IntToStr(Category) + '">Zobrazit v¹echny aktuality</a>&nbsp;';
    94   if StrToInt(DbRows[0].Values['permission']) = 1 then Result := Result + '<a href="aktuality/index.php?action=add&amp;category=' + IntToStr(Category) + '">Pøidat aktualitu</a>&nbsp;';
    95   Result := Result + '</td></tr><tr><td colspan="2">'+
    96     '<table cellspacing="0" width="100%" style="padding: 2px 2px 2px 2px; font-size: small; border-style: solid; border-color: red; border-width: 1; background-color: #FFF0F0;">';
    97   Index := 0;
    98   FontSize := 12;
    99   DbRows := Database.Select('news', '*', 'category=' + IntToStr(Category) + ' ORDER BY date DESC LIMIT 0,' + IntToStr(NewsCountPerCategory));
    100   for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
    101     Result := Result + '<tr><td onmouseover="zobraz(''."''new".$Category.$Index."''".'')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%">'+
    102       '<tr><td style="font-size: ' + IntToStr(FontSize) + 'pt"><strong>' + Values['title'] + '</strong></td>'+
    103       '<td align="right" style="font-size: ' + IntToStr(FontSize) + 'pt">' + Values['author'] + ' (' + HumanDate(Values['date']) + ')</td></tr></table>'+
    104       '<div id="new' + IntToStr(Category) + IntToStr(Index) + '" class="skryty" style="display: none; border-width: 1; border-style: solid; border-color: blue; padding: 3px; font-size: 9pt;">' + Values['content'];
    105 
    106     if Values['enclosure'] <> '' then begin
    107       Result := Result + '<br>Pøílohy: ';
    108       Enclosures := Explode(';', Values['enclosure']);
    109             for II := 0 to High(Enclosures) do begin
    110               // if(file_exists($UploadedFilesFolder.$Enclosure)) echo(' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>')
    111       end;
    112     end;
    113     Result := Result + '</div></td></tr>';
    114     Index := Index + 1;   
    115     FontSize := FontSize - 2;
    116   end;
    117   Result := Result + '</table></td></tr></table>';
    118 end;
     6  UCore, USqlDatabase, SysUtils, UMainPage, pwinit, pwmain,
     7  UFinancePage;
    1198
    1209var
    12110  Output: string;
    122   DbRows: TDbRows;
    12311  I: Integer;
     12  PageName: string;
    12413begin
    125   Database := TSqlDatabase.Create;
    126   with Database do begin
    127     Hostname := 'localhost';
    128     Database := 'is';
    129     UserName := 'root';
    130     Password := '6yeyEtiAcr';
    131     Connect;
    132   end;
    133   DbRows := Database.Query('SET CHARACTER SET latin2');
    134   DbRows.Free;
    135   Output := ShowHeader('Vítejte na <strong>Centrále!</strong> - serveru komunitní poèítaèové sítì <strong>ZdechovNET</strong>','Rozcestník');
    136   Output := Output + '<script type="text/javascript">'+
    137     '<!--'+
    138     'function openClient(client_type)'+
    139     '{'+
    140     'if(client_type=="java")clientWindow = window.open("http://go.icq.com/icq2go/web.html","ICQ2Go","left=20,top=20,width=156,height=446,toolbar=0,resizable=0");'+
    141     'else clientWindow = window.open("http://go.icq.com/icq2go/flicq.html","ICQ2Go","left=20,top=20,width=176,height=441,toolbar=0,resizable=0");'+
    142     '}'+
    143 
    144 'var predchozi = ''first'';'+
    145 ''+
    146 'function zobraz(idecko)'+
    147 '{'+
    148 '  skryj(predchozi);'+
    149   'el=document.getElementById(idecko).style;'+
    150   '  el.display=''block'';'+
    151   'predchozi = idecko;'+
    152   '}'+
    153 ''+
    154 'function skryj(idecko)'+
    155 '{'+
    156   'if(idecko != ''first'')'+
    157   '{'+
    158   '  el=document.getElementById(idecko).style;'+
    159   '  el.display=''none'';'+
    160   '}'+
    161 '}'+
    162 '//-->'+
    163 '</script>'+
    164 ''+
    165 '<table width="100%"><tr><td valign="top">'+
    166 '<table width="100%">'+
    167 '<tr><td width="20%" valign="top">'+
    168 '<strong>Dùle¾ité odkazy:</strong><br>'+
    169 '<img alt="" src="images/favicons/money.gif" width="16" height="16"> <a href="/finance/">Finance</a><br>'+
    170 '<img alt="" src="images/favicons/chart.gif" width="16" height="16"> <a href="/statistic/trafficview2.php">Statistika</a><br>'+
    171 '<img alt="" src="images/favicons/prohledavac_sdileni.gif" width="15" height="15"> <a href="/share">Prohledat sdílení</a><br>'+
    172 '<img alt="" src="images/favicons/comp.gif" width="16" height="16"> <a href="/userlist.php">Seznam u¾ivatelù</a><br>'+
    173 '<img alt="" src="images/favicons/comp.gif" width="16" height="16"> <a href="/hostlist.php">Seznam poèítaèù</a><br>'+
    174 '<img alt="" src="images/favicons/sunrisechat.gif" width="16" height="16"> <a href="/sunrisechat/history.php">Historie SunriseChatu</a><br>'+
    175 '<img alt="" src="images/favicons/sunrisechat.gif" width="16" height="16"> <a href="/sunrisechat/webchat.php">Webový SunriseChatu</a><br>'+
    176 '<img alt="" src="images/favicons/discus.gif" width="16" height="16"> <a href="/forum">Diskusní fórum</a><br>'+
    177 '<img alt="" src="images/favicons/openwebmail.gif" width="16" height="16"> <a href="https://centrala.zdechov.net/cgi-bin/openwebmail/openwebmail.pl">WebMail</a><br>'+
    178 '<img alt="" src="images/favicons/apple.gif" width="16" height="16"> <a href="/jidelna">Jídelníèek</a><br>'+
    179 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="http://tv.zdechov.net/">Televize</a><br>'+
    180 '<img alt="" src="images/favicons/cube.gif" width="16" height="16"> <a href="http://game-server.zdechov.net/">Herní server</a><br>'+
    181 '<img alt="" src="images/favicons/cfix.gif" width="16" height="16"> <a href="/farnost">Rozpis m¹í</a><br>'+
    182 '<img alt="" src="images/favicons/tel.gif" width="16" height="16"> <a href="/telseznam.php">Telefonní seznam</a><br>'+
    183 '<img alt="" src="images/favicons/pripoj.gif" width="16" height="16"> <a href="/nabidky_pripojeni.php">Nabídky pøipojení</a><br>'+
    184 '<img alt="" src="images/favicons/zapisy.gif" width="16" height="16"> <a href="/docs/zapisy/zapisy.php">Zápisy ze schùzí</a><br>'+
    185 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="/mapy/mapa.php">Mapa Zdìchova</a><br>'+
    186 '<img alt="" src="images/favicons/otv_doby.gif" width="16" height="16"> <a href="/otevreno.php">Otvírací doby</a><br>'+
    187 '<img alt="" src="images/favicons/topologie.gif" width="16" height="16"> <a href="/is/topologie.php">Topologie sítì</a><br>'+
    188 '<img alt="" src="images/favicons/satellite.gif" width="16" height="16"> <a href="/is/dostupnost.php">Dostupnost sítì</a><br>'+
    189 '<img alt="" src="images/favicons/tech.gif" width="16" height="16"> <a href="/network.php">Technické informace</a><br>'+
    190 '<img alt="" src="images/favicons/socer.gif" width="16" height="16"> <a href="http://fotbal.zdechov.net/">Fotbal Sokol Zdìchov</a><br>'+
    191 '<br>'+
    192 '<strong>Dal¹í odkazy:</strong><br>'+
    193 '<img alt="" src="images/favicons/tv.gif" width="16" height="16"> <a href="/tkr.php">Kanály kabelovky</a><br>'+
    194 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="/mapy/mapa_nabidka.php">Nabídka mapy</a><br>'+
    195 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="/history.php">Historie sítì</a><br>'+
    196 '<img alt="" src="images/favicons/electric.gif" width="16" height="16"> <a href="/merak.php">Mìøiè spotøeby</a><br>'+
    197 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="/sluzby.php">Seznam slu¾eb</a><br>'+
    198 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="/ukoly.php">Plány do budoucna</a><br>'+
    199 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="/navody.php">Návody</a><br>'+
    200 '<img alt="" src="images/favicons/info.gif" width="16" height="16"> <a href="/infokanal/index.htm">Infokanál</a><br>'+
    201 '<img alt="" src="images/favicons/progman.gif" width="16" height="16"> <a href="/manualy.php">Programátorské manuály</a><br>'+
    202 '<br>'+
    203 '</td><td width="13%" valign="top">'+
    204 '<strong>Vyhledávání:</strong><br>'+
    205 '<img alt="" src="images/favicons/www_google_com.gif" width="16" height="16"> <a href="http://www.google.cz/">Google</a><br>'+
    206 '<img alt="" src="images/favicons/morfeo.png" width="16" height="16"> <a href="http://morfeo.centrum.cz">Morfeo</a><br>'+
    207 '<img alt="" src="images/favicons/www_centrum_cz.gif" width="16" height="16"> <a href="http://www.centrum.cz">Centrum</a><br>'+
    208 '<img alt="" src="images/favicons/www_seznam_cz.gif" width="16" height="16"> <a href="http://www.seznam.cz">Seznam</a><br>'+
    209 '<img alt="" src="images/favicons/www_atlas_cz.gif" width="16" height="16"> <a href="http://www.atlas.cz">Atlas</a><br>'+
    210 '<img alt="" src="images/favicons/www_tiscali_cz.gif" width="16" height="16"> <a href="http://www.tiscali.cz">Tiscali</a><br>'+
    211 '<br>'+
    212 '<strong>U¾iteèné:</strong><br>'+
    213 '<img alt="" src="images/favicons/clear.gif" width="16" height="16"> <a href="http://www.zdechov.net">Stránky na¹í sítì</a><br>'+
    214 '<img alt="" src="images/favicons/www_tvinfo_cz.gif" width="16" height="16"> <a href="http://www.tvinfo.cz/live/televize/cz">Online TV</a><br>'+
    215 '<img alt="" src="images/favicons/www_idos_cz.gif" width="16" height="16"> <a href="http://www.idos.cz/ConnForm.asp?tt=c">Jízdní øády</a><br>'+
    216 '<img alt="" src="images/favicons/www_atlas_cz.gif" width="16" height="16"> <a href="http://tv.atlas.cz">TV programy</a><br>'+
    217 '<img alt="" src="images/favicons/www_icq_com.gif" width="16" height="16"> Web ICQ <a href="javascript:openClient(''flash'')">Flash</a>&nbsp;<a href="javascript:openClient(''java'')">Java</a><br>'+
    218 '<img alt="" src="images/favicons/www_centrum_cz.gif" width="16" height="16"> <a href="http://slovniky.centrum.cz">Slovníky</a><br>'+
    219 '<img alt="" src="images/favicons/pocasi.gif" width="16" height="16"> <a href="http://www.meteopress.cz/">Poèasí</a><br>'+
    220 '<img alt="" src="images/favicons/www_tzones_cz.gif" width="16" height="16"> <a href="http://www.tzones.cz/">T-Mobile SMS</a><br>'+
    221 '<img alt="" src="images/favicons/www_mvk_cz.png" width="16" height="16"> <a href="http://www.mvk.cz/">Knihovna&nbsp;Vsetín</a><br>'+
    222 '<br>'+
    223 '<strong>Prodej poèítaèù:</strong><br>'+
    224 '<img alt="" src="images/favicons/www_computershop_cz.png" width="16" height="16"> <a href="http://shop.computershop.cz/eshop/">SOFTCOM</a><br>'+
    225 '<img alt="" src="images/favicons/www_alfacomp_cz.gif" width="16" height="16"> <a href="http://www.alfacomp.cz/php/zbozi.php?akc=2">Alfacomp</a><br>'+
    226 '<img alt="" src="images/favicons/www_petracomp_cz.png" width="16" height="16"> <a href="http://www.petracomp.cz/">Petracomp</a><br>'+
    227 '<img alt="" src="images/favicons/www_tsbohemia_cz.png" width="16" height="16"> <a href="http://interlink.tsbohemia.cz/">TS Bohemia</a><br>'+
    228 '<br>'+
    229 '</td>'+
    230 '<td width="15%" valign="top">';
    231   // Zobrazení seznamu online poèítaèù
    232   Output := Output + '<strong>Online poèítaèe:</strong><br><span style="font-size: smaller;">';
    233   DbRows := Database.Select('hosts', 'name', 'online=1 AND show_online=1 ORDER BY name');
    234   for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
    235     Output := Output + Values['name'] + '<br>';
    236   end;
    237   DbRows.Free;
    238   Output := Output + '</span><br>';
    239 
    240   // Zobrazení seznamu dlu¾níkù
    241   Output := Output + '<strong>Dlu¾níci:</strong><br><span style="font-size: smaller;">';
    242   DbRows := Database.Select('users', 'fullname', 'cash<0 ORDER BY cash');
    243   for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
    244     Output := Output + Values['fullname'] + '<br>';
    245   end;
    246   DbRows.Free;
    247   Output := Output + '</span>';
    248   Output := Output + '</td></tr></table>';
    249 
    250  (*
    251   // Zobrazení èasu bìhu poèítaèe
    252   Data = explode(' ', exec('uptime'));
    253   Data = array_slice($Data,3,-8);
    254   Uptime = '';
    255   foreach($Data as $Item)
    256   {
    257     if(strpos($Item,':')) $Uptime .= substr($Item,0,-1).' hodin';
    258     else $Uptime .= $Item.' ';
    259   }
    260   $Uptime = str_replace('2 days,','2 dny a',$Uptime);
    261  $Uptime = str_replace('3 days,','3 dny a',$Uptime);
    262 $Uptime = str_replace('4 days,','4 dny a',$Uptime);
    263 $Uptime = str_replace('days,','dní a',$Uptime);
    264 $Uptime = str_replace('day,','den a',$Uptime);
    265 $Uptime = str_replace('min,','minut',$Uptime);
    266 echo('Server bì¾í '.$Uptime);
    267 *)
    268   Output := Output + '</td><td width="50%" valign="top" style="font-size: smaller;">';
    269  
    270 (* 
    271 $File = fopen('/tmp/temperature2','r');
    272 $Teplota = fgets($File);
    273 $Teplota = round($Teplota*10)/10;
    274 fclose($File);
    275 
    276   Output := Output + '<table width="100%"><tr><td><strong>Aktuálnì:</strong></td><td align="right">'+
    277     '<img alt="Teplomer" width="10" height="18" src="images/teplomer3.png"><a href="statistic/trafficview2.php?type=temp">' + Teplota + '°C (mimo provoz)</a></td></tr></table>';
    278 *)
    279 
    280   Output := Output + '<div onmouseout="skryj(predchozi)">'+ ShowNews(5) + ShowNews(3) + ShowNews(1) + ShowNews(2) + ShowNews(4) + ShowNews(6) + ShowNews(8) + ShowNews(9) + ShowNews(10);
    281 
    282   Output := Output + '<a href="aktuality/subscription.php"><img style="margin: 0px 0px 0px 0px;" border="0" src="images/rss20.png" alt="Aktuality pøes RSS"></a>  <a href="aktuality/subscription.php">Automatické sledování novinek</a>'+
    283   '</div></td></tr></table>';
    284   Output := Output + ShowFooter;
     14  SetHeader('Content-Type', 'text/html; charset=utf-8');
     15  PageName := GetCgiVar('p');
     16  if PageName = '' then PageName := 'finance-clenove';
     17  I := 0;
     18  while (I < Length(Pages)) and (Pages[I].Name <> PageName) do Inc(I);
     19  if I < Length(Pages) then Output := Pages[I].Producer
     20    else Output := 'Stránka nenalezena';
    28521  WebWriteLn(Output);
    286   Database.Free;
    28722end.
    288 
Note: See TracChangeset for help on using the changeset viewer.