<?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);
	$livename="视频直播";
	
	if($config_row['bottomMenu'] == ""){  //live logo
		$livePath = "images/picture.gif";
	}else{
		$livePath = "../images/".$config_row['bottomMenu'];
	}
	
	$image=$_FILES['bottomMenu']['name'];   
	$size=$_FILES['bottomMenu']['size'];   
	$type=$_FILES['bottomMenu']['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['bottomMenu'];
							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['bottomMenu']['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 notice=%s ,contact=%s,bottomMenu=%s",
				GetSQLValueString($notice, "text"),
				GetSQLValueString($contact, "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><?=$livename?>设置
				<?php if($lang == "en"){ ?>
			  </legend><table width="100%" border="0" cellspacing="0" cellpadding="4" align="center">
						<tr height="">
							<td width="22%" height="42" align="right">直播网址 </td>
							<td width="78%"><textarea name="contact" rows="5" class="ifinfoinputshort" style="width:94%;"><?php echo $config_row['contact'];?></textarea></td>
						</tr>
						<tr height="">
						  <td align="right">开始时间</td>
						  <td><input name="feedback" type="text" class="ifinfoinputshort" style="width:94%;" value="<?php echo $config_row['feedback'];?>" /></td>
			    </tr>
						<tr height="">
							<td width="22%" align="right">说明 </td>
						  <td width="78%"><textarea name="notice" rows="6" class="ifinfoinputshort" style="width:94%;"><?php echo $config_row['notice'];?></textarea></td>
				</tr>
                         
					</table>
			  
			  <?php }else{  if($lang == "cn"){?>
			 
			                   
                    <?php } }?>
			</fieldset>
		</td>
		<td width="50%" height=" ">
			<fieldset class="infofield" style="height:">
				<legend><?=$livename?>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"><input type="hidden" name="bottomMenuold" value="<?=$picName==""?$config_row['bottomMenu']:$picName?>"><img src="<?php echo $livePath ?>" width="" height="160" border="1" name="livepic"></td>
						</tr>
						<tr>
							<td align="center"><input type="file" name="bottomMenu" style="width:300px;" onchange="ChangeliveLogo2.value='yes';" ></td>
						</tr>
					</table>
			</fieldset>
		</td>
	</tr>
</table>
