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

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

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

<div id="del_Currency_{$id}">
	<table width="100%" border="0">
		<tr height="30px" onmouseover="this.bgColor='#F1F7FE'" onmouseout="this.bgColor='#FFFFFF'">
			<td width="70px" align="center" id="StatusIDCurrency_{$id}">{$id}</td>
			<td><a href="javascript:void(0);" onclick="EditCurrency( '{$id}' ); return false;">{$name}</a></td>
			<td width="100px" align="center">{$symbol}</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, MenuCurrency( '{$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="CheckCurrency[]" 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="currency" method="post" action="" onsubmit="SetFormSubmit( 'currency' ); 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="100px" align="center">Действие</td>
			<td width="30px">
				<input type="checkbox" name="ChecboxAll" onclick="CheckboxAllSelect( 'currency' );" />
			</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="AddCurrency(); return false;" />
				</td>
				<td align="right">
					<span id="status_currency"></span>
					<select name="action" id="action_currency">
						<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="currency" />
				</td>
			</tr>
		</table>
	</div>
</form>

HTML;

opentable();
tableheader( "Список валют" );
echo $list;
closetable();

?>