<?php

// local server
// $con = mysqli_connect("localhost", "root", "", "satoshiclub_db");

// live server
$con = mysqli_connect("localhost", "buycomme_graphics", "Q=Fu%yc.g7q?", "buycomme_satoshigraphics");

// CREATING TABLES
// ev_events
$ev_events_sql = 'CREATE TABLE `ev_events` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    `description` longtext NOT NULL,
    `coin_logo` varchar(100) NOT NULL,
    `coin_shortname` varchar(100) NOT NULL,
    `coin_fullname` varchar(100) NOT NULL,
    `date` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $ev_events_sql);

// ev_time
$ev_time_sql = 'CREATE TABLE `ev_time` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `month` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4
   ';

mysqli_query($con, $ev_time_sql);

// nc_exchange
$nc_exchange_sql = 'CREATE TABLE `nc_exchange` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    `total_sold` varchar(100) NOT NULL,
    `logo` varchar(100) NOT NULL,
    `percentage_change` varchar(100) NOT NULL,
    `name_with_logo` tinyint(1) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $nc_exchange_sql);

// nc_verticalaxis
$nc_verticalaxis_sql = 'CREATE TABLE `nc_verticalaxis` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `max_value` varchar(100) NOT NULL,
    `gap_between_values` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4
   ';

mysqli_query($con, $nc_verticalaxis_sql);

// nc_timerange
$nc_timerange_sql = 'CREATE TABLE `nc_timerange` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `timerange` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $nc_timerange_sql);

// nc_exchangeslist
$nc_exchangeslist_sql = 'CREATE TABLE `nc_exchangeslist` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    `logo` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $nc_exchangeslist_sql);

//np_content
$np_content_sql = 'CREATE TABLE `np_content` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(100) NOT NULL,
    `description` longtext NOT NULL,
    `date` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $np_content_sql);

// np_partners
$np_partners_sql = 'CREATE TABLE `np_partners` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `coin_name` varchar(100) NOT NULL,
    `coin_logo` varchar(100) NOT NULL,
    `coin_placeholder_logo` varchar(100) NOT NULL,
    `coin_placeholder_shortname` varchar(100) NOT NULL,
    `twitter_id` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4
   ';

mysqli_query($con, $np_partners_sql);

// pcl_exchange
$pcl_exchange_sql = 'CREATE TABLE `pcl_exchange` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    `total_sold` varchar(100) NOT NULL,
    `max_value` varchar(100) NOT NULL,
    `logo` varchar(100) NOT NULL,
    `percentage_change` varchar(100) NOT NULL,
    `gap_between_values` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $pcl_exchange_sql);

// pcl_timerange
$pcl_timerange_sql = 'CREATE TABLE `pcl_timerange` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `timerange` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $pcl_timerange_sql);

// pcl_exchangeslist
$pcl_exchangeslist_sql = 'CREATE TABLE `pcl_exchangeslist` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    `logo` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4';

mysqli_query($con, $pcl_exchangeslist_sql);

// ama series

// $ama_series_sql_del = 'DROP TABLE `ama_series`';

// mysqli_query($con, $ama_series_sql_del);

$ama_series_sql = 'CREATE TABLE `ama_series` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `date` varchar(100) NOT NULL,
    `time` varchar(100) NOT NULL,
    `telegram_acc` varchar(100) NOT NULL,
    `project_logo` varchar(100) NOT NULL,
    `project_name` varchar(100) NOT NULL,
    `prize_pool` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4
   ';

mysqli_query($con, $ama_series_sql);
