"; $grant_promotion_errormessage .= promotion_error_text($promotionID); } else { // See if the user has aalready activated a promotion that is excluded by this one. $q = "select code from activatedby, promotion_excludes, promotion"; $q .= " where promotion_excludes.promotionid=$promotionID and excludesid = activatedby.promotionid"; $q .= " and excludesid = promotion.id and loginid=".$user->id.";"; // print "
"; $result = pg_exec($conn,$q); if (($result) && (pg_numrows($result)> 0)) { $row = pg_fetch_row($result,0); $grant_promotion_errormessage = "You have already activated promotion code '" . $row[0] . "'. You cannot activate this promotion."; } // Check if the user has activated the promotion before. // The demo user can activated it an unlimited number of times elseif ($user->demo_user != 't' && get_activation_count($conn,$promotionID,$user->id) > 0) $grant_promotion_errormessage = "You have already activated this promotion. You cannot activate it again."; elseif (!grant_promotion($conn,$promotionID,$user->id)) $grant_promotion_errormessage = "We were unable grant you all of the objects associated with this promotion."; else $promotion_granted = true; } } ?>


If you have been given a promotion code, you may enter it here to receive the tests and/or flashcards associated with that code. You have been granted the objects associated with this promotion.'; if (!empty($grant_promotion_errormessage)) echo "

$grant_promotion_errormessage"; ?>

Please enter the promotion code below.
Promotion Code: