<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php $GLOBALS['SEP_DISABLED'] = 1; ?>
<?php

  require_once('_website_init.php');
  
  require_once ('_ajax_app.php');
	
  if (!@$GLOBALS['WEBSITE_MEMBERSHIP_PLUGIN']) { die("You must activate the Website Membership plugin before you can access this page."); }
  
  if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); }
  
   // load records
  list($common_informationRecords, $common_informationMetaData) = getRecords(array(
    'tableName'   => 'common_information',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $common_informationRecord = @$common_informationRecords[0]; // get first record  
  
  $masterRec = (isset($_POST['project_title']))? $_POST['project_title'] : "0" ;

  list($master_exhibition_listRecords, $master_exhibition_listMetaData) = getRecords(array(
    'tableName'   => 'master_exhibition_list',
    'limit'       => '',
    'where'       => "title = '$masterRec'",
    'allowSearch' => false,
  ));
 
 $file_ext_array = @explode(',',$master_exhibition_listRecords[0]['file_types']);
 $file_max_no    = $master_exhibition_listRecords[0]['file_max_no']; 
 $file_max_size  = $master_exhibition_listRecords[0]['file_max_size'];
 
 foreach ($master_exhibition_listRecords as $record){ 
    $names[$record['title']] = $record['title']; 
 } 

 
   
   
  list($e_blast_events_noticeRecords, $e_blast_events_noticeMetaData) = getRecords(array(
    'tableName'   => 'e_blast_events_notice',
    ));
  
  
  $tableName       = 'client_uploads';
  $fieldName       = 'uploads';
  $recordNum       = null; // you must set either $recordNum or $preSaveTempId to null
  $preSaveTempId   = @$_REQUEST['preSaveTempId'] ? $_REQUEST['preSaveTempId'] : uniqid('x');
  $errorsAndAlerts = '';
  
  $showForm = 1;
  
  ### insert record
  if ( @$_REQUEST['submitForm'] ) {
    //error checking has already been done
  
	  // Get email list of those members with notifications on, and access to the submission
	  $accounts  = mysql_query_fetch_all_assoc("SELECT * FROM `{$TABLE_PREFIX}accounts` WHERE notifications = '1'"); 
	  $emailList = join(",", array_pluck($accounts, 'email'));
 
    $emailTitle       = @$_REQUEST['title'];
    $emailContent     = @$_REQUEST['content'];
    $emailBy          = @$CURRENT_USER['first_name'] . " ".@$CURRENT_USER['last_name'];
    $emailSend        = @$CURRENT_USER['email'];   
	?>  
 
  <?php
    // make sure this isn't a repeat (someone pressing back or reload for example)
    $where = "first_name='".mysql_real_escape_string( $_REQUEST['first_name'] )."'" .
             " AND last_name='".mysql_real_escape_string( $_REQUEST['last_name'] )."'" .
			
             " AND project_title='".mysql_real_escape_string( $_REQUEST['project_title'] )."'" ; 
         //    "AND special_instructions='".mysql_real_escape_string( $_REQUEST['special_instructions'] )."'";
    $alreadyInserted = mysql_get($tableName,null,$where);

    if ( $alreadyInserted ) {
      
      $recordNum        = $alreadyInserted['num'];
      $errorsAndAlerts  = "We've already added your record, please upload some images.";
      $_REQUEST         = array();
      $showForm         = 2;
       
    } else {
		 // update user
		  // removed email and username 7-4-12
		  $phoneCheckBox = intval(@$_REQUEST['ok_to_publish_phone_contact_information']);
		$addressCheckBox = intval(@$_REQUEST['ok_to_publish_address_contact_information']);
		$emailCheckBox = intval(@$_REQUEST['ok_to_publish_email_contact_information']);
	  $query = "UPDATE `{$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'] )."',
                      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'] )."',
					  web_site         = '".mysql_escape( $_REQUEST['web_site'] )."',
					  ok_to_publish_phone_contact_information = '".mysql_escape($phoneCheckBox )."',
					  ok_to_publish_address_contact_information = '".mysql_escape($addressCheckBox )."',
					  ok_to_publish_email_contact_information = '".mysql_escape($emailCheckBox )."',
					  artists_statement         = '".mysql_escape( $_REQUEST['artists_statement'] )."',
					 describe_your_artistic_discipline        = '".mysql_escape( $_REQUEST['describe_your_artistic_discipline'] )."'
					 WHERE num = '".mysql_escape( $CURRENT_USER['num'] )."'";
      mysql_query($query) or die("MySQL Error:<br/>\n". htmlspecialchars(mysql_error()) . "\n");
      $userNum = mysql_insert_id();
    // update record
    mysqlStrictMode(false); // disable Mysql strict errors for when a field isn't defined below (can be caused when fields are added later)
    
    $columnsToValues = array ('createdDate='          => 'NOW()',
                              'createdByUserNum'      => intval( @$CURRENT_USER['num'] ),
                              'updatedDate='          => 'NOW()',
                              'updatedByUserNum'      => intval( @$CURRENT_USER['num'] ),
							  'company_name'          => mysql_escape( $_REQUEST['company_name'] ),	
                              'day_phone'            => mysql_escape( @$CURRENT_USER['day_phone'] ),
							  'evening_phone'            => mysql_escape( @$CURRENT_USER['evening_phone'] ),
							  'cell_phone'            => mysql_escape( @$CURRENT_USER['cell_phone'] ),
							  'email'            => mysql_escape( @$CURRENT_USER['email'] ),
							  'paypal_payment_address'            => mysql_escape( @$CURRENT_USER['paypal_payment_address'] ),
                              'first_name'            => mysql_escape( @$_REQUEST['first_name'] ),
                              'last_name'             => mysql_escape( @$_REQUEST['last_name'] ),
							  'street_address'             => mysql_escape( @$_REQUEST['street_address'] ),
							  'city'             => mysql_escape( @$_REQUEST['city'] ),
							  'state'             => mysql_escape( @$_REQUEST['state'] ),
							  'zip'             => mysql_escape( @$_REQUEST['zip'] ),
							  'web_site'             => mysql_escape( @$_REQUEST['web_site'] ),
							 'ok_to_publish_phone_contact_information'  => mysql_escape( $phoneCheckBox ),
							  'ok_to_publish_address_contact_information' => mysql_escape( $addressCheckBox ),
							  'ok_to_publish_email_contact_information'  => mysql_escape( $emailCheckBox ),	 
                              'project_title'         => mysql_escape( $_REQUEST['project_title'] ),
							  'artists_statement'             => mysql_escape(@ $_REQUEST['artists_statement'] ),
							  'describe_your_artistic_discipline'             => mysql_escape( @$_REQUEST['describe_your_artistic_discipline'] )
                             );
   
  $company_name = @$CURRENT_USER['company_name']; 
  $first_name = @$CURRENT_USER['first_name']; 
  $last_name = @$CURRENT_USER['last_name']; ; 
  $day_phone = @$CURRENT_USER['day_phone']; 
  $evening_phone = @$CURRENT_USER['evening_phone'];
  $cell_phone = @$CURRENT_USER['cell_phone'];
 $project_title    = mysql_escape( $_REQUEST['project_title'] ); 
  $recordNum        = mysql_insert($tableName,$columnsToValues);
  
     $errorsAndAlerts  = "A new submission for the &quot;$project_title&quot; exhibition has been created.<br /><br />You can sumbit up to $file_max_no images to this exhibition.<br /><br />Click on &quot;SELECT FILES&quot;, highlight (select) ALL the image files to include in your submission, and enter the information for those images (step 2 in the Detailed Uploading Insructions above).<br /><br />You <b>must</b> click on the &quot;CLICK TO UPLOAD AND SUBMIT ALL YOUR SELECTED IMAGE FILES&quot; link to complete the process.<br /><br />\n";
      $_REQUEST         = array();
      $showForm         = 2;
	
    }	
  }

?>

<?php
  // prepopulate form with current user values
  foreach ( $CURRENT_USER as $name => $value ) {
    if ( array_key_exists($name, $_REQUEST) ) { continue; }
    $_REQUEST[$name] = $value;
  }
  
?>
<!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>Artists of Palm Beach County - Member Image Upload Form</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

<!--[if IE 6]>
  <script type="text/javascript"> 
    /*Load jQuery if not already loaded*/ if(typeof jQuery == 'undefined'){ document.write("<script type=\"text/javascript\"   src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\"></"+"script>"); var __noconflict = true; } 
    var IE6UPDATE_OPTIONS = {
      icons_path: "images/"
    }
  </script>
  <script type="text/javascript" src="Scripts/ie6update.js"></script>
  <![endif]-->

<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="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js" type="text/javascript"></script>
<script src="Scripts/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="Scripts/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<link href="css/apbc900.css" rel="stylesheet" type="text/css"  media="all"/>
<link rel="stylesheet" type="text/css" href="css/anylinkcssmenu.css" />

<!-- uploadify -->
<link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="uploadify/swfobject.js"></script>
<script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.CUSTOM.js"></script>
<script type="text/javascript" src="uploadify/jquery.form.js"></script>
<script>
  
    $(document).ready(function(){
  
      // bind 'uploadForm' and provide a simple callback function 
      $('#uploadForm').ajaxForm({
        
        //target:        '#output1',   // target element(s) to be updated with server response 
        
        success: function() {
      
          var selected = $("#selected").val();
        
          if ( selected == 'yes' ) {
            
            // Set new list id
            $("#file_upload").uploadifySettings('scriptData', { 'new_list_id': $('#new_list_id').val() });
        
            // Hide upload button
            $("#uploadLink").hide();
            
            // Disable the form fields for the upload 
            $('div[id^="specialInstructions"]').fadeOut(250, function() { $(this).remove() });
        
            // Trigger upload
            $("#file_upload").uploadifyUpload();
        
          } else {
        
              alert('Please select a file to upload.');
        
          }
        
        }
          
      });
      
  
      $("#createRecord").validationEngine({promptPosition : "centerRight", scroll: false});
      
      $('#file_upload').uploadify({
        
        'uploader'        : 'uploadify/uploadify.swf',
        'script'          : 'uploadify/uploadify.php',
        'cancelImg'       : 'uploadify/cancel.png',
        'folder'          : 'uploads',
        'auto'            : false,
        'multi'           : true,
        'removeCompleted' : false,
        'queueSizeLimit'  : <?php echo (strlen($file_max_no) > 0)? $file_max_no : "0"  ; ?>,
        'sizeLimit'       : <?php echo (strlen($file_max_size) > 0)? $file_max_size : "0"  ; ?>,
        'fileExt'         : '<?php echo uploadifyExts($file_ext_array); ?>',
        'fileDesc'        : '<?php echo browseExts($file_ext_array); ?>',
        'scriptData'      : {'recordNum':'<?php echo $recordNum; ?>'},
        'onAllComplete'   : function(event, queueID, fileObj, response, data) {
                              $('#formContainer').html("<div id='formContainer'><span class='heading-text-yellow'><br />CONGRATULATIONS</span><br />The image files for your submission have been uploaded. An email has automatically been sent to our submission committee to let them know to be on the lookout for your image files. They'll contact you if they have any questions about your submission.<br /><br /><span class='body-text-bold'>PLEASE NOTE:</span> Submissions will not be accepted without payment of the required entry fee. <a class='special' href='paypal_intermediate.php?url=six'>CLICK HERE</a> if you still need to pay an entry fee for this submission.<br /><br /><span class='body-text-yellow'>Just a reminder, your dues will be up for renewal on <?php echo date('l M jS, Y', strtotime(@$CURRENT_USER['expiresDate'])) ?></span><br /><br />In order to show work in an APBC sponsored exhibition, your dues will need to be paid during the period that the exhibition is mounted.<br /><br /><a class='special' href='paypal_renew2.php'>CLICK HERE</a> if you need to renew your dues.<br /><br /><span class='body-text-bold-yellow'>You can not modify your existing submission, however, if you've made a mistake in your original submission, or experience any difficulty while uploading your image files, please <a class='special' href='contact.php'>EMAIL US</a>. We will be glad to help.</span></div>");

                              // Send email with all the appropriate data
                              var dataString = '&ProjectTitle=<?php echo @$project_title; ?>';
                              
                              $.ajax( {
                                type: "GET",
                                url: "?operation=sendUploadedEmail&projectNum=<?php echo $recordNum;?>",
                                data: dataString,
                                success: function(errors) {
                                  if (errors != '') { alert(errors); }
                                }
                              });
                              
                            },
        'onComplete'      : function(event, ID, fileObj, response, data) {
          
                              $('#errorMessages').text(""); 
                              $('#archivos').append("<b>" + response + "</b><br />");
                              
                            },
        'onError'         : function(event,ID,fileObj,errorObj) {
          
                              // Cancel upload
                              $("#filename").uploadifyCancel(ID);
                              
                              // remove form fields from page
                              $('#specialInstructions-' + ID).fadeOut(250, function() { $(this).remove() });
                              
                              // Format error msg
                              var error_msg = errorObj.type + '. Error: '  + errorObj.info + '. File: ' + fileObj.name;
                              
                              // Add failed image to temp table
                              var dataString = '&filename=' + fileObj.name + '&projectTitle=<?php echo @$project_title; ?>';
                      
                              $.ajax( {
                                type: "GET",
                                url: "?operation=imageFailed",
                                data: dataString,
                                success: function(errors) {
                                  if (errors != '') { alert(errors); }
                                }
                              });

                            },
        'onSelect'        : function(event,ID,fileObj) {
          
                              // Update selected so we know they have selected a file
                              $("#selected").val('yes');
                              $("#uploadLink").show();
                              
                            },
        'onCancel'        : function(event,ID,fileObj,data) {
          
                              // Update selected so we know they have no file selected
                              queueSize = data.fileCount;
                              if ( queueSize == 0 ) {
                                $("#selected").val('no');
                                $("#uploadLink").hide(); 
                              }
                              
                              // remove the data from the image instructions table                     
                              var dataString = '&filename=' + fileObj.name + '&projectTitle=<?php echo @$project_title; ?>';
                      
                              $.ajax( {
                                type: "GET",
                                url: "?operation=uploadCancelled",
                                data: dataString,
                                success: function(errors) {
                                  if (errors != '') { alert(errors); }
                                }
                              });
                    
                            }
      });
  
      
    });
    
  </script>
<!-- End JavaScript -->

<!-- Begin Stylesheets -->
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
<style type="text/css">
.errors {
	color: #FC9191;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	font-size: 15px;
}
li {
	float: left;
	width: auto;
	margin-left: 5px;
	margin-right: 5px;
}
</style>
<!-- End Stylesheets -->
</head>
<body bgcolor="#9b97ad">
<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' ); //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>
      <?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" class="heading-text-bold">Member Exhibition Entry and Image Upload Form</div>
      <br />
      <br />
      <?php if (xp_detection()) : ?>
      <table width="50%"  align="center"border="0">
        <tr>
          <td align="left" style="text-align:left" ><span class=" errors"><br />
            We've discovered a small problem that needs your attention!</span><br />
            <br />
            <span class="body-text-9">We've determined that your computer is using a combination of Windows XP and the Internet Explorer browser.<br />
            <br />
            We're sorry for the inconvenience, but in order to use this image uploader with Windows XP, you'll need to use the another browser, like the free Firefox or Google Chrome browser.<br />
            <br />
            If you need to, you can download the latest version of Firefox <a class="special" href="http://www.mozilla.org/en-US/firefox/new/">HERE</a>.<br />
            <br />
            Installation is automatic, you can leave multiple browsers on your system, and they won't interfere with using Internet Explorer at other times.<br />
            <br />
            Thanks,<br />
            <br />
            APBC Webmaster</span></td>
        </tr>
      </table>
      <?php endif; ?>
      <table width="50%"  align="center"border="0">
        <tr>
          <td style="text-align:left" class="body-text" ><span class="heading-text">Uploading image files for an APBC Exhibition is easy.</span><br />
            <br />The value of the $where variable is <?php echo $where ?><br /  />
<?php list($client_uploadsRecords, $client_uploadsMetaData) = getRecords(array(
'tableName' => 'client_uploads',
'where' => "first_name= 'Gerald' AND last_name= 'Kornbluth' AND project_title= 'Participation 2012'",
'debugSql' => true,
));
?>
<?php foreach ($client_uploadsRecords as $record): ?>
<?php foreach ($record['uploads'] as $upload): ?>

<?php $count = count($record['uploads']);?>

<?php endforeach ?>
<?php endforeach ?><br />
There are <?php echo $count ?> uploads.
<br />
      
You can upload as many image files <span class="body-text-bold-yellow">in JPG format</span> as allowed by the exhibition. Each file can be up to 1mb in size. The time that your upload takes will depend on the size of your files, and the speed of your internet connection. After your upload is complete the submission committee at APBC will automatically receive an email letting them know that a submission has been uploaded.            
<br />
<br />
<span class="body-text-bold-yellow">If you experience any difficulty while uploading your image files, please <a class="special"  href='contact.php'>EMAIL US</a>. We'll be glad to help.</span>
<br />
<br />
            <?php 
$text1 = "";
$link2 = "<span class='heading-text-yellow'>CLICK TO HIDE THESE INSTRUCTIONS</span><br />";
$text2 = "<br />
<a target='_blank' href='uploader_video.php'><span class='heading-text-yellow'><u>WATCH THE VIDEO DEMO</u></span></a><br /><br>
<span class='body-text-bold'>
    1) CREATE A SUBMISSION RECORD</span><br />
   <span class='body-text'>
    A) Select the name of the exhibition you are entering.<br />
    B) Fill out the information requested in the application.<br />
    C) Click on 'PROCEED TO SELECT IMAGE FILES TO UPLOAD AND SUBMIT'.</span><br />
    <br />
     <span class='body-text-bold'>
    2) SELECT YOUR IMAGE FILES</span><br />
      <span class='body-text'>
     A) Click on 'SELECT FILES'.<br /> 
     B) Browse to the first folder that contains the JPG image files that you'd like to upload, CTRL-CLICK (Mac: CMD-CLICK) to highlight the desired image files (SHIFT-CLICK to highlight a continuous series of image files) and click on 'OPEN' to select those files.<br />
    C) If there are JPG image files in other folders that you'd like to include, click 'SELECT FILES' again, navigate to the next folder, and highlight those image files, and  click on 'OPEN' to add those files to your list.</span><br />
    <br />
      <span class='body-text-bold'>
     3) UPLOAD SELECTED IMAGE FILES</span><br />
     <span class='body-text'>
     After you've selected all of the image files that you'd like to include in this exhibition submission, Click on 'UPLOAD SELECTED IMAGE FILES'.<br />
     <br /> 
    </span> ";
