<?php $GLOBALS['SEP_DISABLED'] = 1; ?>
<?php header('Content-type: text/html; charset=utf-8'); ?>

<?php
 
    if (!defined('START_SESSION')) { define('START_SESSION', true); }
  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/hsphere/local/home/a887307/elleschorrphotography.com/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
  
//Get the current CMS users details
  $CMS_USER = getCurrentUserFromCMS(); 
  
  //redirect the browser if no user is currently logged into the back end
  if (!@$CMS_USER['num']){ 
    session_unset();
    redirectBrowserToUrl("http://elleschorrphotography.com/cmsAdmin/admin.php?redirectUrl=" . $_SERVER['REQUEST_URI']);
    exit;
  }
  
?> <?php
  // load records
  list($salon_listingsRecords, $salon_listingsMetaData) = getRecords(array(
    'tableName'   => 'salon_listings',
	
  ));
   // load records
  list($salon_namesRecords, $salon_namesMetaData) = getRecords(array(
    'tableName'   => 'salon_names',
	
  ));
  
  // load records
  list($salon_datesRecords, $salon_datesMetaData) = getRecords(array(
    'tableName'   => 'salon_dates',
	
  )); 
  list($common_informationRecords, $common_informationMetaData) = getRecords(array(
    'tableName'   => 'common_information',

    'limit'       => '1',
  ));
  
  $common_informationRecord = @$common_informationRecords[0]; // get first record
  
 // load records
  list($google_font_namesRecords, $google_font_namesMetaData) = getRecords(array(
    'tableName'   => 'google_font_names',
  ));
  
  ?>

<!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>E L L E &nbsp; S C H O R R &nbsp; P H O T O G R A P H Y</title>
<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
<meta name="robots" content="noindex,nofollow" />
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css.php" />
<link rel="stylesheet" type="text/css" href="css/fonts.css.php" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php 
    $output = ''; 
    foreach ($google_font_namesRecords as $record) { $record['name'] = preg_replace("/[, ]/", "+", $record['name']);
      $output .= $record['name'] . "|"; 
    } 
    $output = rtrim($output,"|"); // remove trailing pipe 
    print $output; 
?>">
<style type="text/css">
table.email {
	border-width: 1px;
	border-spacing: 1px;
	border-style: solid;
	border-color: #<?php echo $common_informationRecord['horizontal_line_color'] ?>;
	border-collapse: collapse;
}
table.email th {
	border-width: 1px;
	padding: 1px;
	border-style: solid;
	border-color: #<?php echo $common_informationRecord['horizontal_line_color'] ?>;
}
table.email td {
	border-width: 1px;
	padding: 1px;
	border-style: solid;
	border-color: #<?php echo $common_informationRecord['horizontal_line_color'] ?>;
}
</style>
</head>

<body style="font-family:Verdana, Geneva, sans-serif" >
<table align="center" width="1150" border="0">
  <tr>
    <td><div align="left"><br />
        <?php foreach ($common_informationRecord['salons_page_masthead'] as $upload): ?>
        <img src="<?php echo $upload['urlPath'] ?>" alt="<?php $info1 = htmlspecialchars($upload['info1']); ?>
<?php echo ucwords(strtolower($info1)); ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" border="0" />
        <?php endforeach ?>
      </div>
      <br />
      <table align="center" width="80%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><div align="center"><a class="special"   href="index.php"><span class="navigation_font">Home</span></a></div></td>
          <td><div align="center"><a class="special"  href="galleries.php"><span class="navigation_font">Galleries</span></a></div></td>
          <td><div align="center"><a class="special"   href="exhibitions.php"><span class="navigation_font">Exhibitions</span></a></div></td>
          <td><div align="center"><a class="special"  href="presentations.php"><span class="navigation_font">Presentations</span></a></div></td>
          <!-- <td><div align="center"><a href="../projects.php"><span class="navigation_font">Projects</span></a></div></td> -->
          <td><div align="center"><a class="special"  href="aboutme.php"><span class="navigation_font">About</span></a></div></td>
          <td><div align="center"><a class="special"  href="contact.php"><span class="navigation_font">Contact</span></a></div></td>
        </tr>
      </table>
      <br />
      <br /> 
	  <?php if( $CMS_USER['isAdmin']): ?>
      <table align="center" width="100%" border="0">
       <tr><td><a class="special" href="http://elleschorrphotography.com/cmsAdmin/admin.php?action=logoff">Click Here to Log Out</a><br /><br /></td></tr> <tr>
          <td align="right" valign="top"><form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
              <select name="salon_name_keyword">
                <option value="">Choose The Salon To Display</option>
                <?php foreach ($salon_namesRecords as $record): ?>
                <option class=" body-text" value="<?php echo $record['num'] ?>"><?php echo $record['title'] ?></option>
                <?php endforeach ?>
              </select>
    
             <?php 
