<div class="title"><span>Update TradeInfo of WebSite</span> </div>
        <div class="infodiv"><br /><br />
        	本栏目只能提交、更新原始资料和英文站体的信息,其他语言站体请<a href="#">提交ETW</a>进行翻译<br />
<?php $sql="select website from etw_web where usernameid=$userid and istrade=1";
$result=mysql_query($sql);
$count=mysql_fetch_array($result);
if($count==0){ ?>
<input type="text" name="website" class="input" size="40" /> <input type="button" name="btm" value="更新..." />
<?php }else{?>            
<table width="75%" border="0">
<?php while($rs=mysql_fetch_array($result)){?>
  <tr>
    <td></td>
    <td><?php echo $rs['website'];?></td>
    <td><input type="button" name="btm" value="更新..." /></td>
  </tr>
<?php } ?>
</table>
<?php } ?><br />
<br />
<br />
</div>
<?php 
$xmlhead="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\r";
$sql="select * from trade_product where userId=$userid order by updatetime";
$body="<channel>\n\r";

$result=mysql_query($sql);
	while($rs=mysql_fetch_array($result)){
	$body=$body."<item>\n\r";
	$body=$body."<userId>".$rs['userId']."</userId>\n\r";
	$body=$body."<proId>".$rs['proId']."</proId>\n\r";
	$body=$body."<proname>".$rs['proname']."</proname>\n\r";
	$body=$body."<keywords>".$rs['keywords']."</keywords>\n\r";
	$body=$body."<description>".$rs['details']."</description>\n\r";
	$body=$body."<details>".$rs['details']."</details>\n\r";
	$body=$body."<picture>".$rs['picture']."</picture>\n\r";
	$body=$body."<minorder>".$rs['minorder']."</minorder>\n\r";
	$body=$body."<fobprice>".$rs['fobprice']."</fobprice>\n\r";
	$body=$body."<port>".$rs['port']."</port>\n\r";
	$body=$body."<payment>".$rs['payment']."</payment>\n\r";
	$body=$body."<deliverytime>".$rs['deliverytime']."</deliverytime>\n\r";
	$body=$body."<supplyability>".$rs['supplyability']."</supplyability>\n\r";
	$body=$body."<package>".$rs['package']."</package>\n\r";
	$body=$body."</item>\n\r\n\r";
	}
	mysql_free_result($result);
$body=$body."</channel>";
$pro_xml=$xmlhead.$body;
$dir="trade/xml/$userid/";
$xmlfile="trade/xml/$userid/pro.xml";
if(!is_dir($dir)){
	  		if(!mkdir($dir , 0777 ,true)) die("创建站体文件夹失败");
	  }
fopen($xmlfile,"w");
file_put_contents($xmlfile,$pro_xml);	

$param_body="<channel>\n\r";
$param_sql="select * from trade_pro_param where userId=$userid order by proId";
$para_result=mysql_query($param_sql);
while($row=mysql_fetch_array($para_result)){
	$param_body=$param_body."<item>\n\r";
	$param_body=$param_body."<userId>".$row['userId']."</userId>\n\r";
	$param_body=$param_body."<proId>".$row['proId']."</proId>\n\r";
	$param_body=$param_body."<parameter>".$row['parameter']."</parameter>\n\r";
	$param_body=$param_body."<paramvalue>".$row['paramvalue']."</paramvalue>\n\r";
	$param_body=$param_body."</item>\n\r\n\r";
}
$param_xml=$xmlhead.$param_body."</channel>";
$xmlparam="trade/xml/$userid/param.xml";
fopen($xmlparam,"w");
file_put_contents($xmlparam,$param_xml);
	
?>