From cb3e57d6ea08091671743de0a7d922732f9c0ca3 Mon Sep 17 00:00:00 2001 From: nearwood Date: Wed, 15 Oct 2014 17:11:23 -0400 Subject: [PATCH] some css and shit. --- db.php | 28 +++++++++++++++++++++++++--- footer.php | 2 +- header.php | 20 +++++++++++--------- index.php | 17 ++++++----------- msqur.css | 44 +++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 86 insertions(+), 25 deletions(-) diff --git a/db.php b/db.php index 47eb900..1de8389 100644 --- a/db.php +++ b/db.php @@ -9,14 +9,33 @@ function connect() } catch(PDOException $e) { - echo '
Error connecting to database.
'; //$e->getMessage(); + echo '
Error connecting to database.
'; //$e->getMessage(); + $db = null; //Redundant. } return $db; } -function addFile($db, $file) +function addFiles($files) { + $db = connect(); + if ($db == null) return null; + + foreach ($files as $file) + { + //echo 'Adding ' . $file['tmp_name']; + addFile($file); + } +} + +function addFile($file, $db = null) +{ + if ($db == null) + { + $db = connect(); + if ($db == null) return null; + } + try { //TODO Compress? @@ -41,6 +60,9 @@ function addFile($db, $file) function getMSQ($db, $id) { + $db = connect(); + if ($db == null) return null; + try { $st = $db->prepare("SELECT msqs.xml FROM msqs INNER JOIN metadata ON metadata.msq = msqs.id WHERE metadata.id = :id"); @@ -56,4 +78,4 @@ function getMSQ($db, $id) if (!$result) return null; else return $result['xml']; } -?> \ No newline at end of file +?> diff --git a/footer.php b/footer.php index e03cca2..9ad136d 100644 --- a/footer.php +++ b/footer.php @@ -1,5 +1,5 @@ diff --git a/header.php b/header.php index 826d8fe..bfbd63b 100644 --- a/header.php +++ b/header.php @@ -12,12 +12,14 @@ - \ No newline at end of file + + diff --git a/index.php b/index.php index fd5a786..69ac3c9 100644 --- a/index.php +++ b/index.php @@ -58,15 +58,14 @@ require('header.php');
Upload successful
-
+ ' . count($files) . ' files were uploaded.'; + addFiles($files); } } ?> - \ No newline at end of file + + diff --git a/msqur.css b/msqur.css index c845d4f..06d6748 100644 --- a/msqur.css +++ b/msqur.css @@ -1,3 +1,45 @@ +* { + font-family: "Verdana", sans-serif; +} + +div.error { + color: red; +} + +div.warning { + color: yellow; +} + +div.info { + color: green; +} + +div.debug { + color: dark-gray; +} + +div#navigation { + background: #333; + color: white; + padding: 8px 24px 8px 24px; +} + +div#navigation span { + + font-weight: bold; + padding: 0px 8px 0px 8px; +} + +div.footer { + font-size: 0.66em; + text-align: right; + color: light-gray; + position: fixed; + bottom: 4px; + right: 8px; + z-index: -999 +} + #fileDropZone { width: 320px; border: 2px dashed #bbb; @@ -43,4 +85,4 @@ table th+th[scope=col] { table th[scope=row] { border-right: 2px solid #333; -} \ No newline at end of file +}