$v){ $I=explode(",",$index);$i=$I[0]; //get key if ($index==$i.",".$tgs[0]){ $WS[$i]=$DATA[$i.",".$tgs[1]].", ".$DATA[$i.",".$tgs[4]].", ".$DATA[$i.",".$tgs[3]]; $MAX[$i]=$DATA[$i.",".$tgs[9]]; }//end if index }//foreach DATA print "Workshop Form"; ?> "; print "
"; print " "; print "
"; //////////////////////// show pay page (final page) ///////////////////////// if ($NAME!=""){getPay($WORKSHOP,$NAME,$ADDR,$PHONE,$EMAIL);} else if($_REQUEST['descWS']!=""){ $descWS=$_REQUEST['descWS']; print $DATA[$descWS.",description"]."
"; print "
Return"; }//end else if else { ?> Workshops are available on a 1st come, 1st served basis. To reserve a place, please send a donation of $10 or more, and your place will be reserved.

"; print"
"; print" "; print"
"; print" "; print "
"; print "
"; print "
"; // getDesc($WORKSHOP); if ($WORKSHOP>0){ // print $DATA[$WORKSHOP.",".$tgs[7]]; //description print $WS[$WORKSHOP]; //description print "
Max Enrollment: $MAX[$WORKSHOP] (".getCount($WORKSHOP)." seats left)
"; print "Details"; }//if WORKSHOP getForm($WORKSHOP,$NAME); print "
"; }//end else function getForm($num){ if($num>0){ print "
"; print ""; print ""; print ""; print ""; print ""; print " "; print "
Save your spot now:
Name"; print "
Address"; print "
Phone No."; print "
Email "; print "
"; }//end if n>0 }//end getForm function getPay($ws,$NAME,$ADDR,$PHONE,$EMAIL){ global $WS; if (getCount($ws)>0){ $textAddr="3372549695@txt.att.net"; $emailAddr="festivalwords@gmail.com"; $textMsg="NAME=$NAME\nAddress=$ADDR\nPhone=$PHONE\nE-mail=$EMAIL\nWorkshop=#$ws"; $emailMsg="NAME=$NAME\nAddress=$ADDR\nPhone=$PHONE\nE-mail=$EMAIL\nWorkshop="; // $emailMsg=$emailMsg.$WS[$ws]."\r\n\r\n".getData(); $emailMsg=$emailMsg.$WS[$ws]; $emailMsg=$emailMsg."\r\nhttp://c-bruce-snow.com/OTHER/FESTIVALOFWORDS/getWorkshops.php"; $subject="Resrvation for ".$WS[$ws]; mail($textAddr,$subject, $textMsg); mail($emailAddr,$subject, $emailMsg); $textAddr="3377395769@messaging.sprintpcs.com"; $emailAddr="FoW_workshop@brucesnow.us"; // mail($textAddr, $subject, $textMsg); mail($emailAddr,$subject, $emailMsg); $TS=date('Y/m/d-H:i:s',strtotime("now")); $txt=$ws."|".$TS."|".$WS[$ws]."|".$NAME."|".$ADDR."|".$PHONE."|".$EMAIL."|"; if (checkName($ws,$NAME)==0){ saveData($txt); $str="Hold your Place with Your Donation.
$NAME for ".$WS[$ws]; }else{$str="$NAME has already signed up for ".$WS[$ws];} }//end if getCount else {$str="Sorry, that workshop is full.";} print "
"; print ""; ?>

$str

Donate now! ($10 or more)

Or Mail a check:
P.O. Box 252
Grand Coteau, LA 70541

Return to Home
Unable to open remote file(".$savFile.").

"; exit;} while (!feof($fp)) { $line = fgets($fp, 2048); $L=explode('|', $line); $DATA[++$c]=$L[3]."; ".$L[2]; }//end while fclose($fp); for ($i=0;$iUnable to open remote file(".$savFile.").

"; exit;} $c=0; while (!feof($fp)) { $line = fgets($fp, 2048); $L=explode('|', $line); if ($L[3]==$name&&$L[0]==$ws)++$c; }//end while fclose($fp); return $c; }// checkName function getCount($num){ global $savFile,$MAX; $fp=fopen($savFile,"r"); if (!$fp) {echo "

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

"; exit;} $c=0; while (!feof($fp)) { $line = fgets($fp, 2048); $L=explode('|', $line); if ($L[0]==$num)++$c; }//end while fclose($fp); return $MAX[$num]-$c; }//end getCount function saveData($txt){ global $datFile,$savFile; $txt=fixChars($txt); $outFile=fopen($savFile,'a') or die("Cannot open ".$savFile); fwrite($outFile,$txt."\n"); fclose($outFile); $TS=date('Ymd_H_i_s',filemtime($datFile)); //make timestamp from inFile Mtime $buFile=$datFile."_".$TS; //create backup name copy($datFile,$buFile); //copy to backup $str=""; // echo ""; }//end saveData function getDesc($n){ global $WS,$MAX; if ($n==1){ print "
$WS[$n]
"; print "Max Enrollment: $MAX[$n] (".getCount($n)." seats left)
"; print "Details"; }// end if 1 if ($n==2){ print "
$WS[$n]
"; print "Max Enrollment: $MAX[$n] (".getCount($n)." seats left)
"; print "
Details"; }// end if 2 if ($n==3){ print "
$WS[$n]
"; print "Max Enrollment: $MAX[$n] (".getCount($n)." seats left)
"; print "
Details"; }// end if 3 }// end getDesc function fixChars($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; }//end fixChars function descWS1(){ ?> Poetry Workshop
Eva Leavell Haymon
Join Eva Leavell Haymon for an afternoon of inspiration as you explore poetry and create your own works.

Saturday, November 8, 2014
1:00 p.m. to 2:50 p.m.
St. Charles Chapel, 252-A, Church St., Grand Coteau, LA 70541
"; print" "; print"

\n"; print"\n"; }//end descWS1 function descWS2(){ ?> Fiction Workshop
Luis Alberto Urrea
This fiction workshop will explore the concept of "yearning" and what drives a character to reach or try to obtain what cannot be obtained. Bring pen and paper, and be ready for an enjoyable afternoon of writing and sharing with Luis Alberto Urrea.

Saturday, November 8, 2014
3:00 p.m. to 4:50 p.m.
St. Charles Chapel, 252-A, Church St., Grand Coteau, LA 70541
"; print" "; print"

\n"; print"\n"; }//end descWS2 function descWS3(){ ?> Poetry Workshop
Anderson Dovilas
A hands-on poetry workshop for both beginners and more experienced writers. Just bring pen/pencil/paper/laptop or whatever you write on, and a willingness to explore memory and dream. We might even try playing with a traditional form reshaped for our time and place.

Saturday, November 8, 2014
1:00 p.m. to 2:50 p.m.
St. Charles Chapel, 252-A, Church St., Grand Coteau, LA 70541
"; print" "; print"

\n"; print"\n"; }//end descWS3 function loadDATA($inFile,$tags,$marker,$key){ $c=0; $fp=fopen($inFile,"r"); if (!$fp) {echo "

Unable to open remote file.

"; exit;} while (!feof($fp)) { $line = fgets($fp, 2048); for ($i=0;$i")){ list($j,$k)=explode("<".$tags[$i].">",$line); list($l,$m)=explode("<\/".$tags[$i].">",$k); $l=rtrim($l); #note: explode works diferently than strip $l=preg_replace('/<[^>]*>/', '', $l); #get rid of tag ('<...>') $A[$tags[$i]]=$l; }//if strstr }//for if (strstr($line,"")){ //add 2-dimension key to array for ($i=0;$i