Print Friendly, PDF & Email



= 20200414){$bw_on = “yes”;}
if($j_date >= 20190413){$su_on = “yes”;}
$current_user = wp_get_current_user();
# echo ‘User ID: ‘ . $current_user->ID . “\n”;
#######################################
# IF FORM SUBMITTED #
#######################################

if ($_SERVER[‘REQUEST_METHOD’] == ‘POST’){

$hick=”und”;
#######################################
# TAKING CARE OF CARD ENTRY #
#######################################
if (!empty($_POST[‘card’] )){
#echo $_POST[‘card’];
list($ast2, $ast1) = explode(“(“, $_POST[‘card’]);
$ast1= substr_replace($ast1, “”, -1);
$ast = explode(” “, $ast2);
$aaad= substr_replace($ast[0], “”, -1); $aaad = substr($aaad, 1);
list($aaa, $bbb)= explode(“-“, $aaad);
if (“$ast[1] $ast[2]” == “Be Well”){$hick=1;}elseif(“$ast[1] $ast[2]” == “Step Up”){$hick=2;}else{}
$j_gg = “INSERT INTO binding(wid,bwsuid,cnum,email,start,end)VALUES($current_user->ID,$hick,$ast[5],\”$ast1\”,$aaa, $bbb)”;
#echo $j_gg;
$j_rgg = mysql_query($j_gg);
if($j_rgg){
echo “

Service title
SUCCESS! Your card has now been added. To verify any more cards or just start logging.
“;
}else{
echo “
Service title
Oops! Looks Like That Card Number is Spoken for or Badly Formed. Please contact Wendy Lopez at 307-633-3156 to Correct This Issue.
“;
}
}

if (!empty($_POST[‘submit_both’] )){

$mon=$tue=$nev=$cnev=$cnen=$waiting=””;
$wow=array();
$roww= “SELECT * FROM steps_weight WHERE wid= “.$current_user->ID.””;
$nev = mysql_query( “SELECT * FROM steps_weight WHERE wpid= “.$current_user->ID.”” );
$cnev = mysql_num_rows($nev);
while ($cnen=mysql_fetch_row( $nev ) ){list($mon, $tue)=explode(” “, $cnen[4]); echo “mon: “.$mon. “
“; array_push($wow, $mon);}
$punk= date(‘Y-m-d’);
if (in_array($punk, $wow)) {
echo “

Service title
Oops! Can’t resubmit by refreshing, but you can always edit on this info you just submitted on your log page
“;

}else{
$nonce= rand(10, 60);
$jtsa= date(‘YmdHis’);
$nnumm = $jtsa.$nonce;

$love_a = “INSERT INTO steps_weight (swid, cid, bwsuid, wpid, ts, steps, weight) VALUES ($nnumm,1000,”.$_POST[‘whoish’].”,”.$current_user->ID.”,CURRENT_TIMESTAMP, “.$_POST[‘sboth’].”, “.$_POST[‘wboth’].”)”;

$j_rlove = mysql_query($love_a);
if($j_rlove){

echo “

Service title
SUCCESS! Your information has now been added. Click here to return to your log..
“;

}else{

echo “

Service title
Oops! Only whole numbers are allowed to be entered in for steps and weight. Please go back and check your submission. Click here to re-enter.
“;

}
}#no dup

}#if steps entered

if (!empty($_POST[‘subup’] )){

$uall= “UPDATE steps_weight SET steps = “.$_POST[‘usteps’].”, weight = “.$_POST[‘uweight’].” WHERE swid = “.$_POST[‘uswid’].” AND cid =”.$_POST[‘ucid’].” AND bwsuid =”.$_POST[‘ubwsuid’].” AND wpid =”.$_POST[‘uwpid’].”;”;
#echo $uall;
$ruall = mysql_query($uall);
if($ruall){
echo “

Service title
SUCCESS! Your information has now been updated. Click here to return to your log.
“;
}else{
echo “
Service title
Opps! Only numbers are allowed to be entered in for steps and weight. Please go back and check your submission. Click here to re-enter.
“;
}

}#if update

}else{#if not post then carry on
$bwopt = $suopt = $ww = array();
$bw = “no”;
$su= “no”;
$go = “yes”;
$bwho = mysql_query( “SELECT * FROM `binding` WHERE `wid` = $current_user->ID” );
$c_jyan = mysql_num_rows($bwho);
#########################################
# CHECK TO SEE IF ALL READY BINDED CARD #
#########################################
while ($bs=mysql_fetch_row( $bwho ) ){array_push($ww, $bs[1]);}
if (in_array(1, $ww)) {$bw = “yes”;}
if (in_array(2, $ww)) {$su = “yes”;}
#CHECK WHAT RECORDS NEED TO BE VERIFIED IN CSV
if ($c_jyan < 2){ $rr = getrecords($current_user->user_email);
#var_dump ($rr);
$nn= 1;
foreach ($rr as $blah){
#echo $nn.”. “.$blah;
if (ereg (“Be Well Card”, $blah)){array_push($bwopt, $blah);}
if (ereg (“Step Up Card”, $blah)){array_push($suopt, $blah);}
$nn++;
}
if ((count($bwopt) <1)&&(count($suopt) <1)){ echo" [su_service title=\"You need to be enrolled to log your steps and weight.\" icon=\"icon: hand-o-right\" icon_color=\"#004000\"] Looks like you have not enrolled yet. Enroll Now!
[/su_service]

“;
echo “\"\"
“;
}else{
if (($bw ==”no”)||($bw ==”no”)){
if ((count($bwopt) >=1)||(count($suopt) >=1)){
echo”
";
}}
#########################################
# PRINT OUT YOUR CONFIRMATION BOXES #
#########################################
echo "
";
if ($bw =="no"){
if (count($bwopt) >0){
echo "
";
$go = "no";
}#elsego
}#elsego
if ($su =="no"){
if (count($suopt) >0){
echo "
";
$go = "no";
}#elsego
}#elsego
echo "
";
}#NEWBIE?
} elseif($c_jyan == 2){
if (($bw=="yes")&&($su=="yes")){ $go = "yes";
}else{
echo "
Service title
Opps! Looks Like You May Have May Have Multiple Accounts For The Same Challenge. Please contact Abbey Palma at 1.307.633.3145 to Correct This Issue.
";
$go = "no";
}
}else{$go = "no";echo "ERROR - You have Dups";}
##########################
# DISPLAY OPEN CLOSE #
##########################
if ($bw_on =="yes"){$j_bwmesg="is open";}else{$j_bwmesg="opens April 8, 2017";}
if ($su_on =="yes"){$j_sumesg="is open";}else{$j_sumesg="opens April 13, 2019";}

?>

";
####################################################LET THEM HAVE CAKE...OH AND LOG TOO###################################################

if ($go == "yes"){

echo "

This is box title
“;
?>


ID, 121 ); ?>

user_firstname.” “.$current_user->user_lastname.”!
Status: You are enrolled in “.$c_jyan.” account(s).
“;
echo ‘Username: ‘ . $current_user->user_login . ‘
‘;
echo ‘User Email: ‘ . $current_user->user_email . ‘
‘;
echo ‘User display name:

ID ORDER BY ts” );
$jil_num5 = mysql_num_rows( $j_res5 );
$jcomp= date(‘Y-m-d’);
$bwlogged =$slogged=”no”;
$whatb=$whats=array();
$sutslogged =$bwtslogged =$jrows = “”;
$snot=0;
while ( $aj = mysql_fetch_row( $j_res5 ) ){
$jrows= “

“.$aj[4].” “.$aj[5].” “.$aj[6].”

Lightbox: please specify correct source

“;
if ($aj[2] ==1){array_push($whatb, $jrows);}
if ($aj[2] ==2){array_push($whats, $jrows);}

list ($j_day, $j_time) = explode (” “, $aj[4]);
#echo $j_day.” and “. $jcomp. “
“;
if ($j_day == $jcomp){
if ($aj[2] == 1){$bwlogged = “yes”; $bwtslogged = $aj[4];}
if ($aj[2] == 2){$slogged = “yes”; $sutslogged = $aj[4];}
}
$snot++;

}

?>

Enter Steps: Enter Weight:
[/su_note]“;
}

}else{
echo “

Be Well is closed. It “.$j_bwmesg.”.
“;
}#is open
}#if in contest
##########################
# DISPLAY SU FORM #
##########################
if ($su==”yes”){
if ($su_on == “yes”){
if ($slogged == “yes”){
echo “
You have already entered your Step Up steps/weight for today. If you need to edit today’s information. Please scroll down and click edit.
“;
}else{
echo “
Enter Steps: Enter Weight:
“;
}#if inputted anything today
}else{
echo “
Step Up is closed. It “.$j_sumesg.”.
“;
}#is open
}#if in contest

