コード例 #1
0
        $allColumnsAsArray = array();
        echo "<div>\n            <form action='created.php' method='post' onsubmit=\"return confirm('Are you sure you want to submit this form?');\">\n                <fieldset><legend>Add " . $_POST['table'] . "</legend>\n                <input type='hidden' name='table' value='" . $_POST['table'] . "'>\n                    <table align='center'>";
        if ($allColumns->num_rows > 0) {
            while ($row = $allColumns->fetch_assoc()) {
                array_push($allColumnsAsArray, $row["Column_name"]);
            }
            for ($i = 1; $i < count($allColumnsAsArray); $i++) {
                if ($allColumnsAsArray[$i] == "Date_Added" || $allColumnsAsArray[$i] == "Last_Date_Modified" || $allColumnsAsArray[$i] == "Date_Joined" || $allColumnsAsArray[$i] == "Date_Deleted") {
                    continue;
                }
                echo "<tr>";
                echo "<td><b>" . $allColumnsAsArray[$i] . "</b></td>";
                echo "<td><input type='text' required name='" . $allColumnsAsArray[$i] . "' value=''> </td>";
                echo "</tr>";
            }
        } else {
            echo "0 results";
        }
        echo "</table></fieldset</div>";
        echo "<div id='center'><input type='submit' value='Add entry'></form></div>";
    }
    $table = $_POST['table'];
    retrieveAndPrintAllFromTable($table);
    ?>


</body>
</html>

<?php 
}
コード例 #2
0
                            echo "</tr>";
                        } else {
                            if ($allColumnsAsArray[$i] == "Date_Added" || $allColumnsAsArray[$i] == "Last_Date_Modified" || $allColumnsAsArray[$i] == "Date_Created") {
                                continue;
                            } else {
                                echo "<tr>";
                                echo "<td><b>" . $allColumnsAsArray[$i] . "</b></td>";
                                echo "<td><input type='text' name='" . $allColumnsAsArray[$i] . "' value='" . $row[$allColumnsAsArray[$i]] . "'> </td>";
                                echo "</tr>";
                            }
                        }
                    }
                }
            }
        } else {
            echo "0 results";
        }
        echo "</table></fieldset</div>";
        echo "<div id='center'><input type='submit' value='Submit Changes'></form></div>";
    }
    retrieveAndPrintAllFromTable($table, $column, $rowid);
    ?>


</body>

</html>


<?php 
}
コード例 #3
0
                foreach ($allColumnsAsArray as $column) {
                    if ($column == $allColumnsAsArray[0]) {
                        // Checks to see if the column is the id-column in in the table.
                        $columnName = $column;
                        $rowid = $row[$column];
                    }
                    echo "<td align='center'>" . $row[$column] . "</td>";
                }
                echo "<td align='center'>\n                        <form action='updateRow.php' method='get'>\n                            <input type='hidden' name='table' value='{$tableName}'>\n                            <input type='hidden' name='column' value='{$columnName}'>\n                            <input type='hidden' name='rowid' value='{$rowid}'>\n                            <input type='submit' value='Update'>\n                        </form>\n                        <form action='archiveRow.php' method='get'>\n                            <input type='hidden' name='table' value='{$tableName}'>\n                            <input type='hidden' name='column' value='{$columnName}'>\n                            <input type='hidden' name='rowid' value='{$rowid}'>\n                            <input type='submit' value='Delete'>\n                        </form>\n                    </td>";
                echo "</tr>";
            }
        } else {
            echo "0 results";
        }
        echo "</table>";
        echo "</div>";
    }
    if ($_POST["bowlingAudit"] == "") {
        echo "\n        <script type='text/javascript'>\n            alert('You forgot to select a table!');\n            history.go(-1);\n        </script>\n    ";
    } else {
        echo "<br>";
        retrieveAndPrintAllFromTable($_POST["bowlingAudit"]);
    }
    ?>

</body>

</html>

<?php 
}