-- http://www.phpmyadmin.net
--


--
-- Database: `elibrary`
--

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

--
-- Table structure for table `authors`
--

CREATE TABLE IF NOT EXISTS `authors` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

--
-- Dumping data for table `authors`
--

INSERT INTO `authors` (`id`, `name`, `description`) VALUES
(1, 'Chinua Achebe', 'The best in the 80s'),
(2, 'Chimamanda Adichie', 'Contemporary Female Author'),
(3, 'Ernest Ibe', 'Programmer and Graphics designer'),
(4, 'Dan Brown', 'Controversial author'),
(5, 'Daniel Humphrey', 'Sex author of the 90s'),
(6, 'Michael Bolton', 'Musician and author'),
(7, 'Chialuka Ubochi', 'My secondary school guy'),
(8, 'Maduabuchi Ubaka', 'crap'),
(9, 'Fool', ''),
(10, 'Mario Puzo', 'Awesome Author'),
(11, 'Mario Gongalez', 'Fake ass');

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

--
-- Table structure for table `books`
--

CREATE TABLE IF NOT EXISTS `books` (
  `id` int(11) NOT NULL auto_increment,
  `author_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `priority` int(5) NOT NULL,
  `pub_id` int(11) NOT NULL,
  `cat_id` int(11) NOT NULL,
  `cover_img` varchar(60) NOT NULL,
  `vend_id` int(11) default NULL,
  `book` varchar(60) default NULL,
  `year` varchar(10) default NULL,
  `description` text,
  `cost` varchar(20) NOT NULL default '0.00',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

--
-- Dumping data for table `books`
--

INSERT INTO `books` (`id`, `author_id`, `title`, `priority`, `pub_id`, `cat_id`, `cover_img`, `vend_id`, `book`, `year`, `description`, `cost`) VALUES
(1, 1, 'Chike and the River', 1, 1, 1, 'images/cover/d91b5dbac9.jpg', NULL, 'books/silver/d91b5dbac9.pdf', '1977', 'About A kid', '0.00'),
(2, 2, 'Tears of the sun', 2, 1, 1, 'images/cover/400827d776.jpg', NULL, 'books/gold/400827d776.pdf', '1997', 'This book is about the biafran war', '200'),
(3, 3, 'PHP for the soull', 2, 1, 2, 'images/cover/554f9bd000.jpg', NULL, 'books/gold/554f9bd000.pdf', '2010', 'Awesome book on the PHP scripting language', '300'),
(4, 3, 'Graphic Beta', 2, 1, 2, 'images/cover/e669c2fcda.jpg', 2, 'books/gold/e669c2fcda.pdf', '2010', 'Using graphics suites like dreamweaver and photoshop', '100'),
(5, 3, 'Chika dey crase', 0, 1, 2, 'images/cover/c7a3ae4e4b.png', 1, 'books/platinum/c7a3ae4e4b.pdf', '1960', 'Awesome book', '90000'),
(6, 5, 'Sex education', 0, 1, 3, 'images/cover/2f0d3b1d5d.jpg', 2, 'books/platinum/2f0d3b1d5d.pdf', '2001', 'This book is about sex', '300'),
(7, 4, 'Angels and Demons', 1, 1, 1, 'images/cover/edcc033e5f.jpg', 2, 'books/gold/edcc033e5f.pdf', '2006', '', '30'),
(8, 10, 'Great Hill', 2, 1, 4, 'images/cover/3edb313562.jpg', 2, 'books/platinum/3edb313562.pdf', '2008', 'Book writing', '400'),
(9, 10, 'The Vatican', 2, 1, 4, 'images/cover/2669563dd6.jpg', 2, 'books/platinum/2669563dd6.pdf', '2012', 'The book about cathokics', '200'),
(10, 8, 'Daily Manner', 1, 1, 3, 'images/cover/1f12acf3df.jpg', 1, 'books/gold/1f12acf3df.pdf', '1999', 'This is a christian book about life and awesme things', '300'),
(11, 1, 'Obodo Oma', 0, 1, 1, 'images/cover/a63f3695b5.jpeg', 1, 'books/silver/a63f3695b5.pdf', '1994', 'Folklore about a very nice town with creepy but awesome creatures that run things exponentially', '400');

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

--
-- Table structure for table `category`
--

CREATE TABLE IF NOT EXISTS `category` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(60) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `category`
--

INSERT INTO `category` (`id`, `name`, `description`) VALUES
(1, 'Fables', 'Tales of myth and legend'),
(2, 'Programming', 'Software and algorithms'),
(3, 'Life style', 'Entertainment, events and awesome things'),
(4, 'Thriller', 'awesome');

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

--
-- Table structure for table `chats`
--

CREATE TABLE IF NOT EXISTS `chats` (
  `id` int(11) NOT NULL auto_increment,
  `chat` text,
  `time_sent` datetime default NULL,
  `user_id` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=70 ;

--
-- Dumping data for table `chats`
--

INSERT INTO `chats` (`id`, `chat`, `time_sent`, `user_id`) VALUES
(2, 'My name is Jane', '2015-02-04 07:00:00', 7),
(3, 'Osas is my code', '2015-02-04 00:00:00', 8),
(6, 'Hey people i am motal king', '2015-02-04 00:00:00', 5),
(7, 'hey people', '2015-02-04 00:00:00', 5),
(9, 'Hey, Chima is here... Sup people?', '2015-02-04 00:00:00', 4),
(10, 'I think we need change ', '2015-02-04 00:00:00', 4),
(11, 'how are you all doing', '2015-02-05 00:00:00', 7),
(12, 'its a wonderful day', '2015-02-05 00:00:00', 8),
(13, 'hi i am new', '2015-02-05 00:00:00', 12),
(14, 'Good morning, sweet users', '2015-02-06 00:00:00', 10),
(15, 'wat&#039;s up mutherfuckers', '2015-02-07 00:00:00', 10),
(16, 'hgfchgcghcdgfgxh', '2015-02-07 00:00:00', 10),
(17, 'hey guys', '2015-02-08 00:00:00', 8),
(18, 'bucko', '2015-02-08 00:00:00', 8),
(19, 'bucko', '2015-02-08 00:00:00', 8),
(20, 'nsogbu', '2015-02-08 00:00:00', 10),
(21, 'craplet', '2015-02-08 00:00:00', 10),
(22, 'fuck', '2015-02-08 00:00:00', 10),
(23, 'fuck', '2015-02-08 00:00:00', 10),
(24, 'ebby', '2015-02-08 00:00:00', 10),
(25, 'tyryfyfytfyu', '2015-02-08 00:00:00', 10),
(26, 'Happy monday', '2015-02-09 00:00:00', 8),
(27, 'Jane don show', '2015-02-09 00:00:00', 7),
(28, 'Hey good people&#039;s people, admin don show', '2015-02-12 00:00:00', 10),
(29, 'what&#039;s up muthefuckers', '2015-02-12 00:00:00', 8),
(30, 'hey guys', '2015-02-17 00:00:00', 7),
(31, 'ok ooo', '2015-02-17 00:00:00', 7),
(32, 'crap', '2015-02-17 00:00:00', 7),
(33, 'wetin', '2015-02-17 00:00:00', 7),
(34, 'dxrs', '2015-02-17 00:00:00', 7),
(35, 'fthdrt', '2015-02-17 00:00:00', 7),
(36, 'love yall', '2015-02-17 00:00:00', 7),
(37, 'my guys', '2015-02-17 00:00:00', 7),
(38, 'money good ooo', '2015-02-17 00:00:00', 8),
(39, 'you too like money', '2015-02-17 00:00:00', 7),
(40, 'hey peeps', '2015-02-17 00:00:00', 7),
(41, 'sup muther', '0000-00-00 00:00:00', 7),
(42, 'lets see', '2015-02-17 10:04:30', 7),
(43, 'sup people', '2015-02-17 11:48:16', 7),
(44, 'hey', '2015-02-18 11:49:57', 7),
(45, 'cool poo', '2015-02-18 11:51:38', 7),
(46, 'xdfgxg', '2015-02-18 11:51:46', 7),
(47, 'hey people', '2015-02-18 11:54:32', 7),
(48, 'dgsrtsg', '2015-02-18 11:54:53', 7),
(49, 'one love', '2015-02-18 11:57:19', 7),
(50, 'hey', '2015-02-18 11:59:26', 7),
(51, 'cool', '2015-02-18 11:59:44', 7),
(52, 'coo', '2015-02-18 12:06:44', 7),
(53, 'gest4t5er45e', '2015-02-18 12:08:37', 7),
(54, 'dgeag', '2015-02-18 12:09:13', 7),
(55, 'rfthydyhd', '2015-02-18 12:09:41', 7),
(56, 'awegadfv', '2015-02-18 12:14:07', 7),
(57, 'fhdrgds', '2015-02-18 12:15:36', 7),
(58, 'jjdkbjksbks', '2015-02-18 12:16:23', 7),
(59, 'dfxthrd', '2015-02-18 12:16:54', 7),
(60, 'hey', '2015-02-18 12:24:26', 7),
(61, 'wefawer', '2015-02-18 12:24:33', 7),
(62, 'efgea', '2015-02-18 12:24:45', 7),
(63, 'edgar', '2015-02-18 12:25:29', 7),
(64, 'jdrkxdfezr', '2015-02-18 12:25:46', 7),
(65, 'mzdbmfdbzkmfn fvdz', '2015-02-18 12:30:51', 7),
(66, 'hey guys', '2015-02-18 12:31:13', 7),
(67, 'rgsrgdrt', '2015-02-18 16:36:19', 7),
(68, 'awessome crap', '2015-02-18 16:41:16', 7),
(69, 'good night folks', '2015-02-18 16:49:09', 7);

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

--
-- Table structure for table `comments`
--

CREATE TABLE IF NOT EXISTS `comments` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `comment` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `comments`
--


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

--
-- Table structure for table `description`
--

CREATE TABLE IF NOT EXISTS `description` (
  `id` int(11) NOT NULL auto_increment,
  `book_id` int(11) NOT NULL,
  `author_id` int(9) NOT NULL,
  `cat_id` int(11) NOT NULL,
  `pub_id` int(11) NOT NULL,
  `vend_id` int(9) NOT NULL,
  `desc` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `description`
--


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

--
-- Table structure for table `downloaded`
--

CREATE TABLE IF NOT EXISTS `downloaded` (
  `id` int(11) NOT NULL auto_increment,
  `book_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `counter` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `downloaded`
--

INSERT INTO `downloaded` (`id`, `book_id`, `user_id`, `counter`) VALUES
(1, 6, 8, 0),
(2, 6, 8, 0),
(3, 1, 15, 0),
(4, 1, 7, 0),
(5, 1, 7, 0),
(6, 1, 7, 0);

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

--
-- Table structure for table `events`
--

CREATE TABLE IF NOT EXISTS `events` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) default NULL,
  `description` text,
  `event_date` datetime default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `events`
