public function initialize() { $OSCOM_PDO = Registry::get('PDO'); $Qmanufacturers = $OSCOM_PDO->query('select manufacturers_id as id, manufacturers_name as text from :table_manufacturers order by manufacturers_name'); $Qmanufacturers->setCache('manufacturers'); $Qmanufacturers->execute(); $manufacturers_array = array(array('id' => '', 'text' => OSCOM::getDef('pull_down_default'))); foreach ($Qmanufacturers->fetchAll() as $m) { $manufacturers_array[] = $m; } $this->_content = '<form name="manufacturers" action="' . OSCOM::getLink() . '" method="get">' . HTML::hiddenField('Index', null) . HTML::selectMenu('Manufacturers', $manufacturers_array, null, 'onchange="this.form.submit();" size="' . BOX_MANUFACTURERS_LIST_SIZE . '" style="width: 100%"') . HTML::hiddenSessionIDField() . '</form>'; }
public function initialize() { $OSCOM_Currencies = Registry::get('Currencies'); $data = array(); foreach ($OSCOM_Currencies->getData() as $key => $value) { $data[] = array('id' => $key, 'text' => $value['title']); } if (count($data) > 1) { $hidden_get_params = ''; foreach ($_GET as $key => $value) { if ($key != 'currency' && $key != Registry::get('Session')->getName() && $key != 'x' && $key != 'y') { $hidden_get_params .= HTML::hiddenField($key, $value); } } $this->_content = '<form name="currencies" action="' . OSCOM::getLink(null, null, null, 'AUTO', false) . '" method="get">' . $hidden_get_params . HTML::selectMenu('currency', $data, $_SESSION['currency'], 'onchange="this.form.submit();" style="width: 100%"') . HTML::hiddenSessionIDField() . '</form>'; } }
public static function getBatchPagesPullDownMenu($batch_keyword = 'page', $total, $parameters = null) { $batch_number = (isset($_GET[$batch_keyword]) && is_numeric($_GET[$batch_keyword]) ? $_GET[$batch_keyword] : 1); $number_of_pages = ceil($total / MAX_DISPLAY_SEARCH_RESULTS); $pages_array = array(); for ( $i = 1; $i <= $number_of_pages; $i++ ) { $pages_array[] = array('id' => $i, 'text' => $i); } $hidden_parameter = ''; if ( !empty($parameters) ) { $parameters = explode('&', $parameters); foreach ( $parameters as $parameter ) { $keys = explode('=', $parameter, 2); if ( $keys[0] != $batch_keyword ) { $hidden_parameter .= HTML::hiddenField($keys[0], (isset($keys[1]) ? $keys[1] : '')); } } } $string = '<form action="' . OSCOM::getLink(null, null) . '" action="get">' . $hidden_parameter . sprintf(OSCOM::getDef('result_set_current_page'), HTML::selectMenu($batch_keyword, $pages_array, $batch_number, 'onchange="this.form.submit();"'), $number_of_pages) . HTML::hiddenSessionIDField() . '</form>'; return $string; }
if (isset($_GET['Manufacturers']) && !empty($_GET['Manufacturers'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from :table_products p, :table_products_to_categories p2c, :table_categories c, :table_categories_description cd, :table_templates_boxes tb, :table_product_attributes pa where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int) $OSCOM_Language->getID() . "' and tb.code = 'Manufacturers' and tb.id = pa.id and pa.products_id = p.products_id and pa.value = '" . (int) $_GET['Manufacturers'] . "' order by cd.categories_name"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from :table_products p, :table_products_to_categories p2c, :table_manufacturers m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $OSCOM_Category->getID() . "' order by m.manufacturers_name"; } $Qfilterlist = $OSCOM_PDO->query($filterlist_sql); $Qfilterlist->execute(); $filter_result = $Qfilterlist->fetchAll(); if (count($filter_result) > 1) { echo '<p><form name="filter" action="' . OSCOM::getLink() . '" method="get">' . $OSCOM_Language->get('filter_show') . ' '; if (isset($_GET['Manufacturers']) && !empty($_GET['Manufacturers'])) { echo HTML::hiddenField('Manufacturers', $_GET['Manufacturers']); $options = array(array('id' => '', 'text' => OSCOM::getDef('filter_all_categories'))); } else { echo HTML::hiddenField('cPath', $OSCOM_Category->getPath()); $options = array(array('id' => '', 'text' => OSCOM::getDef('filter_all_manufacturers'))); } if (isset($_GET['sort'])) { echo HTML::hiddenField('sort', $_GET['sort']); } foreach ($filter_result as $f) { $options[] = array('id' => $f['id'], 'text' => $f['name']); } echo HTML::selectMenu('filter', $options, isset($_GET['filter']) ? $_GET['filter'] : null, 'onchange="this.form.submit()"') . HTML::hiddenSessionIDField() . '</form></p>' . "\n"; } } if (isset($_GET['Manufacturers']) && !empty($_GET['Manufacturers'])) { $OSCOM_Products->setManufacturer($_GET['Manufacturers']); } $products_listing = $OSCOM_Products->execute(); require OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Application/Products/pages/product_listing.php';
} echo HTML::selectMenu('manufacturer', $manufacturers_array); ?> </li> <li><?php echo HTML::label(OSCOM::getDef('field_search_price_from'), 'pfrom') . HTML::inputField('pfrom'); ?> </li> <li><?php echo HTML::label(OSCOM::getDef('field_search_price_to'), 'pto') . HTML::inputField('pto'); ?> </li> <li><?php echo HTML::label(OSCOM::getDef('field_search_date_from'), 'datefrom_days') . HTML::dateSelectMenu('datefrom', null, false, null, null, date('Y') - $OSCOM_Search->getMinYear(), 0); ?> </li> <li><?php echo HTML::label(OSCOM::getDef('field_search_date_to'), 'dateto_days') . HTML::dateSelectMenu('dateto', null, null, null, null, date('Y') - $OSCOM_Search->getMaxYear(), 0); ?> </li> </ol> </div> </div> <?php echo HTML::hiddenSessionIDField(); ?> </form>
function initialize() { $this->_title_link = OSCOM::getLink(null, 'Search'); $this->_content = '<form name="search" action="' . OSCOM::getLink() . '" method="get">' . HTML::hiddenField('Search', null) . HTML::inputField('Q', null, 'style="width: 80%;" maxlength="30"') . ' ' . HTML::hiddenSessionIDField() . HTML::button(array('icon' => 'search', 'title' => OSCOM::getDef('box_search_heading'))) . '</form>'; }
public function testHiddenSessionIDField() { $OSCOM_Session = Registry::get('Session'); if ($OSCOM_Session->hasStarted() && strlen(SID) > 0) { $this->assertEquals('<input type="hidden" name="' . $OSCOM_Session->getName() . '" value="' . $OSCOM_Session->getID() . '" />', HTML::hiddenSessionIDField()); } else { $this->assertEquals('', HTML::hiddenSessionIDField()); } }