<?php
	require_once('_approot.php');	
	
	$statisticsUrl=$_POST['statisticsUrl'];
	$statisticsName=$_POST['statisticsName'];
	$statisticsPsd=$_POST['statisticsPsd'];
	
	$onlinechartName=$_POST['onlinechartName'];
	$onlinechartPsd=$_POST['onlinechartPsd'];
	
	$ls=$_POST['ls']; 
	
	switch($ls)
	{
		case "insert":
			$select_sql="select * from ls_functioncode ";
			$select_query=$opendb->query($select_sql);
			
			while ($select_rows = mysqli_fetch_assoc($select_query)){
				switch($select_rows['codeID']){
					case "statistics":  //访问统计
						$update_sql=sprintf("update ls_functioncode set codeURLusername=%s, codeURLpsw=%s where codeID=%s", 
							GetSQLValueString($statisticsName, "text"),
							GetSQLValueString($statisticsPsd, "text"),
							GetSQLValueString($select_rows['codeID'], "text")
							);
						$update_query=$opendb->query($update_sql);
					break;
					case "onlinechartUrl":  //在线客服
						$update_sql=sprintf("update ls_functioncode set codeURLusername=%s, codeURLpsw=%s where codeID=%s", 
							GetSQLValueString($onlinechartName, "text"),
							GetSQLValueString($onlinechartPsd, "text"),
							GetSQLValueString($select_rows['codeID'], "text")
							);
						$update_query=$opendb->query($update_sql);
					break;
				}
			}
			break;
	}
	
	$select_sql="select * from ls_functioncode ";
	$select_query=$opendb->query($select_sql);
	
	while ($select_rows = mysqli_fetch_assoc($select_query)){
		switch($select_rows['codeID']){
			case "statistics":  //访问统计
				$statisticsName2=$select_rows['codeURLusername'];
				$statisticsPsd2 = $select_rows['codeURLpsw'];
				$statisticsCodeURL2 = $select_rows['codeURL'];
			break;
			case "onlinechartUrl":  //在线客服
				$onlinechartName2=$select_rows['codeURLusername'];
				$onlinechartPsd2 = $select_rows['codeURLpsw'];
				$onlinechartUrl2 = $select_rows['codeURL'];
			break;
		}
	}
	
	$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">
