📄 job_fl.php
字号:
<?php
session_start();
include "middle.php";
require_once "../MessageBox.php";
$Message = new MessageBox;
if ( !empty($_SESSION["userid"]) ) {
include "../datasource.inc.php";
$page = $_REQUEST['page'];
$id = $_REQUEST['id'];
$action = $_REQUEST['action'];
if ($action == 'add') {
$sql = "insert into job_fl (id,fl) values ('','$_REQUEST[fl]');";
$result = mysql_query($sql);
$Message->setMessage("添加成功!","job_fl.php");
$Message->showMessage();
}
if ($_REQUEST['action'] == 'update') {
$sql = "update job_fl set fl='$_REQUEST[fl]' where id='$id';";
$result = mysql_query($sql);
$Message->setMessage("编辑成功!","job_fl.php");
$Message->showMessage();
}
?>
<link href="../css/a1.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="789" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="../images/home_12.jpg" width="789" height="12"></td>
</tr>
<tr>
<td width="776" valign="top">
<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> 您当前的位置<BR> <IMG
height=15 src="../images/bar.gif" width=15> <IMG height=14
src="../images/openfold.gif" width=14> 文件分类管理</FONT></TD>
</tr>
</table>
<table width=766 border=0 cellspacing=0 cellpadding=0 align="right">
<tr><td width=766 height=1 bgcolor=#3494d4></td>
</tr></table>
<script language=javascript>
function check_input()
{
if (document.form.fl.value=='') {
alert("请输入分类!");
return false;
}
return true;
}
</script>
<br>
<div align=right><a href=job_download_info.php?page=add>添加文档</a> <a href=job_download_info.php>浏览文档</a> <a href=job_fl.php?page=add>添加分类</a> <a href=job_fl.php>分类管理</a></div>
<?php
switch ($page){
case "add":
?>
<center>
<form enctype="multipart/form-data" name=form method="post" action="job_fl.php" onsubmit="return check_input()">
<table border=0 cellpadding=0 cellspacing=0 width=776>
<tr><td width=10 bgcolor=#ffffff> </td>
<td><table border=0 cellpadding=0 cellspacing=1 bgcolor=#3494d4 width=766>
<tr>
<td width="30%" bgColor=#ffffff><center><b>分类</b></center></td>
<td width="70%" bgcolor=ffffff>
<input type="text" size="30" name="fl" maxlength="28">
</td>
</tr>
</table></td></table><br>
<input type="hidden" value="add" name="action">
<input type="submit" name="submit" value=" 确 定 "> <input type="reset" name="submit1" value=" 重 置 ">
</form>
</center>
<?
break;
case "delete":
$query = "delete from job_fl where id='$id';";
mysql_query($query);
$Message->setMessage("删除成功!","job_fl.php");
$Message->showMessage();
break;
case "update":
$sql = "select * from job_fl where id='$id';";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$id = $row['id'];
$name = $row['name'];
$body = str_replace("<BR>", "\n", $row['body']);
?>
<form name=form method="post" action="job_fl.php" onsubmit="return check_input()">
<center>
<table border=0 cellpadding=0 cellspacing=0 width=776>
<tr><td width=10 bgcolor=#ffffff> </td>
<td><table border=0 cellpadding=0 cellspacing=1 bgcolor=#3494d4 width=766>
</tr>
<td width="30%" bgColor=#ffffff><center><b>分类</b></center></td>
<td width="70%" bgcolor=ffffff>
<?php
echo "<input type=text size=30 name=fl maxlength=28 value=\"$row[fl]\">";
?>
</td>
</tr>
</table></td></table><br>
<input type="hidden" value="update" name="action">
<?php echo "<input type=hidden name=id value=$id>"; ?>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="submit" name="submit" value=" 确 定 "> <input type="reset" name="submit1" value=" 重 置 ">
</form>
</center>
<?php
break;
default:
$sql = "select * from job_fl order by id asc;";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ( $num>0 ){
$last = intval(($num-1)/20)+1;
if ( $page < 1 ) $page=1;
if ( $page > $last ) $page=$last;
mysql_data_seek($result,($page-1)*20);
echo "<center><br>";
echo "<table border=0 cellpadding=0 cellspacing=0 width=776>";
echo "<tr><td width=10 bgcolor=#ffffff> </td>";
echo "<td><table border=0 cellpadding=0 cellspacing=1 bgcolor=#3494d4 width=766>";
echo "<tr>";
echo "<td width=450 height=20 bgColor=#3494d4><div align=center><font color=#ffffff><b>分类</b></font></div></td>";
echo "<td width=158 height=20 bgColor=#3494d4><div align=center><font color=#ffffff><b>编辑</b></font></div></td>";
echo "<td width=158 height=20 bgColor=#3494d4><div align=center><font color=#ffffff><b>删除</b></font></div></td>";
echo "</tr>";
for ( $i=0;$i<20;$i++ ) {
$row = mysql_fetch_array($result);
$id = $row['id'];
$body = substr($row['body'],0,30);
if ( $id ) {
echo "<tr bgColor=#ffffff>";
echo "<td width=450 height=18 bgColor=#ffffff><div align=center>$row[fl]</div></td>";
echo "<td width=158 height=18 bgColor=#ffffff><div align=center><a title=点击编辑内容 href=job_fl.php?page=update&id=$row[id]><img src=../images/editicon.gif border=0></a></div></td>";
echo "<td width=158 height=18 bgColor=#ffffff><div align=center><a title=点击删除本条记录 href=job_fl.php?page=delete&id=$row[id] onclick=\"return confirm('确定要删除吗?')\"><img src=../images/clearicon.gif border=0></a></div></td>";
echo "</tr>";
}
}
echo "</table></td></table><br>";
echo "<table width=500 border=0 cellspacing=0 cellpadding=0 height=24>";
echo "<tbody>";
echo "<tr><td><center>";
echo "总共找到<font color=red>$num</font>条记录,第<font color=red>$page</font>页,共<font color=red>$last</font>页。";
echo "</center></td></tr><tr>";
if ( $page <> 1 ) {
echo "<td align=center> <a href=job_fl.php?page=1>第一页</a></td>";
echo "<td align=center><a href=job_fl.php?page=".($page-1).">上一页</a></td>";
}
if ( $page <> $last ) {
echo "<td align=center><a href=job_fl.php?page=".($page+1).">下一页</a></td>";
echo "<td align=center><a href=job_fl.php?page=$last>最后一页</a></td>";
}
echo "</tbody>";
echo "</tr>";
echo "</table><br>";
echo "</center>";
} else {
echo "<center>对不起,您还没有添加记录,<a href=job_fl.php?page=add>我要添加</a>!</center>";
}
break;
}
} else {
$Message->setMessage("对不起,您没有权限进入后台管理!","index.php");
$Message->showMessage();
}
?>
</td>
<td width="13" align="right" background="../images/home_16.jpg" height="457"> </td>
</tr>
<tr>
<td height="8" colspan="2" valign="top"><img src="../images/home_24.jpg" width="789"></td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -