@auto[]
$form_id[19]
$branch_id[]
@main[]
$SQL.connect-string[mysql://intranet:pwd@moko/intranet/cp1251_koi8]
^connect[$SQL.connect-string]{
^content[]
}
@heading[]
^if(def $form_id){Изменение}{Добавление} документа
@help[]
article_help.html
@content[]
$branches[^table:sql{select id, name from kb_branches}]
^if(def $form_id){
$article[^table:sql{select id, name, txt, keywords, kb_branches_id from kb_documents where id='$form_id'}]
$branch_id[$:article.kb_branches_id]
}{
$branch_id[$branch_id]
}
<form method=post action=article_save.html>
<p />Рубрика:<br>
<select name="kb_branches_id" style="width:100%">
$branches{
^menu{
<option value="$id" ^if($id eq $:branch_id){selected}>^if($id eq $:branch_id){•^;}{ ^;}$name</option>
}
}
</select>
<p />Название:<br>
<input type=text name=name style="width:100%" value="$:article.name">
<p />Текст:<br>
<textarea name=text style="width:100%" cols=80 rows=30>^untaint[html]{$:article.txt}</textarea>
<p />Ключевые слова:<br>
<input type=text name=keywords style="width:100%" value="$:article.keywords">
<input type=hidden name=id value="$form_id">
<p />
<table cellspacing=0 cellpadding=0 border=0 width=100%>
# <td>^submit[save]</td>
# ^if(def $form_id){<td align=right>^submit[delete]</td>}
</table>
</form>
E-mail: