Skip to content

Commit

Permalink
Show line that will be deleted on the confirmation page
Browse files Browse the repository at this point in the history
  • Loading branch information
ioguix committed May 11, 2012
1 parent 0b7de9a commit acf7fa0
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions display.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,36 @@ function doDelRow($confirm) {
$misc->printTrail($_REQUEST['subject']);
$misc->printTitle($lang['strdeleterow']);

echo "<p>{$lang['strconfdeleterow']}</p>\n";
$rs = $data->browseRow($_REQUEST['table'], $_REQUEST['key']);

echo "<form action=\"display.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"delrow\" />\n";
echo $misc->form;

if ($rs->recordCount() == 1) {
echo "<p>{$lang['strconfdeleterow']}</p>\n";

$fkinfo = array();
echo "<table><tr>";
printTableHeaderCells($rs, false, true);
echo "</tr>";
echo "<tr class=\"data1\">\n";
printTableRowCells($rs, $fkinfo, true);
echo "</tr>\n";
echo "</table>\n";
echo "<br />\n";

echo "<input type=\"hidden\" name=\"action\" value=\"delrow\" />\n";
echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\" />\n";
echo "<input type=\"submit\" name=\"no\" value=\"{$lang['strno']}\" />\n";
}
elseif ($rs->recordCount() != 1) {
echo "<p>{$lang['strrownotunique']}</p>\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
}
else {
echo "<p>{$lang['strinvalidparam']}</p>\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
}
if (isset($_REQUEST['table']))
echo "<input type=\"hidden\" name=\"table\" value=\"", htmlspecialchars($_REQUEST['table']), "\" />\n";
if (isset($_REQUEST['subject']))
Expand All @@ -210,8 +235,6 @@ function doDelRow($confirm) {
echo "<input type=\"hidden\" name=\"sortdir\" value=\"", htmlspecialchars($_REQUEST['sortdir']), "\" />\n";
echo "<input type=\"hidden\" name=\"strings\" value=\"", htmlspecialchars($_REQUEST['strings']), "\" />\n";
echo "<input type=\"hidden\" name=\"key\" value=\"", htmlspecialchars(urlencode(serialize($_REQUEST['key']))), "\" />\n";
echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\" />\n";
echo "<input type=\"submit\" name=\"no\" value=\"{$lang['strno']}\" />\n";
echo "</form>\n";
}
else {
Expand Down

0 comments on commit acf7fa0

Please sign in to comment.