summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-09-26 16:40:50 -0400
committerMalf Furious <m@lfurio.us>2018-09-26 16:40:50 -0400
commit382364e8031e49bce8831dfbc9a53435407ea4ae (patch)
tree12b7e8642fc1965e134f49423e415a5d41dc55ba
parentfbb9bcb787287597a0666b9313a4754ed03d242b (diff)
parent83be80e89dbbf22a18023fa8443fcab975358c3f (diff)
downloadscrott-382364e8031e49bce8831dfbc9a53435407ea4ae.tar.gz
scrott-382364e8031e49bce8831dfbc9a53435407ea4ae.zip
Merge branch 'feature/view-group' into dev
-rw-r--r--app/index.php9
-rw-r--r--app/model/group.php20
-rw-r--r--app/view/group.php57
3 files changed, 86 insertions, 0 deletions
diff --git a/app/index.php b/app/index.php
index 13b6779..44c2de9 100644
--- a/app/index.php
+++ b/app/index.php
@@ -15,6 +15,8 @@
require_once "class/database.class.php";
require_once "class/settings.class.php";
require_once "class/user.class.php";
+require_once "class/group.class.php";
+require_once "class/pad.class.php";
/*
* This file is the entry-point to the Scrott application. main() will
@@ -98,6 +100,13 @@ function main(array $argv) : void
/* setup page */
switch (obj::typeOf($argv[0]))
{
+ case "group":
+ $obj = new group($argv[0]);
+ setPageObj($obj);
+ setPageName($obj->name);
+ require "view/group.php";
+ break;
+
case "pad":
$obj = new pad($argv[0]);
setPageObj($obj);
diff --git a/app/model/group.php b/app/model/group.php
new file mode 100644
index 0000000..7f3b2bc
--- /dev/null
+++ b/app/model/group.php
@@ -0,0 +1,20 @@
+<?php
+
+/*
+ * SCROTT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * For more information, please refer to UNLICENSE
+ */
+
+require_once "class/group.class.php";
+
+$group = getPageObj();
+$pads = $group->getPads_ordByOwnByName();
+
+?>
diff --git a/app/view/group.php b/app/view/group.php
new file mode 100644
index 0000000..eba9e0a
--- /dev/null
+++ b/app/view/group.php
@@ -0,0 +1,57 @@
+<?php
+
+/*
+ * SCROTT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * For more information, please refer to UNLICENSE
+ */
+
+require_once "model/group.php";
+require_once "view/stdpage.php";
+require_once "view/datalsts.php";
+
+?>
+
+<!DOCTYPE html>
+
+<html lang="en">
+ <head>
+ <?=stdpage\head( getPageName() )?>
+ </head>
+
+ <body>
+ <?=stdpage\top()?>
+ <?=stdpage\nav()?>
+
+ <div class="container">
+ <div class="well well-lg">
+ <div class="row">
+ <div class="col-md-12">
+ <h1>
+ <?=datalsts\objHeadCircle($group, 100)?>
+ <?=$group->name?>
+ </h1>
+ </div>
+ </div>
+ </div>
+
+ <?php if (!count($pads)) { ?>
+ <div class="jumbotron">
+ <h2 class="text-center">No pads in <?=$group->name?></h2>
+ </div>
+ <?php } ?>
+
+ <?php foreach ($pads as $p) { ?>
+ <?=datalsts\gpListItem($p)?>
+ <?php } ?>
+ </div>
+
+ <?=stdpage\foot()?>
+ </body>
+</html>