📄 job_journey1.php
字号:
<?
session_start();
include "middle.php";
require_once "../MessageBox.php";
$Message = new MessageBox;
?>
<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">
<?php
if ( !empty($_SESSION["userid"]) ) {
include "../datasource.inc.php";
$date = date("Y-m-j");
$job_date = $_REQUEST['job_date'];
$page = $_REQUEST['page'];
$id = $_REQUEST['id'];
$action = $_REQUEST['action'];
$job_body = str_replace("\n", "<BR>", $_REQUEST['job_body']);
if ($action == 'add') {
$sql = "insert into job_journey (id,userid,job_date,job_body) values ('','$_SESSION[userid]','$job_date','$job_body');";
$result = mysql_query($sql);
$Message->setMessage("添加成功!","job_journey1.php");
$Message->showMessage();
}
if ($action == 'update') {
$sql = "update job_journey set job_date='$job_date',job_body='$job_body' where id = '$id';";
$result = mysql_query($sql);
$Message->setMessage("编辑成功!","job_journey1.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> 您当前的位置<BR> <IMG
height=15 src="../images/bar.gif" width=15> <IMG height=14
src="../images/openfold.gif" width=14> 浏览日程安排</FONT></TD>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=766 align="right">
<tr><td width=766 bgcolor=#3494d4 height=1></td>
</tr>
</table><br>
<script language=javascript>
function check_input()
{
if (document.form.job_body.value=='') {
alert("请输入日程安排内容!");
return false;
}
return true;
}
</script>
<?php
switch ($page){
case "add":
?>
<center>
<form name=form method="post" action="job_journey1.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 height=24>
<td width="15%" bgColor=#ffffff align="center">安排日期</td>
<td width="85%" bgcolor=ffffff> <font color=red>
<?php
echo "<input type=text size=10 name=job_date value=$date>";
?>
</font>
</td>
</tr>
<tr height=24>
<td width="15%" bgColor=#ffffff align="center">安排内容</td>
<td width="85%" bgcolor=ffffff>
<textarea name="job_body" cols="60" rows="10">
</textarea>
</td>
</tr>
</table></td></table><br>
<input type="hidden" value="add" name="action">
<input type="image" src="../images/images/3.gif" > <a href="job_journey1.php?page=add"><img src="../images/images/4.gif" border="0"></a>
</form>
</center>
<?
break;
case "delete":
$query = "delete from job_journey where id='$id';";
mysql_query($query);
$Message->setMessage("删除成功!","job_journey1.php");
$Message->showMessage();
break;
/* case "update":
$sql = "select * from job_journey where id='$id';";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$job_body = str_replace("<BR>", "\n", $row['job_body']);
*/
?>
<!--<center>
<form name=form method="post" action="job_journey1.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 height=24>
<td width="15%" bgColor=#ffffff align="center">安排日期</td>
<td width="85%" bgcolor=ffffff> <font color=red>
<?php
// echo "<input type=text size=10 name=job_date value=$row[job_date]>";
?>
</font>
</td>
</tr>
<tr height=24>
<td width="15%" bgColor=#ffffff align="center">安排内容</td>
<td width="85%" bgcolor=ffffff>
<textarea name="job_body" cols="60" rows="10">
<?php
//echo $job_body;
?>
</textarea>
</td>
</tr>
</table></td></table><br>
<input type="hidden" value="update" name="action">
<input type="hidden" name="id" value="<?php// echo $row['id'];?>">
<input type="image" src="../images/images/3.gif" > <a href="job_journey1.php?page=update&id=<? echo $row['id']?>"><img src="../images/images/4.gif" border="0"></a>
</form>
</center>-->
<?php
break;
default:
echo "<center>";
echo "<form action=job_journey1.php method=post>";
echo "<table border=0 cellpadding=0 cellspacing=0 width=776>";
echo "<tr>";
echo "<td width=10 bgcolor=#ffffff> </td>";
echo "<td bgColor=#ffffff align=left>";
echo "按安排内容查询:<input type=text size=20 name=job_body maxlength=20>";
echo " <input type=submit value=搜索>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</form>";
if ($_SESSION['userjs']=="2") {
if ($_REQUEST['job_body']){
$sql = "select * from job_journey where job_body like '%$_REQUEST[job_body]%' and department='$_SESSION[department]' order by id desc;";
} else {
$sql = "select * from job_journey where department='$_SESSION[department]' order by id desc;";
}
} else if ($_SESSION['userjs']=="0") {
if ($_REQUEST['job_body']){
$sql = "select * from job_journey where job_body like '%$_REQUEST[job_body]%' order by id desc;";
} else {
$sql = "select * from job_journey order by id desc;";
}
}
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if ( $num>0 ){
$last = intval(($num-1)/40)+1;
if ( $page < 1 ) $page=1;
if ( $page > $last ) $page=$last;
mysql_data_seek($result,($page-1)*40);
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 height=24>";
echo "<td width=266 bgColor=#3494d4><div align=center><font color=#ffffff><b>安排日期</b></font></div></td>";
echo "<td width=350 bgColor=#3494d4><div align=center><font color=#ffffff><b>安排内容</b></font></div></td>";
// echo "<td width=100 height=20 bgColor=#3494d4><div align=center><font color=#ffffff><b>编辑</b></font></div></td>";
echo "<td width=150 bgColor=#3494d4><div align=center><font color=#ffffff><b>删除</b></font></div></td>";
echo "</tr>";
for ( $i=0;$i<40;$i++ ) {
$row = mysql_fetch_array($result);
$id = $row['id'];
$job_body = substr($row['job_body'],0,30);
if ( $id ) {
echo "<tr bgColor=#ffffff height=22>";
echo "<td width=266 bgColor=#ffffff><div align=center>$row[job_date]</div></td>";
echo "<td width=350 bgColor=#ffffff><div align=center><a href=# onClick=\"window.open('job_journey_show.php?id=$row[id]',1,'top=50,left=50,height=450,width=450,scrollbars=yes')\">$job_body</a></div></td>";
//echo "<td width=100 height=18 bgColor=#ffffff><div align=center><a title=onclick return href=job_journey1.php?page=update&id=$row[id]><img src=../images/editicon.gif border=0></a></div></div></td>";
echo "<td width=150 bgColor=#ffffff><div align=center><a title=点击删除内容 href=job_journey1.php?page=delete&id=$row[id] onclick=\"return confirm('是否确定删除此记录')\"><img src=../images/clearicon.gif border=0></a></div></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_journey1.php?page=1>第一页</a></td>";
echo "<td align=center><a href=job_journey1.php?page=".($page-1).">上一页</a></td>";
}
if ( $page <> $last ) {
echo "<td align=center><a href=job_journey1.php?page=".($page+1).">下一页</a></td>";
echo "<td align=center><a href=job_journey1.php?page=$last>最后一页</a></td>";
}
echo "</tbody>";
echo "</tr>";
echo "</table><br>";
echo "</center>";
} else {
echo "<center>对不起,您还没有添加记录!</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" height="8"></td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -