/*
 * (C) 2001 Christian Jacobi
 * (C) 2001 Christoph Berg
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "db_records.h"
#include "help.h"

void dump_kunde(struct db_kunde* k)
{
  char created[50], last_contact[50];

  assert(k!=NULL);
    
  strcpy(created, asctime(&k->created));
  created[strlen(created)-1]=0; // remove \n
  strcpy(last_contact, asctime(&k->last_contact));
  last_contact[strlen(last_contact)-1]=0; // remove \n

  printf("Kunde nickname='%s', vorname='%s', nachname='%s', "
	 "kid=%d, email='%s', pw='%s', guthaben=%s, created=%s, "
	 "last_contact=%s, locked=%d\n",
	 k->nickname, k->vorname, k->nachname, k->kid,
	 k->email, k->pw, betrag2s(k->guthaben), created, 
	 last_contact, k->locked);
  
}

void dump_artikel(struct db_artikel* a)
{
  assert(a!=NULL);
  
  printf("artikel name='%s', aid=%d, preis=%s, anz=%d\n",
	 a->name, a->aid, betrag2s(a->preis), a->anz);
}
