Show line that will be deleted on the confirmation page
authorJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Fri, 11 May 2012 10:10:32 +0000 (12:10 +0200)
committerJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Fri, 11 May 2012 10:10:32 +0000 (12:10 +0200)
display.php

index a33e7a43ab2c52c3e4c493509a7512754e9569ef..f4d18d8455f93980feff4fc19a4c6268310f6ed7 100644 (file)
                        $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']))
                        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 {