<?php
include('../includes/common.php');

$id = intval($_GET['pid']);

if (0 >= $id)
{
	exit;
}

$p_row = mysql_fetch_object(mysql_query("select * from partners where id=$id and status=1"));

if($p_row->id=="")
{
	exit;
}

$js = "
	<style>
	.moneynames {
	font-family: Verdana, Arial, Helvetica, sans-serif;

	font-size: 11px;

	font-style: normal;

	color: #555555;
	}
	</style>
	
	<table style=\"border: 2px solid #EDEDED; background-color:#FFFFFF; \">
	<form action=\"$SITE_URL/pr.php\" method=\"GET\">
	<input name=\"id\" type=\"hidden\" value=\"$id\">
	<tr>
		<td class=\"moneynames\">Я хочу поменять:</td>
		<td>
			<select>
			";
			
			$query = "select * from ex_currencies where status = 1";
			
			
			$res = mysql_query($query);
			while ($row = mysql_fetch_object($res))
			{
				$js.= "<option value=\"$row->id\">$row->name</option> \n";
			}

			$js .=" </select>
		</td>
	</tr>
	<tr>
		<td class=\"moneynames\">На:</td>
		<td>
			<select name=\"currency\">
			";
			$query = "select * from ex_currencies where status = 1";
			
			
			$res = mysql_query($query);
			while ($row = mysql_fetch_object($res))
			{
				$js .= "<option value=\"$row->id\">$row->name</option> \n";
			}
			$js .= "
			</select>
		</td>
	</tr>
	<tr>
		<td></td>
		<td><input style=\"width:100%\" type=\"submit\" value=\"OK\" /></td>
	</td>
	</form>
</table>
";


$js = explode("\n", $js);


header("Content-type: text/javascript");
foreach($js as $s)
{
	echo ("document.write('".preg_replace("(\r\n|\n|\r)", "", $s)."');\n");
}


?>