//Create an array to store the values that have been selected
$selectArray = array(); 
//foreach section item
foreach($salon_datesRecords as $record){ 
  //If the record has something selected for the "attended" category
  if(@$record['date']){    //If the selected value isn't already in the array
    if(!in_array(@$record['date'],$selectArray)){ 
      //Add it to the $selectArray
      $selectArray[$record['date']] = $record['date']; 
    }
  } 
}
?>
<div class="body-text">

<select name="awc_attended_keyword" >
  <option value= "">Or Choose A Date For Which To Display  AWC Attendees And Click/Tap The Search Button</option>
  <?php foreach ($selectArray as $value => $name): ?>
    <option value="<?php echo $value; ?>"><?php echo $name; ?></option>
  <?php endforeach; ?>
</select> 
<select name="mmm_attended_keyword" >
  <option value= "">Or Choose A Date For Which To Display  MMM Attendees And Click/Tap The Search Button</option>
  <?php foreach ($selectArray as $value => $name): ?>
    <option value="<?php echo $value; ?>"><?php echo $name; ?></option>
  <?php endforeach; ?>
</select> 
            
              
              <input type="submit" name="submit" value="Search">
            </form></td>
          <td align="left" valign="top"><FORM ACTION="">
              <INPUT TYPE="submit" VALUE="Cancel Search Filters">
            </FORM></td>
        </tr>
      </table>
      
      <p></p>
      <div align="center" class="copyright"><br/><b><?php if(@$_REQUEST):?>FILTERED<?php elseif(@$_REQUEST =="") :?>FULL<?php else : ?>FULL<?PHP endif; ?> EMAIL ADDRESS LIST(Not Including Contacts Who Have Requested Removal)</b><br />Note: Attendees may have attended other salons in addition to the filtered choice.<br /><br />
      </div><hr  color="#<?php echo $common_informationRecord['horizontal_line_color'] ?>" />
     
       <br />
        <div align="left" class="copyright">
