$Logid is not an authorized user of this script.


return to main page
"; exit; } if(!$Logid == "K4HM") {echo" Database Offline. Please try later";exit;} else {echo "Hello K4HM
";} unset ($auth); //require_once "inc_auth_chk.php"; $trace="on"; /* 8/18/2018 First Version completely self contained, no include or require statements read last 92 lines of application logfile display each application on a
line with a basic form Treasurere can copy/paste into new membersip page. 8/31/2018 Added auth check to access page Added includes for head, menu, and profile_table for inserting member 9/02/2018 Added check for duplicate userid on submission of new member Added lknk to check callsign in QRZ 9/21/2018 changed to only read 60 lines of logfile (last 20 entries) Modified includes to stop execution if not found Added default expire date and password Added include footer 12/01/2018 Added check for existing member when reading log file - skip if duplicate found Added link to previous version 1/24/2019 Added Maintenance Mode 3/04/2019 Changed musql_ to mysqli_ syntax per PHP7 3/27/2019 Added button edge buttons for profile editor and members only page Added payment method to line 6/7/2019 Added link to view the log file Changed title to Post New Member Application 7/16/2019 Changed expireation date constant to reflect 2020 expiration. 12/8/2019 Replaced constant value of $ExpireDate with calculation of expiration date. 3/28/2019 Rewrite the routine that reads the logfile to correct errors in fgetcsv that magically still worked Enlarged size of comments box due to a 2 paragraph entry on an application */ if (isset($trace)) {echo "Authorization verified
";} $maintMode="on"; if( (isset($maintMode)) && ($_SESSION['MemberNumber'] <> 1241) ) { //echo(" Member Number is [ ". $_SESSION['MemberNumber']. " ]
"); echo "System is currently down for maintenance.
Please try again later.

"; } else {echo ("
Maintenance Mode

"); } // Preset some parms: unset($title); $title=" - Post New Member Application"; // Set the Expire Date $year= date('Y') +1; $ExpireDate = $year."-06-30"; //$month = date('m'); echo "Month is $month
"; //if (month > '04') { $ExpireDate = $year."-04-30";; } if(isset($trace)) echo "
Expire date = $ExpireDate"; $logfile="application_logfile2.txt"; /* Log of applications that have been submitted online */ // TEST PARMS comment out for live functionality $TestTable ="ProfilesTst"; //if(isset($trace)) echo("
Requesting DB Table [$TestTable]
"); // For Testing -- comment out for live page if(!include("inc_prof_variables.php")) {Echo("Unable to read profile variables. Please notify the webmaster"); exit;} // ************************************************************************* // ** HERE IF THE USER ALREADY SELECTED AN APPLICATIOON TO BE PROCESSED ** // ************************************************************************* if(isset($trace)) echo"
\$mode is $mode
"; while (isset($mode) and ($mode == "update")) { // Validate Inputs if(isset($trace)) echo("

Mode=update - processing inputs
"); unset($mode); if(isset($trace)) echo("
mode = [$mode]
"); if(isset($trace)) alert("Checking for missing data fields"); $len=strlen($Userid); if (($len < 4) or ($len > 6)) { echo("

Invalid Userid - can not create profile.
Continue
10) { echo("

Invalid Expire Date - can not create profile.
Continue

Invalid Invalid Password - can not create profile.
Continue

Some required values were not provided - can not create profile.
Continue

Query = [$query]
"; $query_results=mysqli_query($link,$query); $match_results=mysqli_num_rows($query_results); if ($match_results > 0) { if(isset($trace)) {$alert="Profile ".$Userid." could not be added - PROFILE ALREADY EXISTS!"; alert($alert);} echo "

Profile $Userid can not be added because it already exists.
Continue

" ; exit; } else { if ($trace) {echo '';} require ("inc_profile_insert.php"); alert("User Profile Inserted"); // header("Location: ./admin.php"); } } if(isset($trace)) echo"


INITIAL ENTRY SCREEN
"; /* ######################## Initial Entry Screen #################### */ $head=" "; //echo "

checkpoint at 165
"; //exit; if(!include("head.html")) {Echo("Unable to read head of page. Please notify the webmaster"); exit;} // Initial entry - display the form if(isset($trace)) echo("
DB Table is $tablename
"); /* get the next member number to be used */ open_db(); $query="select max(membernumber) FROM $tablename"; $query_results=mysqli_query($link,$query); //echo "query results= [ $query_results ]
"; $match_results=mysqli_num_rows($link,$query_results); //echo "match results= [ $match_results ]
"; $row=mysqli_fetch_array($query_results); $HighMemberNumber = $row[0]; $NewMemberNumber=$HighMemberNumber + 1; $AccountNumber=$NewMemberNumber; if ($trace) { echo "High Member Number = [$HighMemberNumber]       New Member Number = [$NewMemberNumber]
Account Number = [$AccountNumber]
"; } $MemberNumber=$NewMemberNumber; $MemberType="Full"; //include("menu.html"); /* puts the menu under the title line */ if(!include("menu.html")) {Echo("Unable to read menu of page. Please notify the webmaster"); exit;} echo("RV Radio Network Pending Applications
The previous version is HERE           View the Application Log File
"); if(isset($trace)) echo "

Checkpoint 1"; //exit; // ********************************************************************* // ** Each entry consists of 2 lines followed by a blank line ** // ** Skip blank lines and get the date from the first line ** // ** Get data from application into an array of the second line ** // ********************************************************************* $logfile="application_logfile2.txt"; $templog="templog.txt"; /* Log of applications that have been submitted online */ $tail = shell_exec("tail -n 60 $logfile > $templog"); /* 60 = 20 records @ 3 lines per record */ $handle = fopen($templog, "r"); if (!$handle) { echo"

Could not open the Application Log File

"; exit; } else { if(isset($trace)) echo "

Application Log File Opened

"; } // echo nl2br( include($templog) ); //$log = shell_exec("tail -n 60 $logfile > $templog"); /* 60 = 20 records @ 3 lines per record */ $daysOfWeek = array("Sun ", "Mon ", "Tue ", "Wed ", "Thu ", "Fri ", "Sat "); $row = 1; while (($data = fgetcsv($handle, 500, ",")) !== FALSE) { $num = count($data); if(isset($trace)) echo "

$num fields in line $row:

\n"; $linelen=strlen($data[0]); if ($linelen < 3) continue; // CHECK FOR DATE LINE - WILL START WITH 3 CHARACTER DAY OF WEEK IN ARRAY $daysOfWeek $day=substr($data[0],0,4); // echo("[[$day]]"); if (in_array($day, $daysOfWeek)) { $summary=$data[0]; continue; /* read next line which includes the user-id for inclusion in the summary line */ } // CHECK to see if call is already in the database (already processed) $query= "select MemberNumber from $tablename where Userid = '" .$data[0]. "'"; $query_results=mysqli_query($link,$query); //echo "query results= [ $query_results ]
"; $match_results=mysqli_num_rows($query_results); //echo "match results= [ $match_results ] for $data[0]
"; if ($match_results > 0 ) continue; // Already in DB so skip to next entry // Print the info from the application echo "
$data[0] -     $data[16]   $summary "; // $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $UserPassword = substr( str_shuffle( $chars ), 0, 8 ); $MemberType = "Full"; $Userid=$data[0]; $FName=$data[1]; $LName=$data[2]; $Homephone=$data[3]."-".$data[4]."-".$data[5]; $Email=$data[6]; $Street=$data[7]; $City=$data[8]; $State=$data[9]; $Zip=$data[10]; $SP_FName=$data[11]; $SP_Userid=$data[12]; if ($data[13] == "Yes") { $ARRL="Y"; } else { $ARRL="N"; } $method=$data[16]; echo "Account Number is [$AccountNumber]
"; $emailBody="%0D%0AHello $FName, $Userid,%0D%0A %0D%0AWelcome to the RV Radio Network. Your Member Profile has been added to the Membership Database.%0D%0AYour User-ID is $Userid and your temporary personal password is: $UserPassword %0D%0A Please log in to the Members Only page and change your password to suit your preference.%0D%0A%0D%0AWhile you are in the Members Only section, go to the My Profile page and click the My Profile link where you can verify the information in your profile is correct.%0D%0A%0D%0APlease join us on our club sponsored nets: %0D%0A --> Nightly Sunday - Friday at 6:00 PM Central time on 7264 KHz ( +/- 10 KHz )%0D%0A -->Thursday Evening EchoLink Net on the *SELINK* Conference Node %0D%0A %0D%0A See https://rvradionetwork.com for details about our nets and rallies. %0D%0A %0D%0A I look forward to hearing you on the nets and meeting you at a rally.%0D%0A%0D%0A 73,%0D%0A%0D%0A"; /* $lineout2 = "\"$Call\",\"$FName\",\"$LName\",\"$AreaCode\",\"$Exchange\",\"$Nnnn\",\"$Email\",\"$Address\",\"$City\",\"$State\",\"$Zip\",\"$Spouse\",\"$S_Call\",\"$ARRL\",\"$how\",\"$Comments\""; */ ?>

RV RADIO NETWORK NEW MEMBERSHIP APPLICATION FORM
NOW USING THE LIVE DATABASE


How did you find out about us?
Comments/Questions
Check QRZ for callsign: " target="_blank">
Send Email to $Email"); ?>
"; Echo "
"; } // end while fclose($handle); ?>