<?php
@session_start();
include('inc/conn.php');
include('checkstate.php');
include('inc/function.php');
include('fun/funcount.php');

   $action=$_GET['action'];
   if($action=="submit"){
       $url=$_POST['url'];
	   $content=$_POST['content'];
	   $time=date('Y-m-d',time());
	   if($content==''){
	   echo "<script type=\"text/javascript\">alert('请认真填写修改内容，谢谢');";
	   echo "window.location.href='updateproduct.php';</script>";
	   }else{	   
	   $ins="insert into etw_productupd(userid,url,content,edittime) value(".$_SESSION['guestid'].",'".$url."','".$content."','".$time."')";
	   mysql_query($ins);
	   }
   }
 ?>
<!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" />
<meta name="robots" content="noindex,nofllow">
<title><?php echo $info['company'];  ?> - 产品更新 -ETW 国际客户之窗</title>
<link rel="stylesheet" type="text/css" href="css/css.css" />


</head>

<body>
<div id="main">
    <div id="top">
        <?php include('header.php');  ?>
       <div id="logo">
       <div id="menu">
          <ul><li class="current"><a href="manage.php">系统首页</a></li>
         <li><a href="news.php">新闻</a></li>
          <li><a href="commontools.php">工具箱</a></li>
       </ul><iframe style=" float:right;" width='350' height='30' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='No' src='http://m.weather.com.cn/m/p3/weather1.htm' name="I6"></iframe></div>
       </div>
    </div>
     <!-- left -->
     <?php include('left.php');?>
     
     <div id="right">
         <p class="title"><strong>ETW 国际服务中心</strong> &gt;&gt; 产品更新与修改 </p>      
         <div class="daoh"><br /> &nbsp; &nbsp;
         <a href="onlineupdateproduct.php" target="_blank">在线更新修改</a>  &nbsp; &nbsp; |  &nbsp; &nbsp;  <a href="?action=etw">ETW更新修改</a></div>
        <?php $action=$_GET['action'];
		      if($action=="etw"){
		?> 
         <div id="con">
         <p>提示：如要更新修改产品信息，请在网站完成制作后的3个月后再提交修改资料.<br /><br /></p>         
         <form action="updateproduct.php?action=submit" method="post">
                修改主题：<input type="text" name="url" value="http://" size="35" /><br />
                <textarea name="content" cols="60" rows="8"></textarea>
                <br />
           <div style="margin-left:100px;">&nbsp;<input type="submit" name="submit" value="提交修改资料" /></div>
         </form>
         <div class="suggests">
<?php 
$count=sql_select("select count(*) from etw_productupd where userid=".$_SESSION['guestid']);
$pages= ceil($count[0][0]/5);
$page=$_GET['page'];
if($page==''){$page=1;$start=0; }else{ $start=($page-1)*5; }
$sql="select * from etw_productupd where userid=".$_SESSION['guestid']." order by edittime desc limit ".$start.",5";
      $result=mysql_query($sql);
	  while($row=mysql_fetch_array($result)){  ?>
           <ul><li class="titles"><span>提交时间：<?php echo $row['edittime'];  ?></span>  修改主题: <?php echo $row['url'] ?> </li>
           <li>修改资料内容: <?php echo $row['content'];  ?></li>
      <?php if($row['achivetime']<>'0'){ ?>
           <li>ETW 处理 ：<?php echo $row['etwinfo'] ?><br /><span>完成时间: <?php echo $row['achivetime'];  ?></span></li><?php }  ?>
           </ul>
	<?php   } ?>
    </div>
    <div id="page"><?php if($page==1){ echo "首页 | 上一页";}else { echo "<a href='updateproduct.php?page=1'>首页</a> | <a href='updateproduct.php?page=".($page-1)."'>上一页</a>"; } 
		  if($page==$pages){echo " | 下一页 | 尾页 &nbsp; (第".$page."页/共".$pages."页)";}else{ echo "| <a href='updateproduct.php?page=".($page+1)."'>下一页</a> | <a href='updateproduct.php?page=".$pages."'>尾页</a> &nbsp; (第".$page."页/共".$pages."页)"; }
		   ?></div>
         </div>
       
	<?php 	} ?> 
     </div>
     <div id="footer"> Copy Rright &copy; 2008-2009 ETW International <?php if( @$_SESSION["username"]<>''){?>
<input type="hidden" id="onlineu" value="<?php echo $_SESSION["username"] ?>" />
<script type="text/javascript" src="js/onlinelisten.js"></script>
<script type="text/javascript">
window.setInterval(onlinemessage,30000);
</script>
<?php } ?></div>  
</div>
<script type="text/javascript" src="js/opencommon.js"></script>
<?php mysql_close(); ?>
</body>
</html>
