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

📄 album_modify.inc

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

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

function dml_modifyalbumtitle( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "UPDATE ALBUM_SUBJECT SET TITLE = '".$parr['title']."'";
		$sql .= " WHERE PID = ".$parr['pid']."";
		if ( $nd->executequery( $sql ) )
		{
			break;
		}
		$nodata = false;
		$term = false;
		break;
	}
	return $term;
}

function dml_getalbumcategoryphoto( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "SELECT P.PID,P.USR,P.ALBUM_SUBJECT,P.ATTACHMENT,P.COVER,P.TITLE,A.HTTP_URL,A.SERVER_PATH,";
		$sql .= " A.ENCRYPT_NAME FROM ALBUM_PHOTO P,ALBUM_ATTACHMENT A  ";
		$sql .= " WHERE P.ATTACHMENT = A.PID";
		$sql .= " AND P.ALBUM_SUBJECT = ".$parr['pid']."";
		$sql .= " AND ABLE <>0 ORDER BY PID DESC ";
		if ( !$nd->executequery( $sql ) )
		{
			$nodata = false;
			$term = false;
		}
		else
		{
			$term = $nd->getrecordset( );
			break;
		}
	}
	return $term;
}

function dml_getalbumcategoryphotopages( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "SELECT P.PID,P.USR,P.ALBUM_SUBJECT,P.ATTACHMENT,P.COVER,P.TITLE,A.HTTP_URL,A.SERVER_PATH,";
		$sql .= " A.ENCRYPT_NAME FROM ALBUM_PHOTO P,ALBUM_ATTACHMENT A  ";
		$sql .= " WHERE P.ATTACHMENT = A.PID";
		$sql .= " AND P.ALBUM_SUBJECT = ".$parr['pid']."";
		$sql .= " AND ABLE <>0 ORDER BY PID DESC ";
		$sql .= " LIMIT ".( $parr['page_no'] - 1 ) * $parr['page_record'].", ".$parr['page_record'];
		if ( !$nd->executequery( $sql ) )
		{
			$nodata = false;
			$term = false;
		}
		else
		{
			$photores = $nd->getrecordset( );
			$des = "album_".$photores[0]['ALBUM_SUBJECT']."/";
			$i = 0;
			for ( ;	$i < count( $photores );	++$i	)
			{
				$file = substr( strrchr( $photores[$i]['SERVER_PATH'], ":" ), 1 );
				$file = substr( strrchr( $photores[$i]['SERVER_PATH'], "/" ), 1 );
				$picfile[$i] = "/cache/album/".$photores[$i]['USR']."/".$des.$file;
			}
			$result = "<table width='100%'  border='0' cellspacing='0' cellpadding='0' ><tr>";
			$result .= "<td align='center'>\n<table width='99%' border='0' cellpadding='0'><form name='pics'>";
			$i = 0;
			for ( ;	$i < count( $photores );	++$i	)
			{
				if ( $i % 3 == 0 )
				{
					$result .= "<tr>";
				}
				$result .= "<td>\n<table border='0' width='100%'><tr><td align='center'>\n";
				$result .= "<div class='divride' id='div_".$photores[$i]['PID']."'>\n";
				$result .= "<div id='pic_".$photores[$i]['PID']."' onclick=\"javascript:divride('".$photores[$i]['PID']."')\"";
				$result .= "><img src='".$picfile[$i]."' width=120 height=100></div>";
				$result .= "<div onclick=modifytitle('".$photores[$i]['PID']."','".$photores[$i]['TITLE']."')";
				$result .= "  id='pictitle_".$photores[$i]['PID']."' style='CURSOR: hand,height:20px'>".$photores[$i]['TITLE']."";
				$result .= "</div><input type='checkbox' name='picchoice' id='".$photores[$i]['PID']."'";
				$result .= "style='display:none' value='".$photores[$i]['PID']."'></div>";
				$result .= "</td></tr></table></td>";
				if ( $i % 3 == 3 )
				{
					$result .= " </tr>";
				}
			}
			$result .= "</div></form></table></td></tr></table>\n";
			$previous = $parr['page_no'] - 1;
			$nexts = $parr['page_no'] + 1;
			$result .= "<br><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">";
			$result .= "<tr class=\"TdLine4\"><td align=\"right\">每页";
			$result .= "".$parr['page_record']."张";
			$result .= "&nbsp;&nbsp;共<font color=\"FF9900\">".$parr['total_cnt']."</font>张&nbsp;";
			$result .= "当前第<font color=\"FF9900\">".$parr['page_no']."</font>页&nbsp;";
			$result .= "总<font color=\"FF9900\">".$parr['page_total']."</font>页&nbsp;";
			if ( 0 < $previous )
			{
				$result .= "<a href=\"javascript:void(0)\" onclick=\"listpages('1','".$_REQUEST['pid']."')\">";
				$result .= "<img src=\"/images/album/pageindex.gif\" border=\"0\" alt=\"首页\"></a>&nbsp;";
				$result .= "<a href=\"javascript:listpages('".$previous."','".$_REQUEST['pid']."')\">";
				$result .= "<img src=\"/images/album/pagepriv.gif\" border=\"0\" style=\"cursor:hand\" onclick=\"\" alt=\"上一页\"></a>";
			}
			if ( $nexts <= $parr['page_total'] )
			{
				$result .= "<a href=\"javascript:listpages('".$nexts."','".$_REQUEST['pid']."')\">";
				$result .= "<img src=\"/images/album/pagenext.gif\" border=\"0\" alt=\"下一页\"></a>&nbsp;";
				$result .= "<a href=\"javascript:void(0)\" onclick=\"listpages('".$parr['page_total']."','".$_REQUEST['pid']."')\">";
				$result .= "<img src=\"/images/album/pagelast.gif\" border=\"0\" alt=\"尾页\"></a>";
			}
			$result .= "&nbsp;".$parr['turn']."";
			$result .= "<input type=\"text\" size=\"1\" id=\"pages\" class=\"inbg2\">";
			$result .= "&nbsp;<input type=\"button\" value=\"确定\"";
			$result .= " onclick=\"choicspage('".$_REQUEST['pid']."')\"></td></tr></table>";
			echo $result;
			break;
		}
	}
	return $term;
}

