<?PHP
include "../inc/var.php";
include "../inc/connect.php";
include $server_inc."/client_functions.php";
include $server_inc."/whm_functions.php";
include $server_admin_tools."/worldpay_select.php";
include $server_admin_tools."/authnet_functions.php";
include $server_inc."/login_functions.php";

clear_cache();

include $server_admin_inc."/header.php";

// Start Form Handler

// set payment method to inactive
if (isset($act)) 
	{
	mysql_query("update payment_process set status='1' where pid='".addslashes(trim($id))."'");
	}

// set payment method to active
if (isset($unact)) 
	{
	mysql_query("update payment_process set status='0' where pid='".addslashes(trim($id))."'");
	}

// set payment attributes
if (isset($submit)) 
	{
	// special for plug n pay only
	if (isset($plug))
		{
		@sort ($card_allowed);
		@reset ($card_allowed);
		$ct=1;
		while (@list($key,$value)=@each($card_allowed))
			{
			$ca=@count($card_allowed);
			@$cards_allowed.=$card_allowed[$key].(($ca==$ct)?"":",");
			$ct++;
			}
		}
	$zzz=base64_encode($subject)."{{break}}".base64_encode($message)."{{break}}";
	@mysql_query("update payment_process set paypal_address='".addslashes(trim($paypal_address))."', checkout_sid='".addslashes(trim($checkout_sid))."', paysystems_companyid='".addslashes(trim($paysystems_companyid))."', plugnpay_subject='".addslashes(trim($plugnpay_subject))."', plugnpay_publisheremail='".addslashes(trim($plugnpay_publisheremail))."', plugnpay_publishername='".addslashes(trim($plugnpay_publishername))."', plugnpay_cardallowed='".addslashes(trim($cards_allowed))."', bymail_to='".addslashes(trim($bymail_to))."', bymail_address1='".addslashes(trim($bymail_address1))."', bymail_address2='".addslashes(trim($bymail_address2))."', bymail_city='".addslashes(trim($bymail_city))."', bymail_state='".addslashes(trim($bymail_state))."', bymail_zip='".addslashes(trim($bymail_zip))."', demo='".addslashes(trim($demo_mode))."', worldpay_id='".addslashes(trim($worldpay_id))."', worldpay_cc='".addslashes(trim($cc))."', worldpay_demo='".addslashes(trim($worldpay_demo))."', worldpay_callback='".addslashes(trim($worldpay_callback))."', default_email='".addslashes(trim($zzz))."', paypal_image_url='".addslashes(trim($paypal_image_url))."', x_Login='".e("576cb7f68040520768bf51c75f7f4c84", $x_Login)."', x_Password='".e("576cb7f68040520768bf51c75f7f4c84", $x_Password)."', x_Currency_Code='".addslashes(trim($auth_currency))."', x_gateway='".addslashes(trim($x_gateway))."' where pid='".addslashes(trim($id))."'");
	}

if (isset($reset))
	{
	@mysql_query("update payment_process set default_email='' where pid='".addslashes(trim($id))."'");
	}

// End Form Handler

// Do we have an id yet?
// if not, start with the first ABC sorted record in the payment_process table
if (!isset($id))
	{
	$ct_first_record=mysql_fetch_row(mysql_query("select pid from payment_process order by name asc limit 0, 1"));
	$id=$ct_first_record[0];
	}
