<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php include ("../_website_init.php"); ?>
<?php // if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); } ?>
<?php 
  // error checking
   if (@$_REQUEST['save']) 
  { 
 
   $action = '' ;
   
  }
?>
<?php
      $searchOptions = array();
      $searchOptions['keywords'] = @$FORM['q'];
      $searchOptions['perPage']  = "30";
      $searchOptions['debugSql'] = "0";

      $searchTables = array();
      $searchTables['family_stories'] = array(
        'viewerUrl'       => 'story_detail.php',
        'titleField'      => 'title',
        'summaryField'    => 'sub_title',
        'searchFields'    =>  array('title','sub_title','story'),
		
      );
	  
$searchTables['resources'] = array(
        'viewerUrl'       => 'resourcedetails.php',
        'titleField'      => 'title',
        'summaryField'    => 'category',
        'searchFields'    =>  array('title', 'category','description'),
    
	  );

$searchTables['help_pages'] = array(
        'viewerUrl'       => 'help.php',
        'titleField'      => 'title',
        'summaryField'    => 'title',
        'searchFields'    =>  array('title', 'content'),
    
	  );	  
	  
   if($CURRENT_USER['isAdmin'])
    {  $searchTables['faq'] = array(
        'viewerUrl'       => 'faqdetail.php',
        'titleField'      => 'question',
        'summaryField'    => 'category',
        'searchFields'    =>  array('category','question','answer'),
     
	  );
   }
	  

 $searchTables['uploads'] = array(
        'viewerUrl'       => 'images.php',
        'titleField'      => 'filePath',
        'summaryField'    => 'thumbFilePath', 
		'info1Field'      =>  'info1',
		'info2Field'      =>  'info2',
		'info3Field'      =>  'info3',
		'info4Field'      =>  'info4',
		'info5Field'      =>  'info5',
        'searchFields'    =>  array('filePath',	 'info1','info2', 'info3', 'info4', 'info5'),
    
	  );

      list($searchRows, $searchDetails) = searchMultipleTables($searchTables, $searchOptions);
    ?>
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.fsSubmit
{
padding: 10px 20px 11px !important;
font-size: 30px !important;
/*background-color: #F36C8C;*/
font-weight: bold;
text-shadow: 1px 1px #000;
color: #fea407;
border-radius: 100px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
border: 2px solid #fea407;
cursor: pointer;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
</style>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pollick.net - Search</title>
<meta name="robots" content="noindex,nofollow" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<link href="../css/pollick.css" rel="stylesheet" type="text/css" />
<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; 
?>">
<link rel="stylesheet" href="royalslider/royalslider.css">
<link rel="stylesheet" href="royalslider/skins/default/rs-default.css">
<script src='royalslider/jquery-1.8.3.min.js'></script>
<script src="royalslider/jquery.royalslider.min.js"></script>
<style type='text/css'>
.royalSlider .rsNav, .royalSlider .rsGCaption {
	position: relative;
	float: left;
	left: 0 !important;
	bottom: 0 !important;
	right: 0 !important;
	width: 100%;
	text-align: center;
	padding: 0;
}
.royalSlider {
	text-align: left;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
$('.royalSlider').royalSlider({
    //autoScaleSlider:false,
    controlNavigation: 'thumbnails',
    autoScaleSlider: true,
	autoScaleSliderWidth: 960,     
  autoScaleSliderHeight: 580,
  // Height of entire slider div
 // autoScaleSliderHeight: 880,
	arrowsNav:true,
	arrowsNavAutoHide: false,
	arrowsNavHideOnTouch: true,
	// imageScaleMode: 'fit-if-smaller',
	fitInViewport:true,
	loop: true,
	fullscreen: {
	   enabled: false,
    		nativeFS: false
    	},
    globalCaption: true,
	numImagesToPreload:2,
	fadeinLoadedSlide: true,
	keyboardNavEnabled: true,
	navigateByClick: true,
    thumbs: {
    appendSpan: true,
      firstMargin: true,
      paddingBottom: 40
	  
    }
});
$('.rsGCaption').after( $('.rsNav') );
});  

</script>
</head>

<body background="pics/wall.gif" link="#FFFFFF" vlink="#FFFFFF">

<div  align="center">
  <?php foreach ($mastheadsRecord['search'] as $index => $upload): ?>
  <img src="<?php echo $upload['urlPath'] ?>"   alt="Search" />
  <?php endforeach ?>