--

INSERT INTO `events` (`id`, `title`, `description`, `event_date`) VALUES
(1, 'Book Launch', 'Hey guy&#039;s, KEC will be holding a book launch. Ensure your presence', '2015-02-12 00:00:00'),
(2, 'e-learning just got better', 'Our e-learning Center just impoved', '2015-02-17 00:00:00');

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

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

CREATE TABLE IF NOT EXISTS `messages` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `message` text NOT NULL,
  `message_time` datetime NOT NULL,
  `title` varchar(255) NOT NULL,
  `status` int(2) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

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

INSERT INTO `messages` (`id`, `user_id`, `message`, `message_time`, `title`, `status`) VALUES
(1, 7, 'Hey People, we have this awesome book by Dan Brown for our Gold users..... It has very awesome thrills and turns, sex and romance', '2015-02-10 00:00:00', 'New Book alert', 1),
(2, 16, 'Hey People, we have this awesome book by Dan Brown for our Gold users..... It has very awesome thrills and turns, sex and romance', '2015-02-10 00:00:00', 'New Book alert', 0),
(3, 16, 'we love you all.... Try to upgrade your subscription to enable us serve you better', '2015-02-12 00:00:00', 'hey guys', 0),
(4, 7, 'we love you all.... Try to upgrade your subscription to enable us serve you better', '2015-02-12 00:00:00', 'hey guys', 0);

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

