<?php 
	session_start(); 
	require_once('inc/conn.php');
	require_once('inc/constant.php');
	require_once('inc/ls_syscode.php');
	require_once('inc/check.php');
	$opendb=new mydb();
	require_once('inc/char_set.php');
	$ls_msg="修改视频图片操作";

	$id=$_GET['id'];
	
	$video_sql="select * from ls_video where ID=".$id." ";
	$video_query=$opendb->query($video_sql);
	$video_rows=mysql_fetch_assoc($video_query);
	
	$title_sql = "select * from ls_config";
	$title_query = $opendb->query($title_sql);
	$title_value = mysql_fetch_assoc($title_query);
	
	$pos = strpos($title_value['companyName'], '-', 1);
	$subCompanyName = substr($title_value['companyName'], (mb_strlen($title_value['companyName'],'utf-8') - $pos) * -1 );
	
?>
<!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">
		<link href="css/admin.css" rel="stylesheet" type="text/css">
        <script language="JavaScript" src="js/jquery.js"></script>
		<script language="JavaScript" src="js/ls.js"></script>
		<title>无标题文档</title>
         <link rel="stylesheet" href="css/style2.css" />
	</head>
	<body>
		<table width="100%" border="0" align="center" cellpadding="1" 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 height="213" valign="top"><br>
				 <form name="myform" enctype="multipart/form-data" method="post" action="savevideo.php" onSubmit="return CheckaddVideo()">
					<input type="hidden" value="update" name="ls">
					<input type="hidden" value="<?php echo $id;?>" name="id">
					<input type="hidden" value="<?php echo $video_rows['videoFile'];?>" name="Pic">
					<input type="hidden" name="ChangecatePagePic" value="no">
					<table border="0" width="98%" align="center">
						<tr>
							<td>提示：<font color="#FF0000"><?php echo $ls_msg; ?></font></td>
							<td align="right"><img src="images/shao.gif">&nbsp;<a href="video.php"><u>返回</u></a></td>
						</tr>
					</table>
					<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#f0f0ee">
					  <tr bgcolor="#f0f0ee"> 
						<td height="28" colspan="4"></td>
					  </tr>
                      <tr bgcolor="#f0f0ee" height="37"> 
						<td style="padding-left:20px;" width="11%">视频名称：</td>
						<td width="40%"><input type="text" name="videoName" id="videoName" style="width:300px;" value="<?php echo $video_rows['videoName'];?>" ></td>
                        <td colspan="2" rowspan="2"><table border="0" width="98%">
						  <tr height="37">
						    <td bgcolor="#f0f0ee" >标题 Title</td>
						    <td><input name="newsTitle" id="newsTitle" type="text" value="<?php echo $video_rows['newsTitle'];?>" size="70" /></td>
					      </tr>
						    <tr height="37">
						    <td bgcolor="#f0f0ee" >关键字 Keywords</td>
						    <td><input name="newsKeywords" id="newsKeywords" type="text" value="<?php echo $video_rows['newsKeywords'];?>" size="70" /></td>
					      </tr>
						    <tr height="37">
						    <td bgcolor="#f0f0ee"  >描述 Description</td>
						 <td><textarea name="newsDescription" cols="72" rows="3" id="newsDescription"></textarea></td>
					      </tr>
					    </table></td>
                      </tr>
                      <tr bgcolor="#f0f0ee"> 
						<td style="padding-left:20px;" width="11%">视频简介：</td>
						<td><textarea name="videoText" id='videoText' style="width:90%; height:50px;" ><?php echo $video_rows['videoText'];?></textarea></td>
                      </tr>
					  <!--<tr bgcolor="#f4f4f4"> 
						<td style="padding-left:50px;" >*缩略图：</td>
						<td style="padding-left:5px;" >
							<img src="<?php echo "../".$videoFolders."/".$SmallFoldersProducts."/".$video_rows['videoPic']?>" width="<?php echo $SmallPicW ?>" height="<?php echo $SmallPicH?>" border="1" name="pic" ><br />
                            <input type="file" name="productPic" style="width:300px;" onBlur="document.pic.src=myform.productPic.value"; onChange="myform.ChangecatePagePic.value='yes';">
						</td>
					  </tr>-->
					</table>
                    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"  bgcolor="#f0f0ee" >
                      <tr > 
						<td style="padding-left:20px;" width="11%">视频链接：</td>
						<td width="89%"><textarea name="videoCode" style="width:70%;height:50px;" ><?php echo $video_rows['code'];?></textarea></td>
					  </tr>
                      <tr > 
						<td style="padding-left:20px;" >视频文件：</td>
						<td><input type="file" name="videoFile" style="width:400px;" onChange="myform.ChangecatePagePic.value='yes';"><font color="#FF0000">（视频格式必须为flv）</font></td>
					  </tr>
                      <tr height="37"> 
						<td style="padding-left:50px;" >&nbsp;</td>
						<td>宽度：<input type="text" name="videoW" style="width:200px;" value="<?php echo $video_rows['videoW'];?>" > &nbsp; &nbsp; 高度：<input type="text" name="videoH" style="width:200px;" value="<?php echo $video_rows['videoH'];?>" ></td>
					  </tr>
                      <tr height="37"> 
						<td style="padding-left:50px;" width="11%">&nbsp;</td>
						<td width="89%"><font color="#FF0000">提示：如果有“视频链接”（即：不为空），则为显示“视频链接”为主！</font></td>
					  </tr>
					  <tr height="47">
						<td height="47" colspan="2" align="center"><button type="submit" value="保存">保存</button>
							&nbsp;<button type="button" value="刷新本页" onClick="JavaScript:history.go(0);">刷新本页</button>
                            &nbsp;<button type="button" name="button" id="button" value="SEO"  onclick="
                            if(confirm('您确定要修改SEO设置吗？')){
                            $('#newsTitle').val($('#videoName').val()+'<?php if(strpos($title_value['companyName'],"-")){echo " ".$subCompanyName;}else{echo " - ".$title_value['companyName'];}?>');
						$('#newsKeywords').val('<?=$title_value['siteKeywords']?>');
						$('#newsDescription').val($('#videoText').val().substr(0, 267).replace(/<[^>]+>/g,'').replace(/	/g, '').replace(/\n/g, ''));
	}else{
		return false;
	}"/>SEO</button></td>
					  </tr>
					</table>
				</form>
				</td>
			</tr>
		</table>
	</body>
</html>