oc-content/themes/veronika/functions.php
// SIMPLE PERIOD SELECT (search only)
SIMPLE PERIOD SELECT (search only)
SIMPLE PERIOD SELECT ( search only )
function veronika_simple_period( $select = false ) {
  $id = Params::getParam('sPeriod');
  if($id == "") {
    $name = __('Any age', 'veronika');
  } else if ($id == 1) {
    $name = __('1 day old', 'veronika');
  } else if ($id == 2) {
    $name = __('2 days old', 'veronika');
  } else if ($id == 7) {
    $name = __('1 week old', 'veronika');
  } else if ($id == 14) {
    $name = __('2 weeks old', 'veronika');
  } else if ($id == 31) {
    $name = __('1 month old', 'veronika');
  } else {
    $name = __('Other age', 'veronika');
  }
  if( !$select ) {
    $html  = '<div class="simple-period simple-select">';
    $html .= '<input type="hidden" name="sPeriod" class="input-hidden" value="' . $id . '"/>';
    $html .= '<span class="text round3 tr1"><span>' . $name . '</span> <i class="fa fa-angle-down"></i></span>';
    $html .= '<div class="list">';
    $html .= '<div class="option info">' . __('Choose period', 'veronika') . '</div>';
    $html .= '<div class="option bold' . ($id == "" ? ' selected' : '') . '" data-id="">' . __('Any age', 'veronika') . '</div>';
    $html .= '<div class="option' . ($id == "1" ? ' selected' : '') . '" data-id="1">' . __('1 day old', 'veronika') . '</span></div>';
    $html .= '<div class="option' . ($id == "2" ? ' selected' : '') . '" data-id="2">' . __('2 days old', 'veronika') . '</span></div>';
    $html .= '<div class="option' . ($id == "7" ? ' selected' : '') . '" data-id="7">' . __('1 week old', 'veronika') . '</span></div>';
    $html .= '<div class="option' . ($id == "14" ? ' selected' : '') . '" data-id="14">' . __('2 weeks old', 'veronika') . '</span></div>';
    $html .= '<div class="option' . ($id == "31" ? ' selected' : '') . '" data-id="31">' . __('1 month old', 'veronika') . '</span></div>';
    $html .= '</div>';
    $html .= '</div>';
    return $html;
  } else {
    $html  = '<select class="sPeriod" id="sPeriod" name="sPeriod">';
    $html .= '<option value="" ' . ($id == "" ? ' selected="selected"' : '') . '>' . __('Any age', 'veronika') . '</option>';
    $html .= '<option value="1" ' . ($id == "1" ? ' selected="selected"' : '') . '>' . __('1 day old', 'veronika') . '</option>';
    $html .= '<option value="2" ' . ($id == "2" ? ' selected="selected"' : '') . '>' . __('2 days old', 'veronika') . '</option>';
    $html .= '<option value="3" ' . ($id == "7" ? ' selected="selected"' : '') . '>' . __('1 week old', 'veronika') . '</option>';
    $html .= '<option value="4" ' . ($id == "14" ? ' selected="selected"' : '') . '>' . __('2 weeks old', 'veronika') . '</option>';
    $html .= '<option value="4" ' . ($id == "31" ? ' selected="selected"' : '') . '>' . __('1 month old', 'veronika') . '</option>';
    $html .= '</select>';
    return $html;
  }
}
function veronika_simple_period ( $ select = false ) { $ id = Params :: getParam ( 'sPeriod' ) ; if ( $ id == " " ) { $ name = __ ( 'Any age' , 'veronika' ) ; } else if ( $ id == 1 ) { $ name = __ ( '1 day old' , 'veronika' ) ; } else if ( $ id == 2 ) { $ name = __ ( '2 days old' , 'veronika' ) ; } else if ( $ id == 7 ) { $ name = __ ( '1 week old' , 'veronika' ) ; } else if ( $ id == 14 ) { $ name = __ ( '2 weeks old' , 'veronika' ) ; } else if ( $ id == 31 ) { $ name = __ ( '1 month old' , 'veronika' ) ; } else { $ name = __ ( 'Other age' , 'veronika' ) ; } if ( ! $ select ) { $ html = '<div class="simple-period simple-select">' ; $ html .= '<input type="hidden" name="sPeriod" class="input-hidden" value="' . $ id . '"/>' ; $ html .= '<span class="text round3 tr1"><span>' . $ name . '</span> <i class="fa fa-angle-down"></i></span>' ; $ html .= '<div class="list">' ; $ html .= '<div class="option info">' . __ ( 'Choose period' , 'veronika' ) . '</div>' ; $ html .= '<div class="option bold' . ( $ id == " " ? ' selected' : '' ) . '" data-id="">' . __ ( 'Any age' , 'veronika' ) . '</div>' ; $ html .= '<div class="option' . ( $ id == " 1 " ? ' selected' : '' ) . '" data-id="1">' . __ ( '1 day old' , 'veronika' ) . '</span></div>' ; $ html .= '<div class="option' . ( $ id == " 2 " ? ' selected' : '' ) . '" data-id="2">' . __ ( '2 days old' , 'veronika' ) . '</span></div>' ; $ html .= '<div class="option' . ( $ id == " 7 " ? ' selected' : '' ) . '" data-id="7">' . __ ( '1 week old' , 'veronika' ) . '</span></div>' ; $ html .= '<div class="option' . ( $ id == " 14 " ? ' selected' : '' ) . '" data-id="14">' . __ ( '2 weeks old' , 'veronika' ) . '</span></div>' ; $ html .= '<div class="option' . ( $ id == " 31 " ? ' selected' : '' ) . '" data-id="31">' . __ ( '1 month old' , 'veronika' ) . '</span></div>' ; $ html .= '</div>' ; $ html .= '</div>' ; return $ html ; } else { $ html = '<select class="sPeriod" id="sPeriod" name="sPeriod">' ; $ html .= '<option value="" ' . ( $ id == " " ? ' selected="selected"' : '' ) . '>' . __ ( 'Any age' , 'veronika' ) . '</option>' ; $ html .= '<option value="1" ' . ( $ id == " 1 " ? ' selected="selected"' : '' ) . '>' . __ ( '1 day old' , 'veronika' ) . '</option>' ; $ html .= '<option value="2" ' . ( $ id == " 2 " ? ' selected="selected"' : '' ) . '>' . __ ( '2 days old' , 'veronika' ) . '</option>' ; $ html .= '<option value="3" ' . ( $ id == " 7 " ? ' selected="selected"' : '' ) . '>' . __ ( '1 week old' , 'veronika' ) . '</option>' ; $ html .= '<option value="4" ' . ( $ id == " 14 " ? ' selected="selected"' : '' ) . '>' . __ ( '2 weeks old' , 'veronika' ) . '</option>' ; $ html .= '<option value="4" ' . ( $ id == " 31 " ? ' selected="selected"' : '' ) . '>' . __ ( '1 month old' , 'veronika' ) . '</option>' ; $ html .= '</select>' ; return $ html ; } }
SIMPLE PERIOD SELECT (search only)
SIMPLE PERIOD SELECT ( search only )