<?php 	require_once('_approot.php');	 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
$companyName3=htmlspecialchars( $_POST['companyName'], ENT_QUOTES);
$siteKeywords3= htmlspecialchars( $_POST['siteKeywords'], ENT_QUOTES);  
$siteDescription3= htmlspecialchars( strip_tags($_POST['siteDescription']), ENT_QUOTES) ;
$myanchor=$_GET['myanchor'];

function xmlencode($tag){
	$tag = str_replace("&", "&amp;", $tag);
	$tag = str_replace("<", "&lt;", $tag);
	$tag = str_replace(">", "&gt;", $tag);
	$tag = str_replace("'", "&apos;", $tag);
	$tag = str_replace("/", '&quot;', $tag);
	return $tag;
	}
	
function getolddir($content)
{	
	require_once('inc/conn.php');
	$opendb=new mydb();
	$olddir_sql="select * from ls_products where position('ls_admin' IN ".$content.")>0 ";
	$olddir_query=$opendb->query($olddir_sql);
	$olddir_rows=mysqli_fetch_assoc($olddir_query); 
	$olddirstr=$olddir_rows[$content];
	$olddir=substr($olddirstr,0,strpos($olddirstr,'ls_admin'));
	$olddir=substr($olddir,strrpos($olddir,'"')+1).'ls_admin';
	
	return($olddir);
}
	

/*版权设置*/
	$copyright_post=inputsafe($_POST['copyright'],2);
	$config_sql="select * from ls_config ";
	$config_query=$opendb->query($config_sql);
	$config_row=mysqli_fetch_assoc($config_query);
	if($copyright_post=="")
	{
		$copyrightsql="Copyright ©  - ".date("Y")." ".$config_row['companyNameCn']." All Rights Reserved.";
	}
	else 
	{
		$copyrightsql=str_replace("- ","-",$copyright_post);
		$copyrightsql=str_replace("- ","-",$copyrightsql);
		$minpos=strpos($copyrightsql,"-");
		$copyrightsql=substr($copyrightsql,0,$minpos-1)." - ".date("Y")." ".substr($copyrightsql,$minpos+6);
		
	}

/*版权设置结束*/
	$ls=$_POST['ls'];
	$replacedir=$_POST['replacedir'];
	$templates = "";
	file_exists("widget/ls_config_template.php")?$templates = $_POST['select2']:$templates = "Templates1";

	
if($_POST['name_']!='' && $_POST['tel_']!='' && $_POST['sub2']!=''){
	//print_r($_POST);
	$png = new Two($_POST['name_'],$_POST['tel_']);
	if(file_exists('company_logo/logo.jpg')){
		$png->setLogo('company_logo/logo.jpg');
	}
	if(file_exists('company_logo/logo.png')){
		$png->setLogo('company_logo/logo.png');
	}
	
	if($_POST['email_']!=''){
		$png->setEmail($_POST['email_']);
	}
	if($_POST['adr_']!=''){
		$png->setAdr($_POST['adr_']);
	}
	if($_POST['url_']!=''){
		$png->setUrl($_POST['url_']);
	}
	$png->show();
	$msg = true;
	//生成xml文件  er.xml 保存二维码数据 转义符号
	
	$name_ = xmlencode($_POST['name_']);
	$tel_ = xmlencode($_POST['tel_']);
	$email_ = xmlencode($_POST['email_']);
	$adr_ = xmlencode($_POST['adr_']);
	$url_ = xmlencode($_POST['url_']);
	
	$text = '<?xml version="1.0"?>
<body>
	<name>'.$name_.'</name>
	<tel>'.$tel_.'</tel>
	<email>'.$email_.'</email>
	<adr>'.$adr_.'</adr>
	<url>'.$url_.'</url>
</body>';
$handle = fopen('code/er.xml','w+');
if($handle){
	//$xml = simplexml_load_string($text);
	fwrite($handle,$text);
	fclose($handle);
}
	
}

if($_POST['text']!='' && $_POST['sub1']!=''){

	$png = new Two();
	if(file_exists('company_logo/logo.jpg')){
		$png->setLogo('company_logo/logo.jpg');
	}
	if(file_exists('company_logo/logo.png')){
		$png->setLogo('company_logo/logo.png');
	}
	$png->show($_POST['text']);
	$msg = true;
	
	//生成xml文件  er.xml 保存二维码数据
	$text = xmlencode($_POST['text']);
	$text = '<?xml version="1.0"?>
<body>
	<content>'.$text.'</content>
</body>';
$handle = fopen('code/er.xml','w+');
if($handle){
	fwrite($handle,$text);
	fclose($handle);
}
}
	if($_POST['del']!=""){
		if(file_exists('code/2.png')){
			unlink('code/2.png');
			$msg_er =  "<script>alert('删除成功')</script>";
		}
	}
