View file apanel/pages/default.php

File size: 3.69Kb
<?php
/**********************************************/
/* Автор скрипта: Александр Есин              */
/* E-Mail: [email protected] ([email protected]) */
/* ICQ: 6464729                               */
/* Site: http://ticlove.ru                    */
/**********************************************/
?>
<?php if (!defined('SECURED')) die("SORRY! Unknown Error!"); ?>
<?php
if (!isset($_SESSION['page_users'])) $_SESSION['page_users'] = 40;
if (isset($_POST['act_users']))
{
     $page_users = intval($_POST['page_users']);
     if ($page_users < 5 or $page_users > 50) $page_users = 40;
     $_SESSION['page_users'] = $page_users;
}
?>
<h3>Пользователи</h3>
<?php
$col = $_SESSION['page_users'];
if (isset($_GET['start'])) $start = abs(intval($_GET['start']));
else $start = 0;
$count_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `q_users`;"), 0);
if ($count_p > 0) {
if ($start >= $count_p) $start = 0;
$q = mysql_query("SELECT * FROM `q_users` ORDER BY `id_user` DESC LIMIT ".$start.", ".$col);
?>
<div style="padding: 5px 0;">
Для удаления анкет пометьте их галочкой и нажмите кнопку "Удалить"
</div>
<div style="padding: 5px 0;">
Всего анкет: <strong><?php echo $count_p; ?></strong>
</div>
<div style="padding: 10px 0;">
<form action="/apanel/apanel.php" method="post">
<input type="hidden" name="act_users" value="1" />
Сколько анкет выводить на странице:
<select class="select" name="page_users">
<?php for ($i = 0; $i < 10; $i++) {
$arr = array('5', '10', '15', '20', '25', '30', '35', '40', '45', '50');
echo '<option value="'.$arr[$i].'" '.($_SESSION['page_users'] == $arr[$i] ? 'selected="selected"' : '').'>'.$arr[$i].'</option>';
}
?>
</select>
<input class="submit_green" type="submit" value="Применить" />
</form>
</div>
<form action="apanel.php?page=delete_users" method="post">
<table width="100%" cellspacing="1" cellpadding="0">
<tr>
<td class="td_users"></td>
<td class="td_users">ID</td>
<td class="td_users">Логин</td>
<td class="td_users">Имя</td>
<td class="td_users">Пол</td>
<td class="td_users">Фото</td>
<td class="td_users">Возраст</td>
<td class="td_users">Дата регистрации</td>
</tr>
<?php $i = 1; ?>
<?php while ($array = mysql_fetch_array($q)) { ?>
<?php
if ($i == 1) $bg_td = 'td_users_cont_w';
else { $bg_td = 'td_users_cont_t'; $i = 0; }
?>
<tr>
<td class="<?php echo $bg_td; ?>"><input type="checkbox" name="sel[]" value="<?php echo $array['id_user']; ?>" /></td>
<td class="<?php echo $bg_td; ?>"><?php echo $array['id_user']; ?></td>
<td class="<?php echo $bg_td; ?>"><a href="../user.php?id=<?php echo $array['id_user']; ?>" target="_blank"><?php echo htmlspecialchars($array['login'], ENT_QUOTES); ?></a></td>
<td class="<?php echo $bg_td; ?>"><?php echo htmlspecialchars($array['name'], ENT_QUOTES); ?></td>
<td class="<?php echo $bg_td; ?>"><?php echo ($array['pol'] == 1 ? 'муж' : 'жен'); ?></td>
<td class="<?php echo $bg_td; ?>"><?php echo $array['photo']; ?></td>
<td class="<?php echo $bg_td; ?>"><?php echo function_vozrast_n($array['god'].'-'.$array['mes'].'-'.$array['day']); ?></td>
<td class="<?php echo $bg_td; ?>"><?php echo function_vizit($array['reg_date']); ?></td>
</tr>
<?php $i++; ?>
<?php } ?>
</table>
<?php function_page($_SERVER['PHP_SELF'].'?', $col, $start, $count_p); ?>
<div style="padding-top: 10px;">
<input class="submit_red" type="submit" value="Удалить отмеченные" />
</div>
</form>
<?php } else { ?>
<div style="padding-top: 10px; font-size: 16px; text-align : center;">Записей нет</div>
<?php } ?>