2005-10-17 03:59:24 +00:00
|
|
|
<?php
|
|
|
|
|
/*************************************/
|
|
|
|
|
/* code to view distributions */
|
|
|
|
|
/*************************************/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* application environment
|
|
|
|
|
*/
|
2006-07-07 18:14:53 +00:00
|
|
|
require("path.php");
|
2005-10-17 03:59:24 +00:00
|
|
|
require(BASE."include/incl.php");
|
2006-07-21 04:21:04 +00:00
|
|
|
require_once(BASE."include/distribution.php");
|
2006-07-12 00:29:35 +00:00
|
|
|
require_once(BASE."include/testData.php");
|
2005-10-17 03:59:24 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if ($aClean['sSub'])
|
2005-10-21 02:48:27 +00:00
|
|
|
{
|
|
|
|
|
if(!$_SESSION['current']->hasPriv("admin"))
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Insufficient privileges.");
|
2005-10-21 02:48:27 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sSub'] == 'delete')
|
2005-10-21 02:48:27 +00:00
|
|
|
{
|
2006-06-17 06:10:10 +00:00
|
|
|
$oDistribution = new distribution($aClean['iDistributionId']);
|
2005-10-21 02:48:27 +00:00
|
|
|
$oDistribution->delete();
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit($_SERVER['PHP_SELF']);
|
2005-10-21 02:48:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
2006-06-17 06:10:10 +00:00
|
|
|
$oDistribution = new distribution($aClean['iDistributionId']);
|
2005-10-17 03:59:24 +00:00
|
|
|
|
2007-01-27 00:30:00 +00:00
|
|
|
/* Display distribution list if no id given */
|
2005-10-17 03:59:24 +00:00
|
|
|
if(!$oDistribution->iDistributionId)
|
|
|
|
|
{
|
2005-10-21 02:48:27 +00:00
|
|
|
apidb_header("View Distributions");
|
|
|
|
|
|
|
|
|
|
//get available Distributions
|
2007-01-27 00:30:00 +00:00
|
|
|
$hResult = distribution::ObjectGetEntries(false);
|
2005-10-21 02:48:27 +00:00
|
|
|
|
|
|
|
|
// show Distribution list
|
|
|
|
|
echo html_frame_start("","90%","",0);
|
|
|
|
|
echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
|
|
|
|
|
|
2007-01-27 00:30:00 +00:00
|
|
|
distribution::ObjectOutputHeader("color4");
|
|
|
|
|
|
|
|
|
|
for($c = 1; $oRow = mysql_fetch_object($hResult); $c++)
|
2005-10-21 02:48:27 +00:00
|
|
|
{
|
2007-01-27 00:30:00 +00:00
|
|
|
$oDistribution = distribution::ObjectGetInstanceFromRow($oRow);
|
|
|
|
|
|
2007-01-31 02:18:18 +00:00
|
|
|
$oDistribution->objectOutputTableRow(($c % 2) ? "color0" : "color1");
|
2005-10-21 02:48:27 +00:00
|
|
|
}
|
|
|
|
|
echo "</table>\n\n";
|
|
|
|
|
echo html_frame_end(" ");
|
|
|
|
|
if ($_SESSION['current']->hasPriv("admin"))
|
|
|
|
|
echo "[<a href='".BASE."admin/editDistribution.php'>Add New Distribution</a>]";
|
|
|
|
|
apidb_footer();
|
2005-10-17 03:59:24 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//display page
|
|
|
|
|
apidb_header("View Distribution");
|
|
|
|
|
echo html_frame_start("Distribution Information",500);
|
|
|
|
|
|
2007-01-31 02:18:18 +00:00
|
|
|
$oDistribution->display();
|
2005-10-17 03:59:24 +00:00
|
|
|
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
echo html_back_link(1);
|
|
|
|
|
apidb_footer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|