//  end


	if ($ls=="modi")
	{
		$languages = "";
		$email3=$_POST['email3'];
		$email4=$_POST['email4'];
		$tel4old=$_POST['tel4old'];
		$language = $_POST['language'];  //获取的多选框的值，为一个数组，通过下面的foreach对数据进行操作
		$languages .= count($language);
		if($language != null){
			foreach($language as $employee_id) {
				$languages .= $employee_id;
			}
		}
		$modi_sql=sprintf("update ls_config set companyNameCn=%s, companyName=%s, siteKeywords=%s, siteDescription=%s, address=%s, tel=%s, fax=%s, email=%s, MSN=%s, feedback=%s, ICP=%s, qq=%s, people=%s, feedbackEmail=%s, bottomMenu=%s, website=%s, templates=%s, email2=%s, email3=%s, email4=%s, tel2=%s, tel3=%s, tel4=%s, MSN2=%s, MSN3=%s, MSN4=%s, skype=%s, skype2=%s, skype3=%s, skype4=%s, facebook=%s, twitter=%s, linkedin=%s, google=%s, pinterest=%s, youtube=%s, language=%s, shieldIP=%s, copyright=%s,statistics=%s, onlines=%s , maps=%s", 
				GetSQLValueString(inputsafe($_POST['companyNameCn'],2), "text"),
				GetSQLValueString(str_replace(array("\r\n", "\r", "\n"), "",$companyName3 ), "text"),
				GetSQLValueString(str_replace(array("\r\n", "\r", "\n"), "",$siteKeywords3  ), "text"),
				GetSQLValueString(str_replace(array("\r\n", "\r", "\n"), "", $siteDescription3 ), "text"),
				GetSQLValueString(clearname($_POST['address']), "text"),
				GetSQLValueString($_POST['tel'], "text"),
				GetSQLValueString($_POST['fax'], "text"),
				GetSQLValueString($_POST['email'], "text"),
				GetSQLValueString($_POST['MSN'], "text"),
				GetSQLValueString($_POST['feedback'], "text"),
				GetSQLValueString($_POST['ICP'], "text"),
				GetSQLValueString($_POST['qq'], "text"),
				GetSQLValueString($_POST['people'], "text"),
				GetSQLValueString($_POST['feedbackEmail'], "text"),
				GetSQLValueString($_POST['bottomMenu'], "text"),
				GetSQLValueString($_POST['website'], "text"),
				GetSQLValueString($templates, "text"),
				GetSQLValueString($_POST['email2'], "text"),
				GetSQLValueString($email3, "text"),
				GetSQLValueString($email4, "text"),
				GetSQLValueString($_POST['tel2'], "text"),
				GetSQLValueString($_POST['tel3'], "text"),
				GetSQLValueString($tel4old, "text"),
				GetSQLValueString($_POST['MSN2'], "text"),
				GetSQLValueString($_POST['MSN3'], "text"),
				GetSQLValueString($_POST['MSN4'], "text"),
				GetSQLValueString($_POST['skype'], "text"),
				GetSQLValueString($_POST['skype2'], "text"),
				GetSQLValueString($_POST['skype3'], "text"),
				GetSQLValueString($_POST['skype4'], "text"),
				GetSQLValueString($_POST['facebook'], "text"),
				GetSQLValueString($_POST['twitter'], "text"),
				GetSQLValueString($_POST['linkedin'], "text"),
				GetSQLValueString($_POST['google'], "text"),
				GetSQLValueString($_POST['pinterest'], "text"),
				GetSQLValueString($_POST['youtube'], "text"),
				GetSQLValueString($languages, "text"),
				GetSQLValueString($_POST['shieldIP'], "text"),
				GetSQLValueString($copyrightsql, "text"),
				GetSQLValueString(trim($_POST['wechat']), "text"),
				GetSQLValueString(trim($_POST['postcode']), "text"),
				GetSQLValueString(trim($_POST['other']), "text")
				
				);
		//echo $modi_sql;
		$modi_query=$opendb->query($modi_sql);
		$modi_mobi_sql=sprintf("update ls_mobiconfig set companyName=%s",
				GetSQLValueString($_POST['mobilecompanyName'], "text")
			);
		//echo $modi_sql;
		//修改禁用词
		$modi_sql1="update ls_banword set banword =  '".$_POST['banword']."'";
		$modi_query1=$opendb->query($modi_sql1);
		$modi_mobi_query=$opendb->query($modi_mobi_sql);
		$ls_msg="修改配制操作成功！";
	}
	if($replacedir=="进行目录整理")
	{
		 file_exists("widget/ls_config_replace.php")?include "widget/ls_config_replace.php":"";

	}
	
	$config_sql="select * from ls_config ";
	$config_query=$opendb->query($config_sql);
	$config_row=mysqli_fetch_assoc($config_query);
	$olddir=getolddir('productSpecification');
	if($olddir=='ls_admin'){$olddir=getolddir('cateBrief');}
	if($olddir=='ls_admin'){$olddir=getolddir('cateDetail');}
	if($olddir=='ls_admin'){$olddir=getolddir('midcateBrief');}
	if($olddir=='ls_admin'){$olddir=getolddir('midcateDetail');}
	if($olddir=='ls_admin'){$olddir=getolddir('subcateBrief');}
	if($olddir=='ls_admin'){$olddir=getolddir('subcateDetail');}
	//echo $olddir;
	$currentdir=dirname($_SERVER['HTTP_REFERER']);
	
	//内链代码开始
	$in=$_GET['in'];
	
	$id=$_GET['id'];
	$modiid=$_POST['modiid'];
	$scanning=$_GET['scanning'];
	
	$title=strtolower(trim(str_replace("|","",$_POST['title']))); // 清除| 避免干肉 ，小写
	$Num=$_POST['Num'];
	$url=strtolower(trim($_POST['url']));
	$nowlinknum=$_GET['Num'];
	
	$pattern = "/^(http:\/\/|https:\/\/).*$/";
	 
	$memo=trim($_POST['memo']);
	if($memo==""){
		if(!preg_match($pattern,  $url)){
			$memo="内链";
		}else{
			$memo="外链";
		}
	}

	switch ($in)
	{
		case "up":
			$down=$nowlinknum-1;
			$down_sql="update ls_internal set Num=".$nowlinknum." where Num=".$down." ";
			$down_sql2="update ls_internal set Num=Num-1 where id=".$id." ";
			//echo $down_sql;
			$down_query=$opendb->query($down_sql);
			$down_query=$opendb->query($down_sql2);
			$ls_msg="上移操作成功！";
			break;
		case "down":
			$up=$nowlinknum+1;
			$up_sql="update ls_internal set Num=".$nowlinknum." where Num=".$up."  ";
			$up_sql2="update ls_internal set Num=Num+1 where id=".$id." ";
			
			//echo $up_sql;
			$up_query=$opendb->query($up_sql);
			$up_query=$opendb->query($up_sql2);

			$ls_msg="下移操作成功！";

			break;
		case "insert":
			$select_sql2="select * from ls_internal where title='".$title."' ";
			$select_query2=$opendb->query($select_sql2);
			$select_rows2=mysqli_num_rows($select_query2); //总数
			if(trim($title)!="" && $select_rows2==0) {
				$select_sql2="select * from ls_internal ";
				$select_query2=$opendb->query($select_sql2);
				$select_rows2=mysqli_num_rows($select_query2); //总数
				$insert_sql="insert into ls_internal(title,url,memo,Num,enable) values ('".$title."','".editorPath('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], $url)."','".$memo."',".($select_rows2+1).",1)";
				//echo $insert_sql;
				$insert_query=$opendb->query($insert_sql);
				if($title!="" && $url!="") replalltext("addlink",$title, $url);

				$ls_msg="添加操作成功！";
			}else{
				echo "<script> alert('锚点已经存在或链接文字为空，请修改');</script>";
			}
				
			break;
		case "modi":
			if(trim($title)==""||trim($url)==""){
				echo "<script> alert('锚点文字或链接不能为空，请修改');</script>";
			}else{
				$select_sql2="select * from ls_internal where title='".$title."' ";
				$select_query2=$opendb->query($select_sql2);
				$select_rows2=mysqli_num_rows($select_query2); //总数
				if($select_rows2==0) {
				  
				  $modi_sql="update ls_internal set memo='".$memo."', title='".$title."',   url='".editorPath('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], $url)."', memo='".$memo."'  where id=".$modiid." ";
				  //echo $modi_sql;
				  $modi_query=$opendb->query($modi_sql);
				  if($title!="" && $url!="") replalltext("dellink",$title, $url); //删除链接
				  if($title!="" && $url!="") replalltext("addlink",$title, $url);
				  
				  $ls_msg="修改操作成功！";
			  	}else{
					echo "<script> alert('锚点已经存在，请修改');</script>";
				}
			}
				
			break;
		case "del":
		 
			$link_sql2="select * from ls_internal where id=".$id." ";
			$link_query2=$opendb->query($link_sql2);
			$link_rows2=mysqli_fetch_assoc($link_query2);
			$num_sql2="update ls_internal set Num=Num-1 where Num>".$link_rows2['Num']." ";//all order number-1
			$down_query=$opendb->query($num_sql2);
		
			$del_sql="delete from ls_internal where id=".$id." ";
			$del_query=$opendb->query($del_sql);
			replalltext("dellink",$link_rows2['title'], $url); //删除链接
			$ls_msg="删除操作成功！";
			break;
		case "unenable":
			$unenable_sql="update ls_internal set enable=0 where id=".$id." ";
			//echo $unenable_sql;
			$unenable_query=$opendb->query($unenable_sql);
			$ls_msg="禁止操作成功！";
			break;
		case "enable":
			$enable_sql="update ls_internal set enable=1 where id=".$id." ";
			//echo $enable_sql;
			$enable_query=$opendb->query($enable_sql);
			$ls_msg="允许操作成功！";
			break;
	}
	
	if($scanning=="add")
	{
		$in_sql="SELECT * FROM ls_internal where enable=1 and url!='' order by Num asc"; //count the error by searchtype
		$in_query=$opendb->query($in_sql);
		$internal = array(); //添加过的内链锚点
		$i = -1;
		while ($in_rows=mysqli_fetch_assoc($in_query)){
			$i++;
			$internal[$i] = $in_rows['title'];
			$stitle = $in_rows['title'];
			$surl = $in_rows['url'];
			replalltext("addlink",$stitle, $surl);
			
		}
		
		$code_sql = "select * from ls_functioncode where codeID='internal' ";
		$code_query = $opendb->query($code_sql);
		$code_value = mysqli_fetch_array($code_query);
		$code = explode(",",$code_value['code']);
		$int_str = "";
		foreach($internal as $in_val){
			$foo = true;
			foreach($code as $code_val){
				if(trim($code_val) == trim($in_val)){
					$foo = false;
				}
			}
			if($foo){
				$int_str .= trim($in_val).",";
			}
		}
		
		$updateint_sql=sprintf("update ls_functioncode set code=%s where codeID=%s",
				GetSQLValueString($code_value['code'].$int_str,"text"),
				GetSQLValueString('internal',"text")
			);
		$updateint_query=$opendb->query($updateint_sql);
		$ls_msg="所有文章已增加内链！";

	}elseif($scanning=="clear"){
		
		$in_sql="select * from ls_functioncode where codeID='internal'"; //count the error by searchtype
		$in_query=$opendb->query($in_sql);
		
		$in_value = mysqli_fetch_array($in_query);
		$in_code = explode(",",$in_value['code']);
		
		foreach($in_code as $in_rows){
			$stitle = $in_rows;
			replalltext("dellink",$stitle, $surl);  //清除自动添加的内链，清除全部在ls_internal.php
		}
		$ls_msg="已清除所有文章内链！";

	}
	
	$select_sql2="select * from ls_internal ";
	$select_query2=$opendb->query($select_sql2);
	$link_num=mysqli_num_rows($select_query2); //总数
	
	$in_sql="SELECT * FROM ls_internal order by Num asc"; //count the error by searchtype
	$in_query=$opendb->query($in_sql);
	//内链代码结束
	
	$config_mobi_sql="select * from ls_mobiconfig ";
	$config_mobi_query=$opendb->query($config_mobi_sql);
	$config_mobi_rows=mysqli_fetch_assoc($config_mobi_query);
	
	if($_GET['mess']!="")$ls_msg=$_GET['mess'];
	
	//联系信息分解
	$contactmsg=strtolower(trim($_POST['contactmsg'])); //小写
	if($contactmsg!=""){
	  $contactmsg=str_replace("：",":",$contactmsg); //整理冒号
	  $contactmsg=str_replace("e-mail","email",$contactmsg);  
	  $contactmsg=str_replace("mail","email",$contactmsg);  
	  $contactmsg=str_replace("邮箱","email",$contactmsg);  
	  $contactmsg=str_replace("电子邮箱","email",$contactmsg);  
	  $contactmsg=str_replace("address","add",$contactmsg);  
	  $contactmsg=str_replace("地址","add",$contactmsg);  
	  $contactmsg=str_replace("Zip Code","postcode",$contactmsg);  
	  $contactmsg=str_replace("邮编","postcode",$contactmsg);  
	  $contactmsg=str_replace("电话","tel",$contactmsg);  
	  $contactmsg=str_replace("手机","mobile",$contactmsg);  
	  $contactmsg=str_replace("微信","wechat",$contactmsg);  
	  $contactmsg=str_replace("\r\n","\n",$contactmsg); 
	  $contactmsg=str_replace("\r","\n",$contactmsg); 
	  $contactmsga=explode("\n",$contactmsg);
	  foreach($contactmsga as $val){
		  $vala=explode(":",$val); //分解冒号
		  $ctname=strtolower(trim($vala[0]));
		  $ctvalue=trim($vala[1]);
		  
		  //echo $ctvalue."--";exit;
		  if(trim($ctvalue)==""){
	  	 	  $val=str_replace("	"," ",$val);  
	  	 	  $val=str_replace("  "," ",$val);  
			  $vala=explode(" ",$val); //分解空格
	  		  $ctname=strtolower(trim($vala[0]));
			  $ctvalue=trim($vala[1]);
		  }
		  switch($ctname)
		  {
			  case "tel":
				  if($tel11=="") $tel11=$ctvalue; else if($tel12=="") $tel12=$ctvalue;
			  break;
			  case "mobile":
				  if($tel11=="") $tel11=$ctvalue; else if($tel12=="") $tel12=$ctvalue;
			  break;
			  case "mob":
				  if($tel11=="") $tel11=$ctvalue; else if($tel12=="") $tel12=$ctvalue;
			  break;
			  case "phone":
				  if($tel11=="") $tel11=$ctvalue; else if($tel12=="") $tel12=$ctvalue;
			  break;
			  case "mobilephone":
				  if($tel11=="") $tel11=$ctvalue; else if($tel12=="") $tel12=$ctvalue;
			  break;
			  case "add":
				  if($address11=="") $address11=$ctvalue; 
			  break;
			  case "email":
				  if($email11=="") $email11=$ctvalue; else if($email12=="") $email12=$ctvalue;
			  break;
			  case "postcode":
				  if($postcode11=="") $postcode11=$ctvalue; 
			  break;
			  case "skype":
				  if($skype11=="") $skype11=$ctvalue;  
			  break;
			  case "whatsapp":
				  if($whatsapp11=="") $whatsapp11=$ctvalue;  
			  break;
			  case "wechat":
				  if($wechat11=="") $wechat11=$ctvalue;  
			  break;
		  }  
  
	  }
	}
	//var_dump($tel11,$add11);

	//if($contactmsg!=""){
/*	if(!(strpos($ls_msg,"内链")===false)){
		$myanchor="interlink";
	}
*/
?>
<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 href="css/newui.css" rel="stylesheet" type="text/css">
   <link rel="stylesheet" href="css/style2.css" />
<SCRIPT type=text/javascript src="js/ls2.js"></SCRIPT>
<style type="text/css"> 
div,ul,li {margin:0;padding:0;}
ul{list-style-type:none;}
#fo li{ width:350px;}
#tul{list-style-type:none;width:240px;background:#D6DFF7;margin-bottom:30px;}
#tul:after{content:".";display:block;clear:both;line-height:0px;height:0;visibility:hidden;}
.tul li { width:50%; height:30px; line-height:30px; text-align:center; color:#0c3d66;background:#e3e6ed; font-size:14px; float:left;  color:#2064ae;cursor: hand;!important;cursor: pointer}
.tul .check { background:white;font-weight: bold; } 
.slist { width:350px; height:170px;margin:auto;}
#cont{
	width:380px;
	height:250px;
	border:1px solid gray;
}
#nei{
	clear:both;
	width:360px;
	height:100px;
	padding:10px;
}
.b1 {
	color: #FFF;
}
</style> 
<script type="text/javascript" src="js/jquery.js"></script>
<script language="JavaScript" src="js/ls.js"></script>
<script type="text/javascript">
	function setInnerHTML(){
		var path1 = document.getElementById("select2").value;
		document.getElementById("img1").innerHTML="<img src='../"+path1+"/"+path1+".jpg' width='400' />";
	}
    
    jQuery(document).ready(function(){
        jQuery('.tul li').click(
                function(){
                        jQuery(this).siblings().removeClass("check");
                        jQuery(this).addClass("check");
                        var tid = "#" + jQuery(this).attr('id') + "_cont";
                        jQuery(tid).siblings().hide();
                        jQuery(tid).show();
                        
                },
                function(){}
        );
});
window.location.hash = "<?=$interlink?>"	
</script>
<script language="javascript"> 
function keypress2() //textarea输入长度处理 
{
var text1=document.getElementById("siteDescription").value;
var text2=document.getElementById("siteKeywords").value;
var text3=document.getElementById("companyName").value;
var text4=document.getElementById("mobilecompanyName").value;

var len;//记录剩余字符串的长度
var len2;
var len3;
var len4;
if(text2.length>=244 || text1.length>=155 || text3.length>=55 || text4.length>=40)//textarea控件不能用maxlength属性，就通过这样显示输入字符数了 
{
len=244-(text2.length);
len2=155-(text1.length); 
len3=55-(text3.length); 
len4=40-(text4.length); 
} 
else 
{ 
len=244-(text2.length);
len2=155-(text1.length); 
len3=55-(text3.length); 
len4=40-(text4.length); 
} 
var show="还可输"+len+"个";
var show2="还可输"+len2+"个"; 
var show3="还可输"+len3+"个"; 
var show4="还可输"+len4+"个"; 
document.getElementById("pinglun").innerText=show;
document.getElementById("pinglun2").innerText=show2;
document.getElementById("pinglun3").innerText=show3;
document.getElementById("pinglun4").innerText=show4;
} 

