define defaults

This commit is contained in:
Tony Volpe
2024-09-17 15:52:13 +00:00
parent 8dd84d12e6
commit 2a354bae60
2 changed files with 64 additions and 114 deletions

View File

@@ -19,50 +19,6 @@ function googleapi(){
session_start();
$utm_campaign = $_GET['promotion_id'];
if( have_rows('promotions', 'option') ) {
while( have_rows('promotions', 'option') ): the_row();
$date = date('Y-m-d');
$date = date('Y-m-d', strtotime($date));
$promo_id = get_sub_field('promotion_id');
$promotion_description = get_sub_field('promotion_description');
$promophone_number = get_sub_field('phone_number');
$promocoupon_code = get_sub_field('promocoupon_code');
$start_date = get_sub_field('start_date');
$end_date = get_sub_field('end_date');
$lldefault_descr = "Lifeline.com Default";
$lldefault_phone = "8556815351";
if ($utm_campaign === $promo_id) {
if (($date >= $start_date) && ($date <= $end_date)) :
setcookie('SESSpromoid', $promo_id, 0,'/');
setcookie('SESSpromotion_description', $promotion_description, 0,'/');
setcookie('SESSphone_number', $promophone_number, 0,'/');
setcookie('SESScoupon_code', $promocoupon_code , 0,'/');
//setcookie('SESSstart_date', $start_date , 0,'/');
//setcookie('SESSend_date', $end_date , 0,'/');
$_SESSION['SESSpromoid']=$promo_id;
$_SESSION['SESSpromotion_description']=$promotion_description;
$_SESSION['SESSphone_number']=$promophone_number;
$_SESSION['SESScoupon_code']=$promocoupon_code;
$_SESSION['SESSstart_date']=$start_date;
$_SESSION['SESSend_date']=$end_date;
endif;
}
endwhile;
}
if (!isset($_SESSION["SESSpromoid"])) {
setcookie('SESSpromoid', 'WEB_ORG_0001', 0,'/');
setcookie('SESSpromotion_description', $lldefault_descr, 0,'/');
setcookie('SESSphone_number', $lldefault_phone, 0,'/');
$_SESSION['SESSpromoid']="WEB_ORG_0001";
$_SESSION['SESSpromotion_description']=$lldefault_descr;
$_SESSION['SESSphone_number']=$lldefault_phone;
}
# Imports all Composer packages
require __DIR__ . '/vendor/autoload.php';
@@ -994,6 +950,7 @@ function aarp_form_notfound()
global $aarp_member_notfound;
}
/**
* Function get_phone
*
@@ -1003,15 +960,15 @@ function aarp_form_notfound()
function get_phone()
{
if (isset($_SESSION['SESSphone_number'])) {
$num = $_SESSION["SESSphone_number"];
if (isset($_SESSION['SESScampaignphone'])) {
$num = $_SESSION["SESScampaignphone"];
$ufnum = preg_replace("/[^0-9]/", "", $num);
$fnum = substr($ufnum, 0, 3) . "-" . substr($ufnum, 3, 3) . "-" . substr($ufnum, 6);
return $fnum;
global $fnum;
} else {
$num = get_option('cta_tel', true);
$ufnum = preg_replace("/[^0-9]/", "", $num);