<?php

 $amount=$payment->pay_samount;
 $id=$payment->pay_transid;  

# get the user details
$result = mysql_query("SELECT * FROM members WHERE mem_userid='$Sess_UserId'",$link);
$arr_member = mysql_fetch_object($result);
$testdate=date("Y-m-d");
$expDate=date($CONST_FORMAT_DATE_SHORT, strtotime($arr_member->mem_expiredate));
if ($arr_member->mem_expiredate < $testdate) {
    $Sess_Userlevel="silver";
} else {
    $Sess_Userlevel="gold";
}
switch ($payment->pay_transstatus) {
    case 'Completed':
        $response=sprintf(THANKYOU_COMPLETED,$id,$currency.$amount,$expDate);
        break;
    case 'Pending':
        $response=sprintf(THANKYOU_PENDING,$id,$currency.$amount,$expDate);
        break;
    case 'Failed':
        $response=THANKYOU_FAILED;
        break;
    case 'Denied':
        $response=THANKYOU_DENIED;
        break;
}
?>
<?=$response?>
