Файл: modules/domens/edit_file.php
Строк: 69
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.pp.ua *
**********************************/
$locate = 'in_share';
$edit_topic = $db->query("SELECT * FROM `share_files` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->fetch();
if($user['id'] == $edit_topic['user_id'] or $user['level'] > 4)
{
if (isset($user)) {
if(isset($_GET['id'])) {
if($db->query("SELECT * FROM `share_files` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->rowCount() == 0) {
go('/domens/');
}
if(isset($_POST['edit']) && $_GET['act'] == 'edit') {
$name = substr(input($_POST['name']), 0, 99);
$reg = substr(input($_POST['reg']), 0, 99);
$panel = substr(input($_POST['panel']), 0, 99);
$data = substr(input($_POST['data']), 0, 99);
$do = substr(input($_POST['do']), 0, 99);
$cena = substr(input($_POST['cena']), 0, 99);
$text = substr(input($_POST['text']), 0, 5000);
$db->query("UPDATE `share_files` SET `name` = '".$name."', `reg` = '".$reg."', `panel` = '".$panel."', `data` = '".$data."', `do` = '".$do."', `cena` = '".$cena."', `text` = '". $text ."' WHERE `id` = '". abs(intval($_GET['id'])) ."'");
go('/domens/file/'. abs(intval(abs(intval($_GET['id'])))));
// print_r($db->errorInfo());
}
$title = $lang->word('edit');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('edit'));
echo '<form action="/domens/edit_file/'. abs(intval($_GET['id'])) .'/?act=edit" method="post">
<div class="menu">
<b>'. $lang->word('name') .'</b>:<br/>
<input name="name" type="text" value="'. $edit_topic['name'] .'" /><br/>
<b>Регистратор</b>:<br/>
<input name="reg" type="text" value="'. $edit_topic['reg'] .'" /><br/>
<b>Панель</b>:<br/>
<input name="panel" type="text" value="'. $edit_topic['panel'] .'" /><br/>
<b>Дата регистрации</b>:<br/>
<input name="data" type="text" value="'. $edit_topic['data'] .'" /><br/>
<b>Оплачен до</b>:<br/>
<input name="do" type="text" value="'. $edit_topic['do'] .'" /><br/>
<b>Цена</b> (.руб):<br/>
<input name="cena" type="text" value="'. $edit_topic['cena'] .'" /><br/>
<b>'. $lang->word('about') .'</b>:<br/>
<textarea name="text" rows="5" cols="26">'. $edit_topic['text'] .'</textarea><br/>
<input name="edit" type="submit" value="'. $lang->word('edit') .'" /><br/>
</div>
</form>';
$tpl->div('block', NAV .'<a href="/domens/">'. $lang->word('share') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
} else { go('/'); }
} else { go('/'); }
} else {
header('location: /');
exit;
}
?>