diff options
| -rw-r--r-- | app/index.php | 9 | ||||
| -rw-r--r-- | app/model/group.php | 20 | ||||
| -rw-r--r-- | app/view/group.php | 57 | 
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> | 