$link1 = "<span class='heading-text-yellow'><u>CLICK HERE FOR DETAILED UPLOADING INSTRUCTIONS</u></span><br /><br /><br />";
 
echo ToggleText($text1, $link1, $text2, $link2);
 
function ToggleText($text1, $link1, $text2, $link2)
{
 
$tok = rand(0, 1000000);
$out   = "<div id='TT1_$tok' style='display:block;'>" .
"<a href=\"javascript://\" onClick=\"document." .
"getElementById('TT1_$tok').style.display=" .
"'none'; document.getElementById('TT2_$tok')" .
".style.display='block';\">$link1</a>$text1</div>\n";

$out  .= "<div id='TT2_$tok' style='display:none;'>" .
"<a href=\"javascript://\" onClick=\"document." .
"getElementById('TT1_$tok').style.display=" .
"'block'; document.getElementById('TT2_$tok')" .
".style.display='none';\">$link2</a>$text2</div>\n";
return  $out;
}
 
?>
            <?php if (@$errorsAndAlerts): ?>
         
            <div id='errorMessages' ,span class="body-text-bold-yellow"><?php echo $errorsAndAlerts; ?></div>
            <?php endif ?>
            <div id='archivos'></div>
            <div id='formContainer'>
            <?php if ($showForm == 1) : ?>
            <form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" id='createRecord'>
              <fieldset>
                <input type="hidden" name="submitForm" value="1" />
                <label for='first_name'><span class="body-text-bold">First Name:</span><br />
                </label>
                <input class="validate[required]" type="text" id="first_name" name="first_name" value="<?php echo htmlspecialchars(@$_REQUEST['first_name']) ?>" size="50" />
                <br />
                <br />
                <label for='last_name'><span class="body-text-bold">Last Name:</span></label>
                <br />
                <input class="validate[required]" type="text" id="last_name" name="last_name" value="<?php echo htmlspecialchars(@$_REQUEST['last_name']) ?>" size="50" />
                <br />
                <br />
                <?php 
 $names = array(); 
 foreach ($master_exhibition_listRecords as $record){ 
    $names[$record['title']]=$record['title']; 
 } 
