<?
	$ChangecateCompanyLogo2=$_POST['ChangecateCompanyLogo2'];
	
	$openck=new cktb();
	if($openck->checkfield("ls_config","facebook","ALTER TABLE  `ls_config` ADD  `facebook` VARCHAR( 200 ) NULL AFTER  `bottomMenu`"))	$ls_msg = $ls_msg .$openck->ls_msg;
	if($openck->checkfield("ls_config","twitter","ALTER TABLE  `ls_config` ADD  `twitter` VARCHAR( 200 ) NULL AFTER  `facebook`"))	$ls_msg = $ls_msg .$openck->ls_msg;
	if($openck->checkfield("ls_config","linkedin","ALTER TABLE  `ls_config` ADD  `linkedin` VARCHAR( 200 ) NULL AFTER  `twitter`"))	$ls_msg = $ls_msg .$openck->ls_msg;
	if($openck->checkfield("ls_config","google","ALTER TABLE  `ls_config` ADD  `google` VARCHAR( 200 ) NULL AFTER  `linkedin`"))	$ls_msg = $ls_msg .$openck->ls_msg;
	if($openck->checkfield("ls_config","company_logo","ALTER TABLE  `ls_config` ADD  `company_logo` VARCHAR( 200 ) NULL AFTER  `google`"))	$ls_msg = $ls_msg .$openck->ls_msg;
	
	$config_sql="select * from ls_config ";
	$config_query=$opendb->query($config_sql);
	$config_rows=mysql_fetch_assoc($config_query);
	
	if($config_rows['company_logo'] == null){
		$classPath = "images/picture.gif";
	}else{
		$classPath = "company_logo/".$config_rows['company_logo'];
	}
	
	$image=$_FILES['company_logo']['name'];   
	$size=$_FILES['company_logo']['size'];   
	$type=$_FILES['company_logo']['type'];
	
	if($ls=="modi"){ 
			createFolder(company_logo);
			if($ChangecateCompanyLogo2=="yes"){
				//
				//判断图像格式
				if($type == "image/gif" || $type == "image/png" || $type == "image/pjpeg" || $type == "image/jpeg" )
					{
						if($size < 600000) //开始判断图像大小
						{
							$oldbigpic="company_logo/".$config_rows['company_logo'];
							if(file_exists($oldbigpic)){
								unlink($oldbigpic);		//delete old big pic
							}
							
							$dest="logo";
	
							$pic = $_FILES['company_logo']['name'];
							$pic=substr($pic,(strlen($pic)-4),strlen($pic));
							$picName = $dest.$pic;
							$pathBigPic = "company_logo/".$picName;
							$classPath="company_logo/".$picName;
							//上传文件
							move_uploaded_file($_FILES['company_logo']['tmp_name'], $pathBigPic);
							echo $pathBigPic;
						}
						else
						{
							echo "	<script>alert('图像最大为".$PicSize."！');history.go(-1);</script>";
						}
					}else{
						echo "	<script>alert('请选择图片上传，或者你选择的文件不符合要求!\\n只允许格式 .gif .png .jpeg');history.go(-1);</script>";
					}
				$update_pic_sql=sprintf("update ls_config set company_logo=%s ",
				GetSQLValueString($picName, "text")
				);
				//更新产品图片
				$update_query=$opendb->query($update_pic_sql);
				//echo $update_sql;
				//更新数据
			}
	}

?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="100%">
			<fieldset class="infofield2" style="height:80px;">
				<legend>社交网站</legend>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
						<tr height="32">
							<td width="15%" align="right">Facebook：</td>
							<td width="35%"><input type="text" value="<?php echo $config_rows['facebook'];?>" name="facebook" class="ifinfoinputshort"  style="width:90%;"   /></td>
                            <td width="15%" align="right">Linkedin：</td>
							<td width="35%"><input type="text" value="<?php echo $config_rows['linkedin'];?>" name="linkedin" class="ifinfoinputshort"  style="width:90%;"   /></td>
						</tr>
						<tr height="32">
							<td width="15%" align="right">Twitter：</td>
							<td width="35%"><input type="text" value="<?php echo $config_rows['twitter'];?>" name="twitter" class="ifinfoinputshort" style="width:90%;"   /></td>
                            <td width="15%" align="right">Google+：</td>
							<td width="35%"><input type="text" value="<?php echo $config_rows['google'];?>" name="google" class="ifinfoinputshort" style="width:90%;"   /></td>
						</tr>
					</table>
			</fieldset>
		</td>
	</tr>
</table>
