Файл: modules/share/edit_folder.php
Строк: 48
<?php
$locate = 'in_share';
if($user['level'] < '6' || !isset($_GET['cat_id'])) { go('/'); }
if($db->query("SELECT * FROM `share_c` WHERE `id` = '". abs(intval($_GET['cat_id'])) ."'")->rowCount() == 0) {
go('/share/');
}
$edit_folder = $db->query("SELECT * FROM `share_c` WHERE `id` = '". abs(intval($_GET['cat_id'])) ."'")->fetch();
if(isset($_POST['edit']) && $_GET['act'] == 'edit') {
$name = substr(input($_POST['name']), 0, 90);
$desc = substr(input($_POST['desc']), 0, 160);
$who_upload = substr(abs(intval($_POST['who_upload'])), 0, 1);
$db->query("UPDATE `share_c` SET `name` = '". $name ."', `who_upload` = '$who_upload', `desc` = '$desc' WHERE `id` = '". abs(intval($_GET['cat_id'])) ."'");
go('/share/folder/'. abs(intval($_GET['cat_id'])) .'/');
// print_r($db->errorInfo());
}
$title = $lang->word('edit');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('edit'));
echo '<form action="/share/edit_folder/'. abs(intval($_GET['cat_id'])) .'/?act=edit" method="post">
<div class="menu">
<b>'. $lang->word('form_album_name') .'</b>:<br/>
<input typr="text" name="name" value="'. $edit_folder['name'] .'" /><br/>
<b>'. $lang->word('desc') .'</b>:<br/>
<input typr="text" name="desc" value="'. $edit_folder['desc'] .'" /><br/>
<b>'.$lang->word('who_upload').'</b>:<br/>
<select name="who_upload">
<option value="1" '.($edit_folder['who_upload'] == 1 ? 'selected="selected"' : NULL).'>'.$lang->word('administration').'</option>
<option value="2" '.($edit_folder['who_upload'] == 2 ? 'selected="selected"' : NULL).'>'.$lang->word('alls').'</option>
</select><br/>
<input name="edit" type="submit" value="'. $lang->word('edit') .'" /><br/>
</div>
</form>';
$tpl->div('block', img('share.png') .'<a href="/share/">'. $lang->word('share') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>