<script type="text/javascript" src="trade/js/delpic.js"></script>
<div class="infodiv"><br>
        	<center>修改产品信息</center><br>
        </div>
<?php 
$proid=$_GET['pro'];
$langid=$_GET['langid'];
$sql="select * from trade_product where userId=$userid and proId=$proid and langId=$langid limit 0,1";
$result=mysql_query($sql);
if(mysql_num_rows($result)==0){ echo "<script type='text/javascript'>location.href='tradeinfo.php';</script>";}
?>
<form action="trade/dotrade.php?act=modpro" method="post" enctype="multipart/form-data" onSubmit="return goaddproduct()">
     	<div class="infodiv" id="webdiv"><input type="hidden" name="lang" value="<?php echo $langid;?>" />
        	<div class="infoleft"><span class="red">*</span> 选择发布站体:</div>
            <div class="inforight"><select  name="webiste" id="website"><?php  getWeblist($userid,mysql_result($result,0,'website'));?></select><br><span id="err_p"></span> </div>
        </div>

        <div class="infodiv"><input type="hidden" name="proid" value="<?php echo $proid; ?>">
        	<div class="infoleft"><span class="red">*</span> Product Name:</div>
            <div class="inforight"><input type="text" id="proname" name="proname" value="<?php echo mysql_result($result,0,'proname');?>" class="input" size="50" /><br><span id="err_p"></span> </div>
        </div>
        <div class="infodiv">
        	<div class="infoleft"><span class="red">*</span> 相关产品名:</div>
            <div class="inforight">
<?php $keyword=mysql_result($result,0,'keywords'); $key=explode(",",$keyword);
switch (count($key)){
	case "1";$key1=""; $key2=""; $key3=""; break;  case "2";$key1=$key[0]; $key2=""; $key3=""; break;
	case "3";$key1=$key[0]; $key2=$key[1]; $key3=""; break;  case "4";$key1=$key[0]; $key2=$key[1]; $key3=$key[2]; break;}
	$cns=mysql_result($result,0,'cnkeywords'); $cn=explode(",",$cns);
switch (count($cn)){
	case "1";$cn1=""; $cn2=""; $cn3=""; break;  case "2";$cn1=$cn[0]; $cn2=""; $cn3=""; break;
	case "3";$cn1=$cn[0]; $cn2=$cn[1]; $cn3=""; break;  case "4";$cn1=$cn[0]; $cn2=$cn[1]; $cn3=$cn[2]; break;}
 ?>            
 <span class="huise">英文产品名 	<input type="text" id="key1" name="key1" value="<?php echo $key1; ?>" class="input" />
 			<input type="text" name="key2" id="key2" value="<?php echo $key2; ?>" class="input" />
            <input type="text" name="key3" id="key3" value="<?php echo $key3; ?>" class="input" /> </span><br />
<span class="huise">对应的中文  <input type="text" name="cn1" value="<?php echo $cn1; ?>" class="input" />
 			<input type="text" name="cn2" value="<?php echo $cn2; ?>" class="input" />
            <input type="text" name="cn3" value="<?php echo $cn3; ?>" class="input" /> </span><br />
	<span class="huise" id="err_k">最少必须一个</span></div>
        </div>
        <div class="infodiv">
<?php $picture=mysql_result($result,0,"picture"); $pics=explode(";",$picture);$nums=count($pics)==0?0:(count($pics)-1);
$nums=$nums>5?5:$nums;
 ?>            
        	<div class="infoleft">Picture:</div>
            <div class="inforight"><table id="pictures"><tr><td><input type="file" name="picture[]" value="" class="input" /> <span class="huise">请上传jpg、gif格式的图片(300*200)</span></td></tr></table> <a href="" onclick="addmorepic(); return false;">更多图片</a> <a href="#">(已上传<?php echo $nums; ?>张)</a>
            <input type="hidden" name="oldpicture" id="oldpicture" value="<?php echo $picture; ?>"><br>
