Location: PHPKode > projects > ComVironment > comvironment/libraries/form.lib.php
<?php

function fb_ftt ($act, $color)
{
	global $primary_align, $middle_width;
	$return = "<form action=\"<?php echo \"$act\"; ?>\" method=\"post\">\n";
	if($primary_align=="center") $return .= "\t<center>\n";
	$return.= "\t<table bgcolor=\"$color\" width=\"100%\" ";
	$return.= "border=\"0\" cellspacing=\"1\" cellpadding=\"2\">\n";
	return $return;
}

function ib_ftt ($act, $color)
{
	global $primary_align;
	$return = "<form action=\"$act\" method=\"post\">\n";
	if($primary_align=="center") $return .= "\t<center>\n";
	$return.= "\t<table bgcolor=\"$color\" width=\"100%\" ";
	$return.= "border=\"0\" cellspacing=\"1\" cellpadding=\"2\">\n";
	return $return;
}

function fb_ftb ()
{
	global $primary_align;
	$return = "\t</table>\n";
	if($primary_align=="center") $return .= "\t</center>\n";
	$return.= "</form>\n\n";
	return $return;
}

function fb_z1 ($question, $color)
{
	$return = "\t<tr bgcolor=$color height=\"25\">\n";
	$return.= "\t<td colspan=2>\n";
	$return.= "\t\t<font size=\"+2\"><b>$question</b></font>\n\t\t\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}
function fb_z2 ($question, $color)
{
	$return = "\t<tr bgcolor=$color height=\"25\">\n";
	$return.= "\t<td colspan=2>\n";
	$return.= "\t\t<font size=\"+1\"><b>$question</b></font>\n\t\t\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}
function fb_z3 ($question, $color)
{
	$return = "\t<tr bgcolor=$color height=\"25\">\n";
	$return.= "\t<td colspan=2>\n";
	$return.= "\t\t<b>$question</b>\n\t\t\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}
function fb_z4 ($question,$color)
{
	$return = "\t<tr bgcolor=$color height=\"25\">\n";
	$return.= "\t<td colspan=2>\n";
	$return.= "\t\t$question\n\t\t<br>\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}

function fb_hv ($question,$name,$value,$color)
{
	$return = "\t<tr bgcolor=$color>\n";
	$return.= "\t<td>\n";
	$return.= "\t\t$question\n";
	$return.= "\t</td><td >\n";
	$return.= "\t\t<b>$value</b>\n";
	$return.= "\t\t<input type=hidden name=\"$name\" value=\"$value\">\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}

function fb_h ($name,$value)
{
	$return = "\t\t<input type=hidden name=\"$name\" value=\"$value\">";
	return $return;
}

function fb_a ($question,$name,$value,$color)
{

	$return = "\n\t<tr bgcolor=$color>\n\t<td colspan=2>\n\n";
	$return.= "\t\t<table border=0 cellspacing=0 cellpadding=0>\n";
	$return.= "\t\t<tr><td>\n";
	$return.= "\n\t\t<br>$question\n\t</td></tr>\n";
	$return.= "\n\t\t<tr bgcolor=$color>\n\t<td colspan=2 align=center>\n";
	$return.= "\n\t\t<textarea rows=6 cols=84 name=$name wrap=virtual class=\"inputtxt\" style=\"font-family:Arial,Helvetica;width:100%\">";
	$return.= "$value";
	$return.= "</textarea>\n";
	$return.= "\n\t\t</td></tr>\n\t\t</table>\n\n";
	$return.= "\n\t</td></tr>\n\n";
	return $return;
}

function fb_b ($question,$name,$value,$color)
{
	
	$return = "\t<tr bgcolor=$color>\n";
	$return.= "\t<td width=\"40%\">\n\t\t$question\n\t</td>\n";
	$return.= "\t<td width=\"60%\">\n\t\t<input type=text size=30 name=\"$name\" value=\"$value\" class=\"inputtxt\" style=\"font-family:Arial,Helvetica;width:100%\">\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}


function fb_x ($question,$color)
{

	$return = "\t<tr bgcolor=$color>\n";
	$return.= "\t<td colspan=2 align=center>\n";
	$return.= "\t\t<input type=\"submit\" value=\"$question\">\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}

function fb_c ($question,$name,$value,$array,$color)
{

	if(sizeof($array)>2) $br = "<br>";
	$return = "\t<tr bgcolor=$color height=\"25\"><td width=\"40%\">\n";
	$return.= "\t\t$question\n\t</td>\n\t<td width=\"60%\">\n";
	if(sizeof($array)>1)
	{
		foreach ($array as $x => $w)
		{
			$return.= "\t\t<input type=\"checkbox\" ";
			if($value[$x]) $return .= "checked ";
			$return.= "name=\"" . $name . "_" . ($x+1);
			$return.= "\" value=\"1\">$w$br\n";
		}
	}
	else
	{
		$return.= "\t\t<input type=\"checkbox\" ";
		if($value[0]) $return .= "checked ";
		$return.= "name=\"" . $name ;
		$return.= "\" value=\"1\">$w$br\n";
	}
	$return.= "\t</td></tr>\n\n";
	return $return;
}

function fb_d ($question,$name,$value,$array,$color)
{

	if(sizeof($array)>2) $br = "<br>";
	$return = "\t<tr bgcolor=$color height=\"25\"><td width=\"40%\">\n";
	$return.= "\t\t$question\n\t</td>\n\t<td width=\"60%\">\n";
	foreach ($array as $x => $w)
	{
		$return.= "\t\t<input type=\"radio\" ";
		if($value == ($x+1)) $return .= "checked ";
		   
		$return.= "name=\"$name\" ";
		$return.= "value=\"" . ($x+1) . "\">$w$br\n";
	}
	$return.= "\t</td></tr>\n\n";
	return $return;
}

function fb_e ($question,$name,$value,$array,$color)
{

	$return = "\t<tr bgcolor=$color height=\"25\">\n\t<td width=\"40%\">\n";
	$return.= "\t\t$question\n\t</td>\n\t<td width=\"60%\">\n";
	$return.= "\t\t<select name=\"$name\" size=\"1\" class=\"inputtxt\"  style=\"font-family:Arial,Helvetica;width:100%\">\n";
	$return.= "\t\t<option ";
	if(!$value) $return.= "selected ";
	$return.= " value=\"0\">Bitte ausw&auml;hlen</option>\n";
	foreach ($array as $x => $w)
	{
		$return.= "\t\t<option ";
		if($value == ($x+1)) $return .= "selected ";
		
		$return.= "value=\"" . ($x+1) . "\">";
		$return.= "$w</option>\n";
	}
	$return.= "\t\t</select>\n";
	$return.= "\t</td></tr>\n\n";
	return $return;
}

function fb_l_b ($question,$name,$value,$count,$left,$right,$color)
{
	global $bdcolor, $img_dir;
	$colspan = round ((($count -1) / 2), 0) +1 ;
	$return = "\t<tr bgcolor=\"$color\"><td valign=\"bottom\" width=\"40%\">\n";
	$return.= "\t\t$question\n\t</td>\n\t<td>\n";

	$return.= "\t\t<table width=\"100%\" ";
	$return.= "border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr><td valign=\"bottom\">\n";

	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\" width=\"100%\">\n";
	$return.= "\t\t<td colspan=\"$colspan\" align=\"left\">&nbsp;$left</td>\n";
	$return.= "\t\t<td colspan=\"" . ($count - $colspan) . "\" align=\"right\">$right&nbsp;</td>\n";
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\t\t</td><td width=\"70\" bgcolor=\"$color\">\n";
	$return.= "\t\t&nbsp;\n";
	$return.= "\t\t</td></tr>\n\n";
	
	$return.= "\t\t<tr bgcolor=\"$bdcolor\"><td colspan=\"3\">";
	$return.= "<img src=\"" . $img_dir . "tpx.gif\" width=\"1\" height=\"1\">";
	$return.= "</td></tr>\n\n";

	$return.= "\t\t<tr><td>\n";
	
	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\" width=\"100%\">\n";
	for ($i=1;$i<=$count;$i++)
	{
		$return.= "\n\t\t<td align=\"center\">";
		$return.= "\n\t\t\t<input type=\"radio\" ";
		if($value == $i) $return .= "checked ";
		$return.= "name=\"$name\" value=\"$i\">\n";
		$return.= "\t\t</td>\n";
	}
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\t\t</td><td width=\"70\" bgcolor=\"$color\">\n";
	$return.= "\t\t&nbsp;\n";
	$return.= "\t\t</td></tr>\n\n";


	$return.= "\n\t\t</table>\n\t</td></tr>\n\n";
	return $return;
}

function fb_l_f ($question,$name,$value,$count,$color)
{
	global $img_dir;
	$colspan = round ((($count -1) / 2), 0) +1 ;
	$return = "\t<tr bgcolor=\"$color\"><td valign=\"bottom\" width=\"40%\">\n";
	$return.= "\t\t$question\n\t</td>\n\t<td>\n";

	$return.= "\t\t<table width=\"100%\" ";
	$return.= "border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";

	$return.= "\t\t<tr><td>\n";
	
	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\" width=\"100%\">\n";
	for ($i=1;$i<=$count;$i++)
	{
		$return.= "\n\t\t<td align=\"center\">";
		$return.= "\n\t\t\t<input type=\"radio\" ";
		if($value == $i) $return .= "checked ";
		$return.= "name=\"$name\" value=\"$i\">\n";
		$return.= "\t\t</td>\n";
	}
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\t\t</td><td width=\"70\" bgcolor=\"$color\">\n";
	$return.= "\t\t&nbsp;\n";
	$return.= "\t\t</td></tr>\n\n";


	$return.= "\n\t\t</table>\n\t</td></tr>\n\n";
	return $return;
}


function fb_m_b ($question,$name,$value,$count,$left,$right,$add,$color)
{
	global $bdcolor, $img_dir;
	$colspan = round ((($count -1) / 2), 0) +1 ;
	$return = "\t<tr bgcolor=\"$color\"><td valign=\"bottom\" width=\"40%\">\n";
	$return.= "\t\t$question\n\t</td>\n\t<td>\n";

	$return.= "\t\t<table width=\"100%\" ";
	$return.= "border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr><td valign=\"bottom\">\n";


	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\" width=\"100%\">\n";
	$return.= "\t\t<td colspan=\"$colspan\" align=\"left\">&nbsp;$left</td>\n";
	$return.= "\t\t<td colspan=\"" . ($count - $colspan) . "\" align=\"right\">$right&nbsp;</td>\n";
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\t\t</td><td width=\"1\" bgcolor=\"$bdcolor\">";
	$return.= "<img src=\"" . $img_dir . "tpx.gif\" width=\"1\" height=\"1\">";
	$return.= "</td>\n\t\t<td width=\"70\">\n";
	
	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\" width=\"100%\">\n";
	$return.= "\t\t<td align=\"center\">$add</td>\n";
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";
	
	$return.= "\t\t</td></tr>\n\n";
	
	$return.= "\t\t<tr bgcolor=\"$bdcolor\"><td colspan=\"3\">";
	$return.= "<img src=\"" . $img_dir . "tpx.gif\" width=\"1\" height=\"1\">";
	$return.= "</td></tr>\n\n";

	$return.= "\t\t<tr><td>\n";
	
	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\" width=\"100%\">\n";
	for ($i=1;$i<=$count;$i++)
	{
		$return.= "\n\t\t<td align=\"center\">";
		$return.= "\n\t\t\t<input type=\"radio\" ";
		if($value == $i) $return .= "checked ";
		$return.= "name=\"$name\" value=\"$i\">\n";
		$return.= "\t\t</td>\n";
	}
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\t\t</td><td width=\"1\" bgcolor=\"$bdcolor\">";
	$return.= "<img src=\"" . $img_dir . "tpx.gif\" width=\"1\" height=\"1\">";
	$return.= "</td>\n\t\t<td>\n";
	
	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\"width=\"100%\">\n";
	$return.= "\t\t<td align=\"center\">";
	$return.= "\n\t\t\t<input type=\"radio\" ";
	if($value == 9) $return .= "checked ";
	$return.= "name=\"$name\" value=\"9\">\n";
	$return.= "\n\t\t</td>\n";
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\n\t\t</td></tr>\n\t\t</table>\n\t</td></tr>\n\n";
	return $return;
}
function fb_m_f ($question,$name,$value,$count,$color)
{
global $bdcolor, $img_dir;
	$colspan = round ((($count -1) / 2), 0) +1 ;
	$return = "\t<tr bgcolor=\"$color\"><td valign=\"bottom\" width=\"40%\">\n";
	$return.= "\t\t$question\n\t</td>\n\t<td>\n";

	$return.= "\t\t<table width=\"100%\" ";
	$return.= "border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr><td>\n";


	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\" width=\"100%\">\n";
	for ($i=1;$i<=$count;$i++)
	{
		$return.= "\n\t\t<td align=\"center\">";
		$return.= "\n\t\t\t<input type=\"radio\" ";
		if($value == $i) $return .= "checked ";
		$return.= "name=\"$name\" value=\"$i\">\n";
		$return.= "\t\t</td>\n";
	}
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\t\t</td><td width=\"1\" bgcolor=\"$bdcolor\" >";
	$return.= "<img src=\"" . $img_dir . "tpx.gif\" width=\"1\" height=\"1\">";
	$return.= "</td>\n\t\t<td width=\"70\">\n";
	
	$return.= "\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
	$return.= "\t\t<tr bgcolor=\"$color\"width=\"100%\">\n";
	$return.= "\t\t<td align=\"center\">";
	$return.= "\n\t\t\t<input type=\"radio\" ";
	if($value == 9) $return .= "checked ";
	$return.= "name=\"$name\" value=\"9\">\n";
	$return.= "\n\t\t</td>\n";
	$return.= "\t\t</tr>\n";
	$return.= "\t\t</table>\n";

	$return.= "\n\t\t</td></tr>\n\t\t</table>\n\t</td></tr>\n\n";
	return $return;

	
}

?>
Return current item: ComVironment