<?php $countb = 0; ?>
<?php $count2 = 0; ?>
<?php foreach ($salon_listingsRecords as $record): ?>
<?php if ($record['email_address'] && ($record['remove_me']== 0 || $record['remove_me']== "")): ?>
<?php $countb++; ?>
<?php $count2++; ?>
<?php echo $record['email_address'] ?>;&nbsp;
<?php endif ?>
<?PHP $maxemailsa= $common_informationRecord['max_emails']; ?>
<?php if ($countb >= $maxemailsa): ?>
<?php $countb = 0; ?>
</div>
<div align="left" class="copyright">
<br />
<hr  color="#<?php echo $common_informationRecord['horizontal_line_color'] ?>" />
<br />
<?php endif ?>
<?php endforeach ?>
<br /><br />
</div>
  <hr  color="#<?php echo $common_informationRecord['horizontal_line_color'] ?>" />      
       
      <div align="center" class="copyright">There <?php if($count2 == 1):?>is <?php else :?>are <?php endif ?><?php echo $count2 ?> email address<?php if($count2 > 1 ||($count2 == 0 || $count2 == "")):?>es <?php else :?> <?php endif ?> in your <?php if(@$_REQUEST):?>filtered<?php elseif(@$_REQUEST =="") :?> <?php else : ?> <?PHP endif; ?> list<?php if($count2 > @$maxemailsa ):?>, in groups of no more than <?php echo $common_informationRecord['max_emails'] ?> e-mail addresses each<?PHP endif; ?>.<br />
        <?php if($count2 > 0 && $count2 !== ""):?>Copy <?php if($count2 > @$maxemailsa ):?>each group <?php endif ?>to the BCC: field of your e-mail.<?php endif ?></div>
      <div align="center" >
        <div align="left" class="copyright">
          <hr  color="#<?php echo $common_informationRecord['horizontal_line_color'] ?>" />
          <br />
        </div>
        <div> </div>
        <p></p>
      </div>
    <?php 
	
	// load records
  list($salon_listingsRecords, $salon_listingsMetaData) = getRecords(array(
    'tableName'   => 'salon_listings',
		'orderBy'=> 'last_name ASC',
  ));
  
     // load records
  list($salon_namesRecords, $salon_namesMetaData) = getRecords(array(
    'tableName'   => 'salon_names',

  ));
  ?>
  
      <div class="copyright" align="center"> <b><br />
        SALON ATTENDEES</b><br />
      </div><div align="center" class="copyright">Includes all entries, even where email addresses don't exist and where the attendee has requested to be removed from the list.</div>
      <div align="center" >
      <div align="left" >
      <hr  color="#<?php echo $common_informationRecord['horizontal_line_color'] ?>" />
      <br />
      <table class="email" width="100%" >
        <tr>

          <td width="11%" class="copyright" style="text-align:left" align="center" valign="top"><b>&nbsp;Last Name</b></td>
          <td width="11%" class="copyright" style="text-align:left" align="center" valign="top"><b>&nbsp;First Name</b></td>
          <td width="11%" class="copyright" style="text-align:left" align="center" valign="top"><b>&nbsp;Salon</b></td>
         <td width="12%" class="copyright" style="text-align:left" align="center" valign="top"><b>&nbsp;E-mail</b></td>
          <td width="12%" class="copyright" style="text-align:left" align="center" valign="top"><b>&nbsp;Removal Request</b></td> 
        </tr>
              <tr>
          <td colspan="5" ><hr  color="#fef692" /></td>
        </tr>
        <?php foreach ($salon_listingsRecords as $record): ?>
        <tr>
          
          <td class="copyright" style="text-align:left"  align="center" valign="top"><?php if ($record['last_name']): ?>
            &nbsp;<?php echo $record['last_name'] ?>
            <?php else: ?>
            &nbsp;<b>- -</b>&nbsp;
            <?PHP endif ?></td>
          <td class="copyright" style="text-align:left" align="center" valign="top"><?php if ($record['first_name']): ?>
            &nbsp;<?php echo $record['first_name'] ?>
            <?php else: ?>
            &nbsp;<b>- -</b>&nbsp;
            <?PHP endif ?></td>
          <td class="copyright" style="text-align:left" align="center" valign="top"><?php if ($record['salon_name']): ?>
            &nbsp;<?php echo join(', ', $record['salon_name:labels']); ?>
            <?php else: ?>
            &nbsp;<b>- -</b>&nbsp;
            <?PHP endif ?></td>
          
          <td class="copyright" style="text-align:left" align="center" valign="top"><?php if ($record['email_address']): ?>
            &nbsp;<?php echo $record['email_address'] ?>
            <?php else: ?>
            &nbsp;<b>- -</b>&nbsp;
            <?PHP endif ?></td>
         
          <td class="copyright" style="text-align:left" align="center" valign="top"><?php if ($record['remove_me'] == 1): ?>&nbsp;Removal Requested<?php else: ?>&nbsp;<b>- -</b>&nbsp;<?PHP endif ?></td>
      </tr>
        <tr>
          <td colspan="9" ><hr  color="#fef692" /></td>
        </tr>
        <?php endforeach ?>
      </table>
       <?php else :?>
      <br />
      <br />
      <span class=" copyright"> Sorry, based on the login credentials you used, you don't have the authority to access this page. <br />
      <br />
      To log in with the appropriate credentials, <a class="special" href="http://www.elleschorrphotography.com/cmsAdmin/admin.php?action=logoff">Click Here to Log Out</a>, then return to this page and log in again.<br />
     
      </span>
      <?php endif ?>
      </td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>