</div>
<br />
<?php include ("_mainnavmenu.php"); ?>
<br />
<table align="center" border="0" width="70%">
  <tr>
    <td align="center" colspan="2"><br />
      <span class=" navigation_font">Need To Log Off?</span> <a href='?action=logoff'><span class=" navigation_font">Click/Tap Here</span></a><br><br><br>
     </td></tr>
  <?php if  (!@$_REQUEST['save'] == 1 ):
		    ?>
    <tr><td align="center" colspan="2"><span style="font-size:1.6em;" class="navigation_font" >Search Our Site For Keywords</span><br><span style="font-size:1.2em;" class="navigation_font" >Your search results will include any matching keywords found in family stories,image captions, help menus and any other text on the site, except in the genealogy section of our site.<br><br>Enter your search term below (name, place,etc.), then click/tap on the search button.<br><br>You can surround your search terms with quotes I.E. “search terms”, to force an exact-match search.<br />If not the list will include results that contain any or all words or partial words.</span><br><br><span style="font-size:1.6em;" class="navigation_font" >Your Help Is Needed</span><br><span style="font-size:1.2em;" class="navigation_font" >Please help to identify unknown members of our family. Just enter a ? (question mark) in the search box and you'll come up with a list of images that have individuals needing identification.<br>If you know any of them, let us know </span> <a href="contact.php"><span style="font-size:1.2em; color:#fea407; text-decoration:underline" class="navigation_font" >HERE.</span></a></td>
  </tr>
  <tr>
    <td class="text_font" align="left" style="text-align:left"><br>
      <form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
    <input class="fsSubmit navigation_font" type="text" name="q" value="<?php echo htmlspecialchars(@$FORM['q']); ?>" size="50" autocomplete="off">
     <input type="hidden" name="save" value="1" />
    <input class="fsSubmit navigation_font" type="submit" name="" value="Search">
    
  </form>
  <?php endif ?>  
    
  <?php if (@$_REQUEST['save'] == 1):?></table><table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tr>
        <td ><br/> 
    <br/><a href="search.php"><span class="fsSubmit">Cancel Search Filters - Start Another Search</span></a>
              <br><br><span style="font-size:20px;" class="navigation_font" >Search results for <b><?php echo htmlspecialchars(@$FORM['q']); ?></b> - This page shows results <b><?php echo htmlspecialchars(@$searchDetails['pageResultsStart']); ?></b> to <b><?php echo htmlspecialchars(@$searchDetails['pageResultsEnd']); ?></b> out of <b><?php echo htmlspecialchars(@$searchDetails['totalRecords']); ?></b> found.</span></td>
      </tr>
  </table><?php endif ?>
    <br/>
    <!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
   <?php if ($searchDetails['prevPage']): ?>
    <a href="<?php echo $searchDetails['prevPageLink'] ?>"><span style="font-size:20px;" class="navigation_font" >&lt;&lt; previous page</a></span>
    <?php else: ?>
    &nbsp;
    <?php endif ?>
   <?php if (@$_REQUEST['save'] == 1):?><span style="font-size:20px;" class="navigation_font" >- page </span><span style="font-size:20px;" class="navigation_font" ><?php echo $searchDetails['page'] ?></span><span style="font-size:20px;" class="navigation_font" > of </span><span style="font-size:20px;" class="navigation_font" ><?php echo $searchDetails['totalPages'] ?> -</span><?php endif ?>
    <?php if ($searchDetails['nextPage']): ?>
    <a href="<?php echo $searchDetails['nextPageLink'] ?>"><span style="font-size:20px;" class="navigation_font" >next page &gt;&gt;</a></span>
    <?php else: ?>
    &nbsp;
    <?php endif ?>
    <!-- /STEP3: Display Page Links --> 
    
    <!-- show errors -->
    <?php if ($searchDetails['invalidPageNum']): ?>
    <span style="font-size:20px;" class="navigation_font" >Results page '<?php echo $searchDetails['page']?>' not found,</span> <a href="<?php echo $searchDetails['firstPageLink'] ?>"><span style="font-size:20px;" class="navigation_font" >start over &gt;&gt;</span></a>.<br/>
    <?php elseif ($searchOptions['keywords'] && $searchDetails['noRecordsFound']): ?>
    <span style="font-size:20px;" class="navigation_font" >next &gt;&gt; &nbsp; Sorry, we can't find any matches for the search term you entered, please try again.</span><br/>
    <br/>
    <?php elseif ($searchOptions['keywords'] == ""): ?>
   <span class="navigation_font" style="font-size:20px;">Please enter at least one keyword to search for.</span><br/>
    <br/>
    <?php endif ?>

     <!-- STEP2: Display Record List -->
     <hr align="left" style="width:50%; color:#FFF">
       <?php $previous_table = ''; ?>
   <?php $count = '' ?>    
