<?php // This sends emails to the approriate individuals - page styling, jurying warnings and email tally working on submit tally

// blank img code is on line 454


  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
 $dirsToCheck = array('/hsphere/local/home/apbcweb/artistsofpalmbeachcounty.org/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
  if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); }
  list($common_informationRecords, $common_informationMetaData) = getRecords(array(
    'tableName'   => 'common_information',
    'allowSearch' => '0',
    'limit'       => '1',
	// 'debugSql' => true, 
  ));
  $common_informationRecord = @$common_informationRecords[0]; // get first record

  ?>
<?php         
list($master_exhibition_listRecords, $master_exhibition_listMetaData) = getRecords(array(
'tableName' => 'master_exhibition_list',

));
list($e_blast_events_noticeRecords, $e_blast_events_noticeMetaData) = getRecords(array(
    'tableName'   => 'e_blast_events_notice',
 
  ));
?>
<?php   
$numToName = array(); 
foreach ($master_exhibition_listRecords as $record){ 
  $numToName[$record['num']] = $record['title']; 


}
?>

<!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>
		
		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
		
		<title>Welcome to the Artists of Palm Beach County - Terms and Conditions</title>
		<link href="css/apbc900.css" type="text/css" rel="stylesheet" media="all" />
        <style type="text/css">
