Файл: modules/obmen/inc/file_form.php
Строк: 174
<?php
/* DCMS Special
* Дата последнего редактирования 11.12.2015
* Модифицировал densnet
*/
if ((access('obmen_file_delete') || $user['id'] == $file_id['id_user']) && isset($_GET['act']) && $_GET['act'] == 'edit') {
echo '<div class="card">';
echo "<div class = 'card-header'>Параметры <a style = 'float:right;color: grey;' href = '?showinfo'><small>Закрыть</small></a></div>";
echo "<form method = 'post' class = 'card-block' action = '?showinfo&act=edit&ok'>";
echo "<b>Название</b><br />";
echo "<input class='form-control' type = 'text' name = 'name' value = '$file_id[name]' maxlength = '512' />";
echo "<b>Описание</b><br />";
echo "<textarea class='form-control' rows='3' name = 'opis'>$file_id[opis]</textarea>";
echo "Формат: <font color = 'green'>$file_id[ras]</font><br />";
echo "<button name = 'save' class = 'btn btn-success'><span class='fa fa-save'></span> Сохранить</button>";
echo "</form>";
echo "</div>";
}
if ((access('obmen_file_delete') || $user['id'] == $file_id['id_user']) && isset($_GET['act']) && $_GET['act'] == 'parol') {
echo '<div class="card">';
echo "<div class = 'card-header'>Новый пароль<a style = 'float:right;color: grey;' href = '?showinfo'><small>Закрыть</small></a></div>";
echo "<form method = 'post' class = 'card-block' action = '?showinfo&act=parol&ok'>";
echo "<b>Пароль</b><br />";
echo "<input class='form-control' type = 'text' name = 'parol' value = '$file_id[parol]' maxlength = '512' /><br />";
echo "<button name = 'save' class = 'btn btn-success'><span class='fa fa-save'></span> Сохранить</button>";
echo "</form>";
echo "</div>";
}
if (access('obmen_file_delete') && isset($_GET['act']) && $_GET['act'] == 'blokk') {
echo '<div class="card">';
echo "<div class = 'card-header'>Блокировка<a style = 'float:right;color: grey;' href = '?showinfo'><small>Закрыть</small></a></div>";
echo "<form method='post' class = 'card-block' action='?showinfo&act=blok&ok'>n";
echo "<b>Причина блокировки</b> <br />";
echo "<input class='form-control' type = 'text' name = 'blok' value = '' maxlength = '5102' /><br />n";
echo "<button name = 'save' class = 'btn btn-success'><span class='fa fa-save'></span> Сохранить</button>";
echo "</form>";
echo "</div>";
}
if (access('obmen_file_delete') && isset($_GET['act']) && $_GET['act'] == 'delete') {
echo '<div class="card">';
echo "<div class = 'card-header'>Удаление <a style = 'float:right;color: grey;' href = '?showinfo'><small>Закрыть</small></a></div>";
echo "<div class = 'card-block'>";
echo "Удалить файл " . toOutput($file_id['name']) . "?<br />";
echo "<a class = 'btn btn-success' href = '?showinfo&act=delete&ok' style = 'color:white;'>Да</a> ";
echo "<a class = 'btn btn-secondary' href = '?showinfo'>Нет</a>";
echo "</div>";
echo "</div>";
}
if (access('obmen_file_delete')) {
echo "<a href = '?showinfo&act=edit' class = 'list-group-item list-group-item-warning'><span class='fa fa-cog fa-fw'></span> Параметры</a>";
echo "<a href = '?showinfo&act=delete' class = 'list-group-item list-group-item-warning'><span class='fa fa-trash-o fa-fw'></span> Удалить</a>";
if ($file_id['parol'] != NULL && $file_id['blok'] == NULL) {
echo "<a href = '?showinfo&act=parol' class = 'list-group-item list-group-item-warning'><span class='fa fa-lock fa-fw'></span> Изменить пароль</a>";
echo "<a href = '?showinfo&act=paroll&ok' class = 'list-group-item list-group-item-warning'><span class='fa fa-lock fa-fw'></span> Удалить пароль</a>";
} else if ($file_id['blok'] == NULL) {
echo "<a href = '?showinfo&act=parol' class = 'list-group-item list-group-item-warning'><span class='fa fa-lock fa-fw'></span> Поставить пароль</a>";
}
if ($file_id['blok'] != NULL) {
echo "<a href = '?showinfo&act=blokk&ok' class = 'list-group-item list-group-item-warning'><span class='fa fa-ban fa-fw'></span> Разблокировать</a>";
} else {
echo "<a href = '?showinfo&act=blokk' class = 'list-group-item list-group-item-warning'><span class='fa fa-ban fa-fw'></span> Заблокировать</a>";
}
} elseif (isset($user) && $user['id'] == $file_id['id_user']) {
echo "<a href = '?showinfo&act=edit' class = 'list-group-item list-group-item-warning'><span class='fa fa-cog fa-fw'></span> Параметры</a>";
echo "<a href = '?showinfo&act=delete' class = 'list-group-item list-group-item-warning'><span class='fa fa-trash-o fa-fw'></span> Удалить</a>";
if ($file_id['parol'] != NULL && $file_id['blok'] == NULL) {
echo "<a href = '?showinfo&act=parol' class = 'list-group-item list-group-item-warning'> <span class='fa fa-lock fa-fw'></span> Изменить пароль</a>";
echo "<a href = '?showinfo&act=paroll&ok' class = 'list-group-item list-group-item-warning'><span class='fa fa-lock fa-fw'></span> Удалить пароль</a>";
} else if ($file_id['blok'] == NULL) {
echo "<a href = '?showinfo&act=parol' class = 'list-group-item list-group-item-warning'><span class='fa fa-lock fa-fw'></span> Поставить пароль</a>";
}
}
if (isset($user)) {
if (isset($_GET['idd']) && $user['id'] != @$_GET['id']) {
$q_user = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='" . mysql_real_escape_string($_GET['idd']) . "'"));
echo "<form class = 'list-group-item' method="post" name='message' action="?showinfo&mess&uidd=$q_user[id]">n";
} else {
echo "<form class = 'list-group-item' method="post" name='message' action="?showinfo&mess">n";
}
if (isset($_GET['idd']) && isset($user) && $user['id'] != @$_GET['id']) {
$q_user = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`='" . mysql_real_escape_string($_GET['idd']) . "'"));
echo "<b>Комментарий</b><br />";
echo "<textarea class='form-control' rows='3' name='msg'>$q_user[nick], </textarea><br />";
} else {
echo "<b>Комментарий</b><br />";
echo "<textarea class='form-control' rows='3' name='msg'></textarea><br />n";
}
echo "<button class='btn btn-success'>Добавить</button>";
echo "</form>n";
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_komm` WHERE `id_file` = '$file_id[id]'"), 0);
$k_page = k_page($k_post, 5);
$page = page($k_page);
$start = 5 * $page - 5;
if ($k_post == 0) {
echo "<div class='list-group-item'>";
echo "<span class='fa fa-info-circle fa-fw'></span> Нет результатов";
echo "</div>";
}
$q = mysql_query("SELECT * FROM `obmennik_komm` WHERE `id_file` = '$file_id[id]' ORDER BY `id` DESC LIMIT $start, 5");
while ($post = mysql_fetch_assoc($q)) {
$ank = get_user($post['id_user']);
echo "<table class='list-group-item'><tr><td class='icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div style = 'float:right;' id = 'hide'>";
if ($ank['id'] != $user['id']) {
echo "<a href = '?showinfo&mess&page=$page&idd=$post[id_user]' title = 'Ответить'><span class='fa fa-pencil'></span></a> ";
}
if (access('obmen_komm_del')) {
echo "<a href = '?showinfo&mess&page=$page&del_post=$post[id]' title = 'Удалить'><span class='fa fa-trash-o'></span></a>";
}
echo "</div>";
echo user($ank['id']);
echo " <small>" . date::times($post['time']) . "</small><br />";
echo toOutput($post['msg']) . "<br />n";
echo "</td></tr></table>";
}
if ($k_page > 1) {
str('?showinfo&', $k_page, $page);
} // Вывод страниц