Initial commit as release 1.1.0

This commit is contained in:
2026-02-14 11:07:25 -05:00
parent 6b49566e58
commit a6331f7fed
141 changed files with 50383 additions and 0 deletions

43
distfiles/CHANGELOG Normal file
View File

@@ -0,0 +1,43 @@
OpenDRS - Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Changelog
1.0.0 - 2018-03-13
- Initial release as OpenMTS.
1.1.0 - 2018-05-10
- Name change from OpenMTS to OpenDRS.
- Added "Go Back" button to left side menu to make up for loss of browser
back button in terminal mode.
- Added configurable help text for period effective selection.
- Changed Sim period effective from selection to yes/no radio buttons.
- Writeup groups page shows collapsed list of groups. Click the expand icon
to expand each group.
- Fixed bug where entries made on stale create page had inaccurate date/time.
- For logged in users, added the ability to select writeups directly on the
View All Writeups page and assign/create a group.
- On the Create New Writeup page, removed the default selections for Device,
Subsystem, and Period dropdowns, forcing user to make a selection.
- Added a Today button to the View All Writeups page
- Changed the Period dropdowns on the Create, Search, and Group pages to show
the times instead of the period numbers. Period numbers are still shown
in the results tables with mouse hover showing times.
- Moved all installation/upgrade functions to the install.sh script.

28
distfiles/INSTALL Normal file
View File

@@ -0,0 +1,28 @@
Installation or upgrade of OpenDRS is straightforward.
1. Unpack
Unpack the distribution in a convenient place. A directory will
created called OpenDRS-x.x.x/.
2. Review License
Change to the OpenDRS-x.x.x/ directory and review the LICENSE file.
3. Run the install script
In the same directory, type ./install.sh at a command prompt and
follow the prompts.
4. Log in
Click on the Log In menu option on the main page. If this is a fresh
installation The initial user is drsadmin and the initial password
is OpenDRS-1. It is highly recommended that you changethis password
to a strong one by going to the Manage Database page under the
Admin Functions menu. If this an upgrade, your current usernames and
passwords are unchanged.
5. Configure
The Admin Functions menu will be shown when logged in as an admin user.
Click on Global Settings to set display options, page colors, banners, and
miscellaneous options. Click on Manage Database to set users, devices,
subsystems, action reasons and periods.
6. Start making writeups

341
distfiles/LICENSE Normal file
View File

@@ -0,0 +1,341 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The \"Program\", below,
refers to any such program or work, and a \"work based on the Program\"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term \"modification\".) Each licensee is addressed as \"you\".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and \"any
later version\", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the \"copyright\" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a \"copyright disclaimer\" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

139
distfiles/about.php Normal file
View File

@@ -0,0 +1,139 @@
<?php
/*
about.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// redirect to index.php on cancel button press
if ($_REQUEST['cancel']) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:index.php");
exit();
}
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST to $incoming
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
// define local functions
// assign variables from constants
$appname=APP_NAME;
if ($print=="Printer Friendly") {
$sbcolor=P_SIDEBAR_COLOR;
$mbgcolor=P_MENUBG_COLOR;
} else {
$sbcolor=SIDEBAR_COLOR;
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($mts_db,"users","id","role",$userid);
framework("begin","$appname","About OpenDRS",$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
echo "
<h3 align=\"center\">
OpenDRS $version Discrepancy Reporting System
</h3><br>
<p>This program is licensed under the terms of the <a href=\"gpl.php\">GNU General Public License</a>. Click on the link
or see the LICENSE file in the distribution to read it. OpenDRS is Copyright (C) 2018 by Rod Wright.
</p>
<p>
OpenDRS is a simple online maintenance tracking/discrepancy reporting application. It allows anyone with a web browser to create ,
view, and search writeups. The look and feel of the OpenDRS pages are easily changed.
Settings that affect all users can be changed in the Admin Functions menu. User specific settings can be changed in the
My Profile menu. No browser specific HTML is used in OpenDRS, so it should be useable in any browser, and it has been
tested using Google Chrome, Mozilla Firefox and Microsoft Internet Explorer.
</p>
<p>
OpenDRS is highly flexible. Instructions are included in the distribution for creating a user terminal with a Raspberry Pi. OpenDRS can be hosted on a
centralized server, accessed by networked PCs and/or Raspberry Pi terminals. It can also be hosted directly on a Raspberry Pi
terminal as a non-networked standalone system or in a small network of Raspberry Pi terminals.
</p>
<p>
To read about the <a href=\"CHANGELOG\" >changes</a> in this latest version of OpenDRS, click on the link or see the CHANGELOG file in the distribution.
</p>
<p>Several pieces of Open Source software make OpenDRS possible.
<br>
<table border=0 cellpadding=20>
<tr>
<td><a href=\"http://www.linux.org\" target=\"_blank\"><img src=\"images/linux.png\" border=0></a></td><td><b>Linux</b></td><td>All
development and most of the testing of OpenDRS was done on computers running the
<a href=\"http://www.linux.org\" target=\"_blank\">Linux</a> operating system.</td>
</tr>
<tr>
<td><a href=\"http://www.php.net\" target=\"_blank\"><img src=\"images/php-small-trans-dark.gif\"
border=0></a></td><td><b>PHP</b></td><td>OpenDRS is written in <a href=\"http://www.php.net\" target=\"_blank\">PHP</a>, a hypertext
preprocessor, which makes possible the dynamic content of the pages.</td>
</tr>
<tr>
<td><a href=\"https://mariadb.org\" target=\"_blank\"><img src=\"images/mariadb-badge-180x60.png\"
border=0></a></td><td><b>MariaDB</b></td><td>OpenDRS stores its data in a <a href=\"https://mariadb.org\" target=\"_blank\">MariaDB</a>
database.</td>
</tr>
<tr>
<td><a href=\"http://http.apache.org\" target=\"_blank\"><img src=\"images/apache_pb.gif\"
border=0></a></td><td><b>Apache</b></td><td>OpenDRS was developed using the <a href=\"httpd.apache.org\" target=\"_blank\">Apache</a> web
server.</td>
</tr>
<tr>
<td><a href=\"http://p.yusukekamiyamane.com\" target=\"_blank\"><img src=\"images/Kamiyamane.png\"
border=0></a></td><td><b>Fugue<br>Icons</b></td><td>The icons used in OpenDRS are from the Fugue Icon set created by Yusuke Kamiyamane. The entire set is available at
<a href=\"http://p.yusukekamiyamane.com/\" target=\"_blank\">p.yusukekamiyamane.com</a>, and are licensed under a
<a href=\"http://creativecommons.org/licenses/by/3.0/legalcode\" target=\"_blank\">Creative Commons Attribution 3.0 License</a>.</td>
</tr>
</table>
</p>
";
echo "<br>";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

View File

@@ -0,0 +1,149 @@
#pickerPanel { width: 360px; height: 240px; font: normal 11px verdana, sans-serif; color: #333; line-height: 19px; margin: 0; }
/* slider */
.dragPanel {
position: relative;
background-color: #eeeeee;
margin: 4px;
width: 260px;
height: 180px;
}
.dragPanel h4 {
background-color: #bbbbbb;
height: 10px;
margin: 0px;
cursor: move;
}
input { font-size: .85em }
.thumb {
cursor:default;
width:18px;
height:18px;
z-index: 9;
position:absolute;
}
.bg {
position:absolute;
left:10px;
height:18px;
width:146px;
border: 0px solid #aaaaaa;
}
.bg span, .bg p {
cursor:default;
position: relative;
font-size: 2px;
overflow: hidden;
color: #aaaaaa;
top: 4px;
height: 10px;
width: 4px;
display: block;
float:left;
}
.bg span {
border-top:1px solid #cccccc;
border-bottom:1px solid #cccccc;
}
.bg .lb {
border-left:1px solid #cccccc;
}
.bg .rb {
border-right:1px solid #cccccc;
}
#valdiv { position:absolute; top: 100px; left:10px; }
#rBG {top:30px}
#gBG {top:50px}
#bBG {top:70px}
#rgbSwatch {
position:absolute;
left:160px;
top:34px;
height:50px;
width:50px;
border:1px solid #aaaaaa;
}
#rgbPanel {
/*
top: 400px;
left: 20px;
*/
width: 360px;
height: 240px;
}
/* picker */
#hueThumb {
cursor:default;
width:18px;
height:18px;
z-index: 9;
position:absolute;
}
#hueBg {
position:absolute;
left:216px;
height:198px;
width:18px;
background:url(../img/hue.png) no-repeat;
top:18px;
}
#pickerDiv {
position:absolute;
left:10px;
height:187px;
width:188px;
/*
background:url(../img/pickerbg.png) no-repeat;
*/
top:20px;
}
#pickerbg {
position:absolute;
z-index: 1;
top:0px;
left:0px;
}
#selector {
cursor:default;
width:11px;
height:11px;
z-index: 9;
position:absolute;
top:0px;
left:0px;
}
#pickerSwatch {
position:absolute;
left:260px;
top:30px;
height:60px;
width:60px;
border:2px solid #aaaaaa;
}
#pickervaldiv { text-align:right; position:absolute; top: 86px; left:246px; }
.colorbox{
width: 25px;
height: 14px;
border: 1px solid black;
border-bottom-width: 0;
}

View File

@@ -0,0 +1,196 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:x2="http://www.w3.org/TR/xhtml2"
xmlns:role="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"
xmlns:state="http://www.w3.org/2005/07/aaa">
<head>
<title>YUI Color Picker</title>
<link rel="stylesheet" type="text/css" href="css/screen.css">
<script type="text/javascript" src="js/ddcolorposter.js"></script>
<script type="text/javascript" src="js/YAHOO.js" ></script>
<script type="text/javascript2" src="js/log.js" ></script>
<script type="text/javascript" src="js/color.js" ></script>
<script type="text/javascript" src="js/event.js" ></script>
<script type="text/javascript" src="js/dom.js" ></script>
<script type="text/javascript" src="js/animation.js" ></script>
<script type="text/javascript" src="js/dragdrop.js" ></script>
<script type="text/javascript" src="js/slider.js" ></script>
<script type="text/javascript">
var hue;
var picker;
//var gLogger;
var dd1, dd2;
var r, g, b;
function init() {
if (typeof(ygLogger) != "undefined")
ygLogger.init(document.getElementById("logDiv"));
pickerInit();
ddcolorposter.fillcolorbox("colorfield1", "colorbox1") //PREFILL "colorbox1" with hex value from "colorfield1"
ddcolorposter.fillcolorbox("colorfield2", "colorbox2") //PREFILL "colorbox1" with hex value from "colorfield1"
}
// Picker ---------------------------------------------------------
function pickerInit() {
hue = YAHOO.widget.Slider.getVertSlider("hueBg", "hueThumb", 0, 180);
hue.onChange = function(newVal) { hueUpdate(newVal); };
picker = YAHOO.widget.Slider.getSliderRegion("pickerDiv", "selector",
0, 180, 0, 180);
picker.onChange = function(newX, newY) { pickerUpdate(newX, newY); };
hueUpdate();
dd1 = new YAHOO.util.DD("pickerPanel");
dd1.setHandleElId("pickerHandle");
dd1.endDrag = function(e) {
// picker.thumb.resetConstraints();
// hue.thumb.resetConstraints();
};
}
executeonload(init);
function pickerUpdate(newX, newY) {
pickerSwatchUpdate();
}
function hueUpdate(newVal) {
var h = (180 - hue.getValue()) / 180;
if (h == 1) { h = 0; }
var a = YAHOO.util.Color.hsv2rgb( h, 1, 1);
document.getElementById("pickerDiv").style.backgroundColor =
"rgb(" + a[0] + ", " + a[1] + ", " + a[2] + ")";
pickerSwatchUpdate();
}
function pickerSwatchUpdate() {
var h = (180 - hue.getValue());
if (h == 180) { h = 0; }
document.getElementById("pickerhval").value = (h*2);
h = h / 180;
var s = picker.getXValue() / 180;
document.getElementById("pickersval").value = Math.round(s * 100);
var v = (180 - picker.getYValue()) / 180;
document.getElementById("pickervval").value = Math.round(v * 100);
var a = YAHOO.util.Color.hsv2rgb( h, s, v );
document.getElementById("pickerSwatch").style.backgroundColor =
"rgb(" + a[0] + ", " + a[1] + ", " + a[2] + ")";
document.getElementById("pickerrval").value = a[0];
document.getElementById("pickergval").value = a[1];
document.getElementById("pickerbval").value = a[2];
var hexvalue = document.getElementById("pickerhexval").value =
YAHOO.util.Color.rgb2hex(a[0], a[1], a[2]);
ddcolorposter.initialize(a[0], a[1], a[2], hexvalue)
}
</script>
<!--[if gte IE 5.5000]>
<script type="text/javascript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
YAHOO.util.Event.addListener(window, "load", correctPNG);
</script>
<![endif]-->
</head>
<body>
<h3>Color Picker</h3>
<p>
Implements a slider region and a vertical slider to implement an HSV color
picker.
</p>
<div id="pickerPanel" class="dragPanel">
<h4 id="pickerHandle">&nbsp;</h4>
<div id="pickerDiv">
<img id="pickerbg" src="img/pickerbg.png" alt="">
<div id="selector"><img src="img/select.gif"></div>
</div>
<div id="hueBg">
<div id="hueThumb"><img src="img/hline.png"></div>
</div>
<div id="pickervaldiv">
<form name="pickerform" onsubmit="return pickerUpdate()">
<br />
R <input name="pickerrval" id="pickerrval" type="text" value="0" size="3" maxlength="3" />
H <input name="pickerhval" id="pickerhval" type="text" value="0" size="3" maxlength="3" />
<br />
G <input name="pickergval" id="pickergval" type="text" value="0" size="3" maxlength="3" />
S <input name="pickergsal" id="pickersval" type="text" value="0" size="3" maxlength="3" />
<br />
B <input name="pickerbval" id="pickerbval" type="text" value="0" size="3" maxlength="3" />
V <input name="pickervval" id="pickervval" type="text" value="0" size="3" maxlength="3" />
<br />
<br />
# <input name="pickerhexval" id="pickerhexval" type="text" value="0" size="6" maxlength="6" />
<br />
</form>
</div>
<div id="pickerSwatch">&nbsp;</div>
</div>
</div>
</div>
</div>
<form>
# <input type="text" id="colorfield1" onFocus="ddcolorposter.echocolor(this, 'colorbox1')"> <span id="colorbox1" class="colorbox">____</span> <br />
# <input type="text" id="colorfield2" onFocus="ddcolorposter.echocolor(this, 'colorbox2')"> <span id="colorbox2" class="colorbox">____</span>
</form>
More info: <a href="http://www.dynamicdrive.com/dynamicindex11/yuicolorpicker/">YUI Color Picker script</a>.
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

View File

@@ -0,0 +1,60 @@
/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
/**
* @class The Yahoo global namespace
*/
var YAHOO = function() {
return {
/**
* Yahoo presentation platform utils namespace
*/
util: {},
/**
* Yahoo presentation platform widgets namespace
*/
widget: {},
/**
* Yahoo presentation platform examples namespace
*/
example: {},
/**
* Returns the namespace specified and creates it if it doesn't exist
*
* YAHOO.namespace("property.package");
* YAHOO.namespace("YAHOO.property.package");
*
* Either of the above would create YAHOO.property, then
* YAHOO.property.package
*
* @param {String} sNameSpace String representation of the desired
* namespace
* @return {Object} A reference to the namespace object
*/
namespace: function( sNameSpace ) {
if (!sNameSpace || !sNameSpace.length) {
return null;
}
var levels = sNameSpace.split(".");
var currentNS = YAHOO;
// YAHOO is implied, so it is ignored if it is included
for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
currentNS[levels[i]] = currentNS[levels[i]] || {};
currentNS = currentNS[levels[i]];
}
return currentNS;
}
};
} ();

View File

@@ -0,0 +1,39 @@
/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
YAHOO.util.Anim=function(el,attributes,duration,method)
{if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={doMethod:function(attribute,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attribute,val,unit){YAHOO.util.Dom.setStyle(this.getEl(),attribute,val+unit);},getAttribute:function(attribute){return parseFloat(YAHOO.util.Dom.getStyle(this.getEl(),attribute));},defaultUnits:{opacity:' '},defaultUnit:'px',init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var endTime=null;var actualFrames=0;var defaultValues={};el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.setDefault=function(attribute,val){if(val=='auto'){switch(attribute){case'width':val=el.clientWidth||el.offsetWidth;break;case'height':val=el.clientHeight||el.offsetHeight;break;case'left':if(YAHOO.util.Dom.getStyle(el,'position')=='absolute'){val=el.offsetLeft;}else{val=0;}
break;case'top':if(YAHOO.util.Dom.getStyle(el,'position')=='absolute'){val=el.offsetTop;}else{val=0;}
break;default:val=0;}}
defaultValues[attribute]=val;}
this.getDefault=function(attribute){return defaultValues[attribute];};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.animate=function(){this.onStart.fire();this._onStart.fire();this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);var attributes=this.attributes;var el=this.getEl();var val;for(var attribute in attributes){val=this.getAttribute(attribute);this.setDefault(attribute,val);}
isAnimated=true;actualFrames=0;startTime=new Date();};this.stop=function(){this.currentFrame=0;endTime=new Date();var data={time:endTime,duration:endTime-startTime,frames:actualFrames,fps:actualFrames/this.duration};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};var onTween=function(){var start;var end=null;var val;var unit;var attributes=this['attributes'];for(var attribute in attributes){unit=attributes[attribute]['unit']||this.defaultUnits[attribute]||this.defaultUnit;if(typeof attributes[attribute]['from']!='undefined'){start=attributes[attribute]['from'];}else{start=this.getDefault(attribute);}
if(typeof attributes[attribute]['to']!='undefined'){end=attributes[attribute]['to'];}else if(typeof attributes[attribute]['by']!='undefined'){end=start+attributes[attribute]['by'];}
if(end!==null&&typeof end!='undefined'){val=this.doMethod(attribute,start,end);if((attribute=='width'||attribute=='height'||attribute=='opacity')&&val<0){val=0;}
this.setAttribute(attribute,val,unit);}}
actualFrames+=1;};this._onStart=new YAHOO.util.CustomEvent('_onStart',this);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onTween.subscribe(onTween);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){if(tween.isAnimated()){return false;}
queue[queue.length]=tween;tweenCount+=1;this.start();};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween)
{clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){queue[i].stop();}}
queue=[];thread=null;tweenCount=0;}
else{tween.stop();tweenCount-=1;if(tweenCount<=0){this.stop();}}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}
tween.onTween.fire();tween._onTween.fire();}
else{YAHOO.util.AnimMgr.stop(tween);}}};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}
tween.currentFrame+=tweak;}};}
YAHOO.util.Bezier=new function()
{this.getPosition=function(points,t)
{var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}
for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}
return[tmp[0][0],tmp[0][1]];};};YAHOO.util.Easing=new function(){this.easeNone=function(t,b,c,d){return b+c*(t/=d);};this.easeIn=function(t,b,c,d){return b+c*((t/=d)*t*t);};this.easeOut=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(tc+-3*ts+3*t);};this.easeBoth=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(-2*tc+3*ts);};this.backIn=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(-3.4005*tc*ts+10.2*ts*ts+-6.2*tc+0.4*ts);};this.backOut=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(8.292*tc*ts+-21.88*ts*ts+22.08*tc+-12.69*ts+5.1975*t);};this.backBoth=function(t,b,c,d){var ts=(t/=d)*t;var tc=ts*t;return b+c*(0.402*tc*ts+-2.1525*ts*ts+-3.2*tc+8*ts+-2.05*t);};};YAHOO.util.Motion=function(el,attributes,duration,method){if(el){this.initMotion(el,attributes,duration,method);}};YAHOO.util.Motion.prototype=new YAHOO.util.Anim();YAHOO.util.Motion.prototype.defaultUnits.points='px';YAHOO.util.Motion.prototype.doMethod=function(attribute,start,end){var val=null;if(attribute=='points'){var translatedPoints=this.getTranslatedPoints();var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;if(translatedPoints){val=YAHOO.util.Bezier.getPosition(translatedPoints,t);}}else{val=this.method(this.currentFrame,start,end-start,this.totalFrames);}
return val;};YAHOO.util.Motion.prototype.getAttribute=function(attribute){var val=null;if(attribute=='points'){val=[this.getAttribute('left'),this.getAttribute('top')];if(isNaN(val[0])){val[0]=0;}
if(isNaN(val[1])){val[1]=0;}}else{val=parseFloat(YAHOO.util.Dom.getStyle(this.getEl(),attribute));}
return val;};YAHOO.util.Motion.prototype.setAttribute=function(attribute,val,unit){if(attribute=='points'){YAHOO.util.Dom.setStyle(this.getEl(),'left',val[0]+unit);YAHOO.util.Dom.setStyle(this.getEl(),'top',val[1]+unit);}else{YAHOO.util.Dom.setStyle(this.getEl(),attribute,val+unit);}};YAHOO.util.Motion.prototype.initMotion=function(el,attributes,duration,method){YAHOO.util.Anim.call(this,el,attributes,duration,method);attributes=attributes||{};attributes.points=attributes.points||{};attributes.points.control=attributes.points.control||[];this.attributes=attributes;var start;var end=null;var translatedPoints=null;this.getTranslatedPoints=function(){return translatedPoints;};var translateValues=function(val,self){var pageXY=YAHOO.util.Dom.getXY(self.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var onStart=function(){start=this.getAttribute('points');var attributes=this.attributes;var control=attributes['points']['control']||[];if(control.length>0&&control[0].constructor!=Array){control=[control];}
if(YAHOO.util.Dom.getStyle(this.getEl(),'position')=='static'){YAHOO.util.Dom.setStyle(this.getEl(),'position','relative');}
if(typeof attributes['points']['from']!='undefined'){YAHOO.util.Dom.setXY(this.getEl(),attributes['points']['from']);start=this.getAttribute('points');}
else if((start[0]===0||start[1]===0)){YAHOO.util.Dom.setXY(this.getEl(),YAHOO.util.Dom.getXY(this.getEl()));start=this.getAttribute('points');}
var i,len;if(typeof attributes['points']['to']!='undefined'){end=translateValues(attributes['points']['to'],this);for(i=0,len=control.length;i<len;++i){control[i]=translateValues(control[i],this);}}else if(typeof attributes['points']['by']!='undefined'){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
if(end){translatedPoints=[start];if(control.length>0){translatedPoints=translatedPoints.concat(control);}
translatedPoints[translatedPoints.length]=end;}};this._onStart.subscribe(onStart);};YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Anim.call(this,el,attributes,duration,method);}};YAHOO.util.Scroll.prototype=new YAHOO.util.Anim();YAHOO.util.Scroll.prototype.defaultUnits.scroll=' ';YAHOO.util.Scroll.prototype.doMethod=function(attribute,start,end){var val=null;if(attribute=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=this.method(this.currentFrame,start,end-start,this.totalFrames);}
return val;}
YAHOO.util.Scroll.prototype.getAttribute=function(attribute){var val=null;var el=this.getEl();if(attribute=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=parseFloat(YAHOO.util.Dom.getStyle(el,attribute));}
return val;};YAHOO.util.Scroll.prototype.setAttribute=function(attribute,val,unit){var el=this.getEl();if(attribute=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{YAHOO.util.Dom.setStyle(el,attribute,val+unit);}};

View File

@@ -0,0 +1,101 @@
/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
YAHOO.util.Color = new function() {
// Adapted from http://www.easyrgb.com/math.html
// hsv values = 0 - 1
// rgb values 0 - 255
this.hsv2rgb = function (h, s, v) {
var r, g, b;
if ( s == 0 ) {
r = v * 255;
g = v * 255;
b = v * 255;
} else {
// h must be < 1
var var_h = h * 6;
if ( var_h == 6 ) {
var_h = 0;
}
//Or ... var_i = floor( var_h )
var var_i = Math.floor( var_h );
var var_1 = v * ( 1 - s );
var var_2 = v * ( 1 - s * ( var_h - var_i ) );
var var_3 = v * ( 1 - s * ( 1 - ( var_h - var_i ) ) );
if ( var_i == 0 ) {
var_r = v;
var_g = var_3;
var_b = var_1;
} else if ( var_i == 1 ) {
var_r = var_2;
var_g = v;
var_b = var_1;
} else if ( var_i == 2 ) {
var_r = var_1;
var_g = v;
var_b = var_3
} else if ( var_i == 3 ) {
var_r = var_1;
var_g = var_2;
var_b = v;
} else if ( var_i == 4 ) {
var_r = var_3;
var_g = var_1;
var_b = v;
} else {
var_r = v;
var_g = var_1;
var_b = var_2
}
r = var_r * 255 //rgb results = 0 ÷ 255
g = var_g * 255
b = var_b * 255
}
return [Math.round(r), Math.round(g), Math.round(b)];
};
this.rgb2hex = function (r,g,b) {
return this.toHex(r) + this.toHex(g) + this.toHex(b);
};
this.hexchars = "0123456789ABCDEF";
this.toHex = function(n) {
n = n || 0;
n = parseInt(n, 10);
if (isNaN(n)) n = 0;
n = Math.round(Math.min(Math.max(0, n), 255));
return this.hexchars.charAt((n - n % 16) / 16) + this.hexchars.charAt(n % 16);
};
this.toDec = function(hexchar) {
return this.hexchars.indexOf(hexchar.toUpperCase());
};
this.hex2rgb = function(str) {
var rgb = [];
rgb[0] = (this.toDec(str.substr(0, 1)) * 16) +
this.toDec(str.substr(1, 1));
rgb[1] = (this.toDec(str.substr(2, 1)) * 16) +
this.toDec(str.substr(3, 1));
rgb[2] = (this.toDec(str.substr(4, 1)) * 16) +
this.toDec(str.substr(5, 1));
// gLogger.debug("hex2rgb: " + str + ", " + rgb.toString());
return rgb;
};
this.isValidRGB = function(a) {
if ((!a[0] && a[0] !=0) || isNaN(a[0]) || a[0] < 0 || a[0] > 255) return false;
if ((!a[1] && a[1] !=0) || isNaN(a[1]) || a[1] < 0 || a[1] > 255) return false;
if ((!a[2] && a[2] !=0) || isNaN(a[2]) || a[2] < 0 || a[2] > 255) return false;
return true;
};
}

View File

@@ -0,0 +1,43 @@
/*
======================================================================
ddcolorposter.js: By Dynamic Drive (http://www.dynamicdrive.com)
Communicates between Yahoo Color Picker and form fields on your page
Created: Feb 20th, 06'
======================================================================
*/
function executeonload(functionref){
if (window.addEventListener)
window.addEventListener("load", functionref, false)
else if (window.attachEvent)
window.attachEvent("onload", functionref)
else if (document.getElementById)
window.onload=functionref
}
var ddcolorposter={
initialize:function(r,g,b, hexvalue){
this.rvalue=r //store red value
this.gvalue=g //store green value
this.bvalue=b //store blue value
this.hexvalue=hexvalue //store combined hex value
if (typeof this.targetobj!="undefined"){
this.targetobj.value=this.hexvalue //set field to selected hex color value
if (typeof this.divobj!="undefined") //set adjacent div to selected hex color value
this.divobj.style.backgroundColor="#"+this.hexvalue
}
},
echocolor:function(inputobj, divID){
this.targetobj=inputobj
this.divobj=document.getElementById(divID)
this.targetobj.onblur=function(){
if (inputobj.value.search(/^[a-zA-Z0-9]{6}$/)!=-1) //if field contains valid hex value
document.getElementById(divID).style.backgroundColor="#"+inputobj.value
}
},
fillcolorbox:function(inputID, divID){
var inputobj=document.getElementById(inputID)
if (inputobj.value.search(/^[a-zA-Z0-9]{6}$/)!=-1) //if field contains valid hex value
document.getElementById(divID).style.backgroundColor="#"+inputobj.value
}
}

View File

@@ -0,0 +1,26 @@
/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
YAHOO.util.Dom=new function(){this.get=function(el){if(typeof el=='string'){el=document.getElementById(el);}
return el;};this.getStyle=function(el,property){var value=null;var dv=document.defaultView;el=this.get(el);if(property=='opacity'&&el.filters){value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}
else if(el.style[property]){value=el.style[property];}
else if(el.currentStyle&&el.currentStyle[property]){value=el.currentStyle[property];}
else if(dv&&dv.getComputedStyle)
{var converted='';for(i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase()){converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}
if(dv.getComputedStyle(el,'').getPropertyValue(converted)){value=dv.getComputedStyle(el,'').getPropertyValue(converted);}}
return value;};this.setStyle=function(el,property,val){el=this.get(el);switch(property){case'opacity':if(el.filters){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style['-moz-opacity']=val;el.style['-khtml-opacity']=val;}
break;default:el.style[property]=val;}};this.getXY=function(el){el=this.get(el);if(el.parentNode===null||this.getStyle(el,'display')=='none'){return false;}
var parent=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;var scrollLeft=document.documentElement.scrollLeft||document.body.scrollLeft;return[box.left+scrollLeft,box.top+scrollTop];}
else if(document.getBoxObjectFor){box=document.getBoxObjectFor(el);pos=[box.x,box.y];}
else{pos=[el.offsetLeft,el.offsetTop];parent=el.offsetParent;if(parent!=el){while(parent){pos[0]+=parent.offsetLeft;pos[1]+=parent.offsetTop;parent=parent.offsetParent;}}
var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1||(ua.indexOf('safari')!=-1&&this.getStyle(el,'position')=='absolute')){pos[1]-=document.body.offsetTop;}}
if(el.parentNode){parent=el.parentNode;}
else{parent=null;}
while(parent&&parent.tagName!='BODY'&&parent.tagName!='HTML'){pos[0]-=parent.scrollLeft;pos[1]-=parent.scrollTop;if(parent.parentNode){parent=parent.parentNode;}
else{parent=null;}}
return pos;};this.getX=function(el){return this.getXY(el)[0];};this.getY=function(el){return this.getXY(el)[1];};this.setXY=function(el,pos,noRetry){el=this.get(el);var pageXY=YAHOO.util.Dom.getXY(el);if(pageXY===false){return false;}
var delta=[parseInt(YAHOO.util.Dom.getStyle(el,'left'),10),parseInt(YAHOO.util.Dom.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=0;}
if(isNaN(delta[1])){delta[1]=0;}
if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}
return true;};this.setX=function(el,x){return this.setXY(el,[x,null]);};this.setY=function(el,y){return this.setXY(el,[null,y]);};this.getRegion=function(el){el=this.get(el);return new YAHOO.util.Region.getRegion(el);};this.getClientWidth=function(){return(document.documentElement.offsetWidth||document.body.offsetWidth);};this.getClientHeight=function(){return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);};};YAHOO.util.Region=function(t,r,b,l){this.top=t;this.right=r;this.bottom=b;this.left=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+" t: "+this.top+", r: "+this.right+", b: "+this.bottom+", l: "+this.left+"}");}
YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){this.x=x;this.y=y;this.top=y;this.right=x;this.bottom=y;this.left=x;};YAHOO.util.Point.prototype=new YAHOO.util.Region();

1
distfiles/colorpicker/js/dragdrop.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,34 @@
/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
YAHOO.util.Key = new function() {
// this.logger = new ygLogger("ygEventUtil");
// DOM key constants
this.DOM_VK_UNDEFINED = 0x0;
this.DOM_VK_RIGHT_ALT = 0x12;
this.DOM_VK_LEFT_ALT = 0x12;
this.DOM_VK_LEFT_CONTROL = 0x11;
this.DOM_VK_RIGHT_CONTROL = 0x11;
this.DOM_VK_LEFT_SHIFT = 0x10;
this.DOM_VK_RIGHT_SHIFT = 0x10;
this.DOM_VK_META = 0x9D;
this.DOM_VK_BACK_SPACE = 0x08;
this.DOM_VK_CAPS_LOCK = 0x14;
this.DOM_VK_DELETE = 0x7F;
this.DOM_VK_END = 0x23;
this.DOM_VK_ENTER = 0x0D;
this.DOM_VK_ESCAPE = 0x1B;
this.DOM_VK_HOME = 0x24;
this.DOM_VK_NUM_LOCK = 0x90;
this.DOM_VK_PAUSE = 0x13;
this.DOM_VK_PRINTSCREEN = 0x9A;
this.DOM_VK_SCROLL_LOCK = 0x91;
this.DOM_VK_SPACE = 0x20;
this.DOM_VK_TAB = 0x09;
this.DOM_VK_LEFT = 0x25;
this.DOM_VK_RIGHT = 0x27;
this.DOM_VK_UP = 0x26;
this.DOM_VK_DOWN = 0x28;
this.DOM_VK_PAGE_DOWN = 0x22;
this.DOM_VK_PAGE_UP = 0x21;
};

View File