a.webterms:link { font-family:Verdana; color: #ffffff; font-size: 0.68em; font-weight: bold; text-decoration: none;}
a.webterms:visited { font-family:Verdana; color: #ffffff; font-size: 0.68em; font-weight: bold; text-decoration: none;}
a.webterms:hover { font-family:Verdana; color: #ffffff; font-size: 0.68em; font-weight: bold; text-decoration: none; }
a.webterms:active { font-family:Verdana; color: #ffffff; font-size: 0.68em; font-weight: bold; text-decoration: none;}
</style>
       <link rel="stylesheet" type="text/css" href="css/anylinkcssmenu.css" />
<script type="text/javascript" src="Scripts/anylinkcssmenu.js">

/***********************************************
* AnyLink CSS Menu script v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm for full source code
***********************************************/

</script>
	<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>


	<body bgcolor="#9b97ad">	    	
    <?php
    function mobile_detection ()
{
	if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))
		return true;
 if (isset ($_SERVER['HTTP_ACCEPT']))
	{
		$accept = strtolower($_SERVER['HTTP_ACCEPT']);
		if (strpos($accept, 'wap') !== false)
			return true;
	}

	if (isset ($_SERVER['HTTP_USER_AGENT']))
	{
			if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Android') !== false)
			return true;
			
			if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false)
			return true;
			
			if (strpos ($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false)
			return true;
			if (strpos ($_SERVER['HTTP_USER_AGENT'], 'ipad') !== false)
			return true;
			if (strpos ($_SERVER['HTTP_USER_AGENT'], 'iPod') !== false)
			return true;


		if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false)
			return true;
	}

	return false;
}
    ?>
		<table bgcolor="#7C7164" align="center" width="1085" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left">
	<?php if (mobile_detection()) : ?>
<img src="images/APBC-LOGO.png" width="800" height="183" />
<?PHP else: ?>
<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' );
</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>
                            
<?PHP endif ?>
			</td>
  </tr>
</table>

<table align="center" width="1085" border="0" cellspacing="0" cellpadding="20">
<tr>
					<td valign="top" rowspan="3" width="107" bgcolor="#66594b" ><!-- #BeginLibraryItem "/Library/LeftNav.lbi" -->
<table  width="107"  border="0" cellspacing="0"  cellpadding="4" height="600" >
  <tr>
    <td align="left" valign="top"><p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p class="special-non-link">
        <?php if (mobile_detection()) : ?>
        Tap To<br />Expand<br />Menus
        <?PHP else: ?>
        Rollover<br />To Expand<br />Menus
        <?PHP endif ?>
      </p>
      <p><a href="http://www.artistsofpalmbeachcounty.org/index.php">Home </a></p>
      <p><a href="#" class="anchorclass" rel="submenu1<?php if (mobile_detection()) : ?>[click]<?PHP endif ?>" rev="lr">About&nbsp;&nbsp;&nbsp;<img src="http://www.artistsofpalmbeachcounty.org/images/pointer2.gif" style="border-width:0;  position:relative; left: 0px; top:2px" /><br />
        APBC</a></p>
      <div id="submenu1" class="anylinkcss">
        <ul>
          <li><a href="http://www.artistsofpalmbeachcounty.org/whoweare.php">Who We Are</a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/boardofdirectors.php">Board of<br />
            &nbsp;Directors</a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/committees.php">Committees</a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/bylaws.php">By-Laws</a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/pdf/2007-bylaws.pdf">By-Laws (PDF)</a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/ourmission.php">Mission<br />
            &nbsp;Statement</a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/history.php">History</a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/webterms.php">Terms of<br />
            &nbsp;Service</a></li>
        </ul>
      </div>
      <p> <a  href="http://www.artistsofpalmbeachcounty.org/artists.php">APBC Artists</a></p>
      <p><a href="#" class="anchorclass" rel="submenu2<?php if (mobile_detection()) : ?>[click]<?PHP endif ?>" rev="lr">Meetings&nbsp;&nbsp;&nbsp;<img src="http://www.artistsofpalmbeachcounty.org/images/pointer2.gif" style="border-width:0;  position:relative; left: 0px; top:2px" /></a></p>
      <div id="submenu2" class="anylinkcss">
        <ul>
          <li><a href="http://www.artistsofpalmbeachcounty.org/meetings.php"><?php echo $common_informationRecord['member_meetings'] ?></a></li>
          <li><a href="http://www.artistsofpalmbeachcounty.org/boardmeetings.php">Board Meetings</a></li>
        </ul>
      </div>
      <p><a href="http://www.artistsofpalmbeachcounty.org/events.php">What's Happening Now!</a></p>
      <p><a href="http://www.artistsofpalmbeachcounty.org/special-events.php"  >Special Events</a></p>
      <p><a href="http://www.artistsofpalmbeachcounty.org/photographerscorner.php" >Photographer's Corner</a></p>
      <p><a href="http://www.artistsofpalmbeachcounty.org/writerscorner.php"  >Writer's Corner</a></p>
    
        <p><a href="http://www.artistsofpalmbeachcounty.org/becomeamember.php"  >Become a<br />
          member</a></p>
        <p><a href="#" class="anchorclass" rel="submenu3<?php if (mobile_detection()) : ?>[click]<?PHP endif ?>" rev="lr">Members&nbsp;&nbsp;&nbsp;<img src="http://www.artistsofpalmbeachcounty.org/images/pointer2.gif" style="border-width:0;  position:relative; left: 0px; top:2px" /><br />
          Only</a></p>
        <div id="submenu3" class="anylinkcss">
          <ul>
            <li><a href="http://www.artistsofpalmbeachcounty.org/access_menu.php">Access to Members Only Pages</a></li>
            <li><a href="http://www.artistsofpalmbeachcounty.org/member_reminder.php">Forget Your Login Info?</a></li>
            <li><a href="http://www.artistsofpalmbeachcounty.org/specialwebpage.php">Get a Personal<br />
              &nbsp;Web Page</a></li>
          </ul>
        </div>
        <p><a href="http://www.artistsofpalmbeachcounty.org/membersblogs.php"  >Member's<br />
          Blogs</a></p>
        <p><a href="http://www.artistsofpalmbeachcounty.org/pastevents.php">Past Event<br />
          Image Galleries</a></p>
        <p><a href="http://www.artistsofpalmbeachcounty.org/artavox.php">Artavox 2009<br />
          &nbsp;Presentation</a></p>
        <p><a href="http://www.artistsofpalmbeachcounty.org/contributors.php"  >Supporters</a></p>
        <p><a href="http://www.artistsofpalmbeachcounty.org/resources.php"  >Resources</a></p>
        <p><a href="http://www.artistsofpalmbeachcounty.org/contact.php"  >Contact Us</a></p>
        <p><a href="http://www.artistsofpalmbeachcounty.org/faq.php"  >FAQ</a></p>
        <p><a href="http://www.facebook.com/pages/Artists-of-Palm-Beach-County/124543357559891" target="_blank" > <img src="http://www.artistsofpalmbeachcounty.org/images/facebook.gif" width="92"  alt="Facebook" /></a></p>
      </td>
  </tr>
</table>
<table width="107"  border="0" cellspacing="0"  cellpadding="4" >
  <tr>
    <td valign="bottom"><br />
      <div align="left" >&nbsp;</div></td>
  </tr>
</table>
<!-- #EndLibraryItem --><br /><br /> </td>
					
					<td valign="top" align="center" bgcolor="#7C7164"  >
					
					
					            <div align="center">
					              <h2 class="heading-text-bold">TEST - EXHIBITION ACCEPTANCE EMAILS - TEST</h2></div>
<?php if (@$CURRENT_USER['isAdmin'] || strpos(@$CURRENT_USER['allowedFolders'], 'exhibition_manager')): ?>
<!--<div align="left"><span class="heading-text-bold">You can only send acceptance/rejection emails to exhibition entrants after that <br />
exhibition's jurying has ended, and on or before before the Artists Notification date.<br /></span></div><br />--><br /><br />
<div align="left">

<?php if(@isset($_REQUEST['submit_count'])){ 
	$count = $_REQUEST['submit_count'] + 1; 
}else{ 
	$count = 0; 
} 
 
?> 
<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<input name="submit_count" type="hidden" value="<?php echo $count; ?>" /> 
  <select name="where">
    <option value="">Select an Exhibition</option>
    <?php foreach($numToName as $num => $name): ?>
    <option value="<?php echo $num;?>"><?php echo $name;?></option>
    <?php endforeach?>
  </select><br /><br />
     
                  <input type = "checkbox" id="send_this" name="send_this" value = "1" <?php checkedIf(1, @$_REQUEST['send_this']);?> />
                   <label for='send_this'> <span class="body-text-bold">Check This Box When You're Ready To Send Emails</span>&nbsp; </label>
  
  <br /><br />
  
  <!--<input type="submit" name="submitForm" value="<After You've Select An Exhibition And Checked The Box Above, Click Here To Send E-mails To All Applicants">-->
   <input type="submit" name="submitForm" value="Click Here To Send Individual E-mails To Each Applicant">
</form>

<?php $agree = $CURRENT_USER['allowedFolders'] ?>
<?php 
 $where = ""; 
  ?>
<?php foreach ($master_exhibition_listRecords as $record): ?>
<?php if (strpos($agree, 'exhibition_manager')|| @$CURRENT_USER['isAdmin']): ?>
<?php if ($FORM['where'] == $record['num']) { $where = $record['title'];}?>
<?php endif ?>
<?php endforeach; ?>
<?php
 list($exhibition_email_testRecords, $exhibition_email_testMetaData) = getRecords(array(  
    'tableName'   => 'exhibition_email_test',  
    'where'       => " project_title = '$where'",  
	
  ));

?>
<br />


<?php foreach ($e_blast_events_noticeRecords as $record): ?>
<?php if (@$where == @$record['master_exhibition_title:label']):?>
<?php $start_date_for_jurying = @$record['start_date_for_jurying'] ?>
<?php $end_date_for_jurying = @$record['end_date_for_jurying'] ?>
<?php $artist_notification_date = @$record['artist_notification_date'] ?>
<?php endif ?>
<?php endforeach; ?>
 <?php
$endDate = date("M jS, Y", strtotime($end_date_for_jurying))
;// end date

// echo "The End Date: ".$endDate."<br>";

//Add one day to endt date
$dateplus1 = strtotime(date("M jS, Y", strtotime($endDate)) . " +1 day");
// echo date('M jS, Y', $dateplus1);

?>



<br />
    <?php if ($where &&(@$CURRENT_USER  && strtotime($start_date_for_jurying) >= time())):?>
    <?php $allow_send = '0' ?>
    <span class="error-text-yellow-italic">Jurying for this exhibition begins on <?php echo date("M jS, Y", strtotime($start_date_for_jurying)) ?> and ends on <?php echo date("M jS, Y", strtotime($end_date_for_jurying)) ?>.<!--<br />You can send acceptance emails after jurying ends, on <?php echo date("M jS, Y", strtotime($end_date_for_jurying)) ?>.--><br />Send acceptance/rejection emails on or before the Artists Notification date, which is <?php echo date("M jS, Y", strtotime($artist_notification_date)) ?>.<br /><br /></span>
    <?php elseif ($where && (@$CURRENT_USER  && (strtotime($start_date_for_jurying) <= time() && strtotime(date('M jS, Y', $dateplus1)) >= time()))):?>
    <?php $allow_send = '0' ?>
    <span class="error-text-yellow-italic">Jurying for this exhibition began on <?php echo date("M jS, Y", strtotime($start_date_for_jurying)) ?> and will end at midnight (Eastern Time) on <?php echo date("M jS, Y", strtotime($end_date_for_jurying)) ?>.<!--<br />You can send acceptance emails after jurying ends, on <?php echo date("M jS, Y", strtotime($end_date_for_jurying)) ?>.--><br />Send acceptance/rejection emails on or before the Artists Notification date, which is <?php echo date("M jS, Y", strtotime($artist_notification_date)) ?>.<br /><br /></span>
    <?php elseif ($where && (@$CURRENT_USER &&  strtotime(date('M jS, Y', $dateplus1)) <= time())):?>
    <?php $allow_send = '1' ?>
    <span class="error-text-yellow-italic">Jurying for this exhibition ended at midnight (Eastern Time) on <?php echo date("M jS, Y", strtotime($end_date_for_jurying)) ?>.<!--<br />You can now send out acceptance emails.--><br />Send acceptance/rejection emails on or before the Artists Notification date, which is <?php echo date("M jS, Y", strtotime($artist_notification_date)) ?>.<br /><br /></span>
    <?PHP endif ?>

<div  align="left">
<?php if($where && !$allow_send == '1'):?>
<span class=" heading-text-red">*** </span><span class="error-text-yellow-italic">You can not send acceptance emails for this exhibition until the jurying has ended. </span><span class=" heading-text-red">***</span><br />
<?php elseif ($where && $allow_send == '1' && !$_REQUEST['send_this'] == '1') :?>
<span class=" heading-text-red">*** </span><span class=" heading-text">YOU MUST CHECK THE BOX ABOVE TO SEND ACCEPTANCE EMAILS</span><span class=" heading-text-red"> ***</span>
<?php elseif (@$_REQUEST['submitForm'] && @!$FORM['where'] && @$_REQUEST['send_this'] == '1') :?>
<span class=" heading-text-red">*** </span><span class=" heading-text">YOU MUST CHOOSE AN EXHIBITION TO SEND ACCEPTANCE EMAILS</span><span class=" heading-text-red"> ***</span
>
<?php elseif (@!$where ) :?>
<span class=" heading-text-red">*** </span><span class=" heading-text">YOU MUST CHOOSE AN EXHIBITION <u>AND</u> CHECK THE BOX</span><span class=" heading-text-red"> ***</span
>
<?php endif; ?>

<?php //reset counter so emails sent can be counted
$email_count = '' ?>
<?php foreach($exhibition_email_testRecords as $record) : ?>
<?php $the_to = $record['email']; ?>
<?php $first_name = $record['first_name'] ; ?>
<?php $last_name = $record['last_name'] ; ?>
<?php ob_start(); // start capturing output ?>
<?php $instructionInformation = array(); ?>
<?php foreach ($exhibition_email_testRecords as $record): ?>
<?php if($the_to == $record['email']) : ?>
<?php foreach ($record['uploads'] as $upload): ?>
<?php if($upload['info5'] == 0) : ?><?php if(@$record['uploads']): ?><span class='heading-text-yellow'>CONGRATULATIONS, THE FOLLOWING WORK(S) WAS/WERE ACCEPTED FOR INCLUSION IN THE <?php echo strtoupper($where) ?> EXHIBITION BY THE JURORS.</span><?php endif; ?><br /><br /><?php break ?>

<?php endif; ?>
<?php endforeach ?>
<?php endif; ?>
<?php endforeach ?>

<?php foreach ($exhibition_email_testRecords as $record): ?>
<?php if($the_to == $record['email']) : ?>
<?php $recnum = $record['num'] ?>
<?php foreach ($record['uploads'] as $upload): ?>
<?php if($upload['info5'] == 0 || !$upload['info5']) : ?>
<img src="http://www.artistsofpalmbeachcounty.org<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>"  /> <br />
<?php // get the instructions for this particular image
        $instructions = mysql_get("email_image_information",null,"file_name = '".$upload['filename']."' AND project_title = '".$record['project_title']."'");
 
        // Get only the instructions we want to show - in this case, the fields we want start with 'complete_'
        foreach ( $instructions as $field => $value ) {
          
          if ( preg_match("/^complete_/",$field) ) {
            
            // Replace all the underscores with spaces and remove 'complete_' from the field name
            // then capitalize all the individual words so we can use this as a proper label
            $field = str_replace("complete_","",$field);
            $field = str_replace("_"," ",$field);
            $field = ucwords($field);
            
            // Add this extra info to the appropriate upload in the exhibition_email_testRecords array
            // in it's own array called 'email_image_information'
            $exhibition_email_testRecord['uploads'][$key]['email_image_information'][$field] = $value;
	    $instructionInformation[$field] = $value;
	    
      } }
  ?>
<?php foreach ( $instructionInformation as $field => $instruction ) : ?>
<?php if ( @$instruction && $field == 'Title') : ?>
<?php // Replace all double quotes with single quotes
					   $instruction = preg_replace("[\"]", "''", $instruction); ?>
<div ><?php echo $field.': '.$instruction; ?></div>
<?php endif; ?>
<?php endforeach; ?>
<?php if (!$upload['info5'] == 1):?><span class='body-text-yellow'>Congratulations, this work has been accepted.</span><?php endif; ?><br />
<br />
<?php endif; ?>
<?php endforeach ?>
<?php endif; ?>
<?php endforeach ?>
<?php $output = ob_get_clean(); // stop capturing output  ?>
<?php ob_start(); // start capturing output2 ?>
<?php $instructionInformation = array(); ?>

<?php foreach ($exhibition_email_testRecords as $record): ?>
<?php if($the_to == $record['email']) : ?>
<?php foreach ($record['uploads'] as $upload): ?>
<?php if($upload['info5'] == 1) : ?><?php if(@$record['uploads']): ?><span class='heading-text-yellow'>UNFORTUNATELY, THE FOLLOWING WORK(S) WAS/WERE NOT ACCEPTED FOR INCLUSION IN THE <?php echo strtoupper($where) ?> EXHIBITION BY THE JURORS.</span><?php endif; ?><br /><br /><?php break ?>


<?php endif; ?>
<?php endforeach ?>
<?php endif; ?>
<?php endforeach ?>
<?php foreach ($exhibition_email_testRecords as $record): ?>
<?php if($the_to == $record['email']) : ?>
<?php foreach ($record['uploads'] as $upload): ?>
<?php if($upload['info5'] == 1) : ?>
<img src="http://www.artistsofpalmbeachcounty.org<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>"  /> <br />
<?php // get the instructions for this particular image
        $instructions = mysql_get("email_image_information",null,"file_name = '".$upload['filename']."' AND project_title = '".$record['project_title']."'");
 
        // Get only the instructions we want to show - in this case, the fields we want start with 'complete_'
        foreach ( $instructions as $field => $value ) {
          
          if ( preg_match("/^complete_/",$field) ) {
            
            // Replace all the underscores with spaces and remove 'complete_' from the field name
            // then capitalize all the individual words so we can use this as a proper label
            $field = str_replace("complete_","",$field);
            $field = str_replace("_"," ",$field);
            $field = ucwords($field);
            
            // Add this extra info to the appropriate upload in the exhibition_email_testRecords array
            // in it's own array called 'email_image_information'
            $exhibition_email_testRecord['uploads'][$key]['email_image_information'][$field] = $value;
	    $instructionInformation[$field] = $value;
	    
      } }
  ?>
<?php foreach ( $instructionInformation as $field => $instruction ) : ?>
<?php if ( @$instruction && $field == 'Title') : ?>
<?php // Replace all double quotes with single quotes
					   $instruction = preg_replace("[\"]", "''", $instruction); ?>
<div ><?php echo $field.': '.$instruction; ?></div>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($upload['info5'] == 1):?><span class='body-text-yellow'>Sorry, this work has not been accepted.</span><?php endif; ?>
<br />
<br />
<?php endif; ?>
<?php endforeach ?>
<?php endif; ?>
<?php endforeach ?>
<?php $output2 = ob_get_clean(); // stop capturing output  ?>

<?php // set $allow send  to 0 to test email sending
if ($FORM['where'] && $_REQUEST['send_this'] == '1' && $allow_send == '1'):?>
<?php $email_count++ ; ?>

<?php
  

 // $the_to = $record['email'];
   $the_from  = "exhibition-submissions@artistsofpalmbeachcounty.org";
$to = "$the_to";
$from = "$the_from";
$headers  = "From: $from\r\n";
    $headers .= "Content-type: text/html\r\n"; 
	
$subject = "Your submission to the $where Exhibition has been Juried";
$message = <<<EOF
<html>
<head>
<style type="text/css">
.body-text {font-family:Arial; font-size: 1.0em;}
.body-text-yellow {font-family:Arial; color: rgb(255,255,0); font-size: 1.0em;}
.heading-text-yellow {font-family:Arial; color: rgb(255,255,0); font-size: 1.3em;}
</style>
</head>
<body bgcolor="#7C7164">
<table style='background-color: #7C7164;' width='100%' align='center' border='0' >
			  <tr>
    <td align='left' >
	<table style='background-color: #7C7164;' width='70%' align='center' border='0' >
			  <tr>
    <td align='left' >
 <div align='left'><img src='http://www.artistsofpalmbeachcounty.org/open.php?num=$recnum&amp;opened=1&amp;email=$the_to&amp;project_title=$where' height='1' width='1' alt='' /><img src='http://www.artistsofpalmbeachcounty.org/images/APBC-LOGO.png' width='800' height='183' style='border:hidden'/></div><br /><br />
 <div align='left' class='body-text-yellow'>
  Hello $first_name $last_name,
  <br /><br />
 $output<br /><br />$output2

    <br /><br />
  Thank you for submitting your work to this exhibition,
  <br /><br />
 The Exhibition Committee<br />
  Artists of Palm Beach County</div>
  </td>
    </tr>
	</table>
	</td>
    </tr>
	</table>
  </body>
</html>
EOF;
   //end of message 
mail($to,$subject,$message,$headers);

?>
<?php endif; ?>
<?php endforeach ?>

<?php if (@$_REQUEST['submitForm'] && @$FORM['where'] && @$_REQUEST['send_this'] == '1' && @!$allow_send == '1'):?>
<?php foreach ($exhibition_email_testRecords as $record): ?>
<span class="error-text-yellow-italic"><br /><br />Sorry, You can not send acceptance e-mails for this exhibition at this time. Make sure that the jurying has ended and the notification date has not passed.</span><?php break ?>
<?php endforeach ?>
<?php endif; ?>

<br /><br /><span class="error-text-yellow-italic">
<?php if ($count == '0'):?>&nbsp;
<?php endif; ?>

<?php if ($count =='1'):?>
This form has been submitted once.<br /><?php if ($where):?>The last attempt was for the exhibition: <?php echo $where ?>.<?php endif; ?><?php if (@$_REQUEST['submitForm'] && @$FORM['where'] && @$_REQUEST['send_this'] == '1' && @$allow_send == '1'):?><br /><br /><span class=" heading-text-red">*** </span>You have <?php if ($email_count =='0' || @!$email_count ):?> sent no<?php else: ?> successfully sent <?php echo $email_count ?> <?php endif; ?> emails to entrants of <?php echo $where ?>. 
<?php endif; ?><?php if(@$where && @!$email_count):?><br /><br /><span class=" heading-text-red">*** </span>You have sent no emails.<?php endif; ?><?php if (!$where):?><br /><br /><span class=" heading-text-red">*** </span>You have sent no emails.<?php endif; ?><span class=" heading-text-red"> ***</span><?php endif; ?>

<?php if ($count > '1'):?>
This form has been submitted <?php echo $count ?> times.<br /><?php if ($where):?>The last attempt was for <?php echo $where ?>.<?php endif; ?><?php if (@$_REQUEST['submitForm'] &&($email_count =='0' || @!$email_count )):?><br /><br /><span class=" heading-text-red">*** </span>You have sent no emails. <?php endif; ?><?php if (@$_REQUEST['submitForm'] && @$FORM['where'] && @$_REQUEST['send_this'] == '1' && @$allow_send == '1'):?><br /><br /><span class=" heading-text-red">*** </span>You have <?php if ($email_count =='0' || @!$email_count ):?> sent no<?php else:?> successfully sent <?php echo $email_count ?> <?php endif; ?> emails to entrants of <?php echo $where ?>.
<?php endif; ?> <span class=" heading-text-red"> ***</span>
<?php endif; ?></span><br /><br /><a class="special" href='?action=logoff'>WHEN YOU'RE DONE, CLICK HERE TO LOG OFF</a>
<?php else:?><br /><span class="heading-text-yellow">Please log in as an administrator or manager and then return to this page.</span><?php endif; ?>	
</td>
  </tr>
			</table>

<p></p><script type="text/javascript">

//anylinkcssmenu.init("menu_anchors_class") //call this function at the very *end* of the document!
anylinkcssmenu.init("anchorclass")

</script></body>

</html>