First git push to github
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Create System Tables</title>
|
||||
<style>
|
||||
body {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
font-family: sans-serif;
|
||||
padding: 1em;
|
||||
}
|
||||
.log {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
define("INITIALIZATION_FILE_NAME", "../xml/settings.xml");
|
||||
|
||||
// Load Application Settings
|
||||
$applicationSettings = simplexml_load_file(INITIALIZATION_FILE_NAME);
|
||||
|
||||
if (empty($applicationSettings)) {
|
||||
echo "<div class='log'>❌ Unable to load Application Settings.</div>";
|
||||
exit();
|
||||
}
|
||||
|
||||
// Database Connection
|
||||
$host = (string) $applicationSettings->DatabaseServer;
|
||||
$database = (string) $applicationSettings->DatabaseName;
|
||||
$user = (string) $applicationSettings->DatabaseUser;
|
||||
$password = (string) $applicationSettings->DatabasePassword;
|
||||
|
||||
try {
|
||||
$connection = new PDO("mysql:host={$host};dbname={$database}", $user, $password);
|
||||
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
|
||||
// Disable foreign key checks temporarily
|
||||
$connection->exec("SET FOREIGN_KEY_CHECKS = 0");
|
||||
} catch (PDOException | Exception $e) {
|
||||
echo "<div class='log'>❌ Unable to connect to the database.<br/>Error: {$e->getMessage()}</div>";
|
||||
exit();
|
||||
}
|
||||
|
||||
// Get all table definition files
|
||||
$tableFiles = array_diff(scandir("."), ['.', '..', '_createSystemTable.php', '_createTable.php']);
|
||||
|
||||
foreach ($tableFiles as $tableFile) {
|
||||
$tableName = basename($tableFile, ".php");
|
||||
echo "<div class='log'>Processing <strong>{$tableName}</strong>...</div>";
|
||||
|
||||
try {
|
||||
$connection->exec("DROP VIEW IF EXISTS `view_{$tableName}`");
|
||||
} catch (PDOException $e) {
|
||||
echo "<div class='log'>⚠️ Error dropping view view_{$tableName}: {$e->getMessage()}</div>";
|
||||
}
|
||||
|
||||
try {
|
||||
$connection->exec("DROP TABLE IF EXISTS `{$tableName}`");
|
||||
} catch (PDOException $e) {
|
||||
echo "<div class='log'>⚠️ Error dropping table {$tableName}: {$e->getMessage()}</div>";
|
||||
}
|
||||
|
||||
$SQL = null;
|
||||
|
||||
if (!include $tableFile) {
|
||||
echo "<div class='log'>❌ Failed to include {$tableFile}. Skipping.</div>";
|
||||
continue;
|
||||
}
|
||||
|
||||
runSQL($SQL, $connection, $tableName);
|
||||
|
||||
switch ($tableFile) {
|
||||
case 'popovers.php':
|
||||
$sqlQueries = [
|
||||
// (same array from before)
|
||||
"INSERT INTO popovers (popover_name, popover_title, popover_placeholder, popover_text, popover_created, popover_creator)
|
||||
VALUES ('find_user', 'Find User', 'Find User...', '<p>Find by Name, Email, or Role</p>', CURDATE(), 'Init Script')",
|
||||
"INSERT INTO popovers (popover_name, popover_title, popover_placeholder, popover_text, popover_created, popover_creator)
|
||||
VALUES ('find_report', 'Find Report', 'Find Report...', '<p>Find by Name or Description</p>', CURDATE(), 'Init Script')",
|
||||
"INSERT INTO popovers (popover_name, popover_title, popover_placeholder, popover_text, popover_created, popover_creator)
|
||||
VALUES ('select_report', 'Select Report', 'Find Report...', '<p>Find by Name, Email, or Role</p>', CURDATE(), 'Init Script')",
|
||||
"INSERT INTO popovers (popover_name, popover_title, popover_placeholder, popover_text, popover_created, popover_creator)
|
||||
VALUES ('find_popover', 'Find Popover', 'Find Popover...', '<p>Find by Name, Title or Placeholder</p>', CURDATE(), 'Init Script')",
|
||||
"INSERT INTO popovers (popover_name, popover_title, popover_placeholder, popover_text, popover_created, popover_creator)
|
||||
VALUES ('find_journal', 'Find Journal', 'Find Journal...', '<p>Find by Name, Email, or Role</p>', CURDATE(), 'Init Script')",
|
||||
"INSERT INTO popovers (popover_name, popover_title, popover_placeholder, popover_text, popover_created, popover_creator)
|
||||
VALUES ('find_status', 'Find Status', 'Find Status...', '<p>Find by Name</p>', CURDATE(), 'Init Script')",
|
||||
"INSERT INTO popovers (popover_name, popover_title, popover_placeholder, popover_text, popover_created, popover_creator)
|
||||
VALUES ('find_dropdowntype', 'Find Dropdown Types', 'Find Dropdown Types...', '<p>Search for dropdown types</p>', CURDATE(), 'Init Script')"
|
||||
];
|
||||
|
||||
foreach ($sqlQueries as $sql) {
|
||||
runSQL($sql, $connection, "popovers data");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'users.php':
|
||||
$password = password_hash("349Jamot@", PASSWORD_DEFAULT);
|
||||
$sql = "INSERT INTO users (user_id, user_name, user_email, user_password, user_role, user_change_password, user_active, user_creator, user_created)
|
||||
VALUES ('jric11', 'James Richie', 'james.richie@onesourceits.com', '{$password}', 'Administrator', 0, 1, 'Init Script', CURDATE())";
|
||||
runSQL($sql, $connection, "initial admin user");
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing extra
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class='log'><strong>✅ System Tables Created.</strong></div>";
|
||||
|
||||
/**
|
||||
* Executes a SQL query and handles error output
|
||||
*/
|
||||
function runSQL($SQL, $connection, $context = 'query') {
|
||||
try {
|
||||
$connection->exec($SQL);
|
||||
} catch (PDOException $e) {
|
||||
echo "<div class='log'>❌ Error running {$context}: {$e->getMessage()}</div>";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,73 @@
|
||||
<style>
|
||||
body {
|
||||
background-color: #333333;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
// Simple Script to create a MySQL Table.
|
||||
|
||||
define("INITIALIZATION_FILE_NAME", "../xml/settings.xml");
|
||||
|
||||
// Retrieve the Table Name.
|
||||
|
||||
$table = (isset($_GET["table"])) ? $_GET["table"] : "";
|
||||
|
||||
if (empty($table)) {
|
||||
echo "No table name given. Table not created.";
|
||||
exit();
|
||||
}
|
||||
|
||||
if ((include "{$table}.php") != true) {
|
||||
echo "{$table}.php not found. Table not created.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Retrieve Application Settings
|
||||
|
||||
$applicationSettings = simplexml_load_file(INITIALIZATION_FILE_NAME);
|
||||
|
||||
if (empty($applicationSettings)) {
|
||||
echo "Unable to load Application Settings." . PHP_EOL;
|
||||
exit();
|
||||
}
|
||||
|
||||
// Connect to the Database.
|
||||
|
||||
$host = (string) $applicationSettings->DatabaseServer;
|
||||
$database = (string) $applicationSettings->DatabaseName;
|
||||
$user = (string) $applicationSettings->DatabaseUser;
|
||||
$password = (string) $applicationSettings->DatabasePassword;
|
||||
|
||||
try {
|
||||
$connection = new PDO("mysql:host={$host};dbname={$database}", $user, $password);
|
||||
$connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
|
||||
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException | Exception $e) {
|
||||
echo "Unable to connect to the database. <br/>";
|
||||
echo "Error is: {$e->getMessage()}";
|
||||
exit();
|
||||
}
|
||||
|
||||
// Create the table.
|
||||
|
||||
$connection->exec("set foreign_key_checks = 0");
|
||||
$connection->exec("drop table if exists {$table}");
|
||||
|
||||
try {
|
||||
$connection->exec($SQL);
|
||||
} catch (PDOException | Exception $e) {
|
||||
echo "Error creating table. <br/>";
|
||||
echo "Error is: {$e->getMessage()}";
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($connection->errorCode() != 0) {
|
||||
echo "Error creating table. <br/>";
|
||||
echo "<pre>";
|
||||
print_r($connection->errorInfo());
|
||||
} else {
|
||||
echo "Table {$table} was created.";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table alerts
|
||||
|
||||
(
|
||||
|
||||
alert_serial serial,
|
||||
alert_title varchar(100) default null,
|
||||
alert_started datetime default null,
|
||||
alert_expired datetime default null,
|
||||
alert_message varchar(1000) default null,
|
||||
|
||||
alert_creator varchar(100) default null,
|
||||
alert_created datetime default null,
|
||||
alert_changer varchar(100) default null,
|
||||
alert_changed datetime default null,
|
||||
|
||||
primary key (alert_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table businessfacts
|
||||
|
||||
(
|
||||
|
||||
businessfact_serial serial,
|
||||
businessfact_legacy_id bigint unsigned default null,
|
||||
businessfact_company varchar(100) default null,
|
||||
businessfact_address_one varchar(254) default null,
|
||||
businessfact_address_two varchar(254) default null,
|
||||
businessfact_city bigint unsigned default null, /* cities table */
|
||||
businessfact_state varchar(2) default null,
|
||||
businessfact_zip varchar(20) default null,
|
||||
businessfact_county bigint unsigned default null, /* counties table */
|
||||
businessfact_phone varchar(10) default null,
|
||||
businessfact_fax varchar(10) default null,
|
||||
businessfact_email_address varchar(250) default null,
|
||||
businessfact_business_class bigint unsigned default null, /* dropdowns table */
|
||||
businessfact_action bigint unsigned default null, /* dropdowns table */
|
||||
businessfact_employee_count bigint unsigned default null,
|
||||
businessfact_inception varchar(4) default null,
|
||||
businessfact_sic_code varchar(4) default null,
|
||||
businessfact_contact_name varchar(100) default null,
|
||||
businessfact_contact_title varchar(100) default null,
|
||||
businessfact_license_date date default null,
|
||||
businessfact_home_based_business varchar(1) default null,
|
||||
businessfact_year_established varchar(4) default null,
|
||||
businessfact_entry_date date default null,
|
||||
|
||||
businessfact_creator varchar(100) default null,
|
||||
businessfact_created datetime default null,
|
||||
businessfact_changer varchar(100) default null,
|
||||
businessfact_changed datetime default null,
|
||||
|
||||
primary key (businessfact_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table cities
|
||||
|
||||
(
|
||||
|
||||
city_serial serial,
|
||||
city_name varchar(100) default null,
|
||||
city_area varchar(100) default null,
|
||||
|
||||
city_creator varchar(100) default null,
|
||||
city_created datetime default null,
|
||||
city_changer varchar(100) default null,
|
||||
city_changed datetime default null,
|
||||
|
||||
primary key (city_serial),
|
||||
index (city_name)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table counties
|
||||
|
||||
(
|
||||
|
||||
county_serial serial,
|
||||
county_name varchar(100) default null,
|
||||
county_creator varchar(100) default null,
|
||||
county_created datetime default null,
|
||||
county_changer varchar(100) default null,
|
||||
county_changed datetime default null,
|
||||
|
||||
primary key (county_serial),
|
||||
index (county_name)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table dropdowns
|
||||
|
||||
(
|
||||
|
||||
dropdown_serial serial,
|
||||
dropdown_dropdowntype bigint unsigned default 0,
|
||||
dropdown_value varchar(100) default null,
|
||||
dropdown_default boolean default false,
|
||||
dropdown_active boolean default false,
|
||||
|
||||
dropdown_creator varchar(100) default null,
|
||||
dropdown_created datetime default null,
|
||||
dropdown_changer varchar(100) default null,
|
||||
dropdown_changed datetime default null,
|
||||
|
||||
primary key (dropdown_serial),
|
||||
unique key (dropdown_dropdowntype, dropdown_value),
|
||||
|
||||
foreign key (dropdown_dropdowntype)
|
||||
references dropdowntypes(dropdowntype_serial)
|
||||
on update cascade
|
||||
on delete restrict
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table dropdowntypes
|
||||
|
||||
(
|
||||
|
||||
dropdowntype_serial serial,
|
||||
dropdowntype_name varchar(100) default null,
|
||||
dropdowntype_title varchar(100) default null,
|
||||
dropdowntype_table varchar(100) default null,
|
||||
dropdowntype_column varchar(100) default null,
|
||||
|
||||
dropdowntype_creator varchar(100) default null,
|
||||
dropdowntype_created datetime default null,
|
||||
dropdowntype_changer varchar(100) default null,
|
||||
dropdowntype_changed datetime default null,
|
||||
|
||||
primary key (dropdowntype_serial),
|
||||
unique key (dropdowntype_name)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table exportjobs (
|
||||
|
||||
exportjob_serial serial,
|
||||
exportjob_export_code char(36) default null,
|
||||
exportjob_subscription bigint unsigned default null,
|
||||
exportjob_export_type varchar(255) default null,
|
||||
exportjob_status enum('queued','running','complete','failed') not null default 'queued',
|
||||
exportjob_file_name varchar(255) default null,
|
||||
exportjob_file_path varchar(1024) default null,
|
||||
exportjob_file_type varchar(10) default null,
|
||||
exportjob_notified boolean default false,
|
||||
exportjob_download_token varchar(1024) default null,
|
||||
exportjob_error_message text default null,
|
||||
exportjob_creator varchar(100) default null,
|
||||
exportjob_created datetime default null,
|
||||
exportjob_completed datetime default null,
|
||||
|
||||
primary key (exportjob_serial),
|
||||
unique key uq_export_job_code (exportjob_export_code),
|
||||
key idx_status_created (exportjob_status, exportjob_created),
|
||||
key idx_created_by (exportjob_creator),
|
||||
key idx_token (exportjob_download_token) )";
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table journal
|
||||
|
||||
(
|
||||
|
||||
journal_serial serial,
|
||||
journal_timestamp timestamp default current_timestamp,
|
||||
journal_origin varchar(100) default null,
|
||||
journal_ip varchar(128) default null,
|
||||
journal_entry varchar(1000) default null,
|
||||
|
||||
primary key (journal_serial),
|
||||
index (journal_timestamp)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table notes
|
||||
|
||||
(
|
||||
|
||||
note_serial serial,
|
||||
note_type varchar(20) default null,
|
||||
note_reference bigint unsigned default 0,
|
||||
note_text text,
|
||||
note_timestamp timestamp default current_timestamp on update current_timestamp,
|
||||
note_origin varchar(100) default null,
|
||||
|
||||
primary key (note_serial),
|
||||
index (note_type),
|
||||
index (note_reference),
|
||||
index (note_timestamp)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table permitfacts
|
||||
|
||||
(
|
||||
|
||||
permitfact_serial serial,
|
||||
permitfact_legacy_id bigint unsigned default null,
|
||||
permitfact_entry_date date default null,
|
||||
permitfact_permit_number varchar(100) default null,
|
||||
permitfact_permit_date date default null,
|
||||
permitfact_county bigint unsigned default null, /* counties table */
|
||||
|
||||
permitfact_project_address varchar(254) default null,
|
||||
permitfact_project_name varchar(100) default null,
|
||||
permitfact_project_type bigint unsigned default null, /* dropdowns table */
|
||||
permitfact_project_city bigint unsigned default null, /* cities table */
|
||||
permitfact_project_state varchar(2) default null,
|
||||
permitfact_project_zip varchar(20) default null,
|
||||
|
||||
permitfact_company varchar(100) default null,
|
||||
permitfact_address varchar(100) default null,
|
||||
permitfact_city bigint unsigned default null, /* cities table */
|
||||
permitfact_state varchar(2) default null,
|
||||
permitfact_zip varchar(20) default null,
|
||||
permitfact_phone varchar(10) default null,
|
||||
permitfact_size bigint unsigned default null,
|
||||
permitfact_value decimal(15,2) default null,
|
||||
|
||||
permitfact_work_type bigint unsigned default null, /* dropdowns table */
|
||||
permitfact_building_type bigint unsigned default null, /* dropdowns table */
|
||||
permitfact_lot_block varchar(100) default null,
|
||||
permitfact_dist_ll varchar(100) default null,
|
||||
|
||||
permitfact_owner_name varchar(100) default null,
|
||||
permitfact_owner_address varchar(254) default null,
|
||||
permitfact_owner_city bigint unsigned default null, /* cities table */
|
||||
permitfact_owner_state varchar(2) default null,
|
||||
permitfact_owner_zip varchar(20) default null,
|
||||
permitfact_owner_phone varchar(10) default null,
|
||||
|
||||
permitfact_creator varchar(100) default null,
|
||||
permitfact_created datetime default null,
|
||||
permitfact_changer varchar(100) default null,
|
||||
permitfact_changed datetime default null,
|
||||
|
||||
primary key (permitfact_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table popovers
|
||||
|
||||
(
|
||||
|
||||
popover_serial serial,
|
||||
popover_name varchar(100) default null,
|
||||
popover_title varchar(100) default null,
|
||||
popover_placeholder varchar(100) default null,
|
||||
popover_text varchar(1000) default null,
|
||||
popover_creator varchar(100) default null,
|
||||
popover_created datetime default null,
|
||||
popover_changer varchar(100) default null,
|
||||
popover_changed datetime default null,
|
||||
|
||||
primary key (popover_serial),
|
||||
unique key (popover_name)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table projecttypes
|
||||
|
||||
(
|
||||
|
||||
projecttype_serial serial,
|
||||
projecttype_name varchar(100) default null,
|
||||
|
||||
projecttype_creator varchar(100) default null,
|
||||
projecttype_created datetime default null,
|
||||
projecttype_changer varchar(100) default null,
|
||||
projecttype_changed datetime default null,
|
||||
|
||||
primary key (projecttype_serial),
|
||||
index (projecttype_name)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table projecttypes
|
||||
|
||||
(
|
||||
|
||||
projecttype_serial serial,
|
||||
projecttype_name varchar(100) default null,
|
||||
|
||||
projecttype_creator varchar(100) default null,
|
||||
projecttype_created datetime default null,
|
||||
projecttype_changer varchar(100) default null,
|
||||
projecttype_changed datetime default null,
|
||||
|
||||
primary key (projecttype_serial),
|
||||
index (projecttype_name)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table pzfacts
|
||||
|
||||
(
|
||||
|
||||
pzfact_serial serial,
|
||||
pzfact_legacy_id bigint unsigned default null,
|
||||
pzfact_entry_date date default null,
|
||||
pzfact_county bigint unsigned default null, /* counties table */
|
||||
|
||||
pzfact_professional_name varchar(100) default null,
|
||||
pzfact_professional_address varchar(254) default null,
|
||||
pzfact_professional_state varchar(2) default null,
|
||||
pzfact_professional_phone varchar(20) default null,
|
||||
pzfact_professional_fax varchar(20) default null,
|
||||
|
||||
pzfact_owner_name varchar(100) default null,
|
||||
pzfact_owner_address varchar(254) default null,
|
||||
pzfact_owner_state varchar(2) default null,
|
||||
pzfact_owner_phone varchar(20) default null,
|
||||
pzfact_owner_fax varchar(20) default null,
|
||||
|
||||
pzfact_project_name varchar(100) default null,
|
||||
pzfact_project_type bigint unsigned default null, /* dropdowns table */
|
||||
pzfact_project_description longtext default null,
|
||||
pzfact_project_address varchar(100) default null,
|
||||
pzfact_project_city bigint unsigned default null, /* cities table */
|
||||
|
||||
pzfact_action_code bigint unsigned default null, /* dropdowns table */
|
||||
pzfact_district varchar(100) default null,
|
||||
pzfact_land_lot varchar(100) default null,
|
||||
pzfact_lot varchar(100) default null,
|
||||
pzfact_block varchar(100) default null,
|
||||
pzfact_parcel_number varchar(250) default null,
|
||||
pzfact_action_date date default null,
|
||||
pzfact_acres decimal(10,4) default null,
|
||||
pzfact_status longtext default null,
|
||||
pzfact_dollar_value longtext default null,
|
||||
pzfact_estimated_ground_break varchar(100) default null,
|
||||
pzfact_in_city_limit boolean default false,
|
||||
|
||||
pzfact_creator varchar(100) default null,
|
||||
pzfact_created datetime default null,
|
||||
pzfact_changer varchar(100) default null,
|
||||
pzfact_changed datetime default null,
|
||||
|
||||
primary key (pzfact_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table reports
|
||||
|
||||
(
|
||||
|
||||
report_serial serial,
|
||||
report_class varchar(100) default null,
|
||||
report_name varchar(100) default null,
|
||||
report_description varchar(100) default null,
|
||||
report_type varchar(10) default null,
|
||||
report_target varchar(50) default null,
|
||||
report_creator varchar(100) default null,
|
||||
report_created datetime default null,
|
||||
report_changer varchar(100) default null,
|
||||
report_changed datetime default null,
|
||||
|
||||
primary key (report_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table searchhistories
|
||||
|
||||
(
|
||||
|
||||
searchhistory_serial serial,
|
||||
searchhistory_user bigint unsigned default null,
|
||||
searchhistory_subscription bigint unsigned default null,
|
||||
searchhistory_parameters longtext default null,
|
||||
|
||||
searchhistory_creator varchar(100) default null,
|
||||
searchhistory_created datetime default null,
|
||||
searchhistory_changer varchar(100) default null,
|
||||
searchhistory_changed datetime default null,
|
||||
|
||||
primary key (searchhistory_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table siccodes
|
||||
|
||||
(
|
||||
|
||||
siccode_serial serial,
|
||||
siccode_code varchar(10) default null,
|
||||
siccode_description text,
|
||||
|
||||
primary key (siccode_serial),
|
||||
index (siccode_code)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table subscriptioncities
|
||||
|
||||
(
|
||||
|
||||
subscriptioncity_serial serial,
|
||||
subscriptioncity_subscription bigint unsigned default null,
|
||||
subscriptioncity_city bigint unsigned default null,
|
||||
|
||||
subscriptioncity_creator varchar(100) default null,
|
||||
subscriptioncity_created datetime default null,
|
||||
subscriptioncity_changer varchar(100) default null,
|
||||
subscriptioncity_changed datetime default null,
|
||||
|
||||
primary key (subscriptioncity_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table subscriptioncounties
|
||||
|
||||
(
|
||||
|
||||
subscriptioncounty_serial serial,
|
||||
subscriptioncounty_subscription bigint unsigned default null,
|
||||
subscriptioncounty_county bigint unsigned default null,
|
||||
|
||||
subscriptioncounty_creator varchar(100) default null,
|
||||
subscriptioncounty_created datetime default null,
|
||||
subscriptioncounty_changer varchar(100) default null,
|
||||
subscriptioncounty_changed datetime default null,
|
||||
|
||||
primary key (subscriptioncounty_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table subscriptions
|
||||
|
||||
(
|
||||
|
||||
subscription_serial serial,
|
||||
subscription_title varchar(50) not null default '',
|
||||
subscription_service_level bigint unsigned default null,
|
||||
subscription_market bigint unsigned default null,
|
||||
|
||||
subscription_creator varchar(100) default null,
|
||||
subscription_created datetime default null,
|
||||
subscription_changer varchar(100) default null,
|
||||
subscription_changed datetime default null,
|
||||
|
||||
primary key (subscription_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table users
|
||||
|
||||
(
|
||||
|
||||
user_serial serial,
|
||||
user_id varchar(100) default null,
|
||||
user_name varchar(128) default null,
|
||||
user_email varchar(100) default null,
|
||||
user_client_name varchar(128) default null,
|
||||
user_password varchar(255) not null,
|
||||
user_role varchar(255) not null,
|
||||
user_change_password boolean default false,
|
||||
user_active boolean default true,
|
||||
user_login datetime default null,
|
||||
user_creator varchar(100) default null,
|
||||
user_created datetime default null,
|
||||
user_changer varchar(100) default null,
|
||||
user_changed datetime default null,
|
||||
|
||||
primary key (user_serial),
|
||||
unique key (user_name),
|
||||
index (user_name)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table usersubscriptions
|
||||
|
||||
(
|
||||
|
||||
usersubscription_serial serial,
|
||||
usersubscription_user bigint unsigned default 0,
|
||||
usersubscription_subscription bigint unsigned default 0,
|
||||
usersubscription_start_date date default null,
|
||||
usersubscription_stop_date date default null,
|
||||
|
||||
usersubscription_creator varchar(100) default null,
|
||||
usersubscription_created datetime default null,
|
||||
usersubscription_changer varchar(100) default null,
|
||||
usersubscription_changed datetime default null,
|
||||
|
||||
primary key (usersubscription_serial)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$SQL = "create table zipcodes
|
||||
|
||||
(
|
||||
|
||||
zipcode_serial serial,
|
||||
zipcode_code bigint not null default 0,
|
||||
zipcode_city varchar(50) not null default '',
|
||||
zipcode_state varchar(50) not null default '',
|
||||
zipcode_county varchar(50) not null default '',
|
||||
zipcode_country varchar(50) not null default '',
|
||||
|
||||
primary key (zipcode_serial),
|
||||
unique key (zipcode_code)
|
||||
|
||||
)
|
||||
|
||||
default character set = utf8";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user