45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
/** loads all customers
|
|
*
|
|
* @version 2.0.0
|
|
* @since 2008-02-13
|
|
* @author Martin Lenzelbauer
|
|
*/
|
|
|
|
define("ROOT", "../");
|
|
require_once(ROOT."include/config.inc.php");
|
|
require_once(ROOT."include/db.inc.php");
|
|
require_once(ROOT."include/xml.inc.php");
|
|
|
|
|
|
switch($_GET['action']){
|
|
case "loadCustomers": loadCustomers();
|
|
break;
|
|
}
|
|
|
|
|
|
/** loads customer data
|
|
*/
|
|
############################################
|
|
function loadCustomers(){
|
|
############################################
|
|
|
|
$xml = '<?xml version="1.0" encoding="utf-8"?>';
|
|
$xml .= '<customers>';
|
|
|
|
$query = sprintf("SELECT id, surname, firstname, address, zip, city FROM bruckmuehle_ticketcustomer ORDER BY surname ASC, firstname ASC");
|
|
$result = dbQuery($query);
|
|
while($line = mysqli_fetch_array($result, MYSQLI_ASSOC)){
|
|
$xml .= '<customer id="' . $line['id'] . '" firstname="' . xmlstring($line['firstname']) . '" surname="' . xmlstring($line['surname']) . '" ';
|
|
$xml .= 'address="' . xmlstring($line['address']) . '" zip="' . xmlstring($line['zip']) . '" city="' . xmlstring($line['city']) . '" />';
|
|
}
|
|
|
|
$xml .= '</customers>';
|
|
|
|
header('Content-Type: text/xml');
|
|
echo $xml;
|
|
|
|
}
|
|
|
|
|
|
?>
|