?>
                <label for='project_title'><span class="body-text-bold">Exhibition Name:</span><br /><span class="body-text-bold-yellow"> This Field Is Required!</span><br />
                </label>
                <select  class="validate[required]" id="project_title" name="project_title">
                  <option value="">Select an Exhibition Name</option>
                  <?php foreach(mysql_select("master_exhibition_list", "members_only = '0' AND hidden = '0' ") as $exhibitionRecord): ?>
                  <option value="<?php echo $exhibitionRecord['title'];?>"><?php echo $exhibitionRecord['title'];?></option>
                  <?php endforeach?>
                </select>
                <br />
                <label for='street_address'><br />
                  <span class="body-text-bold">Street Address:</span><br />
                </label>
                <input  type="text" id="street_address" name="street_address" value="<?php echo htmlspecialchars(@$_REQUEST['street_address']) ?>" size="50" />
                <label for='city'><br />
                  <span class="body-text-bold">City:</span><br />
                </label>
                <input  type="text" id="city" name="city" value="<?php echo htmlspecialchars(@$_REQUEST['city']) ?>" size="50" />
                <label for='state'><br />
                  <span class="body-text-bold">State:</span><br />
                </label>
                <input  type="text" id="state" name="state" value="<?php echo htmlspecialchars(@$_REQUEST['state']) ?>" size="20" />
                <label for='zip'><br />
                  <span class="body-text-bold">Zip:</span><br />
                </label>
                <input  type="text" id="zip" name="zip" value="<?php echo htmlspecialchars(@$_REQUEST['zip']) ?>" size="20" />
                <label for='web_site'><br />
                  <span class="body-text-bold">Web Site:</span><br />
                </label>
                <input  type="text" id="web_site" name="web_site" value="<?php echo htmlspecialchars(@$_REQUEST['web_site']) ?>" size="20" />
                <br />
                <label for='day_phone'><br />
                  <span class="body-text-bold">Day Phone:</span><br />
                </label>
                <input  type="text" id="day_phone" name="day_phone" value="<?php echo htmlspecialchars(@$_REQUEST['day_phone']) ?>" size="20" />
                <label for='evening_phone'><br />
                  <span class="body-text-bold">Evening Phone:</span><br />
                </label>
                <input  type="text" id="evening_phone" name="evening_phone" value="<?php echo htmlspecialchars(@$_REQUEST['evening_phone']) ?>" size="20" />
                <label for='cell_phone'><br />
                  <span class="body-text-bold">Cell Phone:</span><br />
                </label>
                <input  type="text" id="cell_phone" name="cell_phone" value="<?php echo htmlspecialchars(@$_REQUEST['cell_phone']) ?>" size="20" />
                <br />
                <label for='ok_to_publish_address_contact_information'><br />
                  <span class="body-text-bold">OK To Publish Address Contact Information:</span>&nbsp; </label>
                <input type = "checkbox" id="ok_to_publish_address_contact_information" name="ok_to_publish_address_contact_information" value = "1" <?php checkedIf(1, @$_REQUEST['ok_to_publish_address_contact_information']);?> />
                <label for='ok_to_publish_phone_contact_information'><br />
                  <span class="body-text-bold">OK To Publish Phone Contact Information:</span> &nbsp;&nbsp;</label>
                <input type = "checkbox" id="ok_to_publish_phone_contact_information" name="ok_to_publish_phone_contact_information" value = "1" <?php checkedIf(1, @$_REQUEST['ok_to_publish_phone_contact_information']);?> />
                <label for='ok_to_publish_email_contact_information'><br />
                  <span class="body-text-bold">OK To Publish Email Contact Information:</span>&nbsp;&nbsp; &nbsp;</label>
                <input type = "checkbox" id="ok_to_publish_email_contact_information" name="ok_to_publish_email_contact_information" value = "1" <?php checkedIf(1, @$_REQUEST['ok_to_publish_email_contact_information']);?> />
                <br />
                <label for='paypal_payment_address'><br />
                  <span class="body-text-bold">PayPal Payment Email Address:</span><br />
                  <span class="body-text">This is used only if works are to be sold directly by artists</span><br />
                </label>
                <input  type="text" id="paypal_payment_address" name="paypal_payment_address" value="<?php echo htmlspecialchars(@$_REQUEST['paypal_payment_address']) ?>" size="50" />
                <br />
                <label for='describe_your_artistic_discipline'><br />
                  <span class="body-text-bold">Describe Your Artistic Discipline:</span><br />
                </label>
                <textarea name="describe_your_artistic_discipline" id="describe_your_artistic_discipline" cols="80" rows="4"><?php echo htmlspecialchars(@$_REQUEST['describe_your_artistic_discipline']); ?></textarea>
                <br />
                <label for='artists_statement'><br />
                  <span class="body-text-bold">Artists Statement:</span><br />
                </label>
                <textarea name="artists_statement" id="artists_statement" cols="80" rows="4"><?php echo htmlspecialchars(@$_REQUEST['artists_statement']) ?></textarea>
                <br />
                <br />
                <input class="button" type="submit" name="submitForm" value="Proceed To Select Image Files To Upload And Submit &gt;&gt;" />
              </fieldset>
            </form>
            <?php elseif( $showForm == 2 ) : ?>
            <?php foreach ($e_blast_events_noticeRecords as $record): ?>
            <?php if ($_POST['project_title'] == $record['master_exhibition_title:label']): ?>
            <?php
