|
|

<?php
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//File: addlink.php
//Author: TZNKTG
//Purpose: This page is add all information of site link
///////////////////////////////////////////////////////////////////////////////////////////////////////////
session_start();
require("include/dbfun.php");
require("include/common_var.php");
$pageid = $_SESSION['page'];
if(empty($pageid))
{
$par="";
}
else
{
$par="?page=".$pageid;
}
$id = $_GET['id'];
?>
<html>
<head><title><? echo $logotitle ?>-更新友情链接信息</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link href="css/15hr.css" type="text/css" rel="stylesheet">
<script language="javascript" src="include/per_jslib.js"></script>
<script language="javascript">
<!--
function check()
{
if(document.modify.sname.value=="")
{
alert("请您输入网站名称!");
document.modify.sname.focus();
return false;
}
else if(document.modify.surl.value=="")
{
alert("请您输入网站地址!");
document.modify.surl.focus();
return false;
}
else
{
return true;
}
}
-->
</script>
</head>
<body>
<?php
if(!$_POST['modify'])
{
?>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="186" valign="top" background="images/middle.gif">
<?php
//左边菜单栏//
require("left.php");
?>
</td>
<td width="15"></td>
<td rowspan="2" valign="top">
<table cellspacing=0 cellpadding=0 width="100%" align="center" border=0>
<tbody>
<tr>
<td width="5"><img src="images/main_top_left.gif" width="5" height="5" border="0"></td>
<td width="100%" background="images/main_top_center.gif" height="5"></td>
<td width="5"><img src="images/main_top_right.gif" width="5" height="5" border="0"></td>
</tr>
</tbody>
</table>
<table class="main_bg" cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
<tbody>
<tr height="5"><td></td></tr>
<tr valign="top">
<td> <img src="images/link_arrow.gif"> 服务器当前时间: <? echo $nowdt ?>
<br><br></td>
</tr>
<?php
$select_logoinfo_sql="select id,hrsite,sitename,siteurl,siteshow from ".$slinfo_table." where id=".$id;
$db->execute($select_logoinfo_sql);
while($slinfo=$db->reader())
{ $id = $slinfo['id'];
//$hrsite = $slinfo['hrsite'];
$sname = $slinfo['sitename'];
$surl = $slinfo['siteurl'];
$sshow = $slinfo['siteshow'];
//echo $hrsite;
?>
<tr>
<td>
<form action="<? $PHP_SELF ?>" method="post" name="modify" onSubmit="return check()">
<table cellspacing=0 cellpadding=0 width="95%" align="center" border=0>
<tbody>
<tr bgcolor="#EEEEEE"><td height="30" align="center" colspan="4">修改<font color="#FF0000">【<? echo $sname ?>】</font>的友情链接信息</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" width="15%" align="center">人才站点:</td>
<td height="30" width="85%" align="left">
<select id="hrsite" name="hrsite">
<?php hrsitefun() ?>
</select>
</td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="30" width="15%" align="center">网站名称:</td>
<td height="30" width="15%" align="left"><input type="text" id="sitename" name="sname" size="30" value="<? echo $sname ?>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" width="15%" align="center">网站地址:</td>
<td height="30" width="85%" align="left"><input type="text" id="siteurl" name="surl" size="40" value="<? echo $surl ?>"></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="30" width="15%" align="center">网站说明:</td>
<td height="30" width="85%" align="left" >
<textarea name="sshow" rows="7" cols="55"><? echo $sshow ?></textarea>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" align="center" colspan="4"><input type="submit" name="modify" value=" 修 改 " > <input type="button" name="back" value=" 返 回 " onclick="history.back()"></td>
</tr>
<script language="javascript">
//人才站点中文名称
js_set_sel(document.modify.hrsite,'<? echo $slinfo[hrsite]; ?>');
</script>
</tbody>
</table>
</form>
</td>
</tr>
<? } ?> </tbody>
</table>
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tbody>
<tr>
<td width="5"><img src="images/main_bot_left.gif" width="5" height="5" border="0"></td>
<td width="100%" background="images/main_bot_center.gif" height=5></td>
<td width="5"><img src="images/main_bot_right.gif" width="5" height="5" border="0"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="bottom" background="images/middle.gif"><img height="5" src="images/bottom.gif" width="190"></td>
</tr>
</table>
<?php
}else
{
$datelog = date("Y-m-d H:i:s"); //日期时间日志;
$hrsite = htmlspecialchars($_POST['hrsite']);
$sname = htmlspecialchars($_POST['sname']);
$surl = htmlspecialchars($_POST['surl']);
$sshow = htmlspecialchars($_POST['sshow']);
$update_slinfo_sql = "update ".$slinfo_table." set hrsite='".$hrsite."',sitename='".$sname."',siteurl='".$surl."',siteshow='".$sshow."' where id='".$id."'";
$db->execute($update_slinfo_sql);
echo "<script language='javascript'>window.alert('您已经于 ".$datelog." 成功修改【".$sname."】友情链接信息!');location.href='updatelinks.php".$par."';</script>";
}
?>
</body>
</html> |
|