<?php

require 'include_elevforeningen_login.php';
$contact_array = $auth->getContact($_SESSION['contact_id']);
$debtor_client = new IntrafacePublic_Debtor_XMLRPC_Client($credentials, false);
$orders = $debtor_client->getDebtorList('order', $contact_array['id']);
$invoices = $debtor_client->getDebtorList('invoice', $contact_array['id']);
//$debtors = array_merge($orders, $invoices);
/*
if (count($debtors) > 0) {
    // Fremstiller en liste af koloner
    foreach ($debtors as $key => $row) {
       $date[$key]  = $row['this_date'];
    //   $edition[$key] = $row['edition'];
    }

    // Sorterer 'volume' data faldende og 'edition' stigende
    // Tilf�jer $data som den sidste parameter s� sorteringen sker direkte
    // i det array.
    array_multisort($date, SORT_DESC, $debtors);
}
*/
//$debtors = array_merge($orders, $invoices);
//print_r($orders);
/*
$contact = new ContactClient(array('private_key' => $private_key), true);
$contact_array = $contact->factory('code', $_GET['password']);
$contact_array = $contact->factory('email', '*****@*****.**');
*/
/*
if (!empty($contact_array['id']) AND $contact_array['id'] > 0) {