function dml_modifyptitle( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "UPDATE ALBUM_PHOTO SET TITLE = '".$parr['title']."'";
		$sql .= " WHERE PID = ".$parr['pid']."";
		if ( $nd->executequery( $sql ) )
		{
			break;
		}
		$nodata = false;
		$term = false;
		break;
	}
	return $term;
}

function dml_delphoto( &$nd, &$nodata, &$error, &$parr )
{
	$term = true;
	while ( $term )
	{
		$sql = "SELECT ATTACHMENT FROM ALBUM_PHOTO WHERE PID = ".$parr['pid']."";
		if ( !$nd->executequery( $sql ) )
		{
			$nodata = false;
			$term = false;
		}
		else
		{
			$res = $nd->getrecordset( );
			$sql = "DELETE FROM ALBUM_PHOTO WHERE PID= ".$parr['pid']."";
			if ( !$nd->executequery( $sql ) )
			{
				$nodata = false;
				$term = false;
			}
			else
			{
				$sql = "DELETE FROM ATTACHMENT WHERE ATT_ID = ".$res[0]['ATTACHMENT']."";
				if ( $nd->executequery( $sql ) )
				{
					break;
				}
				$nodata = false;
				$term = false;
				break;
			}
		}
	}
	return $term;
}

function dml_getalbumcount( &$nd, &$nodata, &$error, &$parr )
{
	$vReturn = false;
	$term = true;
	while ( $term )
	{
		$sql = "SELECT  COUNT(*) ALBUM_CNT FROM ALBUM_PHOTO ";
		$sql .= " WHERE ALBUM_SUBJECT  = ".$parr['pid']."";
		$sql .= " AND ABLE <> 0";
		if ( !$nd->executequery( $sql ) )
		{
			$nodata = false;
			$term = false;
		}
		else if ( !( $res = $nd->getrecordset( ) ) )
		{
			$nodata = true;
			$term = false;
			$error['msg'] = "";
		}
		else
		{
			return $res[0]['ALBUM_CNT'];
		}
	}
	return $vReturn;
}

?>

⌨️ 快捷键说明

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