%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/www.varak.net/includes/
Upload File :
Create Path :
Current File : /www/varak.net/www.varak.net/includes/foto_display.php

<?php

    $txt = "";

    if(isset($_GET['pg']) && $_GET['pg'] > 0)

    {

        $kolik = $_GET['pg']*20;

        $pg = $_GET['pg'];

    }

    else

    {

        $kolik = 20;

        $pg = 1;

    }

    $spojeni = mysql_connect($sql, $usr, $pwd);

    mysql_select_db($db, $spojeni);
    mysql_query("SET NAMES 'latin2'");

    $result = mysql_query("select nazev, sekce, kolik from waritko_sekce where id='".$_GET['sekce']."'", $spojeni);

    while($r = mysql_fetch_row($result))

    {

        $txt .= "<h2>".$r[0]."</h2>\n";

        $slozka = "./foto/".$r[1]."/";

        $pages = ceil($r[2]/20);

        if($kolik > $r[2])

        {

            $kolik = $r[2];

        }

        if($pg > $pages)

        {

            $pg = $pages;

        }

        $txt .= "<ul>\n";

        for($i = 1; $i <= $pages; $i++)

        {

            $txt .= "\t<li><a href=\"index.php?fil=foto_display&amp;sekce=".$_GET['sekce']."&amp;pg=$i\">Strana $i</a></li>\n";

        }

        $txt .= "</ul>\n";

        

    }

    $txt .= '<table width="100%" align="center" border="0">';

    for($i = ($pg-1)*20+1; $i <= $kolik; $i++)

    {

        $cislo = sprintf("%'02d", $i);

        $txt .= "<tr>

        <td width=\"2%\">&nbsp;</td>

        <td width=\"45%\"><a href=\"".$slozka.$cislo.".jpg\" target=\"_blank\"><img src=\"".$slozka.$cislo."t.jpg\" alt=\"\" class=\"foto\"></a></td>

        <td width=\"6%\">&nbsp;</td>";

        if($i <= $kolik)

        {

            $i++;

            $cislo = sprintf("%'02d", $i);

            $txt .= "        <td width=\"45%\"><a href=\"".$slozka.$cislo.".jpg\" target=\"_blank\"><img src=\"".$slozka.$cislo."t.jpg\" alt=\"\" class=\"foto\"></a></td>

        <td width=\"2%\">&nbsp;</td>";

        }

        $txt .= "</tr>";

    }

    $txt .= "</table>";

    mysql_close($spojeni);

    $smarty->assign('text', $txt);

?>


Zerion Mini Shell 1.0