</script>
<script type="text/javascript">
function internal(operation){
	var action = "ls_internal.php?action="+operation;
	$.ajax({
		type: "POST",
		url: action,
		error: function(request) {
		},
		success: function(response)
		{
			if(response == "repeat"){
				alert("链接已经存在 或链接文字为空。");
			}else{
				if(response == "fail"){
					//alert("自动添加失败");
				}else{
					//alert("自动添加成功");
					window.location.href="ls_config.php?myanchor=interlink&mess="+response;
				}
			}
		}
	});
}

window.onload=function(){
	location.hash='#<?=$myanchor?>';
}

</script>
</head>
<body>
<?php echo $msg_er;?>
<table width="100%" border="0" cellspacing="1">
	<tr>
        <td height="18" style="border-bottom:2px solid #00c0ef; padding-bottom:5px;"><div align="center"><font color="#3c8dbc" style="font-size:16px;">系统配置与优化</font></div>
				</td>
	</tr>
	<tr>
		<td align="center" ><form name="fmconfig" method="post" enctype="multipart/form-data"  action="ls_config.php">
			<input type="hidden" name="ls" value="modi" />
		  <table width="98%" border="0" style="margin-top:16px;">
				<tr>
					<td colspan="2" style="padding-left:20px;"> 提示：<font color="#FF0000"><?=$ls_msg; ?></font></td>
					<td width="26%" colspan="2">
                     
                    </td>
				</tr>
				<tr>
			</table>
			<table width="100%" border="0" cellpadding="4" cellspacing="0" style=" margin-bottom:10px; background-color: #f0f0ee;">
		  <tr>
				<td valign="top"><fieldset class="infofield" >
						<span class="b1">.</span>
