<?php 
	require_once('_approot.php');	
	
	file_exists("inc/seotips.php")?require_once("inc/seotips.php"):"";
 
	$ls_msg="添加产品";

	$lan = array();
	
	if($lang != "en"){
		$lan = $lang_cn;
	}else{
		$lan = $lang_en;
	}
	
	$ls=$_GET['ls'];
	$id=$_GET['id'];
	$admininfo = $admin->getinfo();
	$opendb=new mydb();
	$addclear=$_GET['addclear'];
	//echo $addclear;
	//if($addclear==1){ unset($_SESSION['savepost']); unset($_SESSION['saveget']);  unset($_GET['addclear']); }
	
	$cateid=$_GET['cateid'];
	$cateid2=$_GET['cateid'];
	if(isset($_POST['BigClassName']))$cateid=$_POST['BigClassName'];  //$_POST['BigClassName'] 传了ID
	$catename=$_GET['catename'];
	$midcateid=$_GET['midcateid'];
	$midcateid2=$_GET['midcateid'];
	if(isset($_POST['MiddleClassName']))$midcateid=$_POST['MiddleClassName'];  //$_POST['MiddleClassName'] 传了ID
	$midcatename=$_GET['midcatename'];
	$subcateid=$_GET['subcateid'];
	$subcateid2=$_GET['subcateid'];
	if(isset($_POST['SmallClassName']))$subcateid=$_POST['SmallClassName'];  //$_POST['SmallClassName'] 传了ID
	$subcatename=$_GET['subcatename'];
	$page=$_GET['page'];
	
	if(isset($_SESSION['savepost']))  { $_POST=$_SESSION['savepost'];$ls_msg=str_replace("添加".$productShowName."操作，","上次产品添加失败，",$ls_msg);} //saveproducts 变量
	if(isset($_SESSION['saveget'])) $_GET=$_SESSION['saveget']; //saveproducts 变量
	$productID=$_GET['productID'];
	
	$title_sql = "select * from ls_config";
	$title_query = $opendb->query($title_sql);
	$title_value = mysqli_fetch_assoc($title_query);
?>
<!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" />
<link rel="stylesheet" href="kindeditor-4.1.10/themes/default/default.css" />
<link rel="stylesheet" href="kindeditor-4.1.10/plugins/code/prettify.css" />
<script charset="utf-8" src="kindeditor-4.1.10/kindeditor.js"></script>
<script charset="utf-8" src="kindeditor-4.1.10/lang/zh_CN.js"></script>
<script charset="utf-8" src="kindeditor-4.1.10/plugins/code/prettify.js"></script>
<script>
    KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="productSpecification"]', {
			filterMode: false,	
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
			afterBlur: function(){
				this.sync();
			},
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
	
	 KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="characteristics"]', {
			filterMode: false,	
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
	 
	  KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="advantages"]', {
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
	  
	   KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="parameters"]', {
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
	   
	   		KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="canshu"]', {
			filterMode: false,	
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });

	KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="basicInfo"]', {
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });

	KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="additionalInfo"]', {
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
	   
