<?php require_once "cmsAdmin/lib/viewer_functions.php";
 ?>
 
<?php if (!@$GLOBALS['WEBSITE_MEMBERSHIP_PLUGIN']) { die("You must activate the Website Membership plugin before you can access this page."); } ?>
<?php

  $showSignupForm = true;

  // error checking
  if (@$CURRENT_USER) {
    $errorsAndAlerts = "You are already signed up! <a href='{$GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL']}'>Click here to continue</a>.";
    $showSignupForm = false;
  }

  // process form
  if (@$_REQUEST['save']) {

    // error checking
    $errorsAndAlerts = "";
	if (!@$_REQUEST['first_name'])                { $errorsAndAlerts .= "You must enter your first name!<br/>\n"; }
	if (!@$_REQUEST['last_name'])                { $errorsAndAlerts .= "You must enter your last name!<br/>\n"; }
    if (!@$_REQUEST['email'])                   { $errorsAndAlerts .= "You must enter your email!<br/>\n"; }
    else if(!isValidEmail(@$_REQUEST['email'])) { $errorsAndAlerts .= "Please enter a valid email (example: user@example.com)<br/>\n"; }
    if (!@$_REQUEST['username'])                { $errorsAndAlerts .= "You must choose a username!<br/>\n"; }

    // check for duplicate usernames and emails
    if (!$errorsAndAlerts) {
      $count = mysql_select_count_from('accounts', "`username` = '".mysql_escape(@$_REQUEST['username'])."'");
      if ($count > 0 && @$_REQUEST['username']) { $errorsAndAlerts .= "That username is already in use, please choose another!<br/>\n"; }

      $count = mysql_select_count_from('accounts', "'".mysql_escape($_REQUEST['email'])."' IN (email, username)");
      if ($count > 0) { $errorsAndAlerts .= "That email is already in use, please choose another!<br/>\n"; }
    }

    // turn off strict mysql error checking for: STRICT_ALL_TABLES
    mysqlStrictMode(false); // disable Mysql strict errors for when a field isn't defined below (can be caused when fields are added later)

    // add user
    if (!$errorsAndAlerts) {
      $_REQUEST['password'] = substr(md5(uniqid(rand(), true)), 15); // example output: c5560251ef0b3eef9

      mysql_query("INSERT INTO `{$TABLE_PREFIX}accounts` SET
                      first_name         = '".mysql_escape( $_REQUEST['first_name'] )."',
					  middle_initial         = '".mysql_escape( $_REQUEST['middle_initial'] )."',
					  last_name         = '".mysql_escape( $_REQUEST['last_name'] )."',
					  email            = '".mysql_escape( $_REQUEST['email'] )."',	 
					  web_site         = '".mysql_escape( $_REQUEST['web_site'] )."',
                      username         = '".mysql_escape( $_REQUEST['username'] )."',
					  password         = '".mysql_escape( $_REQUEST['password'] )."',
					  street_address         = '".mysql_escape( $_REQUEST['street_address'] )."',
					  city         = '".mysql_escape( $_REQUEST['city'] )."',
					  state         = '".mysql_escape( $_REQUEST['state'] )."',
					  zip         = '".mysql_escape( $_REQUEST['zip'] )."',
					  day_phone         = '".mysql_escape( $_REQUEST['day_phone'] )."', 
					  evening_phone         = '".mysql_escape( $_REQUEST['evening_phone'] )."', 
					  cell_phone         = '".mysql_escape( $_REQUEST['cell_phone'] )."',
			          describe_discipline        = '".mysql_escape( $_REQUEST['describe_discipline'] )."',
					  discipline         = '".mysql_escape( $_REQUEST['discipline'] )."', 
					  discipline_code         = '".mysql_escape( $_REQUEST['discipline_code'] )."',
					  describe_accomplishments            = '".mysql_escape( $_REQUEST['describe_accomplishments'] )."',
                      view_where         = '".mysql_escape( $_REQUEST['view_where'] )."',
                      not_artist         = '".mysql_escape( $_REQUEST['not_artist'] )."',
					  AllowedFolders = 'member_access',
                      disabled         = '0',
					  approved         = '0',
                      isAdmin          = '0',
                      expiresDate      = '0000-00-00 00:00:00',
                      neverExpires     = '1',
                      createdDate      = NOW(),
                      updatedDate      = NOW(),
                      createdByUserNum = '0',
                      updatedByUserNum = '0'")
      or die("MySQL Error Creating Record:<br/>\n". htmlspecialchars(mysql_error()) . "\n");
      $userNum = mysql_insert_id();

      // create accesslist entry
      // replace '_sample' with the table you want the user to access
      // replace '6' with the access level they should have: 0=none, 6=author, 9=editor
      // replace '1' with the max listings they are allowed
      mysql_query("INSERT INTO `{$TABLE_PREFIX}_accesslist`
                               (userNum,  tableName,        accessLevel, maxRecords, randomSaveId)
                        VALUES ($userNum, 'all',            '1',         NULL,       '1234567890'),
                               ($userNum, '_sample',        '6',         1,          '1234567890'),
                               ($userNum, '_sample',        '6',         1,          '1234567890'),
                               ($userNum, '_sample',        '6',         1,          '1234567890')") or die("MySQL Error Creating Access List:<br/>\n". htmlspecialchars(mysql_error()) . "\n");

      //
      _websiteLogin_sendSignupMessage();
      $errorsAndAlerts  = "Thanks, We've created an account for you. As soon as your membership is successfully processed we'll mail you your password.<br/><br/>\n";
      $errorsAndAlerts .= "The approval process is handled by our membership committee.<br/><br/>\n";
	   $errorsAndAlerts .= "If you haven't received an email from us within a few days check your spam filter for messages from {$SETTINGS['adminEmail']}<br/><br/>\n";
     

      $_REQUEST        = array(); // clear form values
      $showSignupForm  = false;
    }
  }

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!-- saved from url=(0013)about:internet -->
		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
		<meta name="generator" content="Adobe GoLive" />
		<title>Welcome to the Artists of Palm Beach County - Membership Sign Up</title>
		<link href="css/apbc900.css" type="text/css" rel="stylesheet" media="all" />
  <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

	<body bgcolor="#9b97ad"><?php 
	require 'emailcode.class.php'; 
	$emailcode = new ClassEmailcode();?>
	    	
    
		<table bgcolor="#7C7164" align="center" width="1085" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0','height','180','width','100%','pluginspage','http://www.macromedia.com/go/getflashplayer','src','images/masthead','wmode','transparent','quality','best','play','true','movie','images/masthead' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="180" width="100%">
								<param name="movie" value="images/masthead.swf" />
								<param name="quality" value="best" />
								<param name="play" value="true" />
								<param name="wmode" value="transparent" />
								<embed height="188" pluginspage="http://www.macromedia.com/go/getflashplayer" src="images/masthead.swf" type="application/x-shockwave-flash" width="100%" wmode="transparent" quality="best" play="true"></embed> 
							</object></noscript>
			</td>
  </tr>
</table>

<table align="center" width="1085" border="0" cellspacing="0" cellpadding="20">
<tr>
					<td valign="top" rowspan="3" width="107" bgcolor="#66594b" ><table  width="107"  border="0" cellspacing="0"  cellpadding="4" height="600">
                      <tr>
                        <td align="left" valign="top"><p>&nbsp;</p>
                            </td>
                      </tr>
                    </table>
					  
    <br /><br /> </td>
					
					<td valign="top" align="center" bgcolor="#7C7164"  >
					  
                          <div align="left">
					
					            <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0','height','70','width','100%','pluginspage','http://www.macromedia.com/go/getflashplayer','src','images/headlines/becomehead','wmode','transparent','quality','best','play','true','movie','images/headlines/becomehead' ); //end AC code
                                </script>
					            <noscript>
					            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="70" width="100%" >
                                  <param name="movie" value="images/headlines/becomehead.swf" />
                                  <param name="quality" value="best" />
                                  <param name="play" value="true" />
                                  <param name="wmode" value="transparent" />
                                  <embed height="70" pluginspage="http://www.macromedia.com/go/getflashplayer" src="images/headlines/becomehead.swf" type="application/x-shockwave-flash" width="100%" wmode="transparent" quality="best" play="true"></embed>
                                </object>
					            </noscript>
                          

                           <div align="left">
                          
                           <h3 class="title-text" align="center">JUST ONE MORE STEP TO MEMBERSHIP</h3>
                           <span class="body-text">Please fill out the  form below and click on the submit button.<br /><br />
                           Your membership request will be reviewed by our membership committee and you'll receive a confirmation e-mail<br />with your temporary password and login instructions.<br /><br />
                           Remember, if you haven't paid your first year's dues, your membership application cannot be processed.<br />
                           </span>                           <a class="special" href="http://www.artistsofpalmbeachcounty.org/paypal2.php">CLICK HERE IF YOU'D LIKE TO PAY YOUR DUES ON-LINE NOW</a><br /><br />
                           <span class="body-text-bold">If you've paid by check, please allow at least a week for the check to clear before expecting your confirmation e-mail.</span><br /><br />
                           <span class="body-text-bold">Questions? &nbsp; </span><a class="special" href="http://www.artistsofpalmbeachcounty.org/contact.php">CLICK HERE TO CONTACT US</a><br />
                           <br />
                           <!-- USER SIGNUP FORM -->
                           <?php if (@$errorsAndAlerts): ?>
                            </div>
                      <div style="color: #FDE87C; font-weight: bold; font-size: 14px; font: Verdana, Arial, Helvetica, sans-serif; ">
                       <br /><br />
                      <?php echo $errorsAndAlerts; ?><br/>
                         </div>
                      
                               
  <?php endif ?>
                                  
  <?php if ($showSignupForm): ?>
                                                          
                      <form method="post" action="?" >
                                                
                                                        <input type="hidden" name="save" value="1" />
                                                                  
                                                        <table border="0" cellspacing="0" cellpadding="5">
                                                                    
                                                          <tr>
                                                            <td colspan="2" class="jwaddress-bar">PLEASE TELL US A LITTLE ABOUT YOU.</td>
                                                          </tr>
                                                          <tr>
                                                            <td width="486" class="body-text-bold">First Name</td>
        <td width="392"><input type="text" name="first_name" value="<?php echo htmlspecialchars(@$_REQUEST['first_name']); ?>" size="50" /></td>
       </tr>
       <tr>
                                                            <td class="body-text-bold">Middle Initial (optional)&nbsp;</td>
        <td><input type="text" name="middle_initial" value="<?php echo htmlspecialchars(@$_REQUEST['middle_initial']); ?>" MAXLENGTH="1" size="3" /></td>
       </tr>
                                                          <tr>
                                                            <td class="body-text-bold">Last Name</td>
        <td><input type="text" name="last_name" value="<?php echo htmlspecialchars(@$_REQUEST['last_name']); ?>" size="50" /></td>
       </tr>
        <tr>
          <td class="body-text-bold">Street_Address</td>
      <td><input type="text" name="street_address" value="<?php echo htmlspecialchars(@$_REQUEST['street_address']); ?>" size="50" /></td>
     </tr>
     <tr>
          <td class="body-text-bold">City</td>
      <td><input type="text" name="city" value="<?php echo htmlspecialchars(@$_REQUEST['city']); ?>" size="50" /></td>
     </tr>
     <tr>  
          <td class="body-text-bold">State<?php @$_REQUEST['state'] = strtoupper(@$_REQUEST['state']); ?></td>  
      <td><input type="text" name="state" value="<?php echo htmlspecialchars(@$_REQUEST['state']); ?>" MAXLENGTH="2" size="50" /></td>  
     </tr>
     <tr>
          <td class="body-text-bold">Zip Code</td>
      <td><input type="text" name="zip" value="<?php echo htmlspecialchars(@$_REQUEST['zip']); ?>" MAXLENGTH="10" size="50" /></td>
     </tr>
                                                         
                                                        
                                                          <tr>
                                                            <td class="body-text-bold">Day Phone</td>
                                                            <td><input type="text" name="day_phone" value="<?php echo htmlspecialchars(@$_REQUEST['day_phone']); ?>" size="50" /></td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold">Evening Phone</td>
                                                            <td><input type="text" name="evening_phone" value="<?php echo htmlspecialchars(@$_REQUEST['evening_phone']); ?>" size="50" /></td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold">Cell Phone</td>
                                                            <td><input type="text" name="cell_phone" value="<?php echo htmlspecialchars(@$_REQUEST['cell_phone']); ?>" size="50" /></td>
                                                          </tr>
                                                          <tr>
                                                            <td colspan="2" class="body-text-bold">&nbsp;</td>
                                                          </tr>
                                                            <tr>
                                                            <td class="body-text-bold">Choose a temporary Username</td>
        <td><input type="text" name="username" value="<?php echo htmlspecialchars(@$_REQUEST['username']); ?>" size="50" /></td>
       </tr>
                                                          <tr>
                                                            <td colspan="2" class="body-text-bold">&nbsp;</td>
                                                          </tr>
                                                          <tr>
                                                            <td colspan="2" class="jwbold-text">THIS WILL BE INCLUDED IN OUR ON-LINE MEMBER'S DIRECTORY, ALONG WITH YOUR NAME.</td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold">Email</td>
        <td><input type="text" name="email" value="<?php echo htmlspecialchars(@$_REQUEST['email']); ?>" size="50" /></td>
       </tr>
       <tr>
              <td class="body-text-bold"><p>Web Site (Optional)</p>
              </td>
                                                            <td><input type="text" name="web_site" value="<?php echo htmlspecialchars(@$_REQUEST['web_site']); ?>" size="50" /></td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold"><p>List  the artisitic mediums in which you work - I.E.: Writer, Poet, Painter, etc.  - 
                                                            NOT AN ARTISTS STATEMENT</p>
                                                              </td>
                                                            <td><input type="text" name="discipline" value="<?php echo htmlspecialchars(@$_REQUEST['discipline']); ?>" size="50" /></td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold">Artisitc discipline Code - Single Letter, CAPS please, no spaces<br />
                                                              V = Visual, M = Media, P = Performance, L = Literary, O = Other</td>
                                                            <td><input type="text"  name="discipline_code" value="<?php echo htmlspecialchars(@$_REQUEST['discipline_code']); ?>" size="50" /></td>
                                                          </tr>
                                                          <tr>
                                                            <td colspan="2" class="body-text-bold">&nbsp;</td>
                                                          </tr>
                                                          <tr>
                                                            <td colspan="2" class="jwbold-text">THIS INFORMATION WILL HELP THE MEMBERSHIP COMMITTEE TO GET TO KNOW YOU BETTER.</td>
                                                          </tr>
                                                           <tr>
                                                            <td class="body-text-bold">Describe your Artistic Discipline</td>
                                                            <td><TEXTAREA NAME="describe_discipline" COLS=50 ROWS=6 value="<?php echo htmlspecialchars(@$_REQUEST['desctribe_discipline']); ?>"></TEXTAREA>                                                          </td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold"><p>Describe any awards, prizes, grants, or significant accomplishments.</p>
                                                            </td>
                                                            <td><TEXTAREA NAME="describe_accomplishments" COLS=50 ROWS=6 value="<?php echo htmlspecialchars(@$_REQUEST['describe_accomplishments']); ?>"></TEXTAREA></td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold"><p>How/where may our members view, observe, or otherwise enjoy your work?</p>
                                                            </td>
                                                            <td><TEXTAREA NAME="view_where" COLS=50 ROWS=6 value="<?php echo htmlspecialchars(@$_REQUEST['view-where']); ?>"></TEXTAREA></td>
                                                          </tr>
                                                          <tr>
                                                            <td class="body-text-bold"><p>If you are not an artist but wish to join this organization, describe your reasons here.</p>
                                                            </td>
                                                            <td><TEXTAREA NAME="not_artist" COLS=50 ROWS=6 value="<?php echo htmlspecialchars(@$_REQUEST['not_artist']); ?>"></TEXTAREA></td>
                                                          </tr>
                                                         
                   
                   
                   
                
                                                          <tr>
                                                            <td  valign="top">&nbsp;</td>
                                                            <td>&nbsp;</td>
                                                          </tr>
                                                          <tr>
                     <td  valign="top"><span class="body-text-bold">Image Verification</span><br />
                     <span class="body-text">To help prove that you're a human, please type the characters in the image into the blank box before you click on submit.</span> <a href="/captcha/whatisturing.html" onclick="window.open('/captcha/whatisturing.html','_blank','width=300, height=300, left=' + (screen.width-450) + ', top=100');return false;">What's This?</a></td>
                     <td>
                     
                     <table cellpadding=5 cellspacing=0 bgcolor="#7C7164">


<tr>
<td style="padding: 5px;" width="300" height="100"><img src="/captcha/captchac_code.php" id="captcha"><br /><a href="#" onclick=" document.getElementById('captcha').src = document.getElementById('captcha').src + '?' + (new Date()).getMilliseconds()">Click to Change Image</a><br /></td>
</tr>
<tr>
  <td style="padding: 5px;"><input type="text" name="Turing" value="" maxlength="100" size="20" />
    <br />
    <br />    </td>
</tr>
</table></td></tr>
                   
                   
                   
                                                                    
                                                          <tr>
                                                            <td colspan="2" align="center">
                                                              <br/><input class="button" type="submit" name="submit" value="Click to Submit &gt;&gt;" />                                                            </td>
       </tr>
                                                        </table>
                        
                      </form>
                               
                                  <?php endif ?>
                                  <br /> 
                                  <span class="body-text">By submitting this form you agree to abide by all the terms and conditions of membership to Artists of Palm Beach County.</span><br /><a class="special" href="http://www.artistsofpalmbeachcounty.org/webterms.php">CLICK HERE TO READ OUR TERMS</a> 
                                  <!-- /USER SIGNUP FORM -->     
              </div></td>
  </tr>
			</table>
	
<p></p>

</body>

</html>