From fba23ca163517597b67f4674f721d919470f3697 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 18 May 2015 12:36:04 +0200 Subject: Add functionality for changing, deleting and adding data --- categoryedit.php | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 categoryedit.php (limited to 'categoryedit.php') diff --git a/categoryedit.php b/categoryedit.php new file mode 100644 index 0000000..7a1bf59 --- /dev/null +++ b/categoryedit.php @@ -0,0 +1,75 @@ +findOneById($_GET['delete']); + } + if(isset($_GET['modify'])) + { + $type = 'modify'; + $category = CategoryQuery::create()->findOneById($_GET['modify']); + } + if(isset($_GET['add'])) + { + $type = "add"; + $category = new Category(); + } + if(!is_object($category)) + { + header('Location: categories.php'); + } + if(isset($_GET['delete'])) + { + $category->delete(); + header('Location: categories.php'); + } + if(isset($_POST['name']) && isset($_POST['desc'])) + { + $category->setName($_POST['name']); + $category->setDescription($_POST['desc']); + $category->save(); + header('Location: categories.php'); + } +?> + + + + +Category + + + + Back +
getId()}" ?>" method="post"> +

Category

+
+ +
+
+ + +
+
+   +
+ + +
+ + \ No newline at end of file -- cgit v1.2.3-70-g09d2