/**
  * Outputs the search form
  */
 function outputSearchReviews()
 {
     global $application;
     $start_year = (int) modApiFunc('Settings', 'getParamValue', 'VISUAL_INTERFACE', 'SEARCH_START_YEAR');
     $year_offset = (int) ((int) (date("Y") - $start_year) + modApiFunc('Settings', 'getParamValue', 'VISUAL_INTERFACE', 'SEARCH_YEAR_OFFSET'));
     $template_contents = array('LabelPending' => $this->outputLabel('ShowPendingReviews'), 'LabelBad' => $this->outputLabel('ShowBadReviews'), 'LabelGood' => $this->outputLabel('ShowGoodReviews'), 'LabelAll' => $this->outputLabel('ShowAllReviews'), 'LabelDate' => $this->outputLabel('SearchReviews', 'from'), 'LabelAuthor' => $this->outputLabel('SearchReviews', 'author'), 'LabelIPAddress' => $this->outputLabel('SearchReviews', 'ip_address'), 'LabelProduct' => $this->outputLabel('SearchReviews', 'product'), 'LabelRating' => $this->outputLabel('SearchReviews', 'rating'), 'LabelStatus' => $this->outputLabel('SearchReviews', 'status'), 'CountPending' => $this->outputCount('pending'), 'CountBad' => $this->outputCount('bad'), 'CountGood' => $this->outputCount('good'), 'CountAll' => $this->outputCount('all'), 'ActionField' => '<input type="hidden" ' . HtmlForm::genHiddenField('asc_action', 'SearchReviews') . ' />', 'ProductField' => '<input type="hidden" ' . HtmlForm::genHiddenField('product_id', @$this->_search_filter['product']['id']) . ' />', 'SelectFromDay' => HtmlForm::genDropdownDaysList('from_day', @$this->_search_filter['from']['day']), 'SelectFromMonth' => HtmlForm::genDropdownMonthsList('from_month', @$this->_search_filter['from']['month']), 'SelectFromYear' => HtmlForm::genDropdownYearsList('from_year', @$this->_search_filter['from']['year'], $start_year, $year_offset), 'SelectToDay' => HtmlForm::genDropdownDaysList('to_day', @$this->_search_filter['to']['day']), 'SelectToMonth' => HtmlForm::genDropdownMonthsList('to_month', @$this->_search_filter['to']['month']), 'SelectToYear' => HtmlForm::genDropdownYearsList('to_year', @$this->_search_filter['to']['year'], $start_year, $year_offset), 'AuthorField' => '<input class="form-control input-sm input-large" style="float:left;" type="text"' . HtmlForm::genInputTextField('128', 'author_name', 52, prepareHTMLDisplay(@$this->_search_filter['author']['name'])) . ' />', 'AuthorCheckbox' => HtmlForm::genCheckbox(array('value' => 'Y', 'is_checked' => @$this->_search_filter['author']['exactly'] == 'Y' ? 'checked' : '', 'name' => 'author_exactly', 'id' => 'author_exactly')), 'IPAddressField' => '<input class="form-control input-sm input-large" type="text"' . HtmlForm::genInputTextField('15', 'ip_address', 52, prepareHTMLDisplay(@$this->_search_filter['ip_address'])) . ' />', 'ProductNameField' => '<input class="form-control input-sm input-large" style="float:left;" type="text"' . HtmlForm::genInputTextField('128', 'product_name', 52, prepareHTMLDisplay(@$this->_search_filter['product']['name'])) . ' />', 'ProductCheckbox' => HtmlForm::genCheckbox(array('value' => 'Y', 'is_checked' => @$this->_search_filter['product']['exactly'] == 'Y' ? 'checked' : '', 'name' => 'product_exactly', 'id' => 'product_exactly')), 'RatingSelect' => HtmlForm::genDropdownSingleChoice(array('select_name' => 'rate', 'selected_value' => @$this->_search_filter['rating']['rate'], 'id' => 'rate', 'class' => 'input-small rating-margin-btm', 'values' => modApiFunc('Customer_Reviews', 'getRateValues'))), 'RatingAddSelect' => HtmlForm::genDropdownSingleChoice(array('select_name' => 'rate_range', 'selected_value' => @$this->_search_filter['rating']['range'], 'id' => 'rate_range', 'class' => 'input-small', 'values' => array(array('value' => '+', 'contents' => getMsg('CR', 'CR_ABOVE')), array('value' => '=', 'contents' => getMsg('CR', 'CR_EXACTLY')), array('value' => '-', 'contents' => getMsg('CR', 'CR_BELOW'))))), 'StatusSelect' => HtmlForm::genDropdownSingleChoice(array('select_name' => 'status', 'selected_value' => @$this->_search_filter['status'], 'id' => 'status', 'class' => 'input-small', 'values' => array(array('value' => 'All', 'contents' => getMsg('CR', 'CR_STATUS_ALL')), array('value' => 'A', 'contents' => getMsg('CR', 'CR_STATUS_APPROVED')), array('value' => 'P', 'contents' => getMsg('CR', 'CR_STATUS_PENDING')), array('value' => 'N', 'contents' => getMsg('CR', 'CR_STATUS_NOTAPPROVED'))))));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill('customer_reviews/manage_customer_reviews/', 'search-reviews.tpl.html', array());
 }
 /**
  * Outputs the date/time select boxes
  */
 function outputReviewDate()
 {
     global $application;
     if (isset($this->_Review_Data['datetime'])) {
         $datetime = modApiFunc('Localization', 'SQL_date_format', $this->_Review_Data['datetime'], 'Y-m-d H:i:s');
     } else {
         $datetime = modApiFunc('Localization', 'SQL_date_format', date('Y-m-d H:i:s'), 'Y-m-d H:i:s');
     }
     list($date, $time) = explode(' ', $datetime);
     $date = explode('-', $date);
     $time = explode(':', $time);
     $template_contents = array('SelectDay' => HtmlForm::genDropdownDaysList('review_data[day]', $date[2]), 'SelectMonth' => HtmlForm::genDropdownMonthsList('review_data[month]', $date[1]), 'SelectYear' => HtmlForm::genDropdownYearsList('review_data[year]', $date[0], CUSTOMER_REVIEWS_HIDDEN_START_YEAR, max(1, intval(date('Y')) - CUSTOMER_REVIEWS_HIDDEN_START_YEAR)), 'SelectHour' => $this->outputField('hour', $time[0], 24), 'SelectMinute' => $this->outputField('minute', $time[1], 60), 'SelectSecond' => $this->outputField('second', $time[2], 60));
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill('customer_reviews/review_data/', 'output-review-date.tpl.html', array());
 }