<?php 	//ls_config 1002 视频会谈、视频直播设置 
	$ChangeliveLogo2=$_POST['ChangeliveLogo2'];
	$config_sql="select * from ls_config ";
	$config_query=$opendb->query($config_sql);
	$config_row=mysqli_fetch_assoc($config_query);
	
	if($config_row['tel4'] == ""){  //live logo
		$livePath = "images/picture.gif";
	}else{
		$livePath = "../images/".$config_row['tel4'];
	}
	
	$image=$_FILES['tel4']['name'];   
	$size=$_FILES['tel4']['size'];   
	$type=$_FILES['tel4']['type'];
	
	if($ls=="modi"){ 
			 
			if($ChangeliveLogo2=="yes"){
				//
				//判断图像格式
				if($type == "image/gif" || $type == "image/png" || $type == "image/pjpeg" || $type == "image/jpeg" )
					{
						if($size < 600000) //开始判断图像大小
						{
							$oldbigpic="../images/".$config_row['tel4'];
							if(file_exists($oldbigpic)){
								unlink($oldbigpic);		//delete old big pic
							}
							
							$dest="logo";
	
							$pic = $image;
							$dest=time();
							$pic=substr($pic,(strlen($pic)-4),strlen($pic));
							$picName = $dest.$pic;
							$pathBigPic = "../images/".$picName;
							$livePath="../images/".$picName;
							//上传文件
							move_uploaded_file($_FILES['tel4']['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 email4=%s ,email3=%s,tel4=%s",
				GetSQLValueString($email4, "text"),
				GetSQLValueString($email3, "text"),
				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="50%">
		  <fieldset class="infofield" style="height:">
				<legend>视频会议设置
				<?php if($lang == "en"){ ?>
			  </legend><table width="100%" border="0" cellspacing="0" cellpadding="4" align="center">
						<tr height="">
							<td width="14%" height="42" align="right">网址 </td>
							<td width="86%"><textarea name="email3" rows="5" class="ifinfoinputshort" style="width:94%;"><?php echo $config_row['email3'];?></textarea></td>
						</tr>
						<tr height="">
							<td width="14%" align="right">说明 </td>
						  <td width="86%"><textarea name="email4" rows="6" class="ifinfoinputshort" style="width:94%;"><?php echo $config_row['email4'];?></textarea></td>
				</tr>
                         
					</table>
			  
			  <?php }else{  if($lang == "cn"){?>
			 
			                   
                    <?php } }?>
			</fieldset>
		</td>
		<td width="50%" height=" ">
			<fieldset class="infofield" style="height:">
				<legend>视频会议logo图</legend><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
					  <tr>
							<td height=" " align="center"><input type="hidden" name="ChangeliveLogo2" value="no"><img src="<?php echo $livePath ?>" width="" height="160" border="1" name="livepic"></td>
						</tr>
						<tr>
							<td align="center"><input type="file" name="tel4" style="width:300px;" onchange="ChangeliveLogo2.value='yes';"></td>
						</tr>
					</table>
			</fieldset>
		</td>
	</tr>
</table>
