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

📄 album_set.inc

📁 泛微协同办公系统标准版E-office V5.5的源代码内含泛微办公系统V5.5自动注册文件。
💻 INC
字号:
<?php

function dml_getcategory( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "SELECT * FROM ALBUM_CATEGORY ";
		if ( !$nd->executequery( $sql ) )
		{
			$term = false;
			$nodata = false;
			$error['msg'] = "插入错误。";
		}
		else
		{
			$term = $nd->getrecordset( );
			break;
		}
	}
	return $term;
}

function dml_getcategorynum( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "SELECT COUNT(PID) CNUM FROM ALBUM_CATEGORY ";
		if ( !$nd->executequery( $sql ) )
		{
			$term = false;
			$nodata = false;
			$error['msg'] = "插入错误。";
		}
		else
		{
			$term = $nd->getrecordset( );
			break;
		}
	}
	return $term;
}

function dml_setcategory( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "INSERT INTO ALBUM_CATEGORY(PID,USR,TITLE,MANAGER,BROWSE,";
		$sql .= " MAX_SPACE,CREATE_DATA)";
		$sql .= " VALUES(0,'".$parr['usr']."','".$parr['title']."','".$parr['to_id']."',";
		$sql .= "'".$parr['copy_to_id']."',".$parr['max_space'].",NOW())";
		if ( $nd->executequery( $sql ) )
		{
			break;
		}
		$term = false;
		$error['msg'] = "插入错误。";
		break;
	}
	return $term;
}

function dml_checkalbumsubject( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "SELECT COUNT(PID) CPID FROM ALBUM_SUBJECT WHERE ";
		$sql .= " ALBUM_CATEGORY = ".$parr['pid']."";
		if ( !$nd->executequery( $sql ) )
		{
			$term = false;
			$nodata = false;
		}
		else
		{
			$term = $nd->getrecordset( );
			break;
		}
	}
	return $term;
}

function dml_delcategory( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "DELETE FROM ALBUM_CATEGORY WHERE PID = ".$parr['pid']."";
		if ( $nd->executequery( $sql ) )
		{
			break;
		}
		$term = false;
		$error['msg'] = "插入错误。";
		break;
	}
	$path = $_SERVER['DOCUMENT_ROOT'];
	$dir = $path."attachment/album/".$parr['pid'];
	$olddir = $parr['pid']."_".rand( 0, 1000 );
	$destination = $path."attachment/album/".$olddir;
	@rename( $dir, $destination );
	return $term;
}

function dml_getcategoryinfo( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "SELECT * FROM ALBUM_CATEGORY WHERE PID = ".$parr['pid']."";
		if ( !$nd->executequery( $sql ) )
		{
			$term = false;
			$nodata = false;
			$error['msg'] = "插入错误。";
		}
		else
		{
			$term = $nd->getrecordset( );
			$manager = str_replace( ",", "','", substr( $term[0]['MANAGER'], 0, strrpos( $term[0]['MANAGER'], "," ) ) );
			$browse = str_replace( ",", "','", substr( $term[0]['BROWSE'], 0, strrpos( $term[0]['BROWSE'], "," ) ) );
			$sql = "SELECT USER_NAME FROM USER WHERE USER_ID IN('".$manager."')";
			if ( !$nd->executequery( $sql ) )
			{
				$term = false;
				$nodata = false;
				$error['msg'] = "查询错误。";
			}
			else
			{
				$mres = $nd->getrecordset( );
				$i = 0;
				for ( ;	$i < count( $mres );	++$i	)
				{
					$musername[$i] = $mres[$i]['USER_NAME'];
				}
				$musername = implode( ",", $musername );
				$sql = "SELECT USER_NAME FROM USER WHERE USER_ID IN('".$browse."')";
				if ( !$nd->executequery( $sql ) )
				{
					$term = false;
					$nodata = false;
					$error['msg'] = "查询错误。";
				}
				else
				{
					$bres = $nd->getrecordset( );
					$i = 0;
					for ( ;	$i < count( $bres );	++$i	)
					{
						$busername[$i] = $bres[$i]['USER_NAME'];
					}
					$busername = implode( ",", $busername );
					$term[0]['musername'] = $musername.",";
					$term[0]['busername'] = $busername.",";
					break;
				}
			}
		}
	}
	return $term;
}

function dml_modifycategoryinfo( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "UPDATE ALBUM_CATEGORY SET TITLE = '".$parr['title']."',";
		$sql .= "MAX_SPACE = ".$parr['max_space'].",";
		$sql .= " MANAGER = '".$parr['manager']."',BROWSE = '".$parr['browse']."'";
		$sql .= " WHERE PID = ".$parr['pid']."";
		if ( $nd->executequery( $sql ) )
		{
			break;
		}
		$term = false;
		$nodata = false;
		$error['msg'] = "查询错误。";
		break;
	}
	return $term;
}

?>

⌨️ 快捷键说明

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