<?php
/**
 * @version        Somao_Search X1.0 9:23 2012-1-1 Somao $
 * @package        Somao_Search.Site
 * @copyright      Copyright (c) 2009 - 2012, Somao, Inc.
 * @license        http://www.somao123.com/
 * @link           http://www.somao.cc/
 */
require_once("global.php");
$title=trim(HtmlReplace($_POST["title"]));
$imagecode=trim(HtmlReplace($_POST["entered_imagecode"]));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /><title>
	竞价价格查询服务
</title><link href="css/style.css" rel="stylesheet" type="text/css" />
<script>
function fEvent(sType,oInput){
  switch (sType){
   case "focus" :
    oInput.isfocus = true;
   case "mouseover" :
    oInput.style.borderColor = '#9ecc00';
    break;
   case "blur" :
    oInput.isfocus = false;
   case "mouseout" :
    if(!oInput.isfocus){
     oInput.style.borderColor='#84a1bd';
    }
    break;
  }
 }
</script>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
<script src="css/WebResource.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
</head>
<body style="background:#dfebf5 url(images/bg.gif) repeat-x left top;text-align:left">

<form name="form1" method="post" action="" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
  <div id="wrap">
    <div class="head">
      <div class="logo"></div>
      <div class="logotxt">- 竞价价格查询</div>
      <div class="headlink" ><a href="/">首页</a> | <a href="login.php">已有帐号返回登录</a> | <a href="http://www.somao123.com/" target="_blank">搜猫官方</a></div>
      <div class="clearit"></div>
    </div>
    <div class="main">
      <div class="main_top_com">
        <div style="height:34px;"></div>
        <p class="title" style="margin-top:10px;">竞价查询<span class="title_sub orange">搜猫推广平台，助您赢得人生的第一桶金！</span> </p>
        <ul class="maintable">
          <li>
            <div class="mt_l"><span class="red">*</span>查询关键词：</div>
            <div class="mt_r" style="z-index:3;">
              <div class="inputbox">
                <input name="title" type="text" id="title" maxlength="40" onBlur="fEvent('blur',this)" onMouseOver="fEvent('mouseover',this)" onFocus="fEvent('focus',this)" onMouseOut="fEvent('mouseout',this)" value="" />
              </div>
              <div class="onWrap">
                <span id="RequiredFieldValidator1" style="color:Red;display:none;">不能为空！</span>
              </div>
              <div class="inputtxt zi_9">最多可输入40的汉字。</div>
            </div>
          </li>
        </ul>
        <div class="main_cen">
          <ul class="maintable">
            <li>
              <div class="mt_l"><span class="red">*</span>验证码：</div>
              <div class="mt_r" style="z-index:3;">
                <div class="inputbox">
                  <input name="entered_imagecode" type="text" id="entered_imagecode" maxlength="8" style="width:80px" onBlur="fEvent('blur',this)" onMouseOver="fEvent('mouseover',this)" onFocus="fEvent('focus',this)" onMouseOut="fEvent('mouseout',this)" value="" /> 
                  <img src="/include/vdimgck.php" onclick="this.src='/include/vdimgck.php?'+Date()" style="cursor:pointer; height:21px" /> </div>
                <div class="onWrap">
                  <span id="RequiredFieldValidator2" style="color:Red;display:none;">不能为空！</span>
                </div>
              </div>
            </li>
            <li>
              <div class="mt_l"></div>
              <div class="mt_r">
                <input type="submit" name="Button1" value=" 查 询 " onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;Button1&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="Button1" class="sign" />
              </div>
            </li>
            
<br>
<?php
if($title!="")
{
    if($_SESSION['randcode']!=$imagecode){
	 jsalert ("验证码错误!");
	 exit(); 
    }
    $row=$db->get_one("select * from ve123_keyword_pay where keywords='".$title."' order by price desc");
	if(!$row){
	 jsalert ("该关键字，暂时未竞价!");
	 exit(); 
	}
?>
            <p class="title">关键词"<span class="orange"><?php echo $title;?></span>"的当前竞价价格：</p>
            <li>
              <div class="mt_l">当前排名：</div>
              <div class="mt_r2">第1名</div>
            </li>
            <li>
              <div class="mt_l">广告标题：</div>
              <div class="mt_r2"><?php echo $row['title'];?></div>
            </li>
            <li>
              <div class="mt_l">广告内容：</div>
              <div class="mt_r2"><?php echo $row['description'];?></div>
            </li>
            <li>
              <div class="mt_l">URL 地址：</div>
              <div class="mt_r2"><a href="<?php echo $row['url'];?>" target="_blank"><?php echo $row['url'];?></a></div>
            </li>
            <li>
              <div class="mt_l">最高出价：</div>
              <div class="mt_r2"><?php echo $row['price'];?>个积分，相当于<?php echo $row['price']/$config['alipay_propor'];?>元</div>
            </li>
<?php
}
?>
          </ul>
        </div>
        <div class="main_bottom"></div>
      </div>
    </div>
    <?php foothtml(); ?>
  </div>

<script type="text/javascript">
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("RequiredFieldValidator1"), document.getElementById("RequiredFieldValidator2"));
//]]>
</script>

<script type="text/javascript">
//<![CDATA[
var RequiredFieldValidator1 = document.all ? document.all["RequiredFieldValidator1"] : document.getElementById("RequiredFieldValidator1");
RequiredFieldValidator1.controltovalidate = "title";
RequiredFieldValidator1.errormessage = "不能为空！";
RequiredFieldValidator1.display = "Dynamic";
RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator1.initialvalue = "";
var RequiredFieldValidator2 = document.all ? document.all["RequiredFieldValidator2"] : document.getElementById("RequiredFieldValidator2");
RequiredFieldValidator2.controltovalidate = "title";
RequiredFieldValidator2.errormessage = "不能为空！";
RequiredFieldValidator2.display = "Dynamic";
RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator2.initialvalue = "";
//]]>
</script>

<script type="text/javascript">
//<![CDATA[

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        //]]>
</script>
</form>
</body>
</html>
