<?php
function orderemail($emailmark, $nametext, $info) {
	global $db;
	$a = array('{order_name}', '{order_money}', '{order_wlname}', '{order_wlid}', '{user_tname}', '{user_address}','{downurl}');
	$b = array($info['order_name'], $info['order_money'], $info['order_wlname'], $info['order_wlid'], $info['user_tname'], $info['user_address'],$info['downurl']);
	$orderemail = $db->pe_select('orderemail', array('orderemail_mark'=>$emailmark));	
	
	if ($nametext == 'name') {
		return str_replace($a, $b, $orderemail['orderemail_name']);
	}
	elseif ($nametext == 'text') {
		return str_replace($a, $b, $orderemail['orderemail_text']);
	}
}
?>