<? include('checkcookie.php'); ?>
<h3>Биржа рефералов</h3>
<br>

<?
if(isset($_GET["unbron"]))
{
	$unbrid=intval($_GET["unbron"]);
	mysql_query("UPDATE b_jarmarka SET bron=0 WHERE rid='$unbrid'");
	mysql_query("DELETE FROM b_basket WHERE ident='$unbrid' and type='4'");
}
if(isset($_POST["del"]))
{
	$del=intval($_POST["del"]);
	mysql_query("DELETE FROM `b_jarmarka` WHERE rid='$del'");
}
$sql=mysql_query("SELECT * FROM b_jarmarka");
?>

Рефералы в продаже:<br>

<table class="adn">
<tr class="lineb">
	<td>№</td>
	<td>Логин</td>
	<td>ID продавца</td>
	<td>Выставлен(время)</td>
	<td>Стоимость</td>
	<td>Статус</td>
	<td></td>
</tr>
<?
;
while($row=mysql_fetch_array($sql))
{
	?>
	<tr class='liney ell'>
	<td align=center><?=$row["rid"]; ?>
	</td><td align=center><?=$row["rname"]; ?>
	</td>
	<td align=center><?=$row["trid"] ?></td>
	<td align=center><?=date("d.m H:i", $row["timestart"]); ?></td>
	<td align=center><?=$row["price"]; ?></td>
	<td align=center><? if($row["bron"]==0) { echo "продаётся"; }else{ echo "забронирован<br><a href='adminmain.php?p=jarmarka&unbron=".$row["rid"]."'>разбронировать</a>"; } ?>
	</td>
	<td align=center><form action='' method='post'><input type='hidden' name='del' value='<?=$row[rid]; ?>'>
	<input type='submit' value='Убрать с биржи'></form></td></tr>
	<?
}

echo "</table>";
?>
