Execute("SELECT release_flag FROM $coupon_gv_queuetable WHERE unique_id='".$_GET['gid']."'"); $gv_result = $gv_result->fields; if ($gv_result['release_flag'] == 'N') { $coupon_gv_queuetable = $oostable['coupon_gv_queue']; $gv_result = $dbconn->Execute("SELECT customer_id, amount FROM $coupon_gv_queuetable WHERE unique_id='".$_GET['gid']."'"); if ($gv_resulta = $gv_result->fields) { $gv_amount = $gv_resulta['amount']; //Let's build a message object using the email class $customerstable = $oostable['customers']; $mail_result = $dbconn->Execute("SELECT customers_firstname, customers_lastname, customers_email_address FROM $customerstable WHERE customers_id = '" . $gv_resulta['customer_id'] . "'"); $mail = $mail_result->fields; $message = TEXT_REDEEM_COUPON_MESSAGE_HEADER; $message .= sprintf(TEXT_REDEEM_COUPON_MESSAGE_AMOUNT, $currencies->format($gv_amount)); $message .= TEXT_REDEEM_COUPON_MESSAGE_BODY; $message .= TEXT_REDEEM_COUPON_MESSAGE_FOOTER; // Instantiate a new mail object $send_mail = new PHPMailer(); $send_mail->PluginDir = OOS_ABSOLUTE_PATH . 'includes/lib/phpmailer/'; $sLang = (isset($_SESSION['iso_639_1']) ? $_SESSION['iso_639_1'] : 'en'); $send_mail->SetLanguage( $sLang, OOS_ABSOLUTE_PATH . 'includes/lib/phpmailer/language/' ); $send_mail->CharSet = CHARSET; $send_mail->IsMail(); $send_mail->From = STORE_OWNER_EMAIL_ADDRESS; $send_mail->FromName = STORE_OWNER; $send_mail->Mailer = EMAIL_TRANSPORT; // Add smtp values if needed if ( EMAIL_TRANSPORT == 'smtp' ) { $send_mail->IsSMTP(); // set mailer to use SMTP $send_mail->SMTPAuth = OOS_SMTPAUTH; // turn on SMTP authentication $send_mail->Username = OOS_SMTPUSER; // SMTP username $send_mail->Password = OOS_SMTPPASS; // SMTP password $send_mail->Host = OOS_SMTPHOST; // specify main and backup server } else // Set sendmail path if ( EMAIL_TRANSPORT == 'sendmail' ) { if (!oos_empty(OOS_SENDMAIL)) { $send_mail->Sendmail = OOS_SENDMAIL; $send_mail->IsSendmail(); } } $send_mail->Subject = TEXT_REDEEM_COUPON_SUBJECT; $send_mail->Body = $message; $send_mail->AddAddress($mail['customers_email_address'], $mail['customers_firstname'] . ' ' . $mail['customers_lastname']); $send_mail->Send(); $send_mail->ClearAddresses(); $send_mail->ClearAttachments(); $gv_amount = $gv_resulta['amount']; $coupon_gv_customertable = $oostable['coupon_gv_customer']; $gv_result = $dbconn->Execute("SELECT amount FROM $coupon_gv_customertable WHERE customer_id='".$gv_resulta['customer_id']."'"); $customer_gv = false; $total_gv_amount = 0; if ($gv_result = $gv_result->fields) { $total_gv_amount=$gv_result['amount']; $customer_gv = true; } $total_gv_amount=$total_gv_amount+$gv_amount; if ($customer_gv) { $coupon_gv_customertable = $oostable['coupon_gv_customer']; $gv_update = $dbconn->Execute("UPDATE $coupon_gv_customertable SET amount='".$total_gv_amount."' WHERE customer_id='".$gv_resulta['customer_id']."'"); } else { $coupon_gv_customertable = $oostable['coupon_gv_customer']; $gv_insert = $dbconn->Execute("INSERT INTO $coupon_gv_customertable (customer_id, amount) VALUES ('".$gv_resulta['customer_id']."','".$total_gv_amount."')"); } $coupon_gv_queuetable = $oostable['coupon_gv_queue']; $gv_update = $dbconn->Execute("UPDATE $coupon_gv_queuetable SET release_flag='Y' WHERE unique_id='".$_GET['gid']."'"); } } } require 'includes/header.php'; ?>

'[' . $gInfo->unique_id . '] ' . oos_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount)); $contents[] = array('align' => 'center', 'text' => ''.oos_button(IMAGE_CONFIRM) . '' . BUTTON_CANCEL . ''); break; default: $heading[] = array('text' => '[' . $gInfo->unique_id . '] ' . oos_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount)); $contents[] = array('align' => 'center','text' => '' . oos_button(IMAGE_RELEASE) . ''); break; } if ( (oos_is_not_null($heading)) && (oos_is_not_null($contents)) ) { ?>
Execute($gv_result_raw); while ($gv_list = $gv_result->fields) { if ((!isset($_GET['gid']) || (isset($_GET['gid']) && ($_GET['gid'] == $gv_list['unique_id']))) && !isset($gInfo)) { $gInfo = new objectInfo($gv_list); } if (isset($gInfo) && is_object($gInfo) && ($gv_list['unique_id'] == $gInfo->unique_id) ) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?> MoveNext(); } ?>
 
format($gv_list['amount']); ?> unique_id) ) { echo ''; } else { echo ''; } ?> 
display_count($gv_result_numrows, MAX_DISPLAY_SEARCH_RESULTS, $nPage, TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS); ?> display_links($gv_result_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $nPage); ?>
infoBox($heading, $contents); ?>