function get_specialinviteallowed_typemap()
{
$allowedtypemap['genesisonly']="Genesis Portal";
//If packages other than Genesis Portal are allowed with special invites in the future then some changes will need to be made to displays on registration pages
//to take into account charges for addons that users may select when signing up but should be an additional charge above the cost of special invite.
//Especially when crossing out the montly amount and just showing dislay of special invite cost and time.
//$allowedtypemap['classic']="RIO Professional"; //Not allowed at this time but may be allowed for special invite in the future.
//$allowedtypemap['riooffice']="RIO Office"; //Not allowed at this time but may be allowed for special invite in the future.
//$allowedtypemap['rioofficeplus']="RIO Office Complete"; //Not allowed at this time but may be allowed for special invite in the future.
return $allowedtypemap;
}
function get_specialinviteallowed_timemap()
{
//$allowedtimemap['30 days']="30 Days"; //Not allowed at this time but may be allowed for special invite in the future.
//$allowedtimemap['60 days']="60 Days"; //Not allowed at this time but may be allowed for special invite in the future.
//$allowedtimemap['90 days']="90 Days"; //Not allowed at this time but may be allowed for special invite in the future.
$allowedtimemap['1 year']="1 Year";
return $allowedtimemap;
}
function get_specialinvitetimedisplay($specialinvitetimeinterval="")
{
if(!$specialinvitetimeinterval)
return "";
$specialinvitetimemap=get_specialinviteallowed_timemap();
$label=$specialinvitetimemap[$specialinvitetimeinterval];
if(!$label)
return "";
return $label;
}
function specialinvite_send($specialinviteid)
{
/*
any call to this function with an invalid $specialinviteid is considered a violation
*/
if( !is_numeric($specialinviteid))
ddie("Invalid developer configuration issue specialinvite_send($specialinviteid) -specialinviteid not set");
$arr = db_first("select * from tblspecialinvite where specialinviteid = ".db_number($specialinviteid));//" and accountid = ".accountid());
if( !$arr) //lets die if they got in here incorrectly
ddie("Invalid developer configuration specialinvite_send($specialinviteid) was called on an invalid record ");
$specialinvitearr = get_accountcompany(accountid());
$email = $arr['specialinviteemail'];
if(!is_email($email))
{
d("Invalid email found in specialinviteemail ($email)",$arr);
dlog('specialinvite_send',"Invalid email found in accountemail ($email), $specialinviteid");
d('backtrace',debug_backtrace());
return;
}
d('email',$email);
d('specialinviteid',$specialinviteid);
$ln = get_verificationvar($email,$specialinviteid);
$proto="https";
if($_SERVER[SERVER_PORT]==80)
$proto="http";
$rndlink = "$proto://$_SERVER[HTTP_HOST]/".replacelinkwithpermalink("index.php?p=468&sid=$specialinviteid&verify=".urlencode($ln));
$eml = get_email('specialinvitation');
if(!$eml)
ddie("DEV, CONFIGURE, need to make sure this email exists");
$subject = $eml[emailsubject];
$body = $eml[emailtext];
$specialinvitedescription="