function editpost() {
global $db;
$lid = (isset($_POST['id'])) ? ((isset($_POST['id'])) ? intval($_POST['id']) : "") : ((isset($_GET['id'])) ? intval($_GET['id']) : "");
$obj = "for".$lid."";
$go = 3;
$op = "editpost";
$result = $db->sql_query("SELECT lid, shortdescription from asershop_products where lid=$lid");
list($lid, $text) = $db->sql_fetchrow($result);
$text = mb_convert_encoding($text, "utf-8", "windows-1251");
$code = "<form id=\"form".$obj."\" method=\"post\" action=\"ajax.php\">"
."<input type=\"hidden\" name=\"method\" value=\"POST\">"
."<input type=\"hidden\" id=\"go\" name=\"go\" value=\"".$go."\">"
."<input type=\"hidden\" id=\"op\" name=\"op\" value=\"editpost\">"
."<input type=\"hidden\" id=\"id\" name=\"id\" value=\"".$lid."\">"
."<textarea id=\"text\" name=\"text\" cols=\"65\" rows=\"20\">".$text."</textarea>"
."<div style=\"clear: both;\"><input type=\"submit\" value=\"".mb_convert_encoding(Применить, "utf-8", "windows-1251")."\" OnClick=\"LoadPost('1', '".$obj."'); return false;\" OnDblClick=\"LoadPost('1', '".$obj."'); return false;\" title=\"".mb_convert_encoding(Применить, "utf-8", "windows-1251")."\" class=\"ebutton\"></form>"
."<input type=\"submit\" value=\"".mb_convert_encoding(Отмена, "utf-8", "windows-1251")."\" OnClick=\"LoadGet('1', '".$obj."', '".$go."', 'showpost', '".$lid."', '".$typ."', '".$mod."', ''); return false;\" OnDblClick=\"LoadGet('1', '".$obj."', '".$go."', 'showpost', '".$lid."', '".$typ."', '".$mod."', ''); return false;\" title=\"".mb_convert_encoding(Отмена, "utf-8", "windows-1251")."\" class=\"bbutton\"></div>";
echo $code;
$db->sql_query("UPDATE asershop_products SET shortdescription='$text' WHERE lid='$lid'");
}