<?php header('Content-type: text/html; charset=utf-8'); ?>

<?php
  /* Works In FF With link */

  // load viewer library
  $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',
    'limit'       => '1',
 
  ));
  $common_informationRecord = @$common_informationRecords[0]; // get first record
  	
       
list($master_exhibition_listRecords, $master_exhibition_listMetaData) = getRecords(array(
'tableName' => 'master_exhibition_list',
'debugSql'      =>   true, 
));
   
$numToName = array(); 
foreach ($master_exhibition_listRecords as $record){ 
  $numToName[$record['num']] = $record['title']; 


}


?>
<?php 
 $where = ""; 
  ?>
<?php foreach ($master_exhibition_listRecords as $record): ?>

<?php if (@$FORM['where'] == $record['num'] { $where = $record['title']}); ?>

<?php endforeach; ?>
   
  
<?php
 list($client_uploadsRecords, $client_uploadsMetaData) = getRecords(array(  
    'tableName'   => 'client_uploads',  
    'where'       => " project_title = '$where'",  
	'debugSql'      =>   true, 

  ));

?>

<!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" />
	        <meta name="robots" content="noindex,nofollow" />
		<title>Welcome to the Artists of Palm Beach County - Exhibition Submissions Spreadheet</title>
		<link href="../css/apbc900.css" type="text/css" rel="stylesheet" media="all" />
        
         <!-- This style makes the menu item for the current page white and bold --> 
		<style type="text/css">
a.contact:link { font-family:Verdana; color: #ffffff; font-size: 0.68em; font-weight: bold; text-decoration: none;}
a.contact:visited { font-family:Verdana; color: #ffffff; font-size: 0.68em; font-weight: bold; text-decoration: none;}
a.contact:hover { font-family:Verdana; color: #ffffff; font-size: 0.68em; font-weight: bold; text-decoration: none; }
a.contact: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>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 

 <script type = "text/javascript" src = "cmsAdmin/3rdParty/jquery/jquery1.4.1.js"></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'], 'Mobile') !== false)
			return true;

		if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false)
			return true;
	}

	return false;
}
    ?>
		<table  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" align="center"   >
      <div  align="center"><?php if($where):?><span class="heading-text-bold">EXHIBITION SUBMISSIONS SPREADHEETS FOR <?php echo strtoupper($where) ?></span><?PHP else: ?><span class=" heading-text-bold">EXHIBITION SUBMISSIONS SPREADHEETS</span><?php endif; ?>
     </div><br />

  <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">

<select name="where"> 
<option value=""><span class="body-text-bold">Select</span></option> 
 
<?php foreach($numToName as $num => $name): ?> 
<option value="<?php echo $num;?>"><?php echo $name;?></option> 
<?php endforeach?> 
</select>


<input type="submit" name="submit" value="Select An Exhibition And Click To View">
</form></td></tr></table>
 <div  align="center"><?php if(!$where):?><span class=" heading-text-red">***</span><span class=" heading-text-yellow">YOU MUST SELECT AN EXHIBITION TO VIEW THE SUBMISSIONS SPREADSHEETS</span><span class=" heading-text-red">***</span><?php endif; ?></div>

<?php if (@$CURRENT_USER['isAdmin']): ?>

<table align="center" width="900" border="0" cellpadding="5" cellspacing="0">


<tr>
  <td align="left" valign="top">
  


 <div align="center"><span class="heading-text-bold">ALL ENTRANTS SPREADSHEET</span>
 
<br />
<?php $count = 0; ?>
<?php foreach ($client_uploadsRecords as $record): ?>
<?php foreach ($record['uploads'] as $upload): ?>
					<?php $count++; ?><?php break ?><?php endforeach; ?><?php endforeach; ?>
				      <span class="heading-text-yellow">There are <?php echo $count ?> entrants to the "<?php echo ucwords($where) ?>" exhibition.</span><br />
				      <span class="body-text-bold">Copy the information between the horizontal lines into a text document.<br />Rename the file extension as .csv and open in Excel.
