<?php
/*
=====================================================
 Модуль создал: REZER (http://rezer.net)
=====================================================
 Файл: board_type.php
=====================================================
 Данный код защищен авторскими правами
=====================================================
 Назначение: Вывод всех типов объявлений
=====================================================
*/

if( !defined( "DATALIFEENGINE" ) ) die( "Hacking attempt!" );

$list = "";	
if( count( $Board->DB['board_type'] ) > 0 )
	{
		$list .= showStart();
		foreach( $Board->DB['board_type'] as $key => $row )
			{
				$id = $row['id'];
				$name = stripslashes( $row['name'] );
				$sort = intval( $row['sort'] );
				
$list .= <<<HTML

<div id="del_BoardType_{$id}">
	<table width="100%" border="0">
		<tr height="30px" onmouseover="this.bgColor='#F1F7FE'" onmouseout="this.bgColor='#FFFFFF'">
			<td width="70px" align="center" id="StatusIDBoardType_{$id}">{$id}</td>
			<td><a href="javascript:void(0);" onclick="EditBoardType( '{$id}' ); return false;">{$name}</a></td>
			<td width="100px" align="center">
				<input type="text" name="sort[{$id}]" value="{$sort}" style="text-align: center; width: 50px;" class="edit" />
			</td>
			<td width="100px" align="center">
				<a onclick="return dropdownmenu( this, event, MenuBoardType( '{$id}' ), '120px')" href="javascript:void(0);">
					<img src="engine/skins/images/browser_action.gif" border="0">
				</a>
			</td>
			<td width="30px">
				<input type="checkbox" name="CheckBoardType[]" value="{$id}" />
			</td>
		</tr>
		<tr>
			<td colspan="10" background="engine/skins/images/mline.gif" height="1"></td>
		</tr>
	</table>
</div>

HTML;

			}
	}
		else
	{
		$list = showStart()."<div style=\"padding: 15px; text-align: center;\">Типов не обнаружено</div>".showStart();
	}

$list = <<<HTML

<form name="board_type" method="post" action="" onsubmit="SetFormSubmit( 'board_type' ); return false;">
	<table width="100%" border="0" style="margin: 2px 0px 2px 0px;">
		<tr>
			<td width="70px" align="center">ID</td>
			<td>Название типа</td>
			<td width="100px" align="center">Сортировка</td>
			<td width="100px" align="center">Действие</td>
			<td width="30px">
				<input type="checkbox" name="ChecboxAll" onclick="CheckboxAllSelect( 'board_type' );" />
			</td>
		</tr>
	</table>
	<div class="hr_line"></div>
	{$list}
	<div class="hr_line"></div>
	<div style="padding: 5px;">
		<table width="100%" border="0">
			<tr>
				<td>
					<input type="button" value="Добавить тип предложения" class="edit" onclick="AddBoardType(); return false;" />
				</td>
				<td align="right">
					<span id="status_board_type"></span>
					<select name="action" id="action_board_type">
						<option value=""> - Выберите действие - </option>
						<option value="sort">Отсортировать</option>
						<option value="del">Удалить</option>
					</select>
					<input type="submit" name="submit" value="Сохранить" class="edit" />
					<input type="hidden" name="TypeAction" value="board_type" />
				</td>
			</tr>
		</table>
	</div>
</form>

HTML;

opentable();
tableheader( "Список типов предложений" );
echo $list;
closetable();

?>