</script></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="saveproducts.php?cateid=<?php echo $cateid?>&midcateid=<?php echo $midcateid?>&subcateid=<?php echo $subcateid?>&page=<?php echo $page ?>" onSubmit="return Checkaddproducts()">
				<input type="hidden" value="insert" name="ls">
			  <table border="0" width="96%" align="center">
					<tr>
						<td width="56%">提示：<font color="#FF0000"><?php echo $ls_msg; ?></font></td>
						<td width="26%" align="right"><button  type="button"value="产品页生成" onClick="JavaScript:location='temp_index.php?ls=products&productsall=ok'">产品页生成</button></td>
						<td width="18%" align="right"><img src="images/shao.gif">&nbsp;<a href="<?php echo "products.php?cateid=".$cateid."&midcateid=".$midcateid."&subcateid=".$subcateid."&page=".$page; ?>">返回</a></td>
					</tr>
				</table>
				<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#f0f0ee">
	  <tr>
						<td height="20" colspan="3"></td>
					</tr>
					<tr  bgcolor="#f0f0ee">
						<td style="padding-left:15px;" width="9%">类别 *</td>
						<td colspan="2" style="padding-left:3em;" ><?php
									//cate change
									$midcate_sql="select * from ls_products where subcateName is null and cateName is null and cateFolders is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
									$midcate_query=$opendb->query($midcate_sql);
									echo "<script language = 'JavaScript'>" ;
									echo " var onecount; " ;
									echo " midcat = new Array(); " ;
									$count=0;
									while($midcate_rows=mysqli_fetch_assoc($midcate_query))
									{
										echo " midcat[".$count."] = new Array(\"" ;
										echo 			trim($midcate_rows['midcateName'])."\",\"" ;
										echo 			trim($midcate_rows['midcateID'])."\",\"" ;
										echo 			trim($midcate_rows['ID'])."\"); " ;
										$count++	;
									}
									echo "onecount=".$count.";"	;

									
									
									$subcate_sql="select * from ls_products where cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and midcateName is null and midcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
									$subcate_query=$opendb->query($subcate_sql);
									
									echo " var onecount2; " ;
									echo " subcat = new Array(); " ;
									$count2=0;
									while($subcate_rows=mysqli_fetch_assoc($subcate_query))
									{
										echo " subcat[".$count2."] = new Array(\"" ;
										echo 			trim($subcate_rows['subcateName'])."\",\"" ;
										echo 			trim($subcate_rows['subcateID'])."\",\"" ;
										echo 			trim($subcate_rows['ID'])."\"); " ;
											
										$count2++	;
									}
									echo "onecount2=".$count2.";"	;
								 	
									
									echo "function changelocation_big(locationid) "	;
								  echo "  {"	;
								  echo "  document.myform.MiddleClassName.length = 0; ";
								  echo "  var locationid=locationid;";
								  echo "  var i;";
								  echo "  var j=1;";
								  echo "  for (i=0;i < onecount; i++)";
								  echo "	  {";
								  echo "		  if (midcat[i][1] == locationid)";
								  echo "		  { ";
								  echo "			  document.myform.MiddleClassName.options[document.myform.MiddleClassName.length] = new Option(midcat[i][0], midcat[i][2]);";
								  echo "		  	  if (j == 1)";
								  echo "		  	  	{";
								  echo "		  	  	changelocation_middle(midcat[i][2]);";
								  echo "		  	  	j++;";
								  echo "		  	  	}";
								  echo "		  } ";	   
								  echo "	   	  if (j == 1)";
								  echo "	   	  {";
								  echo " 	 	  	changelocation_middle(-1);";//clear smallclass select
								  echo "	   	  }";
								  echo "	  }";
								  echo "  }"; 
								   
								   //midcate change
									echo "function changelocation_middle(locationid) "	;
								  echo "  {"	;
								  echo "  document.myform.SmallClassName.length = 0; ";
								  echo "  var locationid=locationid;";
								  echo "  var i;";
								  echo "  for (i=0;i < onecount2; i++)";
								  echo "	  {";
								  echo "		  if (subcat[i][1] == locationid)";
								  echo "		  { ";
								  echo "			  document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);";
								  echo "		  } ";	   
								  echo "	  }";
								  echo "  }"; 
								  echo "</script>";   
								  								   
								  $cate_bigclass_sql="select * from ls_products where midcateName is null and midcateID is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
									$cate_bigclass_query=$opendb->query($cate_bigclass_sql);
									$cate_bigclass_num=mysqli_num_rows($cate_bigclass_query); 
									if($cate_bigclass_num==0)
									{
										echo "请先添加大类!";
									}
									else
									{
									echo "大类: <select name='BigClassName' onChange='changelocation_big(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)' size='1'>" ;
									$i=1;
									while($cate_bigclass_rows=mysqli_fetch_assoc($cate_bigclass_query))
									 {
									 	 if($i==1)
									 	 {
									 	 	$selclass=$cate_bigclass_rows['ID'];
									 	 	
									 	 	echo " <option ";
									 	 	if($cateid=="" || $cateid==$cate_bigclass_rows['ID'])
									 	 	{
									 	 		echo "selected";
									 	 	}
									 	 	echo " value=".trim($cate_bigclass_rows['ID']).">".trim($cate_bigclass_rows['cateName'])."</option>";
									 	 }
									 	 else
									 	 {
									 	  echo "	<option ";
									 	  if($cateid==$cate_bigclass_rows['ID'])
									 	 	{
									 	 		echo "selected";
									 	 	}
									 	  echo " value=".trim($cate_bigclass_rows['ID']).">".trim($cate_bigclass_rows['cateName'])."</option>";
									 	 }
									 	  $i++;
									 }
									echo "</select>";

								 	if($midcateid=="")
								  	{
										if($cateid != null){
											$selclass = $cateid2;
										}
										
								  		$midcate_middleclass_sql="select * from ls_products where cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null  and enable=1 and midcateID=".$selclass."  order by Num asc";
									}
									else
									{
										$midcate_middleclass_sql="select * from ls_products where cateName is null and cateFolders is null  and subcateName is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null  and enable=1 and midcateID=".$cateid."  order by Num asc";
									}
									$midcate_middleclass_query=$opendb->query($midcate_middleclass_sql);
									$midcate_middleclass_num=mysqli_num_rows($midcate_middleclass_query);
									
									
									echo " 中类: <select name='MiddleClassName'onChange='changelocation_middle(document.myform.MiddleClassName.options[document.myform.MiddleClassName.selectedIndex].value)' size='1'>" ;
									if($midcate_middleclass_num==0)
									{
										echo "<option value='' ";
										
										if($midcateid=="")
								  		{
											echo "selected";
										}
										echo "></option>";
									}else{
										$j=1;
									}
									
								  	while($midcate_middleclass_rows=mysqli_fetch_assoc($midcate_middleclass_query))
								  	{
										if($j==1)
										{
										 	$selmidclass=$midcate_middleclass_rows['ID'];

										}
										$j++;
								  		echo "<option ";
								  		if($midcateid==$midcate_middleclass_rows['ID'])
								  		{
												echo "selected";
										}
								  		echo " value=".$midcate_middleclass_rows['ID'].">".$midcate_middleclass_rows['midcateName']."</option>";
									}
									echo "</select>";
									
									

									echo " 小类: <select name='SmallClassName'>";
								  	if($midcate_middleclass_num!=0)
									{
										if($subcateid=="")
										{
											if($midcateid != null){
												$selmidclass = $midcateid2;
											}
									  		$subcate_smallclass_sql="select * from ls_products where cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and midcateName is null and midcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null  and enable=1 and subcateID=".$selmidclass."";
										}
										else
										{
											$subcate_smallclass_sql="select * from ls_products where cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and midcateName is null and midcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null  and enable=1 and subcateID=".$midcateid."";
										}
										$subcate_smallclass_query=$opendb->query($subcate_smallclass_sql);
										$subcate_smallclass_num=mysqli_num_rows($subcate_smallclass_query);

										if($subcate_smallclass_num==0)
										{
											echo "<option value='' ";
											if($subcateid=="")
									  		{
												echo "selected";
											}
											echo "></option>";
										}
									  	while($subcate_smallclass_rows=mysqli_fetch_assoc($subcate_smallclass_query))
									  	{
									  		echo "<option ";
									  		if($subcateid==$subcate_smallclass_rows['ID'])
									  		{
												echo "selected";
											}
									  		echo " value=".$subcate_smallclass_rows['ID'].">".$subcate_smallclass_rows['subcateName']."</option>";
										}
									
								  	}//	if($midcate_middleclass_num==0)
								echo "</select>";
							}//if($cate_bigclass_num==0)
							
								?></td>
					</tr>
                   <tr  bgcolor="#f0f0ee">
                    	<td style="padding-left:15px;" >添加到</td>
                        <td style="padding-left:3em;" width="29%">
                        	<?php
							if($_SESSION['place']){
								$place = $_SESSION['place'];
							}else{
								$place = $proplace;
							}
							?>
                        	<select style="color:#F09;FONT-SIZE:14px;" name='place'>
                            	<option value="first" <?php if($place=='first')echo "selected"?>>
                                	最前面
                                </option>
                                <option value="last" <?php if($place=='last')echo "selected"?>>
                                	最后面
                                </option>
                            </select>  
                                                   
                            
                        </td>
						<td width="62%"><select style="color:#F09;FONT-SIZE:14px;" name='isbranch'>
                            	<option value="0">
                                	普通产品
                                </option>
                                <option value="1">
                                	只有本部门会员可见
                                </option>
                            </select></td>
                    </tr>
				<tr  bgcolor="#f0f0ee">
						<td align="left" style="padding-left:15px;" >名称 *</td>
			    <td colspan="2" style="padding-left:3em;" ><input name="productName" type="text" value="<?php echo $_POST['productName'];?>" size="36" onblur="