</span></div>
					       <hr align="center" width="300" color="#660033"/>
                            <p class="body-text" style="text-align:left" align="left"> First Name,Last Name,Street Address,City,State,Zip,Day-Phone,Evening-Phone,Cell-Phone,email,website,Publish-Address,Publish-Phone,Publish-Email,Artistic-Discipline,Artists-Statement,link1,filename1,accepted1,link2,filename2,accepted2,link3,filename3,accepted3,link4,filename4,accepted4,link5,filename5,accepted5<br />
<?php foreach ($client_uploadsRecords as $record ): ?>
<?php foreach ($record['uploads'] as $upload): ?>
<?php echo $record['first_name'] ?>,<?php echo $record['last_name'] ?>,<?php echo $record['street_address'] ?>,<?php echo $record['city'] ?>,<?php echo $record['state'] ?>,<?php echo $record['zip'] ?>,<?php echo $record['day_phone'] ?>,<?php echo $record['evening_phone'] ?>,<?php echo $record['cell_phone'] ?>,<?php echo $record['email'] ?>,<?php if ($record['web_site']): ?><?PHP if (!preg_match("/^http:\/\//i", $record['web_site'])) {$record['web_site'] = "http://" . $record['web_site']; } ?><?php echo $record['web_site'] ?><?php endif ?>,<?php if ($record['ok_to_publish_address_contact_information']==1): ?>Yes<?php else: ?>No<?php endif ?>,<?php if ($record['ok_to_publish_phone_contact_information']==1): ?>Yes<?php else: ?>No<?php endif ?>,<?php if ($record['ok_to_publish_email_contact_information']==1): ?>Yes<?php else: ?>No<?php endif ?>,<?PHP $record['describe_your_artistic_discipline'] = preg_replace("[<br/>]", "&nbsp;", $record['describe_your_artistic_discipline'] ); ?><?PHP $record['describe_your_artistic_discipline'] = preg_replace("[,]", "", $record['describe_your_artistic_discipline'] ); ?><?php echo $record['describe_your_artistic_discipline'] ?>,<?PHP $record['artists_statement'] = preg_replace("[,]", "", $record['artists_statement'] ); ?><?PHP $record['artists_statement'] = preg_replace("[<br/>]", "&nbsp;", $record['artists_statement'] ); ?><?php echo $record['artists_statement'] ?>,<?php foreach ($record['uploads'] as $upload): ?>http://www.artistsofpalmbeachcounty.org<?php echo $upload['urlPath'] ?>,<?PHP $upload['urlPath'] = preg_replace("[/cmsAdmin/uploads/customers/]", "", $upload['urlPath']); ?><?php echo $upload['urlPath'] ?>,<?php if( $upload['info5'] == 0):?>Yes,<?php else: ?>No,<?php endif ?><?php endforeach; ?><br /><?php break ?><?php endforeach; ?><?php endforeach; ?>


</p>
<hr width="300" color="#660033"/>
                            
     
  </td>
</tr>

<tr>
  <td align="left" valign="top">
  


 <div align="center"><span class="heading-text-bold">ALL ENTRANTS EMAIL LIST</span>
<br /><?php $count1 = 0; ?>
<?php foreach ($client_uploadsRecords as $record): ?>
<?php foreach ($record['uploads'] as $upload): ?><!--<?php if( $upload['info5'][0] == 1 || $upload['info5'][0] == 0):?>-->
					<?php $count1++; ?><!--<?php endif ?>--><?php break ?><?php endforeach; ?><?php endforeach; ?>
				      <span class="heading-text-yellow">There are <?php echo $count1 ?> entrants to the "<?php echo ucwords($where) ?>" exhibition.</span><br />
				      <span class="body-text-bold">Copy the email addresses from between the horizontal lines and copy into the BCC: Field of your email.</span></div>
<hr align="center" width="300" color="#660033"/>
<?php foreach ($client_uploadsRecords as $record ): ?>
<?php foreach ($record['uploads'] as $upload): ?><!--<?php if( $upload['info5'][0] == 1):?>-->
<?php echo $record['email'] ?>;&nbsp; 
<!--<?php endif ?>--><?php break ?><?php endforeach; ?><?php endforeach; ?>


</p>
<hr width="300" color="#660033"/>
                            
     
  </td>
</tr>
</table>

<?php else:?><br />Please log in as an administrator and then return to this page<?php endif; ?>                  
<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>