<table width="100%" border="0" cellspacing="8" cellpadding="">
	    <tr>
								<td width="13%" height="112" align="right">公司名称 *</td>
								<td width="87%" valign="top"><textarea name="companyNameCn" class="inputareashort" style="width:98%;"><?=$config_row['companyNameCn'];?></textarea>
					  <br /></td>
						  </tr>
							<tr>
							  <td colspan="2" align="right" style="padding-right:18px;"></label>
							    </font></td>
						  </tr>
							<tr>
								<td height="69" align="right">首页标题<br />
								Title *<br /></td>
							  <td valign="top"><textarea name="companyName" id="companyName" class="inputareashort" onKeyUp="keypress2()" onBlur="keypress2()" style="width:98%;"><?=$config_row['companyName'];?></textarea></td>
						  </tr>
                          <tr>
							  <td colspan="2" align="right" style="padding-right:18px;">最多55个字符（25汉字），<font color="#FF0000">
				              <label id="pinglun3">还可输55个</label>
							  </font></td>
						  </tr>
                            <tr>
								<!--<td align="right">手机标题<br />
							    Title</td>
								<td><textarea name="mobilecompanyName" id="mobilecompanyName" class="inputareashort" style="height:55px;" onKeyUp="keypress2()" onBlur="keypress2()"><?=$config_mobi_rows['companyName'];?></textarea></td>
							</tr>
                            <tr>
							  <td colspan="2" align="right" style="padding-right:18px;">最多40个字符（20汉字），<font color="#FF0000">
				              <label id="pinglun4">还可输40个</label>
							  </font></td>-->
							</tr>
				  </table>
					</fieldset></td>
				<td width="51%"><fieldset class="infofield"  >
				  <legend><strong>SEO优化</strong></legend>
		  <table width="100%" border="0" cellspacing="8" cellpadding="0">
							<tr>
								<td width="15%" align="right" ><br />
									首页关键字<br />
									Keywords</td>
								<td width="85%"><textarea name="siteKeywords" id="siteKeywords" class="inputareashort" onKeyUp="keypress2()" onBlur="keypress2()" style="width:94%;"><?=$config_row['siteKeywords'];?></textarea></td>
							</tr>
                            <tr>
							  <td colspan="2" align="right" style="padding-right:18px;" >最多 244个字符，<font color="#FF0000">
				              <label id="pinglun">还可输244个</label>
							  </font></td>
							</tr>
							<tr>
								<td align="right">首页描述<br />
									Description *</td>
								<td><textarea name="siteDescription" id="siteDescription" class="inputareashort" onKeyUp="keypress2()" onBlur="keypress2()" style="width:94%;" ><?=$config_row['siteDescription'];?></textarea>
								   
								  <?=$promlv>1?$seo:""?>
							    </td>
							</tr>
                            <tr>
							  <td colspan="2" align="right" style="padding-right:18px;" >最多155个字符，<font color="#FF0000">
				              <label id="pinglun2">还可输155个</label>
							  </font></td>
							</tr>
						</table>
					</fieldset></td>
			</tr>
            <script> keypress2();</script>
			<tr>
				<td colspan="3"> 
    			<table width="100%" border="0" cellspacing="4" cellpadding="0">
                <tr>
								<td width="88" height="32" align="right">电话 </td>
								<td width="155" align="left"><input type="text" value="<?=$tel11==""?$config_row['tel']:$tel11?>" name="tel" class="ifinfoinputshort" style="width:100%;" onblur="writetel(this);" /></td>
								<td width="96" align="right">邮箱</td>
				  <td width="216"><input type="text" id="email" value="<?=$email11==""?$config_row['email']:$email11;?>" name="email" class="ifinfoinputshort"  style="width:82%;" onblur=""  /></td>
				  <td width="106" align="right"><input type="button" value="联系信息抓取" class="" onclick="if(this.form.contactmsg.value!=''){alert('将分解并替换联系信息，确定吗？');this.form.submit();}"></button></td>
								<td width="458" colspan="2" rowspan="3"><textarea name="contactmsg" id="contactmsg" class="inputareashort"  style="width:92%;" ></textarea></td>
				  </tr>
							<tr>
								<td align="right" height="32"><?=$tel12show?></td>
								<td align="left"><input type="text" onblur="" value="<?=$tel12==""?$config_row['fax']:$tel12;?>" name="fax" style="width:100%;" class="ifinfoinputshort" /></td>
								<td align="right"><?=$email12show?></td>
								<td><input type="text" value="<?=$email12==""?$config_row['MSN']:$email12?>" name="MSN" style="width:82%;" class="ifinfoinputshort"    /></td>
								<td align="center">&lt;= </td>
							</tr>
							<tr>
							  <td align="right" height="32"><?=$wechat11show?></td>
							  <td align="left"><input type="text" value="<?=$wechat11==""?$config_row['statistics']:$wechat11?>" name="wechat" style="width:100%;" class="ifinfoinputshort"    /></td> 
							  <td align="right">邮编</td>
							  <td><input type="text" value="<?=$postcode11==""?$config_row['onlines']:$postcode11?>" name="postcode" style="width:82%;" class="ifinfoinputshort"    /></td>
							  <td align="center" valign="middle">一行一个</td>
	              </tr>
							<tr>
							  <td align="right" height="32">地址</td>
							  <td colspan="3" align="left"><input name="address" type="text" value="<?=$address11==""?$config_row['address']:$address11?>"    class="ifinfoinputshort" style="width:92%;" /></td>
							  <td align="right"><?=$other11show?></td>
							  <td><input name="other" type="text" value="<?=$other11==""?$config_row['maps']:$other11?>"   class="ifinfoinputshort" style="width:100%;" /></td>
							  <td><div  align="right"><button type="submit" value="保存" class="submitbuttonsf4">保存</button></div></td>
	              </tr> 
                            </table>
    			<br />
				  <table width="100%" border="0" cellspacing="4" cellpadding="0">
						  