document.myform.productTitle.value=this.value+'<?php if(strpos($title_value['companyName'],"-")){echo " ".substr($title_value['companyName'],strpos($title_value['companyName'],"-"),200);}else{echo " - ".$title_value['companyName'];}?>';document.myform.productKeywords.value=this.value+', <?=$lan['seoFrefix1']?>'+this.value+'<?=$lan['seoSufix1']?>, <?=$lan['seoFrefix2']?>'+this.value+'<?=$lan['seoSufix2']?>'+', '+document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text;document.myform.matealt.value=this.value;" /></td>
					</tr>
					<tr  bgcolor="#f0f0ee">
						<td style="padding-left:15px;" >货号</td>
						<td width="29%" style="padding-left:3em;" ><input name="productItemNo" type="text" value="<?php echo $_POST['productItemNo'];?>" size="36" /></td>
						<td style="padding-left:3em;"><input id="showonhome" name="showonhome" type="checkbox" value="0"  />
							<label for="showonhome" style="margin-right:10px;">首页热点，位置 
					          <input type="text" value="1" size="6" name="No"></label>
							  <?php 							  if($ls_classproType == "selectPic"){
								?>
							  	<input name="classproduct" type="checkbox" id="classproduct" style="margin-left:5px;" value="0" /><label for="hotproduct" style="margin-right:10px;">产品类图片</label> 
							  	位置 
							  	<input type="text" size="4" name="NoClassPro" value="1" /> &nbsp; 
								<?php 							  }
							  ?>
							  <input id="hotproduct" name="hotproduct" type="checkbox" value="1" />
							<label for="hotproduct" style="margin-right:10px;">推荐产品</label>
							<input id="newproduct" name="newproduct" type="checkbox" value="2" />
							<label for="newproduct" style="margin-right:10px;">新产品</label></td>
					</tr>
                    
                    <?php                     $specificationName=explode(',',$specNames);
                    $specificationValue=explode(',',$specValue);
					if($specificationName[0]!="")
					{
					for($i=0;$i<(count($specificationName));$i++)  //循环处理变量处理 变量名
					{	
					?>

					<tr  bgcolor="#f0f0ee">
					  <td style="padding-left:12px;" >参数</td>
					  <td colspan="2" style="padding-left:3em;" ><input name="specificationName[<?=$i?>]" type="text" value="<?php echo $specificationName[$i];?>:" size="13"  id="specificationName<?=$i?>"     readonly="readonly" style="border:none"/>					    
                      <input name="specificationValue[<?=$i?>]" type="text" value="<?php echo $specificationValue[$i];?>" size="16" id="specificationValue<?=$i?>" onfocus="this.value=((this.value=='<?php echo $specificationValue[$i];?>')?'':(this.value));"  onblur="this.value=((this.value=='')?('<?php echo $specificationValue[$i];?>'):this.value); "  style="color:#999" onchange="document.getElementById('specificationValue<?=$i?>').style.color ='black';"/></td>
				  </tr>
                  <?php                   }
				  }
				  ?>
					<tr  bgcolor="#f0f0ee">
						<td rowspan="3" style="padding-left:12px;" >主图  *</span></td>
						<td style="padding-left:3em;" ><div id="preview"><img src="images/picture.gif" width="<?php echo $SmallPicW ?>"   border="1" name="pic" style="float:left;"  ></div><br>
							<br>