@@ -0,0 +1,89 @@
/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
/**
* @class a general logging class. Expects to be initalized with a reference
* to a html element to write to.
*
* @constructor
* @param {String} sModuleName the name of the module this instance belongs
* to. Used in the log message to help id where the msg came from.
*/
function ygLogger(sModuleName) {
if (this.setModuleName)
this.setModuleName(sModuleName);
}
ygLogger.DEBUG_ENABLED = true;
ygLogger.targetEl = null;
ygLogger.logStack = [];
ygLogger.startLog = new Date().getTime();
ygLogger.lastLog = new Date().getTime();
ygLogger.locked = true;
ygLogger.logTimeout = null;
ygLogger.init = function(oHostElement) {
if (oHostElement) {
ygLogger.targetEl = oHostElement;
} else {
// create element or create window?
}
};
ygLogger.prototype.setModuleName = function(sModuleName) {
this.logName = sModuleName;
};
ygLogger.prototype.debug = function() {
if (ygLogger.DEBUG_ENABLED) {
var newDate = new Date();
var newTime = newDate.getTime();
var timeStamp = newTime - ygLogger.lastLog;
var totalSeconds = (newTime - ygLogger.startLog) / 1000;
ygLogger.lastLog = newTime;
for (var i = 0; i < arguments.length; i++) {
ygLogger.logStack[ygLogger.logStack.length] =
timeStamp + " ms(" + totalSeconds + ") " +
newDate.toLocaleTimeString() + "<br />" +
this.logName + ": <b>" + arguments[i] + "</b>";
}
if (ygLogger.logTimeout == null) {
ygLogger.logTimeout = setTimeout("ygLogger._outputMessages()" , 1);
}
}
};
ygLogger.disable = function() {
ygLogger.DEBUG_ENABLED = false;
try { ygLogger.targetEl.style.visibility = "hidden"; } catch(e) {}
};
ygLogger.enable = function() {
ygLogger.DEBUG_ENABLED = true;
try { ygLogger.targetEl.style.visibility = ""; } catch(e) {}
};
ygLogger._outputMessages = function() {
if (ygLogger.targetEl != null) {
for (var i = 0; i < ygLogger.logStack.length; i++) {
var sMsg = ygLogger.logStack[i];
var oNewElement = ygLogger.targetEl.appendChild(
document.createElement("p"));
oNewElement.innerHTML = sMsg;
}
ygLogger.logStack = [];
ygLogger.targetEl.scrollTop = ygLogger.targetEl.scrollHeight;
// debugger;
}
ygLogger.logTimeout = null;
};

File diff suppressed because one or more lines are too long

810
distfiles/common.php Normal file
View File

