📄 edit.php
字号:
<?php
function GETALLDATE( $CODE, $GETVALUE )
{
global $connection;
$query = "SELECT * from SYS_CODE where PARENT_NO='".$CODE."'";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$CODE_NO = $ROW['CODE_NO'];
$CODE_NAME = $ROW['CODE_NAME'];
if ( $CODE_NO == $GETVALUE )
{
echo "<option value='".$CODE_NO."' selected>".$CODE_NAME."</option>";
}
else
{
echo "<option value='".$CODE_NO."'>".$CODE_NAME."</option>";
}
}
}
include_once( "inc/auth.php" );
include_once( "inc/check_type.php" );
echo "<html>\r\n<head>\r\n<title>办公用品编辑</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<script src=\"/inc/js/module.js\"></script>\r\n<script Language=\"JavaScript\">\r\nfunction CheckForm()\r\n{\r\n if(document.form1.PRO_NAME.value==\"\")\r\n { \r\n alert(\"办公用名称不能为空!\");\r\n form1.PRO_NAME.focus()\r\n return (false);\r\n }\r\n\r\n if(document.form1.PRO_UNIT.value==\"\")\r\n { \r\n alert(\"计量单位不能为空!\");\r\n \tform1.PRO_UNIT.focus()\r\n return (false);\r\n }\r\n}\r\n\r\nfunction delete_vote(PRO_ID,TYPE_ID)\r\n{\r\n msg='确认删除该用品吗?删除后该用品的全部信息将被清除!';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?PRO_ID=\"+PRO_ID+\"&CODE_ID=\"+TYPE_ID;\r\n window.location=URL;\r\n }\r\n}\r\n</script>\r\n</head>\r\n";
$query = "SELECT * from OFFICE_PRODUCTS where PRO_ID='".$PRO_ID."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PRO_ID = $ROW['PRO_ID'];
$PRO_NAME1 = $ROW['PRO_NAME'];
$PRO_DESC1 = $ROW['PRO_DESC'];
$PRO_UNIT1 = $ROW['PRO_UNIT'];
$PRO_PRICE1 = $ROW['PRO_PRICE'];
$PRO_SUPPLIER1 = $ROW['PRO_SUPPLIER'];
$PRO_LOWSTOCK1 = $ROW['PRO_LOWSTOCK'];
$PRO_MAXSTOCK1 = $ROW['PRO_MAXSTOCK'];
$PRO_STOCK1 = $ROW['PRO_STOCK'];
$TO_ID = $ROW['PRO_DEPT'];
$PRO_MANAGER1 = $ROW['PRO_MANAGER'];
$PRO_CREATOR1 = $ROW['PRO_CREATOR'];
$OFFICE_PROTYPE1 = $ROW['OFFICE_PROTYPE'];
$PRO_CODE1 = $ROW['PRO_CODE'];
}
$TO_NAME = "";
if ( $TO_ID == "ALL_DEPT" )
{
$TO_NAME = "全体部门";
}
else
{
$query1 = "select DEPT_NAME from DEPARTMENT where find_in_set(DEPT_ID,'".$TO_ID."')";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$TO_NAME .= $ROW['DEPT_NAME'].",";
}
}
if ( $PRO_CREATOR1 == "" )
{
$PRO_CREATOR1 = "{$LOGIN_USER_ID}";
}
$query1 = "SELECT USER_ID,USER_NAME from USER where find_in_set(USER_ID,'".$PRO_MANAGER1."')";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$PRO_MANAGERNAME .= $ROW['USER_NAME'].",";
}
$query1 = "select USER_NAME from USER where USER_ID='".$PRO_CREATOR1."'";
$cursor = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PRO_CREATORNAME = $ROW['USER_NAME'];
}
$query = "SELECT * from SYS_CODE where CODE_ID='".$CODE_ID."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$CODE_NO = $ROW['CODE_NO'];
$CODE_ORDER = $ROW['CODE_ORDER'];
$CODE_NAME = $ROW['CODE_NAME'];
}
echo "<body class=\"bodycolor\" topmargin=\"5\">\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/edit.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> 办公用品信息编辑 </span>\r\n </td>\r\n </tr>\r\n</table>\r\n<table width=\"500\" class=\"TableBlock\" align=\"center\" >\r\n <form action=\"update.php\" method=\"post\" name=\"form1\" onSubmit=\"return CheckForm();\">\r\n <tr>\r\n <td nowrap class=\"TableContent\">办公用品名称: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_NAME\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo htmlspecialchars( $PRO_NAME1 );
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">办公用品描述: </td>\r\n <td nowrap class=\"TableData\">\r\n\t\t<textarea cols=37 name=\"PPRO_DESC\" rows=\"2\" class=\"BigInput\" wrap=\"yes\">";
echo $PRO_DESC1;
echo "</textarea>\r\n\t</td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">办公用品类别: </td>\r\n <td nowrap class=\"TableData\">\r\n <select name=\"OFFICE_PROTYPE\" class=\"BigSelect\">\r\n";
getalldate( "OFFICE_PROTYPE", $OFFICE_PROTYPE1 );
echo " </select>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">办公用品编码: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_CODE\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo htmlspecialchars( $PRO_CODE1 );
echo "\"> \r\n <input type=\"hidden\" name=\"iExpand\" value=\"";
echo $iExpand;
echo "\"\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">计量单位: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_UNIT\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo htmlspecialchars( $PRO_UNIT1 );
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">单价: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_PRICE\" class=\"BigInput\" size=\"30\" maxlength=\"100\" value=\"";
echo htmlspecialchars( $PRO_PRICE1 );
echo "\">(元) \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">供应商: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_SUPPLIER\" class=\"BigInput\" size=\"33\" maxlength=\"25\" value=\"";
echo htmlspecialchars( $PRO_SUPPLIER1 );
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">最低警戒库存: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_LOWSTOCK\" class=\"BigInput\" size=\"33\" maxlength=\"25\" value=\"";
echo $PRO_LOWSTOCK1;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">最高警戒库存: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_MAXSTOCK\" class=\"BigInput\" size=\"33\" maxlength=\"25\" value=\"";
echo $PRO_MAXSTOCK1;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">当前库存: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"PRO_STOCK\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo $PRO_STOCK1;
echo "\"> ";
if ( $PRO_MAXSTOCK1 < $PRO_STOCK1 )
{
echo "<font color=red>大于最高警戒库存</font>";
}
if ( $PRO_STOCK1 < $PRO_LOWSTOCK1 )
{
echo "<font color=red>小于最低警戒库存</font>";
}
echo " </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">创建人:</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"hidden\" name=\"PRO_CREATOR\" value=\"";
echo $PRO_CREATOR1;
echo "\" >\r\n <input type=\"text\" name=\"PRO_CREATORNAME\" class=\"BigStatic\" readonly size=\"10\" maxlength=\"100\" value=\"";
echo $PRO_CREATORNAME;
echo "\"> 创建人可以修改自己创建的办公用品信息。\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">登记权限(用户):</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"hidden\" name=\"COPY_TO_ID\" value=\"";
echo $PRO_MANAGER1;
echo "\">\r\n <textarea cols=37 name=\"COPY_TO_NAME\" rows=2 class=\"BigStatic\" wrap=\"yes\" readonly>";
echo $PRO_MANAGERNAME;
echo "</textarea>\r\n <a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectUser('','COPY_TO_ID', 'COPY_TO_NAME')\">选择</a>\r\n <a href=\"javascript:;\" class=\"orgClear\" onClick=\"ClearUser('COPY_TO_ID', 'COPY_TO_NAME')\">清空</a>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">登记权限(部门):</td>\r\n <td class=\"TableData\">\r\n <input type=\"hidden\" name=\"TO_ID\" value=\"";
echo $TO_ID;
echo "\">\r\n <input type=\"hidden\" name=\"OLD_TYPE\" value=\"";
echo $OFFICE_PROTYPE1;
echo "\">\r\n <textarea cols=37 name=TO_NAME rows=2 class=\"BigStatic\" wrap=\"yes\" readonly>";
echo $TO_NAME;
echo "</textarea>\r\n <a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectDept()\">添加</a>\r\n <a href=\"javascript:;\" class=\"orgClear\" onClick=\"ClearUser()\">清空</a>\r\n 有登记权限的用户或部门,可以申请领用、借用该办公用品,都不填写,表示所有部门均有权限。 \r\n </td>\r\n </tr>\r\n <tfoot align=\"center\" class=\"TableFooter\">\r\n <td colspan=\"2\" align=\"center\">\r\n <input type=\"hidden\" value=\"";
echo $PRO_ID;
echo "\" name=\"PRO_ID\">\r\n <input type=\"hidden\" value=\"PRO_NAME=";
echo $PRO_NAME;
echo "&OFFICE_PROTYPE=";
echo $OFFICE_PROTYPE;
echo "&PRO_DESC=";
echo $PRO_DESC;
echo "&PAGE_START=";
echo $PAGE_START;
echo "&LOW_Stock=";
echo $LOW_Stock;
echo "\" name=\"QUERY_LIST\">\r\n <input type=\"submit\" value=\"确定\" class=\"BigButton\"> \r\n <input type=\"button\" value=\"删除\" class=\"BigButton\" onClick=\"delete_vote('";
echo $PRO_ID;
echo "','";
echo $OFFICE_PROTYPE1;
echo "');\">\r\n ";
if ( $iExpand == "1" )
{
echo " \t <input type=\"button\" value=\"返回\" class=\"BigButton\" onClick=\"javascript:window.history.go(-1);\">\r\n ";
}
echo " </td>\r\n </tfoot>\r\n </form>\r\n</table>\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -