Location: PHPKode > projects > Prsaar Social Networking Platform > PrsaarColour-0.7.alpha.6.3/pr-layout/category.php
<?php
	if(empty($_GET['category']))
	{
		echo " <h2> Profile Categories </h2> <ul> ";
		foreach($Display->ProfileTypes as $Key => $KeyValue)
			{
				print " <li> <a href='./?page=category&category={$KeyValue}'>{$KeyValue}</a> </li> ";
			}
		echo " </ul> ";
	}
	else
	{
		$Type = $_GET['category'];
		if(strtolower($Type) == 'identity')
		{
			$Display->ShowProfileIdentity();
			if($Display->ShowIdentity == false)
				print ' <p> User hasn\'t yet created his Identity page </p> ';
			else
			{
				print " <h1 id='page_content_heading'> Profile Category: ".ucfirst($Type)." </h1> <table>";
				print " <table> ";
				foreach($Display->ShowIdentity as $Key => $KeyValue)
				{
					$IdentityElement = 'show';
					if(strtolower($KeyValue['name']) == 'dateofbirth')
					{
						if($Display->ShowDOB == 'yes')
						{
						//todo
						}
						else
							$IdentityElement = 'dontshow';
					}
					if($IdentityElement == 'show')
					{
						//trying to produce an alternate background effect, someday i'll replace it by javascript
						if(empty($i)) $i = 0;
						if($i%2 == 0) $BackgroundColour = '#F1F1F1';
						else $BackgroundColour = '#E2E2E2';
						$i++;
						print " <tr> <td class='category_element_heading' style='background-color:{$BackgroundColour}'> ".ucfirst($KeyValue['name']).": </td> <td class='category_element_content' style='background-color:{$BackgroundColour}'> ".ucfirst($KeyValue['value'])." </td> </tr> ";
					}
				}
				print " </table> ";
			}
		}
		else
		{
			$Display->ShowProfileType($Type);
			if($Display->ShowCategory == false)
					print 'unable to display the profile';
				else
				{
					print " <h1 id='page_content_heading'> Profile Category: ".ucfirst($Type)." </h1> <table>";
					foreach($Display->ShowCategory as $Key => $KeyValue)
					{
						//trying to produce an alternate background effect,
						if(empty($i)) $i = 0;
						if($i%2 == 0) $BackgroundColour = '#F1F1F1';
						else $BackgroundColour = '#E2E2E2';
						$i++;
?>
						<tr class='category_row'>
							<td valign="top" class='category_element_heading' style="background-color:<?php _P($BackgroundColour); ?>;"> <?php _P(ucfirst($KeyValue['name'])); ?>: </td> 
							<td valign="top" class='category_element_content' style="background-color:<?php _P($BackgroundColour); ?>;"> <?php _P(ucfirst($KeyValue['value'])); ?> </td> 
						</tr>
<?php
					}
					_P('</table>');
				}
		}
	}
?>
Return current item: Prsaar Social Networking Platform