echo("
<!--- Start Main Process --->
	<table width='725' cellpadding='2' cellspacing='0' border='0'>
		<tr>
			<td width='50%' align='left' valign='top'>

<!--- Start Process Menu --->
	<table width='100%' cellpadding='2' cellspacing='0' border='0'>
		<tr>
			<td align='left' valign='top'><b>Current Payment Processors</b></td>
		</tr>
	</table>
	<table width='100%' cellpadding='2' cellspacing='0' border='0'>
	");
// loop through processors in db
$row0=mysql_query("select pid, name, status from payment_process order by name asc");
while ($rs0=mysql_fetch_row($row0))
	{
	echo("
		<tr>
			<td width='40%' align='left' valign='top'><a href='".$http_admin."/payment_process.php?id=".$rs0[0]."".((trim($rs0[2])=="0")?"&ny=5":"")."&sid=".trim($sid)."'><img border='0' src='".$http_images."/".(($id==$rs0[0])?"menu_arrow.gif'":"space.gif' width='15' height='9'").">".stripslashes($rs0[1])."</a></td>
			<td width='60%' align='left' valign='top'>".((trim($rs0[2])=="0")?"[<a href='".$http_admin."/payment_process.php?id=".$rs0[0]."&act=5&sid=".trim($sid)."'>activate</a>]":"[<a href='".$http_admin."/payment_process.php?id=".$rs0[0]."&unact=5&sid=".trim($sid)."'>de-activate</a>]")."</td>
		</tr>
		");
	}
echo("
		<tr>
			<td width='40%' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='195' height='1'></td>
			<td width='60%' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='95' height='1'></td>
		</tr>
	</table>
<!--- End Process Menu --->

			</td>
			<td width='50%' align='left' valign='top'>

<!--- Start Process Details --->
	");
$query1="select ";
$query1.="name, ";						// 0
$query1.="paypal_address, ";			// 1
$query1.="checkout_sid, ";				// 2
$query1.="paysystems_companyid, ";		// 3
$query1.="plugnpay_subject, ";			// 4
$query1.="plugnpay_publisheremail, ";	// 5
$query1.="plugnpay_publishername, ";	// 6
$query1.="plugnpay_cardallowed, ";		// 7
$query1.="bymail_to, ";					// 8
$query1.="bymail_address1, ";			// 9
$query1.="bymail_address2, ";			// 10
$query1.="bymail_city, ";				// 11
$query1.="bymail_state, ";				// 12
$query1.="bymail_zip, ";				// 13
$query1.="demo, ";						// 14
$query1.="worldpay_id, ";				// 15
$query1.="worldpay_cc, ";				// 16
$query1.="worldpay_demo, ";				// 17
$query1.="worldpay_callback, ";			// 18
$query1.="default_email, ";				// 19
$query1.="paypal_image_url, ";			// 20
$query1.="x_Login, ";					// 21
$query1.="x_Password, ";				// 22
$query1.="x_Currency_Code, ";			// 23
$query1.="x_gateway ";					// 24
$query1.="from ";
$query1.="payment_process ";
$query1.="where ";
$query1.="pid='".addslashes(trim($id))."'";

$rs1=mysql_fetch_row(mysql_query($query1));
$demo_mode=$rs1[14];
$cc=stripslashes(trim($rs1[16]));
$worldpay_demo=$rs1[17];
$worldpay_callback=$rs1[18];
$default_email=$rs1[19];
$paypal_image_url=$rs1[20];
$x_Login=d("576cb7f68040520768bf51c75f7f4c84", $rs1[21]);
$x_Password=d("576cb7f68040520768bf51c75f7f4c84", $rs1[22]);
$x_Currency_Code=$rs1[23];
$x_gateway=$rs1[24];
echo("
	<form action='".$PHP_SELF."' method='POST'>
	<input type='hidden' name='id' value='".trim($id)."'>
	<input type='hidden' name='sid' value='".trim($sid)."'>
	<table width='100%' cellpadding='2' cellspacing='0' border='0'>
		<tr>
			<td><b>".stripslashes($rs1[0])." Configuration</b></td>
		</tr>
		<tr>
			<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
		</tr>
	</table>
	");

// build pay - mod details
if (ereg("authorize.net", strtolower(trim($rs1[0])))==true)
	{
	// worldpay
	if (isset($ny))
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td>Please activate this payment gateway first.</td>
				</tr>
				<tr>
					<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
				</tr>
			</table>
			");
		}
	else
		{
		$sho=display_auth_currency($auth_currency, $input_style);
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td width='50%' align='left' valign='top'>Login ID:</td>
					<td width='50%' align='left' valign='top'><input ".$input_style." size='30' maxlength='20' type='text' name='x_Login' value='".$x_Login."'></td>
				</tr>
				<tr>
					<td width='50%' align='left' valign='top'>Login Password:</td>
					<td width='50%' align='left' valign='top'><input ".$input_style." size='30' maxlength='50' type='text' name='x_Password' value='".$x_Password."'></td>
				</tr>
				<tr>
					<td width='50%' align='left' valign='top'>Run Authorize.net in:</td>
					<td width='50%' align='left' valign='top'><select name='demo_mode' ".$input_style.">
					<option value='0'".(($demo_mode==0)?" selected":"").">Live Mode</option>
					<option value='1'".(($demo_mode==1)?" selected":"").">Test Mode</option>	
				</select></td>
				</tr>
				<tr>
					<td width='50%' align='left' valign='top'>Choose Gateway:</td>
					<td width='50%' align='left' valign='top'>
					<select name='x_gateway' ".$input_style.">
						<option value='authorize'".((isset($x_gateway))?"".(($x_gateway=="authorize")?" selected":"")."":"").">Authorize.net</option>
						<option value='ecx'".((isset($x_gateway))?"".(($x_gateway=="ecx")?" selected":"")."":"").">eCommerce Exchange</option>
						<option value='epn'".((isset($x_gateway))?"".(($x_gateway=="epn")?" selected":"")."":"").">eProcessing Network</option>
						<option value='rtware'".((isset($x_gateway))?"".(($x_gateway=="rtware")?" selected":"")."":"").">RT Ware</option>
						<option value='mcps'".((isset($x_gateway))?"".(($x_gateway=="mcps")?" selected":"")."":"").">Merchant Commerce</option>
					</select>
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>Choose Currency:</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>".$sho."</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>
	");
include $server_admin_tools."/payment_process_email.php";
echo("		
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
				<tr>
					<td width='50%' align='left' valign='top'></td>
					<td width='50%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='Edit Now &gt'></td>
				</tr>
			</table>
			</form>
			");
		}
	}
else if (ereg("worldpay", strtolower(trim($rs1[0])))==true)
	{
	// worldpay
	if (isset($ny))
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td>Please activate this payment gateway first.</td>
				</tr>
				<tr>
					<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
				</tr>
			</table>
			");
		}
	else
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td width='50%' align='left' valign='top'>WorldPay instId:</td>
					<td width='50%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='worldpay_id' value='".stripslashes($rs1[15])."'></td>
				</tr>
				<tr>
					<td width='50%' align='left' valign='top'>WorldPay Callback Password:</td>
					<td width='50%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='worldpay_callback' value='".$worldpay_callback."'></td>
				</tr>
				<tr>
					<td width='50%' align='left' valign='top'>Run WorldPay in:</td>
					<td width='50%' align='left' valign='top'><select name='worldpay_demo' ".$input_style.">
					<option value='0'".(($worldpay_demo==1)?" selected":"").">Live Mode</option>
					<option value='100'".(($worldpay_demo==100)?" selected":"").">Test Mode - Always Approve</option>	
					<option value='101'".(($worldpay_demo==101)?" selected":"").">Test Mode - Always Fail</option>	
				</select></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>WorldPay Currency Code:</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>".show_worldpay_cc($cc)."</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>
	");
include $server_admin_tools."/payment_process_email.php";
echo("		
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
				<tr>
					<td width='50%' align='left' valign='top'></td>
					<td width='50%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='Edit Now &gt'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='149' height='16'></td>
					<td size='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='195' height='16'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>Enter the link below as your callback URL at WorldPay:<br>http://&ltWPDISPLAY ITEM=MC_callback&gt<br><br><a href='http://support.worldpay.com/kb/integration_guides/junior/integration/help/payment_response/sjig_5125.html' target='_blank'>Click here for more information.</a></td>
				</tr>
			</table>
			</form>
			");
		}
	}
else if (ereg("2checkout", strtolower(trim($rs1[0])))==true)
	{
	// 2Checkout
	if (isset($ny))
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td>Please activate this payment gateway first.</td>
				</tr>
				<tr>
					<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
				</tr>
			</table>
			");
		}
	else
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td size='25%' align='left' valign='top'>2Checkout SID:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='checkout_sid' value='".stripslashes($rs1[2])."'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><input type='checkbox' name='demo_mode' value='1'".(($demo_mode==1)?" checked":"")."> Check to put 2Checkout in demo mode.</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>
	");
include $server_admin_tools."/payment_process_email.php";
echo("		
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'></td>
					<td size='75%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='Edit Now &gt'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='149' height='16'></td>
					<td size='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='195' height='16'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>Use this URL as the return path:<br>".$http_web."/2checkout_success.php</td>
				</tr>
			</table>
			</form>
			");
		}
	}
if (ereg("paypal", strtolower(trim($rs1[0])))==true)
	{
	// PayPal
	if (isset($ny))
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td>Please activate this payment gateway first.</td>
				</tr>
				<tr>
					<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
				</tr>
			</table>
			");
		}
	else
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td size='25%' align='left' valign='top'>PayPal Address:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='paypal_address' value='".stripslashes($rs1[1])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'>PayPal Logo URL:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='paypal_image_url' value='".stripslashes($paypal_image_url)."'> <font color='#990000'><i>Optional</i></font></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>
	");
include $server_admin_tools."/payment_process_email.php";
echo("		
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'></td>
					<td size='75%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='Edit Now &gt'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='149' height='1'></td>
					<td size='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='195' height='1'></td>
				</tr>
			</table>
			</form>
			");
		}
	}
else if (ereg("tpp-pro", strtolower(trim($rs1[0])))==true)
	{
	// TPP-PRO
	if (isset($ny))
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td>Please activate this payment gateway first.</td>
				</tr>
				<tr>
					<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
				</tr>
			</table>
			");
		}
	else
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td size='25%' align='left' valign='top'>TPP-PRO CompanyID:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='paysystems_companyid' value='".stripslashes($rs1[3])."'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>
	");
include $server_admin_tools."/payment_process_email.php";
echo("		
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'></td>
					<td size='75%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='Edit Now &gt'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='149' height='1'></td>
					<td size='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='195' height='1'></td>
				</tr>
			</table>
			</form>
			");
		}
	}
