-- PhD Center Database Backup script
-- Powered by mysqldump-php https://github.com/ifsnop/mysqldump-php
--
-- Host: localhost	Database: phdcenter
-- ------------------------------------------------------
-- MySQL Server version: 	5.5.38-0ubuntu0.14.04.1
-- Backup from: Tue, 09 Dec 2014 20:19:23 +0200

--
-- Table structure for table `accounts`
--

CREATE TABLE `accounts` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created` int(11) NOT NULL,
  `name` text NOT NULL,
  `contactperson` text NOT NULL,
  `notes` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `accounts`
--

--
-- Table structure for table `accounts_data`
--

CREATE TABLE `accounts_data` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) NOT NULL,
  `user_id` int(11) NOT NULL,
  `service_id` int(11) NOT NULL,
  `service_text` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` float NOT NULL,
  `discard` int(11) NOT NULL,
  `timestamp` bigint(20) NOT NULL,
  `person_name` text NOT NULL,
  `notes` text NOT NULL,
  `document` int(11) NOT NULL DEFAULT '0',
  `deleted` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `accounts_data`
--

--
-- Table structure for table `documents`
--

CREATE TABLE `documents` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `account_id` bigint(20) NOT NULL,
  `person` varchar(255) NOT NULL,
  `user` bigint(20) NOT NULL,
  `timestamp` bigint(20) NOT NULL,
  `notes` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `documents`
--

--
-- Table structure for table `keys`
--

CREATE TABLE `keys` (
  `user` bigint(20) NOT NULL,
  `value` varchar(255) NOT NULL,
  `expiration` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `keys`
--

--
-- Table structure for table `log_data`
--

CREATE TABLE `log_data` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `service_id` int(11) NOT NULL,
  `service_text` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` float NOT NULL,
  `discard` int(11) NOT NULL,
  `timestamp` bigint(20) NOT NULL,
  `notes` text NOT NULL,
  `price_type` int(11) NOT NULL DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `log_data`
--

--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `timestamp` bigint(20) NOT NULL,
  `user` int(11) NOT NULL,
  `subject` varchar(255) NOT NULL DEFAULT '(none)',
  `message` text NOT NULL,
  `flag_important` int(11) NOT NULL,
  `response_to` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `messages`
--

--
-- Table structure for table `notes`
--

CREATE TABLE `notes` (
  `id` int(32) NOT NULL AUTO_INCREMENT,
  `owner` int(11) NOT NULL,
  `content` text NOT NULL,
  `color` varchar(255) NOT NULL,
  `timestamp` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `notes`
--

--
-- Table structure for table `pricelist`
--

CREATE TABLE `pricelist` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` text NOT NULL,
  `baseprice` double NOT NULL,
  `measure` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `pricelist`
--

INSERT INTO `pricelist` VALUES (1,'Печат А4','0.08','страница'),(2,'Копиране А4','0.05','страница'),(3,'Запис CD/DVD с носител','0.83','брой');
--
-- Table structure for table `usergroups`
--

CREATE TABLE `usergroups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `access_admin` int(11) NOT NULL DEFAULT '0',
  `access_pricelist` int(11) NOT NULL DEFAULT '0',
  `access_pricelist_add` int(11) NOT NULL DEFAULT '0' COMMENT 'Whether or not a user can add new items to the price list.',
  `access_rec` int(11) NOT NULL DEFAULT '0',
  `access_rec_add` int(11) NOT NULL DEFAULT '0',
  `access_users` int(11) NOT NULL DEFAULT '0',
  `access_users_create` int(11) NOT NULL DEFAULT '0',
  `access_accounts` int(11) NOT NULL DEFAULT '0',
  `access_accounts_new` int(11) NOT NULL DEFAULT '0',
  `access_accounts_addentries` int(11) NOT NULL DEFAULT '0',
  `access_accounts_delentries` int(11) NOT NULL DEFAULT '0',
  `access_documents_create` int(11) NOT NULL DEFAULT '0',
  `access_documents_edit` int(11) NOT NULL DEFAULT '0',
  `access_documents_delete` int(11) NOT NULL DEFAULT '0',
  `access_log_delete` int(11) NOT NULL DEFAULT '0' COMMENT 'Grants access to delete records in the log.',
  `access_log_restore` int(11) NOT NULL DEFAULT '0' COMMENT 'Grants access to restore deleted records in the log.',
  `access_backups` int(11) NOT NULL DEFAULT '0' COMMENT 'Grants access to the backup page.',
  `access_backups_create` int(11) NOT NULL DEFAULT '0' COMMENT 'Allows a user to backup the system.',
  `access_usergroups` int(11) NOT NULL DEFAULT '0',
  `access_usergroups_create` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `usergroups`
--

INSERT INTO `usergroups` VALUES (1,'Администратори',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),(2,'Оператори',1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,1,0),(3,'Външни потребители',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),(4,'Деактивирани',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
