<?php
session_start();

if($_SESSION['dbName']==""){
header("location:../index.php");
}

include("config.inc.php");

$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass'],true,65536) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'],$connection) or die("Could not find DB");

$actionmode = $_GET['actionmode'];

if ($actionmode == "setedit")
{
	$CouponCode = $_GET['CouponCode'];
	
	$query= "
	select coupon_id,coupon_name,coupon_beneficiary,Coupon_Tel,
	Coupon_Remark,Currency_Code,Coupon_Amount , coupon_debitacc,coupon_debitaccinfo
	from coupon where coupon_id = $CouponCode;
	";
	
	$resquery = mysql_query($query,$connection);
	$rawquery = mysql_fetch_array($resquery);
	extract($rawquery);
	
	echo $coupon_id . "[BRK]". $coupon_name . "[BRK]". $coupon_beneficiary. "[BRK]". $Coupon_Tel. "[BRK]". str_replace("<br>", "\n", $Coupon_Remark). "[BRK]". $Currency_Code. "[BRK]". $Coupon_Amount. "[BRK]". $coupon_debitacc. "[BRK]". $coupon_debitaccinfo;
	
	
}

?>