@@ -0,0 +1,810 @@
<?php
/*
common.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
// test for correct installation
if (!file_exists("db.php")) {
echo "
<html>
<head>
<meta http-equiv=\"x-ua-compatible\" content=\"IE=edge\">
<title>Installation error</title>
</head>
<body>
Could not find the db.php file required for this installation.
</body>
</html>
";
exit();
}
include("db.php");
include("settings.php");
// define some constants
define("STAT_OPEN",1);
define("STAT_CLOSED",2);
define("STAT_DEFERRED",3);
define("ADMIN",2);
define("USER",1);
// build the basic color array
$basic_colors=array(
"White" => "#FFFFFF",
"Silver" => "#C0C0C0",
"Gray" => "#808080",
"Black" => "#000000",
"Red" => "#FF0000",
"Maroon" => "#800000",
"Orange" => "#FFA500",
"Yellow" => "#FFFF00",
"Olive" => "#808000",
"Lime" => "#00FF00",
"Green" => "#008000",
"Aqua" => "#00FFFF",
"Teal" => "#008080",
"Blue" => "#0000FF",
"Navy" => "#000080",
"Fuchsia" => "#FF00FF",
"Purple" => "#800080");
// Generic functions
function framework($option,$htmltitle,$pagetitle,$print) {
// generates html code for the beginning and end of all pages
if ($option=="begin") {
// generates everything down to the sidemenu/pagetable
// htmltitle is the page title that appears in the window titlebar
// pagetitle is what will appear as the title of the page itself
// print is whether to format for printing or not
if ($print) {
$bgcolor=P_BACKGROUND_COLOR;
$textcolor=P_TEXT_COLOR;
$linkcolor=P_LINK_COLOR;
$vlinkcolor=P_VLINK_COLOR;
$hdgcolor=P_HEADING_COLOR;
} else {
$bgcolor=BACKGROUND_COLOR;
$textcolor=TEXT_COLOR;
$linkcolor=LINK_COLOR;
$vlinkcolor=VLINK_COLOR;
$hdgcolor=HEADING_COLOR;
}
echo "
<html>
<head>
<meta http-equiv=\"x-ua-compatible\" content=\"IE=edge\">
<title>$htmltitle</title>
<style type=\"text/css\">
table.writeup {table-layout:fixed;}
td.forcewrap {word-wrap: break-word;}
</style>
<style type=\"text/css\">
.fixed {
position:fixed;
}
</style>
<script>
function goBack() {
window.history.back()
}
</script>
<link href=\"jquery-ui/jquery-ui.css\" rel=\"stylesheet\">
<link href=\"jquery-ui/jquery.multiselect.css\" rel=\"stylesheet\">
<style>div.ui-datepicker{font-size:12px;}</style>
<link rel=\"stylesheet\" type=\"text/css\" href=\"colorpicker/css/screen.css\">
<script type=\"text/javascript\" src=\"colorpicker/js/ddcolorposter.js\"></script>
<script type=\"text/javascript\" src=\"colorpicker/js/YAHOO.js\" ></script>
<script type=\"text/javascript2\" src=\"colorpicker/js/log.js\" ></script>
<script type=\"text/javascript\" src=\"colorpicker/js/color.js\" ></script>
<script type=\"text/javascript\" src=\"colorpicker/js/event.js\" ></script>
<script type=\"text/javascript\" src=\"colorpicker/js/dom.js\" ></script>
<script type=\"text/javascript\" src=\"colorpicker/js/animation.js\" ></script>
<script type=\"text/javascript\" src=\"colorpicker/js/dragdrop.js\" ></script>
<script type=\"text/javascript\" src=\"colorpicker/js/slider.js\" ></script>
<script type=\"text/javascript\">
var hue;
var picker;
//var gLogger;
var dd1, dd2;
var r, g, b;
function init() {
if (typeof(ygLogger) != \"undefined\")
ygLogger.init(document.getElementById(\"logDiv\"));
pickerInit();
ddcolorposter.fillcolorbox(\"bgcfield\", \"bgcbox\")
ddcolorposter.fillcolorbox(\"mbgcfield\", \"mbgcbox\")
ddcolorposter.fillcolorbox(\"tcfield\", \"tcbox\")
ddcolorposter.fillcolorbox(\"lcfield\", \"lcbox\")
ddcolorposter.fillcolorbox(\"vlcfield\", \"vlcbox\")
ddcolorposter.fillcolorbox(\"hcfield\", \"hcbox\")
}
// Picker ---------------------------------------------------------
function pickerInit() {
hue = YAHOO.widget.Slider.getVertSlider(\"hueBg\", \"hueThumb\", 0, 180);
hue.onChange = function(newVal) { hueUpdate(newVal); };
picker = YAHOO.widget.Slider.getSliderRegion(\"pickerDiv\", \"selector\",
0, 180, 0, 180);
picker.onChange = function(newX, newY) { pickerUpdate(newX, newY); };
hueUpdate();
dd1 = new YAHOO.util.DD(\"pickerPanel\");
dd1.setHandleElId(\"pickerHandle\");
dd1.endDrag = function(e) {
// picker.thumb.resetConstraints();
// hue.thumb.resetConstraints();
};
}
executeonload(init);
function pickerUpdate(newX, newY) {
pickerSwatchUpdate();
}
function hueUpdate(newVal) {
var h = (180 - hue.getValue()) / 180;
if (h == 1) { h = 0; }
var a = YAHOO.util.Color.hsv2rgb( h, 1, 1);
document.getElementById(\"pickerDiv\").style.backgroundColor =
\"rgb(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";
pickerSwatchUpdate();
}
function pickerSwatchUpdate() {
var h = (180 - hue.getValue());
if (h == 180) { h = 0; }
document.getElementById(\"pickerhval\").value = (h*2);
h = h / 180;
var s = picker.getXValue() / 180;
document.getElementById(\"pickersval\").value = Math.round(s * 100);
var v = (180 - picker.getYValue()) / 180;
document.getElementById(\"pickervval\").value = Math.round(v * 100);
var a = YAHOO.util.Color.hsv2rgb( h, s, v );
document.getElementById(\"pickerSwatch\").style.backgroundColor =
\"rgb(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";
document.getElementById(\"pickerrval\").value = a[0];
document.getElementById(\"pickergval\").value = a[1];
document.getElementById(\"pickerbval\").value = a[2];
var hexvalue = document.getElementById(\"pickerhexval\").value =
YAHOO.util.Color.rgb2hex(a[0], a[1], a[2]);
ddcolorposter.initialize(a[0], a[1], a[2], hexvalue)
}
</script>
</head>
";
echo "
<body bgcolor=\"#$bgcolor\" text=\"#$textcolor\" link=\"#$linkcolor\" vlink=\"#$vlinkcolor\">
";
if ($htmltitle || $pagetitle) {
echo "<font size=5 color=\"#$hdgcolor\"><b> $htmltitle - $pagetitle</b></font>";
if ($print) {
echo "
&nbsp;&nbsp;&nbsp;<input type=\"button\" onClick=\"window.print()\" value=\"Print\" id=\"printbutton\">
&nbsp;&nbsp;&nbsp;<input type=\"button\" onClick=\"window.close()\" value=\"Close\" id=\"closebutton\">
";
}
echo "<br>";
}
} else if ($option=="end") {
echo "
<script src=\"jquery-ui/external/jquery/jquery.js\"></script>
<script src=\"jquery-ui/jquery-ui.js\"></script>
<script src=\"jquery-ui/jquery.multiselect.js\"></script>
<script>
$( \".sidemenu\").addClass(\"fixed\");
$( \":button, :submit, :reset\" ).button();
$( \"#singledatepicker, #reportdatepicker, #actiondatepicker, [id|='onedp']\" ).datepicker({
showOn: \"focus\",
showButtonPanel: true,
changeMonth: true,
changeYear: true,
dateFormat: \"yy-mm-dd\"
});
$( \"#startdatepicker, [id|='sdp']\" ).datepicker({
showOn: \"focus\",
buttonImage: \"icons/calendar.gif\",
buttonImageOnly: true,
buttonText: \"Select start date\",
inline: true,
showButtonPanel: true,
changeMonth: true,
changeYear: true,
dateFormat: \"yy-mm-dd\"
});
$( \"#enddatepicker, [id|='edp']\" ).datepicker({
showOn: \"focus\",
buttonImage: \"icons/calendar.gif\",
buttonImageOnly: true,
buttonText: \"Select end date\",
inline: true,
showButtonPanel: true,
changeMonth: true,
changeYear: true,
dateFormat: \"yy-mm-dd\"
});
$( \"#logoutall\" ).checkboxradio({
icon: false
});
$( \"#device, #subsystem, #period, #period_effective, [id|='sel']\" ).selectmenu();
$( \"#status, #user, #reason\" ).selectmenu();
$( \"#subsystem, #period, #searchstatus, #pass, #passconf\").tooltip();
$( \"[id|='ms']\").multiselect();
$( \"#configtabs, #dbadmintabs, #profiletabs\" ).tabs();
</script>
</body>
</html>
";
} else {
echo "
<br>Invalid option \"$option\" passed to framework(). Valid options are \"begin\" and \"end\".<br>
";
exit(1);
}
}
function pagetable($option) {
if ($option=="begin") {
echo "
<br>
<table border=\"0\" width=\"100%\" cellpadding=\"10\">
<tr>
";
} else if ($option=="end") {
echo "
</tr></table>
";
} else {
echo "
<br>Invalid option \"$option\" passed to pagetable(). Valid options are \"begin\" and \"end\".<br>
";
exit(1);
}
}
function pageblock($block,$option) {
if ($block=="left") {
if ($option=="begin") {
echo "
<td width=\"210\" valign=\"top\">
";
} else if ($option=="end") {
echo "
</td>
";
} else {
echo "
<br>Invalid option \"$option\" passed to pageblock(). Valid options are \"begin\" and \"end\".<br>
";
exit(1);
}
} else if ($block=="right") {
if ($option=="begin") {
echo "
<td valign=\"top\">
";
} else if ($option=="end") {
if (defined("FOOTER_MESSAGE")) {
$footer_msg=FOOTER_MESSAGE;
echo "
<br><br>
<center>$footer_msg</center><br>
";
}
echo "
</td>
";
} else {
echo "
<br>Invalid option \"$option\" passed to pageblock(). Valid options are \"begin\" and \"end\".<br>
";
exit(1);
}
} else {
echo "
<br>Invalid block \"$block\" passed to pageblock(). Valid blocks are \"left\" and \"right\".<br>
";
exit(1);
}
}
function sidemenu($printable=true) {
// Displays sidebar menu
global $drs_db,$mbgcolor;
echo "
<div class=\"sidemenu\">
<table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\">
<tr><td align=\"center\"><a href=\"create.php\" title=\"Create new writeup\"><font size=\"+1\"><b>Create New Writeup</b></font></a></td></tr>
</table>
<br>";
echo "
<center><button onclick=\"goBack()\">Go Back</button></center>
";
echo "
<br>
<table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\">
<tr><td align=\"center\"><a href=\"writeups.php\" title=\"View open writeups\"><font size=\"+1\"><b>View Open Writeups</b></font></a></td></tr>
<tr><td align=\"center\"><a href=\"writeups.php?view=1\" title=\"View all writeups for a date range\">View All Writeups</a></td></tr>
<tr><td align=\"center\"><a href=\"groups.php\" title=\"View writeup groups\">Writeup Groups</a></td></tr>
<tr><td align=\"center\"><a href=\"search.php\">Search Writeups</a></td></tr>
</table>
<br>
";
if (isset($_SESSION['userid'])) {
$menuuser=$_SESSION['userid'];
if (mysqli_fetch_row(mysqli_query($drs_db,"select role from users where id=\"$menuuser\""))[0] == ADMIN) {
echo "
<br>
<table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\">
<tr><td align=\"center\"><b>Admin Functions</b></td></tr>
<tr><td align=\"center\"><a href=\"config.php\" title=\"Control global settings. Must be an administrator.\">Global Settings</a></td></tr>
<tr><td align=\"center\"><a href=\"dbadmin.php\" title=\"Manage the database. Must be an administrator.\">Manage Database</a></td></tr>
</table>
<br>
";
}
}
if (!isset($_SESSION['userid'])) {
echo "
<br>
<table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\">
<tr><td align=\"center\"><b>My Account</b></td></tr>
<tr><td align=\"center\"><a href=\"login.php\"><b>Log In</b></a></td></tr>
</table>
<br>";
} else {
$loginid=$_SESSION['userid'];
$loggedinas=mysqli_fetch_row(mysqli_query($drs_db,"select firstname,lastname from users where id=\"$loginid\""));
echo "
<br>
<table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\">
<tr><td align=\"center\"><b>My Account</b></td></tr>
<tr><td align=\"center\">Logged in as $loggedinas[0] $loggedinas[1]</td></tr><tr><td align=\"center\"><a href=\"login.php?cancel=1\"><b>Log Out</b></a></td></tr>
<tr><td align=\"center\"><a href=\"profile.php\">My Profile</a></td></tr>
</table>
<br>";
}
if ($printable) {
$currentparams=arrayCopy($_REQUEST);
echo "
<br>
<center>
<form method=\"post\" target=\"_blank\">
<input type=\"hidden\" name=\"all_parameters\" value=\"". htmlentities(serialize($currentparams))."\">
<input type=\"submit\" name=\"print\" value=\"Show Printable\" id=\"showprintable\"></form>
</center>
";
}
echo "
<br>
<table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\">
<tr><td align=\"center\"><a href=\"about.php\">About</a></td></tr>
</table>
</div>
";
}
function banner($print) {
// displays a banner
global $drs_db;
$bannerid=BANNER;
// get banner parameters from banner table
$banrow=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from banners where bannerid=\"$bannerid\""));
if (!$banrow) {
$bannerid=1;
} else {
$bannertext=$banrow["bannername"];
if ($print) {
$bannercolor="#FFFFFF";
$bannertxtcolor="#000000";
} else {
$bannercolor=$banrow["bannercolor"];
$bannertxtcolor=$banrow["textcolor"];
}
}
if ($bannerid != 1) {
echo "
<table width=\"100%\">
<tr bgcolor=\"$bannercolor\" align=\"center\"><td colspan=2><font size=\"+1\" color=\"$bannertxtcolor\"><b>$bannertext</b></font></td></tr></table>
";
}
}
function dblookup($dbhandle,$table,$in_field,$out_field,$in_data) {
// look up a single field in a database given a value for a single field
$out_data=mysqli_fetch_row(mysqli_query($dbhandle,"select $out_field from $table where $in_field=\"$in_data\""));
return($out_data[0]);
}
function arrayCopy( array $array ) {
$result = array();
foreach( $array as $key => $val ) {
if( is_array( $val ) ) {
$result[$key] = arrayCopy( $val );
} elseif ( is_object( $val ) ) {
$result[$key] = clone $val;
} else {
$result[$key] = $val;
}
}
return $result;
}
function validateDate($date, $format = 'Y-m-d') {
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}
function validateTime($time, $format = 'H:i:s') {
$t = DateTime::createFromFormat($format, $time);
return $t && $t->format($format) == $time;
}
function validate_password($pass,$passconf) {
// run some checks on supplied passwords
// returns a two element array
// first element is true if passwords match, false if not
// second element is true if passwords meet complexity requirements, false if not
$results=array();
// check for match
if ($pass==$passconf) {
$results['match']=true;
} else {
$results['match']=false;
}
// check for complexity
// length
if (strlen($pass) < 8) {
$passlength=false;
} else {
$passlength=true;
}
// upper case
if (preg_match('/[A-Z]/',$pass)) {
$hasupper=true;
} else {
$hasupper=false;
}
// lower case
if (preg_match('/[a-z]/',$pass)) {
$haslower=true;
} else {
$haslower=false;
}
// number
if (preg_match('/[0-9]/',$pass)) {
$hasnumber=true;
} else {
$hasnumber=false;
}
// special character
if (preg_match('/[[:punct:]]/',$pass)) {
$hasspecial=true;
} else {
$hasspecial=false;
}
if ($passlength && $hasupper && $haslower && $hasnumber && $hasspecial) {
$results['complex']=true;
} else {
$results['complex']=false;
}
return $results;
}
function displaywriteup($id) {
global $drs_db;
$writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id=\"$id\""));
// determine status indicator
if ($writeupdata['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>";
if ($writeupdata['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>";
if ($writeupdata['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>";
// determine effective icon
if($writeupdata["period_effective"]==1) {
$effind="<font color=\"#00FF00\" title=\"Period Effective\">EFF</font>";
} else {
$effind="<font color=\"#FF0000\" title=\"Period Non-effective\">NEF</font>";
}
// look up text data
$devicename=dblookup($drs_db,"devices","id","name",$writeupdata["device"]);
$subsystemname=dblookup($drs_db,"subsystems","id","name",$writeupdata["subsystem"]);
$subsystemdesc=dblookup($drs_db,"subsystems","id","description",$writeupdata["subsystem"]);
$discrtxt=$writeupdata["discrepancy_text"];
$rdate=$writeupdata["report_date"];
$rtime=$writeupdata["report_time"];
$repby=$writeupdata["reported_by"];
$period=$writeupdata["period"];
$periodtimes=dblookup($drs_db,"periods","id","times",$period);
$techfname=dblookup($drs_db,"users","id","firstname",$writeupdata["action_by"]);
$techlname=dblookup($drs_db,"users","id","lastname",$writeupdata["action_by"]);
$reasonname=dblookup($drs_db,"reasons","id","text",$writeupdata["action_reason"]);
$actxt=$writeupdata["action_text"];
$adate=$writeupdata["action_date"];
if ($adate=="0000-00-00") $adate="";
$atime=$writeupdata["action_time"];
// determine if this is a member of a group
$member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$writeupdata['id']}\"");
$is_member=mysqli_num_rows($member_qry);
if ($is_member) {
$group_count=$is_member;
$member_group=mysqli_fetch_row($member_qry)[0];
$member_group_name=dblookup($drs_db,"groups","id","name",$member_group);
if ($member_group_name) {
$imgtitle="Member of group: $member_group_name";
} else {
$imgtitle="Member of group ID: $member_group";
}
if ($group_count == 1) {
$group_ind="<a href=\"groups.php?group=$member_group\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"$imgtitle\"></a></div>";
} else {
$group_ind="<a href=\"groups.php\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"View writeup groups\"></a></div>";
}
}
echo "
<table border=\"2\" width=\"100%\"><tr><td>
<table border=\"0\">
<tr><td><b>ID:</b> <a href=\"writeupdetail.php?id=$id\" title=\"View or change details of this writeup\">$id</a></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>$statusind</b></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Device:</b> $devicename</td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Subsystem:</b> <font title=\"$subsystemdesc\">$subsystemname</font></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Period:</b> <font title=\"$periodtimes\">$period</font></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>$effind</b></td>
</tr>
</table>
<table border=\"0\">
<tr>
<td><b>Discrepancy:</b><br>$discrtxt</td><td>&nbsp;&nbsp;&nbsp;</td>
<td align=\"right\" valign=\"bottom\">$group_ind</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td><b>Report date:</b> $rdate</td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Report time:</b> $rtime</td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Reported by:</b> $repby</td>
</tr>
</table>
<hr>
<table border=\"0\">
<tr>
<td><b>Action taken by:</b> $techfname $techlname</td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Status change reason:</b> $reasonname</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td><b>Action taken:</b><br>$actxt</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td><b>Action date:</b> $adate</td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Action time:</b> $atime</td>
</tr>
</table>
</td></tr></table>
";
}
function format_message($msgtype,$msgtxt) {
// displays a formatted message
// $msgtype is 0 for success or anything else for failure
// $msgtxt is the string to display
if ($msgtype == 0) {
$state="ui-state-highlight";
$icon="ui-icon-info";
} else {
$state="ui-state-error";
$icon="ui-icon-alert";
}
if ($msgtxt == "") $msgtxt="PROGRAM ERROR: No message text was supplied.";
echo "
<div class=\"$state ui-corner-all\" style=\"margin-top: 20px; padding: 0 .7em;\">
<p><span class=\"ui-icon $icon\" style=\"float: left; margin-right: .3em;\"></span>
$msgtxt</p>
</div><br><br>
";
}
function getsetting($setting_name,$user_id) {
// get the value of a setting for a user
global $drs_db;
$confvalue=mysqli_fetch_assoc(mysqli_query($drs_db,"select id,value from config where name=\"$setting_name\""))['value'];
$uservalue=mysqli_fetch_assoc(mysqli_query($drs_db,"select value from profile where name=\"$setting_name\" and user=\"$user_id\""))['value'];
if ($uservalue) {
return $uservalue;
} else {
return $confvalue;
}
}
function putsetting($setting_name,$setting_value,$user_id) {
// set the value of a setting for a tech
global $drs_db;
$confvalue=mysqli_fetch_assoc(mysqli_query($drs_db,"select value from config where name=\"$setting_name\""))['value'];
$uservalue=mysqli_fetch_assoc(mysqli_query($drs_db,"select value from profile where name=\"$setting_name\" and user=\"$user_id\""))['value'];
if ($setting_value==$confvalue) {
mysqli_query($drs_db,"delete from profile where user=\"$user_id\" and name=\"$setting_name\"");
} else {
if ($uservalue) {
if ($uservalue != $setting_value) mysqli_query($drs_db,"update profile set value=\"$setting_value\" where name=\"$setting_name\" and user=\"$user_id\"");
} else {
mysqli_query($drs_db,"insert into profile(user,name,value) values(\"$user_id\",\"$setting_name\",\"$setting_value\")");
}
}
}
function group_table($groupid,$role=false,$mode="view",$selection="none",$expanded=false) {
// display a table for a single group
global $drs_db;
// print group id and name
if ($selection == "all") {
$sel_flag="checked";
} elseif ($selection == "none") {
$sel_flag="";
}
if ($expanded) {
echo "
<a href=\"groups.php\" style=\"text-decoration:none\">
<img src=\"icons/minus-white.png\" alt=\"Unexpand group\">
</a>
";
}
$groupname=dblookup($drs_db,"groups","id","name",$groupid);
if ($groupname == "") {
echo "<b>Group ID: &nbsp;$groupid";
} else {
echo "<b>Group Name: &nbsp;$groupname";
}
echo "</b><br>";
// print table headers
if ($role && $mode=="select") {
echo "
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
<th style=\"width:1%;\">Select</th>
<th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th>
<th style=\"width:1%;\">Device</th>
<th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th>
</tr>
";
} else {
echo "
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
<th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th>
<th style=\"width:1%;\">Device</th>
<th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th>
</tr>
";
}
$writeup_qry=mysqli_query($drs_db,"select writeupid from links where linkgroup=$groupid");
while ($writeup=mysqli_fetch_row($writeup_qry)) {
// get writeup data
$writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id={$writeup[0]}"));
// convert device number to name
$tname=dblookup($drs_db,"devices","id","name",$writeupdata["device"]);
// convert subsystem number to name
$ssname=dblookup($drs_db,"subsystems","id","name",$writeupdata["subsystem"]);
// determine status indicator
if ($writeupdata['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>";
if ($writeupdata['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>";
if ($writeupdata['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>";
// determine times for period
$ptimes=mysqli_fetch_row(mysqli_query($drs_db,"select times from periods where id=\"{$writeupdata['period']}\""))[0];
// determine effective icon
if($writeupdata["period_effective"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">";
} else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">";
}
// print table row
if ($role && $mode=="select") {
printf(
"<tr>
<td align=\"center\" valign=\"top\"><input type=\"checkbox\" name=\"targets[]\" value=\"%s\" $sel_flag></td>
<td align=\"center\" valign=\"top\"><a href=\"writeupdetail.php?id=%s\" title=\"View or change details of this writeup\">%s</a></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</font></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td>
</tr>\n",
$writeupdata["id"],
$writeupdata["id"],$writeupdata["id"],
$statusind,
$writeupdata["report_date"],
$ptimes, $writeupdata["period"],
$tname,
$ssname,
$writeupdata["reported_by"],
$writeupdata["discrepancy_text"],
$eff_icon
);
} else {
printf(
"<tr>
<td align=\"center\" valign=\"top\"><a href=\"writeupdetail.php?id=%s\" title=\"View or change details of this writeup\">%s</a></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</font></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td>
</tr>\n",
$writeupdata["id"],$writeupdata["id"],
$statusind,
$writeupdata["report_date"],
$ptimes, $writeupdata["period"],
$tname,
$ssname,
$writeupdata["reported_by"],
$writeupdata["discrepancy_text"],
$eff_icon
);
}
}
echo "</table><br>";
}
?>

480
distfiles/config.php Normal file
View File

@@ -0,0 +1,480 @@
<?php
/*
config.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// redirect to index.php on cancel button press
if ($_REQUEST['cancel']) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:index.php");
exit();
}
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
$role=dblookup($drs_db,"users","id","role",$userid);
// redirect to index.php if not an admin
if ($role != ADMIN) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:index.php");
exit();
}
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming[]
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST[] to $incoming[]
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
$update_display=$incoming['update_display'];
$display_appname=$incoming['display_appname'];
$display_banner=$incoming['display_banner'];
$display_footer=$incoming['display_footer'];
$display_pereffhlp=$incoming['display_pereffhlp'];
$update_colors=$incoming['update_colors'];
$reset_colors=$incoming['reset_colors'];
$newbgc=$incoming['newbgc'];
$newmbgc=$incoming['newmbgc'];
$newtc=$incoming['newtc'];
$newlc=$incoming['newlc'];
$newvlc=$incoming['newvlc'];
$newhc=$incoming['newhc'];
$edit_banner=$incoming['edit_banner'];
$add_banner=$incoming['add_banner'];
$update_banner=$incoming['update_banner'];
$delete_banner=$incoming['delete_banner'];
$bnrid=$incoming['bnrid'];
$bnrname=$incoming['bnrname'];
$bnrcolor=$incoming['bnrcolor'];
$bnrtxtcolor=$incoming['bnrtxtcolor'];
$update_misc=$incoming['update_misc'];
$sessttl=$incoming['sessttl'];
$sessdir=$incoming['sessdir'];
$logoutall=$incoming['logoutall'];
// assign variables from constants
$appname=APP_NAME;
if ($print=="Printer Friendly") {
$mbgcolor=P_MENUBG_COLOR;
} else {
$mbgcolor=MENUBG_COLOR;
}
framework("begin","$appname","Configuration",$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
if ($update_display) {
// remove html tags from footer_message and sanitize
$display_footer=strip_tags($display_footer);
$clean_display_footer=mysqli_real_escape_string($drs_db,$display_footer);
// remove html tags from app name and sanitize
$display_appname=strip_tags($display_appname);
$clean_display_appname=mysqli_real_escape_string($drs_db,$display_appname);
// remove html tags from period effective help text and sanitize
$display_pereffhlp=strip_tags($display_pereffhlp);
$clean_display_pereffhlp=mysqli_real_escape_string($drs_db,$display_pereffhlp);
mysqli_query($drs_db,"update config set value=\"$clean_display_appname\" where name=\"app_name\"");
mysqli_query($drs_db,"update config set value=\"$display_banner\" where name=\"banner\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_footer\" where name=\"footer_message\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_pereffhlp\" where name=\"period_eff_help_txt\"");
echo "<meta http-equiv='refresh' content='0'>";
}
if ($update_colors) {
if ($newbgc) mysqli_query($drs_db,"update config set value=\"$newbgc\" where name=\"background_color\"");
if ($newmbgc) mysqli_query($drs_db,"update config set value=\"$newmbgc\" where name=\"menubg_color\"");
if ($newtc) mysqli_query($drs_db,"update config set value=\"$newtc\" where name=\"text_color\"");
if ($newlc) mysqli_query($drs_db,"update config set value=\"$newlc\" where name=\"link_color\"");
if ($newvlc) mysqli_query($drs_db,"update config set value=\"$newvlc\" where name=\"vlink_color\"");
if ($newhc) mysqli_query($drs_db,"update config set value=\"$newhc\" where name=\"heading_color\"");
echo "<meta http-equiv='refresh' content='0'>";
}
if ($reset_colors) {
mysqli_query($drs_db,"update config set value=defaultvalue where name like \"%_color\"");
echo "<meta http-equiv='refresh' content='0'>";
}
if ($add_banner) {
// do error checking
// remove html tags from banner name
$bnrname=strip_tags($bnrname);
// test for name supplied
if (strlen(trim($bnrname))) {
$namesuppld=true;
} else {
$namesuppld=false;
$namesuppld_err=true;
}
// test for name unique
if (mysqli_num_rows(mysqli_query($drs_db,"select bannerid from banners where bannername=\"$bnrname\""))) {
$nameunique=false;
$nameunique_err=true;
} else {
$nameunique=true;
}
if ($namesuppld && $nameunique) {
// sanitize banner name
$clean_bnrname=mysqli_real_escape_string($drs_db,$bnrname);
// modify the table
mysqli_query($drs_db,"insert into banners(bannername,bannercolor,textcolor) values(\"$clean_bnrname\",\"$bnrcolor\",\"$bnrtxtcolor\")");
}
}
if ($edit_banner) {
if ($delete_banner) {
mysqli_query($drs_db,"delete from banners where bannerid=\"$bnrid\"");
unset($edit_banner);
}
if ($update_banner) {
// do error checking
// remove html tags from banner name
$bnrname=strip_tags($bnrname);
// test for name supplied
if (strlen(trim($bnrname))) {
$namesuppld=true;
} else {
$namesuppld=false;
$namesuppld_err=true;
}
// test for name unique
if (mysqli_num_rows(mysqli_query($db,"select bannerid from banners where bannername=\"$bnrname\" and bannerid!=\"$bnrid\""))) {
if (mysqli_num_rows(mysqli_query($drs_db,"select bannerid from banners where bannername=\"$bnrname\""))) {
$nameunique=false;
$nameunique_err=true;
} else {
$nameunique=true;
}
} else {
$nameunique=true;
}
if ($namesuppld && $nameunique) {
// sanitize banner name
$clean_bnrname=mysqli_real_escape_string($drs_db,$bnrname);
// modify the table
mysqli_query($drs_db,"update banners set bannername=\"$bnrname\",bannercolor=\"$bnrcolor\",textcolor=\"$bnrtxtcolor\" where bannerid=\"$bnrid\"");
}
}
}
if ($update_misc) {
if ($logoutall) {
if ($ostype == 'WIN') {
$sessfileloc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"win_server_session_dir\""))[0];
} else {
$sessfileloc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"unix_server_session_dir\""))[0];
}
foreach (glob($sessfileloc."/*") as $sessfile) {
unlink($sessfile);
}
}
// test for sessttl supplied
if (strlen(trim($sessttl))) {
$ttlsuppld=true;
} else {
$ttlsuppld=false;
$ttlsuppld_err=true;
}
// test for sessdir supplied
if (strlen(trim($sessdir))) {
$dirsuppld=true;
} else {
$dirsuppld=false;
$dirsuppld_err=true;
}
if ($ttlsuppld && $dirsuppld) {
mysqli_query($drs_db,"update config set value=\"$sessttl\" where name=\"session_ttl_days\"");
if ($ostype == 'WIN') {
mysqli_query($drs_db,"update config set value=\"$sessdir\" where name=\"win_server_session_dir\"");
} else {
mysqli_query($drs_db,"update config set value=\"$sessdir\" where name=\"unix_server_session_dir\"");
}
}
}
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
echo "
<div id=\"configtabs\">
<ul>
<li><a href=\"#display_options\">Display Options</a></li>
<li><a href=\"#page_colors\">Page Colors</a></li>
<li><a href=\"#banners\">Banners</a></li>
<li><a href=\"#miscellaneous\">Miscellaneous Options</a></li>
</ul>
<div id=\"display_options\">
<form method=\"post\" action=\"config.php\">
";
$curapn=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"app_name\""))[0];
$curbnr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"banner\""))[0];
$curftr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"footer_message\""))[0];
$curpereffhlp=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"period_eff_help_txt\""))[0];
echo "
<font size=\"+1\"><b>Display Configuration Parameters</b></font><br><br><br><br>
";
echo "
Application Name (will appear at the top of every page):<br>
<input type=\"text\" name=\"display_appname\" size=\"80\" value=\"$curapn\">
<br><br><br>
";
echo "
Banner (will appear at the top and bottom of pages): &nbsp;<select name=\"display_banner\" id=\"sel-banner\">
";
$bannerqry=mysqli_query($drs_db,"select * from banners");
while ($bannerrow=mysqli_fetch_assoc($bannerqry)) {
if ($bannerrow["bannerid"]==$curbnr) {
printf("<option value=\"%s\" selected>%s</option>",$bannerrow["bannerid"],$bannerrow["bannername"]);
} else {
printf("<option value=\"%s\">%s</option>",$bannerrow["bannerid"],$bannerrow["bannername"]);
}
}
echo "
</select><br><br><br>
Footer Message (will appear at the bottom of pages):<br>
<input type=\"text\" name=\"display_footer\" size=\"80\" value=\"$curftr\"><br><br><br>
Period Effective Help Text :<br>
<textarea rows=\"4\" cols=\"80\" name=\"display_pereffhlp\" wrap=\"soft\">$curpereffhlp</textarea><br><br><br><br>
<input type=\"submit\" name=\"update_display\" value=\"Update Options\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset\" value=\"Reset\"><br><br><br>
</form>
";
echo "
</div>
<div id=\"page_colors\">
";
$curbgc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"background_color\""))[0];
$curmbgc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"menubg_color\""))[0];
$curtc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"text_color\""))[0];
$curlc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"link_color\""))[0];
$curvlc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"vlink_color\""))[0];
$curhc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"heading_color\""))[0];
echo "
<font size=\"+1\"><b>Color Configuration Parameters</b></font><br><br>
<table border=\"0\"><tr>
<td>
<form method=\"post\" action=\"config.php#page_colors\">
<b>Select the color you'd like to change then use the color picker to select a new color</b><br><br>
<table border=\"0\" cellpadding=\"10\">
<tr><td>Page background color</td><td>#<input type=\"text\" name=\"newbgc\" value=\"$curbgc\" id=\"bgcfield\" onFocus=\"ddcolorposter.echocolor(this, 'bgcbox')\"> <span id=\"bgcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Menu background color</td><td>#<input type=\"text\" name=\"newmbgc\" value=\"$curmbgc\" id=\"mbgcfield\" onFocus=\"ddcolorposter.echocolor(this, 'mbgcbox')\"> <span id=\"mbgcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Normal text color</td><td>#<input type=\"text\" name=\"newtc\" value=\"$curtc\" id=\"tcfield\" onFocus=\"ddcolorposter.echocolor(this, 'tcbox')\"> <span id=\"tcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Link color</td><td>#<input type=\"text\" name=\"newlc\" value=\"$curlc\" id=\"lcfield\" onFocus=\"ddcolorposter.echocolor(this, 'lcbox')\"> <span id=\"lcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Visited link color</td><td>#<input type=\"text\" name=\"newvlc\" value=\"$curvlc\" id=\"vlcfield\" onFocus=\"ddcolorposter.echocolor(this, 'vlcbox')\"> <span id=\"vlcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Heading color</td><td>#<input type=\"text\" name=\"newhc\" value=\"$curhc\" id=\"hcfield\" onFocus=\"ddcolorposter.echocolor(this, 'hcbox')\"> <span id=\"hcbox\" class=\"colorbox\">____</span></td></tr>
</table>
<br><br>
<input type=\"submit\" name=\"update_colors\" value=\"Update Colors\">&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset_colors\" value=\"Reset Colors to Defaults\">
</td>
<td>
<div id=\"pickerPanel\" class=\"dragPanel\">
<h4 id=\"pickerHandle\">&nbsp;</h4>
<div id=\"pickerDiv\">
<img id=\"pickerbg\" src=\"colorpicker/img/pickerbg.png\" alt=\"\">
<div id=\"selector\"><img src=\"colorpicker/img/select.gif\"></div>
</div>
<div id=\"hueBg\">
<div id=\"hueThumb\"><img src=\"colorpicker/img/hline.png\"></div>
</div>
<div id=\"pickervaldiv\">
<form name=\"pickerform\" onsubmit=\"return pickerUpdate()\">
<font size=\"-3\">
<br />
R <input name=\"pickerrval\" id=\"pickerrval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
H <input name=\"pickerhval\" id=\"pickerhval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
<br />
G <input name=\"pickergval\" id=\"pickergval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
S <input name=\"pickergsal\" id=\"pickersval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
<br />
B <input name=\"pickerbval\" id=\"pickerbval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
V <input name=\"pickervval\" id=\"pickervval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
<br />
<br />
# <input name=\"pickerhexval\" id=\"pickerhexval\" type=\"text\" value=\"0\" size=\"6\" maxlength=\"6\" />
<br />
</font>
</form>
</div>
<div id=\"pickerSwatch\">&nbsp;</div>
</div>
</td>
</tr></table>
";
echo "
</form>
</div>
<div id=\"banners\">
";
if ($nameunique_err) format_message(1,"Banner name already exists. Please try another.");
if ($namesuppld_err) format_message(1,"Banner name cannot be blank.");
if ($edit_banner) {
// set form options for editing
$sectiontitle="<font size=\"+1\"><b>Modify Banner</b></font><br><br>";
$formtag="<form method=\"post\" action=\"config.php?edit_banner=1#banners\">";
$buttontags="
<input type=\"hidden\" name=\"bnrid\" value=\"$bnrid\">
<input type=\"submit\" name=\"update_banner\" value=\"Update Banner\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"delete_banner\" value=\"Delete Banner\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset\" value=\"Reset\"><br>
";
// pull current values from database
$currentvalues=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from banners where bannerid=$bnrid"));
$bnrname=$currentvalues["bannername"];
$bnrcolor=$currentvalues["bannercolor"];
$bnrtextcolor=$currentvalues["textcolor"];
$bnrcoloropts="";
foreach($basic_colors as $cname => $chex) {
if ($chex==$bnrcolor) {
$bnrcoloropts=$bnrcoloropts . "<option value=\"$chex\" selected>$cname</option>";
} else {
$bnrcoloropts=$bnrcoloropts . "<option value=\"$chex\">$cname</option>";
}
}
$bnrtextcoloropts="";
foreach($basic_colors as $cname => $chex) {
if ($chex==$bnrtextcolor) {
$bnrtextcoloropts=$bnrtextcoloropts . "<option value=\"$chex\" selected>$cname</option>";
} else {
$bnrtextcoloropts=$bnrtextcoloropts . "<option value=\"$chex\">$cname</option>";
}
}
} else {
// set form options for add
$sectiontitle="<font size=\"+1\"><b>Add New Banner</b></font><br><br>";
$formtag="<form method=\"post\" action=\"config.php#banners\">";
$bnrname="";
$buttontags="
<input type=\"submit\" name=\"add_banner\" value=\"Add Banner\">
";
// set default values
$bnrcolor="#000000";
$bnrtextcolor="#FFFFFF";
$bnrcoloropts="";
foreach($basic_colors as $cname => $chex) {
if ($chex==$bnrcolor) {
$bnrcoloropts=$bnrcoloropts . "<option value=\"$chex\" selected>$cname</option>";
} else {
$bnrcoloropts=$bnrcoloropts . "<option value=\"$chex\">$cname</option>";
}
}
$bnrtextcoloropts="";
foreach($basic_colors as $cname => $chex) {
if ($chex==$bnrtextcolor) {
$bnrtextcoloropts=$bnrtextcoloropts . "<option value=\"$chex\" selected>$cname</option>";
} else {
$bnrtextcoloropts=$bnrtextcoloropts . "<option value=\"$chex\">$cname</option>";
}
}
}
echo "
$sectiontitle
$formtag
<table border=\"0\">
<tr><td>
Banner Name (text displayed in the banner): &nbsp;<input type=\"text\" name=\"bnrname\" size=\"40\" value=\"$bnrname\"><br><br>
Banner Color (background color of the banner): &nbsp;
<select name=\"bnrcolor\">
$bnrcoloropts
</select><br><br>
Banner Text Color (text color of the banner, different than banner color): &nbsp;
<select name=\"bnrtxtcolor\">
$bnrtextcoloropts
</select><br><br>
</td></tr>
</table>
$buttontags
</form>
<br><hr>
";
// show the table of entities
$existingdata=mysqli_query($drs_db,"select * from banners where bannerid!=1 order by bannerid asc");
echo "
<b>Existing Banners</b>&nbsp;&nbsp;&nbsp;<font size=\"-1\">Click on the Banner ID to edit.</font><br><br>
<table border=\"1\">
<tr><th>Banner ID</th><th>Banner</th></tr>
";
while ($tablerow=mysqli_fetch_assoc($existingdata)) {
printf("
<tr>
<td><a href=\"config.php?edit_banner=1&bnrid=%s#banners\">%s</a></td>
<td align=\"center\" bgcolor=\"%s\"><font color=\"%s\">%s</font></td>
</tr>",
$tablerow["bannerid"],$tablerow["bannerid"],
$tablerow["bannercolor"],$tablerow["textcolor"],$tablerow["bannername"]);
}
echo "</table>";
echo "
</div>
<div id=\"miscellaneous\">
<form method=\"post\" action=\"config.php#miscellaneous\">
";
if ($ttlsuppld_err) format_message(1,"Session expiration time cannot be blank.");
if ($dirsuppld_err) format_message(1,"Server session file directory cannot be blank.");
$curttl=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"session_ttl_days\""))[0];
if ($ostype == 'WIN') {
$curssdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"win_server_session_dir\""))[0];
} else {
$curssdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"unix_server_session_dir\""))[0];
}
echo "
<font size=\"+1\"><b>Miscellaneous Configuration Parameters</b></font><br><br><br><br>
Session expiration time (users will have to log in again after this long) : &nbsp;<input type=\"text\" name=\"sessttl\" size=\"3\" value=\"$curttl\"> days<br><br>
Server session file directory (must be writable by the web server process) : <br><input type=\"text\" name=\"sessdir\" size=\"40\" value=\"$curssdir\"><br><br>
Force logout of all users &nbsp;<input type=\"checkbox\" name=\"logoutall\"><br><br><br><br>
<input type=\"submit\" name=\"update_misc\" value=\"Update Options\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset\" value=\"Reset\"><br>
</div>
</div>
";
echo "<br>";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

238
distfiles/create.php Normal file
View File

@@ -0,0 +1,238 @@
<?php
/*
create.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// redirect to writeups.php on change cancel
if ($_REQUEST['cancel']) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:writeups.php");
exit();
}
// import session variables
if (isset($_SESSION['personid'])) $personid=$_SESSION['personid'];
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming[]
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST[] to $incoming[]
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
$create=$incoming['create'];
$device=$incoming['device'];
$period=$incoming['period'];
$period_effective=$incoming['period_effective'];
$reported_by=$incoming['reported_by'];
$report_date=$incoming['report_date'];
$report_time=$incoming['report_time'];
$subsystem=$incoming['subsystem'];
$discrepancy_text=$incoming['discrepancy_text'];
$status=$incoming['status'];
// assign variables from constants
$appname=APP_NAME;
if ($print=="Printer Friendly") {
$mbgcolor=P_MENUBG_COLOR;
} else {
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($drs_db,"persons","id","role",$personid);
framework("begin","$appname","New Writeup",$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
// determine today's date and make it the default
$today=date("Y-m-d");
$now=date("H:i:s");
if (!$report_date || $report_date=="automatic") $report_date=$today;
if (!$report_time || $report_time=="automatic") $report_time=$now;
if ($create) {
// add the entry if create is pressed
if ($discrepancy_text && $reported_by && $device && $subsystem && $period) {
// sanitize and fix blank date and time
$report_date=mysqli_real_escape_string($drs_db,$report_date);
$report_time=mysqli_real_escape_string($drs_db,$report_time);
if (!$report_date) $report_date=$today;
if (!$report_time) $report_time=$now;
// remove html tags from discrepancy text and sanitize
$discrepancy_text=strip_tags($discrepancy_text);
$clean_discrepancy_text=mysqli_real_escape_string($drs_db,$discrepancy_text);
$clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by);
// add the record to writeups
mysqli_query($drs_db,"insert into writeups(device,period,period_effective,reported_by,report_date,report_time,subsystem,discrepancy_text,status)
values (\"$device\",\"$period\",\"$period_effective\",\"$clean_reported_by\",\"$report_date\",\"$report_time\",\"$subsystem\",\"$clean_discrepancy_text\",\"$status\")");
}
}
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
// display the form
if ($create) {
if ($discrepancy_text && $reported_by) {
format_message(0,"<strong>Writeup created.</strong> You may create another writeup or <a href=\"writeups.php\">return to Open Writeups page.</a>");
$preserve=FALSE;
}
if (!$device) {
format_message(1,"You didn't select a device. Please try again.");
$preserve=TRUE;
}
if (!$subsystem) {
format_message(1,"You didn't select a subsystem. Please try again.");
$preserve=TRUE;
}
if (!$period) {
format_message(1,"You didn't select a period. Please try again.");
$preserve=TRUE;
}
if (!$discrepancy_text) {
format_message(1,"You didn't enter any discrepancy text. Please try again.");
$preserve=TRUE;
}
if (!$reported_by) {
format_message(1,"You didn't enter your name in the Reported by: block. Please try again.");
$preserve=TRUE;
}
} else {
$preserve=FALSE;
}
echo "
<form method=\"post\" action=\"create.php\">
";
// start writeup entry section
if ($status==1) $statusind="<b><font color=\"#FF0000\">OPEN</font></b>";
if ($status==2) $statusind="<b><font color=\"#008000\">CLSD</font></b>";
if ($status==3) $statusind="<b><font color=\"#FFFF00\">DFRD</font></b>";
echo "
<table border=\"0\" cellpadding=\"5\">
<tr>
<td align=\"left\">Device<br>
<select name=\"device\" id=\"device\">
<option value=\"\">Please select...</option>
";
$trow=mysqli_query($drs_db,"select * from devices where active is true order by id asc");
while ($titem=mysqli_fetch_assoc($trow)) {
if ($device==$titem["id"] && $preserve) {
printf("<option value=\"%s\" selected>%s</option>",$titem["id"],$titem["name"]);
} else {
printf("<option value=\"%s\">%s</option>",$titem["id"],$titem["name"]);
}
}
echo "
</select></td>
<td align=\"left\">Subsystem<br>
<select name=\"subsystem\" id=\"subsystem\">
<option value=\"\">Please select...</option>
";
$ssrow=mysqli_query($drs_db,"select * from subsystems where active is true order by id asc");
while ($ssitem=mysqli_fetch_assoc($ssrow)) {
if ($subsystem==$ssitem["id"] && $preserve) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
} else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
}
}
echo "
</select></td><td></td>
</tr>
<tr>
<td align=\"left\">Period<br>
<select name=\"period\" id=\"period\">
<option value=\"\">Please select...</option>
";
$prow=mysqli_query($drs_db,"select * from periods where active is true order by times asc");
while ($pitem=mysqli_fetch_assoc($prow)) {
if ($period==$pitem["id"] && $preserve) {
printf("<option value=\"%s\" title=\"Period %s\" selected>%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]);
} else {
printf("<option value=\"%s\" title=\"Period %s\">%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]);
}
}
if (!$preserve) {
$report_date="automatic";
$report_time="automatic";
$discrepancy_text="";
$reported_by="";
}
$effstate=$nefstate="";
if ($preserve) {
if($period_effective==1) $effstate="checked";
if($period_effective==0) $nefstate="checked";
} else {
$effstate="checked";
}
echo "
</select></td>
<td align=\"left\" >Report Date<br>
<input type=\"text\" name=\"report_date\" size=\"10\" maxlength=\"10\" value=\"$report_date\" id=\"singledatepicker\" title=\"Format: YYYY-MM-DD\"></td>
<td align=\"left\">Report Time<br>
<input type=\"text\" name=\"report_time\" size=\"8\" maxlength=\"8\" value=\"$report_time\" title=\"Format: HH:MM:SS\"></td>
</tr>
<tr><td></td><td></td><td></td></tr>
<tr><td colspan=\"3\">
Discrepancy <font size=\"-2\">(required)</font><br>
<textarea rows=\"10\" cols=\"80\" name=\"discrepancy_text\" wrap=\"soft\">$discrepancy_text</textarea><br>
</tr>
<tr>
<td>Reported by <font size=\"-2\">(required)</font><br>
<input type=\"text\" name=\"reported_by\" size=\"30\" value=\"$reported_by\" title=\"Who to contact with questions about this writeup\"></td>
<td>Period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br>
<input type=\"radio\" name=\"period_effective\" value=\"1\" $effstate> Yes &nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"radio\" name=\"period_effective\" value=\"0\" $nefstate> No
</td>
<td align=\"right\" valign=\"bottom\"><input type=\"submit\" name=\"create\" value=\"Submit Writeup\" id=\"createbutton\"></td>
</tr>
<tr><td></td><td></td><td></td></tr>
<td></td><td></td><td align=\"right\" valign=\"bottom\">
<input type=\"submit\" name=\"cancel\" value=\"Cancel\" id=\"usercancelbutton\"></td>
</tr>
</table>
<input type=\"hidden\" name=\"status\" value=\"1\">
</form>
<br>
";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

1096
distfiles/dbadmin.php Normal file

File diff suppressed because it is too large Load Diff

431
distfiles/gpl.php Normal file
View File

@@ -0,0 +1,431 @@
<?php
/*
gpl.php
OpenMTS Online Maintenance Tracking System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// redirect to index.php on cancel button press
if ($_REQUEST['cancel']) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:index.php");
exit();
}
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST to $incoming
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
// define local functions
// assign variables from constants
$appname=APP_NAME;
if ($print=="Printer Friendly") {
$sbcolor=P_SIDEBAR_COLOR;
$mbgcolor=P_MENUBG_COLOR;
} else {
$sbcolor=SIDEBAR_COLOR;
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($mts_db,"users","id","role",$userid);
framework("begin","$appname","GNU General Public License",$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
echo "
<center>
<pre>
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The \"Program\", below,
refers to any such program or work, and a \"work based on the Program\"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term \"modification\".) Each licensee is addressed as \"you\".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and \"any
later version\", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the \"copyright\" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a \"copyright disclaimer\" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
</pre>
</center>
";
echo "<br>";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

896
distfiles/groups.php Normal file
View File

@@ -0,0 +1,896 @@
<?php
/*
groups.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// redirect to groups.php on cancel button press
if ($_REQUEST['cancel']) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:groups.php");
exit();
}
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST to $incoming
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
$action=$incoming['action'];
$save=$incoming['save'];
$targets=$incoming['targets'];
$group=$incoming['group'];
$name=$incoming['name'];
$expandgrp=$incoming['expandgrp'];
$search=$incoming['search'];
$s_status=$incoming['s_status'];
$s_device=$incoming['s_device'];
$s_subsystem=$incoming['s_subsystem'];
$s_period=$incoming['s_period'];
$s_report_date_start=$incoming['s_report_date_start'];
$s_report_date_end=$incoming['s_report_date_end'];
$s_report_time_start=$incoming['s_report_time_start'];
$s_report_time_end=$incoming['s_report_time_end'];
$s_discrepancy_text=$incoming['s_discrepancy_text'];
$s_reported_by=$incoming['s_reported_by'];
$s_period_effective=$incoming['s_period_effective'];
$edit_status=$incoming['edit_status'];
$edit_action_by=$incoming['edit_action_by'];
$edit_action_reason=$incoming['edit_action_reason'];
$edit_action_date=$incoming['edit_action_date'];
$edit_action_time=$incoming['edit_action_time'];
$edit_action_text=$incoming['edit_action_text'];
// define local functions
// assign variables from constants
$appname=APP_NAME;
if ($print=="Printer Friendly") {
$sbcolor=P_SIDEBAR_COLOR;
$mbgcolor=P_MENUBG_COLOR;
} else {
$sbcolor=SIDEBAR_COLOR;
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($drs_db,"users","id","role",$userid);
framework("begin","$appname","Writeup Groups",$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
// determine today's date and make it the default
$today=date("Y-m-d");
$now=date("H:i:s");
// get max report date from writeups table, validate input dates/times and set defaults
$maxrepdate_qry=mysqli_query($drs_db,"select max(report_date) from writeups");
$maxrepdate=mysqli_fetch_row($maxrepdate_qry)[0];
if (!$s_report_date_start || !validateDate($s_report_date_start)) $s_report_date_start=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 30 day)"))[0];
if (!$s_report_date_end || !validateDate($s_report_date_end)) $s_report_date_end=$maxrepdate;
if (!$s_report_time_start || !validateTime($s_report_time_start)) $s_report_time_start="00:00:00";
if (!$s_report_time_end || !validateTime($s_report_time_end)) $s_report_time_end="23:59:59";
if (!$edit_action_date || !validateDate($edit_action_date)) $edit_action_date=$today;
if (!$edit_action_time || !validateTime($edit_action_time)) $edit_action_time=$now;
if ($action=="add" && $role && $save) {
$fail=false;
if (!$group) {
// group was not supplied, so create a new one
mysqli_query($drs_db,"insert into groups(name) value(\"\")");
$fail=mysqli_error($drs_db);
$group=mysqli_insert_id($drs_db);
}
foreach ($targets as $target) {
// add writeup to the group
if (!mysqli_num_rows(mysqli_query($drs_db,"select id from links where writeupid=\"$target\" and linkgroup=\"$group\""))) {
// target is not already a member of this group
mysqli_query($drs_db,"insert into links (linkgroup,writeupid) values($group,$target)");
$fail=mysqli_error($drs_db);
}
}
} elseif ($action=="remove" && $role && $save) {
$fail=false;
$writeups=array();
$writeups_qry=mysqli_query($drs_db,"select writeupid from links where linkgroup=\"$group\"");
while ($writeuprow=mysqli_fetch_row($writeups_qry)) {
$writeups[]=$writeuprow[0];
}
foreach ($writeups as $writeup) {
if (!in_array($writeup,$targets)) {
// remove writeup from group
mysqli_query($drs_db,"delete from links where writeupid=$writeup and linkgroup=$group");
$fail=mysqli_error($drs_db);
}
}
} elseif ($action=="dissolve" && $role && $save) {
$fail=false;
// unassign all writeups from a group and delete the group
mysqli_query($drs_db,"delete from links where linkgroup=$group");
$fail=mysqli_error($drs_db);
mysqli_query($drs_db,"delete from groups where id=$group");
$fail=mysqli_error($drs_db);
} elseif ($action=="setname" && $role && $save) {
$fail=false;
// change the name of a group
// remove html tags from group name and sanitize
$name=strip_tags($name);
$clean_name=mysqli_real_escape_string($drs_db,$name);
mysqli_query($drs_db,"update groups set name=\"$clean_name\" where id=\"$group\"");
$fail=mysqli_error($drs_db);
} elseif ($action=="takeaction" && $role && $save) {
$fail=false;
// set the status, action by, reason action date/time and append supplied text to action text
// for all ids in group
if ($edit_action_text) {
// sanitize date and time
$edit_action_date=mysqli_real_escape_string($drs_db,$edit_action_date);
$edit_action_time=mysqli_real_escape_string($drs_db,$edit_action_time);
// remove html tags from action text and sanitize
$edit_action_text=strip_tags($edit_action_text);
$clean_edit_action_text=mysqli_real_escape_string($drs_db,$edit_action_text);
// update the group members
$groupmem_qry=mysqli_query($drs_db,"select writeupid from links where linkgroup=\"$group\"");
while ($edit_row=mysqli_fetch_row($groupmem_qry)) {
$writeup_to_edit=$edit_row[0];
$writeup_action_text=dblookup($drs_db,"writeups","id","action_text",$writeup_to_edit);
$full_action_text=$writeup_action_text." STATUS CHANGED: ".$clean_edit_action_text;
mysqli_query($drs_db,"update writeups set status=\"$edit_status\",action_by=\"$edit_action_by\",action_date=\"$edit_action_date\",action_time=\"$edit_action_time\",action_reason=\"$edit_action_reason\",action_text=\"$full_action_text\" where id=\"$writeup_to_edit\"");
$fail=mysqli_error($drs_db);
}
}
}
if ($search) {
// strip whitespace from beginning and end of text fields
$s_reported_by=trim($s_reported_by);
$s_action_text=trim($s_action_text);
$s_discrepancy_text=trim($s_discrepancy_text);
// build the query string
$query_string="";
// device
if ($s_device) {
$query_string="{$query_string}(";
$device_param="Devices:";
foreach ($s_device as $dev_val) {
$query_string="{$query_string}device=\"{$dev_val}\" or ";
$device_dsp=dblookup($drs_db,"devices","id","name",$dev_val);
$device_param="{$device_param} {$device_dsp}, ";
}
$device_param=rtrim($device_param,", ");
$num_devices=mysqli_num_rows(mysqli_query($drs_db,"select id from devices"));
if (count($s_device)==$num_devices) $device_param="Devices: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// subsystem
if ($s_subsystem) {
$query_string="{$query_string}(";
$subsystem_param="Subsystems:";
foreach ($s_subsystem as $sub_val) {
$query_string="{$query_string}subsystem=\"{$sub_val}\" or ";
$subsystem_dsp=dblookup($drs_db,"subsystems","id","name",$sub_val);
$subsystem_param="{$subsystem_param} {$subsystem_dsp}, ";
}
$subsystem_param=rtrim($subsystem_param,", ");
$num_subsystems=mysqli_num_rows(mysqli_query($drs_db,"select id from subsystems"));
if (count($s_subsystem)==$num_subsystems) $subsystem_param="Subsystems: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// period
if ($s_period) {
$query_string="{$query_string}(";
$period_param="Periods:";
foreach ($s_period as $per_val) {
$query_string="{$query_string}period=\"{$per_val}\" or ";
$period_dsp=$per_val;
$period_param="{$period_param} {$period_dsp}, ";
}
$period_param=rtrim($period_param,", ");
$num_periods=mysqli_num_rows(mysqli_query($drs_db,"select id from periods"));
if (count($s_period)==$num_periods) $period_param="Periods: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// period_effective
if ($s_period_effective) {
$query_string="{$query_string}(";
$eff_param="Period effective:";
foreach ($s_period_effective as $eff_val) {
$query_string="{$query_string}period_effective=\"{$eff_val}\" or ";
if ($eff_val=="0") $eff_dsp="<font color=\"#FF0000\">NEF</font>";
if ($eff_val=="1") $eff_dsp="<font color=\"#00FF00\">EFF</font>";
$eff_param="{$eff_param} {$eff_dsp}, ";
}
$eff_param=rtrim($eff_param,", ");
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// status
if ($s_status) {
$query_string="{$query_string}(";
$status_param="Status:";
foreach ($s_status as $stat_val) {
$query_string="{$query_string}status=\"{$stat_val}\" or ";
if ($stat_val=="1") $stat_dsp="<font color=\"#FF0000\">OPEN</font>";
if ($stat_val=="2") $stat_dsp="<font color=\"#00FF00\">CLSD</font>";
if ($stat_val=="3") $stat_dsp="<font color=\"#FFFF00\">DFRD</font>";
$status_param="{$status_param} {$stat_dsp}, ";
}
$status_param=rtrim($status_param,", ");
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// report date
$query_string="{$query_string}(";
$query_string="{$query_string}report_date between \"{$s_report_date_start}\" and \"{$s_report_date_end}\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$reportdate_param="Report date between {$s_report_date_start} and {$s_report_date_end}";
// report time
$query_string="{$query_string}(";
$query_string="{$query_string}report_time between \"{$s_report_time_start}\" and \"{$s_report_time_end}\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$reporttime_param="Report time between {$s_report_time_start} and {$s_report_time_end}";
// discrepancy text
if ($s_discrepancy_text) {
$query_string="{$query_string}(";
$query_string="{$query_string}discrepancy_text like \"%{$s_discrepancy_text}%\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$discrepancytext_param="Text in discrepancy: {$s_discrepancy_text}";
} else {
$discrepancytext_param="Text in discrepancy: any";
}
// reported by
if ($s_reported_by) {
$query_string="{$query_string}(";
$query_string="{$query_string}reported_by like \"%{$s_reported_by}%\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$repby_param="Text in Reported by: {$s_reported_by}";
} else {
$repby_param="Text in Reported by: any";
}
$query_string=rtrim($query_string," and ");
$query_string="select * from writeups where {$query_string} order by report_date asc";
}
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
if ($action=="add") {
if (count($targets) > 1) {
$plural="s";
} else {
$plural="";
}
if ($save && !$fail) {
format_message(0,"<strong>Writeup$plural successfully added.</strong> <a href=\"groups.php\">Return to Writeup Groups page.</a>");
} elseif ($save && $fail) {
format_message(2,"<strong>An error was encountered when adding writeup$plural.</strong> The error was \" $fail \"");
}
if ($save) {
// show the group
$mode="view";
group_table($group,$role,$mode);
if ($role) {
// show buttons
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<input type=\"hidden\" name=\"action\" value=\"add\">
<button name=\"action\" value=\"add\" type=\"submit\">Add writeups to this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"remove\" type=\"submit\">Remove writeups from this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"dissolve\" type=\"submit\">Dissolve this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"setname\" type=\"submit\">Set name for this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"takeaction\" type=\"submit\">Take group action</button>
</form>
";
}
} else {
if ($role){
// show mini search with discrepancy data only
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<input type=\"hidden\" name=\"action\" value=\"add\">
<b>Search Parameters</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter search terms to find writeups to add to the group.<br>
<table border=\"0\" cellpadding=\"5\">
<tr>
<td align=\"left\">
";
// Status cell **********************
echo "
Status<br>
";
if ($search) {
$openstate=$clsdstate=$dfrdstate="";
if (in_array("1",$s_status,true)) $openstate="selected";
if (in_array("2",$s_status,true)) $clsdstate="selected";
if (in_array("3",$s_status,true)) $dfrdstate="selected";
} else {
$openstate=$clsdstate=$dfrdstate="selected";
}
echo "
<select name=\"s_status[]\" id=\"ms-status\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option title=\"Open\" value=\"1\" $openstate>OPEN</option>
<option title=\"Closed\" value=\"2\" $clsdstate>CLSD</option>
<option title=\"Deferred\" value=\"3\" $dfrdstate>DFRD</option>
</select>
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Device cell *********************
echo "
Device<br>
<select name=\"s_device[]\" id=\"ms-device\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
";
$drow=mysqli_query($drs_db,"select * from devices order by id asc");
while ($ditem=mysqli_fetch_assoc($drow)) {
if (!$search || in_array($ditem["id"],$s_device,true)) {
printf("<option value=\"%s\" selected>%s</option>",$ditem["id"],$ditem["name"]);
} else {
printf("<option value=\"%s\">%s</option>",$ditem["id"],$ditem["name"]);
}
}
echo "
</select>
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Subsystem cell *******************
echo "
Subsystem<br>
<select name=\"s_subsystem[]\" id=\"ms-subsystem\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
";
$ssrow=mysqli_query($drs_db,"select * from subsystems order by id asc");
while ($ssitem=mysqli_fetch_assoc($ssrow)) {
if (!$search || in_array($ssitem["id"],$s_subsystem,true)) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
} else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
}
}
echo "
</select>
";
// **********************************
echo "
</td>
";
echo "
</tr>
<tr>
<td align=\"left\">
";
// Period cell **********************
echo "
Period<br>
<select name=\"s_period[]\" id=\"ms-period\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
";
$prow=mysqli_query($drs_db,"select * from periods order by times asc");
while ($pitem=mysqli_fetch_assoc($prow)) {
if (!$search || in_array($pitem["id"],$s_period,true)) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]);
} else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]);
}
}
echo "
</select>
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Report Date cell *****************
echo "
Report Date Between<br>
<input type=\"text\" name=\"s_report_date_start\" size=\"10\" maxlength=\"10\" value=\"$s_report_date_start\" id=\"sdp-report_date\" title=\"Format: YYYY-MM-DD\">
&nbsp;and&nbsp;
<input type=\"text\" name=\"s_report_date_end\" size=\"10\" maxlength=\"10\" value=\"$s_report_date_end\" id=\"edp-report_date\" title=\"Format: YYYY-MM-DD\">
";
// **********************************
echo "
</td>
";
echo "
<td align=\"left\">
";
// Report Time cell *****************
echo "
Report Time Between<br>
<input type=\"text\" name=\"s_report_time_start\" size=\"8\" maxlength=\"8\" value=\"$s_report_time_start\" title=\"Format: HH:MM:SS\">
&nbsp;and&nbsp;
<input type=\"text\" name=\"s_report_time_end\" size=\"8\" maxlength=\"8\" value=\"$s_report_time_end\" title=\"Format: HH:MM:SS\">
";
// **********************************
echo "
</td>
</tr>
<tr><td></td><td></td><td></td></tr>
<tr>
<td colspan=\"3\">
";
// Discrepancy text cell ************
echo "
Words in Discrepancy<br>
<textarea rows=\"5\" cols=\"80\" name=\"s_discrepancy_text\" wrap=\"soft\">$s_discrepancy_text</textarea><br>
";
// **********************************
echo "
</td>
</tr>
<tr>
<td align=\"left\">
";
// Reported by cell *****************
echo "
Reported by<br>
<input type=\"text\" name=\"s_reported_by\" size=\"30\" value=\"$s_reported_by\">
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Period effective cell ************
echo "
Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective.
Otherwise, answer Effective. \"><br>
";
if ($search) {
$effstate=$nefstate="";
if (in_array("1",$s_period_effective,true)) $effstate="selected";
if (in_array("0",$s_period_effective,true)) $nefstate="selected";
} else {
$effstate=$nefstate="selected";
}
echo "
<select name=\"s_period_effective[]\" id=\"ms-period_effective\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option value=\"1\" $effstate title=\"Training objectives were achieved\">Effective</option>
<option value=\"0\" $nefstate title=\"Training objectives were not achieved\">Non-effective</option>
</select>
</td>
";
// **********************************"
echo "
<td align=\"right\">
<input type=\"submit\" name=\"search\" value=\"Find Writeups\">
</td></tr>
</table>
</form>";
// display the results
if ($search) {
$writeup_qry=mysqli_query($drs_db,$query_string);
if (mysqli_num_rows($writeup_qry)) {
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<input type=\"hidden\" name=\"action\" value=\"add\">
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
<th style=\"width:1%;\">Select</th>
<th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Device</th>
<th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th>
</tr>
";
while ($tablerow = mysqli_fetch_assoc($writeup_qry)) {
// determine effective icon
if($tablerow["period_effective"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">";
} else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">";
}
// determine status indicator
if ($tablerow['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>";
if ($tablerow['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>";
if ($tablerow['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>";
// convert device number to name
$dname=dblookup($drs_db,"devices","id","name",$tablerow["device"]);
$disc_txt="{$tablerow["discrepancy_text"]}";
// determine if this is a member of a group
$member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\"");
$is_member=mysqli_num_rows($member_qry);
if ($is_member) {
$group_count=$is_member;
$member_group=mysqli_fetch_row($member_qry)[0];
$member_group_name=dblookup($drs_db,"groups","id","name",$member_group);
if ($member_group_name) {
$imgtitle="Member of group: $member_group_name";
} else {
$imgtitle="Member of group ID: $member_group";
}
if ($group_count == 1) {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php?group=$member_group\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"$imgtitle\"></a></div>";
} else {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"View writeup groups\"></a></div>";
}
}
// print table row
printf(
"<tr>
<td align=\"center\" valign=\"top\"><input type=\"checkbox\" name=\"targets[]\" value=\"%s\"></td>
<td align=\"center\" valign=\"top\"><a href=\"writeupdetail.php?id=%s\" title=\"View or change details of this writeup\">%s</a></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td>
</tr>\n",
$tablerow["id"],
$tablerow["id"],$tablerow["id"],
$statusind,
$tablerow["report_date"],
$dname,
$tablerow["reported_by"],
$disc_txt,
$eff_icon
);
}
echo "
</table>\n
<br>
Select the writeups above you'd like to add to the group and &nbsp;&nbsp;
<button name=\"save\" value=\"save\" type=\"submit\">Save group</button>
<br><br>
If nothing looks appropriate, you can modify the search parameters above and search again or select another menu option.
</form>";
} else {
echo "
<b>No writeups match your search parameters.</b><br><br>
You can modify the search parameters above and search again or select another menu option.
";
}
}
}
}
} elseif ($action=="remove") {
if ($save && !$fail) {
format_message(0,"<strong>Group successfully modified.</strong> <a href=\"groups.php\">Return to Writeup Groups page.</a>");
} elseif ($save && $fail) {
format_message(2,"<strong>An error was encountered when modifying group.</strong> The error was \" $fail \"");
}
if ($role && mysqli_num_rows(mysqli_query($drs_db,"select id from links where linkgroup=$group"))) {
// show group table with everything selected
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<input type=\"hidden\" name=\"action\" value=\"remove\">
";
group_table($group,$role,"select","all");
echo "
Deselect the writeups you want to remove from this group. <br><br>
<b>NOTE:</b> Deselecting them all will dissolve the group.
<br><br>
<button name=\"save\" value=\"save\" type=\"submit\">Modify this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"cancel\" value=\"cancel\" type=\"submit\">Cancel</button>
</form>
";
}
} elseif ($action=="dissolve") {
if ($save && !$fail) {
format_message(0,"<strong>Group dissolved.</strong> <a href=\"groups.php\">Return to Writeup Groups page.</a>");
} elseif ($save && $fail) {
format_message(2,"<strong>An error was encountered when dissolving the group.</strong> The error was \" $fail \"");
} else {
if ($role) {
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<input type=\"hidden\" name=\"action\" value=\"dissolve\">
<b>NOTE:</b> Dissolving this group will unassign its member writeups and remove the group.<br><br>
It will not delete any writeups or affect their assignment to other groups.<br><br>
<button name=\"save\" value=\"save\" type=\"submit\">Dissolve this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"cancel\" value=\"cancel\" type=\"submit\">Cancel</button>
</form>
";
}
// show the group
$mode="view";
group_table($group,$role,$mode);
if ($role) {
// show buttons
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<button name=\"action\" value=\"add\" type=\"submit\">Add writeups to this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"remove\" type=\"submit\">Remove writeups from this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"dissolve\" type=\"submit\">Dissolve this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"setname\" type=\"submit\">Set name for this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"takeaction\" type=\"submit\">Take group action</button>
</form>
";
}
}
} elseif ($action=="setname") {
if ($save && !$fail) {
format_message(0,"<strong>Group name updated.</strong> <a href=\"groups.php\">Return to Writeup Groups page.</a>");
} elseif ($save && $fail) {
format_message(2,"<strong>An error was encountered when updating the group name.</strong> The error was \" $fail \"");
}
if ($role) {
// get current group name if there is one and show the form
$curr_name=dblookup($drs_db,"groups","id","name",$group);
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<input type=\"hidden\" name=\"action\" value=\"setname\">
<input type=\"text\" name=\"name\" size=\"60\" value=\"$curr_name\">
<button name=\"save\" value=\"save\" type=\"submit\">Update group name</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"cancel\" value=\"cancel\" type=\"submit\">Cancel</button>
</form>
";
}
// show the group
$mode="view";
group_table($group,$role,$mode);
if ($role) {
// show buttons
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<button name=\"action\" value=\"add\" type=\"submit\">Add writeups to this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"remove\" type=\"submit\">Remove writeups from this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"dissolve\" type=\"submit\">Dissolve this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"setname\" type=\"submit\">Set name for this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"takeaction\" type=\"submit\">Take group action</button>
</form>
";
}
} elseif ($action=="takeaction") {
if ($save && !$fail) {
format_message(0,"<strong>Group action completed.</strong> <a href=\"groups.php\">Return to Writeup Groups page.</a>");
} elseif ($save && $fail) {
format_message(2,"<strong>An error was encountered when taking group action.</strong> The error was \" $fail \"");
}
// show the group
$mode="view";
group_table($group,$role,$mode);
if ($role && ! $save) {
// show action form
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<input type=\"hidden\" name=\"action\" value=\"takeaction\">
<table border=\"0\" cellpadding=\"5\" width=\"600\">
<tr>
<td>Status<br>
<select name=\"edit_status\" id=\"status\">
<option value=\"1\">OPEN</option>
<option value=\"2\"selected>CLOSED</option>
<option value=\"3\">DEFERRED</option>
</select>
</td>
<td>Action taken by<br>
";
if ($role==ADMIN) {
// allow selection of tech name
echo "
<select name=\"edit_action_by\" id=\"user\">
";
$persrow=mysqli_query($drs_db,"select id,firstname,lastname from users where active is true order by lastname asc");
while ($persitem=mysqli_fetch_assoc($persrow)) {
if ($userid==$persitem["id"]) {
printf("<option value=\"%s\" selected>%s %s</option>",$persitem["id"],$persitem["firstname"],$persitem["lastname"]);
} else {
printf("<option value=\"%s\">%s %s</option>",$persitem["id"],$persitem["firstname"],$persitem["lastname"]);
}
}
echo "
</select>
";
} else {
// limit the choice to the tech in question
echo "
<select name=\"edit_action_by\" id=\"user\">
";
$persrow=mysqli_query($drs_db,"select id,firstname,lastname from users where active is true order by lastname asc");
while ($persitem=mysqli_fetch_assoc($persrow)) {
if ($userid==$persitem["id"]) {
printf("<option value=\"%s\" selected>%s %s</option>",$persitem["id"],$persitem["firstname"],$persitem["lastname"]);
}
}
echo "
</select>
";
}
echo "
</td>
<td>Status change reason<br>
<select name=\"edit_action_reason\" id=\"reason\">
";
$reasrow=mysqli_query($drs_db,"select id,text from reasons where active is true order by id asc");
if (!$action_reason) echo "<option selected></option>";
while ($reasitem=mysqli_fetch_assoc($reasrow)) {
if ($action_reason==$reasitem["id"]) {
printf("<option value=\"%s\" selected>%s</option>",$reasitem["id"],$reasitem["text"]);
} else {
printf("<option value=\"%s\">%s</option>",$reasitem["id"],$reasitem["text"]);
}
}
echo "
</select>
</td>
</tr>
<tr><td></td><td></td><td></td></tr>
<tr><td colspan=\"3\">
Action Taken <font size=\"-2\">(required)</font><br>
<textarea rows=\"10\" cols=\"80\" name=\"edit_action_text\" wrap=\"soft\"></textarea><br>
</td>
</tr>
<tr>
<td align=\"left\" >Action Taken Date<br>
<input type=\"text\" name=\"edit_action_date\" size=\"10\" maxlength=\"10\" value=\"$today\" id=\"actiondatepicker\" title=\"Format: YYYY-MM-DD\"></td>
<td align=\"left\">Action Taken Time<br>
<input type=\"text\" name=\"edit_action_time\" size=\"8\" maxlength=\"8\" value=\"$now\" title=\"Format: HH:MM:SS\"></td>
<td align=\"right\" valign=\"bottom\"><button type=\"submit\" name=\"save\" value=\"save\">Save action</button></td>
</tr>
<tr>
<td align=\"left\" valign=\"bottom\">
<td></td><td align=\"right\" valign=\"bottom\">
<input type=\"submit\" name=\"cancel\" value=\"Cancel Changes\"></td>
</tr>
</table>
</form>
";
}
} else {
if ($role) {
echo "
<form method=post action=\"groups.php\">
<button name=\"action\" value=\"add\" type=\"submit\">Create a new group</button>
</form>
<hr>
";
}
if ($group) {
// show only the requested group
$mode="view";
group_table($group,$role,$mode);
if ($role) {
// show buttons
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"$group\">
<button name=\"action\" value=\"add\" type=\"submit\">Add writeups to this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"remove\" type=\"submit\">Remove writeups from this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"dissolve\" type=\"submit\">Dissolve this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"setname\" type=\"submit\">Set name for this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"takeaction\" type=\"submit\">Take group action</button>
</form>
";
}
echo "<hr><br>";
} else {
// show all groups
$mode="view";
$groups_qry=mysqli_query($drs_db,"select id from groups");
if (mysqli_num_rows($groups_qry)) {
while ($grouprow=mysqli_fetch_assoc($groups_qry)) {
if ($expandgrp == $grouprow['id']) {
group_table($grouprow['id'],$role,$mode,"none",$expandgrp);
if ($role) {
// show buttons
echo "
<form method=post action=\"groups.php\">
<input type=\"hidden\" name=\"group\" value=\"{$grouprow['id']}\">
<button name=\"action\" value=\"add\" type=\"submit\">Add writeups to this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"remove\" type=\"submit\">Remove writeups from this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"dissolve\" type=\"submit\">Dissolve this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"setname\" type=\"submit\">Set name for this group</button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button name=\"action\" value=\"takeaction\" type=\"submit\">Take group action</button>
</form>
";
}
} else {
echo "
<a href=\"groups.php?expandgrp={$grouprow['id']}\" style=\"text-decoration:none\">
<img src=\"icons/plus-white.png\" alt=\"Expand group\">
</a>
";
$groupname=dblookup($drs_db,"groups","id","name",$grouprow['id']);
if ($groupname == "") {
echo "<b>Group ID:</b> &nbsp;{$grouprow['id']}";
} else {
echo "<b>Group Name:</b> &nbsp;$groupname";
}
}
echo "<br><br>";
}
} else {
echo "<br>No writeup groups were found.<br><br><br>";
}
}
}
echo "<br>";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

BIN
distfiles/icons/block.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

BIN
distfiles/icons/control.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

BIN
distfiles/icons/cross.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

BIN
distfiles/icons/node.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

BIN
distfiles/icons/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

BIN
distfiles/icons/sym-x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

BIN
distfiles/icons/tick.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
distfiles/images/linux.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,333 @@
Authors ordered by first contribution
A list of current team members is available at http://jqueryui.com/about
Paul Bakaus <paul.bakaus@gmail.com>
Richard Worth <rdworth@gmail.com>
Yehuda Katz <wycats@gmail.com>
Sean Catchpole <sean@sunsean.com>
John Resig <jeresig@gmail.com>
Tane Piper <piper.tane@gmail.com>
Dmitri Gaskin <dmitrig01@gmail.com>
Klaus Hartl <klaus.hartl@gmail.com>
Stefan Petre <stefan.petre@gmail.com>
Gilles van den Hoven <gilles@webunity.nl>
Micheil Bryan Smith <micheil@brandedcode.com>
Jörn Zaefferer <joern.zaefferer@gmail.com>
Marc Grabanski <m@marcgrabanski.com>
Keith Wood <kbwood@iinet.com.au>
Brandon Aaron <brandon.aaron@gmail.com>
Scott González <scott.gonzalez@gmail.com>
Eduardo Lundgren <eduardolundgren@gmail.com>
Aaron Eisenberger <aaronchi@gmail.com>
Joan Piedra <theneojp@gmail.com>
Bruno Basto <b.basto@gmail.com>
Remy Sharp <remy@leftlogic.com>
Bohdan Ganicky <bohdan.ganicky@gmail.com>
David Bolter <david.bolter@gmail.com>
Chi Cheng <cloudream@gmail.com>
Ca-Phun Ung <pazu2k@gmail.com>
Ariel Flesler <aflesler@gmail.com>
Maggie Wachs <maggie@filamentgroup.com>
Scott Jehl <scottjehl@gmail.com>
Todd Parker <todd@filamentgroup.com>
Andrew Powell <andrew@shellscape.org>
Brant Burnett <btburnett3@gmail.com>
Douglas Neiner <doug@dougneiner.com>
Paul Irish <paul.irish@gmail.com>
Ralph Whitbeck <ralph.whitbeck@gmail.com>
Thibault Duplessis <thibault.duplessis@gmail.com>
Dominique Vincent <dominique.vincent@toitl.com>
Jack Hsu <jack.hsu@gmail.com>
Adam Sontag <ajpiano@ajpiano.com>
Carl Fürstenberg <carl@excito.com>
Kevin Dalman <development@allpro.net>
Alberto Fernández Capel <afcapel@gmail.com>
Jacek Jędrzejewski (http://jacek.jedrzejewski.name)
Ting Kuei <ting@kuei.com>
Samuel Cormier-Iijima <sam@chide.it>
Jon Palmer <jonspalmer@gmail.com>
Ben Hollis <bhollis@amazon.com>
Justin MacCarthy <Justin@Rubystars.biz>
Eyal Kobrigo <kobrigo@hotmail.com>
Tiago Freire <tiago.freire@gmail.com>
Diego Tres <diegotres@gmail.com>
Holger Rüprich <holger@rueprich.de>
Ziling Zhao <zilingzhao@gmail.com>
Mike Alsup <malsup@gmail.com>
Robson Braga Araujo <robsonbraga@gmail.com>
Pierre-Henri Ausseil <ph.ausseil@gmail.com>
Christopher McCulloh <cmcculloh@gmail.com>
Andrew Newcomb <ext.github@preceptsoftware.co.uk>
Lim Chee Aun <cheeaun@gmail.com>
Jorge Barreiro <yortx.barry@gmail.com>
Daniel Steigerwald <daniel@steigerwald.cz>
John Firebaugh <john_firebaugh@bigfix.com>
John Enters <github@darkdark.net>
Andrey Kapitcyn <ru.m157y@gmail.com>
Dmitry Petrov <dpetroff@gmail.com>
Eric Hynds <eric@hynds.net>
Chairat Sunthornwiphat <pipo@sixhead.com>
Josh Varner <josh.varner@gmail.com>
Stéphane Raimbault <stephane.raimbault@gmail.com>
Jay Merrifield <fracmak@gmail.com>
J. Ryan Stinnett <jryans@gmail.com>
Peter Heiberg <peter@heiberg.se>
Alex Dovenmuehle <adovenmuehle@gmail.com>
Jamie Gegerson <git@jamiegegerson.com>
Raymond Schwartz <skeetergraphics@gmail.com>
Phillip Barnes <philbar@gmail.com>
Kyle Wilkinson <kai@wikyd.org>
Khaled AlHourani <me@khaledalhourani.com>
Marian Rudzynski <mr@impaled.org>
Jean-Francois Remy <jeff@melix.org>
Doug Blood <dougblood@gmail.com>
Filippo Cavallarin <filippo.cavallarin@codseq.it>
Heiko Henning <heiko@thehennings.ch>
Aliaksandr Rahalevich <saksmlz@gmail.com>
Mario Visic <mario@mariovisic.com>
Xavi Ramirez <xavi.rmz@gmail.com>
Max Schnur <max.schnur@gmail.com>
Saji Nediyanchath <saji89@gmail.com>
Corey Frang <gnarf37@gmail.com>
Aaron Peterson <aaronp123@yahoo.com>
Ivan Peters <ivan@ivanpeters.com>
Mohamed Cherif Bouchelaghem <cherifbouchelaghem@yahoo.fr>
Marcos Sousa <falecomigo@marcossousa.com>
Michael DellaNoce <mdellanoce@mailtrust.com>
George Marshall <echosx@gmail.com>
Tobias Brunner <tobias@strongswan.org>
Martin Solli <msolli@gmail.com>
David Petersen <public@petersendidit.com>
Dan Heberden <danheberden@gmail.com>
William Kevin Manire <williamkmanire@gmail.com>
Gilmore Davidson <gilmoreorless@gmail.com>
Michael Wu <michaelmwu@gmail.com>
Adam Parod <mystic414@gmail.com>
Guillaume Gautreau <guillaume+github@ghusse.com>
Marcel Toele <EleotleCram@gmail.com>
Dan Streetman <ddstreet@ieee.org>
Matt Hoskins <matt@nipltd.com>
Giovanni Giacobbi <giovanni@giacobbi.net>
Kyle Florence <kyle.florence@gmail.com>
Pavol Hluchý <lopo@losys.sk>
Hans Hillen <hans.hillen@gmail.com>
Mark Johnson <virgofx@live.com>
Trey Hunner <treyhunner@gmail.com>
Shane Whittet <whittet@gmail.com>
Edward A Faulkner <ef@alum.mit.edu>
Adam Baratz <adam@adambaratz.com>
Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Eike Send <eike.send@gmail.com>
Kris Borchers <kris.borchers@gmail.com>
Eddie Monge <eddie@eddiemonge.com>
Israel Tsadok <itsadok@gmail.com>
Carson McDonald <carson@ioncannon.net>
Jason Davies <jason@jasondavies.com>
Garrison Locke <gplocke@gmail.com>
David Murdoch <david@davidmurdoch.com>
Benjamin Scott Boyle <benjamins.boyle@gmail.com>
Jesse Baird <jebaird@gmail.com>
Jonathan Vingiano <jvingiano@gmail.com>
Dylan Just <dev@ephox.com>
Hiroshi Tomita <tomykaira@gmail.com>
Glenn Goodrich <glenn.goodrich@gmail.com>
Tarafder Ashek-E-Elahi <mail.ashek@gmail.com>
Ryan Neufeld <ryan@neufeldmail.com>
Marc Neuwirth <marc.neuwirth@gmail.com>
Philip Graham <philip.robert.graham@gmail.com>
Benjamin Sterling <benjamin.sterling@kenzomedia.com>
Wesley Walser <waw325@gmail.com>
Kouhei Sutou <kou@clear-code.com>
Karl Kirch <karlkrch@gmail.com>
Chris Kelly <ckdake@ckdake.com>
Jason Oster <jay@kodewerx.org>
Felix Nagel <info@felixnagel.com>
Alexander Polomoshnov <alex.polomoshnov@gmail.com>
David Leal <dgleal@gmail.com>
Igor Milla <igor.fsp.milla@gmail.com>
Dave Methvin <dave.methvin@gmail.com>
Florian Gutmann <f.gutmann@chronimo.com>
Marwan Al Jubeh <marwan.aljubeh@gmail.com>
Milan Broum <midlis@googlemail.com>
Sebastian Sauer <info@dynpages.de>
Gaëtan Muller <m.gaetan89@gmail.com>
Michel Weimerskirch <michel@weimerskirch.net>
William Griffiths <william@ycymro.com>
Stojce Slavkovski <stojce@gmail.com>
David Soms <david.soms@gmail.com>
David De Sloovere <david.desloovere@outlook.com>
Michael P. Jung <michael.jung@terreon.de>
Shannon Pekary <spekary@gmail.com>
Dan Wellman <danwellman@hotmail.com>
Matthew Edward Hutton <meh@corefiling.co.uk>
James Khoury <james@jameskhoury.com>
Rob Loach <robloach@gmail.com>
Alberto Monteiro <betimbrasil@gmail.com>
Alex Rhea <alex.rhea@gmail.com>
Krzysztof Rosiński <rozwell69@gmail.com>
Ryan Olton <oltonr@gmail.com>
Genie <386@mail.com>
Rick Waldron <waldron.rick@gmail.com>
Ian Simpson <spoonlikesham@gmail.com>
Lev Kitsis <spam4lev@gmail.com>
TJ VanToll <tj.vantoll@gmail.com>
Justin Domnitz <jdomnitz@gmail.com>
Douglas Cerna <douglascerna@yahoo.com>
Bert ter Heide <bertjh@hotmail.com>
Jasvir Nagra <jasvir@gmail.com>
Yuriy Khabarov <13real008@gmail.com>
Harri Kilpiö <harri.kilpio@gmail.com>
Lado Lomidze <lado.lomidze@gmail.com>
Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Simon Sattes <simon.sattes@gmail.com>
Jo Liss <joliss42@gmail.com>
Guntupalli Karunakar <karunakarg@yahoo.com>
Shahyar Ghobadpour <shahyar@gmail.com>
Lukasz Lipinski <uzza17@gmail.com>
Timo Tijhof <krinklemail@gmail.com>
Jason Moon <jmoon@socialcast.com>
Martin Frost <martinf55@hotmail.com>
Eneko Illarramendi <eneko@illarra.com>
EungJun Yi <semtlenori@gmail.com>
Courtland Allen <courtlandallen@gmail.com>
Viktar Varvanovich <non4eg@gmail.com>
Danny Trunk <dtrunk90@gmail.com>
Pavel Stetina <pavel.stetina@nangu.tv>
Michael Stay <metaweta@gmail.com>
Steven Roussey <sroussey@gmail.com>
Michael Hollis <hollis21@gmail.com>
Lee Rowlands <lee.rowlands@previousnext.com.au>
Timmy Willison <timmywillisn@gmail.com>
Karl Swedberg <kswedberg@gmail.com>
Baoju Yuan <the_guy_1987@hotmail.com>
Maciej Mroziński <maciej.k.mrozinski@gmail.com>
Luis Dalmolin <luis.nh@gmail.com>
Mark Aaron Shirley <maspwr@gmail.com>
Martin Hoch <martin@fidion.de>
Jiayi Yang <tr870829@gmail.com>
Philipp Benjamin Köppchen <xgxtpbk@gws.ms>
Sindre Sorhus <sindresorhus@gmail.com>
Bernhard Sirlinger <bernhard.sirlinger@tele2.de>
Jared A. Scheel <jared@jaredscheel.com>
Rafael Xavier de Souza <rxaviers@gmail.com>
John Chen <zhang.z.chen@intel.com>
Robert Beuligmann <robertbeuligmann@gmail.com>
Dale Kocian <dale.kocian@gmail.com>
Mike Sherov <mike.sherov@gmail.com>
Andrew Couch <andy@couchand.com>
Marc-Andre Lafortune <github@marc-andre.ca>
Nate Eagle <nate.eagle@teamaol.com>
David Souther <davidsouther@gmail.com>
Mathias Stenbom <mathias@stenbom.com>
Sergey Kartashov <ebishkek@yandex.ru>
Avinash R <nashpapa@gmail.com>
Ethan Romba <ethanromba@gmail.com>
Cory Gackenheimer <cory.gack@gmail.com>
Juan Pablo Kaniefsky <jpkaniefsky@gmail.com>
Roman Salnikov <bardt.dz@gmail.com>
Anika Henke <anika@selfthinker.org>
Samuel Bovée <samycookie2000@yahoo.fr>
Fabrício Matté <ult_combo@hotmail.com>
Viktor Kojouharov <vkojouharov@gmail.com>
Pawel Maruszczyk (http://hrabstwo.net)
Pavel Selitskas <p.selitskas@gmail.com>
Bjørn Johansen <post@bjornjohansen.no>
Matthieu Penant <thieum22@hotmail.com>
Dominic Barnes <dominic@dbarnes.info>
David Sullivan <david.sullivan@gmail.com>
Thomas Jaggi <thomas@responsive.ch>
Vahid Sohrabloo <vahid4134@gmail.com>
Travis Carden <travis.carden@gmail.com>
Bruno M. Custódio <bruno@brunomcustodio.com>
Nathanael Silverman <nathanael.silverman@gmail.com>
Christian Wenz <christian@wenz.org>
Steve Urmston <steve@urm.st>
Zaven Muradyan <megalivoithos@gmail.com>
Woody Gilk <shadowhand@deviantart.com>
Zbigniew Motyka <zbigniew.motyka@gmail.com>
Suhail Alkowaileet <xsoh.k7@gmail.com>
Toshi MARUYAMA <marutosijp2@yahoo.co.jp>
David Hansen <hansede@gmail.com>
Brian Grinstead <briangrinstead@gmail.com>
Christian Klammer <christian314159@gmail.com>
Steven Luscher <jquerycla@steveluscher.com>
Gan Eng Chin <engchin.gan@gmail.com>
Gabriel Schulhof <gabriel.schulhof@intel.com>
Alexander Schmitz <arschmitz@gmail.com>
Vilhjálmur Skúlason <vis@dmm.is>
Siebrand Mazeland <siebrand@kitano.nl>
Mohsen Ekhtiari <mohsenekhtiari@yahoo.com>
Pere Orga <gotrunks@gmail.com>
Jasper de Groot <mail@ugomobi.com>
Stephane Deschamps <stephane.deschamps@gmail.com>
Jyoti Deka <dekajp@gmail.com>
Andrei Picus <office.nightcrawler@gmail.com>
Ondrej Novy <novy@ondrej.org>
Jacob McCutcheon <jacob.mccutcheon@gmail.com>
Monika Piotrowicz <monika.piotrowicz@gmail.com>
Imants Horsts <imants.horsts@inbox.lv>
Eric Dahl <eric.c.dahl@gmail.com>
Dave Stein <dave@behance.com>
Dylan Barrell <dylan@barrell.com>
Daniel DeGroff <djdegroff@gmail.com>
Michael Wiencek <mwtuea@gmail.com>
Thomas Meyer <meyertee@gmail.com>
Ruslan Yakhyaev <ruslan@ruslan.io>
Brian J. Dowling <bjd-dev@simplicity.net>
Ben Higgins <ben@extrahop.com>
Yermo Lamers <yml@yml.com>
Patrick Stapleton <github@gdi2290.com>
Trisha Crowley <trisha.crowley@gmail.com>
Usman Akeju <akeju00+github@gmail.com>
Rodrigo Menezes <rod333@gmail.com>
Jacques Perrault <jacques_perrault@us.ibm.com>
Frederik Elvhage <frederik.elvhage@googlemail.com>
Will Holley <willholley@gmail.com>
Uri Gilad <antishok@gmail.com>
Richard Gibson <richard.gibson@gmail.com>
Simen Bekkhus <sbekkhus91@gmail.com>
Chen Eshchar <eshcharc@gmail.com>
Bruno Pérel <brunoperel@gmail.com>
Mohammed Alshehri <m@dralshehri.com>
Lisa Seacat DeLuca <ldeluca@us.ibm.com>
Anne-Gaelle Colom <coloma@westminster.ac.uk>
Adam Foster <slimfoster@gmail.com>
Luke Page <luke.a.page@gmail.com>
Daniel Owens <daniel@matchstickmixup.com>
Michael Orchard <morchard@scottlogic.co.uk>
Marcus Warren <marcus@envoke.com>
Nils Heuermann <nils@world-of-scripts.de>
Marco Ziech <marco@ziech.net>
Patricia Juarez <patrixd@gmail.com>
Ben Mosher <me@benmosher.com>
Ablay Keldibek <atomio.ak@gmail.com>
Thomas Applencourt <thomas.applencourt@irsamc.ups-tlse.fr>
Jiabao Wu <jiabao.foss@gmail.com>
Eric Lee Carraway <github@ericcarraway.com>
Victor Homyakov <vkhomyackov@gmail.com>
Myeongjin Lee <aranet100@gmail.com>
Liran Sharir <lsharir@gmail.com>
Weston Ruter <weston@xwp.co>
Mani Mishra <manimishra902@gmail.com>
Hannah Methvin <hannahmethvin@gmail.com>
Leonardo Balter <leonardo.balter@gmail.com>
Benjamin Albert <benjamin_a5@yahoo.com>
Michał Gołębiowski <m.goleb@gmail.com>
Alyosha Pushak <alyosha.pushak@gmail.com>
Fahad Ahmad <fahadahmad41@hotmail.com>
Matt Brundage <github@mattbrundage.com>
Francesc Baeta <francesc.baeta@gmail.com>
Piotr Baran <piotros@wp.pl>
Mukul Hase <mukulhase@gmail.com>
Konstantin Dinev <kdinev@mail.bw.edu>
Rand Scullard <rand@randscullard.com>
Dan Strohl <dan@wjcg.net>
Maksim Ryzhikov <rv.maksim@gmail.com>
Amine HADDAD <haddad@allegorie.tv>
Amanpreet Singh <apsdehal@gmail.com>
Alexey Balchunas <bleshik@gmail.com>
Peter Kehl <peter.kehl@gmail.com>
Peter Dave Hello <hsu@peterdavehello.org>
Johannes Schäfer <johnschaefer@gmx.de>
Ville Skyttä <ville.skytta@iki.fi>
Ryan Oriecuia <ryan.oriecuia@visioncritical.com>

View File

@@ -0,0 +1,43 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery-ui
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 OR COPYRIGHT HOLDERS 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.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code contained within the demos directory.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -0,0 +1,559 @@
<!doctype html>
<html lang="us">
<head>
<meta charset="utf-8">
<title>jQuery UI Example Page</title>
<link href="jquery-ui.css" rel="stylesheet">
<style>
body{
font-family: "Trebuchet MS", sans-serif;
margin: 50px;
}
.demoHeaders {
margin-top: 2em;
}
#dialog-link {
padding: .4em 1em .4em 20px;
text-decoration: none;
position: relative;
}
#dialog-link span.ui-icon {
margin: 0 5px 0 0;
position: absolute;
left: .2em;
top: 50%;
margin-top: -8px;
}
#icons {
margin: 0;
padding: 0;
}
#icons li {
margin: 2px;
position: relative;
padding: 4px 0;
cursor: pointer;
float: left;
list-style: none;
}
#icons span.ui-icon {
float: left;
margin: 0 4px;
}
.fakewindowcontain .ui-widget-overlay {
position: absolute;
}
select {
width: 200px;
}
</style>
</head>
<body>
<h1>Welcome to jQuery UI!</h1>
<div class="ui-widget">
<p>This page demonstrates the widgets and theme you selected in Download Builder. Please make sure you are using them with a compatible jQuery version.</p>
</div>
<h1>YOUR COMPONENTS:</h1>
<!-- Accordion -->
<h2 class="demoHeaders">Accordion</h2>
<div id="accordion">
<h3>First</h3>
<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
<h3>Second</h3>
<div>Phasellus mattis tincidunt nibh.</div>
<h3>Third</h3>
<div>Nam dui erat, auctor a, dignissim quis.</div>
</div>
<!-- Autocomplete -->
<h2 class="demoHeaders">Autocomplete</h2>
<div>
<input id="autocomplete" title="type &quot;a&quot;">
</div>
<!-- Button -->
<h2 class="demoHeaders">Button</h2>
<button id="button">A button element</button>
<button id="button-icon">An icon-only button</button>
<!-- Checkboxradio -->
<h2 class="demoHeaders">Checkboxradio</h2>
<form style="margin-top: 1em;">
<div id="radioset">
<input type="radio" id="radio1" name="radio"><label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio" checked="checked"><label for="radio2">Choice 2</label>
<input type="radio" id="radio3" name="radio"><label for="radio3">Choice 3</label>
</div>
</form>
<!-- Controlgroup -->
<h2 class="demoHeaders">Controlgroup</h2>
<fieldset>
<legend>Rental Car</legend>
<div id="controlgroup">
<select id="car-type">
<option>Compact car</option>
<option>Midsize car</option>
<option>Full size car</option>
<option>SUV</option>
<option>Luxury</option>
<option>Truck</option>
<option>Van</option>
</select>
<label for="transmission-standard">Standard</label>
<input type="radio" name="transmission" id="transmission-standard">
<label for="transmission-automatic">Automatic</label>
<input type="radio" name="transmission" id="transmission-automatic">
<label for="insurance">Insurance</label>
<input type="checkbox" name="insurance" id="insurance">
<label for="horizontal-spinner" class="ui-controlgroup-label"># of cars</label>
<input id="horizontal-spinner" class="ui-spinner-input">
<button>Book Now!</button>
</div>
</fieldset>
<!-- Tabs -->
<h2 class="demoHeaders">Tabs</h2>
<div id="tabs">
<ul>
<li><a href="#tabs-1">First</a></li>
<li><a href="#tabs-2">Second</a></li>
<li><a href="#tabs-3">Third</a></li>
</ul>
<div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
<div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div>
<div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>
</div>
<h2 class="demoHeaders">Dialog</h2>
<p>
<button id="dialog-link" class="ui-button ui-corner-all ui-widget">
<span class="ui-icon ui-icon-newwin"></span>Open Dialog
</button>
</p>
<h2 class="demoHeaders">Overlay and Shadow Classes</h2>
<div style="position: relative; width: 96%; height: 200px; padding:1% 2%; overflow:hidden;" class="fakewindowcontain">
<p>Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. </p><p>Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. </p><p>Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. </p><p>Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. </p>
<!-- ui-dialog -->
<div class="ui-widget-overlay ui-front"></div>
<div style="position: absolute; width: 320px; left: 50px; top: 30px; padding: 1.2em" class="ui-widget ui-front ui-widget-content ui-corner-all ui-widget-shadow">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
<!-- ui-dialog -->
<div id="dialog" title="Dialog Title">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<h2 class="demoHeaders">Framework Icons (content color preview)</h2>
<ul id="icons" class="ui-widget ui-helper-clearfix">
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-n"><span class="ui-icon ui-icon-caret-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-ne"><span class="ui-icon ui-icon-caret-1-ne"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-e"><span class="ui-icon ui-icon-caret-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-se"><span class="ui-icon ui-icon-caret-1-se"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-s"><span class="ui-icon ui-icon-caret-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-sw"><span class="ui-icon ui-icon-caret-1-sw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-w"><span class="ui-icon ui-icon-caret-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-1-nw"><span class="ui-icon ui-icon-caret-1-nw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-2-n-s"><span class="ui-icon ui-icon-caret-2-n-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-caret-2-e-w"><span class="ui-icon ui-icon-caret-2-e-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-n"><span class="ui-icon ui-icon-triangle-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-ne"><span class="ui-icon ui-icon-triangle-1-ne"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-e"><span class="ui-icon ui-icon-triangle-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-se"><span class="ui-icon ui-icon-triangle-1-se"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-s"><span class="ui-icon ui-icon-triangle-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-sw"><span class="ui-icon ui-icon-triangle-1-sw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-w"><span class="ui-icon ui-icon-triangle-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-nw"><span class="ui-icon ui-icon-triangle-1-nw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-n-s"><span class="ui-icon ui-icon-triangle-2-n-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-e-w"><span class="ui-icon ui-icon-triangle-2-e-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-n"><span class="ui-icon ui-icon-arrow-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-ne"><span class="ui-icon ui-icon-arrow-1-ne"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-e"><span class="ui-icon ui-icon-arrow-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-se"><span class="ui-icon ui-icon-arrow-1-se"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-s"><span class="ui-icon ui-icon-arrow-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-sw"><span class="ui-icon ui-icon-arrow-1-sw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-w"><span class="ui-icon ui-icon-arrow-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-nw"><span class="ui-icon ui-icon-arrow-1-nw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-n-s"><span class="ui-icon ui-icon-arrow-2-n-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-ne-sw"><span class="ui-icon ui-icon-arrow-2-ne-sw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-e-w"><span class="ui-icon ui-icon-arrow-2-e-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-se-nw"><span class="ui-icon ui-icon-arrow-2-se-nw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-n"><span class="ui-icon ui-icon-arrowstop-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-e"><span class="ui-icon ui-icon-arrowstop-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-s"><span class="ui-icon ui-icon-arrowstop-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-w"><span class="ui-icon ui-icon-arrowstop-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-n"><span class="ui-icon ui-icon-arrowthick-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-ne"><span class="ui-icon ui-icon-arrowthick-1-ne"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-e"><span class="ui-icon ui-icon-arrowthick-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-se"><span class="ui-icon ui-icon-arrowthick-1-se"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-s"><span class="ui-icon ui-icon-arrowthick-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-sw"><span class="ui-icon ui-icon-arrowthick-1-sw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-w"><span class="ui-icon ui-icon-arrowthick-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-nw"><span class="ui-icon ui-icon-arrowthick-1-nw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-n-s"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-ne-sw"><span class="ui-icon ui-icon-arrowthick-2-ne-sw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-e-w"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-se-nw"><span class="ui-icon ui-icon-arrowthick-2-se-nw"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-n"><span class="ui-icon ui-icon-arrowthickstop-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-e"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-s"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-w"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-w"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-n"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-e"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-s"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-w"><span class="ui-icon ui-icon-arrowreturn-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-n"><span class="ui-icon ui-icon-arrowreturn-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-e"><span class="ui-icon ui-icon-arrowreturn-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-s"><span class="ui-icon ui-icon-arrowreturn-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-w"><span class="ui-icon ui-icon-arrowrefresh-1-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-n"><span class="ui-icon ui-icon-arrowrefresh-1-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-e"><span class="ui-icon ui-icon-arrowrefresh-1-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-s"><span class="ui-icon ui-icon-arrowrefresh-1-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4"><span class="ui-icon ui-icon-arrow-4"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4-diag"><span class="ui-icon ui-icon-arrow-4-diag"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-extlink"><span class="ui-icon ui-icon-extlink"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-newwin"><span class="ui-icon ui-icon-newwin"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-refresh"><span class="ui-icon ui-icon-refresh"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-shuffle"><span class="ui-icon ui-icon-shuffle"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-transfer-e-w"><span class="ui-icon ui-icon-transfer-e-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-transferthick-e-w"><span class="ui-icon ui-icon-transferthick-e-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-folder-collapsed"><span class="ui-icon ui-icon-folder-collapsed"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-folder-open"><span class="ui-icon ui-icon-folder-open"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-document"><span class="ui-icon ui-icon-document"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-document-b"><span class="ui-icon ui-icon-document-b"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-note"><span class="ui-icon ui-icon-note"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-mail-closed"><span class="ui-icon ui-icon-mail-closed"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-mail-open"><span class="ui-icon ui-icon-mail-open"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-suitcase"><span class="ui-icon ui-icon-suitcase"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-comment"><span class="ui-icon ui-icon-comment"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-person"><span class="ui-icon ui-icon-person"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-print"><span class="ui-icon ui-icon-print"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-trash"><span class="ui-icon ui-icon-trash"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-locked"><span class="ui-icon ui-icon-locked"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-unlocked"><span class="ui-icon ui-icon-unlocked"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-bookmark"><span class="ui-icon ui-icon-bookmark"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-tag"><span class="ui-icon ui-icon-tag"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-home"><span class="ui-icon ui-icon-home"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-flag"><span class="ui-icon ui-icon-flag"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-calculator"><span class="ui-icon ui-icon-calculator"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-cart"><span class="ui-icon ui-icon-cart"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-pencil"><span class="ui-icon ui-icon-pencil"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-disk"><span class="ui-icon ui-icon-disk"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-calendar"><span class="ui-icon ui-icon-calendar"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-zoomin"><span class="ui-icon ui-icon-zoomin"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-zoomout"><span class="ui-icon ui-icon-zoomout"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-search"><span class="ui-icon ui-icon-search"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-wrench"><span class="ui-icon ui-icon-wrench"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-gear"><span class="ui-icon ui-icon-gear"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-heart"><span class="ui-icon ui-icon-heart"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-star"><span class="ui-icon ui-icon-star"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-link"><span class="ui-icon ui-icon-link"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-cancel"><span class="ui-icon ui-icon-cancel"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-plus"><span class="ui-icon ui-icon-plus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-plusthick"><span class="ui-icon ui-icon-plusthick"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-minus"><span class="ui-icon ui-icon-minus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-minusthick"><span class="ui-icon ui-icon-minusthick"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-close"><span class="ui-icon ui-icon-close"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-closethick"><span class="ui-icon ui-icon-closethick"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-key"><span class="ui-icon ui-icon-key"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-lightbulb"><span class="ui-icon ui-icon-lightbulb"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-scissors"><span class="ui-icon ui-icon-scissors"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-clipboard"><span class="ui-icon ui-icon-clipboard"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-copy"><span class="ui-icon ui-icon-copy"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-contact"><span class="ui-icon ui-icon-contact"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-image"><span class="ui-icon ui-icon-image"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-video"><span class="ui-icon ui-icon-video"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-script"><span class="ui-icon ui-icon-script"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-alert"><span class="ui-icon ui-icon-alert"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-info"><span class="ui-icon ui-icon-info"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-notice"><span class="ui-icon ui-icon-notice"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-help"><span class="ui-icon ui-icon-help"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-check"><span class="ui-icon ui-icon-check"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-bullet"><span class="ui-icon ui-icon-bullet"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-radio-off"><span class="ui-icon ui-icon-radio-off"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-radio-on"><span class="ui-icon ui-icon-radio-on"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-pin-w"><span class="ui-icon ui-icon-pin-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-pin-s"><span class="ui-icon ui-icon-pin-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-play"><span class="ui-icon ui-icon-play"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-pause"><span class="ui-icon ui-icon-pause"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-seek-next"><span class="ui-icon ui-icon-seek-next"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-seek-prev"><span class="ui-icon ui-icon-seek-prev"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-seek-end"><span class="ui-icon ui-icon-seek-end"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-seek-first"><span class="ui-icon ui-icon-seek-first"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-stop"><span class="ui-icon ui-icon-stop"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-eject"><span class="ui-icon ui-icon-eject"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-volume-off"><span class="ui-icon ui-icon-volume-off"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-volume-on"><span class="ui-icon ui-icon-volume-on"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-power"><span class="ui-icon ui-icon-power"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-signal-diag"><span class="ui-icon ui-icon-signal-diag"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-signal"><span class="ui-icon ui-icon-signal"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-battery-0"><span class="ui-icon ui-icon-battery-0"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-battery-1"><span class="ui-icon ui-icon-battery-1"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-battery-2"><span class="ui-icon ui-icon-battery-2"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-battery-3"><span class="ui-icon ui-icon-battery-3"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span class="ui-icon ui-icon-circle-plus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-minus"><span class="ui-icon ui-icon-circle-minus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-close"><span class="ui-icon ui-icon-circle-close"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-e"><span class="ui-icon ui-icon-circle-triangle-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-s"><span class="ui-icon ui-icon-circle-triangle-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-w"><span class="ui-icon ui-icon-circle-triangle-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-n"><span class="ui-icon ui-icon-circle-triangle-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-e"><span class="ui-icon ui-icon-circle-arrow-e"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-s"><span class="ui-icon ui-icon-circle-arrow-s"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-w"><span class="ui-icon ui-icon-circle-arrow-w"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-n"><span class="ui-icon ui-icon-circle-arrow-n"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomin"><span class="ui-icon ui-icon-circle-zoomin"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomout"><span class="ui-icon ui-icon-circle-zoomout"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-check"><span class="ui-icon ui-icon-circle-check"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-plus"><span class="ui-icon ui-icon-circlesmall-plus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-minus"><span class="ui-icon ui-icon-circlesmall-minus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-close"><span class="ui-icon ui-icon-circlesmall-close"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-plus"><span class="ui-icon ui-icon-squaresmall-plus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-minus"><span class="ui-icon ui-icon-squaresmall-minus"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-close"><span class="ui-icon ui-icon-squaresmall-close"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-vertical"><span class="ui-icon ui-icon-grip-dotted-vertical"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-horizontal"><span class="ui-icon ui-icon-grip-dotted-horizontal"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-gripsmall-diagonal-se"><span class="ui-icon ui-icon-gripsmall-diagonal-se"></span></li>
<li class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></li>
</ul>
<!-- Slider -->
<h2 class="demoHeaders">Slider</h2>
<div id="slider"></div>
<!-- Datepicker -->
<h2 class="demoHeaders">Datepicker</h2>
<div id="datepicker"></div>
<!-- Progressbar -->
<h2 class="demoHeaders">Progressbar</h2>
<div id="progressbar"></div>
<!-- Progressbar -->
<h2 class="demoHeaders">Selectmenu</h2>
<select id="selectmenu">
<option>Slower</option>
<option>Slow</option>
<option selected="selected">Medium</option>
<option>Fast</option>
<option>Faster</option>
</select>
<!-- Spinner -->
<h2 class="demoHeaders">Spinner</h2>
<input id="spinner">
<!-- Menu -->
<h2 class="demoHeaders">Menu</h2>
<ul style="width:100px;" id="menu">
<li><div>Item 1</div></li>
<li><div>Item 2</div></li>
<li><div>Item 3</div>
<ul>
<li><div>Item 3-1</div></li>
<li><div>Item 3-2</div></li>
<li><div>Item 3-3</div></li>
<li><div>Item 3-4</div></li>
<li><div>Item 3-5</div></li>
</ul>
</li>
<li><div>Item 4</div></li>
<li><div>Item 5</div></li>
</ul>
<!-- Tooltip -->
<h2 class="demoHeaders">Tooltip</h2>
<p id="tooltip">
<a href="#" title="That&apos;s what this widget is">Tooltips</a> can be attached to any element. When you hover
the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
</p>
<!-- Highlight / Error -->
<h2 class="demoHeaders">Highlight / Error</h2>
<div class="ui-widget">
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<strong>Hey!</strong> Sample ui-state-highlight style.</p>
</div>
</div>
<br>
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
<strong>Alert:</strong> Sample ui-state-error style.</p>
</div>
</div>
<script src="external/jquery/jquery.js"></script>
<script src="jquery-ui.js"></script>
<script>
$( "#accordion" ).accordion();
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#autocomplete" ).autocomplete({
source: availableTags
});
$( "#button" ).button();
$( "#button-icon" ).button({
icon: "ui-icon-gear",
showLabel: false
});
$( "#radioset" ).buttonset();
$( "#controlgroup" ).controlgroup();
$( "#tabs" ).tabs();
$( "#dialog" ).dialog({
autoOpen: false,
width: 400,
buttons: [
{
text: "Ok",
click: function() {
$( this ).dialog( "close" );
}
},
{
text: "Cancel",
click: function() {
$( this ).dialog( "close" );
}
}
]
});
// Link to open the dialog
$( "#dialog-link" ).click(function( event ) {
$( "#dialog" ).dialog( "open" );
event.preventDefault();
});
$( "#datepicker" ).datepicker({
inline: true
});
$( "#slider" ).slider({
range: true,
values: [ 17, 67 ]
});
$( "#progressbar" ).progressbar({
value: 20
});
$( "#spinner" ).spinner();
$( "#menu" ).menu();
$( "#tooltip" ).tooltip();
$( "#selectmenu" ).selectmenu();
// Hover states on the static widgets
$( "#dialog-link, #icons li" ).hover(
function() {
$( this ).addClass( "ui-state-hover" );
},
function() {
$( this ).removeClass( "ui-state-hover" );
}
);
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,886 @@
/*!
* jQuery UI CSS Framework 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/theming/
*/
.ui-draggable-handle {
-ms-touch-action: none;
touch-action: none;
}
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0); /* support: IE8 */
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
pointer-events: none;
}
/* Icons
----------------------------------*/
.ui-icon {
display: inline-block;
vertical-align: middle;
margin-top: -.25em;
position: relative;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
.ui-widget-icon-block {
left: 50%;
margin-left: -8px;
display: block;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
.ui-selectable {
-ms-touch-action: none;
touch-action: none;
}
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
.ui-sortable-handle {
-ms-touch-action: none;
touch-action: none;
}
.ui-accordion .ui-accordion-header {
display: block;
cursor: pointer;
position: relative;
margin: 2px 0 0 0;
padding: .5em .5em .5em .7em;
font-size: 100%;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
overflow: auto;
}
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
.ui-menu {
list-style: none;
padding: 0;
margin: 0;
display: block;
outline: 0;
}
.ui-menu .ui-menu {
position: absolute;
}
.ui-menu .ui-menu-item {
margin: 0;
cursor: pointer;
/* support: IE10, see #8844 */
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
}
.ui-menu .ui-menu-item-wrapper {
position: relative;
padding: 3px 1em 3px .4em;
}
.ui-menu .ui-menu-divider {
margin: 5px 0;
height: 0;
font-size: 0;
line-height: 0;
border-width: 1px 0 0 0;
}
.ui-menu .ui-state-focus,
.ui-menu .ui-state-active {
margin: -1px;
}
/* icon support */
.ui-menu-icons {
position: relative;
}
.ui-menu-icons .ui-menu-item-wrapper {
padding-left: 2em;
}
/* left-aligned */
.ui-menu .ui-icon {
position: absolute;
top: 0;
bottom: 0;
left: .2em;
margin: auto 0;
}
/* right-aligned */
.ui-menu .ui-menu-icon {
left: auto;
right: 0;
}
.ui-button {
padding: .4em 1em;
display: inline-block;
position: relative;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
/* Support: IE <= 11 */
overflow: visible;
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2em;
box-sizing: border-box;
text-indent: -9999px;
white-space: nowrap;
}
/* no icon support for input elements */
input.ui-button.ui-button-icon-only {
text-indent: 0;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon {
position: absolute;
top: 50%;
left: 50%;
margin-top: -8px;
margin-left: -8px;
}
.ui-button.ui-icon-notext .ui-icon {
padding: 0;
width: 2.1em;
height: 2.1em;
text-indent: -9999px;
white-space: nowrap;
}
input.ui-button.ui-icon-notext .ui-icon {
width: auto;
height: auto;
text-indent: 0;
white-space: normal;
padding: .4em 1em;
}
/* workarounds */
/* Support: Firefox 5 - 40 */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
.ui-controlgroup {
vertical-align: middle;
display: inline-block;
}
.ui-controlgroup > .ui-controlgroup-item {
float: left;
margin-left: 0;
margin-right: 0;
}
.ui-controlgroup > .ui-controlgroup-item:focus,
.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
z-index: 9999;
}
.ui-controlgroup-vertical > .ui-controlgroup-item {
display: block;
float: none;
width: 100%;
margin-top: 0;
margin-bottom: 0;
text-align: left;
}
.ui-controlgroup-vertical .ui-controlgroup-item {
box-sizing: border-box;
}
.ui-controlgroup .ui-controlgroup-label {
padding: .4em 1em;
}
.ui-controlgroup .ui-controlgroup-label span {
font-size: 80%;
}
.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
border-left: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
border-top: none;
}
.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
border-right: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
border-bottom: none;
}
/* Spinner specific style fixes */
.ui-controlgroup-vertical .ui-spinner-input {
/* Support: IE8 only, Android < 4.4 only */
width: 75%;
width: calc( 100% - 2.4em );
}
.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
border-top-style: solid;
}
.ui-checkboxradio-label .ui-icon-background {
box-shadow: inset 1px 1px 1px #ccc;
border-radius: .12em;
border: none;
}
.ui-checkboxradio-radio-label .ui-icon-background {
width: 16px;
height: 16px;
border-radius: 1em;
overflow: visible;
border: none;
}
.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
background-image: none;
width: 8px;
height: 8px;
border-width: 4px;
border-style: solid;
}
.ui-checkboxradio-disabled {
pointer-events: none;
}
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 45%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: right;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
/* Icons */
.ui-datepicker .ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
left: .5em;
top: .3em;
}
.ui-dialog {
position: absolute;
top: 0;
left: 0;
padding: .2em;
outline: 0;
}
.ui-dialog .ui-dialog-titlebar {
padding: .4em 1em;
position: relative;
}
.ui-dialog .ui-dialog-title {
float: left;
margin: .1em 0;
white-space: nowrap;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-dialog .ui-dialog-titlebar-close {
position: absolute;
right: .3em;
top: 50%;
width: 20px;
margin: -10px 0 0 0;
padding: 1px;
height: 20px;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
background: none;
overflow: auto;
}
.ui-dialog .ui-dialog-buttonpane {
text-align: left;
border-width: 1px 0 0 0;
background-image: none;
margin-top: .5em;
padding: .3em 1em .5em .4em;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: right;
}
.ui-dialog .ui-dialog-buttonpane button {
margin: .5em .4em .5em 0;
cursor: pointer;
}
.ui-dialog .ui-resizable-n {
height: 2px;
top: 0;
}
.ui-dialog .ui-resizable-e {
width: 2px;
right: 0;
}
.ui-dialog .ui-resizable-s {
height: 2px;
bottom: 0;
}
.ui-dialog .ui-resizable-w {
width: 2px;
left: 0;
}
.ui-dialog .ui-resizable-se,
.ui-dialog .ui-resizable-sw,
.ui-dialog .ui-resizable-ne,
.ui-dialog .ui-resizable-nw {
width: 7px;
height: 7px;
}
.ui-dialog .ui-resizable-se {
right: 0;
bottom: 0;
}
.ui-dialog .ui-resizable-sw {
left: 0;
bottom: 0;
}
.ui-dialog .ui-resizable-ne {
right: 0;
top: 0;
}
.ui-dialog .ui-resizable-nw {
left: 0;
top: 0;
}
.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
.ui-progressbar {
height: 2em;
text-align: left;
overflow: hidden;
}
.ui-progressbar .ui-progressbar-value {
margin: -1px;
height: 100%;
}
.ui-progressbar .ui-progressbar-overlay {
background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
height: 100%;
filter: alpha(opacity=25); /* support: IE8 */
opacity: 0.25;
}
.ui-progressbar-indeterminate .ui-progressbar-value {
background-image: none;
}
.ui-selectmenu-menu {
padding: 0;
margin: 0;
position: absolute;
top: 0;
left: 0;
display: none;
}
.ui-selectmenu-menu .ui-menu {
overflow: auto;
overflow-x: hidden;
padding-bottom: 1px;
}
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
font-size: 1em;
font-weight: bold;
line-height: 1.5;
padding: 2px 0.4em;
margin: 0.5em 0 0 0;
height: auto;
border: 0;
}
.ui-selectmenu-open {
display: block;
}
.ui-selectmenu-text {
display: block;
margin-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-selectmenu-button.ui-button {
text-align: left;
white-space: nowrap;
width: 14em;
}
.ui-selectmenu-icon.ui-icon {
float: right;
margin-top: 0;
}
.ui-slider {
position: relative;
text-align: left;
}
.ui-slider .ui-slider-handle {
position: absolute;
z-index: 2;
width: 1.2em;
height: 1.2em;
cursor: default;
-ms-touch-action: none;
touch-action: none;
}
.ui-slider .ui-slider-range {
position: absolute;
z-index: 1;
font-size: .7em;
display: block;
border: 0;
background-position: 0 0;
}
/* support: IE8 - See #6727 */
.ui-slider.ui-state-disabled .ui-slider-handle,
.ui-slider.ui-state-disabled .ui-slider-range {
filter: inherit;
}
.ui-slider-horizontal {
height: .8em;
}
.ui-slider-horizontal .ui-slider-handle {
top: -.3em;
margin-left: -.6em;
}
.ui-slider-horizontal .ui-slider-range {
top: 0;
height: 100%;
}
.ui-slider-horizontal .ui-slider-range-min {
left: 0;
}
.ui-slider-horizontal .ui-slider-range-max {
right: 0;
}
.ui-slider-vertical {
width: .8em;
height: 100px;
}
.ui-slider-vertical .ui-slider-handle {
left: -.3em;
margin-left: 0;
margin-bottom: -.6em;
}
.ui-slider-vertical .ui-slider-range {
left: 0;
width: 100%;
}
.ui-slider-vertical .ui-slider-range-min {
bottom: 0;
}
.ui-slider-vertical .ui-slider-range-max {
top: 0;
}
.ui-spinner {
position: relative;
display: inline-block;
overflow: hidden;
padding: 0;
vertical-align: middle;
}
.ui-spinner-input {
border: none;
background: none;
color: inherit;
padding: .222em 0;
margin: .2em 0;
vertical-align: middle;
margin-left: .4em;
margin-right: 2em;
}
.ui-spinner-button {
width: 1.6em;
height: 50%;
font-size: .5em;
padding: 0;
margin: 0;
text-align: center;
position: absolute;
cursor: default;
display: block;
overflow: hidden;
right: 0;
}
/* more specificity required here to override default borders */
.ui-spinner a.ui-spinner-button {
border-top-style: none;
border-bottom-style: none;
border-right-style: none;
}
.ui-spinner-up {
top: 0;
}
.ui-spinner-down {
bottom: 0;
}
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
cursor: text;
}
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
}
body .ui-tooltip {
border-width: 2px;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,443 @@
/*!
* jQuery UI CSS Framework 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/theming/
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=custom-theme&bgImgOpacityError=40&bgImgOpacityHighlight=80&bgImgOpacityActive=30&bgImgOpacityHover=40&bgImgOpacityDefault=20&bgImgOpacityContent=25&bgImgOpacityHeader=25&cornerRadiusShadow=8px&offsetLeftShadow=-7px&offsetTopShadow=-7px&thicknessShadow=7px&opacityShadow=60&bgImgOpacityShadow=30&bgTextureShadow=flat&bgColorShadow=%23cccccc&opacityOverlay=80&bgImgOpacityOverlay=50&bgTextureOverlay=flat&bgColorOverlay=%235c5c5c&iconColorError=%23a83300&fcError=%23111111&borderColorError=%23ffb73d&bgTextureError=glass&bgColorError=%23ffc73d&iconColorHighlight=%234b8e0b&fcHighlight=%232e7db2&borderColorHighlight=%23cccccc&bgTextureHighlight=highlight_soft&bgColorHighlight=%23eeeeee&iconColorActive=%23ffffff&fcActive=%23000000&borderColorActive=%23ffffff&bgTextureActive=inset_soft&bgColorActive=%23afe4e3&iconColorHover=%23ffffff&fcHover=%23ffffff&borderColorHover=%2359b4d4&bgTextureHover=flat&bgColorHover=%23508ca0&iconColorDefault=%23cccccc&fcDefault=%23eeeeee&borderColorDefault=%23666666&bgTextureDefault=flat&bgColorDefault=%23665d5d&iconColorContent=%23cccccc&fcContent=%23ffffff&borderColorContent=%23666666&bgTextureContent=flat&bgColorContent=%23000000&iconColorHeader=%23ffffff&fcHeader=%23ffffff&borderColorHeader=%23333333&bgTextureHeader=gloss_wave&bgColorHeader=%23333333&cornerRadius=3px&fwDefault=normal&fsDefault=.8em&ffDefault=Segoe%20UI%2CArial%2Csans-serif
*/
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Segoe UI,Arial,sans-serif;
font-size: .8em;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Segoe UI,Arial,sans-serif;
font-size: 1em;
}
.ui-widget.ui-widget-content {
border: 1px solid #666666;
}
.ui-widget-content {
border: 1px solid #666666;
background: #000000;
color: #ffffff;
}
.ui-widget-content a {
color: #ffffff;
}
.ui-widget-header {
border: 1px solid #333333;
background: #333333 url("images/ui-bg_gloss-wave_25_333333_500x100.png") 50% 50% repeat-x;
color: #ffffff;
font-weight: bold;
}
.ui-widget-header a {
color: #ffffff;
}
/* Interaction states
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default,
.ui-button,
/* We use html here because we need a greater specificity to make sure disabled
works properly when clicked or hovered */
html .ui-button.ui-state-disabled:hover,
html .ui-button.ui-state-disabled:active {
border: 1px solid #666666;
background: #665d5d;
font-weight: normal;
color: #eeeeee;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited,
a.ui-button,
a:link.ui-button,
a:visited.ui-button,
.ui-button {
color: #eeeeee;
text-decoration: none;
}
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus,
.ui-button:hover,
.ui-button:focus {
border: 1px solid #59b4d4;
background: #508ca0;
font-weight: normal;
color: #ffffff;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited,
.ui-state-focus a,
.ui-state-focus a:hover,
.ui-state-focus a:link,
.ui-state-focus a:visited,
a.ui-button:hover,
a.ui-button:focus {
color: #ffffff;
text-decoration: none;
}
.ui-visual-focus {
box-shadow: 0 0 3px 1px rgb(94, 158, 214);
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
border: 1px solid #ffffff;
background: #afe4e3 url("images/ui-bg_inset-soft_30_afe4e3_1x100.png") 50% 50% repeat-x;
font-weight: normal;
color: #000000;
}
.ui-icon-background,
.ui-state-active .ui-icon-background {
border: #ffffff;
background-color: #000000;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
color: #000000;
text-decoration: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
border: 1px solid #cccccc;
background: #eeeeee url("images/ui-bg_highlight-soft_80_eeeeee_1x100.png") 50% top repeat-x;
color: #2e7db2;
}
.ui-state-checked {
border: 1px solid #cccccc;
background: #eeeeee;
}
.ui-state-highlight a,
.ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a {
color: #2e7db2;
}
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
border: 1px solid #ffb73d;
background: #ffc73d url("images/ui-bg_glass_40_ffc73d_1x400.png") 50% 50% repeat-x;
color: #111111;
}
.ui-state-error a,
.ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a {
color: #111111;
}
.ui-state-error-text,
.ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text {
color: #111111;
}
.ui-priority-primary,
.ui-widget-content .ui-priority-primary,
.ui-widget-header .ui-priority-primary {
font-weight: bold;
}
.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary,
.ui-widget-header .ui-priority-secondary {
opacity: .7;
filter:Alpha(Opacity=70); /* support: IE8 */
font-weight: normal;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
filter:Alpha(Opacity=35); /* support: IE8 */
background-image: none;
}
.ui-state-disabled .ui-icon {
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url("images/ui-icons_cccccc_256x240.png");
}
.ui-widget-header .ui-icon {
background-image: url("images/ui-icons_ffffff_256x240.png");
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-button:hover .ui-icon,
.ui-button:focus .ui-icon {
background-image: url("images/ui-icons_ffffff_256x240.png");
}
.ui-state-active .ui-icon,
.ui-button:active .ui-icon {
background-image: url("images/ui-icons_ffffff_256x240.png");
}
.ui-state-highlight .ui-icon,
.ui-button .ui-state-highlight.ui-icon {
background-image: url("images/ui-icons_4b8e0b_256x240.png");
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url("images/ui-icons_a83300_256x240.png");
}
.ui-button .ui-icon {
background-image: url("images/ui-icons_cccccc_256x240.png");
}
/* positioning */
.ui-icon-blank { background-position: 16px 16px; }
.ui-icon-caret-1-n { background-position: 0 0; }
.ui-icon-caret-1-ne { background-position: -16px 0; }
.ui-icon-caret-1-e { background-position: -32px 0; }
.ui-icon-caret-1-se { background-position: -48px 0; }
.ui-icon-caret-1-s { background-position: -65px 0; }
.ui-icon-caret-1-sw { background-position: -80px 0; }
.ui-icon-caret-1-w { background-position: -96px 0; }
.ui-icon-caret-1-nw { background-position: -112px 0; }
.ui-icon-caret-2-n-s { background-position: -128px 0; }
.ui-icon-caret-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -65px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -65px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 3px;
}
/* Overlays */
.ui-widget-overlay {
background: #5c5c5c;
opacity: .8;
filter: Alpha(Opacity=80); /* support: IE8 */
}
.ui-widget-shadow {
-webkit-box-shadow: -7px -7px 7px #cccccc;
box-shadow: -7px -7px 7px #cccccc;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
.ui-multiselect { padding:2px 0 2px 4px; text-align:left }
.ui-multiselect span.ui-icon { float:right }
.ui-multiselect-single .ui-multiselect-checkboxes input { left:-9999px; position:absolute !important; top: auto !important; }
.ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important }
.ui-multiselect-header { margin-bottom:3px; padding:3px 0 3px 4px; }
.ui-multiselect-header ul { font-size:0.9em }
.ui-multiselect-header ul li { float:left; padding:0 10px 0 0; }
.ui-multiselect-header a { text-decoration:none; }
.ui-multiselect-header a:hover { text-decoration:underline; }
.ui-multiselect-header span.ui-icon { float:left; }
.ui-multiselect-header .ui-multiselect-close { float:right; padding-right:0; text-align:right; }
.ui-multiselect-menu { display:none; padding:3px; position:absolute; text-align: left; }
.ui-multiselect-checkboxes { overflow-y:auto; position:relative; }
.ui-multiselect-checkboxes label { border:1px solid transparent; cursor:default; display:block; padding:3px 1px; }
.ui-multiselect-checkboxes label input { position:relative; top:1px }
.ui-multiselect-checkboxes label img { height: 30px; vertical-align: middle; padding-right: 3px;}
.ui-multiselect-checkboxes li { clear:both; font-size:0.9em; list-style: none; padding-right:3px; }
.ui-multiselect-checkboxes .ui-multiselect-optgroup { padding: 3px; }
.ui-multiselect-columns { display: inline-block; vertical-align: top; }
.ui-multiselect-checkboxes .ui-multiselect-optgroup a { border-bottom:1px solid; cursor: pointer; display:block; font-weight:bold; margin:1px 0; padding:3px; text-align:center; text-decoration:none; }
@media print{
.ui-multiselect-menu {display: none;}
}

View File

@@ -0,0 +1,986 @@
/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, boss:true, undef:true, curly:true, browser:true, jquery:true */
/*
* jQuery MultiSelect UI Widget 2.0.1
* Copyright (c) 2012 Eric Hynds
*
* Depends:
* - jQuery 1.4.2+
* - jQuery UI 1.11 widget factory
*
* Optional:
* - jQuery UI effects
* - jQuery UI position utility
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
(function($, undefined) {
// Counter used to prevent collisions
var multiselectID = 0;
var $doc = $(document);
$.widget("ech.multiselect", {
// default options
options: {
header: true,
height: 175,
minWidth: 225,
classes: '',
checkAllText: 'Check all',
uncheckAllText: 'Uncheck all',
noneSelectedText: 'Select options',
showCheckAll: true,
showUncheckAll: true,
selectedText: '# selected',
selectedList: 0,
closeIcon: 'ui-icon-circle-close',
show: null,
hide: null,
autoOpen: false,
multiple: true,
position: {},
appendTo: null,
menuWidth:null,
selectedListSeparator: ', ',
disableInputsOnToggle: true,
groupColumns: false
},
// This method determines which element to append the menu to
// Uses the element provided in the options first, then looks for ui-front / dialog
// Otherwise appends to the body
_getAppendEl: function() {
var element = this.options.appendTo;
if(element) {
element = element.jquery || element.nodeType ? $(element) : this.document.find(element).eq(0);
}
if(!element || !element[0]) {
element = this.element.closest(".ui-front, dialog");
}
if(!element.length) {
element = this.document[0].body;
}
return element;
},
// Performs the initial creation of the widget
_create: function() {
var el = this.element;
var o = this.options;
this.speed = $.fx.speeds._default; // default speed for effects
this._isOpen = false; // assume no
this.inputIdCounter = 0; // Incremented for each input item (option)
// create a unique namespace for events that the widget
// factory cannot unbind automatically. Use eventNamespace if on
// jQuery UI 1.9+, and otherwise fallback to a custom string.
this._namespaceID = this.eventNamespace || ('multiselect' + multiselectID);
// bump unique ID after assigning it to the widget instance
this.multiselectID = multiselectID++;
// The button that opens the widget menu
var button = (this.button = $('<button type="button"><span class="ui-icon ui-icon-triangle-1-s"></span></button>'))
.addClass('ui-multiselect ui-widget ui-state-default ui-corner-all ' + o.classes)
.attr({ 'title':el.attr('title'), 'tabIndex':el.attr('tabIndex'), 'id': el.attr('id') ? el.attr('id') + '_ms' : null })
.prop('aria-haspopup', true)
.insertAfter(el);
this.buttonlabel = $('<span />')
.html(o.noneSelectedText)
.appendTo(button);
// This is the menu that will hold all the options
this.menu = $('<div />')
.addClass('ui-multiselect-menu ui-widget ui-widget-content ui-corner-all ' + o.classes)
.appendTo(this._getAppendEl());
// Menu header to hold controls for the menu
this.header = $('<div />')
.addClass('ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix')
.appendTo(this.menu);
// Header controls, will contain the check all/uncheck all buttons
// Depending on how the options are set, this may be empty or simply plain text
this.headerLinkContainer = $('<ul />')
.addClass('ui-helper-reset')
.html(function() {
if(o.header === true) {
var header_lis = '';
if(o.showCheckAll) {
header_lis = '<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>' + o.checkAllText + '</span></a></li>';
}
if(o.showUncheckAll) {
header_lis += '<li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>' + o.uncheckAllText + '</span></a></li>';
}
return header_lis;
} else if(typeof o.header === "string") {
return '<li>' + o.header + '</li>';
} else {
return '';
}
})
.append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon '+o.closeIcon+'"></span></a></li>')
.appendTo(this.header);
// Holds the actual check boxes for inputs
var checkboxContainer = (this.checkboxContainer = $('<ul />'))
.addClass('ui-multiselect-checkboxes ui-helper-reset')
.appendTo(this.menu);
this._bindEvents();
// build menu
this.refresh(true);
// If this is a single select widget, add the appropriate class
if(!o.multiple) {
this.menu.addClass('ui-multiselect-single');
}
el.hide();
},
// https://api.jqueryui.com/jquery.widget/#method-_init
_init: function() {
if(this.options.header === false) {
this.header.hide();
}
if(!this.options.multiple) {
this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').hide();
} else {
this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').show();
}
if(this.options.autoOpen) {
this.open();
}
if(this.element.is(':disabled')) {
this.disable();
}
},
/*
* Builds an option item for the menu
* <li>
* <label>
* <input /> checkbox or radio depending on single/multiple select
* <span /> option text
* </label>
* </li>
*/
_makeOption: function(option) {
var title = option.title ? option.title : null;
var value = option.value;
var id = this.element.attr('id') || this.multiselectID; // unique ID for the label & option tags
var inputID = 'ui-multiselect-' + this.multiselectID + '-' + (option.id || id + '-option-' + this.inputIdCounter++);
var isDisabled = option.disabled;
var isSelected = option.selected;
var labelClasses = [ 'ui-corner-all' ];
var liClasses = [];
var o = this.options;
if(isDisabled) {
liClasses.push('ui-multiselect-disabled');
labelClasses.push('ui-state-disabled');
}
if(option.className) {
liClasses.push(option.className);
}
if(isSelected && !o.multiple) {
labelClasses.push('ui-state-active');
}
var $item = $("<li/>").addClass(liClasses.join(' '));
var $label = $("<label/>").attr({
"for": inputID,
"title": title
}).addClass(labelClasses.join(' ')).appendTo($item);
var $input = $("<input/>").attr({
"name": "multiselect_" + id,
"type": o.multiple ? "checkbox" : "radio",
"value": value,
"title": title,
"id": inputID,
"checked": isSelected ? "checked" : null,
"aria-selected": isSelected ? "true" : null,
"disabled": isDisabled ? "disabled" : null,
"aria-disabled": isDisabled ? "true" : null
}).data($(option).data()).appendTo($label);
var $span = $("<span/>").text($(option).text());
if($input.data("image-src")) {
$span.prepend($("<img/>").attr({"src": $input.data("image-src")}));
}
$span.appendTo($label);
return $item;
},
// Builds a menu item for each option in the underlying select
// Option groups are built here as well
_buildOptionList: function(element, $appendTo) {
var self = this;
element.children().each(function() {
var $this = $(this);
if(this.tagName === 'OPTGROUP') {
var $optionGroup = $("<ul/>").addClass('ui-multiselect-optgroup ' + this.className).appendTo($appendTo);
if(self.options.groupColumns) {
$optionGroup.addClass("ui-multiselect-columns");
}
$("<a/>").text(this.getAttribute('label')).appendTo($optionGroup);
self._buildOptionList($this, $optionGroup);
} else {
var $listItem = self._makeOption(this).appendTo($appendTo);
}
});
},
// Refreshes the widget to pick up changes to the underlying select
// Rebuilds the menu, sets button width
refresh: function(init) {
var self = this;
var el = this.element;
var o = this.options;
var menu = this.menu;
var checkboxContainer = this.checkboxContainer;
var $dropdown = $("<ul/>").addClass('ui-multiselect-checkboxes ui-helper-reset');
this.inputIdCounter = 0;
// update header link container visibility if needed
if (this.options.header) {
if(!this.options.multiple) {
this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').hide();
} else {
this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').show();
}
}
this._buildOptionList(el, $dropdown);
this.menu.find(".ui-multiselect-checkboxes").remove();
this.menu.append($dropdown);
// cache some moar useful elements
this.labels = menu.find('label');
this.inputs = this.labels.children('input');
this._setButtonWidth();
this.update(true);
// broadcast refresh event; useful for widgets
if(!init) {
this._trigger('refresh');
}
},
// updates the button text. call refresh() to rebuild
update: function(isDefault) {
var o = this.options;
var $inputs = this.inputs;
var $checked = $inputs.filter(':checked');
var numChecked = $checked.length;
var value;
if(numChecked === 0) {
value = o.noneSelectedText;
} else {
if($.isFunction(o.selectedText)) {
value = o.selectedText.call(this, numChecked, $inputs.length, $checked.get());
} else if(/\d/.test(o.selectedList) && o.selectedList > 0 && numChecked <= o.selectedList) {
value = $checked.map(function() { return $(this).next().text(); }).get().join(o.selectedListSeparator);
} else {
value = o.selectedText.replace('#', numChecked).replace('#', $inputs.length);
}
}
this._setButtonValue(value);
if(isDefault) {
this.button[0].defaultValue = value;
}
},
// this exists as a separate method so that the developer
// can easily override it, usually to allow injecting HTML if they really want it
_setButtonValue: function(value) {
this.buttonlabel.text(value);
},
_bindButtonEvents: function() {
var self = this;
var button = this.button;
function clickHandler() {
self[ self._isOpen ? 'close' : 'open' ]();
return false;
}
// webkit doesn't like it when you click on the span :(
button
.find('span')
.bind('click.multiselect', clickHandler);
// button events
button.bind({
click: clickHandler,
keypress: function(e) {
switch(e.which) {
case 27: // esc
case 38: // up
case 37: // left
self.close();
break;
case 39: // right
case 40: // down
self.open();
break;
}
},
mouseenter: function() {
if(!button.hasClass('ui-state-disabled')) {
$(this).addClass('ui-state-hover');
}
},
mouseleave: function() {
$(this).removeClass('ui-state-hover');
},
focus: function() {
if(!button.hasClass('ui-state-disabled')) {
$(this).addClass('ui-state-focus');
}
},
blur: function() {
$(this).removeClass('ui-state-focus');
}
});
},
_bindMenuEvents: function() {
var self = this;
// optgroup label toggle support
this.menu.on('click.multiselect', '.ui-multiselect-optgroup a', function(e) {
e.preventDefault();
var $this = $(this);
var $inputs = $this.parent().find('input:visible:not(:disabled)');
var nodes = $inputs.get();
var label = $this.text();
// trigger event and bail if the return is false
if(self._trigger('beforeoptgrouptoggle', e, { inputs:nodes, label:label }) === false) {
return;
}
// toggle inputs
self._toggleChecked(
$inputs.filter(':checked').length !== $inputs.length,
$inputs
);
self._trigger('optgrouptoggle', e, {
inputs: nodes,
label: label,
checked: nodes.length ? nodes[0].checked : null
});
})
.on('mouseenter.multiselect', 'label', function() {
if(!$(this).hasClass('ui-state-disabled')) {
self.labels.removeClass('ui-state-hover');
$(this).addClass('ui-state-hover').find('input').focus();
}
})
.on('keydown.multiselect', 'label', function(e) {
if(e.which === 82) {
return; //"r" key, often used for reload.
}
if(e.which > 111 && e.which < 124) {
return; //Keyboard function keys.
}
e.preventDefault();
switch(e.which) {
case 9: // tab
if(e.shiftKey) {
self.menu.find(".ui-state-hover").removeClass("ui-state-hover");
self.header.find("li").last().find("a").focus();
} else {
self.close();
}
break;
case 27: // esc
self.close();
break;
case 38: // up
case 40: // down
case 37: // left
case 39: // right
self._traverse(e.which, this);
break;
case 13: // enter
case 32: //space
$(this).find('input')[0].click();
break;
case 65: // a
if(e.altKey) {
self.checkAll();
}
break;
case 85: // u
if(e.altKey) {
self.uncheckAll();
}
break;
}
})
.on('click.multiselect', 'input[type="checkbox"], input[type="radio"]', function(e) {
var $this = $(this);
var val = this.value;
var optionText = $this.parent().find("span").text();
var checked = this.checked;
var tags = self.element.find('option');
// bail if this input is disabled or the event is cancelled
if(this.disabled || self._trigger('click', e, { value: val, text: optionText, checked: checked }) === false) {
e.preventDefault();
return;
}
// make sure the input has focus. otherwise, the esc key
// won't close the menu after clicking an item.
$this.focus();
// toggle aria state
$this.prop('aria-selected', checked);
// change state on the original option tags
tags.each(function() {
if(this.value === val) {
this.selected = checked;
} else if(!self.options.multiple) {
this.selected = false;
}
});
// some additional single select-specific logic
if(!self.options.multiple) {
self.labels.removeClass('ui-state-active');
$this.closest('label').toggleClass('ui-state-active', checked);
// close menu
self.close();
}
// fire change on the select box
self.element.trigger("change");
// setTimeout is to fix multiselect issue #14 and #47. caused by jQuery issue #3827
// http://bugs.jquery.com/ticket/3827
setTimeout($.proxy(self.update, self), 10);
});
},
_bindHeaderEvents: function() {
var self = this;
// header links
this.header.on('click.multiselect', 'a', function(e) {
var $this = $(this);
if($this.hasClass('ui-multiselect-close')) {
self.close();
} else if($this.hasClass("ui-multiselect-all")) {
self.checkAll();
} else if($this.hasClass("ui-multiselect-none")) {
self.uncheckAll();
}
e.preventDefault();
}).on('keydown.multiselect', 'a', function(e) {
switch(e.which) {
case 27: // esc
self.close();
break;
case 9: // tab
var $target = $(e.target);
if((e.shiftKey && !$target.parent().prev().length && !self.header.find(".ui-multiselect-filter").length) || (!$target.parent().next().length && !self.labels.length && !e.shiftKey)) {
self.close();
e.preventDefault();
}
break;
}
});
},
_bindEvents: function() {
var self = this;
this._bindButtonEvents();
this._bindMenuEvents();
this._bindHeaderEvents();
// close each widget when clicking on any other element/anywhere else on the page
$doc.bind('mousedown.' + self._namespaceID, function(event) {
var target = event.target;
if(self._isOpen &&
target !== self.button[0] &&
target !== self.menu[0] &&
!$.contains(self.menu[0], target) &&
!$.contains(self.button[0], target)
) {
self.close();
}
});
// deal with form resets. the problem here is that buttons aren't
// restored to their defaultValue prop on form reset, and the reset
// handler fires before the form is actually reset. delaying it a bit
// gives the form inputs time to clear.
$(this.element[0].form).bind('reset.' + this._namespaceID, function() {
setTimeout($.proxy(self.refresh, self), 10);
});
},
// Determines the minimum width for the button and menu
// Can be a number, a digit string, or a percentage
_getMinWidth: function() {
var minVal = this.options.minWidth;
var width = 0;
switch (typeof minVal) {
case 'number':
width = minVal;
break;
case 'string':
var lastChar = minVal[ minVal.length -1 ];
width = minVal.match(/\d+/);
if(lastChar === '%') {
width = this.element.parent().outerWidth() * (width/100);
} else {
width = parseInt(minVal, 10);
}
break;
}
return width;
},
// set button width
_setButtonWidth: function() {
var width = this.element.outerWidth();
var minVal = this._getMinWidth();
if(width < minVal) {
width = minVal;
}
// set widths
this.button.outerWidth(width);
},
// set menu width
_setMenuWidth: function() {
var m = this.menu;
var width = (this.button.outerWidth() <= 0) ? this._getMinWidth() : this.button.outerWidth();
m.outerWidth(this.options.menuWidth || width);
},
// Sets the height of the menu
// Will set a scroll bar if the menu height exceeds that of the height in options
_setMenuHeight: function() {
var headerHeight = this.menu.children(".ui-multiselect-header:visible").outerHeight(true);
var ulHeight = 0;
this.menu.find(".ui-multiselect-checkboxes li, .ui-multiselect-checkboxes a").each(function(idx, li) {
ulHeight += $(li).outerHeight(true);
});
if(ulHeight > this.options.height) {
this.menu.children(".ui-multiselect-checkboxes").css("overflow", "auto");
ulHeight = this.options.height;
} else {
this.menu.children(".ui-multiselect-checkboxes").css("overflow", "hidden");
}
this.menu.children(".ui-multiselect-checkboxes").height(ulHeight);
this.menu.height(ulHeight + headerHeight);
},
// Resizes the menu, called every time the menu is opened
_resizeMenu: function() {
this._setMenuWidth();
this._setMenuHeight();
},
// move up or down within the menu
_traverse: function(which, start) {
var $start = $(start);
var moveToLast = which === 38 || which === 37;
// select the first li that isn't an optgroup label / disabled
var $next = $start.parent()[moveToLast ? 'prevAll' : 'nextAll']('li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup):visible').first();
// we might have to jump to the next/previous option group
if(!$next.length) {
$next = $start.parents(".ui-multiselect-optgroup")[moveToLast ? "prev" : "next" ]();
}
// if at the first/last element
if(!$next.length) {
var $container = this.menu.find('ul').last();
// move to the first/last
this.menu.find('label:visible')[ moveToLast ? 'last' : 'first' ]().trigger('mouseover');
// set scroll position
$container.scrollTop(moveToLast ? $container.height() : 0);
} else {
$next.find('label:visible')[ moveToLast ? "last" : "first" ]().trigger('mouseover');
}
},
// This is an internal function to toggle the checked property and
// other related attributes of a checkbox.
//
// The context of this function should be a checkbox; do not proxy it.
_toggleState: function(prop, flag) {
return function() {
if(!this.disabled) {
this[ prop ] = flag;
}
if(flag) {
this.setAttribute('aria-selected', true);
} else {
this.removeAttribute('aria-selected');
}
};
},
// Toggles checked state on either an option group or all inputs
_toggleChecked: function(flag, group) {
var $inputs = (group && group.length) ? group : this.inputs;
var self = this;
// toggle state on inputs
$inputs.each(this._toggleState('checked', flag));
// give the first input focus
$inputs.eq(0).focus();
// update button text
this.update();
// gather an array of the values that actually changed
var values = {};
$inputs.each(function() {
values[this.value] = true;
});
// toggle state on original option tags
this.element
.find('option')
.each(function() {
if(!this.disabled && values[this.value]) {
self._toggleState('selected', flag).call(this);
}
});
// trigger the change event on the select
if($inputs.length) {
this.element.trigger("change");
}
},
// Toggle disable state on the widget and underlying select
_toggleDisabled: function(flag) {
this.button.prop({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled');
if(this.options.disableInputsOnToggle) {
var checkboxes = this.menu.find(".ui-multiselect-checkboxes").get(0);
var matchedInputs = [];
var key = "ech-multiselect-disabled";
var i = 0;
if(flag) {
// remember which elements this widget disabled (not pre-disabled)
// elements, so that they can be restored if the widget is re-enabled.
matchedInputs = checkboxes.querySelectorAll("input:enabled");
for(i = 0; i < matchedInputs.length; i++) {
matchedInputs[i].setAttribute(key, true);
matchedInputs[i].setAttribute("disabled", "disabled");
matchedInputs[i].setAttribute("aria-disabled", "disabled");
matchedInputs[i].parentNode.className = matchedInputs[i].parentNode.className + " ui-state-disabled";
}
} else {
matchedInputs = checkboxes.querySelectorAll("input:disabled");
for(i = 0; i < matchedInputs.length; i++) {
if(matchedInputs[i].hasAttribute(key)) {
matchedInputs[i].removeAttribute(key);
matchedInputs[i].removeAttribute("disabled");
matchedInputs[i].removeAttribute("aria-disabled");
matchedInputs[i].parentNode.className = matchedInputs[i].parentNode.className.replace(" ui-state-disabled", "");
}
}
}
}
this.element.prop({
'disabled':flag,
'aria-disabled':flag
});
},
// open the menu
open: function(e) {
var self = this;
var button = this.button;
var menu = this.menu;
var speed = this.speed;
var o = this.options;
var args = [];
// bail if the multiselectopen event returns false, this widget is disabled, or is already open
if(this._trigger('beforeopen') === false || button.hasClass('ui-state-disabled') || this._isOpen) {
return;
}
var $container = menu.find('.ui-multiselect-checkboxes');
var effect = o.show;
// figure out opening effects/speeds
if($.isArray(o.show)) {
effect = o.show[0];
speed = o.show[1] || self.speed;
}
// if there's an effect, assume jQuery UI is in use
// build the arguments to pass to show()
if(effect) {
args = [ effect, speed ];
}
// set the scroll of the checkbox container
$container.scrollTop(0);
// show the menu, maybe with a speed/effect combo
$.fn.show.apply(menu, args);
this._resizeMenu();
// positon
this.position();
// select the first not disabled option or the filter input if available
var filter = this.header.find(".ui-multiselect-filter");
if(filter.length) {
filter.first().find('input').trigger('focus');
} else if(this.labels.length){
this.labels.filter(':not(.ui-state-disabled)').eq(0).trigger('mouseover').trigger('mouseenter').find('input').trigger('focus');
} else {
this.header.find('a').first().trigger('focus');
}
button.addClass('ui-state-active');
this._isOpen = true;
this._trigger('open');
},
// close the menu
close: function() {
if(this._trigger('beforeclose') === false) {
return;
}
var o = this.options;
var effect = o.hide;
var speed = this.speed;
var args = [];
// figure out opening effects/speeds
if($.isArray(o.hide)) {
effect = o.hide[0];
speed = o.hide[1] || this.speed;
}
if(effect) {
args = [ effect, speed ];
}
$.fn.hide.apply(this.menu, args);
this.button.removeClass('ui-state-active').trigger('blur').trigger('mouseleave');
this._isOpen = false;
this._trigger('close');
this.button.trigger('focus');
},
enable: function() {
this._toggleDisabled(false);
},
disable: function() {
this._toggleDisabled(true);
},
checkAll: function(e) {
this._toggleChecked(true);
this._trigger('checkAll');
},
uncheckAll: function() {
this._toggleChecked(false);
this._trigger('uncheckAll');
},
getChecked: function() {
return this.menu.find('input').filter(':checked');
},
getUnchecked: function() {
return this.menu.find('input').not(':checked');
},
destroy: function() {
// remove classes + data
$.Widget.prototype.destroy.call(this);
// unbind events
$doc.unbind(this._namespaceID);
$(this.element[0].form).unbind(this._namespaceID);
this.button.remove();
this.menu.remove();
this.element.show();
return this;
},
isOpen: function() {
return this._isOpen;
},
widget: function() {
return this.menu;
},
getButton: function() {
return this.button;
},
getMenu: function() {
return this.menu;
},
getLabels: function() {
return this.labels;
},
/*
* Adds an option to the widget and underlying select
* attributes: Attributes hash to add to the option
* text: text of the option
* groupLabel: Option Group to add the option to
*/
addOption: function(attributes, text, groupLabel) {
var $option = $("<option/>").attr(attributes).text(text);
var optionNode = $option.get(0);
if(groupLabel) {
this.element.children("OPTGROUP").filter(function() {
return $(this).prop("label") === groupLabel;
}).append($option);
this.menu.find(".ui-multiselect-optgroup").filter(function() {
return $(this).find("a").text() === groupLabel;
}).append(this._makeOption(optionNode));
} else {
this.element.append($option);
this.menu.find(".ui-multiselect-checkboxes").append(this._makeOption(optionNode));
}
//update cached elements
this.labels = this.menu.find('label');
this.inputs = this.labels.children('input');
},
removeOption: function(value) {
if(!value) {
return;
}
this.element.find("option[value=" + value + "]").remove();
this.labels.find("input[value=" + value + "]").parents("li").remove();
//update cached elements
this.labels = this.menu.find('label');
this.inputs = this.labels.children('input');
},
position: function() {
var pos = {
my: "top",
at: "bottom",
of: this.button
};
if(!$.isEmptyObject(this.options.position)) {
pos.my = this.options.position.my || pos.my;
pos.at = this.options.position.at || pos.at;
pos.of = this.options.position.of || pos.of;
}
if($.ui && $.ui.position) {
this.menu.position(pos);
} else {
pos = this.button.position();
pos.top += this.button.outerHeight(false);
this.menu.offset(pos);
}
},
// react to option changes after initialization
_setOption: function(key, value) {
var menu = this.menu;
switch(key) {
case 'header':
if(typeof value === 'boolean') {
this.header[value ? 'show' : 'hide']();
} else if(typeof value === 'string') {
this.headerLinkContainer.children("li:not(:last-child)").remove();
this.headerLinkContainer.prepend("<li>" + value + "</li>");
}
break;
case 'checkAllText':
menu.find('a.ui-multiselect-all span').eq(-1).text(value);
break;
case 'uncheckAllText':
menu.find('a.ui-multiselect-none span').eq(-1).text(value);
break;
case 'height':
this.options[key] = value;
this._setMenuHeight();
break;
case 'minWidth':
case 'menuWidth':
this.options[key] = value;
this._setButtonWidth();
this._setMenuWidth();
break;
case 'selectedText':
case 'selectedList':
case 'noneSelectedText':
this.options[key] = value; // these all needs to update immediately for the update() call
this.update();
break;
case 'classes':
menu.add(this.button).removeClass(this.options.classes).addClass(value);
break;
case 'multiple':
menu.toggleClass('ui-multiselect-single', !value);
this.options.multiple = value;
this.element[0].multiple = value;
this.uncheckAll();
this.refresh();
break;
case 'position':
this.position();
break;
case 'selectedListSeparator':
this.options[key] = value;
this.update(true);
break;
}
$.Widget.prototype._setOption.apply(this, arguments);
}
});
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,74 @@
{
"name": "jquery-ui",
"title": "jQuery UI",
"description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.",
"version": "1.12.1",
"homepage": "http://jqueryui.com",
"author": {
"name": "jQuery Foundation and other contributors",
"url": "https://github.com/jquery/jquery-ui/blob/1.12.1/AUTHORS.txt"
},
"main": "ui/widget.js",
"maintainers": [
{
"name": "Scott González",
"email": "scott.gonzalez@gmail.com",
"url": "http://scottgonzalez.com"
},
{
"name": "Jörn Zaefferer",
"email": "joern.zaefferer@gmail.com",
"url": "http://bassistance.de"
},
{
"name": "Mike Sherov",
"email": "mike.sherov@gmail.com",
"url": "http://mike.sherov.com"
},
{
"name": "TJ VanToll",
"email": "tj.vantoll@gmail.com",
"url": "http://tjvantoll.com"
},
{
"name": "Felix Nagel",
"email": "info@felixnagel.com",
"url": "http://www.felixnagel.com"
},
{
"name": "Alex Schmitz",
"email": "arschmitz@gmail.com",
"url": "https://github.com/arschmitz"
}
],
"repository": {
"type": "git",
"url": "git://github.com/jquery/jquery-ui.git"
},
"bugs": "https://bugs.jqueryui.com/",
"license": "MIT",
"scripts": {
"test": "grunt"
},
"dependencies": {},
"devDependencies": {
"commitplease": "2.3.0",
"grunt": "0.4.5",
"grunt-bowercopy": "1.2.4",
"grunt-cli": "0.1.13",
"grunt-compare-size": "0.4.0",
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-csslint": "0.5.0",
"grunt-contrib-jshint": "0.12.0",
"grunt-contrib-qunit": "1.0.1",
"grunt-contrib-requirejs": "0.4.4",
"grunt-contrib-uglify": "0.11.1",
"grunt-git-authors": "3.1.0",
"grunt-html": "6.0.0",
"grunt-jscs": "2.1.0",
"load-grunt-tasks": "3.4.0",
"rimraf": "2.5.1",
"testswarm": "1.1.0"
},
"keywords": []
}

View File

@@ -0,0 +1,507 @@
/***
Spectrum Colorpicker v1.5.1
https://github.com/bgrins/spectrum
Author: Brian Grinstead
License: MIT
***/
.sp-container {
position:absolute;
top:0;
left:0;
display:inline-block;
*display: inline;
*zoom: 1;
/* https://github.com/bgrins/spectrum/issues/40 */
z-index: 9999994;
overflow: hidden;
}
.sp-container.sp-flat {
position: relative;
}
/* Fix for * { box-sizing: border-box; } */
.sp-container,
.sp-container * {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
.sp-top {
position:relative;
width: 100%;
display:inline-block;
}
.sp-top-inner {
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
}
.sp-color {
position: absolute;
top:0;
left:0;
bottom:0;
right:20%;
}
.sp-hue {
position: absolute;
top:0;
right:0;
bottom:0;
left:84%;
height: 100%;
}
.sp-clear-enabled .sp-hue {
top:33px;
height: 77.5%;
}
.sp-fill {
padding-top: 80%;
}
.sp-sat, .sp-val {
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
}
.sp-alpha-enabled .sp-top {
margin-bottom: 18px;
}
.sp-alpha-enabled .sp-alpha {
display: block;
}
.sp-alpha-handle {
position:absolute;
top:-4px;
bottom: -4px;
width: 6px;
left: 50%;
cursor: pointer;
border: 1px solid black;
background: white;
opacity: .8;
}
.sp-alpha {
display: none;
position: absolute;
bottom: -14px;
right: 0;
left: 0;
height: 8px;
}
.sp-alpha-inner {
border: solid 1px #333;
}
.sp-clear {
display: none;
}
.sp-clear.sp-clear-display {
background-position: center;
}
.sp-clear-enabled .sp-clear {
display: block;
position:absolute;
top:0px;
right:0;
bottom:0;
left:84%;
height: 28px;
}
/* Don't allow text selection */
.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
-webkit-user-select:none;
-moz-user-select: -moz-none;
-o-user-select:none;
user-select: none;
}
.sp-container.sp-input-disabled .sp-input-container {
display: none;
}
.sp-container.sp-buttons-disabled .sp-button-container {
display: none;
}
.sp-container.sp-palette-buttons-disabled .sp-palette-button-container {
display: none;
}
.sp-palette-only .sp-picker-container {
display: none;
}
.sp-palette-disabled .sp-palette-container {
display: none;
}
.sp-initial-disabled .sp-initial {
display: none;
}
/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
.sp-sat {
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
}
.sp-val {
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
}
.sp-hue {
background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}
/* IE filters do not support multiple color stops.
Generate 6 divs, line them up, and do two color gradients for each.
Yes, really.
*/
.sp-1 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
}
.sp-2 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
}
.sp-3 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
}
.sp-4 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
}
.sp-5 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
}
.sp-6 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
}
.sp-hidden {
display: none !important;
}
/* Clearfix hack */
.sp-cf:before, .sp-cf:after { content: ""; display: table; }
.sp-cf:after { clear: both; }
.sp-cf { *zoom: 1; }
/* Mobile devices, make hue slider bigger so it is easier to slide */
@media (max-device-width: 480px) {
.sp-color { right: 40%; }
.sp-hue { left: 63%; }
.sp-fill { padding-top: 60%; }
}
.sp-dragger {
border-radius: 5px;
height: 5px;
width: 5px;
border: 1px solid #fff;
background: #000;
cursor: pointer;
position:absolute;
top:0;
left: 0;
}
.sp-slider {
position: absolute;
top:0;
cursor:pointer;
height: 3px;
left: -1px;
right: -1px;
border: 1px solid #000;
background: white;
opacity: .8;
}
/*
Theme authors:
Here are the basic themeable display options (colors, fonts, global widths).
See http://bgrins.github.io/spectrum/themes/ for instructions.
*/
.sp-container {
border-radius: 0;
background-color: #ECECEC;
border: solid 1px #f0c49B;
padding: 0;
}
.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear {
font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.sp-top {
margin-bottom: 3px;
}
.sp-color, .sp-hue, .sp-clear {
border: solid 1px #666;
}
/* Input */
.sp-input-container {
float:right;
width: 100px;
margin-bottom: 4px;
}
.sp-initial-disabled .sp-input-container {
width: 100%;
}
.sp-input {
font-size: 12px !important;
border: 1px inset;
padding: 4px 5px;
margin: 0;
width: 100%;
background:transparent;
border-radius: 3px;
color: #222;
}
.sp-input:focus {
border: 1px solid orange;
}
.sp-input.sp-validation-error {
border: 1px solid red;
background: #fdd;
}
.sp-picker-container , .sp-palette-container {
float:left;
position: relative;
padding: 10px;
padding-bottom: 300px;
margin-bottom: -290px;
}
.sp-picker-container {
width: 172px;
border-left: solid 1px #fff;
}
/* Palettes */
.sp-palette-container {
border-right: solid 1px #ccc;
}
.sp-palette-only .sp-palette-container {
border: 0;
}
.sp-palette .sp-thumb-el {
display: block;
position:relative;
float:left;
width: 24px;
height: 15px;
margin: 3px;
cursor: pointer;
border:solid 2px transparent;
}
.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
border-color: orange;
}
.sp-thumb-el {
position:relative;
}
/* Initial */
.sp-initial {
float: left;
border: solid 1px #333;
}
.sp-initial span {
width: 30px;
height: 25px;
border:none;
display:block;
float:left;
margin:0;
}
.sp-initial .sp-clear-display {
background-position: center;
}
/* Buttons */
.sp-palette-button-container,
.sp-button-container {
float: right;
}
/* Replacer (the little preview div that shows up instead of the <input>) */
.sp-replacer {
margin:0;
overflow:hidden;
cursor:pointer;
padding: 4px;
display:inline-block;
*zoom: 1;
*display: inline;
border: solid 1px #91765d;
background: #eee;
color: #333;
vertical-align: middle;
}
.sp-replacer:hover, .sp-replacer.sp-active {
border-color: #F0C49B;
color: #111;
}
.sp-replacer.sp-disabled {
cursor:default;
border-color: silver;
color: silver;
}
.sp-dd {
padding: 2px 0;
height: 16px;
line-height: 16px;
float:left;
font-size:10px;
}
.sp-preview {
position:relative;
width:25px;
height: 20px;
border: solid 1px #222;
margin-right: 5px;
float:left;
z-index: 0;
}
.sp-palette {
*width: 220px;
max-width: 220px;
}
.sp-palette .sp-thumb-el {
width:16px;
height: 16px;
margin:2px 1px;
border: solid 1px #d0d0d0;
}
.sp-container {
padding-bottom:0;
}
/* Buttons: http://hellohappy.org/css3-buttons/ */
.sp-container button {
background-color: #eeeeee;
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
border: 1px solid #ccc;
border-bottom: 1px solid #bbb;
border-radius: 3px;
color: #333;
font-size: 14px;
line-height: 1;
padding: 5px 4px;
text-align: center;
text-shadow: 0 1px 0 #eee;
vertical-align: middle;
}
.sp-container button:hover {
background-color: #dddddd;
background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -o-linear-gradient(top, #dddddd, #bbbbbb);
background-image: linear-gradient(to bottom, #dddddd, #bbbbbb);
border: 1px solid #bbb;
border-bottom: 1px solid #999;
cursor: pointer;
text-shadow: 0 1px 0 #ddd;
}
.sp-container button:active {
border: 1px solid #aaa;
border-bottom: 1px solid #888;
-webkit-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-moz-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-ms-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-o-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
}
.sp-cancel {
font-size: 11px;
color: #d93f3f !important;
margin:0;
padding:2px;
margin-right: 5px;
vertical-align: middle;
text-decoration:none;
}
.sp-cancel:hover {
color: #d93f3f !important;
text-decoration: underline;
}
.sp-palette span:hover, .sp-palette span.sp-thumb-active {
border-color: #000;
}
.sp-preview, .sp-alpha, .sp-thumb-el {
position:relative;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
}
.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner {
display:block;
position:absolute;
top:0;left:0;bottom:0;right:0;
}
.sp-palette .sp-thumb-inner {
background-position: 50% 50%;
background-repeat: no-repeat;
}
.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
}
.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
}
.sp-clear-display {
background-repeat:no-repeat;
background-position: center;
background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
}

