\n"; print "Show Data"; print "\n\n"; print "

Volunteer List\n"; print "\n"; print ""; for ($i=0;$i".$TagsCsv[$i].""; }//end for i print ""; for ($v=0;$v< sizeof($VOLUNTEERS);$v++){ $L=explode('|',$VOLUNTEERS[$v]); print ""; for ($i=0;$i".$L[$i].""; print ""; }//end for i print ""; print "\n"; }//end for $v print "
Edit
".substr($L[$i],0,20)."
\n"; print"
Return"; print "\n\n"; }//end showData else if ($Edit!=""){ ////////////////////// update data ///////////////////////// $VOLUNTEERS=file($datFile); foreach($VOLUNTEERS as $line){ $S=explode("|",$line); if ($VOL_NAME==$S[0]){ $NAME=$S[0]; $EMAIL=$S[1]; $PHONE=$S[2]; $PASSWD1=$S[3]; $PASSWD2=$S[3]; //use for both passwords $ADDR=$S[5]; $PREF=$S[6]; }//end if VOL_NAME }//end foreach //build form table to input data print " "; print "Update Data"; print " "; print "
"; print "

Edit Record"; print ""; sort($DATA); $L=explode('|',$VOLUNTEERS[$Edit]); print "\n"; print ""; print ""; print "
$TagsCsv[0]:\n"; print "
$TagsCsv[1]:\n"; print "
$TagsCsv[2]:\n"; print "
$TagsCsv[3]:\n"; print "
$TagsCsv[4]:\n"; print "
$TagsCsv[5]:\n"; print "
$TagsCsv[6]:\n"; print "
\n"; print ""; print ""; print ""; print "
"; print "\n"; print ""; print "\n"; print "
\n"; print ""; print "

"; print ""; }//end if updateData else if ($saveData!=""){ ////////////////////// saveData ///////////////////////// $VOLUNTEERS=file($datFile); list($j,$inFile)=explode("/",$datFile); $TS=date('Ymd_H_i_s',filemtime($datFile)); //make timestamp from inFile Mtime $buFile="NO_SYNC/BACKUP/".$inFile."_".$TS; //create backup name $inFile=$buFile; //use backup to load data if(!rename($datFile,$buFile))print "Failed to move to $buFile
"; //move to backup dir $ip=fopen($buFile,"r"); if (!$ip) {echo "

Unable to open remote file, $buFile.

"; exit;} $op=fopen($datFile,'w+') or die("Cannot open ".$datFile); foreach($VOLUNTEERS as $line){ $S=explode("|",$line); if ($S[0]==$e0){ fwrite($op,"$e0|$e1|$e2|$e3|$e4|$e5|$e5|\n"); $nFlg=1; }//end if NAME else fwrite($op,$line); }//end foreach VOLUNTEERS fclose($op); print ""; }//end if saveData ////////////////////// Log In ////////////////// else if ($LogIn=="LogIn"){ $name=$_REQUEST['name']; $password=$_REQUEST['password']; $pswFile="NO_SYNC/weeklyList.psw"; $fp=fopen($pswFile,"r"); if (!$fp) {echo "

Unable to open remote file.

"; exit;} $NAME=trim(fgets($fp, 2048)); $PASSWD=trim(fgets($fp, 2048)); fclose($fp); if(!isset($name)&&!isset($password)) { //Visitor needs to enter a name and password // print "
"; print ""; print ""; print ""; print ""; print "

Please Log In
".$_REQUEST['Msg'];"

"; // print ""; print "
"; print ""; print " "; print " "; print ""; print ""; print " "; print " "; print ""; print ""; print " "; print "
Username
Password
"; print " "; print ""; print "
"; print ""; print "
"; print "
"; print "
"; print "
"; print "
"; }//if !name/password else if(strtolower($name)==$NAME&&strtolower($password)==$PASSWD) { // visitor's name and password combination are correct // echo ""; echo ""; }//else else { // visitor's name and password combination are not correct echo "

Invalid login/password

"; echo "You must provide a valid login and password to enter this site."; }// else }//end if LogIn ////////////////////// Change Password ////////////////// else if ($Change=="Change"||$Change=="TryData"||$Change=="SaveData"){ $name=$_REQUEST['name']; $password=$_REQUEST['password']; $Opasswd=$_REQUEST['Opasswd']; $Npasswd1=$_REQUEST['Npasswd1']; $Npasswd2=$_REQUEST['Npasswd2']; $Msg=$_REQUEST['Msg']; $Saveword=$_REQUEST['Saveword']; $pswFile="weeklyList.psw"; $fp=fopen($pswFile,"r"); if (!$fp) {echo "

Unable to open remote file.