$endDate = date("M jS, Y", strtotime($record['call_to_artists_end_date']));// end date

//Add one day to endt date
$dateplus1 = strtotime(date("M jS, Y", strtotime($endDate)) . " +1 day");
// echo date('M jS, Y', $dateplus1);

?>
            <?php 
// If submission deadline is past show this message. If not show form.
if ($dateplus1 <= time()): ?>
            <span class="error-text-yellow-italic">The entry submission period for this exhibition ended at midnight (Eastern Time) on <?php echo date("l F jS,  Y", strtotime($record['call_to_artists_end_date'])) ?>.</span>
            <?php $past = '1' ?>
            <?php else :?>
            <form method="post" action="/uploadify/submit_image_forms.php" id='uploadForm'>
              <fieldset>
                <input type='hidden' name='submit_new_data' value='1' />
                <input type="hidden" name="preSaveTempId" value="<?php echo $preSaveTempId ?>" />
                <input type="hidden" name="selectedFile" id='selected' value="no" />
                <input type="hidden" name="project_title" value="<?php echo $project_title; ?>" />
                <br />
                <input id="file_upload" name="file_upload" class='validate[required]' type="file" />
                <?php // This link will only show if a file has been added to the queue ?>
                <div id='uploadLink' style='display:none;'> 
                  <!--<span class="body-text-bold-9">CLICK TO UPLOAD SELECTED IMAGE FILES &gt;&gt;</span>-->
                  <input type='submit' name='submit_this' value='CLICK TO UPLOAD AND SUBMIT ALL YOUR SELECTED IMAGE FILES' />
                </div>
                <span class="body-text-bold"><br />CAUTION: Do not close this window or your submission may not complete and some or all of your image files may not be uploaded.<br />
                </span> <br />
                <span class="heading-text-yellow">You will see a confirmation once your images have been successfuly uploaded.</span><br />
                <br />
                <span class="heading-text-bold">If you should close this window by mistake, you'll have to begin the submission upload process again.<br />
                <br />
                </span>
              </fieldset>
            </form>
            <?PHP endif ?>
            <?PHP endif ?>
            <?php endforeach ?>
            <?php else : ?>
            <span class="body-text-bold">Unknown request made.</span>
         
            <?php endif; ?></div></td>
        </tr>
      </table></td>
  </tr>
</table>
<br /><br />
<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>