<?php foreach ($searchRows as $record): ?>

<?php if ($previous_table != $record['tablename']): ?>
  <?php if ($record['tablename'] == 'family_stories'): ?>
    <h2 class="navigation_font" style="font-size:1.5em">STORIES</h2>
  <?php elseif ($record['tablename'] == 'resources'): ?>
    <h2 class="navigation_font" style="font-size:1.5em">RESOURCES</h2>
	<?php elseif ($record['tablename'] == 'faq'): ?>
    <h2 class="navigation_font" style="font-size:1.5em">FAQS</h2>
    <?php elseif ($record['tablename'] == 'help_pages'): ?>
    <h2 class="navigation_font" style="font-size:1.5em">HELP</h2>
     <?php elseif ($record['tablename'] == 'uploads'): ?>
    <h2 class="navigation_font" style="font-size:1.5em">IMAGES</h2>
  <?php endif; ?>
  <?php  $previous_table = $record['tablename']; ?>
<?php endif; ?>

 <?php if ($record['tablename'] == 'uploads'): ?> 
  <?php $count++ ?>
  <?php if ($count ==1 ):?><div class="royalSlider rsDefault"><?php endif ?>
        
        <div > <a class="rsImg " href="http://pollick.net/cmsAdmin/uploads/<?php echo $record['_title'] ?>">
         <?PHP $record['_info1'] = preg_replace("/[\"]/", "''", $record['_info1'] ); ?>
          <?PHP $record['_info2'] = preg_replace("/[\"]/", "''", $record['_info2'] ); ?>
          <?PHP $record['_info3'] = preg_replace("/[\"]/", "''", $record['_info3'] ); ?>
          <?PHP $record['_info4'] = preg_replace("/[\"]/", "''", $record['_info4'] ); ?>
          <?PHP $record['_info5'] = preg_replace("/[\"]/", "''", $record['_info5'] ); ?>
          <br><br>
          <div align='center' style='font-size:1.4em; vertical-align:top; text-align:left;' class='text_font' ><?php echo($record['_info1']) ?> <?php echo($record['_info2']) ?> <?php echo($record['_info3']) ?> <?php echo($record['_info4']) ?> <?php echo($record['_info5']) ?></div>  
          </a>
          <div class="rsTmb" ><img class="rsTmb" src="http://pollick.net/cmsAdmin/uploads/<?php echo $record['_summary'] ?>"/></div>
        </div>
        
      
 
 <?php else:?> <a href="<?php if ($record['tablename'] == 'help_pages'): ?>help.php?#<?php echo $record['num']?><?php else : ?><?php echo $record['_link'] ?><?php endif ?>"><span class="navigation_font" style="font-size:1.25em; text-decoration:underline"><?php echo $record['_title'] ?></span></a><br/>
    <?php if ($record['tablename'] != 'uploads'): ?>
	<?php  if ($record['_summary']): ?>
        <span class="navigation_font" style="font-size:1.2em;"><?php echo $record['_summary'] ?></span><br/>
    <?php  else: ?>
   <span class="navigation_font" style="font-size:1.2em;">No description is available for this page.</span><br/><?php endif ?><?php elseif ($record['tablename'] == 'uploads'): ?>&nbsp;
    <?php  endif ?>
    <hr align="left" style="width:50%; color:#FFF" >
  <?php endif ?>  
<?php endforeach; ?>

<!-- /STEP2: Display Record List -->
</div>
<br />
<br />
<br />
<br />
<p align="center"><a href="http://www.pollick.net/OK/contact.php"><img
src="pics/email10-21-98.gif" width="81" height="36" alt="email10-21-98.gif (1893 bytes)"></a><img
src="pics/tree23.gif" width="130" height="166" alt="tree23.gif (4347 bytes)" align="right"></p>
</body>
</html>