<?
	function ref_sign() {
		$params = func_get_args();
		$prehash = implode("::", $params);
		return md5($prehash);
	}

	function print_form($purse, $order_id, $amount, $clear_amount, $description, $secret_code, $type_payment, $ob_id, $submit) {

		$sign = ref_sign($purse, $order_id, $amount, $clear_amount, $description, $secret_code);

		echo 
		'<form action="http://service.smscoin.com/bank/" method="post">
			<p>
				<input name="s_purse" type="hidden" value="'.$purse.'" />
				<input name="s_order_id" type="hidden" value="'.$order_id.'" />
				<input name="s_amount" type="hidden" value="'.$amount.'" />
				<input name="s_clear_amount" type="hidden" value="'.$clear_amount.'" />
				<input name="s_description" type="hidden" value="'.$description.'" />
				<input name="s_sign" type="hidden" value="'.$sign.'" />
				<input name="type_payment" type="hidden" value="'.$type_payment.'" />
				<input name="ob_id" type="hidden" value="'.$ob_id.'" />
				<input type="submit" class="submit" value="'.$submit.'" />
			</p>
		</form>';
		
	}

	$clear_amount = 0;              // billing algorithm  алгоритм подсчета стоимости
	$submit = "Оплатить с помощью SMS";    // submit label       надпись на кнопке submit
	print_form($ry['billing_purse'], time(), $amount, $clear_amount, $description, $ry['billing_secret_code'], $type_payment, $id, $submit);
?>