<?
// 기본 설정 로딩
require_once('config.php');
require_once('function.php');
require_once('lib.php');

//HTML 시작

?>
<?
$service_code=$_GET[service_code];  
$client_code=$_GET[client_code];

$query="select service_code, service_line, client_code , coupon From servicedb where service_line NOT IN ( 'vpn', 'test','soloLine','substitution' ) and service_code = '$service_code'";

$coupon_data = @mysql_query($query , $db_connect) or die($db_q_error);
$coupon=mysql_fetch_assoc($coupon_data);
/*
$server_date= explode('-', $coupon['service_open_date']);
$server_timestamp = mktime('0','0','0',$server_date[1],$server_date[2],$server_date[0]);

$timestamp = mktime('0','0','0','18','9','2015');
$default = $timestamp - 32676480; // 1432721520 <- 기준점에서 1년전 타임스탬프
if ( $server_timestamp < $default ) { echo "<font color=blue>5</font>"; } else { echo "<font color=red>3</font>";}
*/
if ( $coupon[coupon] == NULL ) {$coupon[coupon] = 0;}
echo "<a href='/IdcCouponUseMK.cup?client_code=$client_code' onclick=\"location.href='/IdcCouponUseMK.cup?client_code=<?=$coupon[client_code]?>'\" style=\"cursor: pointer;\">$coupon[coupon] 개</a>";

//DB닫기
mysql_close($db_connect);
?>