<?php
	session_start(); 
	require_once('inc/conn.php');
	require_once('inc/constant.php');
	require_once('inc/ls_syscode.php');
	require_once('inc/check.php');
	$opendb=new mydb();
	require_once('inc/char_set.php');
	
	$statisticsUrl=$_POST['statisticsUrl'];
	$statisticsName=$_POST['statisticsName'];
	$statisticsPsd=$_POST['statisticsPsd'];
	$ls=$_POST['ls']; 
	
	switch($ls)
	{
		case "insert":
			$update_sql=sprintf("update ls_config set statisticsUrl=%s, statisticsName=%s, statisticsPsd=%s", 
						GetSQLValueString($statisticsUrl, "text"),
						GetSQLValueString($statisticsName, "text"),
						GetSQLValueString($statisticsPsd, "text")
						);
			if($update_query=$opendb->query($update_sql)){
				$ls_msg="修改操作成功！";
			}else{
				$ls_msg="修改操作失败！";
			}
			break;
	}
	
	$select_sql="select * from ls_config ";
	$select_query=$opendb->query($select_sql);
	$select_rows=mysql_fetch_assoc($select_query);
	
	$ls_msg="访问统计";
	
?>
<!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=utf-8">
<link href="css/admin.css" rel="stylesheet" type="text/css">
<title>无标题文档</title>
</head>

<body>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6396D6">
  <tr> 
	<td height="18" background="images/admin_bg.gif"><div align="center"><font color="#FFFFFF"><strong>常用入口</strong></font></div></td>
  </tr>

  <tr>
  	<td bgcolor="#E8F1FF" valign="top" align="center">
	<br>
		<form name="form1" method="post" action="statistics.php">
        <input type="hidden" value="insert" name="ls">
        <table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
          <tr bgcolor="#B9DAFF">
            <td width="5%" align="center">序号</td>
            <td width="8%" align="center">类型</td>
            <td width="33%" align="center">用户名</td>
            <td width="33%" align="center">密码</td>
            <td height="28" colspan="2"  style="padding-left:30px;" ></td>
          </tr>
          <tr bgcolor="#f4f4f4">
            <td width="5%" align="center">1</td>
            <td width="8%" align="center">统计 </td>
            <td width="33%" style="padding-left:10px;" ><input type="text" value="<?php echo $select_rows['statisticsName'];?>" name="statisticsName" style="width:200px;" ></td>
            <td width="33%" style="padding-left:10px;" > <input type="text" value="<?php echo $select_rows['statisticsPsd'];?>" name="statisticsPsd" style="width:200px;" ></td>
            <td width="21%"><input type="button" onclick="window.open('<?=$select_rows['statisticsUrl']?>')" value="查看统计" /></td>
          </tr>
          <tr bgcolor="#f4f4f4">
            <td align="center">2</td>
            <td align="center">客服</td>
            <td style="padding-left:10px;" ><input type="text" value="<?php echo $select_rows['onlinechartName'];?>" name="onlinechartName" style="width:200px;" ></td>
            <td style="padding-left:10px;" ><input type="text" value="<?php echo $select_rows['onlinechartPsd'];?>" name="onlinechartPsd" style="width:200px;" ></td>
            <td width="21%"><input type="button" onclick="window.open('<?=$select_rows['onlinechartUrl']?>')" value="登录客服"></td>
          </tr>
          <tr bgcolor="#f4f4f4">
            <td colspan="5" align="center"><input type="submit" value="提交" /></td>
          </tr>
         </table>
	  </form>
	<br>
	</td>
 </tr>
</table>

</body>
</html>