<tr>
								<td width="88" height="37" align="right">反馈邮箱 *
                              </td>
							  <td width="151" align="left"><input type="text" value="<?=$config_row['feedbackEmail']?>" name="feedbackEmail" class="ifinfoinputshort"  style="width:90%;"  /></td>
							  <td width="1" align="left">&nbsp;</td>
							  <td width="96" align="right"  style="padding-left:4px;">手机WhatsApp*					          </td>
							  <td width="226"  style="padding-left:4px;"><input type="text" value="<?=$config_row['tel2'];?>" name="tel2" class="ifinfoinputshort" style="width:80%;" /></td> 
							  <td width="95" align="right"  style="padding-left:4px;">skype*</td>
							  <td width="423"  style="padding-left:4px;"><input type="text" value="<?=$config_row['skype'];?>" name="skype" class="ifinfoinputshort" style="width:98%;" /></td> 
                    <tr style="margin-top:20px;">
                              <td height="34" align="right"><span style="padding-left:4px;">品牌*</span></td>
                              <td style="padding-left:px;"><input type="text" value="<?=$config_row['MSN4'];?>" name="MSN4" class="ifinfoinputshort" style="width:90%;" /></td>
                              <td style="padding-left:px;">&nbsp;</td>
                              <td align="right"><span style="padding-left:4px;">核心词*</span></td>
                              <td style="padding-left:4px;"><input type="text" value="<?=$config_row['MSN3'];?>" name="MSN3" class="ifinfoinputshort" style="width:80%;" /></td>
                              <td rowspan="2" valign="bottom" style="padding-left:4px;"></td>
                      <td rowspan="2" valign="middle" style="padding-left:4px;"><?=$fbmail_tips?></td>
                              <td width="31" rowspan="2">&nbsp;</td>
                    </tr>
                          <tr style="margin-top:20px;">
		<td height="19" align="right"><span style="padding-left:px;"><span style="padding-left:10px;">成立年</span></span></td>
		<td><span style="padding-left:px;">
		  <input name="MSN2" type="text" class="ifinfoinputshort" style="width:90%" value="<?=$config_row['MSN2'];?>"   />
		</span></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		</tr>
  
    <tr>
      <td height="48" colspan="5"></td> 
      <td colspan="4"><div class="lsconeditorarea2" align="right"><button type="submit" value="保存" class="submitbuttonsf4">保存</button></div></td>
    </tr>
    
    		</table>
						<table width="95%" height="80" border="0" align="right" cellpadding="0" cellspacing="0" id="notmust" style="DISPLAY:none ; " >
 
							 
							
                  </table>
					 
			  </td>
	</tr>
	 		 <?php file_exists("widget/ls_language.php")?include '<tr><td colspan="4">'."widget/ls_language.php".'</td></tr>':"" ?> 
   <tr>
	<td colspan="3">
    
    <table width="100%" cellspacing="0" cellpadding="0" border="0">
	<tbody><tr>
		<td width="50%">
			<?php file_exists("widget/ls_shieldIP.php")?include "widget/ls_shieldIP.php":"" ?>
		</td>
		<td width="50%" height="193">
			   <?php file_exists("widget/ls_banwords.php")?include "widget/ls_banwords.php":"" ?>

		</td>
	</tr>