<title>优化工具</title>
<link href="css/admin.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/style2.css" />
<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr> 
  <td height="18" style="border-bottom:2px solid #00c0ef; padding-bottom:5px;font-size:16px;"><div align="center"><font color="#3c8dbc">统计与客服</font></div>
				</td>
  </tr>

  <tr>
  	<td  valign="top" align="center">
	<br>
		<form name="form1" method="post" action="statistics.php">
        <input type="hidden" value="insert" name="ls">
        <table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#f0f0ee">
          <tr bgcolor="#f0f0ee" height="37">
            <td width="5%" align="center"><strong>序号</strong></td>
            <td width="8%" align="center"><strong>类型</strong></td>
            <td width="33%" align="center"><strong>用户名</strong></td>
            <td width="33%" align="center"><strong>密码</strong></td>
            <td height="46" colspan="2" align="center"   ><strong>操作</strong></td>
          </tr>
          <tr bgcolor="#f0f0ee" height="37">
            <td width="5%" align="center">1</td>
            <td width="8%" align="center">访问统计 </td>
            <td width="33%" align="center" style="padding-left:10px;" ><input type="text" value="<?php echo $statisticsName2;?>" name="statisticsName" style="width:200px;" ></td>
            <td width="33%" align="center" style="padding-left:10px;" > <input type="text" value="<?php echo $statisticsPsd2;?>" name="statisticsPsd" style="width:200px;" ></td>
            <td width="21%" align="center"><button type="button" onclick="window.open('<?=$statisticsCodeURL2?>')" value="查看统计" />查看统计</button></td>
          </tr>
          <tr bgcolor="#f0f0ee" height="37">
            <td align="center">2</td>
            <td align="center">在线客服</td>
            <td align="center" style="padding-left:10px;" ><input type="text" value="<?php echo $onlinechartName2;?>" name="onlinechartName" style="width:200px;" ></td>
            <td align="center" style="padding-left:10px;" ><input type="text" value="<?php echo $onlinechartPsd2;?>" name="onlinechartPsd" style="width:200px;" ></td>
            <td width="21%" align="center"><button type="button" onclick="window.open('<?=$onlinechartUrl2?>')" value="登录客服">登录客服</button></td>
          </tr>
         <tr bgcolor="#f0f0ee" height="47">
            <td height="51" colspan="5" align="center"><button type="submit" value="确定" />确定</button></td>
          </tr>
         </table>
	  </form>
      
      <p></p>
      <p></p>
      <div align="center"><font color="#3c8dbc" style="font-size:16px;"><br />
        网站优化工具</font><br />
        <br />
      </div>
      <table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#f0f0ee">
        <tr bgcolor="#f0f0ee" height="37">
          <td width="11%" height="54" align="center">&nbsp; </td>
          <td width="43%" align="center"><strong>名 称</strong></td>
          <td width="46%" align="center"><strong>说 明</strong></td>
        </tr>
        <tr bgcolor="#f0f0ee" height="37">
          <td height="37" align="center">1</td>
          <td align="left"><a href="https://www.xml-sitemaps.com/" target="_blank">生成 xml 网站地图</a><i class="fa fa fa-link"></i>，<a href="https://search.google.com/u/4/search-console" target="_blank">并提交谷歌</a><i class="fa fa fa-link"></i></td>
          <td align="left" style="padding-left:10px;" >在线生成网站地图，并提交谷歌</td>
        </tr>
        <tr bgcolor="#f0f0ee" height="37">
          <td height="37" align="center">2</td>
          <td align="left"><a href="https://search.google.com/u/4/search-console" target="_blank">谷歌官方站长工具 Google Search Console</a> <i class="fa fa fa-link"></i></td>
          <td width="46%" align="left" style="padding-left:10px;" >网站页面收录、索引管理，<strong>需要登录</strong></td>
        </tr>
        <tr bgcolor="#f0f0ee" height="37">
          <td height="37" align="center">3</td>
          <td align="left"><a href="https://analytics.google.com/analytics" target="_blank">谷歌官方站长统计 GA</a> <i class="fa fa fa-link"></i></td>
          <td align="left" style="padding-left:10px;" >谷歌官方网站访问统计，<strong>需要登录</strong></td>
        </tr>
        <tr bgcolor="#f0f0ee" height="37">
          <td height="37" align="center">4</td>
          <td align="left"><a href="https://developers.google.com/speed/pagespeed/insights/" target="_blank">谷歌官方网站测速 Pagespeed Insights</a> <i class="fa fa fa-link"></i></td>
          <td align="left" style="padding-left:10px;" >电脑端网站、移动端测速网站速度测试，优化意见</td>
        </tr>
        <tr height="37">
          <td height="37" align="center">5</td>
          <td align="left"><a href="https://www.google.com/webmasters/tools/disavow-links-main?pli=1" target="_blank">谷歌官方拒绝外链 Disavow links</a> <i class="fa fa fa-link"></i></td>
          <td align="left" style="padding-left:10px;" >遇到垃圾链接指向了你的页面，可以使用 Disavow links 功能屏蔽对应的外链。</td>
        </tr>
        <tr bgcolor="#f0f0ee" height="37">
          <td height="37" align="center">6</td>
          <td align="left"><a href="https://www.google.com/contact/
" target="_blank">谷歌官方投诉 Contact</a> <i class="fa fa fa-link"></i></td>
          <td align="left" style="padding-left:10px;" >遇到别人<a href="https://www.google.com/webmasters/tools/disavow-links-main?pli=1" target="_blank">侵权</a>，可以向谷歌提供证据，进行投诉。</td>
        </tr>
        <tr bgcolor="#f0f0ee" height="47">
          <td colspan="3" align="center"> </td>
        </tr>
      </table>
      <p><br>
    </p></td>
 </tr>
</table>

</body>
</html>