else if (ereg("plug n pay", strtolower(trim($rs1[0])))==true)
	{
	// Plug N Pay
	if (isset($ny))
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td>Please activate this payment gateway first.</td>
				</tr>
				<tr>
					<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
				</tr>
			</table>
			");
		}
	else
		{
		echo("
			<input type='hidden' name='plug' value='5'>
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td size='25%' align='left' valign='top'>Return Email Subject:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='plugnpay_subject' value='".stripslashes($rs1[4])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'>Publisher Email:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='plugnpay_publisheremail' value='".stripslashes($rs1[5])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'>Publisher Name:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='plugnpay_publishername' value='".stripslashes($rs1[6])."'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>Choose all that apply below:</td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><input type='checkbox' name='card_allowed[Visa]' value='Visa'".((ereg("Visa", stripslashes($rs1[7]))==true)?" checked":"")."> Visa</td>
					<td size='75%' align='left' valign='top'><input type='checkbox' name='card_allowed[Mastercard]' value='Mastercard'".((ereg("Mastercard", stripslashes($rs1[7]))==true)?" checked":"")."> Mastercard</td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><input type='checkbox' name='card_allowed[Amex]' value='Amex'".((ereg("Amex", stripslashes($rs1[7]))==true)?" checked":"")."> Amex</td>
					<td size='75%' align='left' valign='top'><input type='checkbox' name='card_allowed[Discover]' value='Discover'".((ereg("Discover", stripslashes($rs1[7]))==true)?" checked":"")."> Discover</td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><input type='checkbox' name='card_allowed[JCB]' value='JCB'".((ereg("JCB", stripslashes($rs1[7]))==true)?" checked":"")."> JCB</td>
					<td size='75%' align='left' valign='top'><input type='checkbox' name='card_allowed[Diners]' value='Diners'".((ereg("Diners", stripslashes($rs1[7]))==true)?" checked":"")."> Diners</td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><input type='checkbox' name='card_allowed[MYAR]' value='MYAR'".((ereg("MYAR", stripslashes($rs1[7]))==true)?" checked":"")."> MYAR</td>
					<td size='75%' align='left' valign='top'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>
	");
include $server_admin_tools."/payment_process_email.php";
echo("		
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'></td>
					<td size='75%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='Edit Now &gt'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='149' height='1'></td>
					<td size='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='195' height='1'></td>
				</tr>
			</table>
			</form>
				");
		}
	}
else if (ereg("mail in", strtolower(trim($rs1[0])))==true)
	{
	// Revcomm
	if (isset($ny))
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td>Please activate this payment gateway first.</td>
				</tr>
				<tr>
					<td><img src='".$http_images."/space.gif' width='345' height='1'></td>
				</tr>
			</table>
			");
		}
	else
		{
		echo("
			<table width='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td size='25%' align='left' valign='top'>Mail to:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='bymail_to' value='".stripslashes($rs1[8])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'>Mailing Address:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='bymail_address1' value='".stripslashes($rs1[9])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'></td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='bymail_address2' value='".stripslashes($rs1[10])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'>City:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='bymail_city' value='".stripslashes($rs1[11])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'>State:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='bymail_state' value='".stripslashes($rs1[12])."'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'>Postal Code:</td>
					<td size='75%' align='left' valign='top'><input ".$input_style." size='30' maxlength='255' type='text' name='bymail_zip' value='".stripslashes($rs1[13])."'></td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'>
	");
include $server_admin_tools."/payment_process_email.php";
echo("		
					</td>
				</tr>
				<tr>
					<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'></td>
					<td size='75%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='Edit Now &gt'></td>
				</tr>
				<tr>
					<td size='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='149' height='1'></td>
					<td size='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='195' height='1'></td>
				</tr>
			</table>
			</form>
			");
		}
	}
echo("
<!--- End Process Details --->

			</td>
		</tr>
		<tr>
			<td colspan='2'><img src='".$http_images."/space.gif' width='1' height='8'></td>
		</tr>
	</table>
	");
// End Main Process
mysql_close($dblink);
include $server_admin_inc."/footer.php";
?>