-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 09, 2023 at 07:53 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.34

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!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 utf8mb4 */;

--
-- Database: `farris_directory`
--

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int(11) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `image` varchar(50) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `listings` int(11) DEFAULT 0,
  `pageviews` int(11) DEFAULT 0,
  `last_post` bigint(20) DEFAULT 0,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `clicks`
--

CREATE TABLE `clicks` (
  `id` int(11) NOT NULL,
  `ip` varchar(15) DEFAULT NULL,
  `listing_id` int(11) DEFAULT 0,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `listings`
--

CREATE TABLE `listings` (
  `id` int(11) NOT NULL,
  `status` varchar(20) DEFAULT 'pending',
  `user_id` int(11) DEFAULT 0,
  `category_id` int(11) DEFAULT 0,
  `points` int(11) DEFAULT 0,
  `name` varchar(30) DEFAULT NULL,
  `image` varchar(50) DEFAULT '''default.png''',
  `description` varchar(255) DEFAULT NULL,
  `about` text DEFAULT NULL,
  `url` text DEFAULT NULL,
  `pageviews` int(11) DEFAULT 0,
  `clicks` int(11) DEFAULT 0,
  `last_click` bigint(20) DEFAULT 0,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT 0,
  `paypal` varchar(100) DEFAULT NULL,
  `points` int(11) DEFAULT 0,
  `amount` decimal(20,2) DEFAULT 0.00,
  `fee` decimal(10,2) DEFAULT 0.00,
  `status` varchar(20) DEFAULT NULL,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `pages`
--

CREATE TABLE `pages` (
  `id` int(11) NOT NULL,
  `name` varchar(30) DEFAULT NULL,
  `slug` varchar(30) DEFAULT NULL,
  `title` varchar(70) DEFAULT NULL,
  `keywords` varchar(100) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `content` text DEFAULT NULL,
  `last_update` bigint(20) DEFAULT 0,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `pageviews`
--

CREATE TABLE `pageviews` (
  `id` int(11) NOT NULL,
  `ip` varchar(15) DEFAULT NULL,
  `page` text DEFAULT NULL,
  `date_created` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `stats`
--

CREATE TABLE `stats` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT 0,
  `pageviews` int(11) DEFAULT 0,
  `clicks` int(11) DEFAULT 0,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(20) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `password` varchar(40) DEFAULT NULL,
  `image` varchar(25) DEFAULT 'default.png',
  `points` int(11) DEFAULT 0,
  `orders` int(11) DEFAULT 0,
  `listings` int(11) DEFAULT 0,
  `visits` int(11) DEFAULT 0,
  `this_day` int(1) DEFAULT 0,
  `this_week` int(1) DEFAULT 0,
  `this_month` int(1) DEFAULT 0,
  `last_post` bigint(20) DEFAULT 0,
  `last_seen` bigint(20) DEFAULT 0,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `_settings`
--

CREATE TABLE `_settings` (
  `website_name` varchar(50) DEFAULT NULL,
  `admin_password` varchar(42) DEFAULT NULL,
  `tracking_code` text DEFAULT NULL,
  `ads_code` text DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `paypal` varchar(100) DEFAULT NULL,
  `default_status` varchar(20) DEFAULT 'pending',
  `point_price` decimal(20,2) DEFAULT 0.01,
  `daily_points` int(11) DEFAULT 0,
  `daily_deducted` int(11) DEFAULT 0,
  `index_title` varchar(255) DEFAULT NULL,
  `register_title` varchar(255) DEFAULT NULL,
  `login_title` varchar(255) DEFAULT NULL,
  `submit_title` varchar(255) DEFAULT NULL,
  `categories_title` varchar(255) DEFAULT NULL,
  `dashboard_title` varchar(255) DEFAULT NULL,
  `stats_title` varchar(255) DEFAULT NULL,
  `points_title` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `_settings`
--

INSERT INTO `_settings` (`website_name`, `admin_password`, `tracking_code`, `ads_code`, `email`, `paypal`, `default_status`, `point_price`, `daily_points`, `daily_deducted`, `index_title`, `register_title`, `login_title`, `submit_title`, `categories_title`, `dashboard_title`, `stats_title`, `points_title`) VALUES
('FarrisDirectory', 'admin', '', '', 'farris@gmail.com', 'farris@gmail.com', 'approved', '0.01', 0, 0, 'Hello World', 'Hello World', 'Hello World', 'Hello World', 'Hello World', 'Hello World', 'Hello World', 'Hello World');

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

--
-- Table structure for table `_stats`
--

CREATE TABLE `_stats` (
  `id` int(11) NOT NULL,
  `users` int(11) DEFAULT 0,
  `visits` int(11) DEFAULT 0,
  `listings` int(11) DEFAULT 0,
  `points` int(11) DEFAULT 0,
  `pageviews` int(11) DEFAULT 0,
  `clicks` int(11) DEFAULT 0,
  `orders` int(11) DEFAULT 0,
  `earnings` decimal(20,2) DEFAULT 0.00,
  `date_created` bigint(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `clicks`
--
ALTER TABLE `clicks`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `listings`
--
ALTER TABLE `listings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pages`
--
ALTER TABLE `pages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pageviews`
--
ALTER TABLE `pageviews`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `stats`
--
ALTER TABLE `stats`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `_stats`
--
ALTER TABLE `_stats`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `clicks`
--
ALTER TABLE `clicks`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `listings`
--
ALTER TABLE `listings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `pages`
--
ALTER TABLE `pages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `pageviews`
--
ALTER TABLE `pageviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `stats`
--
ALTER TABLE `stats`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `_stats`
--
ALTER TABLE `_stats`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

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