diff --git a/announcement.php b/announcement.php
deleted file mode 100644
index 6494e86..0000000
--- a/announcement.php
+++ /dev/null
@@ -1,27 +0,0 @@
-query($query) == TRUE) {
- echo "Record added successfully";
- } else {
- echo "Error added record: " . $link->error;
- }
- unlink("announcement.php");
-
- }
-}
-?>
diff --git a/balance.php b/balance.php
deleted file mode 100644
index 59da1cd..0000000
--- a/balance.php
+++ /dev/null
@@ -1,25 +0,0 @@
-query($query) == TRUE) {
- echo "Record added successfully";
- } else {
- echo "Error added record: " . $link->error;
- }
- unlink("balance.php");
-
- }
-}
-?>
diff --git a/db.php b/db.php
index c89eb54..51a07b3 100644
--- a/db.php
+++ b/db.php
@@ -1,9 +1,9 @@
addTPost($tble, $idCol);
$mpty = $c->ifMpty($tble, $idCol);
- $tmpfile = $tble . '.php';
+ $tmpfile = 'tmp/' . $tble . '.php';
$myfile = fopen("$tmpfile", "w") or die("Unable to open file!");
$start = 'addItem($tble, $idCol);
?>
@@ -246,7 +246,7 @@ function getID($tble) {
$ecols = $c->updateData($tble, $idCol);
$mpty = $c->ifMpty($tble, $idCol);
- $tmpfile = $tble . '.php';
+ $tmpfile = 'tmp/' . $tble . '.php';
$myfile = fopen("$tmpfile", "w") or die("Unable to open file!");
$content = 'editItem($tble, $id, $idCol);
?>
diff --git a/index2.php b/index2.php
new file mode 100644
index 0000000..f906bad
--- /dev/null
+++ b/index2.php
@@ -0,0 +1,384 @@
+ /
+ * Website Author: http://pepiuox.net/ / http://labemotion.net/
+ * Author's licenses: http://pepiuox.net/license / http://labemotion.net/license
+ * Project Name: EasyCRUD
+
+ * Contributors:
+ * Website Contributors:
+
+ * Library list.
+ * Bootstrap http://www.getbootstrap.com
+ * Jquery http://www.jquery.com ,
+ * Poppers https://popper.js.org/
+
+ * This file is a module or application for make simple CRUD based in PHP.
+ * Use of this source code is governed by an PEPIUOX / LAB EMOTION License included
+ * MIT License that can be found in the LICENSE file in the root directory of
+ * this source tree.
+
+ * Distributed under the MIT License
+ * (license terms are at http://opensource.org/licenses/MIT).
+
+ * */
+ob_start();
+
+require_once("db.php");
+
+$path = basename($_SERVER['REQUEST_URI']);
+$file = basename($path);
+
+$fileName = basename($_SERVER['PHP_SELF']);
+
+if ($file == $fileName) {
+ header("Location: index.php?view=select");
+}
+
+function protect($string) {
+ $protection = htmlspecialchars(trim($string), ENT_QUOTES);
+ return $protection;
+}
+
+/* Get id table as first column */
+
+function getID($tble) {
+ global $link;
+ if (!empty(protect($_GET['tbl']))) {
+ $tble = protect($_GET['tbl']);
+ $query = "SELECT * from " . $tble;
+ if ($result = $link->query($query)) {
+ /* Get field information for first column */
+ $result->field_seek(0);
+ $deletemeta = $result->fetch_field();
+ return $deletemeta->name;
+ }
+ }
+}
+
+$view = protect($_GET['view']);
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ' . "\n";
+ echo '
' . "\n";
+ echo '' . "\n";
+ echo '' . "\n";
+ $sql = "SELECT * FROM $tble";
+ $result = $link->query($sql);
+ $i = 0;
+ while ($i < mysqli_num_fields($result)) {
+ $meta = mysqli_fetch_field($result);
+ $remp = str_replace("_", " ", $meta->name);
+ echo '' . ucfirst($remp) . ' | ' . "\n";
+ $i = $i + 1;
+ }
+ echo 'Add new | ' . "\n";
+ echo '
' . "\n";
+ echo '' . "\n";
+ echo '' . "\n";
+
+ while ($row = mysqli_fetch_row($result)) {
+ echo '' . "\n";
+ $count = count($row);
+ $y = 0;
+ while ($y < $count) {
+ $c_row = current($row);
+ if ($y == 0) {
+ echo '' . $c_row . ' | ' . "\n";
+ } else {
+ echo '' . $c_row . ' | ' . "\n";
+ }
+ next($row);
+ $y = $y + 1;
+ }
+
+ $i_row = $row[0];
+ echo '
+ Edit
+ Delete
+ | ';
+
+ echo '
' . "\n";
+ $i = $i + 1;
+ }
+ echo '' . "\n";
+ echo '
' . "\n";
+ echo '' . "\n";
+ ?>
+
+
+
+
+
+
+
+
+
+
+';
+ } else {
+ header("Location: index.php?view=select");
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+';
+ ?>
+
+
+
+
+
+
+
+
+
+ query($deletequery);
+ echo '
' . "\n";
+ }
+ ?>
+
+
+
+
+
+
+