<?

	#---------------------------------------------------------------------#
	# This source code is (c)2000 White Pajamas, Inc                      #
	# see http://www.stonekeep.com/license.html for licensing information #
	#---------------------------------------------------------------------#

	#----------------------------------------------------------------------
	# $Id: contutils.php3,v 1.9 2000/12/14 19:13:46 shevett Exp $
	#----------------------------------------------------------------------
	
	#----------------------------------------------------------------------

	Function LoadColInfo () {
		Global $Colheader,$curruser,$cscol,$csflags,$sys_col;
		$hq = db_query("select p_column,p_active,p_flags,dcolumn,dheading,p_order ".
									"from ".
									"propdisp,dictionary ".
									"where ".
									"p_dataset=dtable ".
									"and dtable='contacts' ".
									"and p_column=dcolumn ".
									"and p_uid='$curruser' ".
									"and p_active=1 ".
									"order by p_order");
#		$Colheader="<td bgcolor=#bbbbbb>&nbsp;</td>";
		$Colheader="";
		if (db_numrows($hq)) {
			while ($hinfo = db_fetch_array($hq)) {
				$cscol[] = "$hinfo[p_column]";
				$csflags[] = "$hinfo[p_flags]";
				$Colheader="$Colheader <td bgcolor=$sys_col[bgmed]><b><font size=2>$hinfo[dheading]</td>";
			}
		} else {

			# There are no rows in the preferences table describing how things should
			# be shown.  Here are the defaults.

			$cscol[]="name";		$csflags[]="";		$Colheader="<td><b><font size=2>Name</td>";
			$cscol[]="company";	$csflags[]="";		$Colheader="$Colheader <td><b><font size=2>Company</td>";
			$cscol[]="email";		$csflags[]="";		$Colheader="$Colheader <td><b><font size=2>E-Mail</td>";
			$cscol[]="ctype";		$csflags[]="";		$Colheader="$Colheader <td><b><font size=2>Type</td>";

		}
	}
?>
