<?php require_once('../../include/class.inc.php'); ?>
<?php
if($_GET["vote"]=="yes")
{
if($name!="" && $name!="" && $content!="") {
	$name=$_POST["name"];
	$phone=$_POST["phone"];
	$other=$_POST["other"];
	$E_mail=$_POST["E_mail"];
	$content=$_POST["content"];
	$adddate=date('Y-m-d');
	$sql="insert into message(name,phone,other,E_mail,content,adddate) value('$name','$phone','$other','$E_mail','$content','$adddate')";
	//echo $sql;
//	exit;
	$result=$my->data_work($sql);
	if($result){
	echo ("<script type='text/javascript'>alert('添加留言成功！');location.href='message.php';</script>");
	}
	else{
	echo ("<script type='text/javascript'>alert('添加留言失败！请检查您所填写的内容是否完整。');location.href='message_add.php';</script>");
	}
	exit();
	}
}
?>
<!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" />
<link rel="stylesheet" href="../inc/css.css" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE5 {color: #FFFFFF; font-weight: bold; }
.STYLE6 {color: #FF0000}
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="../message/message_add.php?vote=yes">
  <table width="1052" border="0" align="center" cellpadding="2" cellspacing="1" bordercolor="#799AE1" class="tableBorder">
    <tbody>
      <tr bgcolor="#CCCCCC">
        <td height="18" colspan="2" bgcolor="#4455aa"><div align="center" class="STYLE5">
          <div align="left">添加留言</div>
        </div>
            <div align="center" class="STYLE5">
              <div align="left"></div>
        </div></td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td width="105" align="center" class="txlrow"><div align="center"><strong>留言者姓名</strong></div></td>
        <td align="center" class="txlrow"><div align="left">
          <input name="name" type="text" id="name" size="30" />
          <span class="STYLE6">*</span></div></td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td width="105" align="center" class="txlrow"><div align="center"><strong>电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话</strong></div></td>
        <td align="center" class="txlrow"><div align="left">
            <input name="phone" type="text" id="phone" size="30" />
            <span class="STYLE6">*</span></div></td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td width="105" align="center" class="txlrow"><div align="center"><strong>其他联系方式</strong></div></td>
        <td align="center" class="txlrow"><div align="left">
            <input name="other" type="text" id="other" size="30" />
        如QQ、MSN等</div></td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td width="105" align="center" class="txlrow"><div align="center"><strong>E-mail</strong></div></td>
        <td align="center" class="txlrow"><div align="left">
            <input name="E_mail" type="text" id="E_mail" size="30" />
        </div></td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td width="105" align="center" class="txlrow"><strong>留言内容</strong></td>
        <td align="center" class="txlrow"><div align="left">
            <textarea name="content" id="content" cols="50" rows="5">
</textarea>
            <span class="STYLE6">*</span></div></td>
      </tr>

      <tr bgcolor="#DEE5FA">
        <td width="105" align="center" class="txlrow"><div align="center"></div></td>
        <td align="center" class="txlrow"><div align="left">
            <input type="submit" name="button" id="button" value="提交" />
            <input type="reset" name="button2" id="button2" value="重置" />
        </div></td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td colspan="2" align="center" class="txlrow"></td>
      </tr>
    </tbody>
  </table>
</form>
</body>
</html>