<div id="piclist">
<?php for($i=0;$i<$nums;$i++){ echo "<li><img src='trade/picture/$userid/".$pics[$i]."' width=75 height=45><a href=\"#\" onClick=\"delpic('".$proid."','".$userid."','".$pics[$i]."')\">删除</a></li>"; }?>
</div></div>
        </div>
        <div class="infodiv">
        	<div class="infoleft"><span class="red">*</span> Description:<br />
<span class="huise">在此输入你的产品优势</span></div>
            <div class="inforight"><textarea name="description" id="description" style="border:solid 1px #ccc; width:80%; height:80px;"><?php echo mysql_result($result,0,'description');?></textarea><br><span id="err_des"></span>		</div>
        </div>
        <div class="infodiv">
        	<div class="infoleft">Details:<br />
<span class="huise">产品详细描述</span></div>
            <div class="inforight"> <textarea name="details" id="details" style="border:solid 1px #ccc; width:85%; height:120px;" onkeyup="wordnum()" ><?php  echo mysql_result($result,0,'details'); ?></textarea><br />
<span class="huise" id="wordnums">你可以输入100个单词</span>	</div>
        </div>
		<div class="infodiv">
        	<div class="infoleft">产品参数属性:<br /></div>
			<div class="inforight"><table border="0" id="myparam"><?php productparambyid($userid,$proid)?>
            <tr><td><input type="text"  name="param[]" value="" class="input1" />: <input type="text" name="value[]" value="" class="input" /></td></tr></table>
            <a href="" onclick="admore(15);return false;" class="abtn">添加更多</a></div>
        </div>
        <div class="infodiv">
        	<div class="infoleft">选择贸易条件:</div>
			<div class="inforight" style="line-height:28px;"><span>FOB价格：
            <input type="text" name="fob_small" class="input" size="10" value="<?php echo mysql_result($result,0,"fob_small");?>" /> ~ 
            <input type="text" name="fob_big" size="10" class="input" value="<?php echo mysql_result($result,0,"fob_big");?>" /> 
            <select name="fob_moneystyle" style="font-size:12px;">
<?php $styles=mysql_result($result,0,"fob_moneystyle"); fob_moneystyle($styles)?></select>
             港口 <input type="text" name="port" value="<?php echo mysql_result($result,0,"port");?>" class="input" size="15" /></span><br />
<span>付款方式： <?php $payment=mysql_result($result,0,"payment"); paymentmethod($payment);?></span><br />
<span>最小起订量： 
<input type="text" name="minordernum" value="<?php echo mysql_result($result,0,"minordernum");?>" class="input" size="10" /> 
<select name="order_unit"><?php $order_unit=mysql_result($result,0,"order_unit"); unit($order_unit); ?></select> 
其他<input type="text" name="order_other" value="<?php echo mysql_result($result,0,"order_other");?>" size="25" class="input" /></span><br />

<span>供货能力：<input type="text" name="supply" class="input" size="10" value="<?php echo mysql_result($result,0,"supply"); ?>" /> 
<select name="supply_unit"><?php  $supply_unit=mysql_result($result,0,"supply_unit"); unit($supply_unit);?></select>
 per <select name="everytime" ><?php $every=mysql_result($result,0,"everytime"); supply_times($every);?></select></span> <br />
<span>发货期限：<input type="text" class="input" name="deliverytime" value="<?php echo  mysql_result($result,0,"deliverytime");?>" size="65" /></span><br />
<span style="float:left">常规包装：</span><span ><textarea name="package" style="border:solid 1px #ccc; width:80%; height:80px;"><?php echo  mysql_result($result,0,"package");?></textarea></span></div>
        </div>
        <div class="infodiv" style="text-align:center; line-height:30px;">
<br />
提交前，请认真核对您填写的信息。<br />
<input type="submit" name="submit" value="提交" /><br />
<br />
        </div>
        </form>
		
<script type="text/javascript">
	url=document.getElementById("website")
	opt=url.getElementsByTagName("option")
	fat=document.getElementById("webdiv")
	if(opt.length<2){ fat.style.cssText="display:none";}
</script> 