<script type="text/javascript">  
function preview(file)
{
	
	
var prevDiv = document.getElementById('preview');
if (file.files && file.files[0])
{
var reader = new FileReader();
reader.onload = function(evt){
prevDiv.innerHTML = '<img src="' + evt.target.result + '" width="<?php echo $SmallPicW ?>"  border="1" name="pic" style="float:left;" />';
}  
reader.readAsDataURL(file.files[0]);
}
else  
{
prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
}
}

//图片类型验证 ".jpg", 
function pictype(file)
{
   var fileTypes = [<?=$imagetypes2?>];
    var filePath = file.value;
    //当括号里面的值为0、空字符、false 、null 、undefined的时候就至关于false
	alert( filePath );
    if(filePath){
        var isNext = false;
        var fileEnd = filePath.substring(filePath.indexOf("."));
        for (var i = 0; i < fileTypes.length; i++) {
            if (fileTypes[i] == fileEnd) {
                isNext = true;
                break;
            }
        }
        if (!isNext){
            alert('<?=$imagealert?>');
            file.value = "";
            return false;
        }
    }else {
        return false;
    }
}

//图片大小验证
function picsize(file) {
    var fileSize = 0;
    var fileMaxSize =<?=$PicSize/1000?>;// 1M
    var filePath = file.value;
    if(filePath){
        fileSize =file.files[0].size;
        var size = fileSize / 1024;
        if (size > fileMaxSize) {
            alert("<?=$imagealertsize?>");
            file.value = "";
            return false;
        }else if (size <= 0) {
            alert("图片大小不能为0！");
            file.value = "";
            return false;
        }
    }else{
        return false;
    }
}

