public function get_code() { $sn = $this->config['order_sn']; if ($this->config['record']) { $user = M('Pay')->where("sn='{$sn}'")->find(); $return = URL('User-Pay/payshow?id=' . $user['id']); } else { $user = M('Order')->where("sn='{$sn}'")->find(); $return = URL('User-Order/show?id=' . $user['id']); } $post_variables = array("cmd" => "_ext-enter", "redirect_cmd" => "_xclick", "upload" => "1", "business" => $this->config['PayPal_account'], "receiver_email" => $this->config['PayPal_account'], "item_name" => "Order Number: " . $this->config['order_sn'], "item_number" => $this->config['order_sn'], "invoice" => $this->config['order_sn'], "amount" => round($this->config['order_amount'], 2), "shipping" => sprintf("%.2f", 0), "currency_code" => $this->config['PayPal_currency_code'], "return" => $return, "notify_url" => $this->config['notify_url'], "cancel_return" => HOMEURL(), "undefined_quantity" => "0", "no_shipping" => "1", "no_note" => "1"); $button = '<form action="' . $this->config['gateway_url'] . '"method="post" target="_blank">'; foreach ($post_variables as $name => $value) { if ($name == 'return' || $name == 'notify_url') { $button .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />'; } else { $button .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />'; } } $button .= '<input type="submit" class="button" value="' . L('PAY_NOW') . '" /></form>'; return $button; }
/** * Get menu * * @param array $attr request array * @param string $content content * * @return string * */ public function _menu($attr, $content) { $tag = $this->parseXmlAttr($attr, 'menu'); $cid = isset($tag['cid']) ? $tag['cid'] : 0; $class = isset($tag['class']) ? $tag['class'] : ''; $num = isset($tag['num']) ? $tag['num'] : 6; $catid = isset($tag['catid']) ? $tag['catid'] : 0; $currentid = intval($this->tpl->get($catid)); $catagory = $this->tpl->get('Categorys'); $li = "<li class='start " . (!$currentid ? 'current' : '') . "'><a href='" . HOMEURL() . "'>" . L(HOME_FONT) . "</a></li><li class='" . $class . "'></li>"; foreach ($catagory as $perCatagory) { if ($perCatagory['parentid'] == 0 && $perCatagory['ismenu'] == 1) { switch ($perCatagory['listorder']) { case $num: $li .= "<li class='" . $class . "'></li><li class='end " . ($perCatagory['id'] == $currentid ? 'current' : '') . "'><a href='" . $perCatagory['url'] . "'>" . $perCatagory['catname'] . "</a></li>"; break; default: $li .= "<li class='" . $class . "'></li><li " . ($perCatagory['id'] == $currentid ? "class = 'current'" : '') . "><a href='" . $perCatagory['url'] . "'>" . $perCatagory['catname'] . "</a></li>"; break; } } } return $li; }
echo L(order_query); ?> </a> | <?php if (is_array($Lang)) { $i = 0; $__LIST__ = $Lang; if (count($__LIST__) == 0) { echo ""; } else { foreach ($__LIST__ as $key => $r) { $mod = $i % 2; ++$i; ?> <a href="<?php echo HOMEURL($r[mark]); ?> "><img src="__PUBLIC__/Images/flag/<?php echo $r["flag"]; ?> "></a> <?php } } } else { echo ""; } ?> </div><!--<span>[<a href="javascript:void(0);" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php echo $site_url; ?> ');return(false);" style="behavior: url(#default#homepage)">设为首页</a>]</span><span>[<a href="javascript:window.external.addFavorite('<?php
function logout() { if ($this->_userid) { cookie(null); $this->assign('jumpUrl', HOMEURL($l)); $this->success(L('loginouted')); exit; } else { $this->assign('jumpUrl', $this->forward); $this->error(L('noogin')); exit; } }