zencart常用表单模块

搜索模块:search_form.php

<?php
/**
 * search_form.php -- modules
 */
$output_form = "";
$output_form .= zen_draw_form('quick_find_header', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', $request_type, false), 'get');
$output_form .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
$output_form .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();
$output_form .= zen_draw_input_field('keyword', '', 'value="' . HEADER_SEARCH_DEFAULT_TEXT . '" οnfοcus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" οnblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"');
$output_form .= zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
$output_form .= '<input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />';
$output_form .= "</form>";

echo $output_form;
?>

货币选择模块:currency_form.php

<?php
/**
 * currency_from.php  - modules
 */
$show_currencies= false;
if (substr($current_page, 0, 8) != 'checkout') {
	$show_currencies= true;
}

if ($show_currencies == true) {
	if (isset($currencies) && is_object($currencies)) {
		reset($currencies->currencies);
		$currencies_array = array();
		while (list($key, $value) = each($currencies->currencies)) {
			$currencies_array[] = array('id' => $key, 'text' => $value['title']);
		}
		$hidden_get_variables = '';
		reset($_GET);
		while (list($key, $value) = each($_GET)) {
			if ( ($key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
				$hidden_get_variables .= zen_draw_hidden_field($key, $value);
			}
		}

		$output_currency_from = "";
		$output_currency_from .= zen_draw_form('currencies_form', zen_href_link(basename(preg_replace('/.php/','', $PHP_SELF)), '', $request_type, false), 'get');
		$output_currency_from .= zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'οnchange="this.form.submit();"') . $hidden_get_variables . zen_hide_session_id();
		$output_currency_from .= '</form>';
		echo $output_currency_from;
	}
}
?>

转载于:https://www.cnblogs.com/hidepeng/archive/2011/04/23/2025798.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值