-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: donald.it-biz.nl
-- Generation Time: Jan 29, 2010 at 02:46 PM
-- Server version: 5.1.41
-- PHP Version: 5.3.1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `ac0003b`
--

-- --------------------------------------------------------

--
-- Table structure for table `tbladdress`
--

CREATE TABLE IF NOT EXISTS `tbladdress` (
  `naddressid` int(11) NOT NULL AUTO_INCREMENT,
  `cstreet` varchar(100) DEFAULT NULL,
  `cnumber` varchar(20) DEFAULT NULL,
  `czipcode` varchar(20) DEFAULT NULL,
  `ccity` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`naddressid`),
  UNIQUE KEY `naddressid` (`naddressid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tbladdress`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblafrekeningen`
--

CREATE TABLE IF NOT EXISTS `tblafrekeningen` (
  `nhouseid` int(11) NOT NULL,
  `dafrekeningen` date NOT NULL,
  `tafrekeningen` bigint(20) NOT NULL,
  `nadminid` int(11) NOT NULL,
  `nbetalerid` int(11) NOT NULL,
  `nontvangerid` int(11) NOT NULL,
  `mbedrag` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblafrekeningen`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblarchive`
--

CREATE TABLE IF NOT EXISTS `tblarchive` (
  `nuserid` int(11) NOT NULL,
  `dmove` date DEFAULT NULL,
  `mendbalance` double(7,2) DEFAULT NULL,
  `mpaid` double(7,2) DEFAULT NULL,
  `mplus` double(7,2) DEFAULT NULL,
  `mopen` double(7,2) DEFAULT NULL,
  `cbailpaid` tinytext,
  PRIMARY KEY (`nuserid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblarchive`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblbankaccount`
--

CREATE TABLE IF NOT EXISTS `tblbankaccount` (
  `nhouseid` int(11) NOT NULL,
  `cnumber` varchar(30) DEFAULT NULL,
  `cholder` varchar(100) DEFAULT NULL,
  `ccity` varchar(20) DEFAULT NULL,
  `ntype` tinyint(4) NOT NULL,
  `mbalance` double(6,2) NOT NULL,
  `dbalancedate` date NOT NULL,
  PRIMARY KEY (`nhouseid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblbankaccount`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblconnect`
--

CREATE TABLE IF NOT EXISTS `tblconnect` (
  `nuserid` int(11) NOT NULL,
  `cemail` varchar(150) NOT NULL,
  `cpassword` varchar(32) NOT NULL,
  `dlastlogin` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `nrights` bigint(4) NOT NULL,
  PRIMARY KEY (`nuserid`),
  UNIQUE KEY `cemail` (`cemail`),
  KEY `nuserid` (`nuserid`),
  KEY `cemail_2` (`cemail`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblconnect`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblcost`
--

CREATE TABLE IF NOT EXISTS `tblcost` (
  `ncostid` int(11) NOT NULL AUTO_INCREMENT,
  `ninputid` int(11) NOT NULL,
  `nbuyerid` int(11) NOT NULL,
  `nshopid` int(11) NOT NULL,
  `nfixedid` int(11) NOT NULL,
  `cdescription` varchar(100) NOT NULL,
  `mtotal` double(6,2) NOT NULL,
  `mperperson` double(6,2) NOT NULL,
  `dinput` date NOT NULL,
  `dcosts` date NOT NULL,
  `ntype` tinyint(4) NOT NULL,
  `nhouseid` bigint(20) NOT NULL,
  `deleted` tinyint(4) NOT NULL DEFAULT '0',
  `billed` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ncostid`,`ninputid`,`nbuyerid`,`nshopid`,`nfixedid`),
  UNIQUE KEY `ncostsid` (`ncostid`),
  KEY `ninputid` (`ninputid`),
  KEY `nbuyerid` (`nbuyerid`),
  KEY `nshopid` (`nshopid`),
  KEY `nfixedid` (`nfixedid`),
  KEY `ncostid` (`ncostid`,`nbuyerid`,`nhouseid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tblcost`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblfaq`
--

CREATE TABLE IF NOT EXISTS `tblfaq` (
  `faqid` int(11) NOT NULL AUTO_INCREMENT,
  `page` varchar(100) NOT NULL,
  `language` varchar(5) NOT NULL,
  `label` varchar(100) NOT NULL,
  `q` varchar(255) NOT NULL,
  `a` text NOT NULL,
  PRIMARY KEY (`faqid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tblfaq`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblfeedback`
--

CREATE TABLE IF NOT EXISTS `tblfeedback` (
  `naam` text NOT NULL,
  `email` text NOT NULL,
  `datum` date NOT NULL,
  `vraag` text NOT NULL,
  `debug` text NOT NULL,
  `rating` int(11) NOT NULL,
  `type` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblfeedback`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblfixed`
--

CREATE TABLE IF NOT EXISTS `tblfixed` (
  `nfixedid` int(11) NOT NULL AUTO_INCREMENT,
  `ninputid` int(11) NOT NULL,
  `cdescription` varchar(100) NOT NULL,
  `mtotal` double(6,2) NOT NULL,
  `nperiod` tinyint(4) NOT NULL,
  `dstart` date NOT NULL,
  `dend` date DEFAULT NULL,
  `dinput` date NOT NULL,
  `dlast` date DEFAULT NULL,
  PRIMARY KEY (`nfixedid`,`ninputid`),
  UNIQUE KEY `nfixedid` (`nfixedid`),
  KEY `ninputid` (`ninputid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tblfixed`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblfixeduser`
--

CREATE TABLE IF NOT EXISTS `tblfixeduser` (
  `nuserid` int(11) NOT NULL,
  `nfixedid` int(11) NOT NULL,
  PRIMARY KEY (`nuserid`,`nfixedid`),
  KEY `nfixedid` (`nfixedid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblfixeduser`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblgroup`
--

CREATE TABLE IF NOT EXISTS `tblgroup` (
  `ngroupid` int(11) NOT NULL AUTO_INCREMENT,
  `cname` varchar(100) NOT NULL,
  `cconstraints` varchar(20) NOT NULL,
  PRIMARY KEY (`ngroupid`),
  UNIQUE KEY `ngroupid` (`ngroupid`),
  UNIQUE KEY `cname` (`cname`),
  UNIQUE KEY `cconstraints` (`cconstraints`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `tblgroup`
--

INSERT INTO `tblgroup` (`ngroupid`, `cname`, `cconstraints`) VALUES
(1, 'studentenhuis', 'X'),
(2, 'sportvereniging', 'XX'),
(3, 'team', 'XXX'),
(4, 'studentenvereniging', 'XXXX'),
(5, 'dispuut', 'XXXXX'),
(6, 'jaarclub', 'XXXXXX'),
(7, 'vriendengroep', 'XXXXXXX');

-- --------------------------------------------------------

--
-- Table structure for table `tblhouse`
--

CREATE TABLE IF NOT EXISTS `tblhouse` (
  `nhouseid` int(11) NOT NULL AUTO_INCREMENT,
  `naddressid` int(11) NOT NULL,
  `ngroupid` int(11) NOT NULL,
  `cname` varchar(100) NOT NULL,
  `cclub` varchar(150) DEFAULT NULL,
  `tinfo` text,
  `nstatus` tinyint(4) NOT NULL,
  `cstreet` varchar(100) NOT NULL,
  `cnumber` varchar(20) NOT NULL,
  `czipcode` varchar(6) NOT NULL,
  `ccity` varchar(100) NOT NULL,
  `ccountry` varchar(3) NOT NULL DEFAULT 'NL',
  `dcreation` date NOT NULL,
  PRIMARY KEY (`nhouseid`,`naddressid`,`ngroupid`),
  UNIQUE KEY `nhouseid` (`nhouseid`),
  KEY `ngroupid` (`ngroupid`),
  KEY `naddressid` (`naddressid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tblhouse`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblmail`
--

CREATE TABLE IF NOT EXISTS `tblmail` (
  `nmailid` bigint(20) NOT NULL AUTO_INCREMENT,
  `dsend` date NOT NULL,
  `cto` varchar(255) NOT NULL,
  `csubject` mediumtext NOT NULL,
  `cbody` longtext NOT NULL,
  PRIMARY KEY (`nmailid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tblmail`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblnews`
--

CREATE TABLE IF NOT EXISTS `tblnews` (
  `nnewsid` int(11) NOT NULL AUTO_INCREMENT,
  `nnewsparentid` int(11) NOT NULL,
  `dinputdate` date NOT NULL,
  `dinputtime` time NOT NULL,
  `cheading` varchar(150) NOT NULL,
  `csubtitle` varchar(150) NOT NULL,
  `tmessage` text NOT NULL,
  `ntype` tinyint(4) NOT NULL,
  PRIMARY KEY (`nnewsid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tblnews`
--


-- --------------------------------------------------------

--
-- Table structure for table `tbloptions`
--

CREATE TABLE IF NOT EXISTS `tbloptions` (
  `nhouseid` int(11) NOT NULL,
  `ncleaning` varchar(4) NOT NULL,
  `nbeerlist` varchar(4) NOT NULL,
  `nnickname` varchar(4) NOT NULL,
  `neatlist` varchar(4) NOT NULL,
  `ngrocery` varchar(4) NOT NULL,
  `nmessageboard` varchar(4) NOT NULL,
  `ncalender` varchar(4) NOT NULL,
  `npic` varchar(4) NOT NULL,
  `ninbox` varchar(4) NOT NULL,
  PRIMARY KEY (`nhouseid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbloptions`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblshop`
--

CREATE TABLE IF NOT EXISTS `tblshop` (
  `nshopid` int(11) NOT NULL AUTO_INCREMENT,
  `nuserid` int(11) NOT NULL,
  `cshopname` varchar(100) NOT NULL,
  PRIMARY KEY (`nshopid`,`nuserid`),
  UNIQUE KEY `nshopid` (`nshopid`),
  KEY `nuserid` (`nuserid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tblshop`
--


-- --------------------------------------------------------

--
-- Table structure for table `tbluser`
--

CREATE TABLE IF NOT EXISTS `tbluser` (
  `nuserid` int(11) NOT NULL AUTO_INCREMENT,
  `cfirstname` varchar(100) NOT NULL,
  `clastname` varchar(100) NOT NULL,
  `cnickname` varchar(50) DEFAULT NULL,
  `dbirthday` date DEFAULT NULL,
  `cphone` varchar(15) DEFAULT NULL,
  `dcreation` date NOT NULL,
  `mbail` double(6,2) NOT NULL,
  `dbalance` date NOT NULL,
  `mbalance` double(6,2) DEFAULT NULL,
  `cfile` varchar(75) DEFAULT NULL,
  `ccomment` varchar(75) DEFAULT NULL,
  `tinfo` text,
  `nstatus` tinyint(4) NOT NULL,
  `tmodified` bigint(20) NOT NULL,
  PRIMARY KEY (`nuserid`),
  UNIQUE KEY `nuserid` (`nuserid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `tbluser`
--


-- --------------------------------------------------------

--
-- Table structure for table `tblusercost`
--

CREATE TABLE IF NOT EXISTS `tblusercost` (
  `nuserid` int(11) NOT NULL,
  `ncostid` int(11) NOT NULL,
  `mtotal` double(6,2) NOT NULL,
  `namount` tinyint(4) NOT NULL,
  `nhouseid` bigint(20) NOT NULL,
  PRIMARY KEY (`nuserid`,`ncostid`),
  KEY `ncostsid` (`ncostid`),
  KEY `nuserid` (`nuserid`,`ncostid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblusercost`
--


-- --------------------------------------------------------

--
-- Table structure for table `tbluserhouse`
--

CREATE TABLE IF NOT EXISTS `tbluserhouse` (
  `nhouseid` int(11) NOT NULL,
  `nuserid` int(11) NOT NULL,
  `nrights` smallint(4) NOT NULL DEFAULT '0',
  `djoined` date NOT NULL,
  `dleft` date NOT NULL,
  `inactive` tinyint(4) NOT NULL,
  `c_msaldo` varchar(255) NOT NULL,
  `c_lastcostid` int(11) NOT NULL,
  `c_recalculate` tinyint(4) NOT NULL,
  PRIMARY KEY (`nhouseid`,`nuserid`),
  KEY `nuserid` (`nuserid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbluserhouse`
--

