<?php
session_start();
include "header.html";
require_once "../MessageBox.php";
include "../datasource.inc.php";
include "../Function.php";
$Message = new MessageBox;
if ( empty($_SESSION["usernumber"]) and $_SESSION["userjs"] != "1") {
    $Message->setMessage("对不起，您没有权限进入后台管理!","logout.php");
	$Message->showMessage();
	EXIT;
}
$body  = $_REQUEST['body'];
if ( $_REQUEST['action'] == 'add' && !empty($body)) {
	$sql     = "insert into en_webinfo values ('','about','$body')";
	$result  = mysql_query($sql);
	$Message->setMessage("添加成功!","en_about.php");
	$Message->showMessage();
}
if ( $_REQUEST['action'] == 'update') {
	$sql         = "update en_webinfo set body='$body' where id='$_REQUEST[id]'";
    $result  = mysql_query($sql);
    $Message->setMessage("编辑成功!","en_about.php");
	$Message->showMessage();
}
?>
<table width="700" border="0" cellspacing="0" cellpadding="0">
        <tr>
         <TD vAlign=top><FONT color=#565656><IMG height=14
      src="../images/closedfold.gif" width=14>&nbsp;&nbsp;您当前的位置<BR><IMG
      height=15 src="../images/bar.gif" width=15><IMG height=14
      src="../images/openfold.gif" width=14>&nbsp;&nbsp;企业概况管理(英文版)</FONT></TD>
        </tr>
</table>
<?php
$sql     = "select * from en_webinfo where fl='about' order by id desc";
$result  = mysql_query($sql);
$row     = mysql_fetch_array($result);
$body    = str_replace("<BR>", "\n", $row['body']);
if ( $row['id']) {
	echo "<p align=center><font size=3><b>修改企业概况</b></font></p>";
	echo "<form name=form  method=\"post\" action=\"en_about.php?action=update\">";
} else {
	echo "<p align=center><font size=3><b>填写企业概况</b></font></p>";
	echo "<form name=form  method=\"post\" action=\"en_about.php?action=add\">";
}
?>
<table border=0 cellpadding=0 cellspacing=1 bgcolor=#6795B4 width=550 align=center>
  <tr>
    <td><textarea name="body" style="display:none"><? echo $row['body']?></textarea><IFRAME ID="eWebEditor1" SRC="eWebEditor/ewebeditor.htm?id=body&style=gray" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME></td>
  </tr>
</table><br>
<?php echo "<input type=hidden name=\"id\"  value=\"$row[id]\">"; ?>
<center><input type="submit" value="提 交">&nbsp;&nbsp;<input type="reset" value="取 消"></center>
</form>