File diff suppressed because it is too large Load Diff

122
distfiles/login.php Normal file
View File

@@ -0,0 +1,122 @@
<?php
/*
login.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
$print=$_REQUEST['print'];
$userid=$_REQUEST['userid'];
$userlogin=$_REQUEST['userlogin'];
$pass=$_REQUEST['pass'];
$login=$_REQUEST['login'];
$cancel=$_REQUEST['cancel'];
if ($cancel) {
session_destroy();
}
$appname=APP_NAME;
if ($print) {
$mbgcolor=P_MENUBG_COLOR;
} else {
$mbgcolor=MENUBG_COLOR;
}
framework("begin","$appname","Login Page",$print);
//var_dump($_REQUEST);
pagetable("begin");
if(!$print){
pageblock("left","begin");
$printable=false;
sidemenu($printable);
pageblock("left","end");
}
pageblock("right","begin");
if ($login) {
// get the id from the userlogin
$userid=dblookup($drs_db,"users","login","id",$userlogin);
$useractive=dblookup($drs_db,"users","id","active",$userid);
// log me in
$pwhash=mysqli_fetch_row(mysqli_query($drs_db,"select password_hash from users where id=\"$userid\""))[0];
if ($userid) {
if ($useractive) {
if (password_verify($pass, $pwhash)) {
$_SESSION['userid']=$userid;
echo "
<script>location.assign(\"login.php\");</script>
";
} else {
$admins=mysqli_query($drs_db,"select firstname,lastname from users where active is true and role=\"".ADMIN."\"");
echo "
Incorrect password. Please <a href=\"login.php\">try again</a>.<br><br>
Forgot your password? Contact an administrator:<br><br>
";
while ($adminrow=mysqli_fetch_assoc($admins)) {
$firstname=$adminrow["firstname"];
$lastname=$adminrow["lastname"];
echo "$firstname $lastname <br>";
}
}
} else {
$admins=mysqli_query($drs_db,"select firstname,lastname from users where active is true and role=\"".ADMIN."\"");
echo "
Your account is inactive. Please contact one of these administrators:<br><br>
";
while ($adminrow=mysqli_fetch_assoc($admins)) {
$firstname=$adminrow["firstname"];
$lastname=$adminrow["lastname"];
echo "$firstname $lastname <br>";
}
}
} else {
$admins=mysqli_query($drs_db,"select firstname,lastname from users where active is true and role=\"".ADMIN."\"");
echo "
Incorrect password. Please <a href=\"login.php\">try again</a>.<br><br>
Forgot your password? Contact an administrator:<br><br>
";
while ($adminrow=mysqli_fetch_assoc($admins)) {
$firstname=$adminrow["firstname"];
$lastname=$adminrow["lastname"];
echo "$firstname $lastname <br>";
}
}
} else if ($cancel) {
echo "
<script>location.assign(\"login.php\");</script>
";
} else {
if (!isset($_SESSION['userid'])) {
// show the login form
echo "
<form method=\"post\" action=\"login.php\">
Login: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"text\" name=\"userlogin\" size=\"40\">
<br><br>
Password: &nbsp;<input type=\"password\" name=\"pass\" size=\"40\"><br><br>
<input type=\"submit\" name=\"login\" value=\"Log In\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"cancel\" value=\"Cancel\"><br>
</form>
<br><hr>
";
} else {
$userid=$_SESSION['userid'];
$firstname=mysqli_fetch_row(mysqli_query($drs_db,"select firstname from users where id=\"$userid\""))[0];
echo "
Welcome $firstname. Please select a menu option at the left to continue.<br><hr>
";
}
}
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

331
distfiles/profile.php Normal file
View File

@@ -0,0 +1,331 @@
<?php
/*
profile.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// redirect to index.php on cancel button press
if ($_REQUEST['cancel']) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:index.php");
exit();
}
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
// if not logged in, redirect to login.php
$role=dblookup($drs_db,"users","id","role",$userid);
if (!$role) {
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:login.php");
exit();
}
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming[]
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST[] to $incoming[]
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
$update_colors=$incoming['update_colors'];
$reset_colors=$incoming['reset_colors'];
$newbgc=$incoming['newbgc'];
$newmbgc=$incoming['newmbgc'];
$newtc=$incoming['newtc'];
$newlc=$incoming['newlc'];
$newvlc=$incoming['newvlc'];
$newhc=$incoming['newhc'];
$edit_user=$incoming['edit_user'];
$update_user=$incoming['update_user'];
$user_id=$userid; // ensures that I can only change my own profile
$user_fname=$incoming['user_fname'];
$user_lname=$incoming['user_lname'];
$user_login=$incoming['user_login'];
$user_pass=$incoming['user_pass'];
$user_passconf=$incoming['user_passconf'];
// define local functions
// assign variables from constants
$appname=APP_NAME;
if ($print=="Printer Friendly") {
$mbgcolor=P_MENUBG_COLOR;
} else {
$mbgcolor=MENUBG_COLOR;
}
framework("begin","$appname","User Profile",$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
if ($update_colors) {
if ($newbgc) putsetting("background_color",$newbgc,$user_id);
if ($newmbgc) putsetting("menubg_color",$newmbgc,$user_id);
if ($newtc) putsetting("text_color",$newtc,$user_id);
if ($newlc) putsetting("link_color",$newlc,$user_id);
if ($newvlc) putsetting("vlink_color",$newvlc,$user_id);
if ($newhc) putsetting("heading_color",$newhc,$user_id);
echo "<meta http-equiv='refresh' content='0'>";
}
if ($reset_colors) {
mysqli_query($drs_db,"delete from profile where name like \"%_color\" and user=\"$user_id\"");
echo "<meta http-equiv='refresh' content='0'>";
}
if ($edit_user) {
if ($update_user) {
// do error checking
// remove html tags from user name
$user_fname=strip_tags($user_fname);
$user_lname=strip_tags($user_lname);
$user_login=strip_tags($user_login);
// test for first name supplied
if (strlen(trim($user_fname))) {
$fnamesuppld=true;
} else {
$fnamesuppld=false;
$fnamesuppld_err=true;
}
// test for last name supplied
if (strlen(trim($user_lname))) {
$lnamesuppld=true;
} else {
$lnamesuppld=false;
$lnamesuppld_err=true;
}
// test for name unique
if (mysqli_num_rows(mysqli_query($drs_db,"select id from users where firstname=\"$user_fname\" and lastname=\"$user_lname\" and id!=\"$user_id\""))) {
if (mysqli_num_rows(mysqli_query($drs_db,"select id from users where firstname=\"$user_fname\" and lastname=\"$user_lname\""))) {
$nameunique=false;
$nameunique_err=true;
} else {
$nameunique=true;
}
} else {
$nameunique=true;
}
// test for login supplied
if (strlen(trim($user_login))) {
$loginsuppld=true;
} else {
$loginsuppld=false;
$loginsuppld_err=true;
}
// test for login unique
if (mysqli_num_rows(mysqli_query($drs_db,"select id from users where login=\"$user_login\" and id!=\"$user_id\""))) {
if (mysqli_num_rows(mysqli_query($drs_db,"select id from users where login=\"$user_login\""))) {
$loginunique=false;
$loginunique_err=true;
} else {
$loginunique=true;
}
} else {
$loginunique=true;
}
// sanitize first name, last name, login
$clean_fname=mysqli_real_escape_string($drs_db,$user_fname);
$clean_lname=mysqli_real_escape_string($drs_db,$user_lname);
$clean_login=mysqli_real_escape_string($drs_db,$user_login);
if ($user_pass!="password_is_unchanged") {
// test passwords
$passresults=validate_password($user_pass,$user_passconf);
if ($passresults['match']) {
$passmatch=true;
} else {
$passmatch=false;
$passmatch_err=true;
}
if ($passresults['complex']) {
$passcomplex=true;
} else {
$passcomplex=false;
$passcomplex_err=true;
}
if ($passmatch && $passcomplex) {
$passhash=password_hash($user_pass,PASSWORD_DEFAULT);
$updqry="update users set firstname=\"$clean_fname\",lastname=\"$clean_lname\",login=\"$clean_login\",password_hash=\"$passhash\" where id=\"$user_id\"";
}
} else {
$passmatch=true;
$passcomplex=true;
$updqry="update users set firstname=\"$clean_fname\",lastname=\"$clean_lname\",login=\"$clean_login\" where id=\"$user_id\"";
}
if ($fnamesuppld && $lnamesuppld && $nameunique && $loginsuppld && $loginunique && $passcomplex && $passmatch) {
// modify the table
mysqli_query($drs_db,$updqry);
}
}
}
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
echo "
<div id=\"profiletabs\">
<ul>
<li><a href=\"#account\">Account Settings</a></li>
<li><a href=\"#page_colors\">Page Colors</a></li>
</ul>
<div id=\"account\">
";
if ($usernameunique_err) format_message(1,"User name already exists.");
if ($fnamesuppld_err) format_message(1,"First name cannot be blank.");
if ($lnamesuppld_err) format_message(1,"Last name cannot be blank.");
if ($loginsuppld_err) format_message(1,"Login cannot be blank.");
if ($loginunique_err) format_message(1,"Login already exists.");
if ($passcomplex_err) format_message(1,"Password doesn't meet complexity requirements.");
if ($passmatch_err) format_message(1,"The supplied passwords don't match.");
// set form options for editing
$sectiontitle="<b><font size=\"+1\">Modify Account</font></b><br><br>";
$formtag="<form method=\"post\" action=\"profile.php?edit_user=1#account\">";
$buttontags="
<input type=\"hidden\" name=\"user_id\" value=\"$user_id\">
<input type=\"submit\" name=\"update_user\" value=\"Update Info\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset\" value=\"Reset\"><br>
";
// pull current values from database
$currentvalues=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from users where id=$user_id"));
$user_fname=$currentvalues["firstname"];
$user_lname=$currentvalues["lastname"];
$user_login=$currentvalues["login"];
$user_pass=$user_passconf="password_is_unchanged";
$password_help="Password must be at least 8 characters in length and contain at least one upper case letter, one lower case letter, one number, and one special character.";
echo "
$sectiontitle
$formtag
<table border=\"0\">
<tr><td>
First Name: &nbsp;<input type=\"text\" name=\"user_fname\" size=\"40\" value=\"$user_fname\"><br><br>
Last Name: &nbsp;<input type=\"text\" name=\"user_lname\" size=\"40\" value=\"$user_lname\"><br><br>
Login: &nbsp;<input type=\"text\" name=\"user_login\" size=\"40\" value=\"$user_login\"><br><br>
Password: &nbsp;<input type=\"password\" name=\"user_pass\" size=\"40\" id=\"pass\" title=\"$password_help\" value=\"$user_pass\"><br><br>
Repeat Password: &nbsp;<input type=\"password\" name=\"user_passconf\" size=\"40\" id=\"passconf\" title=\"$password_help\" value=\"$user_passconf\"><br><br>
<font size=\"-1\">Need a random password? &nbsp;</font>
";
$rpwok=false;
while (!$rpwok) {
$rpw=substr(str_shuffle(password_hash(microtime(),PASSWORD_DEFAULT)), 10, 12);
$rpwtst=validate_password($rpw,$rpw);
if ($rpwtst['complex']) $rpwok=true;
}
echo "&nbsp; $rpw<br><br>
<br><br>
</td></tr>
</table>
$buttontags
</form>
<br><hr>
";
echo "
</div>
<div id=\"page_colors\">
";
$curbgc=getsetting("background_color",$user_id);
$curmbgc=getsetting("menubg_color",$user_id);
$curtc=getsetting("text_color",$user_id);
$curlc=getsetting("link_color",$user_id);
$curvlc=getsetting("vlink_color",$user_id);
$curhc=getsetting("heading_color",$user_id);
echo "
<font size=\"+1\"><b>Color Configuration Parameters</b></font><br><br>
<table border=\"0\"><tr>
<td>
<form method=\"post\" action=\"profile.php#page_colors\">
<b>Select the color you'd like to change then use the color picker to select a new color</b><br><br>
<table border=\"0\" cellpadding=\"10\">
<tr><td>Page background color</td><td>#<input type=\"text\" name=\"newbgc\" value=\"$curbgc\" id=\"bgcfield\" onFocus=\"ddcolorposter.echocolor(this, 'bgcbox')\"> <span id=\"bgcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Menu background color</td><td>#<input type=\"text\" name=\"newmbgc\" value=\"$curmbgc\" id=\"mbgcfield\" onFocus=\"ddcolorposter.echocolor(this, 'mbgcbox')\"> <span id=\"mbgcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Normal text color</td><td>#<input type=\"text\" name=\"newtc\" value=\"$curtc\" id=\"tcfield\" onFocus=\"ddcolorposter.echocolor(this, 'tcbox')\"> <span id=\"tcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Link color</td><td>#<input type=\"text\" name=\"newlc\" value=\"$curlc\" id=\"lcfield\" onFocus=\"ddcolorposter.echocolor(this, 'lcbox')\"> <span id=\"lcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Visited link color</td><td>#<input type=\"text\" name=\"newvlc\" value=\"$curvlc\" id=\"vlcfield\" onFocus=\"ddcolorposter.echocolor(this, 'vlcbox')\"> <span id=\"vlcbox\" class=\"colorbox\">____</span></td></tr>
<tr><td>Heading color</td><td>#<input type=\"text\" name=\"newhc\" value=\"$curhc\" id=\"hcfield\" onFocus=\"ddcolorposter.echocolor(this, 'hcbox')\"> <span id=\"hcbox\" class=\"colorbox\">____</span></td></tr>
</table>
<br><br>
<input type=\"submit\" name=\"update_colors\" value=\"Update Colors\">&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset_colors\" value=\"Reset Colors to Defaults\">
</td>
<td>
<div id=\"pickerPanel\" class=\"dragPanel\">
<h4 id=\"pickerHandle\">&nbsp;</h4>
<div id=\"pickerDiv\">
<img id=\"pickerbg\" src=\"colorpicker/img/pickerbg.png\" alt=\"\">
<div id=\"selector\"><img src=\"colorpicker/img/select.gif\"></div>
</div>
<div id=\"hueBg\">
<div id=\"hueThumb\"><img src=\"colorpicker/img/hline.png\"></div>
</div>
<div id=\"pickervaldiv\">
<form name=\"pickerform\" onsubmit=\"return pickerUpdate()\">
<font size=\"-3\">
<br />
R <input name=\"pickerrval\" id=\"pickerrval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
H <input name=\"pickerhval\" id=\"pickerhval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
<br />
G <input name=\"pickergval\" id=\"pickergval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
S <input name=\"pickergsal\" id=\"pickersval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
<br />
B <input name=\"pickerbval\" id=\"pickerbval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
V <input name=\"pickervval\" id=\"pickervval\" type=\"text\" value=\"0\" size=\"3\" maxlength=\"3\" />
<br />
<br />
# <input name=\"pickerhexval\" id=\"pickerhexval\" type=\"text\" value=\"0\" size=\"6\" maxlength=\"6\" />
<br />
</font>
</form>
</div>
<div id=\"pickerSwatch\">&nbsp;</div>
</div>
</td>
</tr></table>
";
echo "
</form>
</div>
</div>
";
echo "<br>";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

785
distfiles/search.php Normal file
View File

@@ -0,0 +1,785 @@
<?php
/*
search.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming[]
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
if (!$_REQUEST['cancel']) $incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
$search=$incoming['search'];
$viewtype=$incoming['viewtype'];
$s_device=$incoming['s_device'];
$s_period=$incoming['s_period'];
$s_period_effective=$incoming['s_period_effective'];
$s_reported_by=$incoming['s_reported_by'];
$s_report_date_start=$incoming['s_report_date_start'];
$s_report_date_end=$incoming['s_report_date_end'];
$s_report_time_start=$incoming['s_report_time_start'];
$s_report_time_end=$incoming['s_report_time_end'];
$s_action_date_start=$incoming['s_action_date_start'];
$s_action_date_end=$incoming['s_action_date_end'];
$s_action_time_start=$incoming['s_action_time_start'];
$s_action_time_end=$incoming['s_action_time_end'];
$s_action_by=$incoming['s_action_by'];
$s_action_reason=$incoming['s_action_reason'];
$s_action_text=$incoming['s_action_text'];
$s_subsystem=$incoming['s_subsystem'];
$s_discrepancy_text=$incoming['s_discrepancy_text'];
$s_status=$incoming['s_status'];
$s_group=$incoming['s_group'];
// assign variables from constants
$appname=APP_NAME;
if ($print) {
$mbgcolor=P_MENUBG_COLOR;
} else {
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($drs_db,"users","id","role",$userid);
$pgtitle="Search Writeups";
framework("begin","$appname",$pgtitle,$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
// get min, max report and action_dates from writeups table, validate input dates/times and set defaults
$minmaxqry=mysqli_query($drs_db,"select min(report_date),max(report_date),min(action_date),max(action_date) from writeups");
$minmaxdates=mysqli_fetch_row($minmaxqry);
if (!$s_report_date_start || !validateDate($s_report_date_start)) $s_report_date_start=$minmaxdates[0];
if (!$s_report_date_end || !validateDate($s_report_date_end)) $s_report_date_end=$minmaxdates[1];
if (!$s_report_time_start || !validateTime($s_report_time_start)) $s_report_time_start="00:00:00";
if (!$s_report_time_end || !validateTime($s_report_time_end)) $s_report_time_end="23:59:59";
if ($search) {
// strip whitespace from beginning and end of text fields
$s_reported_by=trim($s_reported_by);
$s_action_text=trim($s_action_text);
$s_discrepancy_text=trim($s_discrepancy_text);
// build the query string
$query_string="";
// device
if ($s_device) {
$query_string="{$query_string}(";
$device_param="Devices:";
foreach ($s_device as $dev_val) {
$query_string="{$query_string}device=\"{$dev_val}\" or ";
$device_dsp=dblookup($drs_db,"devices","id","name",$dev_val);
$device_param="{$device_param} {$device_dsp}, ";
}
$device_param=rtrim($device_param,", ");
$num_devices=mysqli_num_rows(mysqli_query($drs_db,"select id from devices"));
if (count($s_device)==$num_devices) $device_param="Devices: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// subsystem
if ($s_subsystem) {
$query_string="{$query_string}(";
$subsystem_param="Subsystems:";
foreach ($s_subsystem as $sub_val) {
$query_string="{$query_string}subsystem=\"{$sub_val}\" or ";
$subsystem_dsp=dblookup($drs_db,"subsystems","id","name",$sub_val);
$subsystem_param="{$subsystem_param} {$subsystem_dsp}, ";
}
$subsystem_param=rtrim($subsystem_param,", ");
$num_subsystems=mysqli_num_rows(mysqli_query($drs_db,"select id from subsystems"));
if (count($s_subsystem)==$num_subsystems) $subsystem_param="Subsystems: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// period
if ($s_period) {
$query_string="{$query_string}(";
$period_param="Periods:";
foreach ($s_period as $per_val) {
$query_string="{$query_string}period=\"{$per_val}\" or ";
$period_dsp=$per_val;
$period_param="{$period_param} {$period_dsp}, ";
}
$period_param=rtrim($period_param,", ");
$num_periods=mysqli_num_rows(mysqli_query($drs_db,"select id from periods"));
if (count($s_period)==$num_periods) $period_param="Periods: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// period_effective
if ($s_period_effective) {
$query_string="{$query_string}(";
$eff_param="Period effective:";
foreach ($s_period_effective as $eff_val) {
$query_string="{$query_string}period_effective=\"{$eff_val}\" or ";
if ($eff_val=="0") $eff_dsp="<font color=\"#FF0000\">NEF</font>";
if ($eff_val=="1") $eff_dsp="<font color=\"#00FF00\">EFF</font>";
$eff_param="{$eff_param} {$eff_dsp}, ";
}
$eff_param=rtrim($eff_param,", ");
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// status
if ($s_status) {
$query_string="{$query_string}(";
$status_param="Status:";
foreach ($s_status as $stat_val) {
$query_string="{$query_string}status=\"{$stat_val}\" or ";
if ($stat_val=="1") $stat_dsp="<font color=\"#FF0000\">OPEN</font>";
if ($stat_val=="2") $stat_dsp="<font color=\"#00FF00\">CLSD</font>";
if ($stat_val=="3") $stat_dsp="<font color=\"#FFFF00\">DFRD</font>";
$status_param="{$status_param} {$stat_dsp}, ";
}
$status_param=rtrim($status_param,", ");
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// action by
if ($s_action_by) {
$query_string="{$query_string}(";
$actionby_param="Status changed by:";
foreach ($s_action_by as $actby_val) {
$query_string="{$query_string}action_by=\"{$actby_val}\" or ";
if ($actby_val==0) {
$actionby_dsp=" (none set)";
} else {
$actionby_dsp=dblookup($drs_db,"users","id","firstname",$actby_val)." ".dblookup($drs_db,"users","id","lastname",$actby_val);
}
$actionby_param="{$actionby_param} {$actionby_dsp}, ";
}
$actionby_param=rtrim($actionby_param,", ");
$num_users=mysqli_num_rows(mysqli_query($drs_db,"select id from users"));
if (count($s_action_by)==$num_users+1) $actionby_param="Status changed by: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// action reason
if ($s_action_reason) {
$query_string="{$query_string}(";
$reason_param="Status change reason:";
foreach ($s_action_reason as $actrn_val) {
$query_string="{$query_string}action_reason=\"{$actrn_val}\" or ";
if ($actrn_val==0) {
$reason_dsp=" (none set)";
} else {
$reason_dsp=dblookup($drs_db,"reasons","id","text",$actrn_val);
}
$reason_param="{$reason_param} {$reason_dsp}, ";
}
$reason_param=rtrim($reason_param,", ");
$num_reasons=mysqli_num_rows(mysqli_query($drs_db,"select id from reasons"));
if (count($s_action_reason)==$num_reasons+1) $reason_param="Status change reason: any";
$query_string=rtrim($query_string," or ");
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// report date
$query_string="{$query_string}(";
$query_string="{$query_string}report_date between \"{$s_report_date_start}\" and \"{$s_report_date_end}\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$reportdate_param="Report date between {$s_report_date_start} and {$s_report_date_end}";
// report time
$query_string="{$query_string}(";
$query_string="{$query_string}report_time between \"{$s_report_time_start}\" and \"{$s_report_time_end}\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$reporttime_param="Report time between {$s_report_time_start} and {$s_report_time_end}";
// action date
if ($s_action_date_start && $s_action_date_end) {
$query_string="{$query_string}(";
$query_string="{$query_string}action_date between \"{$s_action_date_start}\" and \"{$s_action_date_end}\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$actiondate_param="Action taken date between {$s_action_date_start} and {$s_action_date_end}";
} else {
$actiondate_param="Action taken date: any";
}
// action time
if ($s_action_time_start && $s_action_time_end) {
$query_string="{$query_string}(";
$query_string="{$query_string}action_time between \"{$s_action_time_start}\" and \"{$s_action_time_end}\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$actiontime_param="Action taken time between {$s_action_time_start} and {$s_action_time_end}";
} else {
$actiontime_param="Action taken time: any";
}
// discrepancy text
if ($s_discrepancy_text) {
$query_string="{$query_string}(";
$query_string="{$query_string}discrepancy_text like \"%{$s_discrepancy_text}%\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$discrepancytext_param="Text in discrepancy: {$s_discrepancy_text}";
} else {
$discrepancytext_param="Text in discrepancy: any";
}
// action text
if ($s_action_text) {
$query_string="{$query_string}(";
$query_string="{$query_string}action_text like \"%{$s_action_text}%\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$actiontext_param="Text in Action taken: {$s_action_text}";
} else {
$actiontext_param="Text in Action taken: any";
}
// reported by
if ($s_reported_by) {
$query_string="{$query_string}(";
$query_string="{$query_string}reported_by like \"%{$s_reported_by}%\"";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$repby_param="Text in Reported by: {$s_reported_by}";
} else {
$repby_param="Text in Reported by: any";
}
$query_string=rtrim($query_string," and ");
$query_string="select * from writeups where {$query_string} order by report_date asc";
// group membership
if ($s_group) {
$group_param="Group member:";
foreach ($s_group as $group_val) {
if ($group_val=="0") $group_dsp="No";
if ($group_val=="1") $group_dsp="Yes";
$group_param="{$group_param} {$group_dsp}, ";
}
$group_param=rtrim($group_param,", ");
}
}
// ******** end database manipulation ********
pagetable("begin");
if(!$print) {
pageblock("left","begin");
sidemenu();
echo "<br><br>";
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
// show search form
if (!$print) {
echo "
<form method=\"post\" action=\"search.php#results\">
<table border=\"0\" cellpadding=\"5\">
<tr>
<td align=\"left\">
";
// Device cell *********************
echo "
Device<br>
<select name=\"s_device[]\" id=\"ms-device\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
";
$drow=mysqli_query($drs_db,"select * from devices order by id asc");
while ($ditem=mysqli_fetch_assoc($drow)) {
if (!$search || in_array($ditem["id"],$s_device,true)) {
printf("<option value=\"%s\" selected>%s</option>",$ditem["id"],$ditem["name"]);
} else {
printf("<option value=\"%s\">%s</option>",$ditem["id"],$ditem["name"]);
}
}
echo "
</select>
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Subsystem cell *******************
echo "
Subsystem<br>
<select name=\"s_subsystem[]\" id=\"ms-subsystem\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
";
$ssrow=mysqli_query($drs_db,"select * from subsystems order by id asc");
while ($ssitem=mysqli_fetch_assoc($ssrow)) {
if (!$search || in_array($ssitem["id"],$s_subsystem,true)) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
} else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
}
}
echo "
</select>
";
// **********************************
echo "
</td><td></td>
";
echo "
</tr>
<tr>
<td align=\"left\">
";
// Period cell **********************
echo "
Period<br>
<select name=\"s_period[]\" id=\"ms-period\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
";
$prow=mysqli_query($drs_db,"select * from periods order by times asc");
while ($pitem=mysqli_fetch_assoc($prow)) {
if (!$search || in_array($pitem["id"],$s_period,true)) {
printf("<option value=\"%s\" title=\"Period %s\" selected>%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]);
} else {
printf("<option value=\"%s\" title=\"Period %s\">%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]);
}
}
echo "
</select>
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Report Date cell *****************
echo "
Report Date Between<br>
<input type=\"text\" name=\"s_report_date_start\" size=\"10\" maxlength=\"10\" value=\"$s_report_date_start\" id=\"sdp-report_date\" title=\"Format: YYYY-MM-DD\">
&nbsp;and&nbsp;
<input type=\"text\" name=\"s_report_date_end\" size=\"10\" maxlength=\"10\" value=\"$s_report_date_end\" id=\"edp-report_date\" title=\"Format: YYYY-MM-DD\">
";
// **********************************
echo "
</td>
";
echo "
<td align=\"left\">
";
// Report Time cell *****************
echo "
Report Time Between<br>
<input type=\"text\" name=\"s_report_time_start\" size=\"8\" maxlength=\"8\" value=\"$s_report_time_start\" title=\"Format: HH:MM:SS\">
&nbsp;and&nbsp;
<input type=\"text\" name=\"s_report_time_end\" size=\"8\" maxlength=\"8\" value=\"$s_report_time_end\" title=\"Format: HH:MM:SS\">
";
// **********************************
echo "
</td>
</tr>
<tr><td></td><td></td><td></td></tr>
<tr>
<td colspan=\"3\">
";
// Discrepancy text cell ************
echo "
Words in Discrepancy<br>
<textarea rows=\"5\" cols=\"80\" name=\"s_discrepancy_text\" wrap=\"soft\">$s_discrepancy_text</textarea><br>
";
// **********************************
echo "
</td>
</tr>
<tr>
<td align=\"left\">
";
// Reported by cell *****************
echo "
Reported by<br>
<input type=\"text\" name=\"s_reported_by\" size=\"30\" value=\"$s_reported_by\">
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Period effective cell ************
echo "
Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br>
";
if ($search) {
$effstate=$nefstate="";
if (in_array("1",$s_period_effective,true)) $effstate="selected";
if (in_array("0",$s_period_effective,true)) $nefstate="selected";
} else {
$effstate=$nefstate="selected";
}
echo "
<select name=\"s_period_effective[]\" id=\"ms-period_effective\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option value=\"1\" $effstate>Effective</option>
<option value=\"0\" $nefstate>Non-effective</option>
</select>
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Group status cell **************
echo "
Group Member?<br>
";
if ($search) {
$yesgroupstate=$nogroupstate="";
if (in_array("1",$s_group,true)) $yesgroupstate="selected";
if (in_array("0",$s_group,true)) $nogroupstate="selected";
} else {
$yesgroupstate=$nogroupstate="selected";
}echo "
<select name=\"s_group[]\" id=\"ms-group\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option value=\"1\" $yesgroupstate title=\"Writeup is a member of a group\">Show group members</option>
<option value=\"0\" $nogroupstate title=\"Writeup is not a member of a group\">Show non group members</option>
</select>
";
// ************************************
echo "
</td></tr>
<tr><td colspan=\"3\" bgcolor=\"black\"></td></tr>
<tr><td colspan=\"3\" bgcolor=\"black\"></td></tr>
<tr>
<td align=\"left\">
";
// Status cell **********************
echo "
Status<br>
";
if ($search) {
$openstate=$clsdstate=$dfrdstate="";
if (in_array("1",$s_status,true)) $openstate="selected";
if (in_array("2",$s_status,true)) $clsdstate="selected";
if (in_array("3",$s_status,true)) $dfrdstate="selected";
} else {
$openstate=$clsdstate=$dfrdstate="selected";
}
echo "
<select name=\"s_status[]\" id=\"ms-status\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option title=\"Open\" value=\"1\" $openstate>OPEN</option>
<option title=\"Closed\" value=\"2\" $clsdstate>CLSD</option>
<option title=\"Deferred\" value=\"3\" $dfrdstate>DFRD</option>
</select>
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// action by cell ************
echo "
Status changed by<br>
<select name=\"s_action_by[]\" id=\"ms-user\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option value=\"0\" selected>(none set)</option>
";
$persrow=mysqli_query($drs_db,"select id,firstname,lastname from users order by lastname asc");
while ($persitem=mysqli_fetch_assoc($persrow)) {
printf("<option value=\"%s\" selected>%s %s</option>",$persitem["id"],$persitem["firstname"],$persitem["lastname"]);
}
echo "
</select>
";
// ***********************************
echo "
</td>
<td align=\"left\">
";
// action reason cell *********
echo "
Status change reason<br>
<select name=\"s_action_reason[]\" id=\"ms-reason\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option value=\"0\" selected>(none set)</option>
";
$reasrow=mysqli_query($drs_db,"select id,text from reasons order by id asc");
while ($reasitem=mysqli_fetch_assoc($reasrow)) {
printf("<option value=\"%s\" selected>%s</option>",$reasitem["id"],$reasitem["text"]);
}
echo "
</select>
";
// ***********************************
echo "
</td>
</tr>
<tr><td></td><td></td><td></td></tr>
<tr>
<td colspan=\"3\">
";
// Action taken text cell ************
echo "
Words in Action Taken<br>
<textarea rows=\"5\" cols=\"80\" name=\"s_action_text\" wrap=\"soft\">$s_action_text</textarea><br>
";
// ***********************************
echo "
</td>
</tr>
<tr>
<td align=\"left\" >
";
// Action date cell ******************
echo "
Action Taken Date Between<br>
<input type=\"text\" name=\"s_action_date_start\" size=\"10\" maxlength=\"10\" value=\"$s_action_date_start\" id=\"sdp-action_date\" title=\"Format: YYYY-MM-DD\">
&nbsp;and&nbsp;
<input type=\"text\" name=\"s_action_date_end\" size=\"10\" maxlength=\"10\" value=\"$s_action_date_end\" id=\"edp-action_date\" title=\"Format: YYYY-MM-DD\">
";
// ***********************************
echo "
</td>
<td align=\"left\">
";
// Action time cell ******************
echo "
Action Taken Time Between<br>
<input type=\"text\" name=\"s_action_time_start\" size=\"8\" maxlength=\"8\" value=\"$s_action_time_start\" title=\"Format: HH:MM:SS\">
&nbsp;and&nbsp;
<input type=\"text\" name=\"s_action_time_end\" size=\"8\" maxlength=\"8\" value=\"$s_action_time_end\" title=\"Format: HH:MM:SS\">
";
// ***********************************
$summarystat=$detailstat="";
if ($viewtype=="detail") {
$detailstat="checked";
} else {
$summarystat="checked";
}
echo "</td>
</tr>
</table>
<br>
<input type=\"radio\" $summarystat name=\"viewtype\" value=\"summary\" id=\"summaryview\" ><label for=\"summaryview\" title=\"Show one writeup per line with minimal detail.\">Results in summary view</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $detailstat name=\"viewtype\" value=\"detail\" id=\"detailview\"><label for=\"detailview\" title=\"Show each writeup's full details.\">Results in detail view</label>
<br><br>
<input type=\"submit\" name=\"search\" value=\"Search\">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"cancel\" value=\"Start New Search\">
</form>
<br>
";
}
// display the results
if ($search) {
//display the search parameters used
if (!$print) echo "<a id=\"results\"></a>";
echo "
<table border=\"2\" width=\"100%\">
<tr><td align=\"left\"><b>Parameters used in this search</b>
";
if (!$print) {
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Scroll up to modify parameters</font></td>";
} else {
echo "</td>";
}
echo "
</tr>
<tr><td>
<table border=\"0\">
<td><b>$status_param</b></td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$device_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$subsystem_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td>$period_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$reportdate_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$reporttime_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td>$discrepancytext_param</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td>$repby_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$eff_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$group_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td>$actionby_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$reason_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td>$actiontext_param</td>
</tr>
</table>
<table border=\"0\">
<tr>
<td>$actiondate_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$actiontime_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
</td></tr></table>
<br>
";
$writeup=mysqli_query($drs_db,$query_string);
// create an array of ids returned by the query string
$result_ids=array();
while ($eachid=mysqli_fetch_assoc($writeup)) {
$result_ids[]=$eachid['id'];
}
mysqli_data_seek($writeup,0);
// create an array of all ids in groups
$groupmems=array();
$groupmem_qry=mysqli_query($drs_db,"select writeupid from links");
while ($groupmemrow=mysqli_fetch_row($groupmem_qry)) {
$groupmems[]=$groupmemrow[0];
}
$groupmems=array_unique($groupmems);
// determine how many group members are in results
$member_count=0;
foreach($result_ids as $result_id) {
if (in_array($result_id,$groupmems)) $member_count += 1;
}
if (in_array("1",$s_group)) $show_groupmems=true;
if (in_array("0",$s_group)) $show_nongroupmems=true;
if ($show_groupmems == $show_nongroupmems) $num_results=mysqli_num_rows($writeup); //show members and nonmembers
if ($show_groupmems && !$show_nongroupmems) $num_results=$member_count; //only show members
if (!$show_groupmems && $show_nongroupmems) $num_results=mysqli_num_rows($writeup)-$member_count; //only show nonmembers
if ($num_results > 0) {
if ($viewtype=="summary") {
echo "
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
<th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th>
<th style=\"width:1%;\">Device</th>
<th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th>
</tr>
";
while ($tablerow = mysqli_fetch_assoc($writeup)) {
// determine if this is a member of a group
$member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\"");
$is_member=mysqli_num_rows($member_qry);
// determine effective icon
if($tablerow["period_effective"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">";
} else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">";
}
// determine status indicator
if ($tablerow['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>";
if ($tablerow['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>";
if ($tablerow['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>";
// convert device number to name
$dname=dblookup($drs_db,"devices","id","name",$tablerow["device"]);
// convert period number to times
$ptimes=dblookup($drs_db,"periods","id","times",$tablerow["period"]);
// convert subsystem number to name
$ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]);
$disc_txt="{$tablerow["discrepancy_text"]}";
// set group indicator
if ($is_member) {
$group_count=$is_member;
if ($group_count == 1) {
$group_num=mysqli_fetch_row(mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\""))[0];
$member_group_name=dblookup($drs_db,"groups","id","name",$group_num);
if ($member_group_name) {
$imgtitle="Member of group: $member_group_name";
} else {
$imgtitle="Member of group ID: $group_num";
}
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php?group=$group_num\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"$imgtitle\"></a></div>";
} else {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"View writeup groups\"></a></div>";
}
}
if (($show_groupmems == $show_nongroupmems) || ($is_member && $show_groupmems) || (!$is_member && $show_nongroupmems)) {
// print table row
printf(
"<tr>
<td align=\"center\" valign=\"top\"><a href=\"writeupdetail.php?id=%s\" title=\"View or change details of this writeup\">%s</a></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</font></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td>
</tr>\n",
$tablerow["id"],$tablerow["id"],
$statusind,
$tablerow["report_date"],
$ptimes,$tablerow["period"],
$dname,
$ssname,
$tablerow["reported_by"],
$disc_txt,
$eff_icon
);
}
}
echo "</table>\n";
} elseif ($viewtype=="detail") {
echo "
<table border=\"0\"><tr><td>
";
while ($tablerow = mysqli_fetch_assoc($writeup)) {
// determine if this is a member of a group
$member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\"");
$is_member=mysqli_num_rows($member_qry);
if (($show_groupmems == $show_nongroupmems) || ($is_member && $show_groupmems) || (!$is_member && $show_nongroupmems)) {
displaywriteup($tablerow['id']);
echo "<br>";
}
}
echo "
</td></tr></table>
";
}
} else {
echo "<b>No writeups match your search parameters.</b><br>";
}
}
echo "<br>";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

51
distfiles/settings.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
/*
settings.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
$sttl=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"session_ttl_days\""))[0];
$ostype=strtoupper(substr(php_uname('s'), 0, 3));
if ($ostype == 'WIN') {
$sdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"win_server_session_dir\""))[0];
} else {
$sdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"unix_server_session_dir\""))[0];
}
$lifetime=60 * 60 * 24 * $sttl;
if (!is_dir($sdir)) mkdir($sdir, 0700, true);
ini_set('session.cookie_lifetime', $lifetime);
ini_set('session.gc_maxlifetime', $lifetime);
ini_set('session.save_path', $sdir);
session_cache_limiter('private, must-revalidate');
session_cache_expire(60);
$ss=session_status();
if ($ss==PHP_SESSION_NONE) session_start();
// get config options from database and assign them to constants
unset($userid);
if (isset($_SESSION['userid']) && $_SESSION['userid'] != '') {
$userid=$_SESSION['userid'];
}
$configqry=mysqli_query($drs_db,"select name,value from config");
while ($configrow = mysqli_fetch_assoc($configqry)) {
$constname=strtoupper($configrow['name']);
if (isset($userid)) {
$usrval=mysqli_fetch_row(mysqli_query($drs_db,"select value from profile where name=\"{$configrow['name']}\" and user=\"$userid\""))[0];
}
if ($usrval) {
$constvalue=$usrval;
} else {
$constvalue=$configrow['value'];
}
define("$constname","$constvalue");
}
//report no errors
error_reporting(0);
?>

536
distfiles/writeupdetail.php Normal file
View File

@@ -0,0 +1,536 @@
<?php
/*
writeupdetail.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// redirect to writeups.php on change cancel
if ($_REQUEST['cancel']) {
$id=$_REQUEST['id'];
header("Cache-Control:no-cache, must-revalidate");
header("Pragma:no-cache");
header("Location:writeupdetail.php?id=$id");
exit();
}
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming[]
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST[] to $incoming[]
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
$usersave=$incoming['usersave'];
$techsave=$incoming['techsave'];
$useredit=$incoming['useredit'];
$techedit=$incoming['techedit'];
$id=$incoming['id'];
$device=$incoming['device'];
$period=$incoming['period'];
$period_effective=$incoming['period_effective'];
$reported_by=$incoming['reported_by'];
$report_date=$incoming['report_date'];
$report_time=$incoming['report_time'];
$subsystem=$incoming['subsystem'];
$discrepancy_text=$incoming['discrepancy_text'];
$status=$incoming['status'];
$action_by=$incoming['action_by'];
$action_date=$incoming['action_date'];
$action_time=$incoming['action_time'];
$action_reason=$incoming['action_reason'];
$action_text=$incoming['action_text'];
// assign variables from constants
$appname=APP_NAME;
if ($print=="Printer Friendly") {
$mbgcolor=P_MENUBG_COLOR;
} else {
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($drs_db,"users","id","role",$userid);
framework("begin","$appname","Writeup Detail",$print);
//var_dump($incoming);
// ******** begin database manipulation ********
// determine today's date and make it the default
$today=date("Y-m-d");
$now=date("H:i:s");
if ($usersave) {
// user parameters
if ($discrepancy_text && $reported_by) {
// sanitize and fix blank date and time
$report_date=mysqli_real_escape_string($drs_db,$report_date);
$report_time=mysqli_real_escape_string($drs_db,$report_time);
if (!$report_date) $report_date=$today;
if (!$report_time) $report_time=$now;
// remove html tags from discrepancy text and sanitize
$discrepancy_text=strip_tags($discrepancy_text);
$clean_discrepancy_text=mysqli_real_escape_string($drs_db,$discrepancy_text);
$clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by);
// update the record in writeups
mysqli_query($drs_db,"update writeups set device=\"$device\",period=\"$period\",period_effective=\"$period_effective\",reported_by=\"$clean_reported_by\",report_date=\"$report_date\",report_time=\"$report_time\",subsystem=\"$subsystem\",discrepancy_text=\"$clean_discrepancy_text\" where id=\"$id\"");
}
}
elseif ($techsave) {
// tech parameters
if ($role) {
if ($action_text) {
// sanitize and fix blank date and time
$action_date=mysqli_real_escape_string($drs_db,$action_date);
$action_time=mysqli_real_escape_string($drs_db,$action_time);
if (!$action_date) $action_date=$today;
if (!$action_time) $action_time=$now;
// remove html tags from action text and sanitize
$action_text=strip_tags($action_text);
$clean_action_text=mysqli_real_escape_string($drs_db,$action_text);
// update the record in writeups
mysqli_query($drs_db,"update writeups set status=\"$status\",action_by=\"$action_by\",action_date=\"$action_date\",action_time=\"$action_time\",action_reason=\"$action_reason\",action_text=\"$clean_action_text\" where id=\"$id\"");
}
}
}
// get current writeup data from database to populate fields
$writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id=\"$id\""));
$device=$writeupdata['device'];
$period=$writeupdata['period'];
$period_effective=$writeupdata['period_effective'];
$reported_by=$writeupdata['reported_by'];
$report_date=$writeupdata['report_date'];
$report_time=$writeupdata['report_time'];
$subsystem=$writeupdata['subsystem'];
$discrepancy_text=$writeupdata['discrepancy_text'];
$status=$writeupdata['status'];
$action_by=$writeupdata['action_by'];
$action_date=$writeupdata['action_date'];
$action_time=$writeupdata['action_time'];
$action_reason=$writeupdata['action_reason'];
$action_text=$writeupdata['action_text'];
if ($useredit || $techedit) {
if (!$report_date) $report_date=$today;
if (!$report_time) $report_time=$now;
} else {
if (!$report_date) $report_date="&nbsp;";
if (!$report_time) $report_time="&nbsp;";
}
if ($techedit) {
if (!$action_date) $action_date=$today;
if (!$action_time) $action_time=$now;
} else {
if (!$action_date) $action_date="&nbsp;";
if (!$action_time) $action_time="&nbsp;";
}
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
// display the form
if ($usersave) {
if ($discrepancy_text && $reported_by) {
format_message(0,"<strong>Writeup modified.</strong> <a href=\"writeups.php\">Return to Open Writeups page.</a>");
}
if (!$discrepancy_text) {
format_message(1,"You didn't enter any discrepancy text. Please try again.");
}
if (!$reported_by) {
format_message(1,"You didn't enter your name in the Reported by: block. Please try again.");
}
}
if ($techsave) {
if ($role && $action_text) {
format_message(0,"<strong>Writeup modified.</strong> <a href=\"writeups.php\">Return to Open Writeups page.</a>");
}
if ($role && !$action_text) {
format_message(1,"You didn't enter any action taken text. Please try again.");
}
}
echo "
<form method=\"post\" action=\"writeupdetail.php\">
<input type=\"hidden\" name=\"id\" value=\"$id\">
";
// start writeup table section
if ($status==1) $statusind="<b><font color=\"#FF0000\">OPEN</font></b>";
if ($status==2) $statusind="<b><font color=\"#00FF00\">CLSD</font></b>";
if ($status==3) $statusind="<b><font color=\"#FFFF00\">DFRD</font></b>";
echo "
<table border=\"0\" cellpadding=\"5\" width=\"600\">
<tr>
<td align=\"left\">Writeup ID<br>
<table border=\"1\" width=\"100%\"><tr><td><center>$id</center></td></tr></table>
</td>
<td align=\"left\">Device<br>
";
if ($useredit) {
echo "
<select name=\"device\" id=\"device\">
";
$drow=mysqli_query($drs_db,"select * from devices where active is true order by id asc");
while ($ditem=mysqli_fetch_assoc($drow)) {
if ($device==$ditem["id"]) {
printf("<option value=\"%s\" selected>%s</option>",$ditem["id"],$ditem["name"]);
} else {
printf("<option value=\"%s\">%s</option>",$ditem["id"],$ditem["name"]);
}
}
echo "
</select>
";
} else {
$dname=dblookup($drs_db,"devices","id","name",$device);
echo "
<table border=\"1\" width=\"100%\"><tr><td>$dname</td></tr></table>
";
}
echo "
</td>
<td align=\"left\">Subsystem<br>
";
if ($useredit) {
echo "
<select name=\"subsystem\" id=\"subsystem\">
";
$ssrow=mysqli_query($drs_db,"select * from subsystems where active is true order by id asc");
while ($ssitem=mysqli_fetch_assoc($ssrow)) {
if ($subsystem==$ssitem["id"]) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
} else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$ssitem["id"],$ssitem["description"],$ssitem["name"]);
}
}
echo "
</select>
";
} else {
$ssname=dblookup($drs_db,"subsystems","id","name",$subsystem);
$ssdesc=dblookup($drs_db,"subsystems","id","description",$subsystem);
echo "
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$ssdesc\">$ssname</font></td></tr></table>
";
}
echo "
</td>
</tr>
<tr>
<td align=\"left\">Period<br>
";
if ($useredit) {
echo "
<select name=\"period\" id=\"period\">
";
$prow=mysqli_query($drs_db,"select * from periods where active is true order by times asc");
while ($pitem=mysqli_fetch_assoc($prow)) {
if ($period==$pitem["id"]) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$pitem["id"],$pitem["times"],$pitem["id"]);
} else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$pitem["id"],$pitem["times"],$pitem["id"]);
}
}
echo "
</select>
";
} else {
$pertimes=dblookup($drs_db,"periods","id","times",$period);
echo "
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$pertimes\">$period</font></td></tr></table>
";
}
echo "
</td>
";
$effstate=$nefstate="";
if($period_effective==1) {
$effstate="checked";
$eff_ind="Effective";
}
if($period_effective==0) {
$nefstate="checked";
$eff_ind="Non-Effective";
}
$openstate=$closedstate=$deferredstate="";
if($status==1) $openstate="selected";
if($status==2) $closedstate="selected";
if($status==3) $deferredstate="selected";
echo "
<td align=\"left\" >Report Date<br>
";
if ($useredit) {
echo "
<input type=\"text\" name=\"report_date\" size=\"10\" maxlength=\"10\" value=\"$report_date\" id=\"reportdatepicker\" title=\"Format: YYYY-MM-DD\"></td>
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td>$report_date</td></tr></table></td>
";
}
echo "
<td align=\"left\">Report Time<br>
";
if ($useredit) {
echo "
<input type=\"text\" name=\"report_time\" size=\"8\" maxlength=\"8\" value=\"$report_time\" title=\"Format: HH:MM:SS\"></td>
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td>$report_time</td></tr></table></td>
";
}
echo "
</tr>
<tr><td></td><td></td><td></td></tr>
<tr><td colspan=\"3\">
Discrepancy <font size=\"-2\">(required)</font><br>
";
if ($useredit) {
echo "<textarea rows=\"10\" cols=\"80\" name=\"discrepancy_text\" wrap=\"soft\">$discrepancy_text</textarea><br>";
} else {
echo "<table border=\"1\" width=\"100%\"><tr><td>$discrepancy_text</td></tr></table><br>";
}
echo "
</tr>
<tr>
<td>Reported by <font size=\"-2\">(required)</font><br>
";
if ($useredit) {
echo "
<input type=\"text\" name=\"reported_by\" size=\"30\" value=\"$reported_by\" title=\"Who to contact for questions about this writeup\"></td>
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td>$reported_by</td></tr></table></td>
";
}
echo "
<td align=\"left\">Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br>
";
if ($useredit) {
echo "
<input type=\"radio\" name=\"period_effective\" value=\"1\" $effstate> Yes &nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"radio\" name=\"period_effective\" value=\"0\" $nefstate> No
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$eff_title\">$eff_ind</font></td></tr></table>
";
}
echo "
</td>
";
if ($useredit) {
echo "
<td align=\"right\" valign=\"bottom\"><input type=\"submit\" name=\"usersave\" value=\"Save Changes\"></td>
</tr>
<tr>
<td></td><td></td><td align=\"right\" valign=\"bottom\">
<input type=\"submit\" name=\"cancel\" value=\"Cancel Changes\"></td>
</tr>
";
} else {
$wustat=dblookup($drs_db,"writeups","id","status",$id);
if ($wustat==2 && !$role) $allowuseredit="disabled";
echo "
<td align=\"right\" valign=\"bottom\"><input $allowuseredit type=\"submit\" name=\"useredit\" value=\"Edit this Discrepancy\"></td>
</tr>
";
}
// end of user section
echo "
<tr><td colspan=\"3\" bgcolor=\"black\"></td></tr>
<tr><td colspan=\"3\" bgcolor=\"black\"></td></tr>
<tr>
<td>Status<br>
";
if ($techedit) {
echo "
<select name=\"status\" id=\"status\">
<option value=\"1\" $openstate>OPEN</option>
<option value=\"2\" $closedstate>CLOSED</option>
<option value=\"3\" $deferredstate>DEFERRED</option>
</select>
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td><center>$statusind</center></td></tr></table>
";
}
echo "
</td>
<td>Action taken by<br>
";
if ($techedit) {
if ($role==ADMIN) {
// allow selection of tech name
echo "
<select name=\"action_by\" id=\"user\">
";
$persrow=mysqli_query($drs_db,"select id,firstname,lastname from users where active is true order by lastname asc");
while ($persitem=mysqli_fetch_assoc($persrow)) {
if ($userid==$persitem["id"]) {
printf("<option value=\"%s\" selected>%s %s</option>",$persitem["id"],$persitem["firstname"],$persitem["lastname"]);
} else {
printf("<option value=\"%s\">%s %s</option>",$persitem["id"],$persitem["firstname"],$persitem["lastname"]);
}
}
echo "
</select>
";
} else {
// limit the choice to the tech in question
echo "
<select name=\"action_by\" id=\"user\">
";
$persrow=mysqli_query($drs_db,"select id,firstname,lastname from users where active is true order by lastname asc");
while ($persitem=mysqli_fetch_assoc($persrow)) {
if ($userid==$persitem["id"]) {
printf("<option value=\"%s\" selected>%s %s</option>",$persitem["id"],$persitem["firstname"],$persitem["lastname"]);
}
}
echo "
</select>
";
}
} else {
$techfname=dblookup($drs_db,"users","id","firstname",$action_by);
$techlname=dblookup($drs_db,"users","id","lastname",$action_by);
echo "
<table border=\"1\" width=\"100%\"><tr><td>$techfname $techlname&nbsp;</td></tr></table>
";
}
echo "
</td>
<td>Status change reason<br>
";
if ($techedit) {
echo "
<select name=\"action_reason\" id=\"reason\">
";
$reasrow=mysqli_query($drs_db,"select id,text from reasons where active is true order by id asc");
if (!$action_reason) echo "<option selected></option>";
while ($reasitem=mysqli_fetch_assoc($reasrow)) {
if ($action_reason==$reasitem["id"]) {
printf("<option value=\"%s\" selected>%s</option>",$reasitem["id"],$reasitem["text"]);
} else {
printf("<option value=\"%s\">%s</option>",$reasitem["id"],$reasitem["text"]);
}
}
echo "
</select>
";
} else {
$reasonname=dblookup($drs_db,"reasons","id","text",$action_reason);
echo"
<table border=\"1\" width=\"100%\"><tr><td>$reasonname&nbsp;</td></tr></table>
";
}
echo "
</td>
</tr>
<tr><td></td><td></td><td></td></tr>
<tr><td colspan=\"3\">
Action Taken <font size=\"-2\">(required)</font><br>
";
if ($techedit) {
echo "
<textarea rows=\"10\" cols=\"80\" name=\"action_text\" wrap=\"soft\">$action_text</textarea><br>
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td>$action_text&nbsp;</td></tr></table>
";
}
echo "
</td>
</tr>
<tr>
<td align=\"left\" >Action Taken Date<br>
";
if ($techedit) {
echo "
<input type=\"text\" name=\"action_date\" size=\"10\" maxlength=\"10\" value=\"$action_date\" id=\"actiondatepicker\" title=\"Format: YYYY-MM-DD\"></td>
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td>$action_date</td></tr></table></td>
";
}
echo "
<td align=\"left\">Action Taken Time<br>
";
if ($techedit) {
echo "
<input type=\"text\" name=\"action_time\" size=\"8\" maxlength=\"8\" value=\"$action_time\" title=\"Format: HH:MM:SS\"></td>
";
} else {
echo "
<table border=\"1\" width=\"100%\"><tr><td>$action_time</td></tr></table></td>
";
}
if ($techedit) {
echo "
<td align=\"right\" valign=\"bottom\"><input type=\"submit\" name=\"techsave\" value=\"Save Changes\"></td>
</tr>
<tr>
<td></td><td></td>
<td align=\"right\" valign=\"bottom\">
<input type=\"submit\" name=\"cancel\" value=\"Cancel Changes\"></td>
</tr>
";
} else {
if (!$role) $live="disabled";
echo "
<td align=\"right\" valign=\"bottom\"><input $live type=\"submit\" name=\"techedit\" value=\"Edit this Action\"></td>
</tr>
";
}
echo "
</table>
</form>
<br>
";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>

422
distfiles/writeups.php Normal file
View File

@@ -0,0 +1,422 @@
<?php
/*
writeups.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
include("common.php");
// import session variables
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
// import incoming arrays
$print=$_REQUEST['print'];
if ($print) {
// if printer friendly was clicked, values will be passed in serialized
// form as "all_parameters" so we need to load those into $incoming[]
$incoming=unserialize($_REQUEST['all_parameters']);
} else {
// copy $_REQUEST[] to $incoming[]
$incoming=arrayCopy($_REQUEST);
}
// load variables from incoming array
$view=$incoming['view'];
$start_date=$incoming['start_date'];
$end_date=$incoming['end_date'];
$showtoday=$incoming['showtoday'];
$showyesterday=$incoming['showyesterday'];
$show7day=$incoming['show7day'];
$show30day=$incoming['show30day'];
$viewtype=$incoming['viewtype'];
$togroup=$incoming['togroup'];
$addtogroup=$incoming['addtogroup'];
$selectedids=$incoming['selectedids'];
// assign variables from constants
$appname=APP_NAME;
if ($print) {
$mbgcolor=P_MENUBG_COLOR;
} else {
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($drs_db,"users","id","role",$userid);
// define local functions
function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
// show date range selector
echo "
<form method=post action=\"writeups.php\">
";
if ($print) {
echo "
<form method=post action=\"writeups.php\">
Open writeups between&nbsp;&nbsp; $start_date and $end_date
";
} else {
echo "
<input type=\"submit\" name=\"showtoday\" value=\"Today\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"showyesterday\" value=\"Yesterday\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"show7day\" value=\"Last 7 Days\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"show30day\" value=\"Last 30 Days\"><br><br>
";
}
echo "
</form>
";
$writeup=mysqli_query($drs_db,"select * from writeups where status=".STAT_OPEN." and report_date between \"$start_date\" and \"$end_date\" order by report_date desc,period desc,report_time desc");
if (mysqli_num_rows($writeup)) {
$now=date("H:i l");
echo "
<font color=\"red\">As of $now</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br>
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
<th style=\"width:1%;\">ID</th>
<th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th>
<th style=\"width:1%;\">Device</th>
<th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th>
</tr>
";
while ($tablerow = mysqli_fetch_assoc($writeup)) {
// determine effective icon
if($tablerow["period_effective"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">";
} else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">";
}
// convert device number to name
$dname=dblookup($drs_db,"devices","id","name",$tablerow["device"]);
// convert subsystem number to name
$ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]);
// determine times for period
$ptimes=mysqli_fetch_row(mysqli_query($drs_db,"select times from periods where id=\"{$tablerow['period']}\""))[0];
$disc_txt="{$tablerow['discrepancy_text']}";
// determine if this is a member of a group
$member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\"");
$is_member=mysqli_num_rows($member_qry);
if ($is_member) {
$group_count=$is_member;
$member_group=mysqli_fetch_row($member_qry)[0];
$member_group_name=dblookup($drs_db,"groups","id","name",$member_group);
if ($member_group_name) {
$imgtitle="Member of group: $member_group_name";
} else {
$imgtitle="Member of group ID: $member_group";
}
if ($group_count == 1) {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php?group=$member_group\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"$imgtitle\"></a></div>";
} else {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"View writeup groups\"></a></div>";
}
}
// print table row
printf(
"<tr>
<td align=\"center\" valign=\"top\"><a href=\"writeupdetail.php?id=%s\" title=\"View or change details of this writeup\">%s</a></td>
<td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</font></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td>
</tr>\n",
$tablerow["id"],$tablerow["id"],
$tablerow["report_date"],
$ptimes, $tablerow["period"],
$dname,
$ssname,
$tablerow["reported_by"],
$disc_txt,
$eff_icon
);
}
echo "</table>\n";
} else {
if ($_REQUEST['showyesterday']) {
$datespec="yesterday";
} elseif ($_REQUEST['show7day']) {
$datespec="the last 7 days";
} elseif ($_REQUEST['show30day']) {
$datespec="the last 30 days";
} else {
$datespec="today";
}
echo "<b>No open writeups for $datespec.</b>";
}
}
function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$role) {
// show date range selector
$summarystat=$detailstat="";
if ($viewtype=="detail") {
$detailstat="checked";
} else {
$summarystat="checked";
}
echo "
<form method=post action=\"writeups.php\">
<input type=\"hidden\" name=\"view\" value=\"1\">
Writeups between&nbsp;&nbsp;
<input type=\"text\" name=\"start_date\" size=\"10\" value=\"$start_date\" id=\"startdatepicker\" title=\"Format: YYYY-MM-DD\">&nbsp;&nbsp; and &nbsp;&nbsp;
<input type=\"text\" name=\"end_date\" size=\"10\" value=\"$end_date\" id=\"enddatepicker\" title=\"Format: YYYY-MM-DD\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
";
if(!$print) {
echo "
<input type=\"submit\" name=\"update\" value=\"Update\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"showtoday\" value=\"Today\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"showyesterday\" value=\"Yesterday\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"show7day\" value=\"Last 7 Days\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"show30day\" value=\"Last 30 Days\"><br><br>
<input type=\"radio\" $summarystat name=\"viewtype\" value=\"summary\" id=\"summaryview\" ><label for=\"summaryview\" title=\"Show one writeup per line with minimal detail.\">Results in summary view</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $detailstat name=\"viewtype\" value=\"detail\" id=\"detailview\"><label for=\"detailview\" title=\"Show each writeup's full details.\">Results in detail view</label>
<br><br>";
}
$writeup=mysqli_query($drs_db,"select * from writeups where report_date between \"$start_date\" and \"$end_date\" order by report_date desc,period desc,report_time desc");
if (mysqli_num_rows($writeup)) {
$now=date("H:i l");
if ($viewtype == "summary") {
if ($role) {
$selcol="<th style=\"width:1%;\">Sel</th>";
} else {
$selcol="";
}
echo "
<font color=\"red\">As of $now</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br>
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
$selcol
<th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th>
<th style=\"width:1%;\">Device</th>
<th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th>
</tr>
";
while ($tablerow = mysqli_fetch_assoc($writeup)) {
// determine effective icon
if($tablerow["period_effective"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">";
} else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">";
}
// determine status indicator
if ($tablerow['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>";
if ($tablerow['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>";
if ($tablerow['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>";
// convert device number to name
$dname=dblookup($drs_db,"devices","id","name",$tablerow["device"]);
// convert subsystem number to name
$ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]);
// determine times for period
$ptimes=mysqli_fetch_row(mysqli_query($drs_db,"select times from periods where id=\"{$tablerow['period']}\""))[0];
$disc_txt="{$tablerow['discrepancy_text']}";
// determine if this is a member of a group
$member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\"");
$is_member=mysqli_num_rows($member_qry);
if ($is_member) {
$group_count=$is_member;
$member_group=mysqli_fetch_row($member_qry)[0];
$member_group_name=dblookup($drs_db,"groups","id","name",$member_group);
if ($member_group_name) {
$imgtitle="Member of group: $member_group_name";
} else {
$imgtitle="Member of group ID: $member_group";
}
if ($group_count == 1) {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php?group=$member_group\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"$imgtitle\"></a></div>";
} else {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"groups.php\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"View writeup groups\"></a></div>";
}
}
// print table row
if ($role) {
$selcontent="<td align=\"center\" valign=\"top\"><input type=\"checkbox\" name=\"selectedids[]\" value={$tablerow['id']}></td>";
} else {
$selcontent="";
}
printf(
"<tr>
%s
<td align=\"center\" valign=\"top\"><a href=\"writeupdetail.php?id=%s\" title=\"View or change details of this writeup\">%s</a></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</font></td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td>
</tr>\n",
$selcontent,
$tablerow["id"],$tablerow["id"],
$statusind,
$tablerow["report_date"],
$ptimes, $tablerow["period"],
$dname,
$ssname,
$tablerow["reported_by"],
$disc_txt,
$eff_icon
);
}
echo "</table>\n";
} elseif ($viewtype == "detail") {
echo "
<font color=\"red\">As of $now</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br><br>
<table border=\"0\"><tr><td>
";
while ($tablerow = mysqli_fetch_assoc($writeup)) {
if ($role) echo "<input type=\"checkbox\" name=\"selectedids[]\" value={$tablerow['id']}> Select";
displaywriteup($tablerow['id']);
echo "<br><br>";
}
echo "
</td></tr></table>
";
}
if ($role) {
echo "
<br><br>
<button name=\"addtogroup\" value=\"addtogroup\" type=\"submit\">Add selected to group:</button>&nbsp;&nbsp;&nbsp;<select name=\"togroup\" id=\"sel-togroup\">
<option value=\"newgroup\">New group</option>
";
$tgrow=mysqli_query($drs_db,"select id,name from groups order by id asc");
while ($tgitem=mysqli_fetch_assoc($tgrow)) {
printf("<option value=\"%s\">%s</option>",$tgitem["id"],$tgitem["name"]);
}
echo "
</select>
";
}
} else {
echo "<b>No writeups for the date range specified above.</b>";
}
echo "
</form>
";
}
// use default date values if not supplied
$today = date("Y-m-d");
if ($start_date=="") $start_date=$today;
if ($end_date=="") $end_date=$today;
if ($showtoday) {
$start_date=$today;
$end_date=$today;
}
if ($showyesterday) {
$start_date=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 1 day)"))[0];
$end_date=$start_date;
}
if ($show7day) {
$start_date=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 7 day)"))[0];
$end_date=$today;
}
if ($show30day) {
$start_date=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 30 day)"))[0];
$end_date=$today;
}
if ($view) {
$pgtitle="Recent Writeups";
} else {
$pgtitle="Open Writeups";
}
framework("begin","$appname",$pgtitle,$print);
//var_dump($_REQUEST);
//var_dump($incoming);
// ******** begin database manipulation ********
if ($addtogroup && $togroup && $selectedids && $role) {
$fail=false;
if ($togroup=="newgroup") {
// Create a new group
mysqli_query($drs_db,"insert into groups(name) value(\"\")");
$fail=mysqli_error($drs_db);
$togroup=mysqli_insert_id($drs_db);
}
foreach ($selectedids as $selid) {
// add writeup to the group
if (!mysqli_num_rows(mysqli_query($drs_db,"select id from links where writeupid=\"$selid\" and linkgroup=\"$togroup\""))) {
// target is not already a member of this group
mysqli_query($drs_db,"insert into links (linkgroup,writeupid) values($togroup,$selid)");
$fail=mysqli_error($drs_db);
}
}
}
// ******** end database manipulation ********
pagetable("begin");
if(!$print) {
pageblock("left","begin");
sidemenu();
echo "<br><br>";
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo "<br>";
if ($addtogroup) {
if (count($selectedids) > 1) {
$plural="s";
} else {
$plural="";
}
if (!$fail) {
format_message(0,"<strong>Writeup$plural successfully added to group.</strong>");
} else {
format_message(2,"<strong>An error was encountered when adding writeup$plural.</strong> The error was \" $fail \"");
}
}
if (!$viewtype) $viewtype="summary";
if ($view==1) {
// show writeup table
viewtable($start_date,$end_date,$print,$drs_db,$viewtype,$role);
} else {
// show open table
opentable($start_date,$end_date,$print,$drs_db,$viewtype);
}
echo "<br>";
banner($print);
pageblock("right","end");
pagetable("end");
framework("end","","",$print);
?>