##########################
# DISPLAY BW TABLE #
##########################
if ($bw == “yes”){

if ($bw_on == “yes”){
echo ““;
print “

\n”; ?>


\n”;
}
}
##########################
# DISPLAY SU TABLE #
##########################
if ($su==”yes”){
if ($su_on == “yes”){
echo ““;
print “

Date Steps Weight Loss/Gain  
\n”; ?>


\n”;
}
}

echo “";

}

##############################################FUNCTIONS THAT NEED TO BE MOVED TO FUNCTIONS.PHP###################################################

function getrecords($emaill){
$myFile = 'csv/dump.csv';
$csv_pay= $love =$datae = array();

$fhe = fopen($myFile, "r");
if ($fhe) {
$fieldse = fgetcsv($fhe, 4096, ',');
while (($datae = fgetcsv($fhe, 4096, ',')) !== FALSE) {
$datae = array_combine($fieldse, $datae);
array_push ($love, $datae);
}
foreach($love as $tt) {
if (eregi($emaill, $tt['email'])) {
$all_r = "[".$tt['start']."-".$tt[end]."] ".$tt['bwsu']." Card #: ".$tt['cnum']." - ".$tt['name']." (".$tt['email'].")";
#if($tt['bwsu'] == "Step Up"){$stp="yes";} elseif($tt['bwsu'] == "Be Well"){$bwp="yes";}
array_push($csv_pay, $all_r);
}
}
}
fclose($fhe);
return $csv_pay;
}

function fshow($wbs, $selects){
echo"

";
?>


Don't see your card?

Contact Abbey

".$selectf."
"; }

echo "

";

}

?>

Theme by Pixel Ink Group

Date Steps Weight Loss/Gain