$this->table = GLM_MEMBERS_OBITS_PLUGIN_DB_PREFIX . 'obits';
$view = 'search';
-
+ $placeholders = array('Last Name', 'First Middle', 'Birth Year', 'Death Year', 'Maiden or Other Name', 'Spouse or Partner Name');
$year_ranges = new glmObitSupportFunctions($this->wpdb, $this->config);
$birth_death_range = array('birth' => $year_ranges->getObitYearRange(BIRTH_YEAR_START), 'death' => $year_ranges->getObitYearRange(DEATH_YEAR_START));
$form_data = $_POST;
- // build array of potential search fields , will be used in the paging urls
+ // build array of potential search fields , will be used in the paging url
$form_fields = array(
'last' => filter_var($form_data['last_name'],FILTER_SANITIZE_STRING),
'first' => filter_var($form_data['first_mid'],FILTER_SANITIZE_STRING),
'spouse' => filter_var($form_data['spouse_partner'],FILTER_SANITIZE_STRING),
'maiden' => filter_var($form_data['maiden_other'],FILTER_SANITIZE_STRING)
);
-
+
+ //clear the placeholder values from the jquery html input fix
+ foreach($form_fields as $field=>$f){
+ if( in_array($f, $placeholders) ){
+ $form_fields[$field] = '';
+ }
+ }
$get_fields = array(
'last_name' => filter_var($_GET['last'],FILTER_SANITIZE_STRING),
'first_mid' => filter_var($_GET['first'],FILTER_SANITIZE_STRING),
// separate the search fields from the logic ('not', 'contains, 'equals') etc.
foreach($form_data as $key=>$value){
- if (isset($value) && $value !== ''){
+ if (isset($value) && $value !== '' && !in_array($value,$placeholders) ){
if( $value !== 'Search' && $key !== 'conditions' && $key !== 'results-limit'){
if(strpos($key,'-logic') === false && strpos($key,'not-') === false ) {
$value = filter_var($value, FILTER_SANITIZE_STRING);
}
}
-
// check to see if there are 8 empty values, if there are, there are no search values
if(count($empty_values) === 8){
$empty_search = 'true';
$where = $search;
}
-
+
+
// begin paging
if (isset($_REQUEST['pageSelect'])) {
$start = $newStart;
}
}
-
+
$obits = $this->getList($where, 'last_name', $fieldVals = true, $idField = 'id', $start, $per_page);
$returned = $obits['returned'];
<div class="row">
<form action="{$thisUrl}" method="post" enctype="multipart/form-data" name="obits-search" id="obits-search">
+ <div class="show-search small-3 columns show-for-medium-down">Show Search</div>
<div class="small-12 large-3 columns small-centered large-uncentered search-sidebar-container">
<div class="search-sidebar">
<!-- {include file='front/obits/search.html'}-->
<div class="small-12 columns">
<input class="sidebar-criteria" type="radio" checked value="all" name="conditions[]">All
<input class="sidebar-criteria" type="radio" value="any" name="conditions[]">Any
- <a href="#" class="expand-collapse">Show Options</a>
+
+ <a href="#" class="expand-collapse">Show Options</a>
+
<div class="row search-row">
<div class="small-12 columns search-label hide ">
Last Name:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-last">Not</label>
<input type="checkbox" value="not" id="not-last" name="not-last_name">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
<input {if $get_params.last}value="{$get_params.last}"{/if}{if $search.last}value="{$search.last}"{/if} type="text" name="last_name" placeholder="Last Name">
</div>
</div>
First Name & Middle:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-first_mid">Not</label>
<input type="checkbox" value="not" id="not-first_mid" name="not-first_mid">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
- <input {if $get_params.first}value="{$get_params.first}"{/if}{if $search.first}value="{$search.first}"{/if} type="text" name="first_mid" placeholder="First - Middle Name">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
+ <input {if $get_params.first}value="{$get_params.first}"{/if}{if $search.first}value="{$search.first}"{/if} type="text" name="first_mid" placeholder="First Middle">
</div>
</div>
Birth Year:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-b_year">Not</label>
<input type="checkbox" value="not" id="not-b_year" name="not-b_year">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
- <input {if $get_params.b_yr}value="{$get_params.b_yr}"{/if}{if $search.b_yr}value="{$search.b_yr}"{/if} type="text" name="b_year" placeholder="Year of Birth">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
+ <input {if $get_params.b_yr}value="{$get_params.b_yr}"{/if}{if $search.b_yr}value="{$search.b_yr}"{/if} type="text" name="b_year" placeholder="Birth Year">
</div>
</div>
Birth Year Range:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-b_yr_range">Not</label>
<input type="checkbox" value="not" id="not-b_yr_range" name="not-b_yr_range">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
<select name="b_yr_range" id="">
<option value="">Select Birth Year Range</option>
{foreach from=$birth_death_range.birth item=r}
Death Year:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-death">Not</label>
<input type="checkbox" value="not" id="not-death" name="not-d_year">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
- <input }{if $search.d_yr}value="{$search.d_yr}"{/if} type="text" name="d_year" placeholder="Year of Death">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
+ <input }{if $search.d_yr}value="{$search.d_yr}"{/if} type="text" name="d_year" placeholder="Death Year">
</div>
</div>
Death Year Range:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-d_yr_range">Not</label>
<input type="checkbox" value="not" id="not-d_yr_range" name="not-d_yr_range">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
<select name="d_yr_range" id="d_yr_range-range">
<option value="">Select Death Year Range</option>
{foreach from=$birth_death_range.death item=r}
Maiden or Other Name:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-maiden_other">Not</label>
<input type="checkbox" value="not" id="not-maiden" name="not-maiden_other">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
- <input {if $search.maiden}value="{$search.maiden}"{/if} type="text" name="maiden_other" placeholder="Maiden or Other">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
+ <input {if $search.maiden}value="{$search.maiden}"{/if} type="text" name="maiden_other" placeholder="Maiden or Other Name">
</div>
</div>
Spouse / Partner Name:
</div>
<div class="options-wrapper">
- <div class="small-3 large-4 not-wrapper columns">
+ <div class="small-offset-1 small-3 medium-offset-2 large-offset-0 large-4 not-wrapper columns">
<label for="not-spouse_partner">Not</label>
<input type="checkbox" value="not" value="not" id="not-spouse" name="not-spouse_partner">
</div>
</select>
</div>
</div>
- <div class="small-12 columns">
- <input {if $get_params.spouse}value="{$get_params.spouse}"{/if}{if $search.spouse}value="{$search.spouse}"{/if} type="text" name="spouse_partner" placeholder="Spouse or Partner">
+ <div class="small-offset-1 small-10 medium-offset-2 medium-7 large-offset-0 large-12 columns">
+ <input {if $get_params.spouse}value="{$get_params.spouse}"{/if}{if $search.spouse}value="{$search.spouse}"{/if} type="text" name="spouse_partner" placeholder="Spouse or Partner Name">
</div>
</div>
<div class="search-btn-container">
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
- var results_limit = {$limit};
+ var results_limit = {$limit},
+ alpha = '{$alpha_key}' ;
- var alpha = '{$alpha_key}' ;
$('.glm-alpha-link').each(function(){
if( $(this).text() === alpha){
$(this).addClass("selected-alpha");
}
});
+ $('#results-limit').val(results_limit);
-
+ // fixes placeholder problem cross browser
+ $('[placeholder]').focus(function() {
+ var input = $(this);
+ if (input.val() == input.attr('placeholder')) {
+ input.val('');
+ input.removeClass('placeholder');
+ }
+ }).blur(function() {
+ var input = $(this);
+ if (input.val() == '' || input.val() == input.attr('placeholder')) {
+ input.addClass('placeholder');
+ input.val(input.attr('placeholder'));
+ }
+ }).blur();
+
$('#results-limit').val(results_limit);
});
</script>
\ No newline at end of file