2004-12-12 03:51:51 +00:00
|
|
|
<?php
|
2005-01-02 16:51:48 +00:00
|
|
|
/**********************************/
|
|
|
|
|
/* Edit application family */
|
|
|
|
|
/**********************************/
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
include("path.php");
|
2005-01-30 00:57:34 +00:00
|
|
|
require(BASE."include/incl.php");
|
|
|
|
|
require(BASE."include/tableve.php");
|
|
|
|
|
require(BASE."include/application.php");
|
|
|
|
|
require(BASE."include/category.php");
|
|
|
|
|
require(BASE."include/mail.php");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2006-06-17 06:10:10 +00:00
|
|
|
$aClean = array(); //array of filtered user input
|
|
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
|
|
|
|
|
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
|
2006-06-17 06:10:10 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if(!is_numeric($aClean['iAppId']))
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Wrong ID");
|
2005-01-02 16:51:48 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isSuperMaintainer($aClean['iAppId'])))
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit("Insufficient Privileges!");
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if(!empty($aClean['sSubmit']))
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2005-06-05 18:41:47 +00:00
|
|
|
process_app_version_changes(false);
|
2006-07-06 18:44:56 +00:00
|
|
|
util_redirect_and_exit(apidb_fullurl("appview.php?iAppId={$aClean['iAppId']}"));
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
2005-01-05 05:30:23 +00:00
|
|
|
else
|
2005-01-02 16:51:48 +00:00
|
|
|
// Show the form for editing the Application Family
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2004-05-04 15:21:25 +00:00
|
|
|
$family = new TableVE("edit");
|
|
|
|
|
|
2005-10-10 02:37:55 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$oApp = new Application($aClean['iAppId']);
|
2005-01-02 16:51:48 +00:00
|
|
|
|
2005-10-10 02:37:55 +00:00
|
|
|
if(!$oApp)
|
2004-05-04 15:21:25 +00:00
|
|
|
{
|
2006-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit('Application does not exist');
|
2004-05-04 15:21:25 +00:00
|
|
|
}
|
2005-01-02 16:51:48 +00:00
|
|
|
|
2005-10-10 02:37:55 +00:00
|
|
|
if($_SESSION['current']->showDebuggingInfos()) { echo "<p align=center><b>appName:</b> $oApp->sName </p>"; }
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2005-01-02 16:51:48 +00:00
|
|
|
apidb_header("Edit Application Family");
|
2004-05-04 15:21:25 +00:00
|
|
|
|
2005-02-02 02:38:20 +00:00
|
|
|
echo "<form method=\"post\" action=\"editAppFamily.php\">\n";
|
2005-10-10 02:37:55 +00:00
|
|
|
|
|
|
|
|
$oApp->OutputEditor("");
|
|
|
|
|
|
|
|
|
|
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">', "\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<tr><td colspan=2 align=center><input type="submit" name=sSubmit value="Update Database"></td></tr>',"\n";
|
2005-10-10 02:37:55 +00:00
|
|
|
echo '</table>', "\n";
|
2005-02-02 00:35:49 +00:00
|
|
|
echo "</form>";
|
2004-05-04 15:21:25 +00:00
|
|
|
|
2005-10-10 02:37:55 +00:00
|
|
|
echo "<p>";
|
|
|
|
|
|
|
|
|
|
// url edit form
|
2005-02-06 22:50:08 +00:00
|
|
|
echo '<form enctype="multipart/form-data" action="editAppFamily.php" method="post">',"\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<input type=hidden name="iAppId" value='.$oApp->iAppId.'>';
|
2005-02-06 22:50:08 +00:00
|
|
|
echo html_frame_start("Edit URL","90%","",0);
|
|
|
|
|
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
2005-10-10 02:37:55 +00:00
|
|
|
|
2005-02-06 22:50:08 +00:00
|
|
|
$i = 0;
|
2006-06-27 19:16:27 +00:00
|
|
|
$hResult = query_parameters("SELECT * FROM appData WHERE appId = '?' AND type = 'url' AND versionId = 0",
|
|
|
|
|
$oApp->iAppId);
|
2006-06-21 01:04:12 +00:00
|
|
|
if($hResult && mysql_num_rows($hResult) > 0)
|
2005-02-06 22:50:08 +00:00
|
|
|
{
|
|
|
|
|
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
|
|
|
|
|
echo '<b>Description</b></td><td class=color1><b>URL</b></td></tr>',"\n";
|
2006-06-21 01:04:12 +00:00
|
|
|
while($oRow = mysql_fetch_object($hResult))
|
2005-02-06 22:50:08 +00:00
|
|
|
{
|
|
|
|
|
$temp0 = "adelete[".$i."]";
|
|
|
|
|
$temp1 = "adescription[".$i."]";
|
|
|
|
|
$temp2 = "aURL[".$i."]";
|
|
|
|
|
$temp3 = "aId[".$i."]";
|
|
|
|
|
$temp4 = "aOldDesc[".$i."]";
|
|
|
|
|
$temp5 = "aOldURL[".$i."]";
|
|
|
|
|
echo '<tr><td class=color3><input type="checkbox" name="'.$temp0.'"></td>',"\n";
|
2006-06-21 01:04:12 +00:00
|
|
|
echo '<td class=color3><input size=45% type="text" name="'.$temp1.'" value ="'.stripslashes($oRow->description).'"</td>',"\n";
|
|
|
|
|
echo '<td class=color3><input size=45% type="text" name="'.$temp2.'" value="'.$oRow->url.'"></td></tr>',"\n";
|
|
|
|
|
echo '<input type=hidden name="'.$temp3.'" value='.$oRow->id.'>';
|
|
|
|
|
echo '<input type=hidden name="'.$temp4.'" value="'.stripslashes($oRow->description).'">';
|
|
|
|
|
echo '<input type=hidden name="'.$temp5.'" value="'.$oRow->url.'">',"\n";
|
2005-02-06 22:50:08 +00:00
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
echo '<tr><td class=color1></td><td class=color1><b>Description</b></td>',"\n";
|
|
|
|
|
echo '<td class=color1><b>URL</b></td></tr>',"\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</td></tr>\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo "<input type=hidden name='iRows' value='$i'>";
|
2005-02-06 22:50:08 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<tr><td class=color1>New</td><td class=color1><input size=45% type="text" name="sUrlDesc"></td>',"\n";
|
|
|
|
|
echo '<td class=color1><input size=45% name="sUrl" type="text"></td></tr>',"\n";
|
2005-10-10 02:37:55 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
echo '<tr><td colspan=3 align=center class=color3><input type="submit" name=sSubmit value="Update URL"></td></tr>',"\n";
|
2005-10-10 02:37:55 +00:00
|
|
|
|
2005-02-06 22:50:08 +00:00
|
|
|
echo '</table>',"\n";
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
echo "</form>";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
echo html_back_link(1,BASE."appview.php?iAppId=$oApp->iAppId");
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
apidb_footer();
|
|
|
|
|
?>
|