📄 update.php
字号:
<?php
header( "Content-Type: text/html; charset=gb2312" );
include_once( "inc/auth.php" );
$connection = openconnection( );
switch ( $_REQUEST['handle'] )
{
case "update" :
if ( $_REQUEST['caution'] == "" )
{
$caution = 0;
$caution_amount = 0;
}
else
{
$caution_amount = $_REQUEST['caution_amount'];
}
$query = "INSERT INTO officeitem_appellation (APPELLATION, SPEC, UNIT, CAUTION, CAUTION_AMOUNT, SORT_ID, APPELLATION_NUMBER) VALUES('".$_REQUEST['appellation']."', '".$_REQUEST['spec']."', '".$_REQUEST['unit']."', ".$caution.", ".$caution_amount.", ".$_REQUEST['sort'].", '".$_REQUEST['number']."')";
exequery( $connection, $query );
break;
case "delete" :
$query = "DELETE FROM officeitem_appellation WHERE APPELLATION_ID = ".$_REQUEST['appellation_id'];
exequery( $connection, $query );
break;
case "edit" :
if ( $_REQUEST['caution'] == "" )
{
$caution = 0;
$caution_amount = 0;
}
else
{
$caution_amount = $_REQUEST['caution_amount'];
}
$query = "UPDATE officeitem_appellation SET SORT_ID=".$_REQUEST['sort'].",APPELLATION='".$_REQUEST['appellation']."',SPEC='".$_REQUEST['spec']."',UNIT='".$_REQUEST['unit']."',CAUTION=".$caution.",CAUTION_AMOUNT=".$caution_amount.",APPELLATION_NUMBER='".$_REQUEST['number']."' WHERE appellation_id=".$_REQUEST['appellation_id'];
exequery( $connection, $query );
break;
case "delete_all" :
$del_id = explode( ",", $_REQUEST['id_str'] );
$i = 0;
for ( ; $i < sizeof( $del_id ); ++$i )
{
if ( 0 < $del_id[$i] )
{
$query = "UPDATE officeitem_appellation SET STATUS_APPELLATION = '1' WHERE APPELLATION_ID = ".$del_id[$i]."";
exequery( $connection, $query );
}
}
}
header( "location:./" );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -