forked from MichaelJendryke/NyxHyperion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a webbased representation of the DB tables and views
- Loading branch information
Michael Jendryke
committed
Dec 1, 2017
1 parent
dcf04b8
commit 50bf8ab
Showing
11 changed files
with
269 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
|
||
*.cfg | ||
|
||
website/config\.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
$host = 'localhost'; | ||
$port = '5432'; | ||
$database = 'DATABASE'; | ||
$user = 'USER'; | ||
$password = 'PASSWORD'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.hoverTable{ | ||
width:100%; | ||
border-collapse:collapse; | ||
} | ||
.hoverTable td{ | ||
padding:7px; border:#4e95f4 1px solid; | ||
} | ||
/* Define the default color for all the table rows */ | ||
.hoverTable tr{ | ||
background: #b8d1f3; | ||
} | ||
/* Define the hover highlight color for the table row */ | ||
.hoverTable tr:hover { | ||
background-color: #ffff99; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
#https://razorsql.com/articles/postgresql_column_names_values.html | ||
|
||
|
||
include("config.php"); | ||
|
||
$connectString = 'host=' . $host . ' port=' . $port . ' dbname=' . $database . | ||
' user=' . $user . ' password=' . $password; | ||
|
||
|
||
$link = pg_connect ($connectString); | ||
if (!$link) | ||
{ | ||
die('Error: Could not connect: ' . pg_last_error()); | ||
} | ||
|
||
|
||
$query = 'select * from images'; | ||
|
||
$result = pg_query($query); | ||
|
||
$i = 0; | ||
echo '<table class="hoverTable"><tr>'; | ||
while ($i < pg_num_fields($result)) | ||
{ | ||
$fieldName = pg_field_name($result, $i); | ||
echo '<td>' . $fieldName . '</td>'; | ||
$i = $i + 1; | ||
} | ||
echo '</tr>'; | ||
$i = 0; | ||
|
||
while ($row = pg_fetch_row($result)) | ||
{ | ||
echo '<tr>'; | ||
$count = count($row); | ||
$y = 0; | ||
while ($y < $count) | ||
{ | ||
$c_row = current($row); | ||
echo '<td>' . $c_row . '</td>'; | ||
next($row); | ||
$y = $y + 1; | ||
} | ||
echo '</tr>'; | ||
$i = $i + 1; | ||
} | ||
pg_free_result($result); | ||
|
||
echo '</table>'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
#https://razorsql.com/articles/postgresql_column_names_values.html | ||
|
||
|
||
include("config.php"); | ||
|
||
$connectString = 'host=' . $host . ' port=' . $port . ' dbname=' . $database . | ||
' user=' . $user . ' password=' . $password; | ||
|
||
|
||
$link = pg_connect ($connectString); | ||
if (!$link) | ||
{ | ||
die('Error: Could not connect: ' . pg_last_error()); | ||
} | ||
|
||
|
||
$query = 'select * from imagesummary'; | ||
|
||
$result = pg_query($query); | ||
|
||
$i = 0; | ||
echo '<table class="hoverTable"><tr>'; | ||
while ($i < pg_num_fields($result)) | ||
{ | ||
$fieldName = pg_field_name($result, $i); | ||
echo '<td>' . $fieldName . '</td>'; | ||
$i = $i + 1; | ||
} | ||
echo '</tr>'; | ||
$i = 0; | ||
|
||
while ($row = pg_fetch_row($result)) | ||
{ | ||
echo '<tr>'; | ||
$count = count($row); | ||
$y = 0; | ||
while ($y < $count) | ||
{ | ||
$c_row = current($row); | ||
echo '<td>' . $c_row . '</td>'; | ||
next($row); | ||
$y = $y + 1; | ||
} | ||
echo '</tr>'; | ||
$i = $i + 1; | ||
} | ||
pg_free_result($result); | ||
|
||
echo '</table>'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!doctype html> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>NyxHyperion Download Progress</title> | ||
<meta name="description" content="PostgreSQL Tables and Views"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<!--[if lt IE 9]> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script> | ||
<![endif]--> | ||
<script src="https://code.jquery.com/jquery-latest.js"></script> | ||
</head> | ||
<body> | ||
<a href="#" id="overview">Overview</a> | ||
<a href="#" id="orders">Orders</a> | ||
<a href="#" id="imagesummary">Image Summary</a> | ||
<a href="#" id="images">Images</a> | ||
<div id="tabledata"></div> | ||
<script src="js/script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
$("#overview").on("click", function(){ | ||
$("#tabledata").load("overview.php"); | ||
}); | ||
$("#orders").on("click", function(){ | ||
$("#tabledata").load("orders.php"); | ||
}); | ||
$("#imagesummary").on("click", function(){ | ||
$("#tabledata").load("imagesummary.php"); | ||
}); | ||
$("#images").on("click", function(){ | ||
$("#tabledata").load("images.php"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$( "#sample" ).load( "noaa.geoinsight.xyz/overview.php", function() { | ||
alert( "Load was performed." ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
#https://razorsql.com/articles/postgresql_column_names_values.html | ||
|
||
|
||
include("config.php"); | ||
|
||
$connectString = 'host=' . $host . ' port=' . $port . ' dbname=' . $database . | ||
' user=' . $user . ' password=' . $password; | ||
|
||
|
||
$link = pg_connect ($connectString); | ||
if (!$link) | ||
{ | ||
die('Error: Could not connect: ' . pg_last_error()); | ||
} | ||
|
||
|
||
$query = 'select * from orders'; | ||
|
||
$result = pg_query($query); | ||
|
||
$i = 0; | ||
echo '<table class="hoverTable"><tr>'; | ||
while ($i < pg_num_fields($result)) | ||
{ | ||
$fieldName = pg_field_name($result, $i); | ||
echo '<td>' . $fieldName . '</td>'; | ||
$i = $i + 1; | ||
} | ||
echo '</tr>'; | ||
$i = 0; | ||
|
||
while ($row = pg_fetch_row($result)) | ||
{ | ||
echo '<tr>'; | ||
$count = count($row); | ||
$y = 0; | ||
while ($y < $count) | ||
{ | ||
$c_row = current($row); | ||
echo '<td>' . $c_row . '</td>'; | ||
next($row); | ||
$y = $y + 1; | ||
} | ||
echo '</tr>'; | ||
$i = $i + 1; | ||
} | ||
pg_free_result($result); | ||
|
||
echo '</table>'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
include("config.php"); | ||
|
||
$connectString = 'host=' . $host . ' port=' . $port . ' dbname=' . $database . | ||
' user=' . $user . ' password=' . $password; | ||
|
||
|
||
$link = pg_connect ($connectString); | ||
if (!$link) | ||
{ | ||
die('Error: Could not connect: ' . pg_last_error()); | ||
} | ||
|
||
|
||
$query = 'select * from overview'; | ||
|
||
$result = pg_query($query); | ||
|
||
$i = 0; | ||
echo '<table class="hoverTable"><tr>'; | ||
while ($i < pg_num_fields($result)) | ||
{ | ||
$fieldName = pg_field_name($result, $i); | ||
echo '<td>' . $fieldName . '</td>'; | ||
$i = $i + 1; | ||
} | ||
echo '</tr>'; | ||
$i = 0; | ||
|
||
while ($row = pg_fetch_row($result)) | ||
{ | ||
echo '<tr>'; | ||
$count = count($row); | ||
$y = 0; | ||
while ($y < $count) | ||
{ | ||
$c_row = current($row); | ||
echo '<td>' . $c_row . '</td>'; | ||
next($row); | ||
$y = $y + 1; | ||
} | ||
echo '</tr>'; | ||
$i = $i + 1; | ||
} | ||
pg_free_result($result); | ||
|
||
echo '</table>'; | ||
?> |