</script>
<br><br></td>
						<td style="padding-left:1em;">
						<fieldset class="infofield" onMouseOver="ibov(this);" onMouseOut="ibou(this);" style="padding-left:1em; width:92%;">
						<legend>SEO参数</legend>
						<table width="96%" border="0">
					<tr  bgcolor="#f0f0ee">
						    <td width="131">标题 Title *</td>
						    <td width="383"><textarea name="productTitle" cols="70" rows="3" id="productTitle"><?php echo $_POST['productTitle'];?></textarea></td>
					      </tr>
						  <tr>
						    <td>关键字 Keywords</td>
						    <td><textarea name="productKeywords" cols="70" rows="3" id="productKeywords"><?php echo $_POST['productKeywords'];?></textarea></td>
					      </tr>
					<tr  bgcolor="#f0f0ee">
						    <td >描述 Description *</td>
						    <td><textarea name="productDescription" cols="70" rows="4" id="productDescription"><?php echo $_POST['productDescription'];?></textarea></td>
					      </tr>
					    </table> <div style="padding:0 5% 0 0%" align="left"><?=$promlv>1?$seo:""?></div>						</fieldset>
<br/><div align="right" style="padding-right:20px;">
					    <button name="submit3" type="submit" value="确定" onClick="
                        if($('#productDescription').val().length <= 0){
                        	$('#productDescription').val(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix1']?><?=$lan['seoSufix2']?>'+', '+document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix2']?><?=$lan['seoSufix2']?>');
                        }"/>确定</button>
					    </div>
                       
						</td>
					</tr>
				<tr  bgcolor="#f0f0ee">
						<td colspan="2" style="padding-left:3em;" ><input type="file" name="productPic" style="width:160px;" onchange="pictype(this);picsize(this);preview(this);">
						  <input id="automationGif" name="automationGif" type="checkbox" value="1"  />
						  动画透明GIF PNG 
						  <span style="padding-left:110px; "> 图片alt </span>
			             <span style="padding-left:20px;">  <input name="matealt" type="text" value="<?php echo $_POST['matealt'];?>" size="64"    /> </span>
			              <br />
			              <?=$propic_tips?></td>
				  </tr>
				<tr>
				  <td colspan="2" style="padding-left:3em;" >&nbsp;</td>
				  </tr>
                 <?php  if($ifmutipic) include("widget/_addproducts_muti.php"); //  ?>
				<tr>
                <tr>
				  <td colspan="3" style="padding-left:3em;" >&nbsp;</td>
				  </tr>
                  <?php file_exists("widget/ls_products_canshu.php")?include "widget/ls_products_canshu.php":"" ?>
				  <td style="padding-left:12px;" >视频</td>
				  <td style="padding-left:3em;" ><div id="preview2">
