⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 insert.php

📁 极限网络智能办公系统 - Office Automation 2008 官方100% 源码
💻 PHP
字号:
<?php
 

include_once( "inc/auth.php" );
echo "\r\n<html>\r\n<head>\r\n<title>增加自定义字段</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n";
if ( $CODE_TYPE == "1" )
{
	$TYPENAME = "";
	$TYPEVALUE = "";
}
if ( $CODE_TYPE == "2" )
{
	$TYPECODE = "";
}
if ( $TYPENAME != "" )
{
	$TYPEVALUE = str_replace( ",", ",", $TYPEVALUE );
	if ( substr( $TYPEVALUE, -1 ) == "," )
	{
		$TYPEVALUE = substr( $TYPEVALUE, 0, -1 );
	}
	$TYPEVALUE_ARRAY = explode( ",", $TYPEVALUE );
	$TYPENAME = str_replace( ",", ",", $TYPENAME );
	if ( substr( $TYPENAME, -1 ) == "," )
	{
		$TYPENAME = substr( $TYPENAME, 0, -1 );
	}
	$TYPENAME_ARRAY = explode( ",", $TYPENAME );
	if ( count( $TYPENAME_ARRAY ) != count( $TYPEVALUE_ARRAY ) )
	{
		message( "", "选项名称和选项的值 项数不相等" );
		button_back( );
		exit( );
	}
	if ( count( $TYPEVALUE_ARRAY ) != count( array_unique( $TYPEVALUE_ARRAY ) ) )
	{
		message( "", "选项的值 中有重复数值" );
		button_back( );
		exit( );
	}
	if ( !( array_search( "", $TYPEVALUE_ARRAY ) === false ) )
	{
		message( "", "选项的值 中不能有空值" );
		button_back( );
		exit( );
	}
}
if ( $ISQUERY == "on" )
{
	$ISQUERY = 1;
}
if ( $ISGROUY == "on" )
{
	$ISGROUY = 1;
}
if ( $FIELDNO == "" )
{
	$maxcount = 0;
	$query = "SELECT FIELDNO from FIELDSETTING where TABLENAME='".$TABLENAME."'";
	$cursor = exequery( $connection, $query );
	while ( $ROW = mysql_fetch_array( $cursor ) )
	{
		$FIELDNO = $ROW['FIELDNO'];
		if ( $maxcount < intval( substr( $FIELDNO, 7 ) ) )
		{
			$maxcount = intval( substr( $FIELDNO, 7 ) );
		}
	}
	$FIELDNO = "USERDEF".( $maxcount + 1 );
	$query = "insert into FIELDSETTING(TABLENAME,FIELDNO,FIELDNAME,ORDERNO,STYPE,TYPENAME,TYPEVALUE,TYPECODE,ISQUERY,ISGROUY) values ('".$TABLENAME."','{$FIELDNO}','{$FIELDNAME}','{$ORDERNO}','{$STYPE}','{$TYPENAME}','{$TYPEVALUE}','{$TYPECODE}','{$ISQUERY}','{$ISGROUY}')";
}
else
{
	$query = "update FIELDSETTING set FIELDNAME='".$FIELDNAME."',ORDERNO='{$ORDERNO}',STYPE='{$STYPE}',TYPENAME='{$TYPENAME}',TYPEVALUE='{$TYPEVALUE}',TYPECODE='{$TYPECODE}',ISQUERY='{$ISQUERY}',ISGROUY='{$ISGROUY}' where TABLENAME='{$TABLENAME}' and FIELDNO='{$FIELDNO}'";
}
exequery( $connection, $query );
message( "", "增加成功!" );
echo "\r\n<script>\r\nparent.code_list.location.reload();\r\n</script>\r\n\r\n\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -