Remove the amounts and text fields from the board view.
The board view should provide an overview over the available requests for further selection.
This commit is contained in:
parent
4871de62d3
commit
c407495893
|
@ -34,7 +34,7 @@ date_default_timezone_set('Europe/Amsterdam');
|
||||||
<div>
|
<div>
|
||||||
<h2>Open Requests</h2>
|
<h2>Open Requests</h2>
|
||||||
<?php
|
<?php
|
||||||
pbget($con);
|
get_post_titles($con);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -38,16 +38,16 @@ date_default_timezone_set('Europe/Amsterdam');
|
||||||
$demandId = $_POST['demandId'];
|
$demandId = $_POST['demandId'];
|
||||||
$piecesMax = $_POST['piecesMax'];
|
$piecesMax = $_POST['piecesMax'];
|
||||||
$piecesMin = $_POST['piecesMin'];
|
$piecesMin = $_POST['piecesMin'];
|
||||||
$date = $_POST['date'];
|
$title= $_POST['title'];
|
||||||
$text = $_POST['text'];
|
$text = $_POST['text'];
|
||||||
|
|
||||||
echo
|
echo
|
||||||
"<form method='POST' action='".editpost($con)."'>
|
"<form method='POST' action='".editpost($con)."'>
|
||||||
|
<input type='text' name='title' value='".$title."'><br>
|
||||||
<input type='hidden' name='userId' value='".$userId."'>
|
<input type='hidden' name='userId' value='".$userId."'>
|
||||||
<input type='hidden' name='demandId' value='".$demandId."'><br /> Maximum<br/>
|
<input type='hidden' name='demandId' value='".$demandId."'><br /> Maximum<br/>
|
||||||
<input type='number' name='piecesMax' value='".$piecesMax."'> <br /> Minimum<br/>
|
<input type='number' name='piecesMax' value='".$piecesMax."'> <br /> Minimum<br/>
|
||||||
<input type='number' name='piecesMin' value='".$piecesMin."'>
|
<input type='number' name='piecesMin' value='".$piecesMin."'>
|
||||||
<input type='hidden' name='date' value='".$date."'>
|
|
||||||
<br /> Produktbeschreibung<br/>
|
<br /> Produktbeschreibung<br/>
|
||||||
<textarea name='text'>".$text."</textarea><br />
|
<textarea name='text'>".$text."</textarea><br />
|
||||||
<button type='submit' name='edit'>Edit</button>
|
<button type='submit' name='edit'>Edit</button>
|
||||||
|
|
|
@ -89,17 +89,15 @@ function pbinsert ($con)
|
||||||
}
|
}
|
||||||
|
|
||||||
// A function to insert the own posts from the database into the website
|
// A function to insert the own posts from the database into the website
|
||||||
function pbget($con)
|
function get_post_titles($con)
|
||||||
{
|
{
|
||||||
global $con;
|
global $con;
|
||||||
$sql = "SELECT * FROM demands";
|
$sql = "SELECT * FROM demands";
|
||||||
$result = mysqli_query($con, $sql);
|
$result = mysqli_query($con, $sql);
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
echo "<div class='post-box'><p>";
|
echo "<div class='post-box'><p>";
|
||||||
|
echo "<strong>" . $row['demandTitle'] . "</strong>" . "<br>";
|
||||||
echo $row['date'] . "<br>";
|
echo $row['date'] . "<br>";
|
||||||
echo $row['demandText'] ."<br>" , "<br /> Maximum<br/>";
|
|
||||||
echo $row['piecesMax'] ."<br /> Minimum<br/>";
|
|
||||||
echo $row['piecesMin'];
|
|
||||||
echo "</p>
|
echo "</p>
|
||||||
<form class= 'delete-form' method= 'POST' action='".deletepost($con)."'>
|
<form class= 'delete-form' method= 'POST' action='".deletepost($con)."'>
|
||||||
<input type='hidden' name='demandId' value='".$row['demandId']."'>
|
<input type='hidden' name='demandId' value='".$row['demandId']."'>
|
||||||
|
@ -111,7 +109,7 @@ function pbget($con)
|
||||||
<input type='hidden' name='demandId' value='".$row['demandId']."'>
|
<input type='hidden' name='demandId' value='".$row['demandId']."'>
|
||||||
<input type='hidden' name='piecesMax' value='".$row['piecesMax']."'>
|
<input type='hidden' name='piecesMax' value='".$row['piecesMax']."'>
|
||||||
<input type='hidden' name='piecesMin' value='".$row['piecesMin']."'>
|
<input type='hidden' name='piecesMin' value='".$row['piecesMin']."'>
|
||||||
<input type='hidden' name='date' value='".$row['date']."'>
|
<input type='hidden' name='title' value='".$row['demandTitle']."'>
|
||||||
<input type='hidden' name='text' value='".$row['demandText']."'>
|
<input type='hidden' name='text' value='".$row['demandText']."'>
|
||||||
<button>Edit</button>
|
<button>Edit</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -128,12 +126,14 @@ function editpost($con)
|
||||||
$demandId = $_POST['demandId'];
|
$demandId = $_POST['demandId'];
|
||||||
$piecesMax = $_POST['piecesMax'];
|
$piecesMax = $_POST['piecesMax'];
|
||||||
$piecesMin = $_POST['piecesMin'];
|
$piecesMin = $_POST['piecesMin'];
|
||||||
|
$title = $_POST['title'];
|
||||||
$text = $_POST['text'];
|
$text = $_POST['text'];
|
||||||
|
|
||||||
// Inserts Updates Database
|
// Inserts Updates Database
|
||||||
$sql = "UPDATE demands
|
$sql = "UPDATE demands
|
||||||
SET piecesMax='$piecesMax',
|
SET piecesMax='$piecesMax',
|
||||||
piecesMin='$piecesMin',
|
piecesMin='$piecesMin',
|
||||||
|
demandTitle='$title',
|
||||||
demandText='$text'
|
demandText='$text'
|
||||||
WHERE demandId='$demandId'";
|
WHERE demandId='$demandId'";
|
||||||
$result = mysqli_query($con, $sql) or die(mysqli_error($con));
|
$result = mysqli_query($con, $sql) or die(mysqli_error($con));
|
||||||
|
|
Loading…
Reference in New Issue