📄 update.php
字号:
<?php
header( "Content-Type: text/html; charset=gb2312" );
include_once( "inc/auth.php" );
include_once( "inc/utility_sms1.php" );
$connection = openconnection( );
if ( $_REQUEST['handle'] == "nopass" )
{
$query = "update officeitem_take set STATUS=1 where TAKE_ID=".$_REQUEST['take_id'];
exequery( $connection, $query );
$user_id = $_REQUEST['user_id'];
$FROM_ID = "系统提醒";
$TO_ID = $user_id;
$CONTENT = "您申请的办公用品 <<".$_REQUEST['appellation'].">> 被退回!";
send_sms( $connection, $FROM_ID, $TO_ID, 16, $CONTENT );
echo "<script>\r\n\t\t\thistory.back();\r\n\t\t\t</script>";
}
else if ( $_REQUEST['handle'] == "pass" )
{
$stock_sql = "select STOCKPILE from officeitem_appellation where APPELLATION_ID=".$_REQUEST['appellation_id'];
$stock_cs = exequery( $connection, $stock_sql );
if ( $stock_r = mysql_fetch_row( $stock_cs ) )
{
$stockpile = $stock_r[0];
if ( $stockpile == 0 )
{
echo "<script>\r\n\t\t\t\t\talert('库存数量不足,不能批准!');\r\n\t\t\t\t\thistory.back();\r\n\t\t\t\t\t</script>";
exit( );
}
}
$query = "update officeitem_take set STATUS=2 where TAKE_ID=".$_REQUEST['take_id'];
exequery( $connection, $query );
$query2 = "update officeitem_appellation set STOCKPILE=STOCKPILE-".$_REQUEST['take_amount']." where APPELLATION_ID=".$_REQUEST['appellation_id'];
exequery( $connection, $query2 );
$user_id = $_REQUEST['user_id'];
$FROM_ID = "系统提醒";
$TO_ID = $user_id;
$CONTENT = "您申请的办公用品 <<".$_REQUEST['appellation'].">> 以批准!";
send_sms( $connection, $FROM_ID, $TO_ID, 16, $CONTENT );
$query3 = "select CAUTION_AMOUNT from officeitem_appellation where APPELLATION_ID=".$_REQUEST['appellation_id'];
$cursor3 = exequery( $connection, $query3 );
if ( $row3 = mysql_fetch_row( $cursor3 ) )
{
$caution_amount = $row3[0];
}
if ( $_REQUEST['stockpile'] - $_REQUEST['take_amount'] <= $caution_amount )
{
$privflow = ",74,";
$privflowno = "264,265,266,267,268,269,";
$sql = " \r\n\t\t\t\t SELECT USER_PRIV FROM user_priv \r\n\t\t\t\t\t\t WHERE INSTR(FUNC_ID_STR,'".$privflow."') > 0\r\n\t\t\t\t\t\t ";
$rs = exequery( $connection, $sql );
while ( $row = mysql_fetch_array( $rs ) )
{
$user_priv = $row['USER_PRIV'];
$sql2 = "SELECT USER_ID FROM user WHERE USER_PRIV='".$user_priv."'";
$rs2 = exequery( $connection, $sql2 );
if ( $row2 = mysql_fetch_array( $rs2 ) )
{
$user_id = $row2['USER_ID'];
$FROM_ID = "系统提醒";
$TO_ID = $user_id;
$CONTENT = "办公用品 <<".$_REQUEST['appellation'].">> 即将紧缺,请尽快添加!";
send_sms( $connection, $FROM_ID, $TO_ID, 16, $CONTENT );
}
}
}
echo "<script>\r\n\t\t\thistory.back();\r\n\t\t\t</script>";
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -