<script language="JavaScript">
function check() {
if (form.nazv.value=="" || form.price.value=="" || isNaN(form.price.value) || form.cat.value=="cat") {
alert ("Заполните правильно обязательные поля!");
}
else {
form.submit();
}
}
</script>
<?php
include("FCKeditor/fckeditor.php") ;
include ("txt/header.php");
?> 
<table width="560" border="0" cellspacing="0" cellpadding="0">
<tr> 
<td height="22" class="menu">
<div align="center">
Пользовательская панель управления 
</div>
</td>
</tr>
<tr> 
<td align="center" valign="top" class="menu"><table width="560" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF"><table width="550" border="0" cellspacing="5" cellpadding="0">
<tr> 
<td>
<?php
include ("auth_user.php");
?>
<center>
<?php include ("txt/menu_cp.php"); ?>
<form enctype="multipart/form-data" action="action_sell.php" name=form method=post>
<table class="t">
<tr bgcolor=white>
<td>Название:</td><td><input type=text name='nazv' size=40 maxlength=50></td>
</tr>
<tr bgcolor=white>
<td>Тип товара:</td><td>
<select name=type>
<option value=one>Уникальный
<option value=mult>Несколько одинаковых
<option value=unlim>Неограниченное количество
</select>
</td>
</tr>
<tr bgcolor=white>
<td>Начальная стоимость:</td><td><input type=text name='price' size=5 maxlength=10></td>
</tr>
<tr bgcolor=white>
<td>Цена моментальной продажи:</td><td><input type=text name='mprice' size=5 maxlength=10></td>
</tr>
<tr bgcolor=white>
<td>Количество товара:</td><td><input type=text name='quantity' size=5 maxlength=10></td>
</tr>
<tr bgcolor=white>
<td>Продолжительность аукциона:</td><td>
<select name=srok>
<?php
for ($i=1;$i<=31;$i++) {
echo "<option value=$i>$i";
}
$query="select foto_size from settings where (first='1')";
$res_size=mysql_query($query);
$row=mysql_fetch_assoc($res_size);
$foto_size=$row["foto_size"];
?>
</select> дней
</td>
</tr>
<tr bgcolor=white>
<td>Фото товара:</td><td><input type=hidden name="MAX_FILE_SIZE" value="<?php echo $foto_size; ?>"><input name="userfile" type="file"></td>
</tr>
<tr bgcolor=white>
<td>Категория:</td><td>
<select name=cat>
<?php
$query="select * from categories";
$res=mysql_query($query);
while ($myrow=mysql_fetch_assoc($res)) {
$name_of_category=$myrow ["name"];
$name_of_category=stripslashes($name_of_category);
$id=$myrow ["first"];
$query="select * from subcategories where (parent='$id')";
$subres=mysql_query($query);
echo "<option value=cat>$name_of_category";
while ($submyrow=mysql_fetch_assoc($subres)) {
$name_of_subcategory=$submyrow ["name"];
$name_of_subcategory=stripslashes($name_of_subcategory);
$subid=$submyrow ["first"];
echo "<option value=$subid> - $name_of_subcategory";
}
}
?>
</select>
</td>
</tr>
<tr bgcolor=white>
<td>Описание:</td><td>
<?php
$os=getenv("HTTP_USER_AGENT");
if (!eregi("Opera",$os)) {
$oFCKeditor=new FCKeditor('descr') ;
$oFCKeditor->BasePath='FCKeditor/';
$oFCKeditor->ToolbarSet='sell' ;
$oFCKeditor->Value='';
$oFCKeditor->Width ='100%' ;
$oFCKeditor->Height='350' ;
$oFCKeditor->Create() ;
}
else {
echo "<textarea rows=6 cols=30 name=descr></textarea>";
}
?>

</td>
</tr>
<tr bgcolor=white><td colspan=2><center><input type=button value="Выставить" onClick="check()"></td></tr>
</table>
</form>
</td>
</tr>
</table></td>
</tr>
</table></td></tr></table>
<br>
</td>
</tr>
</table></td>
</tr>
<?php
include ("txt/footer.php");
?> 

