Файл: viewpolls.php
Строк: 48
<?php
require('sistema/header.php');
require('sistema/utilition.php');
require('sistema/databaza.php');
require('sistema/login.php');
require('sistema/config.php');
$max_pages = 5;
?>
<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="links" title="Менеджер файлов">
<do type="options" name="main" label="Меню"><go href="main.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>"/></do>
<p>
<?php
$links_list = '';
if(isset($_GET['from']))
$from = $_GET['from'];
else
$from = 0;
$links = mysql_query('SELECT count(*) FROM polls_questions WHERE user_id = "' . (int)($_GET['id']) . '"');
list($total_links) = mysql_fetch_array($links);
$total_pages = ceil($total_links / $max_pages);
$links = mysql_query('SELECT id, question FROM polls_questions WHERE user_id = "' . (int)($_GET['id']) . '" LIMIT ' . $from * $max_pages . ', ' . $max_pages);
if(($n = mysql_num_rows($links)) > 0)
{
while($link = mysql_fetch_array($links, MYSQL_ASSOC))
{
$links_list .= "<a href="editpolls.php?id=$id&p=$login&link_id=$link[id]">$link[question]</a>n<br/>n";
}
}
?>
Всего голосований:<?php echo $total_links; ?>
Стр. <?php if($total_pages != 0) echo $from+1; else echo '0'; ?> из <?php echo $total_pages; ?><br/>
<?php echo $links_list; ?>
<br/>
<?php
if(($from+1) != $total_pages && $total_pages != 0)
{
echo "<a href="viewpolls.php?id=$id&p=$login&from=" . ($from+1) . "">Далее</a>";
echo "<br/>";
}
if($from != 0)
{
echo "<a href="viewpolls.php?id=$id&p=$login&from=" . ($from-1) . "">Назад</a>";
echo "<br/>";
}
?>
<a href="addpolls.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>">Добавить</a>
<br/>
</p>
<p align="center">
*********<br/>
<a href="main.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>">Меню</a><br/>
</p>
</card>
</wml>