--
-- Table structure for table `publishers`
--

CREATE TABLE IF NOT EXISTS `publishers` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `city` varchar(60) NOT NULL,
  `state` varchar(60) NOT NULL,
  `address` varchar(255) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `email` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `publishers`
--

INSERT INTO `publishers` (`id`, `name`, `city`, `state`, `address`, `phone`, `email`) VALUES
(1, 'Apress ', 'New Orleans', 'New Jersey', 'Silicon Valley', '12356', 'apress@yahoo.com'),
(2, '', '', '', '', '', '');

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

--
-- Table structure for table `searches`
--

CREATE TABLE IF NOT EXISTS `searches` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `book_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `vendor`
--

CREATE TABLE IF NOT EXISTS `vendor` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `address` varchar(255) NOT NULL,
  `city` varchar(60) NOT NULL,
  `state` varchar(60) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `email` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `vendor`
--

INSERT INTO `vendor` (`id`, `name`, `address`, `city`, `state`, `phone`, `email`) VALUES
(1, 'Collage Limited', 'New Haven', 'New Jersey', 'New Jersey', '09076576', 'collage@yahoo.com'),
(2, 'New Age ', 'Victoria Island', 'Lagos', 'Lagos', '23985', 'age@yahoo.com');

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

--
-- Table structure for table `views`
--

CREATE TABLE IF NOT EXISTS `views` (
  `id` int(11) NOT NULL auto_increment,
  `book_id` int(11) NOT NULL,
  `count` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=59 ;

--
-- Dumping data for table `views`
--

INSERT INTO `views` (`id`, `book_id`, `count`) VALUES
(1, 6, 3),
(2, 3, 3),
(3, 9, 3),
(4, 1, 3),
(5, 1, 3),
(6, 1, 3),
(7, 1, 3),
(8, 2, 3),
(9, 2, 3),
(10, 2, 3),
(11, 6, 3),
(12, 6, 3),
(13, 6, 3),
(14, 10, 3),
(15, 5, 3),
(16, 5, 3),
(17, 5, 3),
(18, 5, 3),
(19, 5, 3),
(20, 3, 3),
(21, 3, 3),
(22, 3, 3),
(23, 3, 3),
(24, 3, 3),
(25, 3, 3),
(26, 8, 3),
(27, 8, 3),
(28, 1, 3),
(29, 1, 3),
(30, 1, 3),
(31, 1, 3),
(32, 3, 3),
(33, 1, 3),
(34, 1, 3),
(35, 6, 3),
(36, 6, 3),
(37, 6, 3),
(38, 6, 3),
(39, 1, 3),
(40, 1, 3),
(41, 3, 3),
(42, 1, 3),
(43, 3, 3),
(44, 3, 3),
(45, 3, 3),
(46, 3, 3),
(47, 3, 3),
(48, 6, 3),
(49, 10, 3),
(50, 10, 3),
(51, 5, 3),
(52, 11, 3),
(53, 11, 3),
(54, 10, 3),
(55, 1, 3),
(56, 3, 3),
(57, 2, 3),
(58, 1, 3);

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

--
-- Table structure for table `wishlist`
--

CREATE TABLE IF NOT EXISTS `wishlist` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `book_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;

--
-- Dumping data for table `wishlist`
--

INSERT INTO `wishlist` (`id`, `user_id`, `book_id`) VALUES
(1, 0, 3),
(2, 0, 3),
(3, 0, 8),
(4, 0, 8),
(5, 0, 1),
(6, 0, 1),
(7, 7, 1),
(8, 7, 3),
(9, 7, 6),
(10, 7, 10),
(11, 7, 10),
(12, 7, 11),
(13, 8, 11),
(14, 10, 10),
(15, 10, 1),
(16, 10, 3);
