All pastes #93801 Raw Edit

Someone

public php v1 · immutable
#93801 ·published 2006-07-20 19:37 UTC
rendered paste body
<?function head($title = ""){include "connection.php";?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.dotnetglobalservices.com" ><head><title><? echo $title; ?></title> <link href="<?=$path;?>StyleSheet.css" rel="stylesheet" type="text/css"> </head><body leftmargin=0 rightmargin=0><table width=99% align=center cellpadding=0 cellspacing=0 border=0><tr><td width=30%><a href="<? echo $path . "index.php"; ?>"><img src="<?=$path; ?>images/logo.jpg" border=0 /></a>&nbsp;&nbsp;</td><td width=70% align=center><font color="#EEEEEE">[ top banner ]</font></td></tr><tr><td colspan=2></td></table></td></tr></table><?}function ShowMessage($message = "")	{	?>	<table width=100% cellspacing="1" cellpadding="1" Class="NormalTable">	<tr class="top_table"><td width=100%>	&nbsp; &nbsp;<b></b></td></tr>	<tr class="SubLine"><td></td></tr> 	<tr><td><div class="margin_full"><?=$message;?></div></td></tr> 	<tr class="SubLine"><td></td></tr> 	</table>	<?	}		function member_left()	{	?><br/><table width=100% cellspacing="1" cellpadding="1" Class="NormalTable"><tr class="top_table"><td width=100% colspan=7> &nbsp; &nbsp;<b>Options</b></td></tr> <tr class="SubLine"><td></td></tr><tr><td> &nbsp; <img src="images/am.gif" width="8" height="7" /> &nbsp;<a href="new.php">Create New Item</a></td></tr><tr class="SubLine"><td></td></tr><tr><td> &nbsp; <img src="images/am.gif" width="8" height="7" /> &nbsp;<a href="view.php">View items</a></td></tr><tr class="SubLine"><td></td></tr><tr><td> &nbsp; <img src="images/am.gif" width="8" height="7" /> &nbsp;<a href="new_cat.php">Add Category</a></td></tr><tr class="SubLine"><td></td></tr><tr><td> &nbsp; <img src="images/am.gif" width="8" height="7" /> &nbsp;<a href="show.php">Preview</a></td></tr><tr class="SubLine"><td></td></tr><tr><td> &nbsp; <img src="images/am.gif" width="8" height="7" /> &nbsp;<a href="out.php">Log Out</a></td></tr><tr class="SubLine"><td></td></tr><tr class="SubLine"><td></td></tr></table>	<?	}	function ShowContent($title = "Results",$query,$page = 1)	{	include "connection.php";	include "pag.php";		?>	<table width=100% cellspacing="1" cellpadding="1" Class="NormalTable">	<tr class="top_table"><td width=100% colspan=7>	&nbsp; &nbsp;<b><? echo $title ?></b></td></tr> 	<?	$result = mysql_query($query);	$total = mysql_num_rows($result);		$limit = 10; 	$pager  = Pager::getPagerData($total, $limit, $page);     	$offset = $pager->offset;     	$limit  = $pager->limit;     	$page   = $pager->page;  	$query = $query . " limit $offset, $limit"; 	$result = mysql_query($query);  	$i = 1;	while ($row = mysql_fetch_array($result)) {	$title = stripslashes($row['Title']);	$description = stripslashes($row['Description']);	$link = stripslashes($row['Link']);	$ID = stripslashes($row['Id']);	$Category = stripslashes($row['Category']);	if ($i % 2 == 0) {	?><tr class=AlternatingResultsTemplate><td align=left>&nbsp;<b><?=$title;?></b></td><td><?=$description;?></td><td><?=$Category;?></td><td><a href="<?=$link;?>" target="_blank"><img border="0" src="<? echo $path . "view2.php?id=" . $ID; ?>"></a></td><td><a href=<? echo $PHP_SELF;?>?ContentID=<?=$ID;?>&do=edit>Edit</a></td></td><td><a href=<? echo $PHP_SELF;?>?ContentID=<?=$ID;?>&do=delete>Delete</a></td></tr><?	}	else	{	?><tr class=AlternatingResultsTemplate><td align=left>&nbsp;<b><?=$title;?></b></td><td><?=$description;?></td><td><?=$Category;?></td><td><a href="<?=$link;?>" target="_blank"><img border="0" src="<? echo $path . "view2.php?id=" . $ID; ?>"></a></td><td><a href=<? echo $PHP_SELF;?>?ContentID=<?=$ID;?>&do=edit>Edit</a></td></td><td><a href=<? echo $PHP_SELF;?>?ContentID=<?=$ID;?>&do=delete>Delete</a></td></tr><?	}	$i = $i + 1;	}	if ($total >= $limit)	{    // output paging system (could also do it before we output the page content)   if ($page == 1) // this is the first page - there is no previous page         echo "";     else            // not the first page, link to the previous page         echo "<a href=\"?page=" . ($page - 1) . "\">Previous</a>";         if ($page == $pager->numPages) // this is the last page - there is no next page         echo "";     else            // not the last page, link to the next page         echo " <a href=\"?page=" . ($page + 1) . "\">Next</a>"; 	}		echo "</table>";	return $total;	}		function ShowPortfolio($query,$page = 1)	{	include "connection.php";	include "pag.php";		$result = mysql_query($query);	$total = mysql_num_rows($result);		$limit = 7; 	$pager  = Pager::getPagerData($total, $limit, $page);     	$offset = $pager->offset;     	$limit  = $pager->limit;     	$page   = $pager->page;  	$query = $query . " limit $offset, $limit"; 	$result = mysql_query($query);  	$i = 1;	while ($row = mysql_fetch_array($result)) {	$title = stripslashes($row['Title']);	$description = stripslashes($row['Description']);	$link = stripslashes($row['Link']);	$ID = stripslashes($row['Id']);	?>	<table width="400px" align="center" cellspacing="0" cellpadding="0" style="border: solid 1px #CCCCCC" bgcolor="#FFFFFF">		<tr style="background-color:#EEEEEE;height:20px"><td align=left colspan="2" style="font-family:verdana,arial;font-size:7pt;color:#336699">&nbsp; <b><?=$title;?></b></td></tr>	<tr class="SubLine"><td></td></tr>	<tr><td valign="top" align=left style="font-size:6pt;color:#336699">&nbsp;<img src="<? echo $path . "view2.php?id=" . $ID; ?>"></td><td valign="top" style="font-family:verdana,arial;font-size:8pt"><div class="margin_full"><b>Description:</b> <?=$description;?><br/><br/>Click <a href="<?=$link;?>" target="_blank">here</a> to view project.</div></td></tr>	<tr class="SubLine"><td></td></tr>	</table>	<br/>		<?	}	if ($total >= $limit)	{    // output paging system (could also do it before we output the page content)   if ($page == 1) // this is the first page - there is no previous page         echo "";     else            // not the first page, link to the previous page         echo "<a href=\"?page=" . ($page - 1) . "\">Previous</a>";         if ($page == $pager->numPages) // this is the last page - there is no next page         echo "";     else            // not the last page, link to the next page         echo " <a href=\"?page=" . ($page + 1) . "\">Next</a>"; 	}			return $total;	}?>