<video width="<?php echo $SmallPicW  ?>"  id="vdo" style="float:left;" border="1" poster="images/picture.gif"   preload="Metadata" controls="controls"><source src="images/picture.gif" /></video>

                </div>
				    <br />
				    <br />
				    <script type="text/javascript">  
function preview2(file)
{

var prevDiv = document.getElementById('preview2');
if (file.files && file.files[0])
{
var reader = new FileReader();
reader.onload = function(evt){
prevDiv.innerHTML = '<img src="' + evt.target.result + '" width="<?php echo $SmallPicW ?>"  border="1" name="vdo" style="float:left;" />';
}  
reader.readAsDataURL(file.files[1]);
}
else  
{
prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
}
}
                    </script>
				    <br />
				    <br /></td>
				  <td style="padding-left:1em;"><span style="padding-left:3em;">
				    <input type="file" name="productVideo" style="width:300px;" onchange="preview2(this)" />
				    <br />
                  <span style="padding-left:48px;"> <?=$promlv>1?$video_tips:""?> </span></td>
				  </tr>
				<tr  bgcolor="#f0f0ee">
					  <td colspan="3" style="padding-left:10px;"><div align="right" style="padding-right:20px;">
					    <button name="submit3" type="submit" value="确定" onClick="
                        if($('#productDescription').val().length <= 0){
                        	$('#productDescription').val(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix1']?><?=$lan['seoSufix2']?>'+', '+document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix2']?><?=$lan['seoSufix2']?>');
                        }"/>确定</button>
					    </div></td>
				  </tr>
					<tr  bgcolor="#f0f0ee">
						<td style="padding-left:15px; " >说明 *</td>
						<td colspan="2" style="padding-left:3em;padding-right:3em;">
<textarea name="productSpecification" id="productSpecification" style="width:100%;height:400px;visibility:hidden;"><?=$_POST['productSpecification']?></textarea><div style="padding:0 0% 0 0%" align=""><?=$specification_tips?><?=$promlv>1?$detail_tips:""?> </div>
					</tr>
					 <tr bgcolor="#f4f4f4">
						<td style="padding-left:15px;" >&nbsp;</td>
						<td colspan="2" style="padding-left:3em;"><?php file_exists("widget/ls_products_addandmodi_moreinfo.php")?include "widget/ls_products_addandmodi_moreinfo.php":"" ?></td>
					</tr> 
					<tr bgcolor="#f0f0ee">
						<td height="47" colspan="3" align="center"> <button name="submit3" type="submit" value="确定" onClick="
                        if($('#productDescription').val().length <= 0){
                        	$('#productDescription').val(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix1']?><?=$lan['seoSufix2']?>'+', '+document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].text+'<?=$lan['seoFrefix2']?><?=$lan['seoSufix2']?>');
                        }"/> 确定</button>
						<button type="reset" name="button" id="button" value="重置" />重置</button>
			          </td>
					</tr>
				</table>
			</form></td>
	</tr>
</table>
</body>
</html>