</tbody></table>
	
	</td>
    </tr>
    
	<tr>
	  <td colspan="3">
	    <?php file_exists("widget/ls_config_weibo.php")?include "widget/ls_config_weibo.php":"" ?>
	    </td>
	  </tr>
    <tr>
	<td colspan="3">
         <?php file_exists("widget/ls_config_live.php")&&$promlv>1?include "widget/ls_config_live.php":""  ?>
	</td>
	</tr>

		<td colspan="3" align="center" style="padding-bottom:18px;"><div class="lsconeditorarea2" align=""><font color="#FF0000"></font>
		  <button type="submit" value="保存" class="submitbuttonsf4">保存</button></div></td>
		  </tr>
	</table>
</form>
</td>
</tr>
<?php if($promlv>1){ ?>
 <table width="100%">
	<tr style="background-color: #f0f0ee;">
        <td height="" style="padding-top:px;" ><table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" style="background-color: #f0f0ee;">
        <tr bgcolor="#f0f0ee">
              <td align="center" colspan="9" height="37"><b><a name="interlink" id="interlink"></a>内部链接优化</b></td>
            </tr>
            <tr bgcolor="#f0f0ee" height="37">
              <td height="28" colspan="9" align="left"><span style="padding-left:6px;">提示：<font color="#FF0000"><?=$ls_msg; ?></font></span></td>
            </tr>
            <tr bgcolor="#f0f0ee" height="37">
              <td align="center" width="33" height="28">序号</td>
              <td align="center" width="361" height="28">关键词（锚点）</td>
              <td width="347" align="center">链接网址</td>
              <td width="146" align="center">说明</td>
              <td colspan="2" align="center">排序</td>
              <td width="25" align="center" >操作</td>
              <td width="32" align="center" >删除</td>
              <td  width="79" align="center">允许</td>
            </tr>
            <?php 
		  $i=1;
		  while ($link_rows=mysqli_fetch_assoc($in_query))
		  { ?>
            <tbody id='ZH_<?=$link_rows['ID']?>' >
              <tr bgcolor='#f9f9f9' height='37'
						onmouseover=
						 	"this.style.backgroundColor='#e5e5e5'" 
						onmouseout=
						 	"this.style.backgroundColor='#f9f9f9'" 
						>
                <td align='center'   height='25' ><?=$i?></td>
                <td align='left' style='padding-left:10px;' height='25' ><?=$link_rows['title']?></td>
                <td align='left' style='padding-left:10px;' height='25'><a href="<?=$link_rows['url']?>" target="_blank">
                  <?=$link_rows['url']?>
                </a></td>
                <td align='left' style='padding-left:10px;' height='25'><?=trim($link_rows['memo'])?></td>
                <td width="32" align='center'><?php 						if($i!=1)// not start up
						{?>
                  <a href='?page=<?=$page?>&amp;id=<?=$link_rows['ID']?>&amp;Num=<?=$link_rows['Num']?>&amp;in=up&amp;selectcate=<?=$selectcate?>&myanchor=interlink' title='向上移动'><img src='images/up.gif' alt="" border='0' /></a>
                  <?php } ?></td>
                <td width="32" align='center'><?php 
						if($i!=$link_num)// not end down
						{ ?>
                  <a href='?page=<?=$page?>&amp;id=<?=$link_rows['ID']?>&amp;Num=<?=$link_rows['Num']?>&amp;in=down&amp;selectcate=<?=$selectcate?>&myanchor=interlink' title='向下移动'><img src='images/down.gif' alt="" border='0' /></a>
                  <?php } ?></td>
                <td align='center'><a href='javascript:secBoard(<?=$link_rows['ID']?>)' title='编辑'><img src='images/b_edit.png' alt="" border='0' /></a></td>
                <td align='center'><a href='?page=<?=$page?>&amp;id=<?=$link_rows['ID']?>&amp;in=del&amp;selectcate=<?=$selectcate?>&myanchor=interlink' onclick='return ConfirmDel();' title='删除'><img src='images/b_drop.png' alt="" border='0' /></a></td>
                <td align='center'><?php   if($link_rows['enable']==1)
							{ ?>
                  <a href='?page=<?=$page?>&amp;id=<?=$link_rows['ID']?>&amp;in=unenable&amp;selectcate=<?=$selectcate?>&myanchor=interlink' title='显示'><img src='images/enable.gif' alt="" border='0' /></a>
                  <?php }
						  if($link_rows['enable']==0)
						  	{ ?>
                  <a href='?page=<?=$page?>&amp;id=<?=$link_rows['ID']?>&amp;in=enable&amp;selectcate=<?=$selectcate?>&myanchor=interlink' title='不显示'><img src='images/unenable.gif' alt="" border='0' /></a>
                  <?php } ?></td>
              </tr>
            </tbody>
            <tbody id='Z_<?=$link_rows['ID']?>' style='display:none;'>
            
            <form action='?in=modi&myanchor=interlink' method='post' enctype='multipart/form-data' name='fm_link' id="fm_link">
              <tr bgcolor='#f4f4f4'>
                <td align='center' height='25' ><?=$i?></td>
                <td align='center' style='padding-left:10px;' height='25' ><input name='title' type='text' class='inp' value='<?=$link_rows['title']?>' style="width:90%;" /></td>
                <td align='center' style='padding-left:5px;' height='25'><input name='url' type='text' class='inp' value='<?=$link_rows['url']?>' style="width:90%;" /></td>
                <td align='center' style='padding-left:5px;' height='25'><input name="memo" type="text"  value="<?=$link_rows['memo']?>" style="width:80%;" /></td>
                <td colspan='5' align='center'><input value='<?=$link_rows['ID']?>' name='modiid' type='hidden' />
                  <button type='submit' value='保存'>保存</button>
                  <button type='button' onclick='javascript:secBoard2(<?=$link_rows['ID']?>)' value='放弃'>放弃</button></td>
              </tr>
            </form>
            </tbody> 
             
            <?php       $i++;
	  }
	 ?>
          </table>
          <br />
          <form name="fmaddlink" action="?in=insert&myanchor=interlink" enctype="multipart/form-data" method="post" onSubmit="return Checkaddlink();" style="margin-bottom:0px;">
            <table width="98%" border="0" align="center" cellpadding="3" cellspacing="0"style="background-color: #f0f0ee;">
              <tr bgcolor="#f4f4f4" height="47">
                <td width="4%" align="right" >关键词</td>
                <td width="33%" height="28" align="center" ><input name="title" type="text" style="width:90%;" size="40" /></td>
                <td width="6%" align="left" >不能有 |  ，</td>
                <td width="3%" align="right" >链接</td>
                <td width="31%" height="28" align="center" ><input name="url" type="text"  value="" style="width:90%;" /></td>
                <td width="12%" height="28" align="center" >说明
                  <input name="memo2" type="text"  value="" style="width:50%;" /></td>
                <td width="11%" align="center" ><button type="submit" value="增加" />增加</button>
                 
                  </button></td>
              </tr>
            </table>
          </form>
          <br />
         
          <form name="fmin" method="post" action="?myanchor=interlink">
          <table width="98%" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF">
    	<tr>
           <td colspan="5" align="center" height="60"><input type="button" name="button" id="button" value="分析首页获得关键词" style="height:40px;background-color:#390; color:#FFF; border:0px; cursor:pointer;" onclick="
              if(confirm('将获得首页标题关键词，作为内链关键词，确定吗？')){
                internal('add');
            }else{
                return false;
            }"/>&nbsp;&nbsp;
             <input type="button" name="subscanning" value="清除自动添加的链接" style="height:40px;background-color:#C30; color:#FFF; border:0px; cursor:pointer;"  onclick="
              if(confirm('将清除全部成段文字的链接，确定吗？')){
                window.location.href='?scanning=clear&myanchor=interlink';
            }else{
                return false;
            }"/>
            &nbsp;
            <input type="button" name="subscanning2" value="增加全部链接" style="height:40px;background-color:#090; color:#FFF; border:0px; cursor:pointer;"  onclick="
              if(confirm('将要扫描网站成段的文字内容，对关键词加上链接？')){
                window.location.href='?scanning=add&myanchor=interlink';
            }else{
                return false;
            }"/>
            &nbsp;
            <input type="button" name="button2" id="button2" value="清除全部链接" style="height:40px;background-color:#C33; color:#FFF; border:0px; cursor:pointer;" onclick="
              if(confirm('确定清除全部链接吗？')){
                internal('clear');
            }else{
                return false;
            }"/></td>
         </tr>
         <tr >
              <td height='25' colspan="5" align='center' style='padding-left:10px;' >注1： “分析首页获得关键词”将扫描首页SEO设置中的标题（Title）和关键词设置（mate keywords）中的关键词，<br />
            注2： “为网站内容增加内链” 将扫描站内全部文章，对关键词加链接。</td>
          </tr>
    </table>
  	<br />
  </form>
</td>
</tr>

</table>
<?php } ?>
</body>
</html>