"; exit;} $NAME=trim(fgets($fp, 2048)); $PASSWD=trim(fgets($fp, 2048)); fclose($fp); if ($Change=="SaveData"){ //save the new password $fp=fopen($pswFile,"r"); if (!$fp) {echo "

Unable to open remote file(".$inFile.").

"; exit;} $n = fgets($fp, 2048); $p = fgets($fp, 2048); fclose($fp); $fp=fopen($pswFile,'w+') or die("Cannot open ".$pswFile); fwrite($fp,$n); //fwrite($fp,$p); fwrite($fp,$Saveword); fclose($fp); $str="LogIn=LogIn&Msg=password%20changed"; print ""; $Change=""; //clear Change to avoid being picked up by subsequent ifs }//end if Saveword if ($Opasswd==$PASSWD&&$Npasswd1==$Npasswd2&&$Opasswd.$Npasswd1.$Npasswd2!="") { //check if parameters correct for change submit it for change $str="Change=SaveData&Saveword=".$Npasswd1; print ""; $Change=""; //clear Change to avoid being picked up by subsequent ifs }//end if $m1="New_Passwords_not_same!"; $m2="Password_Incorrect!"; $m3="Missing_Data!"; if ($Change=="Change"&&$Opasswd.$Npasswd1.$Npasswd2!=""){ $f=""; if ($Npasswd1!=$Npasswd2){$f=$m1;} if ($Opasswd!=$PASSWD){$f=$m2;} if ($Opasswd==""||$Npasswd1==""||$Npasswd2==""){$f=$m3;} $str="Change=Change&Msg=".$f; print ""; }//end if Msg if ($Change=="Change"&&$Opasswd.$Npasswd1.$Npasswd2.$Saveword==""){ print ""; if ($Msg==""){$Msg="Change Password";} $Msg=str_replace("_"," ",$Msg); print ""; print ""; print "

$Msg

"; print ""; print ""; print " "; print " "; // print " "; print ""; print ""; print " "; print " "; // print " "; print ""; print ""; print " "; print " "; // print " "; print ""; print ""; print "
Old Password
New Password
New Password again
"; print " "; print ""; print ""; print "
"; print ""; print "
"; print "
"; }//end if $Opasswd.$Npasswd1.$Npasswd2=="" }//end if Change else { //////////////////////// Log In (default) ///////////////////////// //echo ""; //FOR TESTING //print "In LogIn
\n"; $name=$_REQUEST['name']; $password=$_REQUEST['password']; $pswFile="NO_SYNC/weeklyList.psw"; $fp=fopen($pswFile,"r"); if (!$fp) {echo "

Unable to open remote file.

"; exit;} $NAME=trim(fgets($fp, 2048)); $PASSWD=trim(fgets($fp, 2048)); fclose($fp); if(!isset($name)&&!isset($password)) { //Visitor needs to enter a name and password // print "
"; print ""; print ""; print ""; print ""; print "

Please Log In
".$_REQUEST['Msg'];"

"; // print ""; print "
"; print ""; print " "; print " "; print ""; print ""; print " "; print " "; print ""; print ""; print " "; print "
Username
Password
"; print " "; print ""; print "
"; print ""; print "
"; print "
"; print "
"; print "
"; print "
"; }//if !name/password else if(strtolower($name)==$NAME&&strtolower($password)==$PASSWD) { // visitor's name and password combination are correct echo ""; // echo ""; }//else else { // visitor's name and password combination are not correct echo "

Invalid login/password

"; echo "You must provide a valid login and password to enter this site."; }// else }// end if showData //////////////////////// End of Code ///////////////////////// function loadDATA($inFile){ $fp=fopen($inFile,"r"); if (!$fp) {echo "

Unable to open remote file(".$inFile.").

"; exit;} $c=0; while (!feof($fp)) { $line = fgets($fp, 2048); $line=str_replace("\x92","'",$line); //workaround MS Word codes: apostrophe $line=str_replace("\x93","'",$line); // : open quote $line=str_replace("\x94","'",$line); // : close quote $line=str_replace("\x96","-",$line); // : double dash (em dash) $DATA[$c++]=$line; }//end while fclose($fp); return $DATA; }//end loadDATA function fixChars($str){ // $str=str_replace("\n","
",$str); // $str=str_replace("
","\n",$str); // $str=str_replace("ZZZ","\n",$str); $str=str_replace("
","\n",$str); $str=str_replace("\r","
",$str); $str=str_replace("\n","",$str); $str=str_replace("\"","'",$str); //workaround for \" $str=str_replace("\'","'",$str); //workaround for \' return $str; }//fixChars function request($arg){ //workaround for PHP 7.1.7 if(isset($_REQUEST[$arg]) && $_REQUEST[$arg]!="") return($_REQUEST[$arg]); else return(""); }//end request ?>