a first draw of xml not finished yet
This commit is contained in:
parent
d9e8bc3347
commit
05eef451e0
|
@ -82,7 +82,7 @@
|
|||
"<td colspan='5' class='beschreibung'>" . htmlentities($row['nachfr_beschr']) . "</td>" .
|
||||
"</tr>";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</table>
|
||||
<div>
|
||||
<?php
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once("session.php");
|
||||
include 'config.php';
|
||||
require_once("config.php");
|
||||
require_once("class.user.php");
|
||||
$auth_user = new USER();
|
||||
|
||||
|
@ -32,12 +32,15 @@
|
|||
<th>Qualität</th>
|
||||
<th>Lieferung</th>
|
||||
<th>Angebot</th>
|
||||
<th colspan="2">Günstigstes Angebot</th>
|
||||
<th colspan="2">Alle Angebote vom Günstigsten zum Teuersten</th>
|
||||
<?php
|
||||
foreach ($db->query("SELECT * FROM nachfrager
|
||||
foreach ($db->query("
|
||||
SELECT * FROM nachfrager
|
||||
LEFT JOIN anbieter
|
||||
ON nachfrager.erfassungs_id = anbieter.erfassungs_id
|
||||
WHERE nachfrager.benutzer_id = $user_id") as $row) {
|
||||
WHERE nachfrager.benutzer_id = $user_id
|
||||
ORDER BY anbieter.angebot_preis ASC
|
||||
") as $row) {
|
||||
echo
|
||||
"<tr>" .
|
||||
"<td>" . substr(htmlentities($row['nachfr_datum']),0,10) . " " . "</td>" .
|
||||
|
@ -54,9 +57,11 @@
|
|||
}
|
||||
if (!empty(htmlentities($row['angebot_preis']))) {
|
||||
echo
|
||||
"<td>" . "<form method='post' action='".$_SERVER['PHP_SELF']."'>" .
|
||||
"<input class='sbtn' type='button' name='annehmen' value='Angebot annehmen' />" .
|
||||
"</form>" .
|
||||
"<td>" .
|
||||
"<form method='GET' action='". "xml2.php" ."'>" .
|
||||
"<input type='hidden' name='angebot_id' value='".htmlentities($row['angebot_id'])."'/>" .
|
||||
"<input class='sbtn' type='submit' name='annehmen' value='Angebot annehmen' />" .
|
||||
"</form>" .
|
||||
"</td>" .
|
||||
"</tr>";
|
||||
} else {
|
||||
|
|
|
@ -58,7 +58,7 @@ if (isset($_GET['keywords'])) {
|
|||
<th>Lieferdatum</th>
|
||||
<?php
|
||||
if ($query->rowCount()) {
|
||||
while ($row = $query->fetch()) {
|
||||
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
echo
|
||||
"<tr>" .
|
||||
"<td>" . substr(htmlentities($row['nachfr_datum']),0,10) . " " . "</td>" .
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
require_once("config.php");
|
||||
//Creates XML string and XML document using the DOM
|
||||
$dom = new DomDocument('1.0', 'UTF-8');
|
||||
|
||||
if (isset($_GET['angebot_id'])) {
|
||||
$angebot_id = $_GET['angebot_id'];
|
||||
$query = $db->query("
|
||||
SELECT * FROM nachfrager
|
||||
RIGHT OUTER JOIN anbieter
|
||||
ON nachfrager.erfassungs_id=anbieter.erfassungs_id
|
||||
WHERE anbieter.angebot_id=$angebot_id
|
||||
");
|
||||
} else {
|
||||
echo "ein problem ist aufgetreten.";
|
||||
break;
|
||||
}
|
||||
//add root == artikel
|
||||
$artikel = $dom->appendChild($dom->createElement('artikel'));
|
||||
while ($result_array = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
//loop through each key,value pair in row
|
||||
foreach($result_array as $key => $value) {
|
||||
//$key holds the table column name
|
||||
|
||||
|
||||
//add track element to jukebox
|
||||
$keys = $dom->createElement($key,$value);
|
||||
$artikel->appendChild($keys);
|
||||
|
||||
}
|
||||
}
|
||||
$dom->formatOutput = true; // set the formatOutput attribute of domDocument to true
|
||||
|
||||
// save XML as string or file
|
||||
$test1 = $dom->saveXML(); // put string in test1
|
||||
echo $test1;
|
||||
//$dom->save('test1.xml'); // save as file
|
||||
?>
|
Loading…
Reference in New Issue