From e06029066d32291053e8cdc6fdcb1cf8db62ab8d Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 20 Feb 2017 22:39:43 +0100 Subject: [PATCH] remove some unnecessary parts --- add_demand.php | 9 ++++----- edit_demand.php | 3 +-- functions.php | 16 ++++++++-------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/add_demand.php b/add_demand.php index f50f939..b3f4651 100644 --- a/add_demand.php +++ b/add_demand.php @@ -34,9 +34,7 @@ date_default_timezone_set('Europe/Amsterdam');

New entry

- - +
Title

Quality
@@ -55,8 +53,9 @@ date_default_timezone_set('Europe/Amsterdam');
- "; - ?>
+ diff --git a/edit_demand.php b/edit_demand.php index 37a5f2e..08c97e8 100644 --- a/edit_demand.php +++ b/edit_demand.php @@ -41,8 +41,7 @@ date_default_timezone_set('Europe/Amsterdam'); $title= $_POST['title']; $text = $_POST['text']; - echo - "
+ echo "

Maximum required pieces
diff --git a/functions.php b/functions.php index 511bcf6..651eafe 100644 --- a/functions.php +++ b/functions.php @@ -57,7 +57,7 @@ function register () } //A function to read out the userId of the current user -function get_userid ($con) +function get_userid () { global $con; session_start(); @@ -69,11 +69,11 @@ function get_userid ($con) } // A function to post a demand -function post_demand ($con) +function post_demand () { if (isset($_POST['submit'])) { global $con; - $userId = get_userid($con); + $userId = get_userid(); $piecesMax = $_POST['piecesMax']; $piecesMin = $_POST['piecesMin']; $qualityId = $_POST['quality']; @@ -95,7 +95,7 @@ function post_demand ($con) } // A function to insert the own posts from the database into the website -function get_demand_titles ($con) +function get_demand_titles () { global $con; $sql = "SELECT * FROM demands"; @@ -106,7 +106,7 @@ function get_demand_titles ($con) echo $row['date'] . "
"; echo "

+ action='".delete_demand()."'>
@@ -126,7 +126,7 @@ function get_demand_titles ($con) // A function to edit a demand -function edit_demand ($con) +function edit_demand () { if (isset($_POST['edit'])) { global $con; @@ -154,7 +154,7 @@ function edit_demand ($con) } } // A function to delete a post -function delete_demand($con) +function delete_demand() { if (isset($_POST['deletepost'])) { global $con; @@ -166,4 +166,4 @@ function delete_demand($con) header('Location: board.php'); } } -?> \ No newline at end of file +?>