<?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
*/
namespace stdpage;
require_once "class/globals.php";
require_once "class/user.class.php";
require_once "view/datamods.php";
require_once "view/settings.php";
?>
<?php function head(?string $title = NULL) : void { ?>
<!--
███████╗ ██████╗██████╗ ██████╗ ████████╗████████╗
██╔════╝██╔════╝██╔══██╗██╔═══██╗╚══██╔══╝╚══██╔══╝
███████╗██║ ██████╔╝██║ ██║ ██║ ██║
╚════██║██║ ██╔══██╗██║ ██║ ██║ ██║
███████║╚██████╗██║ ██║╚██████╔╝ ██║ ██║
╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
Secure Centralized Robust Online Ticketing Tool
<?=__VERSION__?>
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE 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 <http://unlicense.org/>
-->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Scrott<?=($title ? " - ".$title : "")?></title>
<link rel="stylesheet" type="text/css" href="<?=ar()?>/static/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="<?=ar()?>/static/css/bootstrap-select.min.css" />
<style type="text/css">
body
{
padding-top: 70px;
<?php if (getPageObj() && ($pagebg = getPageObj()->getBgImg())) { ?>
background: url(<?=$pagebg?>) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
<?php } ?>
}
</style>
<?php } ?>
<?php function top() : void { ?>
<?php require "model/noticemodal.php"; ?>
<?php if (isError(ERROR) || isError(WARNING) || isError(NOTICE)) { ?>
<div id="noticeModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body alert <?=$noticeModalAlertClass?>" style="margin: 0;">
<h1 class="text-center"><span class="glyphicon <?=$noticeModalGlyphicon?>"></span></h1>
<h5 class="text-center">Something Happened</h5>
<?php if (isError(ERROR)) { ?>
<p>
<?php foreach (getErrors(ERROR) as $err) { ?>
<span class="label label-danger">Error</span> <?=$err?><br />
<?php } ?>
</p>
<?php } ?>
<?php if (isError(WARNING)) { ?>
<p>
<?php foreach (getErrors(WARNING) as $err) { ?>
<span class="label label-warning">Warning</span> <?=$err?><br />
<?php } ?>
</p>
<?php } ?>
<?php if (isError(NOTICE)) { ?>
<p>
<?php foreach (getErrors(NOTICE) as $err) { ?>
<span class="label label-info">Notice</span> <?=$err?><br />
<?php } ?>
</p>
<?php } ?>
<div class="text-center">
<button type="button" class="btn btn-default" data-dismiss="modal">
<span class="glyphicon glyphicon-ok"></span> Got it
</button>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
<?php function foot() : void { ?>
<script type="text/javascript" src="<?=ar()?>/static/js/jquery.min.js"></script>
<script type="text/javascript" src="<?=ar()?>/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?=ar()?>/static/js/bootstrap-select.min.js"></script>
<?php if (isError(ERROR) || isError(WARNING) || isError(NOTICE)) { ?>
<script type="text/javascript">
$(window).on('load', function () {
$("#noticeModal").modal("show");
});
</script>
<?php } ?>
<script type="text/javascript">
$(".issueListItem").click(function () {
//$(this).data("guid");
$("#aboutModal").modal("show");
});
function assertconfirm() {
return confirm("Are you sure?");
}
</script>
<?php } ?>
<?php function about() : void { ?>
<div id="aboutModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body" style="margin: 0;">
<h1 class="text-center"><span class="glyphicon glyphicon-pencil"></span> Scrott</h1>
<h3 class="text-center"><span class="label label-primary"><?=__VERSION__?></span></h3>
</div>
</div>
</div>
</div>
<?php } ?>
<?php function nav() : void { ?>
<?=about()?>
<?php if (\user::getCurrent()) { ?>
<?=\settings\settings()?>
<?=\datamods\newGroup()?>
<?=\datamods\newPad()?>
<?php } ?>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#scrottnav" aria-expanded="false">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="<?=ar()?>/" class="navbar-brand">
<span class="glyphicon glyphicon-pencil"></span> Scrott
</a>
</div>
<div class="collapse navbar-collapse" id="scrottnav">
<?php if (!\user::getCurrent()) { ?>
<p class="navbar-text navbar-right"><i>Not Logged In </i></p>
<?php } else { ?>
<ul class="nav navbar-nav">
<li><a href="<?=ap()?>"><span class="glyphicon glyphicon-refresh"></span></a></li>
<li><a href="<?=ar()?>/groups"><span class="glyphicon glyphicon-th"></span></a></li>
<li><a href="<?=ar()?>/pads"><span class="glyphicon glyphicon-edit"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<?=getPageName()?> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">TODO</a></li>
<li><a href="#">TODO</a></li>
<li><a href="#">TODO</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="glyphicon glyphicon-plus"></span> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#" data-toggle="modal" data-target="#newGroupModal">New Group</a></li>
<li><a href="#" data-toggle="modal" data-target="#newPadModal">New Pad</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<?php if (\user::getCurrent()->admin == 1) { ?>
<span class="glyphicon glyphicon-sunglasses"></span>
<?php } ?>
<span class="glyphicon glyphicon-user"></span>
<?=\user::getCurrent()->getDisplayName()?>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#" data-toggle="modal" data-target="#aboutModal">About Scrott</a></li>
<li><a href="#" data-toggle="modal" data-target="#settingsModal">Settings</a></li>
<li><a href="<?=ar()?>/logout">Log out</a></li>
</ul>
</li>
</ul>
<?php } ?>
</div>
</div>
</nav>
<?php } ?>