original push
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
/.vs/
|
||||
/vendor/
|
||||
@@ -0,0 +1,22 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to `fonia3` will be documented in this file.
|
||||
|
||||
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
|
||||
|
||||
## NEXT - YYYY-MM-DD
|
||||
|
||||
### Added
|
||||
- Nothing
|
||||
|
||||
### Deprecated
|
||||
- Nothing
|
||||
|
||||
### Fixed
|
||||
- Nothing
|
||||
|
||||
### Removed
|
||||
- Nothing
|
||||
|
||||
### Security
|
||||
- Nothing
|
||||
@@ -0,0 +1,74 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to make participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at `[email protected]`. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -0,0 +1,32 @@
|
||||
# Contributing
|
||||
|
||||
Contributions are **welcome** and will be fully **credited**.
|
||||
|
||||
We accept contributions via Pull Requests on [Github](https://github.com/siaupheng/fonia3).
|
||||
|
||||
|
||||
## Pull Requests
|
||||
|
||||
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - Check the code style with ``$ composer check-style`` and fix it with ``$ composer fix-style``.
|
||||
|
||||
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
|
||||
|
||||
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
|
||||
|
||||
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
|
||||
|
||||
- **Create feature branches** - Don't ask us to pull from your master branch.
|
||||
|
||||
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
|
||||
|
||||
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
|
||||
|
||||
|
||||
## Running Tests
|
||||
|
||||
``` bash
|
||||
$ composer test
|
||||
```
|
||||
|
||||
|
||||
**Happy coding**!
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Siau Pheng <siaupheng@3fonia.com>
|
||||
|
||||
> 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.
|
||||
@@ -0,0 +1,83 @@
|
||||
# fonia3
|
||||
|
||||
[![Latest Version on Packagist][ico-version]][link-packagist]
|
||||
[![Software License][ico-license]](LICENSE.md)
|
||||
[![Build Status][ico-travis]][link-travis]
|
||||
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
|
||||
[![Quality Score][ico-code-quality]][link-code-quality]
|
||||
[![Total Downloads][ico-downloads]][link-downloads]
|
||||
|
||||
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what
|
||||
PSRs you support to avoid any confusion with users and contributors.
|
||||
|
||||
## Structure
|
||||
|
||||
If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.
|
||||
|
||||
```
|
||||
bin/
|
||||
build/
|
||||
docs/
|
||||
config/
|
||||
src/
|
||||
tests/
|
||||
vendor/
|
||||
```
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
Via Composer
|
||||
|
||||
``` bash
|
||||
$ composer require siaupheng/fonia3
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
``` php
|
||||
$skeleton = new siaupheng\fonia3();
|
||||
echo $skeleton->echoPhrase('Hello, League!');
|
||||
```
|
||||
|
||||
## Change log
|
||||
|
||||
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
|
||||
|
||||
## Testing
|
||||
|
||||
``` bash
|
||||
$ composer test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.
|
||||
|
||||
## Security
|
||||
|
||||
If you discover any security related issues, please email siaupheng@3fonia.com instead of using the issue tracker.
|
||||
|
||||
## Credits
|
||||
|
||||
- [Siau Pheng][link-author]
|
||||
- [All Contributors][link-contributors]
|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
|
||||
|
||||
[ico-version]: https://img.shields.io/packagist/v/siaupheng/fonia3.svg?style=flat-square
|
||||
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
|
||||
[ico-travis]: https://img.shields.io/travis/siaupheng/fonia3/master.svg?style=flat-square
|
||||
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/siaupheng/fonia3.svg?style=flat-square
|
||||
[ico-code-quality]: https://img.shields.io/scrutinizer/g/siaupheng/fonia3.svg?style=flat-square
|
||||
[ico-downloads]: https://img.shields.io/packagist/dt/siaupheng/fonia3.svg?style=flat-square
|
||||
|
||||
[link-packagist]: https://packagist.org/packages/siaupheng/fonia3
|
||||
[link-travis]: https://travis-ci.org/siaupheng/fonia3
|
||||
[link-scrutinizer]: https://scrutinizer-ci.com/g/siaupheng/fonia3/code-structure
|
||||
[link-code-quality]: https://scrutinizer-ci.com/g/siaupheng/fonia3
|
||||
[link-downloads]: https://packagist.org/packages/siaupheng/fonia3
|
||||
[link-author]: https://github.com/siaupheng
|
||||
[link-contributors]: ../../contributors
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,506 @@
|
||||
.CodeMirror {
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
color: #000;
|
||||
direction: ltr
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0
|
||||
}
|
||||
|
||||
.CodeMirror pre.CodeMirror-line,
|
||||
.CodeMirror pre.CodeMirror-line-like {
|
||||
padding: 0 4px
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler,
|
||||
.CodeMirror-gutter-filler {
|
||||
background-color: #fff
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
.CodeMirror-linenumbers {}
|
||||
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker {
|
||||
color: #000
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker-subtle {
|
||||
color: #999
|
||||
}
|
||||
|
||||
.CodeMirror-cursor {
|
||||
border-left: 1px solid #000;
|
||||
border-right: none;
|
||||
width: 0
|
||||
}
|
||||
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver
|
||||
}
|
||||
|
||||
.cm-fat-cursor .CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0!important;
|
||||
background: #7e7
|
||||
}
|
||||
|
||||
.cm-fat-cursor div.CodeMirror-cursors {
|
||||
z-index: 1
|
||||
}
|
||||
|
||||
.cm-fat-cursor-mark {
|
||||
background-color: rgba(20, 255, 20, .5);
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite
|
||||
}
|
||||
|
||||
.cm-animate-fat-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
background-color: #7e7
|
||||
}
|
||||
|
||||
@-moz-keyframes blink {
|
||||
0% {}
|
||||
50% {
|
||||
background-color: transparent
|
||||
}
|
||||
100% {}
|
||||
}
|
||||
|
||||
@-webkit-keyframes blink {
|
||||
0% {}
|
||||
50% {
|
||||
background-color: transparent
|
||||
}
|
||||
100% {}
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0% {}
|
||||
50% {
|
||||
background-color: transparent
|
||||
}
|
||||
100% {}
|
||||
}
|
||||
|
||||
.CodeMirror-overwrite .CodeMirror-cursor {}
|
||||
|
||||
.cm-tab {
|
||||
display: inline-block;
|
||||
text-decoration: inherit
|
||||
}
|
||||
|
||||
.CodeMirror-rulers {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: -50px;
|
||||
bottom: 0;
|
||||
overflow: hidden
|
||||
}
|
||||
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
position: absolute
|
||||
}
|
||||
|
||||
.cm-s-default .cm-header {
|
||||
color: blue
|
||||
}
|
||||
|
||||
.cm-s-default .cm-quote {
|
||||
color: #090
|
||||
}
|
||||
|
||||
.cm-negative {
|
||||
color: #d44
|
||||
}
|
||||
|
||||
.cm-positive {
|
||||
color: #292
|
||||
}
|
||||
|
||||
.cm-header,
|
||||
.cm-strong {
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
.cm-em {
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
.cm-link {
|
||||
text-decoration: underline
|
||||
}
|
||||
|
||||
.cm-strikethrough {
|
||||
text-decoration: line-through
|
||||
}
|
||||
|
||||
.cm-s-default .cm-keyword {
|
||||
color: #708
|
||||
}
|
||||
|
||||
.cm-s-default .cm-atom {
|
||||
color: #219
|
||||
}
|
||||
|
||||
.cm-s-default .cm-number {
|
||||
color: #164
|
||||
}
|
||||
|
||||
.cm-s-default .cm-def {
|
||||
color: #00f
|
||||
}
|
||||
|
||||
.cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-punctuation,
|
||||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
|
||||
.cm-s-default .cm-variable-2 {
|
||||
color: #05a
|
||||
}
|
||||
|
||||
.cm-s-default .cm-variable-3,
|
||||
.cm-s-default .cm-type {
|
||||
color: #085
|
||||
}
|
||||
|
||||
.cm-s-default .cm-comment {
|
||||
color: #a50
|
||||
}
|
||||
|
||||
.cm-s-default .cm-string {
|
||||
color: #a11
|
||||
}
|
||||
|
||||
.cm-s-default .cm-string-2 {
|
||||
color: #f50
|
||||
}
|
||||
|
||||
.cm-s-default .cm-meta {
|
||||
color: #555
|
||||
}
|
||||
|
||||
.cm-s-default .cm-qualifier {
|
||||
color: #555
|
||||
}
|
||||
|
||||
.cm-s-default .cm-builtin {
|
||||
color: #30a
|
||||
}
|
||||
|
||||
.cm-s-default .cm-bracket {
|
||||
color: #997
|
||||
}
|
||||
|
||||
.cm-s-default .cm-tag {
|
||||
color: #170
|
||||
}
|
||||
|
||||
.cm-s-default .cm-attribute {
|
||||
color: #00c
|
||||
}
|
||||
|
||||
.cm-s-default .cm-hr {
|
||||
color: #999
|
||||
}
|
||||
|
||||
.cm-s-default .cm-link {
|
||||
color: #00c
|
||||
}
|
||||
|
||||
.cm-s-default .cm-error {
|
||||
color: red
|
||||
}
|
||||
|
||||
.cm-invalidchar {
|
||||
color: red
|
||||
}
|
||||
|
||||
.CodeMirror-composing {
|
||||
border-bottom: 2px solid
|
||||
}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {
|
||||
color: #0b0
|
||||
}
|
||||
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {
|
||||
color: #a22
|
||||
}
|
||||
|
||||
.CodeMirror-matchingtag {
|
||||
background: rgba(255, 150, 0, .3)
|
||||
}
|
||||
|
||||
.CodeMirror-activeline-background {
|
||||
background: #e8f2ff
|
||||
}
|
||||
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #fff
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: scroll!important;
|
||||
margin-bottom: -30px;
|
||||
margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none;
|
||||
position: relative
|
||||
}
|
||||
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
border-right: 30px solid transparent
|
||||
}
|
||||
|
||||
.CodeMirror-vscrollbar,
|
||||
.CodeMirror-hscrollbar,
|
||||
.CodeMirror-scrollbar-filler,
|
||||
.CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none
|
||||
}
|
||||
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0;
|
||||
top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll
|
||||
}
|
||||
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0;
|
||||
bottom: 0
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0;
|
||||
bottom: 0
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
min-height: 100%;
|
||||
z-index: 3
|
||||
}
|
||||
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-bottom: -30px
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-wrapper {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
background: 0 0!important;
|
||||
border: none!important
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 4
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-wrapper::selection {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
.CodeMirror-gutter-wrapper::-moz-selection {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
min-height: 1px
|
||||
}
|
||||
|
||||
.CodeMirror pre.CodeMirror-line,
|
||||
.CodeMirror pre.CodeMirror-line-like {
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
border-width: 0;
|
||||
background: 0 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-font-variant-ligatures: contextual;
|
||||
font-variant-ligatures: contextual
|
||||
}
|
||||
|
||||
.CodeMirror-wrap pre.CodeMirror-line,
|
||||
.CodeMirror-wrap pre.CodeMirror-line-like {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal
|
||||
}
|
||||
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 0
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
padding: .1px
|
||||
}
|
||||
|
||||
.CodeMirror-widget {}
|
||||
|
||||
.CodeMirror-rtl pre {
|
||||
direction: rtl
|
||||
}
|
||||
|
||||
.CodeMirror-code {
|
||||
outline: none
|
||||
}
|
||||
|
||||
.CodeMirror-scroll,
|
||||
.CodeMirror-sizer,
|
||||
.CodeMirror-gutter,
|
||||
.CodeMirror-gutters,
|
||||
.CodeMirror-linenumber {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
visibility: hidden
|
||||
}
|
||||
|
||||
.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.CodeMirror-measure pre {
|
||||
position: static
|
||||
}
|
||||
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
z-index: 3
|
||||
}
|
||||
|
||||
div.CodeMirror-dragcursors {
|
||||
visibility: visible
|
||||
}
|
||||
|
||||
.CodeMirror-focused div.CodeMirror-cursors {
|
||||
visibility: visible
|
||||
}
|
||||
|
||||
.CodeMirror-selected {
|
||||
background: #d9d9d9
|
||||
}
|
||||
|
||||
.CodeMirror-focused .CodeMirror-selected {
|
||||
background: #d7d4f0
|
||||
}
|
||||
|
||||
.CodeMirror-crosshair {
|
||||
cursor: crosshair
|
||||
}
|
||||
|
||||
.CodeMirror-line::selection,
|
||||
.CodeMirror-line>span::selection,
|
||||
.CodeMirror-line>span>span::selection {
|
||||
background: #d7d4f0
|
||||
}
|
||||
|
||||
.CodeMirror-line::-moz-selection,
|
||||
.CodeMirror-line>span::-moz-selection,
|
||||
.CodeMirror-line>span>span::-moz-selection {
|
||||
background: #d7d4f0
|
||||
}
|
||||
|
||||
.cm-searching {
|
||||
background-color: #ffa;
|
||||
background-color: rgba(255, 255, 0, .4)
|
||||
}
|
||||
|
||||
.cm-force-border {
|
||||
padding-right: .1px
|
||||
}
|
||||
|
||||
@media print {
|
||||
.CodeMirror div.CodeMirror-cursors {
|
||||
visibility: hidden
|
||||
}
|
||||
}
|
||||
|
||||
.cm-tab-wrap-hack:after {
|
||||
content: ''
|
||||
}
|
||||
|
||||
span.CodeMirror-selectedtext {
|
||||
background: 0 0
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
@charset "UTF-8";
|
||||
/*!
|
||||
* CoreUI Plugins - Chart.js for CoreUI 3
|
||||
* @version vv2.0.0-beta.0
|
||||
* @link https://coreui.io
|
||||
* Copyright (c) 2019 creativeLabs Łukasz Holeczek
|
||||
* Licensed under MIT (https://coreui.io/license/plugins/chart.js)
|
||||
*/
|
||||
.c-chartjs-tooltip {
|
||||
position: absolute;
|
||||
z-index: 1021;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
padding: 0.25rem 0.5rem;
|
||||
color: #fff;
|
||||
pointer-events: none;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
opacity: 0;
|
||||
transition: all 0.25s ease;
|
||||
-webkit-transform: translate(-50%, 0);
|
||||
transform: translate(-50%, 0);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.c-chartjs-tooltip .c-tooltip-header {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.c-chartjs-tooltip .c-tooltip-header-item {
|
||||
font-size: 0.765625rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.c-chartjs-tooltip .c-tooltip-body-item {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
font-size: 0.765625rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.c-chartjs-tooltip .c-tooltip-body-item-color {
|
||||
display: inline-block;
|
||||
width: 0.875rem;
|
||||
height: 0.875rem;
|
||||
margin-right: 0.875rem;
|
||||
}
|
||||
|
||||
.c-chartjs-tooltip .c-tooltip-body-item-value {
|
||||
padding-left: 1rem;
|
||||
margin-left: auto;
|
||||
font-weight: 700;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,688 @@
|
||||
.select2-container {
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
vertical-align: middle; }
|
||||
.select2-container .select2-selection--single {
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 28px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none; }
|
||||
.select2-container .select2-selection--single .select2-selection__rendered {
|
||||
display: block;
|
||||
padding-left: .75em;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap; }
|
||||
.select2-container .select2-selection--single .select2-selection__clear {
|
||||
position: relative; }
|
||||
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
|
||||
padding-right: 8px;
|
||||
padding-left: 20px; }
|
||||
.select2-container .select2-selection--multiple {
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
min-height: 32px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none; }
|
||||
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
padding-left: 8px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap; }
|
||||
.select2-container .select2-search--inline {
|
||||
float: left; }
|
||||
.select2-container .select2-search--inline .select2-search__field {
|
||||
box-sizing: border-box;
|
||||
border: none;
|
||||
font-size: 100%;
|
||||
margin-top: 5px;
|
||||
padding: 0; }
|
||||
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
|
||||
-webkit-appearance: none; }
|
||||
|
||||
.select2-dropdown {
|
||||
background-color: white;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: -100000px;
|
||||
width: 100%;
|
||||
z-index: 1051; }
|
||||
|
||||
.select2-results {
|
||||
display: block; }
|
||||
|
||||
.select2-results__options {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
|
||||
.select2-results__option {
|
||||
padding: 6px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none; }
|
||||
.select2-results__option[aria-selected] {
|
||||
cursor: pointer; }
|
||||
|
||||
.select2-container--open .select2-dropdown {
|
||||
left: 0; }
|
||||
|
||||
.select2-container--open .select2-dropdown--above {
|
||||
border-bottom: none;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0; }
|
||||
|
||||
.select2-container--open .select2-dropdown--below {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0; }
|
||||
|
||||
.select2-search--dropdown {
|
||||
display: block;
|
||||
padding: 4px; }
|
||||
.select2-search--dropdown .select2-search__field {
|
||||
padding: 4px;
|
||||
width: 100%;
|
||||
box-sizing: border-box; }
|
||||
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
|
||||
-webkit-appearance: none; }
|
||||
.select2-search--dropdown.select2-search--hide {
|
||||
display: none; }
|
||||
|
||||
.select2-close-mask {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: block;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
height: auto;
|
||||
width: auto;
|
||||
opacity: 0;
|
||||
z-index: 99;
|
||||
background-color: #fff;
|
||||
filter: alpha(opacity=0); }
|
||||
|
||||
.select2-hidden-accessible {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
-webkit-clip-path: inset(50%) !important;
|
||||
clip-path: inset(50%) !important;
|
||||
height: 1px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
white-space: nowrap !important; }
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
color: #444;
|
||||
line-height: 28px; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-weight: bold; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__placeholder {
|
||||
color: #999; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height: 26px;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
width: 20px; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: #888 transparent transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0 4px;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
margin-top: -2px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 0; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
||||
float: left; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
||||
left: 1px;
|
||||
right: auto; }
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #eee;
|
||||
cursor: default; }
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
|
||||
display: none; }
|
||||
|
||||
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: transparent transparent #888 transparent;
|
||||
border-width: 0 4px 5px 4px; }
|
||||
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
background-color: white;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: text; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
width: 100%; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
||||
list-style: none; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
margin-top: 5px;
|
||||
margin-right: 10px;
|
||||
padding: 1px; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #e4e4e4;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: default;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
margin-top: 5px;
|
||||
padding: 0 5px; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin-right: 2px; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
|
||||
color: #333; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
||||
float: right; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
||||
margin-left: 5px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
||||
margin-left: 2px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
||||
border: solid black 1px;
|
||||
outline: 0; }
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--multiple {
|
||||
background-color: #eee;
|
||||
cursor: default; }
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
|
||||
display: none; }
|
||||
|
||||
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0; }
|
||||
|
||||
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0; }
|
||||
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
border: 1px solid #aaa; }
|
||||
|
||||
.select2-container--default .select2-search--inline .select2-search__field {
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: 0;
|
||||
box-shadow: none;
|
||||
-webkit-appearance: textfield; }
|
||||
|
||||
.select2-container--default .select2-results > .select2-results__options {
|
||||
max-height: 200px;
|
||||
overflow-y: auto; }
|
||||
|
||||
.select2-container--default .select2-results__option[role=group] {
|
||||
padding: 0; }
|
||||
|
||||
.select2-container--default .select2-results__option[aria-disabled=true] {
|
||||
color: #999; }
|
||||
|
||||
.select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background-color: #ddd; }
|
||||
|
||||
.select2-container--default .select2-results__option .select2-results__option {
|
||||
padding-left: 1em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
|
||||
padding-left: 0; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -1em;
|
||||
padding-left: 2em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -2em;
|
||||
padding-left: 3em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -3em;
|
||||
padding-left: 4em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -4em;
|
||||
padding-left: 5em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -5em;
|
||||
padding-left: 6em; }
|
||||
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected] {
|
||||
background-color: #5897fb;
|
||||
color: white; }
|
||||
|
||||
.select2-container--default .select2-results__group {
|
||||
cursor: default;
|
||||
display: block;
|
||||
padding: 6px; }
|
||||
|
||||
.select2-container--classic .select2-selection--single {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
outline: 0;
|
||||
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
|
||||
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
|
||||
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
||||
.select2-container--classic .select2-selection--single:focus {
|
||||
border: 1px solid #5897fb; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__rendered {
|
||||
color: #444;
|
||||
line-height: 28px; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
margin-right: 10px; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
|
||||
color: #999; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__arrow {
|
||||
background-color: #ddd;
|
||||
border: none;
|
||||
border-left: 1px solid #aaa;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
height: 26px;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
width: 20px;
|
||||
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
||||
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
||||
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: #888 transparent transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0 4px;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
margin-top: -2px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 0; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
||||
float: left; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
||||
border: none;
|
||||
border-right: 1px solid #aaa;
|
||||
border-radius: 0;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
left: 1px;
|
||||
right: auto; }
|
||||
|
||||
.select2-container--classic.select2-container--open .select2-selection--single {
|
||||
border: 1px solid #5897fb; }
|
||||
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
|
||||
background: transparent;
|
||||
border: none; }
|
||||
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: transparent transparent #888 transparent;
|
||||
border-width: 0 4px 5px 4px; }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
|
||||
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
||||
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
|
||||
border-bottom: none;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
|
||||
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
|
||||
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
|
||||
|
||||
.select2-container--classic .select2-selection--multiple {
|
||||
background-color: white;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: text;
|
||||
outline: 0; }
|
||||
.select2-container--classic .select2-selection--multiple:focus {
|
||||
border: 1px solid #5897fb; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 5px; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
|
||||
display: none; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #e4e4e4;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: default;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
margin-top: 5px;
|
||||
padding: 0 5px; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
|
||||
color: #888;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin-right: 2px; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
|
||||
color: #555; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
||||
float: right;
|
||||
margin-left: 5px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
||||
margin-left: 2px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--classic.select2-container--open .select2-selection--multiple {
|
||||
border: 1px solid #5897fb; }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0; }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
|
||||
border-bottom: none;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0; }
|
||||
|
||||
.select2-container--classic .select2-search--dropdown .select2-search__field {
|
||||
border: 1px solid #aaa;
|
||||
outline: 0; }
|
||||
|
||||
.select2-container--classic .select2-search--inline .select2-search__field {
|
||||
outline: 0;
|
||||
box-shadow: none; }
|
||||
|
||||
.select2-container--classic .select2-dropdown {
|
||||
background-color: white;
|
||||
border: 1px solid transparent; }
|
||||
|
||||
.select2-container--classic .select2-dropdown--above {
|
||||
border-bottom: none; }
|
||||
|
||||
.select2-container--classic .select2-dropdown--below {
|
||||
border-top: none; }
|
||||
|
||||
.select2-container--classic .select2-results > .select2-results__options {
|
||||
max-height: 200px;
|
||||
overflow-y: auto; }
|
||||
|
||||
.select2-container--classic .select2-results__option[role=group] {
|
||||
padding: 0; }
|
||||
|
||||
.select2-container--classic .select2-results__option[aria-disabled=true] {
|
||||
color: grey; }
|
||||
|
||||
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
|
||||
background-color: #3875d7;
|
||||
color: white; }
|
||||
|
||||
.select2-container--classic .select2-results__group {
|
||||
cursor: default;
|
||||
display: block;
|
||||
padding: 6px; }
|
||||
|
||||
.select2-container--classic.select2-container--open .select2-dropdown {
|
||||
border-color: #5897fb; }
|
||||
|
||||
.select2-container--coreui .select2-selection--single {
|
||||
height: calc(1.5em + .75rem + 2px) !important
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--single .select2-selection__placeholder {
|
||||
color: #757575;
|
||||
line-height: calc(1.5em + .75rem)
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--single .select2-selection__arrow {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 3px;
|
||||
width: 20px
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--single .select2-selection__arrow b {
|
||||
top: 60%;
|
||||
border-color: #636f83 transparent transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0 4px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
margin-top: -2px;
|
||||
position: absolute
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--single .select2-selection__rendered {
|
||||
line-height: calc(1.5em + .75rem)
|
||||
}
|
||||
|
||||
.select2-search--dropdown .select2-search__field {
|
||||
border: 1px solid;
|
||||
border-radius: .25rem;
|
||||
border-color: #d8dbe0
|
||||
}
|
||||
|
||||
.select2-results__message {
|
||||
color: #3c4b64
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--multiple {
|
||||
min-height: calc(1.5em + .75rem + 2px) !important
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--multiple .select2-selection__rendered {
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--multiple .select2-selection__rendered .select2-search__field {
|
||||
background-color: #fff;
|
||||
color: #768192
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--multiple .select2-selection__choice {
|
||||
border: 1px solid;
|
||||
border-radius: .2rem;
|
||||
padding: 0;
|
||||
padding-right: 5px;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
margin-top: 0.3em;
|
||||
margin-right: 5px;
|
||||
color: #768192;
|
||||
border-color: #39f
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--multiple .select2-selection__choice__remove {
|
||||
width: 26px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-right: .375rem;
|
||||
border-right: 1px solid;
|
||||
background: #fff;
|
||||
color: #9cf;
|
||||
border-color: #39f;
|
||||
background: rgba(51, 153, 255, 0)
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection--multiple .select2-selection__choice__remove:hover {
|
||||
color: #39f;
|
||||
background: rgba(51, 153, 255, 0.1)
|
||||
}
|
||||
|
||||
.select2-container {
|
||||
display: block
|
||||
}
|
||||
|
||||
.select2-container *:focus {
|
||||
outline: 0
|
||||
}
|
||||
|
||||
.input-group .select2-container--coreui {
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1
|
||||
}
|
||||
|
||||
.input-group-prepend ~ .select2-container--coreui .select2-selection {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection {
|
||||
border: 1px solid;
|
||||
border-radius: .25rem;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
border-color: #d8dbe0
|
||||
}
|
||||
|
||||
.select2-container--coreui.select2-container--focus .select2-selection {
|
||||
border-color: #39f;
|
||||
box-shadow: 0 0 0 .2rem rgba(50, 31, 219, 0.25)
|
||||
}
|
||||
|
||||
.select2-container--coreui.select2-container--focus.select2-container--open .select2-selection {
|
||||
border-bottom: none;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0
|
||||
}
|
||||
|
||||
.select2-container--coreui.select2-container--disabled .select2-selection,
|
||||
.select2-container--coreui.select2-container--disabled.select2-container--focus .select2-selection {
|
||||
cursor: not-allowed;
|
||||
box-shadow: none;
|
||||
background-color: #d8dbe0;
|
||||
border-color: #d8dbe0
|
||||
}
|
||||
|
||||
.select2-container--coreui.select2-container--disabled .select2-search__field,
|
||||
.select2-container--coreui.select2-container--disabled.select2-container--focus .select2-search__field {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
select.is-invalid ~ .select2-container--coreui .select2-selection {
|
||||
border-color: #e55353
|
||||
}
|
||||
|
||||
select.is-valid ~ .select2-container--coreui .select2-selection {
|
||||
border-color: #2eb85c
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-dropdown {
|
||||
background-color: #fff;
|
||||
border-color: #d8dbe0;
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-dropdown.select2-dropdown--above {
|
||||
border-top: 1px solid;
|
||||
border-top-left-radius: .25rem;
|
||||
border-top-right-radius: .25rem;
|
||||
border-color: #d8dbe0
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-dropdown .select2-results__option[aria-selected=true] {
|
||||
background-color: #f2f2f2
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-results__option--highlighted,
|
||||
.select2-container--coreui .select2-results__option--highlighted.select2-results__option[aria-selected=true] {
|
||||
background-color: #321fdb;
|
||||
color: #ebedef
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-results__option[role=group] {
|
||||
padding: 0
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-results>.select2-results__options {
|
||||
max-height: 15em;
|
||||
overflow-y: auto
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-results__group {
|
||||
padding: 6px;
|
||||
display: list-item;
|
||||
color: #3c4b64
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection__clear {
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
line-height: 1.15em;
|
||||
padding-left: 0.3em;
|
||||
margin-top: 0.5em;
|
||||
border-radius: 100%;
|
||||
background-color: #3c4b64;
|
||||
color: #ebedef;
|
||||
float: right;
|
||||
margin-right: 0.3em
|
||||
}
|
||||
|
||||
.select2-container--coreui .select2-selection__clear:hover {
|
||||
background-color: #636f83
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
table.dataTable.dtr-inline.collapsed>tbody>tr>td.child,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty{cursor:default !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty:before{display:none !important}table.dataTable.dtr-inline.collapsed>tbody>tr[role="row"]>td.dtr-control,table.dataTable.dtr-inline.collapsed>tbody>tr[role="row"]>th.dtr-control{position:relative;padding-left:30px;cursor:pointer}table.dataTable.dtr-inline.collapsed>tbody>tr[role="row"]>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr[role="row"]>th.dtr-control:before{top:50%;left:5px;height:14px;width:14px;margin-top:-9px;display:block;position:absolute;color:white;border:2px solid white;border-radius:14px;box-shadow:0 0 3px #444;box-sizing:content-box;text-align:center;text-indent:0 !important;font-family:'Courier New', Courier, monospace;line-height:14px;content:'+';background-color:#0275d8}table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th.dtr-control:before{content:'-';background-color:#d33333}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td.dtr-control,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th.dtr-control{padding-left:27px}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td.dtr-control:before,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th.dtr-control:before{left:4px;height:14px;width:14px;border-radius:14px;line-height:14px;text-indent:3px}table.dataTable.dtr-column>tbody>tr>td.control,table.dataTable.dtr-column>tbody>tr>th.control{position:relative;cursor:pointer}table.dataTable.dtr-column>tbody>tr>td.control:before,table.dataTable.dtr-column>tbody>tr>th.control:before{top:50%;left:50%;height:16px;width:16px;margin-top:-10px;margin-left:-10px;display:block;position:absolute;color:white;border:2px solid white;border-radius:14px;box-shadow:0 0 3px #444;box-sizing:content-box;text-align:center;text-indent:0 !important;font-family:'Courier New', Courier, monospace;line-height:14px;content:'+';background-color:#0275d8}table.dataTable.dtr-column>tbody>tr.parent td.control:before,table.dataTable.dtr-column>tbody>tr.parent th.control:before{content:'-';background-color:#d33333}table.dataTable>tbody>tr.child{padding:0.5em 1em}table.dataTable>tbody>tr.child:hover{background:transparent !important}table.dataTable>tbody>tr.child ul.dtr-details{display:inline-block;list-style-type:none;margin:0;padding:0}table.dataTable>tbody>tr.child ul.dtr-details>li{border-bottom:1px solid #efefef;padding:0.5em 0}table.dataTable>tbody>tr.child ul.dtr-details>li:first-child{padding-top:0}table.dataTable>tbody>tr.child ul.dtr-details>li:last-child{border-bottom:none}table.dataTable>tbody>tr.child span.dtr-title{display:inline-block;min-width:75px;font-weight:bold}div.dtr-modal{position:fixed;box-sizing:border-box;top:0;left:0;height:100%;width:100%;z-index:100;padding:10em 1em}div.dtr-modal div.dtr-modal-display{position:absolute;top:0;left:0;bottom:0;right:0;width:50%;height:50%;overflow:auto;margin:auto;z-index:102;overflow:auto;background-color:#f5f5f7;border:1px solid black;border-radius:0.5em;box-shadow:0 12px 30px rgba(0,0,0,0.6)}div.dtr-modal div.dtr-modal-content{position:relative;padding:1em}div.dtr-modal div.dtr-modal-close{position:absolute;top:6px;right:6px;width:22px;height:22px;border:1px solid #eaeaea;background-color:#f9f9f9;text-align:center;border-radius:3px;cursor:pointer;z-index:12}div.dtr-modal div.dtr-modal-close:hover{background-color:#eaeaea}div.dtr-modal div.dtr-modal-background{position:fixed;top:0;left:0;right:0;bottom:0;z-index:101;background:rgba(0,0,0,0.6)}@media screen and (max-width: 767px){div.dtr-modal div.dtr-modal-display{width:95%}}div.dtr-bs-modal table.table tr:first-child td{border-top:none}table.dataTable.dtr-inline.collapsed.table-sm>tbody>tr>td:first-child:before,table.dataTable.dtr-inline.collapsed.table-sm>tbody>tr>th:first-child:before{top:5px}
|
||||
@@ -0,0 +1 @@
|
||||
div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0,0,0,0.8);color:white;box-shadow:3px 3px 10px rgba(0,0,0,0.5);text-align:right;border-radius:3px;padding:0.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.dts div.dataTables_scrollBody table{z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none}div.DTS div.dataTables_scrollBody table{background-color:white}
|
||||
@@ -0,0 +1,204 @@
|
||||
body.lb-disable-scrolling {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.lightboxOverlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
background-color: black;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
|
||||
opacity: 0.8;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.lightbox {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 10000;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
font-weight: normal;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.lightbox .lb-image {
|
||||
display: block;
|
||||
height: auto;
|
||||
max-width: inherit;
|
||||
max-height: none;
|
||||
border-radius: 3px;
|
||||
|
||||
/* Image border */
|
||||
border: 4px solid white;
|
||||
}
|
||||
|
||||
.lightbox a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.lb-outerContainer {
|
||||
position: relative;
|
||||
zoom: 1;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
margin: 0 auto;
|
||||
border-radius: 4px;
|
||||
|
||||
/* Background color behind image.
|
||||
This is visible during transitions. */
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.lb-outerContainer:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.lb-loader {
|
||||
position: absolute;
|
||||
top: 43%;
|
||||
left: 0;
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.lb-cancel {
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: 0 auto;
|
||||
background: url(../assets/images/lightbox/loading.gif) no-repeat;
|
||||
}
|
||||
|
||||
.lb-nav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.lb-container > .nav {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.lb-nav a {
|
||||
outline: none;
|
||||
background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
|
||||
}
|
||||
|
||||
.lb-prev, .lb-next {
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-prev {
|
||||
width: 34%;
|
||||
left: 0;
|
||||
float: left;
|
||||
background: url(../assets/images/lightbox/prev.png) left 48% no-repeat;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.6s;
|
||||
-moz-transition: opacity 0.6s;
|
||||
-o-transition: opacity 0.6s;
|
||||
transition: opacity 0.6s;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-prev:hover {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-next {
|
||||
width: 64%;
|
||||
right: 0;
|
||||
float: right;
|
||||
background: url(../assets/images/lightbox/next.png) right 48% no-repeat;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.6s;
|
||||
-moz-transition: opacity 0.6s;
|
||||
-o-transition: opacity 0.6s;
|
||||
transition: opacity 0.6s;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-next:hover {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.lb-dataContainer {
|
||||
margin: 0 auto;
|
||||
padding-top: 5px;
|
||||
*zoom: 1;
|
||||
width: 100%;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.lb-dataContainer:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.lb-data {
|
||||
padding: 0 4px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.lb-data .lb-details {
|
||||
width: 85%;
|
||||
float: left;
|
||||
text-align: left;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
|
||||
.lb-data .lb-caption {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
.lb-data .lb-caption a {
|
||||
color: #4ae;
|
||||
}
|
||||
|
||||
.lb-data .lb-number {
|
||||
display: block;
|
||||
clear: left;
|
||||
padding-bottom: 1em;
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.lb-data .lb-close {
|
||||
display: block;
|
||||
float: right;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: url(../assets/images/lightbox/close.png) top right no-repeat;
|
||||
text-align: right;
|
||||
outline: none;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
|
||||
opacity: 0.7;
|
||||
-webkit-transition: opacity 0.2s;
|
||||
-moz-transition: opacity 0.2s;
|
||||
-o-transition: opacity 0.2s;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.lb-data .lb-close:hover {
|
||||
cursor: pointer;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
#loading-bar,
|
||||
#loading-bar-spinner {
|
||||
-webkit-pointer-events: none;
|
||||
pointer-events: none;
|
||||
transition: 350ms linear all;
|
||||
}
|
||||
|
||||
#loading-bar.ng-enter,
|
||||
#loading-bar.ng-leave.ng-leave-active,
|
||||
#loading-bar-spinner.ng-enter,
|
||||
#loading-bar-spinner.ng-leave.ng-leave-active {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#loading-bar.ng-enter.ng-enter-active,
|
||||
#loading-bar.ng-leave,
|
||||
#loading-bar-spinner.ng-enter.ng-enter-active,
|
||||
#loading-bar-spinner.ng-leave {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#loading-bar .bar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 20002;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #20a8d8;
|
||||
border-top-right-radius: 1px;
|
||||
border-bottom-right-radius: 1px;
|
||||
transition: width 350ms;
|
||||
}
|
||||
|
||||
#loading-bar .peg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 70px;
|
||||
height: 2px;
|
||||
border-radius: 100%;
|
||||
-ms-box-shadow: #29d 1px 0 6px 1px;
|
||||
box-shadow: #29d 1px 0 6px 1px;
|
||||
opacity: .45;
|
||||
}
|
||||
|
||||
#loading-bar-spinner {
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 10002;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#loading-bar-spinner .spinner-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: solid 2px transparent;
|
||||
border-top-color: #29d;
|
||||
border-left-color: #29d;
|
||||
border-radius: 50%;
|
||||
-webkit-animation: loading-bar-spinner 400ms linear infinite;
|
||||
animation: loading-bar-spinner 400ms linear infinite;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loading-bar-spinner {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loading-bar-spinner {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.pace {
|
||||
-webkit-pointer-events: none;
|
||||
pointer-events: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.pace-inactive {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pace .pace-progress {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 100%;
|
||||
z-index: 2000;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #20a8d8;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /assets/css/print.css
|
||||
Desc. : CSS Class for Preview & Printing
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 7th, 2008.
|
||||
Last Modified : November 24th, 2020.
|
||||
|
||||
(c) 2008 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
@media print {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
text-shadow: none!important;
|
||||
box-shadow: none!important
|
||||
}
|
||||
a:not(.btn) {
|
||||
text-decoration: underline
|
||||
}
|
||||
abbr[title]::after {
|
||||
content: " (" attr(title) ")"
|
||||
}
|
||||
pre {
|
||||
white-space: pre-wrap!important
|
||||
}
|
||||
pre, blockquote {
|
||||
border: 1px solid #9da5b1;
|
||||
page-break-inside: avoid
|
||||
}
|
||||
thead {
|
||||
display: table-header-group
|
||||
}
|
||||
tr, img {
|
||||
page-break-inside: avoid
|
||||
}
|
||||
p, h2, h3 {
|
||||
orphans: 3;
|
||||
widows: 3
|
||||
}
|
||||
h2, h3 {
|
||||
page-break-after: avoid
|
||||
}
|
||||
body, .container {
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
.navbar { display: none; }
|
||||
.badge {
|
||||
border: 1px solid #000015
|
||||
}
|
||||
.table {
|
||||
border-collapse: collapse!important
|
||||
}
|
||||
.table td, .table th {
|
||||
background-color: #fff!important
|
||||
}
|
||||
.table-bordered th, .table-bordered td {
|
||||
border: 1px solid #c4c9d0!important
|
||||
}
|
||||
.table-dark {
|
||||
color: inherit
|
||||
}
|
||||
.table-dark th, .table-dark td, .table-dark thead th, .table-dark tbody+tbody, .table .thead-dark th {
|
||||
border-color: #d8dbe0
|
||||
}
|
||||
.table .thead-dark th {
|
||||
color: inherit
|
||||
}
|
||||
|
||||
div.c-wrapper, div.c-sidebar, div.modal, div.modal-backdrop { display: none !important; }
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,234 @@
|
||||
.toast-title {
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
.toast-message {
|
||||
-ms-word-wrap: break-word;
|
||||
word-wrap: break-word
|
||||
}
|
||||
|
||||
.toast-message a,
|
||||
.toast-message label {
|
||||
color: #ffffff
|
||||
}
|
||||
|
||||
.toast-message a:hover {
|
||||
color: #cccccc;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.toast-close-button {
|
||||
position: relative;
|
||||
right: -0.3em;
|
||||
top: -0.3em;
|
||||
float: right;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
-webkit-text-shadow: 0 1px 0 #ffffff;
|
||||
text-shadow: 0 1px 0 #ffffff;
|
||||
opacity: 0.8;
|
||||
-ms-filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=80);
|
||||
filter: alpha(opacity=80)
|
||||
}
|
||||
|
||||
.toast-close-button:hover,
|
||||
.toast-close-button:focus {
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
opacity: 0.4;
|
||||
-ms-filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=40);
|
||||
filter: alpha(opacity=40)
|
||||
}
|
||||
|
||||
button.toast-close-button {
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
-webkit-appearance: none
|
||||
}
|
||||
|
||||
.toast-top-center {
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.toast-bottom-center {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.toast-top-full-width {
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.toast-bottom-full-width {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.toast-top-left {
|
||||
top: 12px;
|
||||
left: 12px
|
||||
}
|
||||
|
||||
.toast-top-right {
|
||||
top: 60px;
|
||||
right: 12px
|
||||
}
|
||||
|
||||
.toast-bottom-right {
|
||||
right: 12px;
|
||||
bottom: 12px
|
||||
}
|
||||
|
||||
.toast-bottom-left {
|
||||
bottom: 12px;
|
||||
left: 12px
|
||||
}
|
||||
|
||||
#toast-container {
|
||||
position: fixed;
|
||||
z-index: 999999
|
||||
}
|
||||
|
||||
#toast-container * {
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
#toast-container .toast {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin: 0 0 6px;
|
||||
padding: 15px;
|
||||
width: 300px;
|
||||
border-radius: .25rem;
|
||||
background-position: 15px center;
|
||||
background-repeat: no-repeat;
|
||||
color: #ffffff;
|
||||
opacity: 0.9;
|
||||
-ms-filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=90);
|
||||
filter: alpha(opacity=90)
|
||||
}
|
||||
|
||||
#toast-container .toast:hover {
|
||||
opacity: 1;
|
||||
-ms-filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
filter: alpha(opacity=100);
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
#toast-container .toast {
|
||||
background-image: none !important
|
||||
}
|
||||
|
||||
#toast-container.toast-top-center>div,
|
||||
#toast-container.toast-bottom-center>div {
|
||||
width: 300px;
|
||||
margin: auto
|
||||
}
|
||||
|
||||
#toast-container.toast-top-full-width>div,
|
||||
#toast-container.toast-bottom-full-width>div {
|
||||
width: 96%;
|
||||
margin: auto
|
||||
}
|
||||
|
||||
.toast {
|
||||
background-color: #321fdb
|
||||
}
|
||||
|
||||
.toast-success {
|
||||
background-color: #2eb85c
|
||||
}
|
||||
|
||||
.toast-error {
|
||||
background-color: #e55353
|
||||
}
|
||||
|
||||
.toast-info {
|
||||
background-color: #39f
|
||||
}
|
||||
|
||||
.toast-warning {
|
||||
background-color: #f9b115
|
||||
}
|
||||
|
||||
progress-bar,
|
||||
.toast-progress {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
height: 4px;
|
||||
background-color: #000000;
|
||||
opacity: .2;
|
||||
-ms-filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=20);
|
||||
filter: alpha(opacity=20)
|
||||
}
|
||||
|
||||
div[toast],
|
||||
.toast {
|
||||
opacity: 1 !important
|
||||
}
|
||||
|
||||
div[toast].ng-enter,
|
||||
.toast.ng-enter {
|
||||
opacity: 0 !important;
|
||||
transition: opacity .3s linear
|
||||
}
|
||||
|
||||
div[toast].ng-enter.ng-enter-active,
|
||||
.toast.ng-enter.ng-enter-active {
|
||||
opacity: 1 !important
|
||||
}
|
||||
|
||||
div[toast].ng-leave,
|
||||
.toast.ng-leave {
|
||||
opacity: 1;
|
||||
transition: opacity .3s linear
|
||||
}
|
||||
|
||||
div[toast].ng-leave.ng-leave-active,
|
||||
.toast.ng-leave.ng-leave-active {
|
||||
opacity: 0 !important
|
||||
}
|
||||
|
||||
@media all and (max-width: 240px) {
|
||||
#toast-container>div {
|
||||
padding: 8px 8px 8px 50px;
|
||||
width: 11em
|
||||
}
|
||||
#toast-container .toast-close-button {
|
||||
right: -0.2em;
|
||||
top: -0.2em
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 241px) and (max-width: 480px) {
|
||||
#toast-container>div {
|
||||
padding: 8px 8px 8px 50px;
|
||||
width: 18em
|
||||
}
|
||||
#toast-container .toast-close-button {
|
||||
right: -0.2em;
|
||||
top: -0.2em
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 481px) and (max-width: 768px) {
|
||||
#toast-container>div {
|
||||
padding: 15px 15px 15px 50px;
|
||||
width: 25em
|
||||
}
|
||||
}
|
||||
|
||||
.toaster-icon.icon-info {
|
||||
display: none
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /assets/css/view.css
|
||||
Desc. : CSS Class for Normal Page
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 20th, 2007.
|
||||
Last Modified : November 24th, 2020.
|
||||
|
||||
(c) 2009 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
.c-main {
|
||||
padding-top: 1rem
|
||||
}
|
||||
|
||||
.card-header.custom-style {
|
||||
padding: .50rem 1.25rem;
|
||||
background-color: #ced2d8 !important;
|
||||
text-align: center !important;
|
||||
color: #fff !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
.card-body { padding: .75rem; }
|
||||
.table th, .table td { padding: .5rem; }
|
||||
.table-hover tbody tr:hover, .table-hover tbody tr:active { background-color: #ff9 }
|
||||
.table-select tbody tr { cursor: pointer }
|
||||
textarea { overflow-x: hidden }
|
||||
input[type="checkbox"][readonly] {
|
||||
pointer-events: none;
|
||||
}
|
||||
a.c-header-nav-link, a.slink, a.mlink , a.table-icon{ cursor: pointer; }
|
||||
a.table-icon {
|
||||
text-decoration: none;
|
||||
padding: 0 5px;
|
||||
}
|
||||
a.table-icon:hover i {
|
||||
color: red;
|
||||
}
|
||||
button.tbl-rowbtn {
|
||||
background-color: #93E3FF;
|
||||
padding: .2rem .5rem;
|
||||
margin-right: .2rem;
|
||||
margin-bottom: .25rem;
|
||||
}
|
||||
button.tbl-rowbtn:hover {
|
||||
color: #fff;
|
||||
background-color: #39f;
|
||||
}
|
||||
.input-group-text {
|
||||
box-shadow: none !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.icon-tooltip { color: var(--warning); }
|
||||
.dropdown-menu.multi-level {
|
||||
margin-top: .5rem;
|
||||
}
|
||||
.dropdown-submenu {
|
||||
position: relative;
|
||||
}
|
||||
.dropdown-submenu>.dropdown-menu {
|
||||
top: 0;
|
||||
left: 100%;
|
||||
margin-top: -6px;
|
||||
margin-left: -1px;
|
||||
-webkit-border-radius: 0 6px 6px 6px;
|
||||
-moz-border-radius: 0 6px 6px;
|
||||
border-radius: 0 6px 6px 6px;
|
||||
}
|
||||
.dropdown-submenu:hover>.dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
.dropdown-submenu>a:after {
|
||||
display: block;
|
||||
content: " ";
|
||||
float: right;
|
||||
text-align: right;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 0 5px 5px;
|
||||
border-left-color: #aaa;
|
||||
margin-top: 3px;
|
||||
margin-right: -10px;
|
||||
}
|
||||
.dropdown-submenu:hover {
|
||||
background-color: #ebedef;
|
||||
}
|
||||
.dropdown-submenu.pull-left {
|
||||
float: none;
|
||||
}
|
||||
.dropdown-submenu.pull-left>.dropdown-menu {
|
||||
left: -100%;
|
||||
margin-left: 10px;
|
||||
-webkit-border-radius: 6px 0 6px 6px;
|
||||
-moz-border-radius: 6px 0 6px 6px;
|
||||
border-radius: 6px 0 6px 6px;
|
||||
}
|
||||
.dropdown-toggle:after {
|
||||
margin-left: .45em;
|
||||
}
|
||||
.dropdown-toggle.slink:after {
|
||||
margin-left: auto;
|
||||
}
|
||||
a.nav-head { font-size: 1.2em; }
|
||||
|
||||
.modal-dialog.modal-fs {
|
||||
width: 95%;
|
||||
max-width: none;
|
||||
}
|
||||
.modal-header button.btn-cetak { margin-left: .5rem; }
|
||||
.modal-header button.btn-cetak:hover {
|
||||
color: var(--light);
|
||||
background-color: var(--info);
|
||||
}
|
||||
@media(max-width:1199.98px) {
|
||||
.modal-header button.btn-cetak span {display: none!important;}
|
||||
.modal-header button.btn-cetak {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
@media(min-width: 576px) {
|
||||
.modal-400 { max-width: 400px; }
|
||||
.modal-500 { max-width: 500px; }
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.dropdown-menu { width: 200px !important; }
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.dropdown-menu { width: 250px !important; }
|
||||
.c-main > .container-fluid {
|
||||
padding-right: 15px;
|
||||
padding-left: 15px
|
||||
}
|
||||
.table thead th {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.toolbar {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
table>tbody tr.rred td:not(:last-child) { background-color: #F49DA4; }
|
||||
table>tbody tr.rgreen td:not(:last-child) { background-color:#7eff6c; }
|
||||
table>tbody tr.ryellow td:not(:last-child) { background-color:#ffffa8; }
|
||||
table>tbody tr.rblue td:not(:last-child) { background-color:#9ECAF5; }
|
||||
table>tbody tr.rpurple td:not(:last-child) { background-color:#8E60EE; }
|
||||
table>tbody tr.rcoret td:not(:last-child) { background-color:#F9B5B7; text-decoration: line-through; }
|
||||
|
||||
table * .bold { font-weight: bold !important; }
|
||||
table * .left { text-align: left !important; }
|
||||
table * .right { text-align: right !important; }
|
||||
table * .center { text-align: center !important; }
|
||||
table * .wrap { white-space: normal !important; }
|
||||
table * .nowrap { white-space: nowrap !important; }
|
||||
table * .autowrap { white-space: nowrap !important; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
|
||||
table * .hidden { visibility: hidden !important; display: none !important; }
|
||||
table * .nb { border: 0 !important; }
|
||||
|
||||
ul.dtr-details li.hidden { visibility: hidden !important; display: none !important; }
|
||||
|
||||
/******************************** Autocomplete ********************************/
|
||||
|
||||
.bs-fonac .dropdown-menu {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bs-fonac .dropdown-item {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: .5rem .8rem;
|
||||
clear: both;
|
||||
font-size: .9rem;
|
||||
font-weight: 400;
|
||||
text-align: inherit;
|
||||
white-space: nowrap;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
color: #000
|
||||
}
|
||||
|
||||
.bs-fonac .dropdown-item:hover, .bs-fonac .dropdown-item:focus {
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
background-color: #ebedef
|
||||
}
|
||||
|
||||
.bs-fonac .dropdown-item.active, .bs-fonac .dropdown-item:active {
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
background-color: #321fdb
|
||||
}
|
||||
|
||||
.bs-fonac .dropdown-item.disabled, .bs-fonac .dropdown-item:disabled {
|
||||
pointer-events: none;
|
||||
background-color: transparent;
|
||||
color: #8a93a2
|
||||
}
|
||||
|
||||
/******************************** text field ********************************/
|
||||
|
||||
input.double, input.integer, input.number {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/******************************** Preloader ********************************/
|
||||
|
||||
#preloader {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
#loader {
|
||||
display: block;
|
||||
position: relative;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin: -75px 0 0 -75px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid transparent;
|
||||
border-top-color: #9370DB;
|
||||
-webkit-animation: spin 2s linear infinite;
|
||||
animation: spin 2s linear infinite;
|
||||
}
|
||||
#loader:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid transparent;
|
||||
border-top-color: #BA55D3;
|
||||
-webkit-animation: spin 3s linear infinite;
|
||||
animation: spin 3s linear infinite;
|
||||
}
|
||||
#loader:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid transparent;
|
||||
border-top-color: #FF00FF;
|
||||
-webkit-animation: spin 1.5s linear infinite;
|
||||
animation: spin 1.5s linear infinite;
|
||||
}
|
||||
@-webkit-keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
-ms-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
-ms-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
-ms-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
-ms-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
+450
@@ -0,0 +1,450 @@
|
||||
!(function (t) {
|
||||
var e = {};
|
||||
function s(i) {
|
||||
if (e[i]) return e[i].exports;
|
||||
var o = (e[i] = { i: i, l: !1, exports: {} });
|
||||
return t[i].call(o.exports, o, o.exports, s), (o.l = !0), o.exports;
|
||||
}
|
||||
(s.m = t),
|
||||
(s.c = e),
|
||||
(s.d = function (t, e, i) {
|
||||
s.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i });
|
||||
}),
|
||||
(s.r = function (t) {
|
||||
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
|
||||
}),
|
||||
(s.t = function (t, e) {
|
||||
if ((1 & e && (t = s(t)), 8 & e)) return t;
|
||||
if (4 & e && "object" == typeof t && t && t.__esModule) return t;
|
||||
var i = Object.create(null);
|
||||
if ((s.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t))
|
||||
for (var o in t)
|
||||
s.d(i,
|
||||
o,
|
||||
function (e) {
|
||||
return t[e];
|
||||
}.bind(null, o)
|
||||
);
|
||||
return i;
|
||||
}),
|
||||
(s.n = function (t) {
|
||||
var e = t && t.__esModule
|
||||
? function () {
|
||||
return t.default;
|
||||
}
|
||||
: function () {
|
||||
return t;
|
||||
};
|
||||
return s.d(e, "a", e), e;
|
||||
}),
|
||||
(s.o = function (t, e) {
|
||||
return Object.prototype.hasOwnProperty.call(t, e);
|
||||
}),
|
||||
(s.p = ""), s((s.s = 0));
|
||||
})([
|
||||
function (t, e, s) {
|
||||
"use strict";
|
||||
s.r(e),
|
||||
s.d(e, "AutoComplete", function () {
|
||||
return a;
|
||||
});
|
||||
var i,
|
||||
o = ((i = function (t, e) {
|
||||
return (i =
|
||||
Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array &&
|
||||
function (t, e) {
|
||||
t.__proto__ = e;
|
||||
}) ||
|
||||
function (t, e) {
|
||||
for (var s in e) e.hasOwnProperty(s) && (t[s] = e[s]);
|
||||
})(t, e);
|
||||
}),
|
||||
function (t, e) {
|
||||
function s() {
|
||||
this.constructor = t;
|
||||
}
|
||||
i(t, e), (t.prototype = null === e ? Object.create(e) : ((s.prototype = e.prototype), new s()));
|
||||
}),
|
||||
n = (function (t) {
|
||||
function e(e) {
|
||||
return t.call(this, e) || this;
|
||||
}
|
||||
return (
|
||||
o(e, t),
|
||||
(e.prototype.getDefaults = function () {
|
||||
return { url: "", method: "post", queryKey: "Auto_Query", extraData: {}, timeout: void 0, requestThrottling: 500 };
|
||||
}),
|
||||
(e.prototype.search = function (t, e) {
|
||||
var s = this;
|
||||
null != this.jqXHR && this.jqXHR.abort();
|
||||
var i = {};
|
||||
(i[this._settings.queryKey] = t),
|
||||
$.extend(i, this._settings.extraData),
|
||||
this.requestTID && window.clearTimeout(this.requestTID),
|
||||
(this.requestTID = window.setTimeout(function () {
|
||||
(s.jqXHR = $.ajax(s._settings.url, { method: s._settings.method, data: i, timeout: s._settings.timeout })),
|
||||
s.jqXHR.done(function (t) {
|
||||
var v;
|
||||
(v = void 0 !== t.autodata ? t.autodata : t), e(v);
|
||||
}),
|
||||
s.jqXHR.fail(function (t) {
|
||||
var e;
|
||||
null === (e = s._settings) || void 0 === e || e.fail(t);
|
||||
}),
|
||||
s.jqXHR.always(function () {
|
||||
s.jqXHR = null;
|
||||
});
|
||||
}, this._settings.requestThrottling));
|
||||
}),
|
||||
e
|
||||
);
|
||||
})(
|
||||
(function () {
|
||||
function t(t) {
|
||||
this._settings = $.extend(!0, {}, this.getDefaults(), t);
|
||||
}
|
||||
return (
|
||||
(t.prototype.getDefaults = function () {
|
||||
return {};
|
||||
}),
|
||||
(t.prototype.getResults = function (t, e, s) {
|
||||
return this.results;
|
||||
}),
|
||||
(t.prototype.search = function (t, e) {
|
||||
e(this.getResults());
|
||||
}),
|
||||
t
|
||||
);
|
||||
})()
|
||||
),
|
||||
l = (function () {
|
||||
function t(t, e, s, i) {
|
||||
(this.initialized = !1), (this.shown = !1), (this.items = []), (this.ddMouseover = !1), (this._$el = t), (this.formatItem = e), (this.autoSelect = s), (this.noResultsText = i);
|
||||
}
|
||||
return (
|
||||
(t.prototype.getElPos = function () {
|
||||
return $.extend({}, this._$el.position(), { height: this._$el[0].offsetHeight });
|
||||
}),
|
||||
(t.prototype.init = function () {
|
||||
var t = this, e = this.getElPos();
|
||||
(this._dd = $("<div />")),
|
||||
this._dd.addClass("bs-fonac dropdown-menu"),
|
||||
this._dd.insertAfter(this._$el),
|
||||
this._dd.css({ cssText: 'width: '+this._$el.outerWidth()+'px !important', top: e.top + this._$el.outerHeight(), left: e.left }),
|
||||
this._dd.on("click", ".dropdown-item", function (e) {
|
||||
var s = $(e.currentTarget).data("item");
|
||||
t.itemSelectedLaunchEvent(s), e.preventDefault();
|
||||
}),
|
||||
this._dd.on("keyup", function (e) {
|
||||
if (t.shown) {
|
||||
switch (e.which) {
|
||||
case 27:
|
||||
t.hide(), t._$el.focus();
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
}),
|
||||
this._dd.on("mouseenter", function (e) {
|
||||
t.ddMouseover = !0;
|
||||
}),
|
||||
this._dd.on("mouseleave", function (e) {
|
||||
t.ddMouseover = !1;
|
||||
}),
|
||||
this._dd.on("mouseenter", ".dropdown-item", function (e) {
|
||||
t.haveResults && ($(e.currentTarget).closest("div").find(".dropdown-item.active").removeClass("active"), $(e.currentTarget).addClass("active"), (t.mouseover = !0));
|
||||
}),
|
||||
this._dd.on("mouseleave", ".dropdown-item", function (e) {
|
||||
t.mouseover = !1;
|
||||
}),
|
||||
(this.initialized = !0);
|
||||
}),
|
||||
(t.prototype.checkInitialized = function () {
|
||||
this.initialized || this.init();
|
||||
}),
|
||||
Object.defineProperty(t.prototype, "isMouseOver", {
|
||||
get: function () {
|
||||
return this.mouseover;
|
||||
},
|
||||
enumerable: !1,
|
||||
configurable: !0,
|
||||
}),
|
||||
Object.defineProperty(t.prototype, "isDdMouseOver", {
|
||||
get: function () {
|
||||
return this.ddMouseover;
|
||||
},
|
||||
enumerable: !1,
|
||||
configurable: !0,
|
||||
}),
|
||||
Object.defineProperty(t.prototype, "haveResults", {
|
||||
get: function () {
|
||||
return this.items.length > 0;
|
||||
},
|
||||
enumerable: !1,
|
||||
configurable: !0,
|
||||
}),
|
||||
(t.prototype.focusNextItem = function (t) {
|
||||
if (this.haveResults) {
|
||||
var e = this._dd.find(".dropdown-item.active"),
|
||||
s = t ? e.prev() : e.next();
|
||||
0 === s.length && (s = t ? this._dd.find(".dropdown-item").last() : this._dd.find(".dropdown-item").first()), e.removeClass("active"), s.addClass("active");
|
||||
}
|
||||
}),
|
||||
(t.prototype.focusPreviousItem = function () {
|
||||
this.focusNextItem(!0);
|
||||
}),
|
||||
(t.prototype.selectFocusItem = function () {
|
||||
this._dd.find(".dropdown-item.active").trigger("click");
|
||||
}),
|
||||
Object.defineProperty(t.prototype, "isItemFocused", {
|
||||
get: function () {
|
||||
return !!(this._dd && this.isShown() && this._dd.find(".dropdown-item.active").length > 0);
|
||||
},
|
||||
enumerable: !1,
|
||||
configurable: !0,
|
||||
}),
|
||||
(t.prototype.show = function () {
|
||||
if (!this.shown) {
|
||||
this.getElPos();
|
||||
this._dd.addClass("show"), (this.shown = !0), this._$el.trigger("autocomplete.dd.shown");
|
||||
}
|
||||
}),
|
||||
(t.prototype.isShown = function () {
|
||||
return this.shown;
|
||||
}),
|
||||
(t.prototype.hide = function () {
|
||||
this.shown && (this._dd.removeClass("show"), (this.shown = !1), this._$el.trigger("autocomplete.dd.hidden"));
|
||||
}),
|
||||
(t.prototype.updateItems = function (t, e) {
|
||||
(this.items = t), (this.searchText = e), this.refreshItemList();
|
||||
}),
|
||||
(t.prototype.showMatchedText = function (t, e) {
|
||||
var s = t.toLowerCase().indexOf(e.toLowerCase());
|
||||
if (s > -1) {
|
||||
var i = s + e.length;
|
||||
return t.slice(0, s) + "<b>" + t.slice(s, i) + "</b>" + t.slice(i);
|
||||
}
|
||||
return t;
|
||||
}),
|
||||
(t.prototype.refreshItemList = function () {
|
||||
var t = this;
|
||||
this.checkInitialized(), this._dd.empty();
|
||||
var e = [];
|
||||
if (this.items.length > 0)
|
||||
this.items.forEach(function (s) {
|
||||
var i, o, n = t.formatItem(s);
|
||||
"string" == typeof n && (n = { text: n }),
|
||||
(i = void 0 !== n.html ? n.html : n.text),
|
||||
(o = t.showMatchedText(i, t.searchText));
|
||||
var r = n.disabled, l = $("<a >");
|
||||
l.addClass("dropdown-item").css({ overflow: "hidden", "text-overflow": "ellipsis" }).html(o).data("item", s), r && l.addClass("disabled"), e.push(l);
|
||||
}),
|
||||
this._dd.append(e),
|
||||
this.show();
|
||||
else if ("" === this.noResultsText) this.hide();
|
||||
else {
|
||||
var s = $("<a >");
|
||||
s.addClass("dropdown-item disabled").html(this.noResultsText), e.push(s), this._dd.append(e), this.show();
|
||||
}
|
||||
}),
|
||||
(t.prototype.itemSelectedLaunchEvent = function (t) {
|
||||
this._$el.trigger("autocomplete.select", t);
|
||||
}),
|
||||
t
|
||||
);
|
||||
})(),
|
||||
a = (function () {
|
||||
function t(t, e) {
|
||||
(this._selectedItem = null),
|
||||
(this._defaultValue = null),
|
||||
(this._defaultText = null),
|
||||
(this._isSelectElement = !1),
|
||||
(this._settings = {
|
||||
resolver: "ajax",
|
||||
resolverSettings: {},
|
||||
minLength: 3,
|
||||
valueKey: "value",
|
||||
formatResult: this.defaultFormatResult,
|
||||
autoSelect: !0,
|
||||
noResultsText: "Tidak ditemukan data",
|
||||
bootstrapVersion: "4",
|
||||
preventEnter: !1,
|
||||
events: { typed: null, searchPre: null, search: null, searchPost: null, select: null, focus: null },
|
||||
keydownFunc: function(){},//gnips
|
||||
}),
|
||||
(this._el = t),
|
||||
(this._$el = $(this._el)),
|
||||
this._$el.is("select") && (this._isSelectElement = !0),
|
||||
this.manageInlineDataAttributes(),
|
||||
"object" == typeof e && (this._settings = $.extend(!0, {}, this.getSettings(), e)),
|
||||
this._isSelectElement && this.convertSelectToText(),
|
||||
this.init();
|
||||
}
|
||||
return (
|
||||
(t.prototype.manageInlineDataAttributes = function () {
|
||||
var t = this.getSettings();
|
||||
this._$el.data("url") && (t.resolverSettings.url = this._$el.data("url")),
|
||||
this._$el.data("default-value") && (this._defaultValue = this._$el.data("default-value")),
|
||||
this._$el.data("default-text") && (this._defaultText = this._$el.data("default-text")),
|
||||
void 0 !== this._$el.data("noresults-text") && (t.noResultsText = this._$el.data("noresults-text"));
|
||||
}),
|
||||
(t.prototype.getSettings = function () {
|
||||
return this._settings;
|
||||
}),
|
||||
(t.prototype.getBootstrapVersion = function () {
|
||||
var t;
|
||||
"4" === this._settings.bootstrapVersion ? (t = [4])
|
||||
: (console.error("INVALID value for 'bootstrapVersion' settings property: " + this._settings.bootstrapVersion + " defaulting to 4"), (t = [4]));
|
||||
return t;
|
||||
}),
|
||||
(t.prototype.convertSelectToText = function () {
|
||||
var e = $("<input>");
|
||||
e.attr("type", "hidden"), e.attr("id", this._$el.attr("id")+'_AutoVal'), this._defaultValue && e.val(this._defaultValue), (this._selectHiddenField = e), e.insertAfter(this._$el);
|
||||
var s = $("<input>");
|
||||
s.attr("type", "search"),
|
||||
s.attr("id", this._$el.attr("id")),
|
||||
s.attr("disabled", this._$el.attr("disabled")),
|
||||
s.attr("placeholder", this._$el.attr("placeholder")),
|
||||
s.attr("autocomplete", "off"),
|
||||
s.addClass(this._$el.attr("class")),
|
||||
this._defaultText && s.val(this._defaultText);
|
||||
var i = this._$el.attr("required");
|
||||
i && s.attr("required", i), s.data(t.NAME, this), this._$el.replaceWith(s), (this._$el = s), (this._el = s.get(0));
|
||||
}),
|
||||
(t.prototype.init = function () {
|
||||
this.bindDefaultEventListeners(),
|
||||
"ajax" === this._settings.resolver && (this.resolver = new n(this._settings.resolverSettings)),
|
||||
(this._dd = new l(this._$el, this._settings.formatResult, this._settings.autoSelect, this._settings.noResultsText));
|
||||
}),
|
||||
(t.prototype.bindDefaultEventListeners = function () {
|
||||
var t = this;
|
||||
this._$el.on("keydown", function (e) {
|
||||
("" == t._$el.val() && t._settings.keydownFunc(e.which));//gnips
|
||||
switch (e.which) {
|
||||
case 9:
|
||||
t._dd.isItemFocused ? t._dd.selectFocusItem() : t._selectedItem || ("" !== t._$el.val() && t._$el.trigger("autocomplete.freevalue", t._$el.val())), t._dd.hide();
|
||||
break;
|
||||
case 13:
|
||||
t._dd.isItemFocused ? t._dd.selectFocusItem() : t._selectedItem || ("" !== t._$el.val() && t._$el.trigger("autocomplete.freevalue", t._$el.val())),
|
||||
t._dd.hide(),
|
||||
t._settings.preventEnter && e.preventDefault();
|
||||
break;
|
||||
case 40:
|
||||
t._dd.focusNextItem();
|
||||
break;
|
||||
case 38:
|
||||
t._dd.focusPreviousItem();
|
||||
}
|
||||
}),
|
||||
this._$el.on("keyup", function (e) {
|
||||
switch (e.which) {
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
case 39:
|
||||
case 37:
|
||||
case 36:
|
||||
case 35:
|
||||
break;
|
||||
case 13:
|
||||
case 27:
|
||||
t._dd.hide();
|
||||
break;
|
||||
case 40:
|
||||
case 38:
|
||||
break;
|
||||
default:
|
||||
t._selectedItem = null;
|
||||
var s = t._$el.val();
|
||||
t.handlerTyped(s);
|
||||
}
|
||||
}),
|
||||
this._$el.on("blur", function (e) {
|
||||
!t._dd.isMouseOver && t._dd.isDdMouseOver && t._dd.isShown()
|
||||
? (setTimeout(function () {
|
||||
t._$el.focus();
|
||||
}),
|
||||
t._$el.focus())
|
||||
: t._dd.isMouseOver ||
|
||||
/*(t._isSelectElement
|
||||
? t._dd.isItemFocused
|
||||
? t._dd.selectFocusItem()
|
||||
: null !== t._selectedItem && "" !== t._$el.val()
|
||||
? t._$el.trigger("autocomplete.select", t._selectedItem)
|
||||
: "" !== t._$el.val() && null !== t._defaultValue
|
||||
? (t._$el.val(t._defaultText), t._selectHiddenField.val(t._defaultValue), (t._selectedItem = null), t._$el.trigger("autocomplete.select", t._selectedItem))
|
||||
: (t._$el.val(""), t._selectHiddenField.val(""), (t._selectedItem = null), t._$el.trigger("autocomplete.select", t._selectedItem))
|
||||
: null === t._selectedItem && t._$el.trigger("autocomplete.freevalue", t._$el.val()),
|
||||
t._dd.hide());*/ t._dd.hide();
|
||||
}),
|
||||
this._$el.on("autocomplete.select", function (e, s) {
|
||||
(t._selectedItem = s), t.itemSelectedDefaultHandler(s);
|
||||
}),
|
||||
this._$el.on("paste", function (e) {
|
||||
setTimeout(function () {
|
||||
t._$el.trigger("keyup", e);
|
||||
}, 0);
|
||||
});
|
||||
}),
|
||||
(t.prototype.handlerTyped = function (t) {
|
||||
(null === this._settings.events.typed || (t = this._settings.events.typed(t, this._$el))) && (t.length >= this._settings.minLength ? ((this._searchText = t), this.handlerPreSearch()) : this._dd.hide());
|
||||
}),
|
||||
(t.prototype.handlerPreSearch = function () {
|
||||
if (null !== this._settings.events.searchPre) {
|
||||
var t = this._settings.events.searchPre(this._searchText, this._$el);
|
||||
if (!t) return;
|
||||
this._searchText = t;
|
||||
}
|
||||
this.handlerDoSearch();
|
||||
}),
|
||||
(t.prototype.handlerDoSearch = function () {
|
||||
var t = this;
|
||||
null !== this._settings.events.search
|
||||
? this._settings.events.search(
|
||||
this._searchText,
|
||||
function (e) {
|
||||
t.postSearchCallback(e);
|
||||
},
|
||||
this._$el
|
||||
)
|
||||
: this.resolver &&
|
||||
this.resolver.search(this._searchText, function (e) {
|
||||
t.postSearchCallback(e);
|
||||
});
|
||||
}),
|
||||
(t.prototype.postSearchCallback = function (t) {
|
||||
(this._settings.events.searchPost && "boolean" == typeof (t = this._settings.events.searchPost(t, this._$el)) && !t) || this.handlerStartShow(t);
|
||||
}),
|
||||
(t.prototype.handlerStartShow = function (t) {
|
||||
if (1 == t.length && 1 == (void 0 !== t[0].bc ? t[0].bc : 0)) {
|
||||
this._$el.trigger("autocomplete.select", t[0]),
|
||||
this._dd.hide();
|
||||
} else this._dd.updateItems(t, this._searchText);
|
||||
}),
|
||||
(t.prototype.itemSelectedDefaultHandler = function (t) {
|
||||
if (null != t) {
|
||||
var e = this._settings.formatResult(t);
|
||||
"string" == typeof e && (e = { text: e }), this._$el.val(e.text), this._isSelectElement && this._selectHiddenField.val(e.value);
|
||||
} else this._$el.val(""), this._isSelectElement && this._selectHiddenField.val("");
|
||||
(this._selectedItem = t), this._dd.hide();
|
||||
}),
|
||||
(t.prototype.defaultFormatResult = function (t) {
|
||||
return "string" == typeof t ? { text: t } : t.text ? t : { text: t.toString() };
|
||||
}),
|
||||
(t.prototype.manageAPI = function (t, e) {
|
||||
"set" === t ? this.itemSelectedDefaultHandler(e) : "clear" === t ? this.itemSelectedDefaultHandler(null) : "show" === t ? this._$el.trigger("keyup") : "updateResolver" === t && (this.resolver = new n(e));
|
||||
}),
|
||||
(t.NAME = "autoComplete"),
|
||||
t
|
||||
);
|
||||
})();
|
||||
!(function (t, e, s) {
|
||||
t.fn[a.NAME] = function (e, s) {
|
||||
return this.each(function () {
|
||||
var i;
|
||||
(i = t(this).data(a.NAME)) || ((i = new a(this, e)), t(this).data(a.NAME, i)), i.manageAPI(e, s);
|
||||
});
|
||||
};
|
||||
})(jQuery, window, document);
|
||||
},
|
||||
]);
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/*!
|
||||
DataTables Bootstrap 4 integration
|
||||
©2011-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var k=a[d];if(b.call(c,k,d,a))return{i:d,v:k}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(a,b,c,e){if(b){c=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];d in c||(c[d]={});c=c[d]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");
|
||||
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);c&&c.fn.dataTable||(c=require("datatables.net")(b,c).$);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c,e){var d=a.fn.dataTable;a.extend(!0,d.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
||||
renderer:"bootstrap"});a.extend(d.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"});d.ext.renderer.pageButton.bootstrap=function(b,l,v,w,m,r){var k=new d.Api(b),x=b.oClasses,n=b.oLanguage.oPaginate,y=b.oLanguage.oAria.paginate||{},g,h,t=0,u=function(c,d){var e,l=function(b){b.preventDefault();
|
||||
a(b.currentTarget).hasClass("disabled")||k.page()==b.data.action||k.page(b.data.action).draw("page")};var q=0;for(e=d.length;q<e;q++){var f=d[q];if(a.isArray(f))u(c,f);else{h=g="";switch(f){case "ellipsis":g="…";h="disabled";break;case "first":g=n.sFirst;h=f+(0<m?"":" disabled");break;case "previous":g=n.sPrevious;h=f+(0<m?"":" disabled");break;case "next":g=n.sNext;h=f+(m<r-1?"":" disabled");break;case "last":g=n.sLast;h=f+(m<r-1?"":" disabled");break;default:g=f+1,h=m===f?"active":""}if(g){var p=
|
||||
a("<li>",{"class":x.sPageButton+" "+h,id:0===v&&"string"===typeof f?b.sTableId+"_"+f:null}).append(a("<a>",{href:"#","aria-controls":b.sTableId,"aria-label":y[f],"data-dt-idx":t,tabindex:b.iTabIndex,"class":"page-link"}).html(g)).appendTo(c);b.oApi._fnBindAction(p,{action:f},l);t++}}}};try{var p=a(l).find(c.activeElement).data("dt-idx")}catch(z){}u(a(l).empty().html('<ul class="pagination"/>').children("ul"),w);p!==e&&a(l).find("[data-dt-idx="+p+"]").trigger("focus")};return d});
|
||||
@@ -0,0 +1,9 @@
|
||||
/*!
|
||||
Bootstrap 4 integration for DataTables' Responsive
|
||||
©2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(c.call(b,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var c=0;c<a.length;++c){var b=a[c];if(b&&b.Math==Math)return b}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
|
||||
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-responsive"],function(c){return a(c,window,document)}):"object"===typeof exports?module.exports=function(c,b){c||(c=window);b&&b.fn.dataTable||(b=require("datatables.net-bs4")(c,b).$);b.fn.dataTable.Responsive||require("datatables.net-responsive")(c,b);return a(b,c,c.document)}:a(jQuery,window,document)})(function(a,c,b,d){c=a.fn.dataTable;b=c.Responsive.display;var e=b.modal,f=a('<div class="modal fade dtr-bs-modal" role="dialog"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body"/></div></div></div>');
|
||||
b.modal=function(b){return function(c,d,g){if(!a.fn.modal)e(c,d,g);else if(!d){if(b&&b.header){d=f.find("div.modal-header");var h=d.find("button").detach();d.empty().append('<h4 class="modal-title">'+b.header(c)+"</h4>").append(h)}f.find("div.modal-body").empty().append(g());f.appendTo("body").modal()}}};return c.Responsive});
|
||||
+8
File diff suppressed because one or more lines are too long
Vendored
+6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,402 @@
|
||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
mod(require("../../lib/codemirror"));
|
||||
else if (typeof define == "function" && define.amd) // AMD
|
||||
define(["../../lib/codemirror"], mod);
|
||||
else // Plain browser env
|
||||
mod(CodeMirror);
|
||||
})(function(CodeMirror) {
|
||||
"use strict";
|
||||
|
||||
var htmlConfig = {
|
||||
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
||||
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
||||
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
||||
'track': true, 'wbr': true, 'menuitem': true},
|
||||
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
||||
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
||||
'th': true, 'tr': true},
|
||||
contextGrabbers: {
|
||||
'dd': {'dd': true, 'dt': true},
|
||||
'dt': {'dd': true, 'dt': true},
|
||||
'li': {'li': true},
|
||||
'option': {'option': true, 'optgroup': true},
|
||||
'optgroup': {'optgroup': true},
|
||||
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
||||
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
||||
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
||||
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
||||
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
||||
'rp': {'rp': true, 'rt': true},
|
||||
'rt': {'rp': true, 'rt': true},
|
||||
'tbody': {'tbody': true, 'tfoot': true},
|
||||
'td': {'td': true, 'th': true},
|
||||
'tfoot': {'tbody': true},
|
||||
'th': {'td': true, 'th': true},
|
||||
'thead': {'tbody': true, 'tfoot': true},
|
||||
'tr': {'tr': true}
|
||||
},
|
||||
doNotIndent: {"pre": true},
|
||||
allowUnquoted: true,
|
||||
allowMissing: true,
|
||||
caseFold: true
|
||||
}
|
||||
|
||||
var xmlConfig = {
|
||||
autoSelfClosers: {},
|
||||
implicitlyClosed: {},
|
||||
contextGrabbers: {},
|
||||
doNotIndent: {},
|
||||
allowUnquoted: false,
|
||||
allowMissing: false,
|
||||
allowMissingTagName: false,
|
||||
caseFold: false
|
||||
}
|
||||
|
||||
CodeMirror.defineMode("xml", function(editorConf, config_) {
|
||||
var indentUnit = editorConf.indentUnit
|
||||
var config = {}
|
||||
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
|
||||
for (var prop in defaults) config[prop] = defaults[prop]
|
||||
for (var prop in config_) config[prop] = config_[prop]
|
||||
|
||||
// Return variables for tokenizers
|
||||
var type, setStyle;
|
||||
|
||||
function inText(stream, state) {
|
||||
function chain(parser) {
|
||||
state.tokenize = parser;
|
||||
return parser(stream, state);
|
||||
}
|
||||
|
||||
var ch = stream.next();
|
||||
if (ch == "<") {
|
||||
if (stream.eat("!")) {
|
||||
if (stream.eat("[")) {
|
||||
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
||||
else return null;
|
||||
} else if (stream.match("--")) {
|
||||
return chain(inBlock("comment", "-->"));
|
||||
} else if (stream.match("DOCTYPE", true, true)) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
return chain(doctype(1));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else if (stream.eat("?")) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
state.tokenize = inBlock("meta", "?>");
|
||||
return "meta";
|
||||
} else {
|
||||
type = stream.eat("/") ? "closeTag" : "openTag";
|
||||
state.tokenize = inTag;
|
||||
return "tag bracket";
|
||||
}
|
||||
} else if (ch == "&") {
|
||||
var ok;
|
||||
if (stream.eat("#")) {
|
||||
if (stream.eat("x")) {
|
||||
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
||||
}
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
||||
}
|
||||
return ok ? "atom" : "error";
|
||||
} else {
|
||||
stream.eatWhile(/[^&<]/);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
inText.isInText = true;
|
||||
|
||||
function inTag(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
||||
state.tokenize = inText;
|
||||
type = ch == ">" ? "endTag" : "selfcloseTag";
|
||||
return "tag bracket";
|
||||
} else if (ch == "=") {
|
||||
type = "equals";
|
||||
return null;
|
||||
} else if (ch == "<") {
|
||||
state.tokenize = inText;
|
||||
state.state = baseState;
|
||||
state.tagName = state.tagStart = null;
|
||||
var next = state.tokenize(stream, state);
|
||||
return next ? next + " tag error" : "tag error";
|
||||
} else if (/[\'\"]/.test(ch)) {
|
||||
state.tokenize = inAttribute(ch);
|
||||
state.stringStartCol = stream.column();
|
||||
return state.tokenize(stream, state);
|
||||
} else {
|
||||
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
|
||||
return "word";
|
||||
}
|
||||
}
|
||||
|
||||
function inAttribute(quote) {
|
||||
var closure = function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.next() == quote) {
|
||||
state.tokenize = inTag;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "string";
|
||||
};
|
||||
closure.isInAttribute = true;
|
||||
return closure;
|
||||
}
|
||||
|
||||
function inBlock(style, terminator) {
|
||||
return function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.match(terminator)) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
}
|
||||
stream.next();
|
||||
}
|
||||
return style;
|
||||
}
|
||||
}
|
||||
|
||||
function doctype(depth) {
|
||||
return function(stream, state) {
|
||||
var ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == "<") {
|
||||
state.tokenize = doctype(depth + 1);
|
||||
return state.tokenize(stream, state);
|
||||
} else if (ch == ">") {
|
||||
if (depth == 1) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
} else {
|
||||
state.tokenize = doctype(depth - 1);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "meta";
|
||||
};
|
||||
}
|
||||
|
||||
function Context(state, tagName, startOfLine) {
|
||||
this.prev = state.context;
|
||||
this.tagName = tagName;
|
||||
this.indent = state.indented;
|
||||
this.startOfLine = startOfLine;
|
||||
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
||||
this.noIndent = true;
|
||||
}
|
||||
function popContext(state) {
|
||||
if (state.context) state.context = state.context.prev;
|
||||
}
|
||||
function maybePopContext(state, nextTagName) {
|
||||
var parentTagName;
|
||||
while (true) {
|
||||
if (!state.context) {
|
||||
return;
|
||||
}
|
||||
parentTagName = state.context.tagName;
|
||||
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
|
||||
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
||||
return;
|
||||
}
|
||||
popContext(state);
|
||||
}
|
||||
}
|
||||
|
||||
function baseState(type, stream, state) {
|
||||
if (type == "openTag") {
|
||||
state.tagStart = stream.column();
|
||||
return tagNameState;
|
||||
} else if (type == "closeTag") {
|
||||
return closeTagNameState;
|
||||
} else {
|
||||
return baseState;
|
||||
}
|
||||
}
|
||||
function tagNameState(type, stream, state) {
|
||||
if (type == "word") {
|
||||
state.tagName = stream.current();
|
||||
setStyle = "tag";
|
||||
return attrState;
|
||||
} else if (config.allowMissingTagName && type == "endTag") {
|
||||
setStyle = "tag bracket";
|
||||
return attrState(type, stream, state);
|
||||
} else {
|
||||
setStyle = "error";
|
||||
return tagNameState;
|
||||
}
|
||||
}
|
||||
function closeTagNameState(type, stream, state) {
|
||||
if (type == "word") {
|
||||
var tagName = stream.current();
|
||||
if (state.context && state.context.tagName != tagName &&
|
||||
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
||||
popContext(state);
|
||||
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
|
||||
setStyle = "tag";
|
||||
return closeState;
|
||||
} else {
|
||||
setStyle = "tag error";
|
||||
return closeStateErr;
|
||||
}
|
||||
} else if (config.allowMissingTagName && type == "endTag") {
|
||||
setStyle = "tag bracket";
|
||||
return closeState(type, stream, state);
|
||||
} else {
|
||||
setStyle = "error";
|
||||
return closeStateErr;
|
||||
}
|
||||
}
|
||||
|
||||
function closeState(type, _stream, state) {
|
||||
if (type != "endTag") {
|
||||
setStyle = "error";
|
||||
return closeState;
|
||||
}
|
||||
popContext(state);
|
||||
return baseState;
|
||||
}
|
||||
function closeStateErr(type, stream, state) {
|
||||
setStyle = "error";
|
||||
return closeState(type, stream, state);
|
||||
}
|
||||
|
||||
function attrState(type, _stream, state) {
|
||||
if (type == "word") {
|
||||
setStyle = "attribute";
|
||||
return attrEqState;
|
||||
} else if (type == "endTag" || type == "selfcloseTag") {
|
||||
var tagName = state.tagName, tagStart = state.tagStart;
|
||||
state.tagName = state.tagStart = null;
|
||||
if (type == "selfcloseTag" ||
|
||||
config.autoSelfClosers.hasOwnProperty(tagName)) {
|
||||
maybePopContext(state, tagName);
|
||||
} else {
|
||||
maybePopContext(state, tagName);
|
||||
state.context = new Context(state, tagName, tagStart == state.indented);
|
||||
}
|
||||
return baseState;
|
||||
}
|
||||
setStyle = "error";
|
||||
return attrState;
|
||||
}
|
||||
function attrEqState(type, stream, state) {
|
||||
if (type == "equals") return attrValueState;
|
||||
if (!config.allowMissing) setStyle = "error";
|
||||
return attrState(type, stream, state);
|
||||
}
|
||||
function attrValueState(type, stream, state) {
|
||||
if (type == "string") return attrContinuedState;
|
||||
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
|
||||
setStyle = "error";
|
||||
return attrState(type, stream, state);
|
||||
}
|
||||
function attrContinuedState(type, stream, state) {
|
||||
if (type == "string") return attrContinuedState;
|
||||
return attrState(type, stream, state);
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function(baseIndent) {
|
||||
var state = {tokenize: inText,
|
||||
state: baseState,
|
||||
indented: baseIndent || 0,
|
||||
tagName: null, tagStart: null,
|
||||
context: null}
|
||||
if (baseIndent != null) state.baseIndent = baseIndent
|
||||
return state
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (!state.tagName && stream.sol())
|
||||
state.indented = stream.indentation();
|
||||
|
||||
if (stream.eatSpace()) return null;
|
||||
type = null;
|
||||
var style = state.tokenize(stream, state);
|
||||
if ((style || type) && style != "comment") {
|
||||
setStyle = null;
|
||||
state.state = state.state(type || style, stream, state);
|
||||
if (setStyle)
|
||||
style = setStyle == "error" ? style + " error" : setStyle;
|
||||
}
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter, fullLine) {
|
||||
var context = state.context;
|
||||
// Indent multi-line strings (e.g. css).
|
||||
if (state.tokenize.isInAttribute) {
|
||||
if (state.tagStart == state.indented)
|
||||
return state.stringStartCol + 1;
|
||||
else
|
||||
return state.indented + indentUnit;
|
||||
}
|
||||
if (context && context.noIndent) return CodeMirror.Pass;
|
||||
if (state.tokenize != inTag && state.tokenize != inText)
|
||||
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
||||
// Indent the starts of attribute names.
|
||||
if (state.tagName) {
|
||||
if (config.multilineTagIndentPastTag !== false)
|
||||
return state.tagStart + state.tagName.length + 2;
|
||||
else
|
||||
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
|
||||
}
|
||||
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
||||
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
||||
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
||||
while (context) {
|
||||
if (context.tagName == tagAfter[2]) {
|
||||
context = context.prev;
|
||||
break;
|
||||
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
||||
context = context.prev;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (tagAfter) { // Opening tag spotted
|
||||
while (context) {
|
||||
var grabbers = config.contextGrabbers[context.tagName];
|
||||
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
||||
context = context.prev;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (context && context.prev && !context.startOfLine)
|
||||
context = context.prev;
|
||||
if (context) return context.indent + indentUnit;
|
||||
else return state.baseIndent || 0;
|
||||
},
|
||||
|
||||
electricInput: /<\/[\s\w:]+>$/,
|
||||
blockCommentStart: "<!--",
|
||||
blockCommentEnd: "-->",
|
||||
|
||||
configuration: config.htmlMode ? "html" : "xml",
|
||||
helperType: config.htmlMode ? "html" : "xml",
|
||||
|
||||
skipAttribute: function(state) {
|
||||
if (state.state == attrValueState)
|
||||
state.state = attrState
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/xml", "xml");
|
||||
CodeMirror.defineMIME("application/xml", "xml");
|
||||
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
||||
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
||||
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /modules/js/export.js
|
||||
Desc. : Fungsi-fungsi export data & laporan
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : April 1st, 2011.
|
||||
Last Modified : January 7th, 2016.
|
||||
|
||||
(c) 2011 - 2016, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var cEXPORT = function(url, options){
|
||||
var vars = {
|
||||
'url': '',
|
||||
'param': []
|
||||
};
|
||||
this.construct = function(url, options){
|
||||
$.extend(vars, options);
|
||||
vars.url = url;
|
||||
};
|
||||
this.set_url = function (url){
|
||||
vars.url = url;
|
||||
};
|
||||
this.add_param = function (par_id, par_val){
|
||||
var _getvalue = (par_val) ? par_id + "=" + escape(par_val) : par_id;
|
||||
vars.param.push(_getvalue);
|
||||
},
|
||||
this.download = function(){
|
||||
if (!vars.url) {
|
||||
console.warn(vars.param + ", cek url php!");
|
||||
return false;
|
||||
}
|
||||
var _pro = (window.location.protocol=='https:') ? 'https://' : 'http://';
|
||||
var _src = _pro+FoniaJS.WEB_HOST + vars.url + '?' + (FoniaJS.RequestParam(vars.param)).join('&');
|
||||
var $exportData = $('#IFrame_Export');
|
||||
if (!$exportData.length) {
|
||||
var $exportData = $('<iframe>', {id:'IFrame_Export','class':'d-none'}).appendTo('body');
|
||||
}
|
||||
$exportData.prop('src', _src);
|
||||
return this;
|
||||
};
|
||||
this.construct(url, options);
|
||||
};
|
||||
+1113
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
autosize 4.0.2
|
||||
license: MIT
|
||||
http://www.jacklmoore.com/autosize
|
||||
*/
|
||||
!function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.autosize=n.exports}}(this,function(e,t){"use strict";var n,o,p="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return-1<n.indexOf(e)},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);-1<t&&(n.splice(t,1),o.splice(t,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(r){if(r&&r.nodeName&&"TEXTAREA"===r.nodeName&&!p.has(r)){var e,n=null,o=null,i=null,d=function(){r.clientWidth!==o&&a()},l=function(t){window.removeEventListener("resize",d,!1),r.removeEventListener("input",a,!1),r.removeEventListener("keyup",a,!1),r.removeEventListener("autosize:destroy",l,!1),r.removeEventListener("autosize:update",a,!1),Object.keys(t).forEach(function(e){r.style[e]=t[e]}),p.delete(r)}.bind(r,{height:r.style.height,resize:r.style.resize,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",l,!1),"onpropertychange"in r&&"oninput"in r&&r.addEventListener("keyup",a,!1),window.addEventListener("resize",d,!1),r.addEventListener("input",a,!1),r.addEventListener("autosize:update",a,!1),r.style.overflowX="hidden",r.style.wordWrap="break-word",p.set(r,{destroy:l,update:a}),"vertical"===(e=window.getComputedStyle(r,null)).resize?r.style.resize="none":"both"===e.resize&&(r.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),a()}function s(e){var t=r.style.width;r.style.width="0px",r.offsetWidth,r.style.width=t,r.style.overflowY=e}function u(){if(0!==r.scrollHeight){var e=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(r),t=document.documentElement&&document.documentElement.scrollTop;r.style.height="",r.style.height=r.scrollHeight+n+"px",o=r.clientWidth,e.forEach(function(e){e.node.scrollTop=e.scrollTop}),t&&(document.documentElement.scrollTop=t)}}function a(){u();var e=Math.round(parseFloat(r.style.height)),t=window.getComputedStyle(r,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):r.offsetHeight;if(n<e?"hidden"===t.overflowY&&(s("scroll"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight):"hidden"!==t.overflowY&&(s("hidden"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight),i!==n){i=n;var o=c("autosize:resized");try{r.dispatchEvent(o)}catch(e){}}}}function i(e){var t=p.get(e);t&&t.destroy()}function d(e){var t=p.get(e);t&&t.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return r(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],d),e}),t.default=l,e.exports=t.default});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* jquery.base64.js 0.1 - https://github.com/yckart/jquery.base64.js
|
||||
* Makes Base64 en & -decoding simpler as it is.
|
||||
*
|
||||
* Based upon: https://gist.github.com/Yaffle/1284012
|
||||
*
|
||||
* Copyright (c) 2012 Yannick Albert (http://yckart.com)
|
||||
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
|
||||
* 2013/02/10
|
||||
**/
|
||||
;(function($) {
|
||||
|
||||
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
||||
a256 = '',
|
||||
r64 = [256],
|
||||
r256 = [256],
|
||||
i = 0;
|
||||
|
||||
var UTF8 = {
|
||||
|
||||
/**
|
||||
* Encode multi-byte Unicode string into utf-8 multiple single-byte characters
|
||||
* (BMP / basic multilingual plane only)
|
||||
*
|
||||
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
|
||||
*
|
||||
* @param {String} strUni Unicode string to be encoded as UTF-8
|
||||
* @returns {String} encoded string
|
||||
*/
|
||||
encode: function(strUni) {
|
||||
// use regular expressions & String.replace callback function for better efficiency
|
||||
// than procedural approaches
|
||||
var strUtf = strUni.replace(/[\u0080-\u07ff]/g, // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
|
||||
function(c) {
|
||||
var cc = c.charCodeAt(0);
|
||||
return String.fromCharCode(0xc0 | cc >> 6, 0x80 | cc & 0x3f);
|
||||
})
|
||||
.replace(/[\u0800-\uffff]/g, // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
|
||||
function(c) {
|
||||
var cc = c.charCodeAt(0);
|
||||
return String.fromCharCode(0xe0 | cc >> 12, 0x80 | cc >> 6 & 0x3F, 0x80 | cc & 0x3f);
|
||||
});
|
||||
return strUtf;
|
||||
},
|
||||
|
||||
/**
|
||||
* Decode utf-8 encoded string back into multi-byte Unicode characters
|
||||
*
|
||||
* @param {String} strUtf UTF-8 string to be decoded back to Unicode
|
||||
* @returns {String} decoded string
|
||||
*/
|
||||
decode: function(strUtf) {
|
||||
// note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!
|
||||
var strUni = strUtf.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, // 3-byte chars
|
||||
function(c) { // (note parentheses for precence)
|
||||
var cc = ((c.charCodeAt(0) & 0x0f) << 12) | ((c.charCodeAt(1) & 0x3f) << 6) | (c.charCodeAt(2) & 0x3f);
|
||||
return String.fromCharCode(cc);
|
||||
})
|
||||
.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g, // 2-byte chars
|
||||
function(c) { // (note parentheses for precence)
|
||||
var cc = (c.charCodeAt(0) & 0x1f) << 6 | c.charCodeAt(1) & 0x3f;
|
||||
return String.fromCharCode(cc);
|
||||
});
|
||||
return strUni;
|
||||
}
|
||||
};
|
||||
|
||||
while(i < 256) {
|
||||
var c = String.fromCharCode(i);
|
||||
a256 += c;
|
||||
r256[i] = i;
|
||||
r64[i] = b64.indexOf(c);
|
||||
++i;
|
||||
}
|
||||
|
||||
function code(s, discard, alpha, beta, w1, w2) {
|
||||
s = String(s);
|
||||
var buffer = 0,
|
||||
i = 0,
|
||||
length = s.length,
|
||||
result = '',
|
||||
bitsInBuffer = 0;
|
||||
|
||||
while(i < length) {
|
||||
var c = s.charCodeAt(i);
|
||||
c = c < 256 ? alpha[c] : -1;
|
||||
|
||||
buffer = (buffer << w1) + c;
|
||||
bitsInBuffer += w1;
|
||||
|
||||
while(bitsInBuffer >= w2) {
|
||||
bitsInBuffer -= w2;
|
||||
var tmp = buffer >> bitsInBuffer;
|
||||
result += beta.charAt(tmp);
|
||||
buffer ^= tmp << bitsInBuffer;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
if(!discard && bitsInBuffer > 0) result += beta.charAt(buffer << (w2 - bitsInBuffer));
|
||||
return result;
|
||||
}
|
||||
|
||||
var Plugin = $.base64 = function(dir, input, encode) {
|
||||
return input ? Plugin[dir](input, encode) : dir ? null : this;
|
||||
};
|
||||
|
||||
Plugin.btoa = Plugin.encode = function(plain, utf8encode) {
|
||||
plain = Plugin.raw === false || Plugin.utf8encode || utf8encode ? UTF8.encode(plain) : plain;
|
||||
plain = code(plain, false, r256, b64, 8, 6);
|
||||
return plain + '===='.slice((plain.length % 4) || 4);
|
||||
};
|
||||
|
||||
Plugin.atob = Plugin.decode = function(coded, utf8decode) {
|
||||
coded = String(coded).split('=');
|
||||
var i = coded.length;
|
||||
do {--i;
|
||||
coded[i] = code(coded[i], true, r64, a256, 6, 8);
|
||||
} while (i > 0);
|
||||
coded = coded.join('');
|
||||
return Plugin.raw === false || Plugin.utf8decode || utf8decode ? UTF8.decode(coded) : coded;
|
||||
};
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,181 @@
|
||||
/*!
|
||||
Copyright 2008-2020 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license
|
||||
|
||||
This source file 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 license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net
|
||||
DataTables 1.10.21
|
||||
©2008-2020 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(f,y,w){f instanceof String&&(f=String(f));for(var n=f.length,H=0;H<n;H++){var L=f[H];if(y.call(w,L,H,f))return{i:H,v:L}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,y,w){f!=Array.prototype&&f!=Object.prototype&&(f[y]=w.value)};$jscomp.getGlobal=function(f){f=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,f];for(var y=0;y<f.length;++y){var w=f[y];if(w&&w.Math==Math)return w}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(f,y,w,n){if(y){w=$jscomp.global;f=f.split(".");for(n=0;n<f.length-1;n++){var H=f[n];H in w||(w[H]={});w=w[H]}f=f[f.length-1];n=w[f];y=y(n);y!=n&&null!=y&&$jscomp.defineProperty(w,f,{configurable:!0,writable:!0,value:y})}};$jscomp.polyfill("Array.prototype.find",function(f){return f?f:function(f,w){return $jscomp.findInternal(this,f,w).v}},"es6","es3");
|
||||
(function(f){"function"===typeof define&&define.amd?define(["jquery"],function(y){return f(y,window,document)}):"object"===typeof exports?module.exports=function(y,w){y||(y=window);w||(w="undefined"!==typeof window?require("jquery"):require("jquery")(y));return f(w,y,y.document)}:f(jQuery,window,document)})(function(f,y,w,n){function H(a){var b,c,d={};f.each(a,function(e,h){(b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" ")&&(c=e.replace(b[0],b[2].toLowerCase()),
|
||||
d[c]=e,"o"===b[1]&&H(a[e]))});a._hungarianMap=d}function L(a,b,c){a._hungarianMap||H(a);var d;f.each(b,function(e,h){d=a._hungarianMap[e];d===n||!c&&b[d]!==n||("o"===d.charAt(0)?(b[d]||(b[d]={}),f.extend(!0,b[d],b[e]),L(a[d],b[d],c)):b[d]=b[e])})}function Fa(a){var b=q.defaults.oLanguage,c=b.sDecimal;c&&Ga(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&d&&"No data available in table"===b.sEmptyTable&&M(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&d&&"Loading..."===b.sLoadingRecords&&M(a,a,
|
||||
"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&c!==a&&Ga(a)}}function ib(a){E(a,"ordering","bSort");E(a,"orderMulti","bSortMulti");E(a,"orderClasses","bSortClasses");E(a,"orderCellsTop","bSortCellsTop");E(a,"order","aaSorting");E(a,"orderFixed","aaSortingFixed");E(a,"paging","bPaginate");E(a,"pagingType","sPaginationType");E(a,"pageLength","iDisplayLength");E(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":
|
||||
"");"boolean"===typeof a.scrollX&&(a.scrollX=a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&L(q.models.oSearch,a[b])}function jb(a){E(a,"orderable","bSortable");E(a,"orderData","aDataSort");E(a,"orderSequence","asSorting");E(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"!==typeof b||f.isArray(b)||(a.aDataSort=[b])}function kb(a){if(!q.__browser){var b={};q.__browser=b;var c=f("<div/>").css({position:"fixed",top:0,left:-1*f(y).scrollLeft(),height:1,width:1,
|
||||
overflow:"hidden"}).append(f("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(f("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}f.extend(a.oBrowser,q.__browser);a.oScroll.iBarWidth=q.__browser.barWidth}
|
||||
function lb(a,b,c,d,e,h){var g=!1;if(c!==n){var k=c;g=!0}for(;d!==e;)a.hasOwnProperty(d)&&(k=g?b(k,a[d],d,a):a[d],g=!0,d+=h);return k}function Ha(a,b){var c=q.defaults.column,d=a.aoColumns.length;c=f.extend({},q.models.oColumn,c,{nTh:b?b:w.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=f.extend({},q.models.oSearch,c[d]);la(a,d,f(b).data())}function la(a,b,c){b=a.aoColumns[b];
|
||||
var d=a.oClasses,e=f(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var h=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);h&&(b.sWidthOrig=h[1])}c!==n&&null!==c&&(jb(c),L(q.defaults.column,c,!0),c.mDataProp===n||c.mData||(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),f.extend(b,c),M(b,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(b.aDataSort=[c.iDataSort]),M(b,c,"aDataSort"));var g=b.mData,k=T(g),
|
||||
l=b.mRender?T(b.mRender):null;c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=f.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=k(a,b,n,c);return l&&b?l(d,b,a,c):d};b.fnSetData=function(a,b,c){return Q(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==f.inArray("asc",b.asSorting);c=-1!==f.inArray("desc",b.asSorting);b.bSortable&&(a||c)?a&&!c?(b.sSortingClass=
|
||||
d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI):(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI="")}function Z(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ia(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;""===b.sY&&""===b.sX||ma(a);A(a,null,"column-sizing",[a])}function aa(a,b){a=na(a,"bVisible");return"number"===
|
||||
typeof a[b]?a[b]:null}function ba(a,b){a=na(a,"bVisible");b=f.inArray(b,a);return-1!==b?b:null}function V(a){var b=0;f.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==f(d.nTh).css("display")&&b++});return b}function na(a,b){var c=[];f.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ja(a){var b=a.aoColumns,c=a.aoData,d=q.ext.type.detect,e,h,g;var k=0;for(e=b.length;k<e;k++){var f=b[k];var m=[];if(!f.sType&&f._sManualType)f.sType=f._sManualType;else if(!f.sType){var p=0;for(h=
|
||||
d.length;p<h;p++){var v=0;for(g=c.length;v<g;v++){m[v]===n&&(m[v]=F(a,v,k,"type"));var u=d[p](m[v],a);if(!u&&p!==d.length-1)break;if("html"===u)break}if(u){f.sType=u;break}}f.sType||(f.sType="string")}}}function mb(a,b,c,d){var e,h,g,k=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){var l=b[e];var m=l.targets!==n?l.targets:l.aTargets;f.isArray(m)||(m=[m]);var p=0;for(h=m.length;p<h;p++)if("number"===typeof m[p]&&0<=m[p]){for(;k.length<=m[p];)Ha(a);d(m[p],l)}else if("number"===typeof m[p]&&0>m[p])d(k.length+
|
||||
m[p],l);else if("string"===typeof m[p]){var v=0;for(g=k.length;v<g;v++)("_all"==m[p]||f(k[v].nTh).hasClass(m[p]))&&d(v,l)}}if(c)for(e=0,a=c.length;e<a;e++)d(e,c[e])}function R(a,b,c,d){var e=a.aoData.length,h=f.extend(!0,{},q.models.oRow,{src:c?"dom":"data",idx:e});h._aData=b;a.aoData.push(h);for(var g=a.aoColumns,k=0,l=g.length;k<l;k++)g[k].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==n&&(a.aIds[b]=h);!c&&a.oFeatures.bDeferRender||Ka(a,e,c,d);return e}function oa(a,b){var c;b instanceof
|
||||
f||(b=f(b));return b.map(function(b,e){c=La(a,e);return R(a,c.data,e,c.cells)})}function F(a,b,c,d){var e=a.iDraw,h=a.aoColumns[c],g=a.aoData[b]._aData,k=h.sDefaultContent,f=h.fnGetData(g,d,{settings:a,row:b,col:c});if(f===n)return a.iDrawError!=e&&null===k&&(O(a,0,"Requested unknown parameter "+("function"==typeof h.mData?"{function}":"'"+h.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),k;if((f===g||null===f)&&null!==k&&d!==n)f=k;else if("function"===typeof f)return f.call(g);return null===
|
||||
f&&"display"==d?"":f}function nb(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}function Ma(a){return f.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\\./g,".")})}function T(a){if(f.isPlainObject(a)){var b={};f.each(a,function(a,c){c&&(b[a]=T(c))});return function(a,c,h,g){var d=b[c]||b._;return d!==n?d(a,c,h,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,h,g){return a(b,c,h,g)};if("string"!==typeof a||
|
||||
-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(b,c){return b[a]};var c=function(a,b,h){if(""!==h){var d=Ma(h);for(var e=0,l=d.length;e<l;e++){h=d[e].match(ca);var m=d[e].match(W);if(h){d[e]=d[e].replace(ca,"");""!==d[e]&&(a=a[d[e]]);m=[];d.splice(0,e+1);d=d.join(".");if(f.isArray(a))for(e=0,l=a.length;e<l;e++)m.push(c(a[e],b,d));a=h[0].substring(1,h[0].length-1);a=""===a?m:m.join(a);break}else if(m){d[e]=d[e].replace(W,"");a=a[d[e]]();continue}if(null===a||a[d[e]]===
|
||||
n)return n;a=a[d[e]]}}return a};return function(b,e){return c(b,e,a)}}function Q(a){if(f.isPlainObject(a))return Q(a._);if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"!==typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(b,d){b[a]=d};var b=function(a,d,e){e=Ma(e);var c=e[e.length-1];for(var g,k,l=0,m=e.length-1;l<m;l++){g=e[l].match(ca);k=e[l].match(W);if(g){e[l]=e[l].replace(ca,"");a[e[l]]=[];c=e.slice();
|
||||
c.splice(0,l+1);g=c.join(".");if(f.isArray(d))for(k=0,m=d.length;k<m;k++)c={},b(c,d[k],g),a[e[l]].push(c);else a[e[l]]=d;return}k&&(e[l]=e[l].replace(W,""),a=a[e[l]](d));if(null===a[e[l]]||a[e[l]]===n)a[e[l]]={};a=a[e[l]]}if(c.match(W))a[c.replace(W,"")](d);else a[c.replace(ca,"")]=d};return function(c,d){return b(c,d,a)}}function Na(a){return K(a.aoData,"_aData")}function pa(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function qa(a,b,c){for(var d=-1,e=0,h=a.length;e<
|
||||
h;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===n&&a.splice(d,1)}function da(a,b,c,d){var e=a.aoData[b],h,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);c.innerHTML=F(a,b,d,"display")};if("dom"!==c&&(c&&"auto"!==c||"dom"!==e.src)){var k=e.anCells;if(k)if(d!==n)g(k[d],d);else for(c=0,h=k.length;c<h;c++)g(k[c],c)}else e._aData=La(a,e,d,d===n?n:e._aData).data;e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==n)g[d].sType=null;else{c=0;for(h=g.length;c<h;c++)g[c].sType=null;
|
||||
Oa(a,e)}}function La(a,b,c,d){var e=[],h=b.firstChild,g,k=0,l,m=a.aoColumns,p=a._rowReadObject;d=d!==n?d:p?{}:[];var v=function(a,b){if("string"===typeof a){var c=a.indexOf("@");-1!==c&&(c=a.substring(c+1),Q(a)(d,b.getAttribute(c)))}},u=function(a){if(c===n||c===k)g=m[k],l=f.trim(a.innerHTML),g&&g._bAttrSrc?(Q(g.mData._)(d,l),v(g.mData.sort,a),v(g.mData.type,a),v(g.mData.filter,a)):p?(g._setter||(g._setter=Q(g.mData)),g._setter(d,l)):d[k]=l;k++};if(h)for(;h;){var q=h.nodeName.toUpperCase();if("TD"==
|
||||
q||"TH"==q)u(h),e.push(h);h=h.nextSibling}else for(e=b.anCells,h=0,q=e.length;h<q;h++)u(e[h]);(b=b.firstChild?b:b.nTr)&&(b=b.getAttribute("id"))&&Q(a.rowId)(d,b);return{data:d,cells:e}}function Ka(a,b,c,d){var e=a.aoData[b],h=e._aData,g=[],k,l;if(null===e.nTr){var m=c||w.createElement("tr");e.nTr=m;e.anCells=g;m._DT_RowIndex=b;Oa(a,e);var p=0;for(k=a.aoColumns.length;p<k;p++){var v=a.aoColumns[p];var n=(l=c?!1:!0)?w.createElement(v.sCellType):d[p];n._DT_CellIndex={row:b,column:p};g.push(n);if(l||
|
||||
!(c&&!v.mRender&&v.mData===p||f.isPlainObject(v.mData)&&v.mData._===p+".display"))n.innerHTML=F(a,b,p,"display");v.sClass&&(n.className+=" "+v.sClass);v.bVisible&&!c?m.appendChild(n):!v.bVisible&&c&&n.parentNode.removeChild(n);v.fnCreatedCell&&v.fnCreatedCell.call(a.oInstance,n,F(a,b,p),h,b,p)}A(a,"aoRowCreatedCallback",null,[m,h,b,g])}e.nTr.setAttribute("role","row")}function Oa(a,b){var c=b.nTr,d=b._aData;if(c){if(a=a.rowIdFn(d))c.id=a;d.DT_RowClass&&(a=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?
|
||||
sa(b.__rowc.concat(a)):a,f(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&f(c).attr(d.DT_RowAttr);d.DT_RowData&&f(c).data(d.DT_RowData)}}function ob(a){var b,c,d=a.nTHead,e=a.nTFoot,h=0===f("th, td",d).length,g=a.oClasses,k=a.aoColumns;h&&(c=f("<tr/>").appendTo(d));var l=0;for(b=k.length;l<b;l++){var m=k[l];var p=f(m.nTh).addClass(m.sClass);h&&p.appendTo(c);a.oFeatures.bSort&&(p.addClass(m.sSortingClass),!1!==m.bSortable&&(p.attr("tabindex",a.iTabIndex).attr("aria-controls",
|
||||
a.sTableId),Pa(a,m.nTh,l)));m.sTitle!=p[0].innerHTML&&p.html(m.sTitle);Qa(a,"header")(a,p,m,g)}h&&ea(a.aoHeader,d);f(d).find(">tr").attr("role","row");f(d).find(">tr>th, >tr>td").addClass(g.sHeaderTH);f(e).find(">tr>th, >tr>td").addClass(g.sFooterTH);if(null!==e)for(a=a.aoFooter[0],l=0,b=a.length;l<b;l++)m=k[l],m.nTf=a[l].cell,m.sClass&&f(m.nTf).addClass(m.sClass)}function fa(a,b,c){var d,e,h=[],g=[],k=a.aoColumns.length;if(b){c===n&&(c=!1);var l=0;for(d=b.length;l<d;l++){h[l]=b[l].slice();h[l].nTr=
|
||||
b[l].nTr;for(e=k-1;0<=e;e--)a.aoColumns[e].bVisible||c||h[l].splice(e,1);g.push([])}l=0;for(d=h.length;l<d;l++){if(a=h[l].nTr)for(;e=a.firstChild;)a.removeChild(e);e=0;for(b=h[l].length;e<b;e++){var m=k=1;if(g[l][e]===n){a.appendChild(h[l][e].cell);for(g[l][e]=1;h[l+k]!==n&&h[l][e].cell==h[l+k][e].cell;)g[l+k][e]=1,k++;for(;h[l][e+m]!==n&&h[l][e].cell==h[l][e+m].cell;){for(c=0;c<k;c++)g[l+c][e+m]=1;m++}f(h[l][e].cell).attr("rowspan",k).attr("colspan",m)}}}}}function S(a){var b=A(a,"aoPreDrawCallback",
|
||||
"preDraw",[a]);if(-1!==f.inArray(!1,b))J(a,!1);else{b=[];var c=0,d=a.asStripeClasses,e=d.length,h=a.oLanguage,g=a.iInitDisplayStart,k="ssp"==I(a),l=a.aiDisplay;a.bDrawing=!0;g!==n&&-1!==g&&(a._iDisplayStart=k?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);g=a._iDisplayStart;var m=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,J(a,!1);else if(!k)a.iDraw++;else if(!a.bDestroying&&!pb(a))return;if(0!==l.length)for(h=k?a.aoData.length:m,k=k?0:g;k<h;k++){var p=l[k],v=a.aoData[p];
|
||||
null===v.nTr&&Ka(a,p);var u=v.nTr;if(0!==e){var q=d[c%e];v._sRowStripe!=q&&(f(u).removeClass(v._sRowStripe).addClass(q),v._sRowStripe=q)}A(a,"aoRowCallback",null,[u,v._aData,c,k,p]);b.push(u);c++}else c=h.sZeroRecords,1==a.iDraw&&"ajax"==I(a)?c=h.sLoadingRecords:h.sEmptyTable&&0===a.fnRecordsTotal()&&(c=h.sEmptyTable),b[0]=f("<tr/>",{"class":e?d[0]:""}).append(f("<td />",{valign:"top",colSpan:V(a),"class":a.oClasses.sRowEmpty}).html(c))[0];A(a,"aoHeaderCallback","header",[f(a.nTHead).children("tr")[0],
|
||||
Na(a),g,m,l]);A(a,"aoFooterCallback","footer",[f(a.nTFoot).children("tr")[0],Na(a),g,m,l]);d=f(a.nTBody);d.children().detach();d.append(f(b));A(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function U(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&qb(a);d?ha(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;S(a);a._drawHold=!1}function rb(a){var b=a.oClasses,c=f(a.nTable);c=f("<div/>").insertBefore(c);var d=a.oFeatures,e=
|
||||
f("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var h=a.sDom.split(""),g,k,l,m,p,n,u=0;u<h.length;u++){g=null;k=h[u];if("<"==k){l=f("<div/>")[0];m=h[u+1];if("'"==m||'"'==m){p="";for(n=2;h[u+n]!=m;)p+=h[u+n],n++;"H"==p?p=b.sJUIHeader:"F"==p&&(p=b.sJUIFooter);-1!=p.indexOf(".")?(m=p.split("."),l.id=m[0].substr(1,m[0].length-1),l.className=m[1]):"#"==p.charAt(0)?l.id=p.substr(1,
|
||||
p.length-1):l.className=p;u+=n}e.append(l);e=f(l)}else if(">"==k)e=e.parent();else if("l"==k&&d.bPaginate&&d.bLengthChange)g=sb(a);else if("f"==k&&d.bFilter)g=tb(a);else if("r"==k&&d.bProcessing)g=ub(a);else if("t"==k)g=vb(a);else if("i"==k&&d.bInfo)g=wb(a);else if("p"==k&&d.bPaginate)g=xb(a);else if(0!==q.ext.feature.length)for(l=q.ext.feature,n=0,m=l.length;n<m;n++)if(k==l[n].cFeature){g=l[n].fnInit(a);break}g&&(l=a.aanFeatures,l[k]||(l[k]=[]),l[k].push(g),e.append(g))}c.replaceWith(e);a.nHolding=
|
||||
null}function ea(a,b){b=f(b).children("tr");var c,d,e;a.splice(0,a.length);var h=0;for(e=b.length;h<e;h++)a.push([]);h=0;for(e=b.length;h<e;h++){var g=b[h];for(c=g.firstChild;c;){if("TD"==c.nodeName.toUpperCase()||"TH"==c.nodeName.toUpperCase()){var k=1*c.getAttribute("colspan");var l=1*c.getAttribute("rowspan");k=k&&0!==k&&1!==k?k:1;l=l&&0!==l&&1!==l?l:1;var m=0;for(d=a[h];d[m];)m++;var p=m;var n=1===k?!0:!1;for(d=0;d<k;d++)for(m=0;m<l;m++)a[h+m][p+d]={cell:c,unique:n},a[h+m].nTr=g}c=c.nextSibling}}}
|
||||
function ta(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],ea(c,b)));b=0;for(var e=c.length;b<e;b++)for(var h=0,g=c[b].length;h<g;h++)!c[b][h].unique||d[h]&&a.bSortCellsTop||(d[h]=c[b][h].cell);return d}function ua(a,b,c){A(a,"aoServerParams","serverParams",[b]);if(b&&f.isArray(b)){var d={},e=/(.*?)\[\]$/;f.each(b,function(a,b){(a=b.name.match(e))?(a=a[0],d[a]||(d[a]=[]),d[a].push(b.value)):d[b.name]=b.value});b=d}var h=a.ajax,g=a.oInstance,k=function(b){A(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(f.isPlainObject(h)&&
|
||||
h.data){var l=h.data;var m="function"===typeof l?l(b,a):l;b="function"===typeof l&&m?m:f.extend(!0,b,m);delete h.data}m={data:b,success:function(b){var c=b.error||b.sError;c&&O(a,0,c);a.json=b;k(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c,d){d=A(a,null,"xhr",[a,null,a.jqXHR]);-1===f.inArray(!0,d)&&("parsererror"==c?O(a,0,"Invalid JSON response",1):4===b.readyState&&O(a,0,"Ajax error",7));J(a,!1)}};a.oAjaxData=b;A(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(g,
|
||||
a.sAjaxSource,f.map(b,function(a,b){return{name:b,value:a}}),k,a):a.sAjaxSource||"string"===typeof h?a.jqXHR=f.ajax(f.extend(m,{url:h||a.sAjaxSource})):"function"===typeof h?a.jqXHR=h.call(g,b,k,a):(a.jqXHR=f.ajax(f.extend(m,h)),h.data=l)}function pb(a){return a.bAjaxDataGet?(a.iDraw++,J(a,!0),ua(a,yb(a),function(b){zb(a,b)}),!1):!0}function yb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,h=a.aoPreSearchCols,g=[],k=X(a);var l=a._iDisplayStart;var m=!1!==d.bPaginate?a._iDisplayLength:
|
||||
-1;var p=function(a,b){g.push({name:a,value:b})};p("sEcho",a.iDraw);p("iColumns",c);p("sColumns",K(b,"sName").join(","));p("iDisplayStart",l);p("iDisplayLength",m);var n={draw:a.iDraw,columns:[],order:[],start:l,length:m,search:{value:e.sSearch,regex:e.bRegex}};for(l=0;l<c;l++){var u=b[l];var ra=h[l];m="function"==typeof u.mData?"function":u.mData;n.columns.push({data:m,name:u.sName,searchable:u.bSearchable,orderable:u.bSortable,search:{value:ra.sSearch,regex:ra.bRegex}});p("mDataProp_"+l,m);d.bFilter&&
|
||||
(p("sSearch_"+l,ra.sSearch),p("bRegex_"+l,ra.bRegex),p("bSearchable_"+l,u.bSearchable));d.bSort&&p("bSortable_"+l,u.bSortable)}d.bFilter&&(p("sSearch",e.sSearch),p("bRegex",e.bRegex));d.bSort&&(f.each(k,function(a,b){n.order.push({column:b.col,dir:b.dir});p("iSortCol_"+a,b.col);p("sSortDir_"+a,b.dir)}),p("iSortingCols",k.length));b=q.ext.legacy.ajax;return null===b?a.sAjaxSource?g:n:b?g:n}function zb(a,b){var c=function(a,c){return b[a]!==n?b[a]:b[c]},d=va(a,b),e=c("sEcho","draw"),h=c("iTotalRecords",
|
||||
"recordsTotal");c=c("iTotalDisplayRecords","recordsFiltered");if(e!==n){if(1*e<a.iDraw)return;a.iDraw=1*e}pa(a);a._iRecordsTotal=parseInt(h,10);a._iRecordsDisplay=parseInt(c,10);e=0;for(h=d.length;e<h;e++)R(a,d[e]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;S(a);a._bInitComplete||wa(a,b);a.bAjaxDataGet=!0;J(a,!1)}function va(a,b){a=f.isPlainObject(a.ajax)&&a.ajax.dataSrc!==n?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===a?b.aaData||b[a]:""!==a?T(a)(b):b}function tb(a){var b=a.oClasses,
|
||||
c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,h=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',k=d.sSearch;k=k.match(/_INPUT_/)?k.replace("_INPUT_",g):k+g;b=f("<div/>",{id:h.f?null:c+"_filter","class":b.sFilter}).append(f("<label/>").append(k));var l=function(){var b=this.value?this.value:"";b!=e.sSearch&&(ha(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,S(a))};h=null!==a.searchDelay?a.searchDelay:"ssp"===I(a)?400:0;var m=
|
||||
f("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",h?Ra(l,h):l).on("mouseup",function(a){setTimeout(function(){l.call(m[0])},10)}).on("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);f(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{m[0]!==w.activeElement&&m.val(e.sSearch)}catch(u){}});return b[0]}function ha(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,h=function(a){d.sSearch=a.sSearch;d.bRegex=
|
||||
a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive},g=function(a){return a.bEscapeRegex!==n?!a.bEscapeRegex:a.bRegex};Ja(a);if("ssp"!=I(a)){Ab(a,b.sSearch,c,g(b),b.bSmart,b.bCaseInsensitive);h(b);for(b=0;b<e.length;b++)Bb(a,e[b].sSearch,b,g(e[b]),e[b].bSmart,e[b].bCaseInsensitive);Cb(a)}else h(b);a.bFiltered=!0;A(a,null,"search",[a])}function Cb(a){for(var b=q.ext.search,c=a.aiDisplay,d,e,h=0,g=b.length;h<g;h++){for(var k=[],l=0,m=c.length;l<m;l++)e=c[l],d=a.aoData[e],b[h](a,d._aFilterData,
|
||||
e,d._aData,l)&&k.push(e);c.length=0;f.merge(c,k)}}function Bb(a,b,c,d,e,h){if(""!==b){var g=[],k=a.aiDisplay;d=Sa(b,d,e,h);for(e=0;e<k.length;e++)b=a.aoData[k[e]]._aFilterData[c],d.test(b)&&g.push(k[e]);a.aiDisplay=g}}function Ab(a,b,c,d,e,h){e=Sa(b,d,e,h);var g=a.oPreviousSearch.sSearch,k=a.aiDisplayMaster;h=[];0!==q.ext.search.length&&(c=!0);var f=Db(a);if(0>=b.length)a.aiDisplay=k.slice();else{if(f||c||d||g.length>b.length||0!==b.indexOf(g)||a.bSorted)a.aiDisplay=k.slice();b=a.aiDisplay;for(c=
|
||||
0;c<b.length;c++)e.test(a.aoData[b[c]]._sFilterRow)&&h.push(b[c]);a.aiDisplay=h}}function Sa(a,b,c,d){a=b?a:Ta(a);c&&(a="^(?=.*?"+f.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0)){var b=a.match(/^"(.*)"$/);a=b?b[1]:a}return a.replace('"',"")}).join(")(?=.*?")+").*$");return new RegExp(a,d?"i":"")}function Db(a){var b=a.aoColumns,c,d,e=q.ext.type.search;var h=!1;var g=0;for(c=a.aoData.length;g<c;g++){var k=a.aoData[g];if(!k._aFilterData){var f=[];var m=0;for(d=b.length;m<d;m++){h=
|
||||
b[m];if(h.bSearchable){var p=F(a,g,m,"filter");e[h.sType]&&(p=e[h.sType](p));null===p&&(p="");"string"!==typeof p&&p.toString&&(p=p.toString())}else p="";p.indexOf&&-1!==p.indexOf("&")&&(xa.innerHTML=p,p=$b?xa.textContent:xa.innerText);p.replace&&(p=p.replace(/[\r\n\u2028]/g,""));f.push(p)}k._aFilterData=f;k._sFilterRow=f.join(" ");h=!0}}return h}function Eb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Fb(a){return{sSearch:a.search,bSmart:a.smart,
|
||||
bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function wb(a){var b=a.sTableId,c=a.aanFeatures.i,d=f("<div/>",{"class":a.oClasses.sInfo,id:c?null:b+"_info"});c||(a.aoDrawCallback.push({fn:Gb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),f(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Gb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),h=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),k=g?c.sInfo:c.sInfoEmpty;
|
||||
g!==h&&(k+=" "+c.sInfoFiltered);k+=c.sInfoPostFix;k=Hb(a,k);c=c.fnInfoCallback;null!==c&&(k=c.call(a.oInstance,a,d,e,h,g,k));f(b).html(k)}}function Hb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,h=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,h)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(h/
|
||||
e)))}function ia(a){var b=a.iInitDisplayStart,c=a.aoColumns;var d=a.oFeatures;var e=a.bDeferLoading;if(a.bInitialised){rb(a);ob(a);fa(a,a.aoHeader);fa(a,a.aoFooter);J(a,!0);d.bAutoWidth&&Ia(a);var h=0;for(d=c.length;h<d;h++){var g=c[h];g.sWidth&&(g.nTh.style.width=B(g.sWidth))}A(a,null,"preInit",[a]);U(a);c=I(a);if("ssp"!=c||e)"ajax"==c?ua(a,[],function(c){var d=va(a,c);for(h=0;h<d.length;h++)R(a,d[h]);a.iInitDisplayStart=b;U(a);J(a,!1);wa(a,c)},a):(J(a,!1),wa(a))}else setTimeout(function(){ia(a)},
|
||||
200)}function wa(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&Z(a);A(a,null,"plugin-init",[a,b]);A(a,"aoInitComplete","init",[a,b])}function Ua(a,b){b=parseInt(b,10);a._iDisplayLength=b;Va(a);A(a,null,"length",[a,b])}function sb(a){var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=f.isArray(d[0]),h=e?d[0]:d;d=e?d[1]:d;e=f("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect});for(var g=0,k=h.length;g<k;g++)e[0][g]=new Option("number"===typeof d[g]?a.fnFormatNumber(d[g]):d[g],h[g]);
|
||||
var l=f("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(l[0].id=c+"_length");l.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));f("select",l).val(a._iDisplayLength).on("change.DT",function(b){Ua(a,f(this).val());S(a)});f(a.nTable).on("length.dt.DT",function(b,c,d){a===c&&f("select",l).val(d)});return l[0]}function xb(a){var b=a.sPaginationType,c=q.ext.pager[b],d="function"===typeof c,e=function(a){S(a)};b=f("<div/>").addClass(a.oClasses.sPaging+b)[0];var h=
|
||||
a.aanFeatures;d||c.fnInit(a,b,e);h.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,g=a._iDisplayLength,f=a.fnRecordsDisplay(),p=-1===g;b=p?0:Math.ceil(b/g);g=p?1:Math.ceil(f/g);f=c(b,g);var n;p=0;for(n=h.p.length;p<n;p++)Qa(a,"pageButton")(a,h.p[p],p,f,b,g)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Wa(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,h=a.fnRecordsDisplay();0===h||-1===e?d=0:"number"===typeof b?(d=b*e,d>h&&(d=0)):
|
||||
"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<h&&(d+=e):"last"==b?d=Math.floor((h-1)/e)*e:O(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(A(a,null,"page",[a]),c&&S(a));return b}function ub(a){return f("<div/>",{id:a.aanFeatures.r?null:a.sTableId+"_processing","class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function J(a,b){a.oFeatures.bProcessing&&f(a.aanFeatures.r).css("display",b?"block":"none");A(a,
|
||||
null,"processing",[a,b])}function vb(a){var b=f(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,h=a.oClasses,g=b.children("caption"),k=g.length?g[0]._captionSide:null,l=f(b[0].cloneNode(!1)),m=f(b[0].cloneNode(!1)),p=b.children("tfoot");p.length||(p=null);l=f("<div/>",{"class":h.sScrollWrapper}).append(f("<div/>",{"class":h.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?d?B(d):null:"100%"}).append(f("<div/>",{"class":h.sScrollHeadInner}).css({"box-sizing":"content-box",
|
||||
width:c.sXInner||"100%"}).append(l.removeAttr("id").css("margin-left",0).append("top"===k?g:null).append(b.children("thead"))))).append(f("<div/>",{"class":h.sScrollBody}).css({position:"relative",overflow:"auto",width:d?B(d):null}).append(b));p&&l.append(f("<div/>",{"class":h.sScrollFoot}).css({overflow:"hidden",border:0,width:d?d?B(d):null:"100%"}).append(f("<div/>",{"class":h.sScrollFootInner}).append(m.removeAttr("id").css("margin-left",0).append("bottom"===k?g:null).append(b.children("tfoot")))));
|
||||
b=l.children();var n=b[0];h=b[1];var u=p?b[2]:null;if(d)f(h).on("scroll.DT",function(a){a=this.scrollLeft;n.scrollLeft=a;p&&(u.scrollLeft=a)});f(h).css("max-height",e);c.bCollapse||f(h).css("height",e);a.nScrollHead=n;a.nScrollBody=h;a.nScrollFoot=u;a.aoDrawCallback.push({fn:ma,sName:"scrolling"});return l[0]}function ma(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY;b=b.iBarWidth;var h=f(a.nScrollHead),g=h[0].style,k=h.children("div"),l=k[0].style,m=k.children("table");k=a.nScrollBody;var p=f(k),v=
|
||||
k.style,u=f(a.nScrollFoot).children("div"),q=u.children("table"),t=f(a.nTHead),r=f(a.nTable),x=r[0],ya=x.style,w=a.nTFoot?f(a.nTFoot):null,y=a.oBrowser,A=y.bScrollOversize,ac=K(a.aoColumns,"nTh"),Xa=[],z=[],C=[],G=[],H,I=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};var D=k.scrollHeight>k.clientHeight;if(a.scrollBarVis!==D&&a.scrollBarVis!==n)a.scrollBarVis=D,Z(a);else{a.scrollBarVis=D;r.children("thead, tfoot").remove();if(w){var E=
|
||||
w.clone().prependTo(r);var F=w.find("tr");E=E.find("tr")}var J=t.clone().prependTo(r);t=t.find("tr");D=J.find("tr");J.find("th, td").removeAttr("tabindex");c||(v.width="100%",h[0].style.width="100%");f.each(ta(a,J),function(b,c){H=aa(a,b);c.style.width=a.aoColumns[H].sWidth});w&&N(function(a){a.style.width=""},E);h=r.outerWidth();""===c?(ya.width="100%",A&&(r.find("tbody").height()>k.offsetHeight||"scroll"==p.css("overflow-y"))&&(ya.width=B(r.outerWidth()-b)),h=r.outerWidth()):""!==d&&(ya.width=B(d),
|
||||
h=r.outerWidth());N(I,D);N(function(a){C.push(a.innerHTML);Xa.push(B(f(a).css("width")))},D);N(function(a,b){-1!==f.inArray(a,ac)&&(a.style.width=Xa[b])},t);f(D).height(0);w&&(N(I,E),N(function(a){G.push(a.innerHTML);z.push(B(f(a).css("width")))},E),N(function(a,b){a.style.width=z[b]},F),f(E).height(0));N(function(a,b){a.innerHTML='<div class="dataTables_sizing">'+C[b]+"</div>";a.childNodes[0].style.height="0";a.childNodes[0].style.overflow="hidden";a.style.width=Xa[b]},D);w&&N(function(a,b){a.innerHTML=
|
||||
'<div class="dataTables_sizing">'+G[b]+"</div>";a.childNodes[0].style.height="0";a.childNodes[0].style.overflow="hidden";a.style.width=z[b]},E);r.outerWidth()<h?(F=k.scrollHeight>k.offsetHeight||"scroll"==p.css("overflow-y")?h+b:h,A&&(k.scrollHeight>k.offsetHeight||"scroll"==p.css("overflow-y"))&&(ya.width=B(F-b)),""!==c&&""===d||O(a,1,"Possible column misalignment",6)):F="100%";v.width=B(F);g.width=B(F);w&&(a.nScrollFoot.style.width=B(F));!e&&A&&(v.height=B(x.offsetHeight+b));c=r.outerWidth();m[0].style.width=
|
||||
B(c);l.width=B(c);d=r.height()>k.clientHeight||"scroll"==p.css("overflow-y");e="padding"+(y.bScrollbarLeft?"Left":"Right");l[e]=d?b+"px":"0px";w&&(q[0].style.width=B(c),u[0].style.width=B(c),u[0].style[e]=d?b+"px":"0px");r.children("colgroup").insertBefore(r.children("thead"));p.trigger("scroll");!a.bSorted&&!a.bFiltered||a._drawHold||(k.scrollTop=0)}}function N(a,b,c){for(var d=0,e=0,h=b.length,g,k;e<h;){g=b[e].firstChild;for(k=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,k,d):a(g,d),d++),g=
|
||||
g.nextSibling,k=c?k.nextSibling:null;e++}}function Ia(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,h=d.sX,g=d.sXInner,k=c.length,l=na(a,"bVisible"),m=f("th",a.nTHead),p=b.getAttribute("width"),n=b.parentNode,u=!1,q,t=a.oBrowser;d=t.bScrollOversize;(q=b.style.width)&&-1!==q.indexOf("%")&&(p=q);for(q=0;q<l.length;q++){var r=c[l[q]];null!==r.sWidth&&(r.sWidth=Ib(r.sWidthOrig,n),u=!0)}if(d||!u&&!h&&!e&&k==V(a)&&k==m.length)for(q=0;q<k;q++)l=aa(a,q),null!==l&&(c[l].sWidth=B(m.eq(q).width()));else{k=
|
||||
f(b).clone().css("visibility","hidden").removeAttr("id");k.find("tbody tr").remove();var w=f("<tr/>").appendTo(k.find("tbody"));k.find("thead, tfoot").remove();k.append(f(a.nTHead).clone()).append(f(a.nTFoot).clone());k.find("tfoot th, tfoot td").css("width","");m=ta(a,k.find("thead")[0]);for(q=0;q<l.length;q++)r=c[l[q]],m[q].style.width=null!==r.sWidthOrig&&""!==r.sWidthOrig?B(r.sWidthOrig):"",r.sWidthOrig&&h&&f(m[q]).append(f("<div/>").css({width:r.sWidthOrig,margin:0,padding:0,border:0,height:1}));
|
||||
if(a.aoData.length)for(q=0;q<l.length;q++)u=l[q],r=c[u],f(Jb(a,u)).clone(!1).append(r.sContentPadding).appendTo(w);f("[name]",k).removeAttr("name");r=f("<div/>").css(h||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(k).appendTo(n);h&&g?k.width(g):h?(k.css("width","auto"),k.removeAttr("width"),k.width()<n.clientWidth&&p&&k.width(n.clientWidth)):e?k.width(n.clientWidth):p&&k.width(p);for(q=e=0;q<l.length;q++)n=f(m[q]),g=n.outerWidth()-n.width(),n=t.bBounding?Math.ceil(m[q].getBoundingClientRect().width):
|
||||
n.outerWidth(),e+=n,c[l[q]].sWidth=B(n-g);b.style.width=B(e);r.remove()}p&&(b.style.width=B(p));!p&&!h||a._reszEvt||(b=function(){f(y).on("resize.DT-"+a.sInstance,Ra(function(){Z(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0)}function Ib(a,b){if(!a)return 0;a=f("<div/>").css("width",B(a)).appendTo(b||w.body);b=a[0].offsetWidth;a.remove();return b}function Jb(a,b){var c=Kb(a,b);if(0>c)return null;var d=a.aoData[c];return d.nTr?d.anCells[b]:f("<td/>").html(F(a,c,b,"display"))[0]}function Kb(a,b){for(var c,
|
||||
d=-1,e=-1,h=0,g=a.aoData.length;h<g;h++)c=F(a,h,b,"display")+"",c=c.replace(bc,""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=h);return e}function B(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function X(a){var b=[],c=a.aoColumns;var d=a.aaSortingFixed;var e=f.isPlainObject(d);var h=[];var g=function(a){a.length&&!f.isArray(a[0])?h.push(a):f.merge(h,a)};f.isArray(d)&&g(d);e&&d.pre&&g(d.pre);g(a.aaSorting);e&&d.post&&g(d.post);for(a=0;a<h.length;a++){var k=
|
||||
h[a][0];g=c[k].aDataSort;d=0;for(e=g.length;d<e;d++){var l=g[d];var m=c[l].sType||"string";h[a]._idx===n&&(h[a]._idx=f.inArray(h[a][1],c[l].asSorting));b.push({src:k,col:l,dir:h[a][1],index:h[a]._idx,type:m,formatter:q.ext.type.order[m+"-pre"]})}}return b}function qb(a){var b,c=[],d=q.ext.type.order,e=a.aoData,h=0,g=a.aiDisplayMaster;Ja(a);var k=X(a);var f=0;for(b=k.length;f<b;f++){var m=k[f];m.formatter&&h++;Lb(a,m.col)}if("ssp"!=I(a)&&0!==k.length){f=0;for(b=g.length;f<b;f++)c[g[f]]=f;h===k.length?
|
||||
g.sort(function(a,b){var d,h=k.length,g=e[a]._aSortData,f=e[b]._aSortData;for(d=0;d<h;d++){var l=k[d];var m=g[l.col];var p=f[l.col];m=m<p?-1:m>p?1:0;if(0!==m)return"asc"===l.dir?m:-m}m=c[a];p=c[b];return m<p?-1:m>p?1:0}):g.sort(function(a,b){var h,g=k.length,f=e[a]._aSortData,l=e[b]._aSortData;for(h=0;h<g;h++){var m=k[h];var p=f[m.col];var n=l[m.col];m=d[m.type+"-"+m.dir]||d["string-"+m.dir];p=m(p,n);if(0!==p)return p}p=c[a];n=c[b];return p<n?-1:p>n?1:0})}a.bSorted=!0}function Mb(a){var b=a.aoColumns,
|
||||
c=X(a);a=a.oLanguage.oAria;for(var d=0,e=b.length;d<e;d++){var h=b[d];var g=h.asSorting;var k=h.sTitle.replace(/<.*?>/g,"");var f=h.nTh;f.removeAttribute("aria-sort");h.bSortable&&(0<c.length&&c[0].col==d?(f.setAttribute("aria-sort","asc"==c[0].dir?"ascending":"descending"),h=g[c[0].index+1]||g[0]):h=g[0],k+="asc"===h?a.sSortAscending:a.sSortDescending);f.setAttribute("aria-label",k)}}function Ya(a,b,c,d){var e=a.aaSorting,h=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===n&&(c=f.inArray(a[1],
|
||||
h));return c+1<h.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=f.inArray(b,K(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=h[b],e[c]._idx=b)):(e.push([b,h[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=h[b],e[0]._idx=b):(e.length=0,e.push([b,h[0]]),e[0]._idx=0);U(a);"function"==typeof d&&d(a)}function Pa(a,b,c,d){var e=a.aoColumns[c];Za(b,{},function(b){!1!==e.bSortable&&
|
||||
(a.oFeatures.bProcessing?(J(a,!0),setTimeout(function(){Ya(a,c,b.shiftKey,d);"ssp"!==I(a)&&J(a,!1)},0)):Ya(a,c,b.shiftKey,d))})}function za(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=X(a),e=a.oFeatures,h;if(e.bSort&&e.bSortClasses){e=0;for(h=b.length;e<h;e++){var g=b[e].src;f(K(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3))}e=0;for(h=d.length;e<h;e++)g=d[e].src,f(K(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Lb(a,b){var c=a.aoColumns[b],d=q.ext.order[c.sSortDataType],
|
||||
e;d&&(e=d.call(a.oInstance,a,b,ba(a,b)));for(var h,g=q.ext.type.order[c.sType+"-pre"],f=0,l=a.aoData.length;f<l;f++)if(c=a.aoData[f],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)h=d?e[f]:F(a,f,b,"sort"),c._aSortData[b]=g?g(h):h}function Aa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:f.extend(!0,[],a.aaSorting),search:Eb(a.oPreviousSearch),columns:f.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Eb(a.aoPreSearchCols[d])}})};
|
||||
A(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function Nb(a,b,c){var d,e,h=a.aoColumns;b=function(b){if(b&&b.time){var g=A(a,"aoStateLoadParams","stateLoadParams",[a,b]);if(-1===f.inArray(!1,g)&&(g=a.iStateDuration,!(0<g&&b.time<+new Date-1E3*g||b.columns&&h.length!==b.columns.length))){a.oLoadedState=f.extend(!0,{},b);b.start!==n&&(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==n&&(a._iDisplayLength=b.length);b.order!==
|
||||
n&&(a.aaSorting=[],f.each(b.order,function(b,c){a.aaSorting.push(c[0]>=h.length?[0,c[1]]:c)}));b.search!==n&&f.extend(a.oPreviousSearch,Fb(b.search));if(b.columns)for(d=0,e=b.columns.length;d<e;d++)g=b.columns[d],g.visible!==n&&(h[d].bVisible=g.visible),g.search!==n&&f.extend(a.aoPreSearchCols[d],Fb(g.search));A(a,"aoStateLoaded","stateLoaded",[a,b])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==n&&b(g)}else c()}function Ba(a){var b=q.settings;a=f.inArray(a,
|
||||
K(b,"nTable"));return-1!==a?b[a]:null}function O(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)y.console&&console.log&&console.log(c);else if(b=q.ext,b=b.sErrMode||b.errMode,a&&A(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function M(a,b,c,d){f.isArray(c)?f.each(c,function(c,d){f.isArray(d)?M(a,b,d[0],d[1]):M(a,b,
|
||||
d)}):(d===n&&(d=c),b[c]!==n&&(a[d]=b[c]))}function $a(a,b,c){var d;for(d in b)if(b.hasOwnProperty(d)){var e=b[d];f.isPlainObject(e)?(f.isPlainObject(a[d])||(a[d]={}),f.extend(!0,a[d],e)):c&&"data"!==d&&"aaData"!==d&&f.isArray(e)?a[d]=e.slice():a[d]=e}return a}function Za(a,b,c){f(a).on("click.DT",b,function(b){f(a).trigger("blur");c(b)}).on("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).on("selectstart.DT",function(){return!1})}function D(a,b,c,d){c&&a[b].push({fn:c,sName:d})}
|
||||
function A(a,b,c,d){var e=[];b&&(e=f.map(a[b].slice().reverse(),function(b,c){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=f.Event(c+".dt"),f(a.nTable).trigger(b,d),e.push(b.result));return e}function Va(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Qa(a,b){a=a.renderer;var c=q.ext.renderer[b];return f.isPlainObject(a)&&a[b]?c[a[b]]||c._:"string"===typeof a?c[a]||c._:c._}function I(a){return a.oFeatures.bServerSide?
|
||||
"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ja(a,b){var c=Ob.numbers_length,d=Math.floor(c/2);b<=c?a=Y(0,b):a<=d?(a=Y(0,c-2),a.push("ellipsis"),a.push(b-1)):(a>=b-1-d?a=Y(b-(c-2),b):(a=Y(a-d+2,a+d-1),a.push("ellipsis"),a.push(b-1)),a.splice(0,0,"ellipsis"),a.splice(0,0,0));a.DT_el="span";return a}function Ga(a){f.each({num:function(b){return Ca(b,a)},"num-fmt":function(b){return Ca(b,a,ab)},"html-num":function(b){return Ca(b,a,Da)},"html-num-fmt":function(b){return Ca(b,a,Da,ab)}},function(b,
|
||||
c){C.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(C.type.search[b+a]=C.type.search.html)})}function Pb(a){return function(){var b=[Ba(this[q.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return q.ext.internal[a].apply(this,b)}}var q=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new x(Ba(this[C.iApiIndex])):new x(this)};this.fnAddData=function(a,b){var c=this.api(!0);a=f.isArray(a)&&
|
||||
(f.isArray(a[0])||f.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===n||b)&&c.draw();return a.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===n||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&ma(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===n||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0);a=d.rows(a);var e=a.settings()[0],h=e.aoData[a[0][0]];
|
||||
a.remove();b&&b.call(this,e,h);(c===n||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,f){e=this.api(!0);null===b||b===n?e.search(a,c,d,f):e.column(b).search(a,c,d,f);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==n){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==n||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=
|
||||
function(a){var b=this.api(!0);return a!==n?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){a=this.api(!0).page(a);(b===n||
|
||||
b)&&a.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===n||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return Ba(this[C.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===n||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===n||e)&&h.columns.adjust();(d===n||d)&&h.draw();return 0};this.fnVersionCheck=C.fnVersionCheck;
|
||||
var b=this,c=a===n,d=this.length;c&&(a={});this.oApi=this.internal=C.internal;for(var e in q.ext.internal)e&&(this[e]=Pb(e));this.each(function(){var e={},g=1<d?$a(e,a,!0):a,k=0,l;e=this.getAttribute("id");var m=!1,p=q.defaults,v=f(this);if("table"!=this.nodeName.toLowerCase())O(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{ib(p);jb(p.column);L(p,p,!0);L(p.column,p.column,!0);L(p,f.extend(g,v.data()),!0);var u=q.settings;k=0;for(l=u.length;k<l;k++){var t=u[k];if(t.nTable==this||
|
||||
t.nTHead&&t.nTHead.parentNode==this||t.nTFoot&&t.nTFoot.parentNode==this){var w=g.bRetrieve!==n?g.bRetrieve:p.bRetrieve;if(c||w)return t.oInstance;if(g.bDestroy!==n?g.bDestroy:p.bDestroy){t.oInstance.fnDestroy();break}else{O(t,0,"Cannot reinitialise DataTable",3);return}}if(t.sTableId==this.id){u.splice(k,1);break}}if(null===e||""===e)this.id=e="DataTables_Table_"+q.ext._unique++;var r=f.extend(!0,{},q.models.oSettings,{sDestroyWidth:v[0].style.width,sInstance:e,sTableId:e});r.nTable=this;r.oApi=
|
||||
b.internal;r.oInit=g;u.push(r);r.oInstance=1===b.length?b:v.dataTable();ib(g);Fa(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=f.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=$a(f.extend(!0,{},p),g);M(r.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));M(r,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu",
|
||||
"sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);M(r.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);M(r.oLanguage,g,"fnInfoCallback");D(r,"aoDrawCallback",g.fnDrawCallback,
|
||||
"user");D(r,"aoServerParams",g.fnServerParams,"user");D(r,"aoStateSaveParams",g.fnStateSaveParams,"user");D(r,"aoStateLoadParams",g.fnStateLoadParams,"user");D(r,"aoStateLoaded",g.fnStateLoaded,"user");D(r,"aoRowCallback",g.fnRowCallback,"user");D(r,"aoRowCreatedCallback",g.fnCreatedRow,"user");D(r,"aoHeaderCallback",g.fnHeaderCallback,"user");D(r,"aoFooterCallback",g.fnFooterCallback,"user");D(r,"aoInitComplete",g.fnInitComplete,"user");D(r,"aoPreDrawCallback",g.fnPreDrawCallback,"user");r.rowIdFn=
|
||||
T(g.rowId);kb(r);var x=r.oClasses;f.extend(x,q.ext.classes,g.oClasses);v.addClass(x.sTable);r.iInitDisplayStart===n&&(r.iInitDisplayStart=g.iDisplayStart,r._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(r.bDeferLoading=!0,e=f.isArray(g.iDeferLoading),r._iRecordsDisplay=e?g.iDeferLoading[0]:g.iDeferLoading,r._iRecordsTotal=e?g.iDeferLoading[1]:g.iDeferLoading);var y=r.oLanguage;f.extend(!0,y,g.oLanguage);y.sUrl&&(f.ajax({dataType:"json",url:y.sUrl,success:function(a){Fa(a);L(p.oLanguage,
|
||||
a);f.extend(!0,y,a);ia(r)},error:function(){ia(r)}}),m=!0);null===g.asStripeClasses&&(r.asStripeClasses=[x.sStripeOdd,x.sStripeEven]);e=r.asStripeClasses;var z=v.children("tbody").find("tr").eq(0);-1!==f.inArray(!0,f.map(e,function(a,b){return z.hasClass(a)}))&&(f("tbody tr",this).removeClass(e.join(" ")),r.asDestroyStripes=e.slice());e=[];u=this.getElementsByTagName("thead");0!==u.length&&(ea(r.aoHeader,u[0]),e=ta(r));if(null===g.aoColumns)for(u=[],k=0,l=e.length;k<l;k++)u.push(null);else u=g.aoColumns;
|
||||
k=0;for(l=u.length;k<l;k++)Ha(r,e?e[k]:null);mb(r,g.aoColumnDefs,u,function(a,b){la(r,a,b)});if(z.length){var B=function(a,b){return null!==a.getAttribute("data-"+b)?b:null};f(z[0]).children("th, td").each(function(a,b){var c=r.aoColumns[a];if(c.mData===a){var d=B(b,"sort")||B(b,"order");b=B(b,"filter")||B(b,"search");if(null!==d||null!==b)c.mData={_:a+".display",sort:null!==d?a+".@data-"+d:n,type:null!==d?a+".@data-"+d:n,filter:null!==b?a+".@data-"+b:n},la(r,a)}})}var C=r.oFeatures;e=function(){if(g.aaSorting===
|
||||
n){var a=r.aaSorting;k=0;for(l=a.length;k<l;k++)a[k][1]=r.aoColumns[k].asSorting[0]}za(r);C.bSort&&D(r,"aoDrawCallback",function(){if(r.bSorted){var a=X(r),b={};f.each(a,function(a,c){b[c.src]=c.dir});A(r,null,"order",[r,a,b]);Mb(r)}});D(r,"aoDrawCallback",function(){(r.bSorted||"ssp"===I(r)||C.bDeferRender)&&za(r)},"sc");a=v.children("caption").each(function(){this._captionSide=f(this).css("caption-side")});var b=v.children("thead");0===b.length&&(b=f("<thead/>").appendTo(v));r.nTHead=b[0];b=v.children("tbody");
|
||||
0===b.length&&(b=f("<tbody/>").appendTo(v));r.nTBody=b[0];b=v.children("tfoot");0===b.length&&0<a.length&&(""!==r.oScroll.sX||""!==r.oScroll.sY)&&(b=f("<tfoot/>").appendTo(v));0===b.length||0===b.children().length?v.addClass(x.sNoFooter):0<b.length&&(r.nTFoot=b[0],ea(r.aoFooter,r.nTFoot));if(g.aaData)for(k=0;k<g.aaData.length;k++)R(r,g.aaData[k]);else(r.bDeferLoading||"dom"==I(r))&&oa(r,f(r.nTBody).children("tr"));r.aiDisplay=r.aiDisplayMaster.slice();r.bInitialised=!0;!1===m&&ia(r)};g.bStateSave?
|
||||
(C.bStateSave=!0,D(r,"aoDrawCallback",Aa,"state_save"),Nb(r,g,e)):e()}});b=null;return this},C,t,z,bb={},Qb=/[\r\n\u2028]/g,Da=/<.*?>/g,cc=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,dc=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^|\-)/g,ab=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,P=function(a){return a&&!0!==a&&"-"!==a?!1:!0},Rb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Sb=function(a,b){bb[b]||(bb[b]=new RegExp(Ta(b),"g"));
|
||||
return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(bb[b],"."):a},cb=function(a,b,c){var d="string"===typeof a;if(P(a))return!0;b&&d&&(a=Sb(a,b));c&&d&&(a=a.replace(ab,""));return!isNaN(parseFloat(a))&&isFinite(a)},Tb=function(a,b,c){return P(a)?!0:P(a)||"string"===typeof a?cb(a.replace(Da,""),b,c)?!0:null:null},K=function(a,b,c){var d=[],e=0,h=a.length;if(c!==n)for(;e<h;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<h;e++)a[e]&&d.push(a[e][b]);return d},ka=function(a,b,c,d){var e=[],
|
||||
h=0,g=b.length;if(d!==n)for(;h<g;h++)a[b[h]][c]&&e.push(a[b[h]][c][d]);else for(;h<g;h++)e.push(a[b[h]][c]);return e},Y=function(a,b){var c=[];if(b===n){b=0;var d=a}else d=b,b=a;for(a=b;a<d;a++)c.push(a);return c},Ub=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},sa=function(a){a:{if(!(2>a.length)){var b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();b=[];e=a.length;var h,g=0;d=0;a:for(;d<e;d++){c=
|
||||
a[d];for(h=0;h<g;h++)if(b[h]===c)continue a;b.push(c);g++}return b};q.util={throttle:function(a,b){var c=b!==n?b:200,d,e;return function(){var b=this,g=+new Date,f=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=n;a.apply(b,f)},c)):(d=g,a.apply(b,f))}},escapeRegex:function(a){return a.replace(dc,"\\$1")}};var E=function(a,b,c){a[b]!==n&&(a[c]=a[b])},ca=/\[.*?\]$/,W=/\(\)$/,Ta=q.util.escapeRegex,xa=f("<div>")[0],$b=xa.textContent!==n,bc=/<.*?>/g,Ra=q.util.throttle,Vb=[],G=Array.prototype,
|
||||
ec=function(a){var b,c=q.settings,d=f.map(c,function(a,b){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase()){var e=f.inArray(a,d);return-1!==e?[c[e]]:null}if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?b=f(a):a instanceof f&&(b=a)}else return[];if(b)return b.map(function(a){e=f.inArray(this,d);return-1!==e?c[e]:null}).toArray()};var x=function(a,b){if(!(this instanceof x))return new x(a,b);var c=[],d=function(a){(a=
|
||||
ec(a))&&c.push.apply(c,a)};if(f.isArray(a))for(var e=0,h=a.length;e<h;e++)d(a[e]);else d(a);this.context=sa(c);b&&f.merge(this,b);this.selector={rows:null,cols:null,opts:null};x.extend(this,this,Vb)};q.Api=x;f.extend(x.prototype,{any:function(){return 0!==this.count()},concat:G.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new x(b[a],this[a]):
|
||||
null},filter:function(a){var b=[];if(G.filter)b=G.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new x(this.context,b)},flatten:function(){var a=[];return new x(this.context,a.concat.apply(a,this.toArray()))},join:G.join,indexOf:G.indexOf||function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1},iterator:function(a,b,c,d){var e=[],h,g,f=this.context,l,m=this.selector;"string"===typeof a&&(d=c,c=b,b=a,
|
||||
a=!1);var p=0;for(h=f.length;p<h;p++){var q=new x(f[p]);if("table"===b){var u=c.call(q,f[p],p);u!==n&&e.push(u)}else if("columns"===b||"rows"===b)u=c.call(q,f[p],this[p],p),u!==n&&e.push(u);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){var t=this[p];"column-rows"===b&&(l=Ea(f[p],m.opts));var w=0;for(g=t.length;w<g;w++)u=t[w],u="cell"===b?c.call(q,f[p],u.row,u.column,p,w):c.call(q,f[p],u,p,w,l),u!==n&&e.push(u)}}return e.length||d?(a=new x(f,a?e.concat.apply([],e):e),b=a.selector,
|
||||
b.rows=m.rows,b.cols=m.cols,b.opts=m.opts,a):this},lastIndexOf:G.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(G.map)b=G.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new x(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:G.pop,push:G.push,reduce:G.reduce||function(a,b){return lb(this,a,b,0,this.length,1)},reduceRight:G.reduceRight||function(a,
|
||||
b){return lb(this,a,b,this.length-1,-1,-1)},reverse:G.reverse,selector:null,shift:G.shift,slice:function(){return new x(this.context,this)},sort:G.sort,splice:G.splice,toArray:function(){return G.slice.call(this)},to$:function(){return f(this)},toJQuery:function(){return f(this)},unique:function(){return new x(this.context,sa(this))},unshift:G.unshift});x.extend=function(a,b,c){if(c.length&&b&&(b instanceof x||b.__dt_wrapper)){var d,e=function(a,b,c){return function(){var d=b.apply(a,arguments);x.extend(d,
|
||||
d,c.methodExt);return d}};var h=0;for(d=c.length;h<d;h++){var f=c[h];b[f.name]="function"===f.type?e(a,f.val,f):"object"===f.type?{}:f.val;b[f.name].__dt_wrapper=!0;x.extend(a,b[f.name],f.propExt)}}};x.register=t=function(a,b){if(f.isArray(a))for(var c=0,d=a.length;c<d;c++)x.register(a[c],b);else{d=a.split(".");var e=Vb,h;a=0;for(c=d.length;a<c;a++){var g=(h=-1!==d[a].indexOf("()"))?d[a].replace("()",""):d[a];a:{var k=0;for(var l=e.length;k<l;k++)if(e[k].name===g){k=e[k];break a}k=null}k||(k={name:g,
|
||||
val:{},methodExt:[],propExt:[],type:"object"},e.push(k));a===c-1?(k.val=b,k.type="function"===typeof b?"function":f.isPlainObject(b)?"object":"other"):e=h?k.methodExt:k.propExt}}};x.registerPlural=z=function(a,b,c){x.register(a,c);x.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof x?a.length?f.isArray(a[0])?new x(a.context,a[0]):a[0]:n:a})};var Wb=function(a,b){if(f.isArray(a))return f.map(a,function(a){return Wb(a,b)});if("number"===typeof a)return[b[a]];var c=
|
||||
f.map(b,function(a,b){return a.nTable});return f(c).filter(a).map(function(a){a=f.inArray(this,c);return b[a]}).toArray()};t("tables()",function(a){return a!==n&&null!==a?new x(Wb(a,this.context)):this});t("table()",function(a){a=this.tables(a);var b=a.context;return b.length?new x(b[0]):a});z("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});z("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},
|
||||
1)});z("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});z("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});z("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});t("draw()",function(a){return this.iterator("table",function(b){"page"===a?S(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),U(b,!1===
|
||||
a))})});t("page()",function(a){return a===n?this.page.info().page:this.iterator("table",function(b){Wa(b,a)})});t("page.info()",function(a){if(0===this.context.length)return n;a=this.context[0];var b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===I(a)}});t("page.len()",function(a){return a===
|
||||
n?0!==this.context.length?this.context[0]._iDisplayLength:n:this.iterator("table",function(b){Ua(b,a)})});var Xb=function(a,b,c){if(c){var d=new x(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==I(a))U(a,b);else{J(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();ua(a,[],function(c){pa(a);c=va(a,c);for(var d=0,e=c.length;d<e;d++)R(a,c[d]);U(a,b);J(a,!1)})}};t("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});t("ajax.params()",function(){var a=this.context;if(0<
|
||||
a.length)return a[0].oAjaxData});t("ajax.reload()",function(a,b){return this.iterator("table",function(c){Xb(c,!1===b,a)})});t("ajax.url()",function(a){var b=this.context;if(a===n){if(0===b.length)return n;b=b[0];return b.ajax?f.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){f.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});t("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Xb(c,!1===b,a)})});var db=function(a,b,c,d,e){var h=
|
||||
[],g,k,l;var m=typeof b;b&&"string"!==m&&"function"!==m&&b.length!==n||(b=[b]);m=0;for(k=b.length;m<k;m++){var p=b[m]&&b[m].split&&!b[m].match(/[\[\(:]/)?b[m].split(","):[b[m]];var q=0;for(l=p.length;q<l;q++)(g=c("string"===typeof p[q]?f.trim(p[q]):p[q]))&&g.length&&(h=h.concat(g))}a=C.selector[a];if(a.length)for(m=0,k=a.length;m<k;m++)h=a[m](d,e,h);return sa(h)},eb=function(a){a||(a={});a.filter&&a.search===n&&(a.search=a.filter);return f.extend({search:"none",order:"current",page:"all"},a)},fb=
|
||||
function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ea=function(a,b){var c=[],d=a.aiDisplay;var e=a.aiDisplayMaster;var h=b.search;var g=b.order;b=b.page;if("ssp"==I(a))return"removed"===h?[]:Y(0,e.length);if("current"==b)for(g=a._iDisplayStart,a=a.fnDisplayEnd();g<a;g++)c.push(d[g]);else if("current"==g||"applied"==g)if("none"==h)c=e.slice();else if("applied"==h)c=d.slice();else{if("removed"==h){var k=
|
||||
{};g=0;for(a=d.length;g<a;g++)k[d[g]]=null;c=f.map(e,function(a){return k.hasOwnProperty(a)?null:a})}}else if("index"==g||"original"==g)for(g=0,a=a.aoData.length;g<a;g++)"none"==h?c.push(g):(e=f.inArray(g,d),(-1===e&&"removed"==h||0<=e&&"applied"==h)&&c.push(g));return c},fc=function(a,b,c){var d;return db("row",b,function(b){var e=Rb(b),g=a.aoData;if(null!==e&&!c)return[e];d||(d=Ea(a,c));if(null!==e&&-1!==f.inArray(e,d))return[e];if(null===b||b===n||""===b)return d;if("function"===typeof b)return f.map(d,
|
||||
function(a){var c=g[a];return b(a,c._aData,c.nTr)?a:null});if(b.nodeName){e=b._DT_RowIndex;var k=b._DT_CellIndex;if(e!==n)return g[e]&&g[e].nTr===b?[e]:[];if(k)return g[k.row]&&g[k.row].nTr===b.parentNode?[k.row]:[];e=f(b).closest("*[data-dt-row]");return e.length?[e.data("dt-row")]:[]}if("string"===typeof b&&"#"===b.charAt(0)&&(e=a.aIds[b.replace(/^#/,"")],e!==n))return[e.idx];e=Ub(ka(a.aoData,d,"nTr"));return f(e).filter(b).map(function(){return this._DT_RowIndex}).toArray()},a,c)};t("rows()",function(a,
|
||||
b){a===n?a="":f.isPlainObject(a)&&(b=a,a="");b=eb(b);var c=this.iterator("table",function(c){return fc(c,a,b)},1);c.selector.rows=a;c.selector.opts=b;return c});t("rows().nodes()",function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||n},1)});t("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ka(a.aoData,b,"_aData")},1)});z("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){b=b.aoData[c];return"search"===a?b._aFilterData:
|
||||
b._aSortData},1)});z("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){da(b,c,a)})});z("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,b){return b},1)});z("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var k=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+k)}return new x(c,b)});z("rows().remove()","row().remove()",function(){var a=
|
||||
this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,k;e.splice(c,1);var l=0;for(g=e.length;l<g;l++){var m=e[l];var p=m.anCells;null!==m.nTr&&(m.nTr._DT_RowIndex=l);if(null!==p)for(m=0,k=p.length;m<k;m++)p[m]._DT_CellIndex.row=l}qa(b.aiDisplayMaster,c);qa(b.aiDisplay,c);qa(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;Va(b);c=b.rowIdFn(f._aData);c!==n&&delete b.aIds[c]});this.iterator("table",function(a){for(var b=0,d=a.aoData.length;b<d;b++)a.aoData[b].idx=b});return this});t("rows.add()",
|
||||
function(a){var b=this.iterator("table",function(b){var c,d=[];var f=0;for(c=a.length;f<c;f++){var k=a[f];k.nodeName&&"TR"===k.nodeName.toUpperCase()?d.push(oa(b,k)[0]):d.push(R(b,k))}return d},1),c=this.rows(-1);c.pop();f.merge(c,b);return c});t("row()",function(a,b){return fb(this.rows(a,b))});t("row().data()",function(a){var b=this.context;if(a===n)return b.length&&this.length?b[0].aoData[this[0]]._aData:n;var c=b[0].aoData[this[0]];c._aData=a;f.isArray(a)&&c.nTr&&c.nTr.id&&Q(b[0].rowId)(a,c.nTr.id);
|
||||
da(b[0],this[0],"data");return this});t("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});t("row.add()",function(a){a instanceof f&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?oa(b,a)[0]:R(b,a)});return this.row(b[0])});var gc=function(a,b,c,d){var e=[],h=function(b,c){if(f.isArray(b)||b instanceof f)for(var d=0,g=b.length;d<g;d++)h(b[d],c);else b.nodeName&&"tr"===b.nodeName.toLowerCase()?
|
||||
e.push(b):(d=f("<tr><td/></tr>").addClass(c),f("td",d).addClass(c).html(b)[0].colSpan=V(a),e.push(d[0]))};h(c,d);b._details&&b._details.detach();b._details=f(e);b._detailsShow&&b._details.insertAfter(b.nTr)},gb=function(a,b){var c=a.context;c.length&&(a=c[0].aoData[b!==n?b:a[0]])&&a._details&&(a._details.remove(),a._detailsShow=n,a._details=n)},Yb=function(a,b){var c=a.context;c.length&&a.length&&(a=c[0].aoData[a[0]],a._details&&((a._detailsShow=b)?a._details.insertAfter(a.nTr):a._details.detach(),
|
||||
hc(c[0])))},hc=function(a){var b=new x(a),c=a.aoData;b.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<K(c,"_details").length&&(b.on("draw.dt.DT_details",function(d,e){a===e&&b.rows({page:"current"}).eq(0).each(function(a){a=c[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),b.on("column-visibility.dt.DT_details",function(b,e,f,g){if(a===e)for(e=V(e),f=0,g=c.length;f<g;f++)b=c[f],b._details&&b._details.children("td[colspan]").attr("colspan",e)}),b.on("destroy.dt.DT_details",
|
||||
function(d,e){if(a===e)for(d=0,e=c.length;d<e;d++)c[d]._details&&gb(b,d)}))};t("row().child()",function(a,b){var c=this.context;if(a===n)return c.length&&this.length?c[0].aoData[this[0]]._details:n;!0===a?this.child.show():!1===a?gb(this):c.length&&this.length&&gc(c[0],c[0].aoData[this[0]],a,b);return this});t(["row().child.show()","row().child().show()"],function(a){Yb(this,!0);return this});t(["row().child.hide()","row().child().hide()"],function(){Yb(this,!1);return this});t(["row().child.remove()",
|
||||
"row().child().remove()"],function(){gb(this);return this});t("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var ic=/^([^:]+):(name|visIdx|visible)$/,Zb=function(a,b,c,d,e){c=[];d=0;for(var f=e.length;d<f;d++)c.push(F(a,e[d],b));return c},jc=function(a,b,c){var d=a.aoColumns,e=K(d,"sName"),h=K(d,"nTh");return db("column",b,function(b){var g=Rb(b);if(""===b)return Y(d.length);if(null!==g)return[0<=g?g:d.length+g];if("function"===
|
||||
typeof b){var l=Ea(a,c);return f.map(d,function(c,d){return b(d,Zb(a,d,0,0,l),h[d])?d:null})}var m="string"===typeof b?b.match(ic):"";if(m)switch(m[2]){case "visIdx":case "visible":g=parseInt(m[1],10);if(0>g){var p=f.map(d,function(a,b){return a.bVisible?b:null});return[p[p.length+g]]}return[aa(a,g)];case "name":return f.map(e,function(a,b){return a===m[1]?b:null});default:return[]}if(b.nodeName&&b._DT_CellIndex)return[b._DT_CellIndex.column];g=f(h).filter(b).map(function(){return f.inArray(this,
|
||||
h)}).toArray();if(g.length||!b.nodeName)return g;g=f(b).closest("*[data-dt-column]");return g.length?[g.data("dt-column")]:[]},a,c)};t("columns()",function(a,b){a===n?a="":f.isPlainObject(a)&&(b=a,a="");b=eb(b);var c=this.iterator("table",function(c){return jc(c,a,b)},1);c.selector.cols=a;c.selector.opts=b;return c});z("columns().header()","column().header()",function(a,b){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});z("columns().footer()","column().footer()",function(a,
|
||||
b){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});z("columns().data()","column().data()",function(){return this.iterator("column-rows",Zb,1)});z("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});z("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ka(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});z("columns().nodes()",
|
||||
"column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ka(a.aoData,e,"anCells",b)},1)});z("columns().visible()","column().visible()",function(a,b){var c=this,d=this.iterator("column",function(b,c){if(a===n)return b.aoColumns[c].bVisible;var d=b.aoColumns,e=d[c],h=b.aoData,m;if(a!==n&&e.bVisible!==a){if(a){var p=f.inArray(!0,K(d,"bVisible"),c+1);d=0;for(m=h.length;d<m;d++){var q=h[d].nTr;b=h[d].anCells;q&&q.insertBefore(b[c],b[p]||null)}}else f(K(b.aoData,"anCells",
|
||||
c)).detach();e.bVisible=a}});a!==n&&this.iterator("table",function(d){fa(d,d.aoHeader);fa(d,d.aoFooter);d.aiDisplay.length||f(d.nTBody).find("td[colspan]").attr("colspan",V(d));Aa(d);c.iterator("column",function(c,d){A(c,null,"column-visibility",[c,d,a,b])});(b===n||b)&&c.columns.adjust()});return d});z("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ba(b,c):c},1)});t("columns.adjust()",function(){return this.iterator("table",function(a){Z(a)},
|
||||
1)});t("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return aa(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});t("column()",function(a,b){return fb(this.columns(a,b))});var kc=function(a,b,c){var d=a.aoData,e=Ea(a,c),h=Ub(ka(d,e,"anCells")),g=f([].concat.apply([],h)),k,l=a.aoColumns.length,m,p,q,u,t,w;return db("cell",b,function(b){var c="function"===typeof b;if(null===b||b===n||c){m=[];p=0;for(q=e.length;p<q;p++)for(k=
|
||||
e[p],u=0;u<l;u++)t={row:k,column:u},c?(w=d[k],b(t,F(a,k,u),w.anCells?w.anCells[u]:null)&&m.push(t)):m.push(t);return m}if(f.isPlainObject(b))return b.column!==n&&b.row!==n&&-1!==f.inArray(b.row,e)?[b]:[];c=g.filter(b).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||!b.nodeName)return c;w=f(b).closest("*[data-dt-row]");return w.length?[{row:w.data("dt-row"),column:w.data("dt-column")}]:[]},a,c)};t("cells()",function(a,b,c){f.isPlainObject(a)&&
|
||||
(a.row===n?(c=a,a=null):(c=b,b=null));f.isPlainObject(b)&&(c=b,b=null);if(null===b||b===n)return this.iterator("table",function(b){return kc(b,a,eb(c))});var d=c?{page:c.page,order:c.order,search:c.search}:{},e=this.columns(b,d),h=this.rows(a,d),g,k,l,m;d=this.iterator("table",function(a,b){a=[];g=0;for(k=h[b].length;g<k;g++)for(l=0,m=e[b].length;l<m;l++)a.push({row:h[b][g],column:e[b][l]});return a},1);d=c&&c.selected?this.cells(d,c):d;f.extend(d.selector,{cols:b,rows:a,opts:c});return d});z("cells().nodes()",
|
||||
"cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&a.anCells?a.anCells[c]:n},1)});t("cells().data()",function(){return this.iterator("cell",function(a,b,c){return F(a,b,c)},1)});z("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});z("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return F(b,c,d,a)},
|
||||
1)});z("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,column:c,columnVisible:ba(a,c)}},1)});z("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){da(b,c,a,d)})});t("cell()",function(a,b,c){return fb(this.cells(a,b,c))});t("cell().data()",function(a){var b=this.context,c=this[0];if(a===n)return b.length&&c.length?F(b[0],c[0].row,c[0].column):n;nb(b[0],c[0].row,c[0].column,a);da(b[0],c[0].row,
|
||||
"data",c[0].column);return this});t("order()",function(a,b){var c=this.context;if(a===n)return 0!==c.length?c[0].aaSorting:n;"number"===typeof a?a=[[a,b]]:a.length&&!f.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});t("order.listener()",function(a,b,c){return this.iterator("table",function(d){Pa(d,a,b,c)})});t("order.fixed()",function(a){if(!a){var b=this.context;b=b.length?b[0].aaSortingFixed:n;return f.isArray(b)?{pre:b}:
|
||||
b}return this.iterator("table",function(b){b.aaSortingFixed=f.extend(!0,{},a)})});t(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];f.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});t("search()",function(a,b,c,d){var e=this.context;return a===n?0!==e.length?e[0].oPreviousSearch.sSearch:n:this.iterator("table",function(e){e.oFeatures.bFilter&&ha(e,f.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===
|
||||
c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});z("columns().search()","column().search()",function(a,b,c,d){return this.iterator("column",function(e,h){var g=e.aoPreSearchCols;if(a===n)return g[h].sSearch;e.oFeatures.bFilter&&(f.extend(g[h],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ha(e,e.oPreviousSearch,1))})});t("state()",function(){return this.context.length?this.context[0].oSavedState:null});t("state.clear()",function(){return this.iterator("table",
|
||||
function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});t("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});t("state.save()",function(){return this.iterator("table",function(a){Aa(a)})});q.versionCheck=q.fnVersionCheck=function(a){var b=q.version.split(".");a=a.split(".");for(var c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};q.isDataTable=q.fnIsDataTable=function(a){var b=f(a).get(0),c=!1;if(a instanceof
|
||||
q.Api)return!0;f.each(q.settings,function(a,e){a=e.nScrollHead?f("table",e.nScrollHead)[0]:null;var d=e.nScrollFoot?f("table",e.nScrollFoot)[0]:null;if(e.nTable===b||a===b||d===b)c=!0});return c};q.tables=q.fnTables=function(a){var b=!1;f.isPlainObject(a)&&(b=a.api,a=a.visible);var c=f.map(q.settings,function(b){if(!a||a&&f(b.nTable).is(":visible"))return b.nTable});return b?new x(c):c};q.camelToHungarian=L;t("$()",function(a,b){b=this.rows(b).nodes();b=f(b);return f([].concat(b.filter(a).toArray(),
|
||||
b.find(a).toArray()))});f.each(["on","one","off"],function(a,b){t(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0]=f.map(a[0].split(/\s/),function(a){return a.match(/\.dt\b/)?a:a+".dt"}).join(" ");var d=f(this.tables().nodes());d[b].apply(d,a);return this})});t("clear()",function(){return this.iterator("table",function(a){pa(a)})});t("settings()",function(){return new x(this.context,this.context)});t("init()",function(){var a=this.context;return a.length?a[0].oInit:null});t("data()",
|
||||
function(){return this.iterator("table",function(a){return K(a.aoData,"_aData")}).flatten()});t("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,h=b.nTBody,g=b.nTHead,k=b.nTFoot,l=f(e);h=f(h);var m=f(b.nTableWrapper),p=f.map(b.aoData,function(a){return a.nTr}),n;b.bDestroying=!0;A(b,"aoDestroyCallback","destroy",[b]);a||(new x(b)).columns().visible(!0);m.off(".DT").find(":not(tbody *)").off(".DT");f(y).off(".DT-"+b.sInstance);
|
||||
e!=g.parentNode&&(l.children("thead").detach(),l.append(g));k&&e!=k.parentNode&&(l.children("tfoot").detach(),l.append(k));b.aaSorting=[];b.aaSortingFixed=[];za(b);f(p).removeClass(b.asStripeClasses.join(" "));f("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);h.children().detach();h.append(p);g=a?"remove":"detach";l[g]();m[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),l.css("width",b.sDestroyWidth).removeClass(d.sTable),(n=b.asDestroyStripes.length)&&
|
||||
h.children().each(function(a){f(this).addClass(b.asDestroyStripes[a%n])}));c=f.inArray(b,q.settings);-1!==c&&q.settings.splice(c,1)})});f.each(["column","row","cell"],function(a,b){t(b+"s().every()",function(a){var c=this.selector.opts,e=this;return this.iterator(b,function(d,f,k,l,m){a.call(e[b](f,"cell"===b?k:c,"cell"===b?c:n),f,k,l,m)})})});t("i18n()",function(a,b,c){var d=this.context[0];a=T(a)(d.oLanguage);a===n&&(a=b);c!==n&&f.isPlainObject(a)&&(a=a[c]!==n?a[c]:a._);return a.replace("%d",c)});
|
||||
q.version="1.10.21";q.settings=[];q.models={};q.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};q.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};q.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,
|
||||
sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};q.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,
|
||||
bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){return{}}},
|
||||
fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",
|
||||
sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:f.extend({},q.models.oSearch),sAjaxDataProp:"data",
|
||||
sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};H(q.defaults);q.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};H(q.defaults.column);q.models.oSettings=
|
||||
{oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},
|
||||
aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,
|
||||
aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:n,oAjaxData:n,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==I(this)?1*this._iRecordsTotal:
|
||||
this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==I(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};q.ext=C={buttons:{},
|
||||
classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:q.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:q.version};f.extend(C,{afnFiltering:C.search,aTypes:C.type.detect,ofnSearch:C.type.search,oSort:C.type.order,afnSortData:C.order,aoFeatures:C.feature,oApi:C.internal,oStdClasses:C.classes,oPagination:C.pager});
|
||||
f.extend(q.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",
|
||||
sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
|
||||
sJUIHeader:"",sJUIFooter:""});var Ob=q.ext.pager;f.extend(Ob,{simple:function(a,b){return["previous","next"]},full:function(a,b){return["first","previous","next","last"]},numbers:function(a,b){return[ja(a,b)]},simple_numbers:function(a,b){return["previous",ja(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ja(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",ja(a,b),"last"]},_numbers:ja,numbers_length:7});f.extend(!0,q.ext.renderer,{pageButton:{_:function(a,b,
|
||||
c,d,e,h){var g=a.oClasses,k=a.oLanguage.oPaginate,l=a.oLanguage.oAria.paginate||{},m,p,q=0,t=function(b,d){var n,r=g.sPageButtonDisabled,u=function(b){Wa(a,b.data.action,!0)};var w=0;for(n=d.length;w<n;w++){var v=d[w];if(f.isArray(v)){var x=f("<"+(v.DT_el||"div")+"/>").appendTo(b);t(x,v)}else{m=null;p=v;x=a.iTabIndex;switch(v){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":m=k.sFirst;0===e&&(x=-1,p+=" "+r);break;case "previous":m=k.sPrevious;0===e&&(x=-1,p+=
|
||||
" "+r);break;case "next":m=k.sNext;if(0===h||e===h-1)x=-1,p+=" "+r;break;case "last":m=k.sLast;e===h-1&&(x=-1,p+=" "+r);break;default:m=v+1,p=e===v?g.sPageButtonActive:""}null!==m&&(x=f("<a>",{"class":g.sPageButton+" "+p,"aria-controls":a.sTableId,"aria-label":l[v],"data-dt-idx":q,tabindex:x,id:0===c&&"string"===typeof v?a.sTableId+"_"+v:null}).html(m).appendTo(b),Za(x,{action:v},u),q++)}}};try{var x=f(b).find(w.activeElement).data("dt-idx")}catch(lc){}t(f(b).empty(),d);x!==n&&f(b).find("[data-dt-idx="+
|
||||
x+"]").trigger("focus")}}});f.extend(q.ext.type.detect,[function(a,b){b=b.oLanguage.sDecimal;return cb(a,b)?"num"+b:null},function(a,b){if(a&&!(a instanceof Date)&&!cc.test(a))return null;b=Date.parse(a);return null!==b&&!isNaN(b)||P(a)?"date":null},function(a,b){b=b.oLanguage.sDecimal;return cb(a,b,!0)?"num-fmt"+b:null},function(a,b){b=b.oLanguage.sDecimal;return Tb(a,b)?"html-num"+b:null},function(a,b){b=b.oLanguage.sDecimal;return Tb(a,b,!0)?"html-num-fmt"+b:null},function(a,b){return P(a)||"string"===
|
||||
typeof a&&-1!==a.indexOf("<")?"html":null}]);f.extend(q.ext.type.search,{html:function(a){return P(a)?a:"string"===typeof a?a.replace(Qb," ").replace(Da,""):""},string:function(a){return P(a)?a:"string"===typeof a?a.replace(Qb," "):a}});var Ca=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Sb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};f.extend(C.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return P(a)?
|
||||
"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return P(a)?"":"string"===typeof a?a.toLowerCase():a.toString?a.toString():""},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});Ga("");f.extend(!0,q.ext.renderer,{header:{_:function(a,b,c,d){f(a.nTable).on("order.dt.DT",function(e,f,g,k){a===f&&(e=c.idx,b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass("asc"==k[e]?d.sSortAsc:"desc"==k[e]?d.sSortDesc:
|
||||
c.sSortingClass))})},jqueryui:function(a,b,c,d){f("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(f("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);f(a.nTable).on("order.dt.DT",function(e,f,g,k){a===f&&(e=c.idx,b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==k[e]?d.sSortAsc:"desc"==k[e]?d.sSortDesc:c.sSortingClass),b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass("asc"==
|
||||
k[e]?d.sSortJUIAsc:"desc"==k[e]?d.sSortJUIDesc:c.sSortingClassJUI))})}}});var hb=function(a){return"string"===typeof a?a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):a};q.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return hb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
|
||||
a)+f+(e||"")}}},text:function(){return{display:hb,filter:hb}}};f.extend(q.ext.internal,{_fnExternApiFunc:Pb,_fnBuildAjax:ua,_fnAjaxUpdate:pb,_fnAjaxParameters:yb,_fnAjaxUpdateDraw:zb,_fnAjaxDataSrc:va,_fnAddColumn:Ha,_fnColumnOptions:la,_fnAdjustColumnSizing:Z,_fnVisibleToColumnIndex:aa,_fnColumnIndexToVisible:ba,_fnVisbleColumns:V,_fnGetColumns:na,_fnColumnTypes:Ja,_fnApplyColumnDefs:mb,_fnHungarianMap:H,_fnCamelToHungarian:L,_fnLanguageCompat:Fa,_fnBrowserDetect:kb,_fnAddData:R,_fnAddTr:oa,_fnNodeToDataIndex:function(a,
|
||||
b){return b._DT_RowIndex!==n?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return f.inArray(c,a.aoData[b].anCells)},_fnGetCellData:F,_fnSetCellData:nb,_fnSplitObjNotation:Ma,_fnGetObjectDataFn:T,_fnSetObjectDataFn:Q,_fnGetDataMaster:Na,_fnClearTable:pa,_fnDeleteIndex:qa,_fnInvalidate:da,_fnGetRowElements:La,_fnCreateTr:Ka,_fnBuildHead:ob,_fnDrawHead:fa,_fnDraw:S,_fnReDraw:U,_fnAddOptionsHtml:rb,_fnDetectHeader:ea,_fnGetUniqueThs:ta,_fnFeatureHtmlFilter:tb,_fnFilterComplete:ha,_fnFilterCustom:Cb,
|
||||
_fnFilterColumn:Bb,_fnFilter:Ab,_fnFilterCreateSearch:Sa,_fnEscapeRegex:Ta,_fnFilterData:Db,_fnFeatureHtmlInfo:wb,_fnUpdateInfo:Gb,_fnInfoMacros:Hb,_fnInitialise:ia,_fnInitComplete:wa,_fnLengthChange:Ua,_fnFeatureHtmlLength:sb,_fnFeatureHtmlPaginate:xb,_fnPageChange:Wa,_fnFeatureHtmlProcessing:ub,_fnProcessingDisplay:J,_fnFeatureHtmlTable:vb,_fnScrollDraw:ma,_fnApplyToChildren:N,_fnCalculateColumnWidths:Ia,_fnThrottle:Ra,_fnConvertToWidth:Ib,_fnGetWidestNode:Jb,_fnGetMaxLenString:Kb,_fnStringToCss:B,
|
||||
_fnSortFlatten:X,_fnSort:qb,_fnSortAria:Mb,_fnSortListener:Ya,_fnSortAttachListener:Pa,_fnSortingClasses:za,_fnSortData:Lb,_fnSaveState:Aa,_fnLoadState:Nb,_fnSettingsFromNode:Ba,_fnLog:O,_fnMap:M,_fnBindAction:Za,_fnCallbackReg:D,_fnCallbackFire:A,_fnLengthOverflow:Va,_fnRenderer:Qa,_fnDataSource:I,_fnRowAttributes:Oa,_fnExtend:$a,_fnCalculateEnd:function(){}});f.fn.dataTable=q;q.$=f;f.fn.dataTableSettings=q.settings;f.fn.dataTableExt=q.ext;f.fn.DataTable=function(a){return f(this).dataTable(a).api()};
|
||||
f.each(q,function(a,b){f.fn.DataTable[a]=b});return f.fn.dataTable});
|
||||
@@ -0,0 +1,45 @@
|
||||
/*!
|
||||
Copyright 2014-2020 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license/mit
|
||||
|
||||
This source file 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 license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net
|
||||
Responsive 2.2.5
|
||||
2014-2020 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,k,g){a instanceof String&&(a=String(a));for(var n=a.length,p=0;p<n;p++){var v=a[p];if(k.call(g,v,p,a))return{i:p,v:v}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,k,g){a!=Array.prototype&&a!=Object.prototype&&(a[k]=g.value)};$jscomp.getGlobal=function(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var k=0;k<a.length;++k){var g=a[k];if(g&&g.Math==Math)return g}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(a,k,g,n){if(k){g=$jscomp.global;a=a.split(".");for(n=0;n<a.length-1;n++){var p=a[n];p in g||(g[p]={});g=g[p]}a=a[a.length-1];n=g[a];k=k(n);k!=n&&null!=k&&$jscomp.defineProperty(g,a,{configurable:!0,writable:!0,value:k})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,g){return $jscomp.findInternal(this,a,g).v}},"es6","es3");
|
||||
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(k){return a(k,window,document)}):"object"===typeof exports?module.exports=function(k,g){k||(k=window);g&&g.fn.dataTable||(g=require("datatables.net")(k,g).$);return a(g,k,k.document)}:a(jQuery,window,document)})(function(a,k,g,n){function p(b,a,c){var d=a+"-"+c;if(q[d])return q[d];var f=[];b=b.cell(a,c).node().childNodes;a=0;for(c=b.length;a<c;a++)f.push(b[a]);return q[d]=f}function v(b,a,c){var d=a+"-"+
|
||||
c;if(q[d]){b=b.cell(a,c).node();c=q[d][0].parentNode.childNodes;a=[];for(var f=0,l=c.length;f<l;f++)a.push(c[f]);c=0;for(f=a.length;c<f;c++)b.appendChild(a[c]);q[d]=n}}var t=a.fn.dataTable,m=function(b,d){if(!t.versionCheck||!t.versionCheck("1.10.10"))throw"DataTables Responsive requires DataTables 1.10.10 or newer";this.s={dt:new t.Api(b),columns:[],current:[]};this.s.dt.settings()[0].responsive||(d&&"string"===typeof d.details?d.details={type:d.details}:d&&!1===d.details?d.details={type:!1}:d&&
|
||||
!0===d.details&&(d.details={type:"inline"}),this.c=a.extend(!0,{},m.defaults,t.defaults.responsive,d),b.responsive=this,this._constructor())};a.extend(m.prototype,{_constructor:function(){var b=this,d=this.s.dt,c=d.settings()[0],e=a(k).innerWidth();d.settings()[0]._responsive=this;a(k).on("resize.dtr orientationchange.dtr",t.util.throttle(function(){var d=a(k).innerWidth();d!==e&&(b._resize(),e=d)}));c.oApi._fnCallbackReg(c,"aoRowCreatedCallback",function(c,e,r){-1!==a.inArray(!1,b.s.current)&&a(">td, >th",
|
||||
c).each(function(c){c=d.column.index("toData",c);!1===b.s.current[c]&&a(this).css("display","none")})});d.on("destroy.dtr",function(){d.off(".dtr");a(d.table().body()).off(".dtr");a(k).off("resize.dtr orientationchange.dtr");d.cells(".dtr-control").nodes().to$().removeClass("dtr-control");a.each(b.s.current,function(a,d){!1===d&&b._setColumnVis(a,!0)})});this.c.breakpoints.sort(function(b,a){return b.width<a.width?1:b.width>a.width?-1:0});this._classLogic();this._resizeAuto();c=this.c.details;!1!==
|
||||
c.type&&(b._detailsInit(),d.on("column-visibility.dtr",function(){b._timer&&clearTimeout(b._timer);b._timer=setTimeout(function(){b._timer=null;b._classLogic();b._resizeAuto();b._resize();b._redrawChildren()},100)}),d.on("draw.dtr",function(){b._redrawChildren()}),a(d.table().node()).addClass("dtr-"+c.type));d.on("column-reorder.dtr",function(a,d,c){b._classLogic();b._resizeAuto();b._resize(!0)});d.on("column-sizing.dtr",function(){b._resizeAuto();b._resize()});d.on("preXhr.dtr",function(){var a=
|
||||
[];d.rows().every(function(){this.child.isShown()&&a.push(this.id(!0))});d.one("draw.dtr",function(){b._resizeAuto();b._resize();d.rows(a).every(function(){b._detailsDisplay(this,!1)})})});d.on("draw.dtr",function(){b._controlClass()}).on("init.dtr",function(c,e,r){"dt"===c.namespace&&(b._resizeAuto(),b._resize(),a.inArray(!1,b.s.current)&&d.columns.adjust())});this._resize()},_columnsVisiblity:function(b){var d=this.s.dt,c=this.s.columns,e,f=c.map(function(a,b){return{columnIdx:b,priority:a.priority}}).sort(function(a,
|
||||
b){return a.priority!==b.priority?a.priority-b.priority:a.columnIdx-b.columnIdx}),l=a.map(c,function(c,h){return!1===d.column(h).visible()?"not-visible":c.auto&&null===c.minWidth?!1:!0===c.auto?"-":-1!==a.inArray(b,c.includeIn)}),r=0;var h=0;for(e=l.length;h<e;h++)!0===l[h]&&(r+=c[h].minWidth);h=d.settings()[0].oScroll;h=h.sY||h.sX?h.iBarWidth:0;r=d.table().container().offsetWidth-h-r;h=0;for(e=l.length;h<e;h++)c[h].control&&(r-=c[h].minWidth);var k=!1;h=0;for(e=f.length;h<e;h++){var g=f[h].columnIdx;
|
||||
"-"===l[g]&&!c[g].control&&c[g].minWidth&&(k||0>r-c[g].minWidth?(k=!0,l[g]=!1):l[g]=!0,r-=c[g].minWidth)}f=!1;h=0;for(e=c.length;h<e;h++)if(!c[h].control&&!c[h].never&&!1===l[h]){f=!0;break}h=0;for(e=c.length;h<e;h++)c[h].control&&(l[h]=f),"not-visible"===l[h]&&(l[h]=!1);-1===a.inArray(!0,l)&&(l[0]=!0);return l},_classLogic:function(){var b=this,d=this.c.breakpoints,c=this.s.dt,e=c.columns().eq(0).map(function(a){var b=this.column(a),d=b.header().className;a=c.settings()[0].aoColumns[a].responsivePriority;
|
||||
b=b.header().getAttribute("data-priority");a===n&&(a=b===n||null===b?1E4:1*b);return{className:d,includeIn:[],auto:!1,control:!1,never:d.match(/\bnever\b/)?!0:!1,priority:a}}),f=function(b,d){b=e[b].includeIn;-1===a.inArray(d,b)&&b.push(d)},g=function(a,c,g,l){if(!g)e[a].includeIn.push(c);else if("max-"===g)for(l=b._find(c).width,c=0,g=d.length;c<g;c++)d[c].width<=l&&f(a,d[c].name);else if("min-"===g)for(l=b._find(c).width,c=0,g=d.length;c<g;c++)d[c].width>=l&&f(a,d[c].name);else if("not-"===g)for(c=
|
||||
0,g=d.length;c<g;c++)-1===d[c].name.indexOf(l)&&f(a,d[c].name)};e.each(function(b,c){for(var e=b.className.split(" "),f=!1,h=0,l=e.length;h<l;h++){var k=a.trim(e[h]);if("all"===k){f=!0;b.includeIn=a.map(d,function(b){return b.name});return}if("none"===k||b.never){f=!0;return}if("control"===k){f=!0;b.control=!0;return}a.each(d,function(b,a){b=a.name.split("-");var d=k.match(new RegExp("(min\\-|max\\-|not\\-)?("+b[0]+")(\\-[_a-zA-Z0-9])?"));d&&(f=!0,d[2]===b[0]&&d[3]==="-"+b[1]?g(c,a.name,d[1],d[2]+
|
||||
d[3]):d[2]!==b[0]||d[3]||g(c,a.name,d[1],d[2]))})}f||(b.auto=!0)});this.s.columns=e},_controlClass:function(){if("inline"===this.c.details.type){var b=this.s.dt,d=a.inArray(!0,this.s.current);b.cells(null,function(b){return b!==d},{page:"current"}).nodes().to$().filter(".dtr-control").removeClass("dtr-control");b.cells(null,d,{page:"current"}).nodes().to$().addClass("dtr-control")}},_detailsDisplay:function(b,d){var c=this,e=this.s.dt,f=this.c.details;if(f&&!1!==f.type){var g=f.display(b,d,function(){return f.renderer(e,
|
||||
b[0],c._detailsObj(b[0]))});!0!==g&&!1!==g||a(e.table().node()).triggerHandler("responsive-display.dt",[e,b,g,d])}},_detailsInit:function(){var b=this,d=this.s.dt,c=this.c.details;"inline"===c.type&&(c.target="td.dtr-control, th.dtr-control");d.on("draw.dtr",function(){b._tabIndexes()});b._tabIndexes();a(d.table().body()).on("keyup.dtr","td, th",function(b){13===b.keyCode&&a(this).data("dtr-keyboard")&&a(this).click()});var e=c.target;c="string"===typeof e?e:"td, th";if(e!==n||null!==e)a(d.table().body()).on("click.dtr mousedown.dtr mouseup.dtr",
|
||||
c,function(c){if(a(d.table().node()).hasClass("collapsed")&&-1!==a.inArray(a(this).closest("tr").get(0),d.rows().nodes().toArray())){if("number"===typeof e){var f=0>e?d.columns().eq(0).length+e:e;if(d.cell(this).index().column!==f)return}f=d.row(a(this).closest("tr"));"click"===c.type?b._detailsDisplay(f,!1):"mousedown"===c.type?a(this).css("outline","none"):"mouseup"===c.type&&a(this).trigger("blur").css("outline","")}})},_detailsObj:function(b){var d=this,c=this.s.dt;return a.map(this.s.columns,
|
||||
function(e,f){if(!e.never&&!e.control)return e=c.settings()[0].aoColumns[f],{className:e.sClass,columnIndex:f,data:c.cell(b,f).render(d.c.orthogonal),hidden:c.column(f).visible()&&!d.s.current[f],rowIndex:b,title:null!==e.sTitle?e.sTitle:a(c.column(f).header()).text()}})},_find:function(b){for(var a=this.c.breakpoints,c=0,e=a.length;c<e;c++)if(a[c].name===b)return a[c]},_redrawChildren:function(){var b=this,a=this.s.dt;a.rows({page:"current"}).iterator("row",function(c,d){a.row(d);b._detailsDisplay(a.row(d),
|
||||
!0)})},_resize:function(b){var d=this,c=this.s.dt,e=a(k).innerWidth(),f=this.c.breakpoints,g=f[0].name,r=this.s.columns,h,n=this.s.current.slice();for(h=f.length-1;0<=h;h--)if(e<=f[h].width){g=f[h].name;break}var m=this._columnsVisiblity(g);this.s.current=m;f=!1;h=0;for(e=r.length;h<e;h++)if(!1===m[h]&&!r[h].never&&!r[h].control&&!1===!c.column(h).visible()){f=!0;break}a(c.table().node()).toggleClass("collapsed",f);var p=!1,q=0;c.columns().eq(0).each(function(a,c){!0===m[c]&&q++;if(b||m[c]!==n[c])p=
|
||||
!0,d._setColumnVis(a,m[c])});p&&(this._redrawChildren(),a(c.table().node()).trigger("responsive-resize.dt",[c,this.s.current]),0===c.page.info().recordsDisplay&&a("td",c.table().body()).eq(0).attr("colspan",q))},_resizeAuto:function(){var b=this.s.dt,d=this.s.columns;if(this.c.auto&&-1!==a.inArray(!0,a.map(d,function(b){return b.auto}))){a.isEmptyObject(q)||a.each(q,function(a){a=a.split("-");v(b,1*a[0],1*a[1])});b.table().node();var c=b.table().node().cloneNode(!1),e=a(b.table().header().cloneNode(!1)).appendTo(c),
|
||||
f=a(b.table().body()).clone(!1,!1).empty().appendTo(c);c.style.width="auto";var g=b.columns().header().filter(function(a){return b.column(a).visible()}).to$().clone(!1).css("display","table-cell").css("width","auto").css("min-width",0);a(f).append(a(b.rows({page:"current"}).nodes()).clone(!1)).find("th, td").css("display","");if(f=b.table().footer()){f=a(f.cloneNode(!1)).appendTo(c);var k=b.columns().footer().filter(function(a){return b.column(a).visible()}).to$().clone(!1).css("display","table-cell");
|
||||
a("<tr/>").append(k).appendTo(f)}a("<tr/>").append(g).appendTo(e);"inline"===this.c.details.type&&a(c).addClass("dtr-inline collapsed");a(c).find("[name]").removeAttr("name");a(c).css("position","relative");c=a("<div/>").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(c);c.insertBefore(b.table().node());g.each(function(a){a=b.column.index("fromVisible",a);d[a].minWidth=this.offsetWidth||0});c.remove()}},_responsiveOnlyHidden:function(){var b=this.s.dt;return a.map(this.s.current,function(a,
|
||||
c){return!1===b.column(c).visible()?!0:a})},_setColumnVis:function(b,d){var c=this.s.dt;d=d?"":"none";a(c.column(b).header()).css("display",d);a(c.column(b).footer()).css("display",d);c.column(b).nodes().to$().css("display",d);a.isEmptyObject(q)||c.cells(null,b).indexes().each(function(a){v(c,a.row,a.column)})},_tabIndexes:function(){var b=this.s.dt,d=b.cells({page:"current"}).nodes().to$(),c=b.settings()[0],e=this.c.details.target;d.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]");
|
||||
"number"===typeof e?b.cells(null,e,{page:"current"}).nodes().to$().attr("tabIndex",c.iTabIndex).data("dtr-keyboard",1):("td:first-child, th:first-child"===e&&(e=">td:first-child, >th:first-child"),a(e,b.rows({page:"current"}).nodes()).attr("tabIndex",c.iTabIndex).data("dtr-keyboard",1))}});m.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];m.display={childRow:function(b,d,c){if(d){if(a(b.node()).hasClass("parent"))return b.child(c(),
|
||||
"child").show(),!0}else{if(b.child.isShown())return b.child(!1),a(b.node()).removeClass("parent"),!1;b.child(c(),"child").show();a(b.node()).addClass("parent");return!0}},childRowImmediate:function(b,d,c){if(!d&&b.child.isShown()||!b.responsive.hasHidden())return b.child(!1),a(b.node()).removeClass("parent"),!1;b.child(c(),"child").show();a(b.node()).addClass("parent");return!0},modal:function(b){return function(d,c,e){if(c)a("div.dtr-modal-content").empty().append(e());else{var f=function(){k.remove();
|
||||
a(g).off("keypress.dtr")},k=a('<div class="dtr-modal"/>').append(a('<div class="dtr-modal-display"/>').append(a('<div class="dtr-modal-content"/>').append(e())).append(a('<div class="dtr-modal-close">×</div>').click(function(){f()}))).append(a('<div class="dtr-modal-background"/>').click(function(){f()})).appendTo("body");a(g).on("keyup.dtr",function(a){27===a.keyCode&&(a.stopPropagation(),f())})}b&&b.header&&a("div.dtr-modal-content").prepend("<h2>"+b.header(d)+"</h2>")}}};var q={};m.renderer=
|
||||
{listHiddenNodes:function(){return function(b,d,c){var e=a('<ul data-dtr-index="'+d+'" class="dtr-details"/>'),f=!1;a.each(c,function(c,d){d.hidden&&(a("<li "+(d.className?'class="'+d.className+'"':"")+' data-dtr-index="'+d.columnIndex+'" data-dt-row="'+d.rowIndex+'" data-dt-column="'+d.columnIndex+'"><span class="dtr-title">'+d.title+"</span> </li>").append(a('<span class="dtr-data"/>').append(p(b,d.rowIndex,d.columnIndex))).appendTo(e),f=!0)});return f?e:!1}},listHidden:function(){return function(b,
|
||||
d,c){return(b=a.map(c,function(a){var b=a.className?'class="'+a.className+'"':"";return a.hidden?"<li "+b+' data-dtr-index="'+a.columnIndex+'" data-dt-row="'+a.rowIndex+'" data-dt-column="'+a.columnIndex+'"><span class="dtr-title">'+a.title+'</span> <span class="dtr-data">'+a.data+"</span></li>":""}).join(""))?a('<ul data-dtr-index="'+d+'" class="dtr-details"/>').append(b):!1}},tableAll:function(b){b=a.extend({tableClass:""},b);return function(d,c,e){d=a.map(e,function(a){return"<tr "+(a.className?
|
||||
'class="'+a.className+'"':"")+' data-dt-row="'+a.rowIndex+'" data-dt-column="'+a.columnIndex+'"><td>'+a.title+":</td> <td>"+a.data+"</td></tr>"}).join("");return a('<table class="'+b.tableClass+' dtr-details" width="100%"/>').append(d)}}};m.defaults={breakpoints:m.breakpoints,auto:!0,details:{display:m.display.childRow,renderer:m.renderer.listHidden(),target:0,type:"inline"},orthogonal:"display"};var u=a.fn.dataTable.Api;u.register("responsive()",function(){return this});u.register("responsive.index()",
|
||||
function(b){b=a(b);return{column:b.data("dtr-index"),row:b.parent().data("dtr-index")}});u.register("responsive.rebuild()",function(){return this.iterator("table",function(a){a._responsive&&a._responsive._classLogic()})});u.register("responsive.recalc()",function(){return this.iterator("table",function(a){a._responsive&&(a._responsive._resizeAuto(),a._responsive._resize())})});u.register("responsive.hasHidden()",function(){var b=this.context[0];return b._responsive?-1!==a.inArray(!1,b._responsive._responsiveOnlyHidden()):
|
||||
!1});u.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",function(){return this.iterator("column",function(a,d){return a._responsive?a._responsive._responsiveOnlyHidden()[d]:!1},1)});m.version="2.2.5";a.fn.dataTable.Responsive=m;a.fn.DataTable.Responsive=m;a(g).on("preInit.dt.dtr",function(b,d,c){"dt"===b.namespace&&(a(d.nTable).hasClass("responsive")||a(d.nTable).hasClass("dt-responsive")||d.oInit.responsive||t.defaults.responsive)&&(b=d.oInit.responsive,!1!==b&&new m(d,
|
||||
a.isPlainObject(b)?b:{}))});return m});
|
||||
@@ -0,0 +1,41 @@
|
||||
/*!
|
||||
Copyright 2011-2020 SpryMedia Ltd.
|
||||
|
||||
This source file is free software, available under the following license:
|
||||
MIT license - http://datatables.net/license/mit
|
||||
|
||||
This source file 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 license files for details.
|
||||
|
||||
For details please refer to: http://www.datatables.net
|
||||
Scroller 2.0.2
|
||||
©2011-2020 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,e,g){c instanceof String&&(c=String(c));for(var k=c.length,l=0;l<k;l++){var h=c[l];if(e.call(g,h,l,c))return{i:l,v:h}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,e,g){c!=Array.prototype&&c!=Object.prototype&&(c[e]=g.value)};$jscomp.getGlobal=function(c){c=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,c];for(var e=0;e<c.length;++e){var g=c[e];if(g&&g.Math==Math)return g}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(c,e,g,k){if(e){g=$jscomp.global;c=c.split(".");for(k=0;k<c.length-1;k++){var l=c[k];l in g||(g[l]={});g=g[l]}c=c[c.length-1];k=g[c];e=e(k);e!=k&&null!=e&&$jscomp.defineProperty(g,c,{configurable:!0,writable:!0,value:e})}};$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,g){return $jscomp.findInternal(this,c,g).v}},"es6","es3");
|
||||
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return c(e,window,document)}):"object"===typeof exports?module.exports=function(e,g){e||(e=window);g&&g.fn.dataTable||(g=require("datatables.net")(e,g).$);return c(g,e,e.document)}:c(jQuery,window,document)})(function(c,e,g,k){var l=c.fn.dataTable,h=function(a,b){this instanceof h?(b===k&&(b={}),a=c.fn.dataTable.Api(a),this.s={dt:a.settings()[0],dtApi:a,tableTop:0,tableBottom:0,redrawTop:0,redrawBottom:0,
|
||||
autoHeight:!0,viewportRows:0,stateTO:null,stateSaveThrottle:function(){},drawTO:null,heights:{jump:null,page:null,virtual:null,scroll:null,row:null,viewport:null,labelFactor:1},topRowFloat:0,scrollDrawDiff:null,loaderVisible:!1,forceReposition:!1,baseRowTop:0,baseScrollTop:0,mousedown:!1,lastScrollTop:0},this.s=c.extend(this.s,h.oDefaults,b),this.s.heights.row=this.s.rowHeight,this.dom={force:g.createElement("div"),label:c('<div class="dts_label">0</div>'),scroller:null,table:null,loader:null},this.s.dt.oScroller||
|
||||
(this.s.dt.oScroller=this,this.construct())):alert("Scroller warning: Scroller must be initialised with the 'new' keyword.")};c.extend(h.prototype,{measure:function(a){this.s.autoHeight&&this._calcRowHeight();var b=this.s.heights;b.row&&(b.viewport=this._parseHeight(c(this.dom.scroller).css("max-height")),this.s.viewportRows=parseInt(b.viewport/b.row,10)+1,this.s.dt._iDisplayLength=this.s.viewportRows*this.s.displayBuffer);var d=this.dom.label.outerHeight();b.labelFactor=(b.viewport-d)/b.scroll;(a===
|
||||
k||a)&&this.s.dt.oInstance.fnDraw(!1)},pageInfo:function(){var a=this.dom.scroller.scrollTop,b=this.s.dt.fnRecordsDisplay(),d=Math.ceil(this.pixelsToRow(a+this.s.heights.viewport,!1,this.s.ani));return{start:Math.floor(this.pixelsToRow(a,!1,this.s.ani)),end:b<d?b-1:d-1}},pixelsToRow:function(a,b,d){a-=this.s.baseScrollTop;d=d?(this._domain("physicalToVirtual",this.s.baseScrollTop)+a)/this.s.heights.row:a/this.s.heights.row+this.s.baseRowTop;return b||b===k?parseInt(d,10):d},rowToPixels:function(a,
|
||||
b,d){a-=this.s.baseRowTop;d=d?this._domain("virtualToPhysical",this.s.baseScrollTop):this.s.baseScrollTop;d+=a*this.s.heights.row;return b||b===k?parseInt(d,10):d},scrollToRow:function(a,b){var d=this,f=!1,e=this.rowToPixels(a),g=a-(this.s.displayBuffer-1)/2*this.s.viewportRows;0>g&&(g=0);(e>this.s.redrawBottom||e<this.s.redrawTop)&&this.s.dt._iDisplayStart!==g&&(f=!0,e=this._domain("virtualToPhysical",a*this.s.heights.row),this.s.redrawTop<e&&e<this.s.redrawBottom&&(this.s.forceReposition=!0,b=!1));
|
||||
b===k||b?(this.s.ani=f,c(this.dom.scroller).animate({scrollTop:e},function(){setTimeout(function(){d.s.ani=!1},250)})):c(this.dom.scroller).scrollTop(e)},construct:function(){var a=this,b=this.s.dtApi;if(this.s.dt.oFeatures.bPaginate){this.dom.force.style.position="relative";this.dom.force.style.top="0px";this.dom.force.style.left="0px";this.dom.force.style.width="1px";this.dom.scroller=c("div."+this.s.dt.oClasses.sScrollBody,this.s.dt.nTableWrapper)[0];this.dom.scroller.appendChild(this.dom.force);
|
||||
this.dom.scroller.style.position="relative";this.dom.table=c(">table",this.dom.scroller)[0];this.dom.table.style.position="absolute";this.dom.table.style.top="0px";this.dom.table.style.left="0px";c(b.table().container()).addClass("dts DTS");this.s.loadingIndicator&&(this.dom.loader=c('<div class="dataTables_processing dts_loading">'+this.s.dt.oLanguage.sLoadingRecords+"</div>").css("display","none"),c(this.dom.scroller.parentNode).css("position","relative").append(this.dom.loader));this.dom.label.appendTo(this.dom.scroller);
|
||||
this.s.heights.row&&"auto"!=this.s.heights.row&&(this.s.autoHeight=!1);this.s.ingnoreScroll=!0;c(this.dom.scroller).on("scroll.dt-scroller",function(b){a._scroll.call(a)});c(this.dom.scroller).on("touchstart.dt-scroller",function(){a._scroll.call(a)});c(this.dom.scroller).on("mousedown.dt-scroller",function(){a.s.mousedown=!0}).on("mouseup.dt-scroller",function(){a.s.labelVisible=!1;a.s.mousedown=!1;a.dom.label.css("display","none")});c(e).on("resize.dt-scroller",function(){a.measure(!1);a._info()});
|
||||
var d=!0,f=b.state.loaded();b.on("stateSaveParams.scroller",function(b,c,e){d?(e.scroller=f.scroller,d=!1):e.scroller={topRow:a.s.topRowFloat,baseScrollTop:a.s.baseScrollTop,baseRowTop:a.s.baseRowTop,scrollTop:a.s.lastScrollTop}});f&&f.scroller&&(this.s.topRowFloat=f.scroller.topRow,this.s.baseScrollTop=f.scroller.baseScrollTop,this.s.baseRowTop=f.scroller.baseRowTop);this.measure(!1);a.s.stateSaveThrottle=a.s.dt.oApi._fnThrottle(function(){a.s.dtApi.state.save()},500);b.on("init.scroller",function(){a.measure(!1);
|
||||
a.s.scrollType="jump";a._draw();b.on("draw.scroller",function(){a._draw()})});b.on("preDraw.dt.scroller",function(){a._scrollForce()});b.on("destroy.scroller",function(){c(e).off("resize.dt-scroller");c(a.dom.scroller).off(".dt-scroller");c(a.s.dt.nTable).off(".scroller");c(a.s.dt.nTableWrapper).removeClass("DTS");c("div.DTS_Loading",a.dom.scroller.parentNode).remove();a.dom.table.style.position="";a.dom.table.style.top="";a.dom.table.style.left=""})}else this.s.dt.oApi._fnLog(this.s.dt,0,"Pagination must be enabled for Scroller")},
|
||||
_calcRowHeight:function(){var a=this.s.dt,b=a.nTable,d=b.cloneNode(!1),f=c("<tbody/>").appendTo(d),e=c('<div class="'+a.oClasses.sWrapper+' DTS"><div class="'+a.oClasses.sScrollWrapper+'"><div class="'+a.oClasses.sScrollBody+'"></div></div></div>');c("tbody tr:lt(4)",b).clone().appendTo(f);var g=c("tr",f).length;if(1===g)f.prepend("<tr><td> </td></tr>"),f.append("<tr><td> </td></tr>");else for(;3>g;g++)f.append("<tr><td> </td></tr>");c("div."+a.oClasses.sScrollBody,e).append(d);a=this.s.dt.nHolding||
|
||||
b.parentNode;c(a).is(":visible")||(a="body");e.find("input").removeAttr("name");e.appendTo(a);this.s.heights.row=c("tr",f).eq(1).outerHeight();e.remove()},_draw:function(){var a=this,b=this.s.heights,d=this.dom.scroller.scrollTop,f=c(this.s.dt.nTable).height(),e=this.s.dt._iDisplayStart,g=this.s.dt._iDisplayLength,k=this.s.dt.fnRecordsDisplay();this.s.skip=!0;!this.s.dt.bSorted&&!this.s.dt.bFiltered||0!==e||this.s.dt._drawHold||(this.s.topRowFloat=0);d="jump"===this.s.scrollType?this._domain("virtualToPhysical",
|
||||
this.s.topRowFloat*b.row):d;this.s.baseScrollTop=d;this.s.baseRowTop=this.s.topRowFloat;var h=d-(this.s.topRowFloat-e)*b.row;0===e?h=0:e+g>=k&&(h=b.scroll-f);this.dom.table.style.top=h+"px";this.s.tableTop=h;this.s.tableBottom=f+this.s.tableTop;f=(d-this.s.tableTop)*this.s.boundaryScale;this.s.redrawTop=d-f;this.s.redrawBottom=d+f>b.scroll-b.viewport-b.row?b.scroll-b.viewport-b.row:d+f;this.s.skip=!1;this.s.dt.oFeatures.bStateSave&&null!==this.s.dt.oLoadedState&&"undefined"!=typeof this.s.dt.oLoadedState.scroller?
|
||||
((b=!this.s.dt.sAjaxSource&&!a.s.dt.ajax||this.s.dt.oFeatures.bServerSide?!1:!0)&&2==this.s.dt.iDraw||!b&&1==this.s.dt.iDraw)&&setTimeout(function(){c(a.dom.scroller).scrollTop(a.s.dt.oLoadedState.scroller.scrollTop);setTimeout(function(){a.s.ingnoreScroll=!1},0)},0):a.s.ingnoreScroll=!1;this.s.dt.oFeatures.bInfo&&setTimeout(function(){a._info.call(a)},0);this.dom.loader&&this.s.loaderVisible&&(this.dom.loader.css("display","none"),this.s.loaderVisible=!1)},_domain:function(a,b){var d=this.s.heights;
|
||||
if(d.virtual===d.scroll||1E4>b)return b;if("virtualToPhysical"===a&&b>=d.virtual-1E4)return a=d.virtual-b,d.scroll-a;if("physicalToVirtual"===a&&b>=d.scroll-1E4)return a=d.scroll-b,d.virtual-a;d=(d.virtual-1E4-1E4)/(d.scroll-1E4-1E4);var c=1E4-1E4*d;return"virtualToPhysical"===a?(b-c)/d:d*b+c},_info:function(){if(this.s.dt.oFeatures.bInfo){var a=this.s.dt,b=a.oLanguage,d=this.dom.scroller.scrollTop,f=Math.floor(this.pixelsToRow(d,!1,this.s.ani)+1),e=a.fnRecordsTotal(),g=a.fnRecordsDisplay();d=Math.ceil(this.pixelsToRow(d+
|
||||
this.s.heights.viewport,!1,this.s.ani));d=g<d?g:d;var h=a.fnFormatNumber(f),k=a.fnFormatNumber(d),l=a.fnFormatNumber(e),m=a.fnFormatNumber(g);h=0===a.fnRecordsDisplay()&&a.fnRecordsDisplay()==a.fnRecordsTotal()?b.sInfoEmpty+b.sInfoPostFix:0===a.fnRecordsDisplay()?b.sInfoEmpty+" "+b.sInfoFiltered.replace("_MAX_",l)+b.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?b.sInfo.replace("_START_",h).replace("_END_",k).replace("_MAX_",l).replace("_TOTAL_",m)+b.sInfoPostFix:b.sInfo.replace("_START_",
|
||||
h).replace("_END_",k).replace("_MAX_",l).replace("_TOTAL_",m)+" "+b.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+b.sInfoPostFix;(b=b.fnInfoCallback)&&(h=b.call(a.oInstance,a,f,d,e,g,h));f=a.aanFeatures.i;if("undefined"!=typeof f)for(e=0,g=f.length;e<g;e++)c(f[e]).html(h);c(a.nTable).triggerHandler("info.dt")}},_parseHeight:function(a){var b,d=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(px|em|rem|vh)$/.exec(a);if(null===d)return 0;a=parseFloat(d[1]);d=d[2];"px"===d?b=a:"vh"===d?b=a/100*
|
||||
c(e).height():"rem"===d?b=a*parseFloat(c(":root").css("font-size")):"em"===d&&(b=a*parseFloat(c("body").css("font-size")));return b?b:0},_scroll:function(){var a=this,b=this.s.heights,d=this.dom.scroller.scrollTop;if(!this.s.skip&&!this.s.ingnoreScroll&&d!==this.s.lastScrollTop)if(this.s.dt.bFiltered||this.s.dt.bSorted)this.s.lastScrollTop=0;else{this._info();clearTimeout(this.s.stateTO);this.s.stateTO=setTimeout(function(){a.s.dtApi.state.save()},250);this.s.scrollType=Math.abs(d-this.s.lastScrollTop)>
|
||||
b.viewport?"jump":"cont";this.s.topRowFloat="cont"===this.s.scrollType?this.pixelsToRow(d,!1,!1):this._domain("physicalToVirtual",d)/b.row;0>this.s.topRowFloat&&(this.s.topRowFloat=0);if(this.s.forceReposition||d<this.s.redrawTop||d>this.s.redrawBottom){var f=Math.ceil((this.s.displayBuffer-1)/2*this.s.viewportRows);f=parseInt(this.s.topRowFloat,10)-f;this.s.forceReposition=!1;0>=f?f=0:f+this.s.dt._iDisplayLength>this.s.dt.fnRecordsDisplay()?(f=this.s.dt.fnRecordsDisplay()-this.s.dt._iDisplayLength,
|
||||
0>f&&(f=0)):0!==f%2&&f++;this.s.targetTop=f;f!=this.s.dt._iDisplayStart&&(this.s.tableTop=c(this.s.dt.nTable).offset().top,this.s.tableBottom=c(this.s.dt.nTable).height()+this.s.tableTop,f=function(){a.s.dt._iDisplayStart=a.s.targetTop;a.s.dt.oApi._fnDraw(a.s.dt)},this.s.dt.oFeatures.bServerSide?(this.s.forceReposition=!0,clearTimeout(this.s.drawTO),this.s.drawTO=setTimeout(f,this.s.serverWait)):f(),this.dom.loader&&!this.s.loaderVisible&&(this.dom.loader.css("display","block"),this.s.loaderVisible=
|
||||
!0))}else this.s.topRowFloat=this.pixelsToRow(d,!1,!0);this.s.lastScrollTop=d;this.s.stateSaveThrottle();"jump"===this.s.scrollType&&this.s.mousedown&&(this.s.labelVisible=!0);this.s.labelVisible&&this.dom.label.html(this.s.dt.fnFormatNumber(parseInt(this.s.topRowFloat,10)+1)).css("top",d+d*b.labelFactor).css("display","block")}},_scrollForce:function(){var a=this.s.heights;a.virtual=a.row*this.s.dt.fnRecordsDisplay();a.scroll=a.virtual;1E6<a.scroll&&(a.scroll=1E6);this.dom.force.style.height=a.scroll>
|
||||
this.s.heights.row?a.scroll+"px":this.s.heights.row+"px"}});h.defaults={boundaryScale:.5,displayBuffer:9,loadingIndicator:!1,rowHeight:"auto",serverWait:200};h.oDefaults=h.defaults;h.version="2.0.2";c(g).on("preInit.dt.dtscroller",function(a,b){if("dt"===a.namespace){a=b.oInit.scroller;var d=l.defaults.scroller;if(a||d)d=c.extend({},a,d),!1!==a&&new h(b,d)}});c.fn.dataTable.Scroller=h;c.fn.DataTable.Scroller=h;var m=c.fn.dataTable.Api;m.register("scroller()",function(){return this});m.register("scroller().rowToPixels()",
|
||||
function(a,b,d){var c=this.context;if(c.length&&c[0].oScroller)return c[0].oScroller.rowToPixels(a,b,d)});m.register("scroller().pixelsToRow()",function(a,b,d){var c=this.context;if(c.length&&c[0].oScroller)return c[0].oScroller.pixelsToRow(a,b,d)});m.register(["scroller().scrollToRow()","scroller.toPosition()"],function(a,b){this.iterator("table",function(d){d.oScroller&&d.oScroller.scrollToRow(a,b)});return this});m.register("row().scrollTo()",function(a){var b=this;this.iterator("row",function(d,
|
||||
c){d.oScroller&&(c=b.rows({order:"applied",search:"applied"}).indexes().indexOf(c),d.oScroller.scrollToRow(c,a))});return this});m.register("scroller.measure()",function(a){this.iterator("table",function(b){b.oScroller&&b.oScroller.measure(a)});return this});m.register("scroller.page()",function(){var a=this.context;if(a.length&&a[0].oScroller)return a[0].oScroller.pageInfo()});return h});
|
||||
Vendored
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,448 @@
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var ua = navigator.userAgent,
|
||||
iPhone = /iphone/i.test(ua),
|
||||
chrome = /chrome/i.test(ua),
|
||||
android = /android/i.test(ua),
|
||||
caretTimeoutId;
|
||||
|
||||
$.mask = {
|
||||
//Predefined character definitions
|
||||
definitions: {
|
||||
'9': "[0-9]",
|
||||
'a': "[A-Za-z]",
|
||||
'*': "[A-Za-z0-9]"
|
||||
},
|
||||
autoclear: true,
|
||||
dataName: "rawMaskFn",
|
||||
placeholder: '_'
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
//Helper Function for Caret positioning
|
||||
caret: function(begin, end) {
|
||||
var range;
|
||||
|
||||
if (this.length === 0 || this.is(":hidden") || this.get(0) !== document.activeElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof begin == 'number') {
|
||||
end = (typeof end === 'number') ? end : begin;
|
||||
return this.each(function() {
|
||||
if (this.setSelectionRange) {
|
||||
this.setSelectionRange(begin, end);
|
||||
} else if (this.createTextRange) {
|
||||
range = this.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', end);
|
||||
range.moveStart('character', begin);
|
||||
range.select();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this[0].setSelectionRange) {
|
||||
begin = this[0].selectionStart;
|
||||
end = this[0].selectionEnd;
|
||||
} else if (document.selection && document.selection.createRange) {
|
||||
range = document.selection.createRange();
|
||||
begin = 0 - range.duplicate().moveStart('character', -100000);
|
||||
end = begin + range.text.length;
|
||||
}
|
||||
return { begin: begin, end: end };
|
||||
}
|
||||
},
|
||||
unmask: function() {
|
||||
return this.trigger("unmask");
|
||||
},
|
||||
mask: function(mask, settings) {
|
||||
var input,
|
||||
defs,
|
||||
tests,
|
||||
partialPosition,
|
||||
firstNonMaskPos,
|
||||
lastRequiredNonMaskPos,
|
||||
len,
|
||||
oldVal;
|
||||
|
||||
if (!mask && this.length > 0) {
|
||||
input = $(this[0]);
|
||||
var fn = input.data($.mask.dataName)
|
||||
return fn?fn():undefined;
|
||||
}
|
||||
|
||||
settings = $.extend({
|
||||
autoclear: $.mask.autoclear,
|
||||
placeholder: $.mask.placeholder, // Load default placeholder
|
||||
completed: null
|
||||
}, settings);
|
||||
|
||||
|
||||
defs = $.mask.definitions;
|
||||
tests = [];
|
||||
partialPosition = len = mask.length;
|
||||
firstNonMaskPos = null;
|
||||
|
||||
mask = String(mask);
|
||||
|
||||
$.each(mask.split(""), function(i, c) {
|
||||
if (c == '?') {
|
||||
len--;
|
||||
partialPosition = i;
|
||||
} else if (defs[c]) {
|
||||
tests.push(new RegExp(defs[c]));
|
||||
if (firstNonMaskPos === null) {
|
||||
firstNonMaskPos = tests.length - 1;
|
||||
}
|
||||
if(i < partialPosition){
|
||||
lastRequiredNonMaskPos = tests.length - 1;
|
||||
}
|
||||
} else {
|
||||
tests.push(null);
|
||||
}
|
||||
});
|
||||
|
||||
return this.trigger("unmask").each(function() {
|
||||
var input = $(this),
|
||||
buffer = $.map(
|
||||
mask.split(""),
|
||||
function(c, i) {
|
||||
if (c != '?') {
|
||||
return defs[c] ? getPlaceholder(i) : c;
|
||||
}
|
||||
}),
|
||||
defaultBuffer = buffer.join(''),
|
||||
focusText = input.val();
|
||||
|
||||
function tryFireCompleted(){
|
||||
if (!settings.completed) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = firstNonMaskPos; i <= lastRequiredNonMaskPos; i++) {
|
||||
if (tests[i] && buffer[i] === getPlaceholder(i)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
settings.completed.call(input);
|
||||
}
|
||||
|
||||
function getPlaceholder(i){
|
||||
if(i < settings.placeholder.length)
|
||||
return settings.placeholder.charAt(i);
|
||||
return settings.placeholder.charAt(0);
|
||||
}
|
||||
|
||||
function seekNext(pos) {
|
||||
while (++pos < len && !tests[pos]);
|
||||
return pos;
|
||||
}
|
||||
|
||||
function seekPrev(pos) {
|
||||
while (--pos >= 0 && !tests[pos]);
|
||||
return pos;
|
||||
}
|
||||
|
||||
function shiftL(begin,end) {
|
||||
var i,
|
||||
j;
|
||||
|
||||
if (begin<0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = begin, j = seekNext(end); i < len; i++) {
|
||||
if (tests[i]) {
|
||||
if (j < len && tests[i].test(buffer[j])) {
|
||||
buffer[i] = buffer[j];
|
||||
buffer[j] = getPlaceholder(j);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
j = seekNext(j);
|
||||
}
|
||||
}
|
||||
writeBuffer();
|
||||
input.caret(Math.max(firstNonMaskPos, begin));
|
||||
}
|
||||
|
||||
function shiftR(pos) {
|
||||
var i,
|
||||
c,
|
||||
j,
|
||||
t;
|
||||
|
||||
for (i = pos, c = getPlaceholder(pos); i < len; i++) {
|
||||
if (tests[i]) {
|
||||
j = seekNext(i);
|
||||
t = buffer[i];
|
||||
buffer[i] = c;
|
||||
if (j < len && tests[j].test(t)) {
|
||||
c = t;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function androidInputEvent(e) {
|
||||
var curVal = input.val();
|
||||
var pos = input.caret();
|
||||
if (oldVal && oldVal.length && oldVal.length > curVal.length ) {
|
||||
// a deletion or backspace happened
|
||||
checkVal(true);
|
||||
while (pos.begin > 0 && !tests[pos.begin-1])
|
||||
pos.begin--;
|
||||
if (pos.begin === 0)
|
||||
{
|
||||
while (pos.begin < firstNonMaskPos && !tests[pos.begin])
|
||||
pos.begin++;
|
||||
}
|
||||
input.caret(pos.begin,pos.begin);
|
||||
} else {
|
||||
var pos2 = checkVal(true);
|
||||
var lastEnteredValue = curVal.charAt(pos.begin);
|
||||
if (pos.begin < len){
|
||||
if(!tests[pos.begin]){
|
||||
pos.begin++;
|
||||
if(tests[pos.begin].test(lastEnteredValue)){
|
||||
pos.begin++;
|
||||
}
|
||||
}else{
|
||||
if(tests[pos.begin].test(lastEnteredValue)){
|
||||
pos.begin++;
|
||||
}
|
||||
}
|
||||
}
|
||||
input.caret(pos.begin,pos.begin);
|
||||
}
|
||||
tryFireCompleted();
|
||||
}
|
||||
|
||||
|
||||
function blurEvent(e) {
|
||||
checkVal();
|
||||
|
||||
if (input.val() != focusText)
|
||||
input.change();
|
||||
}
|
||||
|
||||
function keydownEvent(e) {
|
||||
if (input.prop("readonly")){
|
||||
return;
|
||||
}
|
||||
|
||||
var k = e.which || e.keyCode,
|
||||
pos,
|
||||
begin,
|
||||
end;
|
||||
oldVal = input.val();
|
||||
//backspace, delete, and escape get special treatment
|
||||
if (k === 8 || k === 46 || (iPhone && k === 127)) {
|
||||
pos = input.caret();
|
||||
begin = pos.begin;
|
||||
end = pos.end;
|
||||
|
||||
if (end - begin === 0) {
|
||||
begin=k!==46?seekPrev(begin):(end=seekNext(begin-1));
|
||||
end=k===46?seekNext(end):end;
|
||||
}
|
||||
clearBuffer(begin, end);
|
||||
shiftL(begin, end - 1);
|
||||
|
||||
e.preventDefault();
|
||||
} else if( k === 13 ) { // enter
|
||||
blurEvent.call(this, e);
|
||||
} else if (k === 27) { // escape
|
||||
input.val(focusText);
|
||||
input.caret(0, checkVal());
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
function keypressEvent(e) {
|
||||
if (input.prop("readonly")){
|
||||
return;
|
||||
}
|
||||
|
||||
var k = e.which || e.keyCode,
|
||||
pos = input.caret(),
|
||||
p,
|
||||
c,
|
||||
next;
|
||||
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore
|
||||
return;
|
||||
} else if ( k && k !== 13 ) {
|
||||
if (pos.end - pos.begin !== 0){
|
||||
clearBuffer(pos.begin, pos.end);
|
||||
shiftL(pos.begin, pos.end-1);
|
||||
}
|
||||
|
||||
p = seekNext(pos.begin - 1);
|
||||
if (p < len) {
|
||||
c = String.fromCharCode(k);
|
||||
if (tests[p].test(c)) {
|
||||
shiftR(p);
|
||||
|
||||
buffer[p] = c;
|
||||
writeBuffer();
|
||||
next = seekNext(p);
|
||||
|
||||
if(android){
|
||||
//Path for CSP Violation on FireFox OS 1.1
|
||||
var proxy = function() {
|
||||
$.proxy($.fn.caret,input,next)();
|
||||
};
|
||||
|
||||
setTimeout(proxy,0);
|
||||
}else{
|
||||
input.caret(next);
|
||||
}
|
||||
if(pos.begin <= lastRequiredNonMaskPos){
|
||||
tryFireCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
function clearBuffer(start, end) {
|
||||
var i;
|
||||
for (i = start; i < end && i < len; i++) {
|
||||
if (tests[i]) {
|
||||
buffer[i] = getPlaceholder(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function writeBuffer() { input.val(buffer.join('')); }
|
||||
|
||||
function checkVal(allow) {
|
||||
//try to place characters where they belong
|
||||
var test = input.val(),
|
||||
lastMatch = -1,
|
||||
i,
|
||||
c,
|
||||
pos;
|
||||
|
||||
for (i = 0, pos = 0; i < len; i++) {
|
||||
if (tests[i]) {
|
||||
buffer[i] = getPlaceholder(i);
|
||||
while (pos++ < test.length) {
|
||||
c = test.charAt(pos - 1);
|
||||
if (tests[i].test(c)) {
|
||||
buffer[i] = c;
|
||||
lastMatch = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (pos > test.length) {
|
||||
clearBuffer(i + 1, len);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (buffer[i] === test.charAt(pos)) {
|
||||
pos++;
|
||||
}
|
||||
if( i < partialPosition){
|
||||
lastMatch = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allow) {
|
||||
writeBuffer();
|
||||
} else if (lastMatch + 1 < partialPosition) {
|
||||
if (settings.autoclear || buffer.join('') === defaultBuffer) {
|
||||
// Invalid value. Remove it and replace it with the
|
||||
// mask, which is the default behavior.
|
||||
if(input.val()) input.val("");
|
||||
clearBuffer(0, len);
|
||||
} else {
|
||||
// Invalid value, but we opt to show the value to the
|
||||
// user and allow them to correct their mistake.
|
||||
writeBuffer();
|
||||
}
|
||||
} else {
|
||||
writeBuffer();
|
||||
input.val(input.val().substring(0, lastMatch + 1));
|
||||
}
|
||||
return (partialPosition ? i : firstNonMaskPos);
|
||||
}
|
||||
|
||||
input.data($.mask.dataName,function(){
|
||||
return $.map(buffer, function(c, i) {
|
||||
return tests[i]&&c!=getPlaceholder(i) ? c : null;
|
||||
}).join('');
|
||||
});
|
||||
|
||||
|
||||
input
|
||||
.one("unmask", function() {
|
||||
input
|
||||
.off(".mask")
|
||||
.removeData($.mask.dataName);
|
||||
})
|
||||
.on("focus.mask", function() {
|
||||
if (input.prop("readonly")){
|
||||
return;
|
||||
}
|
||||
|
||||
clearTimeout(caretTimeoutId);
|
||||
var pos;
|
||||
|
||||
focusText = input.val();
|
||||
|
||||
pos = checkVal();
|
||||
|
||||
caretTimeoutId = setTimeout(function(){
|
||||
if(input.get(0) !== document.activeElement){
|
||||
return;
|
||||
}
|
||||
writeBuffer();
|
||||
if (pos == mask.replace("?","").length) {
|
||||
input.caret(0, pos);
|
||||
} else {
|
||||
input.caret(pos);
|
||||
}
|
||||
}, 10);
|
||||
})
|
||||
.on("blur.mask", blurEvent)
|
||||
.on("keydown.mask", keydownEvent)
|
||||
.on("keypress.mask", keypressEvent)
|
||||
.on("input.mask paste.mask", function() {
|
||||
if (input.prop("readonly")){
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
var pos=checkVal(true);
|
||||
input.caret(pos);
|
||||
tryFireCompleted();
|
||||
}, 0);
|
||||
});
|
||||
if (chrome && android)
|
||||
{
|
||||
input
|
||||
.off('input.mask')
|
||||
.on('input.mask', androidInputEvent);
|
||||
}
|
||||
checkVal(); //Perform initial check for existing values
|
||||
});
|
||||
}
|
||||
});
|
||||
}));
|
||||
Vendored
+7
File diff suppressed because one or more lines are too long
@@ -0,0 +1,554 @@
|
||||
/*!
|
||||
* Lightbox v2.11.3
|
||||
* by Lokesh Dhakar
|
||||
*
|
||||
* More info:
|
||||
* http://lokeshdhakar.com/projects/lightbox2/
|
||||
*
|
||||
* Copyright Lokesh Dhakar
|
||||
* Released under the MIT license
|
||||
* https://github.com/lokesh/lightbox2/blob/master/LICENSE
|
||||
*
|
||||
* @preserve
|
||||
*/
|
||||
|
||||
// Uses Node, AMD or browser globals to create a module.
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
root.lightbox = factory(root.jQuery);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
function Lightbox(options) {
|
||||
this.album = [];
|
||||
this.currentImageIndex = void 0;
|
||||
this.init();
|
||||
|
||||
// options
|
||||
this.options = $.extend({}, this.constructor.defaults);
|
||||
this.option(options);
|
||||
}
|
||||
|
||||
// Descriptions of all options available on the demo site:
|
||||
// http://lokeshdhakar.com/projects/lightbox2/index.html#options
|
||||
Lightbox.defaults = {
|
||||
albumLabel: 'Image %1 of %2',
|
||||
alwaysShowNavOnTouchDevices: false,
|
||||
fadeDuration: 600,
|
||||
fitImagesInViewport: true,
|
||||
imageFadeDuration: 600,
|
||||
// maxWidth: 800,
|
||||
// maxHeight: 600,
|
||||
positionFromTop: 50,
|
||||
resizeDuration: 700,
|
||||
showImageNumberLabel: true,
|
||||
wrapAround: false,
|
||||
disableScrolling: false,
|
||||
/*
|
||||
Sanitize Title
|
||||
If the caption data is trusted, for example you are hardcoding it in, then leave this to false.
|
||||
This will free you to add html tags, such as links, in the caption.
|
||||
|
||||
If the caption data is user submitted or from some other untrusted source, then set this to true
|
||||
to prevent xss and other injection attacks.
|
||||
*/
|
||||
sanitizeTitle: false
|
||||
};
|
||||
|
||||
Lightbox.prototype.option = function(options) {
|
||||
$.extend(this.options, options);
|
||||
};
|
||||
|
||||
Lightbox.prototype.imageCountLabel = function(currentImageNum, totalImages) {
|
||||
return this.options.albumLabel.replace(/%1/g, currentImageNum).replace(/%2/g, totalImages);
|
||||
};
|
||||
|
||||
Lightbox.prototype.init = function() {
|
||||
var self = this;
|
||||
// Both enable and build methods require the body tag to be in the DOM.
|
||||
$(document).ready(function() {
|
||||
self.enable();
|
||||
self.build();
|
||||
});
|
||||
};
|
||||
|
||||
// Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes
|
||||
// that contain 'lightbox'. When these are clicked, start lightbox.
|
||||
Lightbox.prototype.enable = function() {
|
||||
var self = this;
|
||||
$('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function(event) {
|
||||
self.start($(event.currentTarget));
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
// Build html for the lightbox and the overlay.
|
||||
// Attach event handlers to the new DOM elements. click click click
|
||||
Lightbox.prototype.build = function() {
|
||||
if ($('#lightbox').length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
// The two root notes generated, #lightboxOverlay and #lightbox are given
|
||||
// tabindex attrs so they are focusable. We attach our keyboard event
|
||||
// listeners to these two elements, and not the document. Clicking anywhere
|
||||
// while Lightbox is opened will keep the focus on or inside one of these
|
||||
// two elements.
|
||||
//
|
||||
// We do this so we can prevent propogation of the Esc keypress when
|
||||
// Lightbox is open. This prevents it from intefering with other components
|
||||
// on the page below.
|
||||
//
|
||||
// Github issue: https://github.com/lokesh/lightbox2/issues/663
|
||||
$('<div id="lightboxOverlay" tabindex="-1" class="lightboxOverlay"></div><div id="lightbox" tabindex="-1" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt=""/><div class="lb-nav"><a class="lb-prev" aria-label="Previous image" href="" ></a><a class="lb-next" aria-label="Next image" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo($('body'));
|
||||
|
||||
// Cache jQuery objects
|
||||
this.$lightbox = $('#lightbox');
|
||||
this.$overlay = $('#lightboxOverlay');
|
||||
this.$outerContainer = this.$lightbox.find('.lb-outerContainer');
|
||||
this.$container = this.$lightbox.find('.lb-container');
|
||||
this.$image = this.$lightbox.find('.lb-image');
|
||||
this.$nav = this.$lightbox.find('.lb-nav');
|
||||
|
||||
// Store css values for future lookup
|
||||
this.containerPadding = {
|
||||
top: parseInt(this.$container.css('padding-top'), 10),
|
||||
right: parseInt(this.$container.css('padding-right'), 10),
|
||||
bottom: parseInt(this.$container.css('padding-bottom'), 10),
|
||||
left: parseInt(this.$container.css('padding-left'), 10)
|
||||
};
|
||||
|
||||
this.imageBorderWidth = {
|
||||
top: parseInt(this.$image.css('border-top-width'), 10),
|
||||
right: parseInt(this.$image.css('border-right-width'), 10),
|
||||
bottom: parseInt(this.$image.css('border-bottom-width'), 10),
|
||||
left: parseInt(this.$image.css('border-left-width'), 10)
|
||||
};
|
||||
|
||||
// Attach event handlers to the newly minted DOM elements
|
||||
this.$overlay.hide().on('click', function() {
|
||||
self.end();
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$lightbox.hide().on('click', function(event) {
|
||||
if ($(event.target).attr('id') === 'lightbox') {
|
||||
self.end();
|
||||
}
|
||||
});
|
||||
|
||||
this.$outerContainer.on('click', function(event) {
|
||||
if ($(event.target).attr('id') === 'lightbox') {
|
||||
self.end();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$lightbox.find('.lb-prev').on('click', function() {
|
||||
if (self.currentImageIndex === 0) {
|
||||
self.changeImage(self.album.length - 1);
|
||||
} else {
|
||||
self.changeImage(self.currentImageIndex - 1);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$lightbox.find('.lb-next').on('click', function() {
|
||||
if (self.currentImageIndex === self.album.length - 1) {
|
||||
self.changeImage(0);
|
||||
} else {
|
||||
self.changeImage(self.currentImageIndex + 1);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
/*
|
||||
Show context menu for image on right-click
|
||||
|
||||
There is a div containing the navigation that spans the entire image and lives above of it. If
|
||||
you right-click, you are right clicking this div and not the image. This prevents users from
|
||||
saving the image or using other context menu actions with the image.
|
||||
|
||||
To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we
|
||||
set pointer-events to none on the nav div. This is so that the upcoming right-click event on
|
||||
the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs
|
||||
we set the pointer events back to auto for the nav div so it can capture hover and left-click
|
||||
events as usual.
|
||||
*/
|
||||
this.$nav.on('mousedown', function(event) {
|
||||
if (event.which === 3) {
|
||||
self.$nav.css('pointer-events', 'none');
|
||||
|
||||
self.$lightbox.one('contextmenu', function() {
|
||||
setTimeout(function() {
|
||||
this.$nav.css('pointer-events', 'auto');
|
||||
}.bind(self), 0);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.$lightbox.find('.lb-loader, .lb-close').on('click', function() {
|
||||
self.end();
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
// Show overlay and lightbox. If the image is part of a set, add siblings to album array.
|
||||
Lightbox.prototype.start = function($link) {
|
||||
var self = this;
|
||||
var $window = $(window);
|
||||
|
||||
$window.on('resize', $.proxy(this.sizeOverlay, this));
|
||||
|
||||
this.sizeOverlay();
|
||||
|
||||
this.album = [];
|
||||
var imageNumber = 0;
|
||||
|
||||
function addToAlbum($link) {
|
||||
self.album.push({
|
||||
alt: $link.attr('data-alt'),
|
||||
link: $link.attr('href'),
|
||||
title: $link.attr('data-title') || $link.attr('title')
|
||||
});
|
||||
}
|
||||
|
||||
// Support both data-lightbox attribute and rel attribute implementations
|
||||
var dataLightboxValue = $link.attr('data-lightbox');
|
||||
var $links;
|
||||
|
||||
if (dataLightboxValue) {
|
||||
$links = $($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]');
|
||||
for (var i = 0; i < $links.length; i = ++i) {
|
||||
addToAlbum($($links[i]));
|
||||
if ($links[i] === $link[0]) {
|
||||
imageNumber = i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($link.attr('rel') === 'lightbox') {
|
||||
// If image is not part of a set
|
||||
addToAlbum($link);
|
||||
} else {
|
||||
// If image is part of a set
|
||||
$links = $($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]');
|
||||
for (var j = 0; j < $links.length; j = ++j) {
|
||||
addToAlbum($($links[j]));
|
||||
if ($links[j] === $link[0]) {
|
||||
imageNumber = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Position Lightbox
|
||||
var top = $window.scrollTop() + this.options.positionFromTop;
|
||||
var left = $window.scrollLeft();
|
||||
this.$lightbox.css({
|
||||
top: top + 'px',
|
||||
left: left + 'px'
|
||||
}).fadeIn(this.options.fadeDuration);
|
||||
|
||||
// Disable scrolling of the page while open
|
||||
if (this.options.disableScrolling) {
|
||||
$('body').addClass('lb-disable-scrolling');
|
||||
}
|
||||
|
||||
this.changeImage(imageNumber);
|
||||
};
|
||||
|
||||
// Hide most UI elements in preparation for the animated resizing of the lightbox.
|
||||
Lightbox.prototype.changeImage = function(imageNumber) {
|
||||
var self = this;
|
||||
var filename = this.album[imageNumber].link;
|
||||
var filetype = filename.split('.').slice(-1)[0];
|
||||
var $image = this.$lightbox.find('.lb-image');
|
||||
|
||||
// Disable keyboard nav during transitions
|
||||
this.disableKeyboardNav();
|
||||
|
||||
// Show loading state
|
||||
this.$overlay.fadeIn(this.options.fadeDuration);
|
||||
$('.lb-loader').fadeIn('slow');
|
||||
this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
|
||||
this.$outerContainer.addClass('animating');
|
||||
|
||||
// When image to show is preloaded, we send the width and height to sizeContainer()
|
||||
var preloader = new Image();
|
||||
preloader.onload = function() {
|
||||
var $preloader;
|
||||
var imageHeight;
|
||||
var imageWidth;
|
||||
var maxImageHeight;
|
||||
var maxImageWidth;
|
||||
var windowHeight;
|
||||
var windowWidth;
|
||||
|
||||
$image.attr({
|
||||
'alt': self.album[imageNumber].alt,
|
||||
'src': filename
|
||||
});
|
||||
|
||||
$preloader = $(preloader);
|
||||
|
||||
$image.width(preloader.width);
|
||||
$image.height(preloader.height);
|
||||
windowWidth = $(window).width();
|
||||
windowHeight = $(window).height();
|
||||
|
||||
// Calculate the max image dimensions for the current viewport.
|
||||
// Take into account the border around the image and an additional 10px gutter on each side.
|
||||
maxImageWidth = windowWidth - self.containerPadding.left - self.containerPadding.right - self.imageBorderWidth.left - self.imageBorderWidth.right - 20;
|
||||
maxImageHeight = windowHeight - self.containerPadding.top - self.containerPadding.bottom - self.imageBorderWidth.top - self.imageBorderWidth.bottom - self.options.positionFromTop - 70;
|
||||
|
||||
/*
|
||||
Since many SVGs have small intrinsic dimensions, but they support scaling
|
||||
up without quality loss because of their vector format, max out their
|
||||
size.
|
||||
*/
|
||||
if (filetype === 'svg') {
|
||||
$image.width(maxImageWidth);
|
||||
$image.height(maxImageHeight);
|
||||
}
|
||||
|
||||
// Fit image inside the viewport.
|
||||
if (self.options.fitImagesInViewport) {
|
||||
|
||||
// Check if image size is larger then maxWidth|maxHeight in settings
|
||||
if (self.options.maxWidth && self.options.maxWidth < maxImageWidth) {
|
||||
maxImageWidth = self.options.maxWidth;
|
||||
}
|
||||
if (self.options.maxHeight && self.options.maxHeight < maxImageHeight) {
|
||||
maxImageHeight = self.options.maxHeight;
|
||||
}
|
||||
|
||||
} else {
|
||||
maxImageWidth = self.options.maxWidth || preloader.width || maxImageWidth;
|
||||
maxImageHeight = self.options.maxHeight || preloader.height || maxImageHeight;
|
||||
}
|
||||
|
||||
// Is the current image's width or height is greater than the maxImageWidth or maxImageHeight
|
||||
// option than we need to size down while maintaining the aspect ratio.
|
||||
if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) {
|
||||
if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) {
|
||||
imageWidth = maxImageWidth;
|
||||
imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10);
|
||||
$image.width(imageWidth);
|
||||
$image.height(imageHeight);
|
||||
} else {
|
||||
imageHeight = maxImageHeight;
|
||||
imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10);
|
||||
$image.width(imageWidth);
|
||||
$image.height(imageHeight);
|
||||
}
|
||||
}
|
||||
self.sizeContainer($image.width(), $image.height());
|
||||
};
|
||||
|
||||
// Preload image before showing
|
||||
preloader.src = this.album[imageNumber].link;
|
||||
this.currentImageIndex = imageNumber;
|
||||
};
|
||||
|
||||
// Stretch overlay to fit the viewport
|
||||
Lightbox.prototype.sizeOverlay = function() {
|
||||
var self = this;
|
||||
/*
|
||||
We use a setTimeout 0 to pause JS execution and let the rendering catch-up.
|
||||
Why do this? If the `disableScrolling` option is set to true, a class is added to the body
|
||||
tag that disables scrolling and hides the scrollbar. We want to make sure the scrollbar is
|
||||
hidden before we measure the document width, as the presence of the scrollbar will affect the
|
||||
number.
|
||||
*/
|
||||
setTimeout(function() {
|
||||
self.$overlay
|
||||
.width($(document).width())
|
||||
.height($(document).height());
|
||||
|
||||
}, 0);
|
||||
};
|
||||
|
||||
// Animate the size of the lightbox to fit the image we are showing
|
||||
// This method also shows the the image.
|
||||
Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {
|
||||
var self = this;
|
||||
|
||||
var oldWidth = this.$outerContainer.outerWidth();
|
||||
var oldHeight = this.$outerContainer.outerHeight();
|
||||
var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + this.imageBorderWidth.left + this.imageBorderWidth.right;
|
||||
var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + this.imageBorderWidth.top + this.imageBorderWidth.bottom;
|
||||
|
||||
function postResize() {
|
||||
self.$lightbox.find('.lb-dataContainer').width(newWidth);
|
||||
self.$lightbox.find('.lb-prevLink').height(newHeight);
|
||||
self.$lightbox.find('.lb-nextLink').height(newHeight);
|
||||
|
||||
// Set focus on one of the two root nodes so keyboard events are captured.
|
||||
self.$overlay.focus();
|
||||
|
||||
self.showImage();
|
||||
}
|
||||
|
||||
if (oldWidth !== newWidth || oldHeight !== newHeight) {
|
||||
this.$outerContainer.animate({
|
||||
width: newWidth,
|
||||
height: newHeight
|
||||
}, this.options.resizeDuration, 'swing', function() {
|
||||
postResize();
|
||||
});
|
||||
} else {
|
||||
postResize();
|
||||
}
|
||||
};
|
||||
|
||||
// Display the image and its details and begin preload neighboring images.
|
||||
Lightbox.prototype.showImage = function() {
|
||||
this.$lightbox.find('.lb-loader').stop(true).hide();
|
||||
this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
|
||||
|
||||
this.updateNav();
|
||||
this.updateDetails();
|
||||
this.preloadNeighboringImages();
|
||||
this.enableKeyboardNav();
|
||||
};
|
||||
|
||||
// Display previous and next navigation if appropriate.
|
||||
Lightbox.prototype.updateNav = function() {
|
||||
// Check to see if the browser supports touch events. If so, we take the conservative approach
|
||||
// and assume that mouse hover events are not supported and always show prev/next navigation
|
||||
// arrows in image sets.
|
||||
var alwaysShowNav = false;
|
||||
try {
|
||||
document.createEvent('TouchEvent');
|
||||
alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices) ? true : false;
|
||||
} catch (e) {}
|
||||
|
||||
this.$lightbox.find('.lb-nav').show();
|
||||
|
||||
if (this.album.length > 1) {
|
||||
if (this.options.wrapAround) {
|
||||
if (alwaysShowNav) {
|
||||
this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1');
|
||||
}
|
||||
this.$lightbox.find('.lb-prev, .lb-next').show();
|
||||
} else {
|
||||
if (this.currentImageIndex > 0) {
|
||||
this.$lightbox.find('.lb-prev').show();
|
||||
if (alwaysShowNav) {
|
||||
this.$lightbox.find('.lb-prev').css('opacity', '1');
|
||||
}
|
||||
}
|
||||
if (this.currentImageIndex < this.album.length - 1) {
|
||||
this.$lightbox.find('.lb-next').show();
|
||||
if (alwaysShowNav) {
|
||||
this.$lightbox.find('.lb-next').css('opacity', '1');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Display caption, image number, and closing button.
|
||||
Lightbox.prototype.updateDetails = function() {
|
||||
var self = this;
|
||||
|
||||
// Enable anchor clicks in the injected caption html.
|
||||
// Thanks Nate Wright for the fix. @https://github.com/NateWr
|
||||
if (typeof this.album[this.currentImageIndex].title !== 'undefined' &&
|
||||
this.album[this.currentImageIndex].title !== '') {
|
||||
var $caption = this.$lightbox.find('.lb-caption');
|
||||
if (this.options.sanitizeTitle) {
|
||||
$caption.text(this.album[this.currentImageIndex].title);
|
||||
} else {
|
||||
$caption.html(this.album[this.currentImageIndex].title);
|
||||
}
|
||||
$caption.fadeIn('fast');
|
||||
}
|
||||
|
||||
if (this.album.length > 1 && this.options.showImageNumberLabel) {
|
||||
var labelText = this.imageCountLabel(this.currentImageIndex + 1, this.album.length);
|
||||
this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast');
|
||||
} else {
|
||||
this.$lightbox.find('.lb-number').hide();
|
||||
}
|
||||
|
||||
this.$outerContainer.removeClass('animating');
|
||||
|
||||
this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function() {
|
||||
return self.sizeOverlay();
|
||||
});
|
||||
};
|
||||
|
||||
// Preload previous and next images in set.
|
||||
Lightbox.prototype.preloadNeighboringImages = function() {
|
||||
if (this.album.length > this.currentImageIndex + 1) {
|
||||
var preloadNext = new Image();
|
||||
preloadNext.src = this.album[this.currentImageIndex + 1].link;
|
||||
}
|
||||
if (this.currentImageIndex > 0) {
|
||||
var preloadPrev = new Image();
|
||||
preloadPrev.src = this.album[this.currentImageIndex - 1].link;
|
||||
}
|
||||
};
|
||||
|
||||
Lightbox.prototype.enableKeyboardNav = function() {
|
||||
this.$lightbox.on('keyup.keyboard', $.proxy(this.keyboardAction, this));
|
||||
this.$overlay.on('keyup.keyboard', $.proxy(this.keyboardAction, this));
|
||||
};
|
||||
|
||||
Lightbox.prototype.disableKeyboardNav = function() {
|
||||
this.$lightbox.off('.keyboard');
|
||||
this.$overlay.off('.keyboard');
|
||||
};
|
||||
|
||||
Lightbox.prototype.keyboardAction = function(event) {
|
||||
var KEYCODE_ESC = 27;
|
||||
var KEYCODE_LEFTARROW = 37;
|
||||
var KEYCODE_RIGHTARROW = 39;
|
||||
|
||||
var keycode = event.keyCode;
|
||||
if (keycode === KEYCODE_ESC) {
|
||||
// Prevent bubbling so as to not affect other components on the page.
|
||||
event.stopPropagation();
|
||||
this.end();
|
||||
} else if (keycode === KEYCODE_LEFTARROW) {
|
||||
if (this.currentImageIndex !== 0) {
|
||||
this.changeImage(this.currentImageIndex - 1);
|
||||
} else if (this.options.wrapAround && this.album.length > 1) {
|
||||
this.changeImage(this.album.length - 1);
|
||||
}
|
||||
} else if (keycode === KEYCODE_RIGHTARROW) {
|
||||
if (this.currentImageIndex !== this.album.length - 1) {
|
||||
this.changeImage(this.currentImageIndex + 1);
|
||||
} else if (this.options.wrapAround && this.album.length > 1) {
|
||||
this.changeImage(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Closing time. :-(
|
||||
Lightbox.prototype.end = function() {
|
||||
this.disableKeyboardNav();
|
||||
$(window).off('resize', this.sizeOverlay);
|
||||
this.$lightbox.fadeOut(this.options.fadeDuration);
|
||||
this.$overlay.fadeOut(this.options.fadeDuration);
|
||||
|
||||
if (this.options.disableScrolling) {
|
||||
$('body').removeClass('lb-disable-scrolling');
|
||||
}
|
||||
};
|
||||
|
||||
return new Lightbox();
|
||||
}));
|
||||
+4601
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,66 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /assets/js/pdf.js
|
||||
Desc. : JS - Cetak Laporan PDF
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : April 6th, 2015.
|
||||
Last Modified : October 18th, 2020.
|
||||
|
||||
(c) 2015 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var cPDF = function(url, options){
|
||||
var vars = {
|
||||
'url': '',
|
||||
'zoom': 80,
|
||||
'param': []
|
||||
};
|
||||
this.construct = function(url, options){
|
||||
$.extend(vars, options);
|
||||
vars.url = url;
|
||||
};
|
||||
this.set_url = function (url){
|
||||
vars.url = url;
|
||||
};
|
||||
this.set_zoom = function (zoom){
|
||||
if (zoom) vars.zoom = zoom;
|
||||
},
|
||||
this.add_param = function (par_id, par_val){
|
||||
var _getvalue = (par_val) ? par_id + "=" + escape(par_val) : par_id;
|
||||
vars.param.push(_getvalue);
|
||||
},
|
||||
this.downloadPDF = function(){
|
||||
if (!vars.url) {
|
||||
console.warn(vars.param + ", cek url php!");
|
||||
return false;
|
||||
}
|
||||
vars.data = FoniaJS.RequestParam(vars.param);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: vars.url,
|
||||
data: (vars.data).join('&'),
|
||||
success: (typeof vars.onSuccess === "function") ? vars.onSuccess : null,
|
||||
error: (typeof vars.onFailure === "function") ? vars.onFailure : null,
|
||||
}).always(FoniaJS.FormDecorated);
|
||||
return this;
|
||||
};
|
||||
this.showPDF = function(){
|
||||
var _proto = window.location.protocol + '//';
|
||||
var _src = _proto + FoniaJS.WEB_HOST + vars.url + '?' + (FoniaJS.RequestParam(vars.param)).join('&') + '#zoom='+vars.zoom+',0,0&page=1';
|
||||
var _wtxt =
|
||||
'<div class="modal fade" id="winAPPPDF" tabindex="-1" role="dialog" data-keyboard="false" data-show="false" data-backdrop="static" aria-labelledby="winAPPPDFLabel" aria-hidden="true">'+
|
||||
'<div class="modal-dialog modal-dialog-centered modal-fs" role="document">'+
|
||||
'<div class="modal-content">'+
|
||||
'<div class="modal-header"><h5 class="modal-title" id="winAPPPDFLabel">Preview PDF</h5><button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div>'+
|
||||
'<div class="modal-body mb-0 p-0"><div class="embed-responsive embed-responsive-21by9"><object class="embed-responsive-item" type="application/pdf" data="'+_src+'"><p>Tidak Mendukung Preview PDF</p></object></div></div>'+
|
||||
'</div></div></div>';
|
||||
if ($('#winAPPPDF')) $('#winAPPPDF').modal('dispose').remove();
|
||||
$(_wtxt).on('shown.coreui.modal', function(e){
|
||||
FoniaJS.FormDecorated();
|
||||
}).on('hidden.coreui.modal', function(e){
|
||||
$(this).remove();
|
||||
}).modal('show');
|
||||
};
|
||||
this.construct(url, options);
|
||||
};
|
||||
@@ -0,0 +1,519 @@
|
||||
/*!
|
||||
* perfect-scrollbar v1.4.0
|
||||
* (c) 2018 Hyunje Jun
|
||||
* @license MIT
|
||||
*/
|
||||
! function(t, e) {
|
||||
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.PerfectScrollbar = e()
|
||||
}(this, function() {
|
||||
"use strict";
|
||||
|
||||
function t(t) {
|
||||
return getComputedStyle(t)
|
||||
}
|
||||
|
||||
function e(t, e) {
|
||||
for (var i in e) {
|
||||
var r = e[i];
|
||||
"number" == typeof r && (r += "px"), t.style[i] = r
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
function i(t) {
|
||||
var e = document.createElement("div");
|
||||
return e.className = t, e
|
||||
}
|
||||
|
||||
function r(t, e) {
|
||||
if (!v) throw new Error("No element matching method supported");
|
||||
return v.call(t, e)
|
||||
}
|
||||
|
||||
function l(t) {
|
||||
t.remove ? t.remove() : t.parentNode && t.parentNode.removeChild(t)
|
||||
}
|
||||
|
||||
function n(t, e) {
|
||||
return Array.prototype.filter.call(t.children, function(t) {
|
||||
return r(t, e)
|
||||
})
|
||||
}
|
||||
|
||||
function o(t, e) {
|
||||
var i = t.element.classList,
|
||||
r = m.state.scrolling(e);
|
||||
i.contains(r) ? clearTimeout(Y[e]) : i.add(r)
|
||||
}
|
||||
|
||||
function s(t, e) {
|
||||
Y[e] = setTimeout(function() {
|
||||
return t.isAlive && t.element.classList.remove(m.state.scrolling(e))
|
||||
}, t.settings.scrollingThreshold)
|
||||
}
|
||||
|
||||
function a(t, e) {
|
||||
o(t, e), s(t, e)
|
||||
}
|
||||
|
||||
function c(t) {
|
||||
if ("function" == typeof window.CustomEvent) return new CustomEvent(t);
|
||||
var e = document.createEvent("CustomEvent");
|
||||
return e.initCustomEvent(t, !1, !1, void 0), e
|
||||
}
|
||||
|
||||
function h(t, e, i, r, l) {
|
||||
var n = i[0],
|
||||
o = i[1],
|
||||
s = i[2],
|
||||
h = i[3],
|
||||
u = i[4],
|
||||
d = i[5];
|
||||
void 0 === r && (r = !0), void 0 === l && (l = !1);
|
||||
var f = t.element;
|
||||
t.reach[h] = null, f[s] < 1 && (t.reach[h] = "start"), f[s] > t[n] - t[o] - 1 && (t.reach[h] = "end"), e && (f.dispatchEvent(c("ps-scroll-" + h)), e < 0 ? f.dispatchEvent(c("ps-scroll-" + u)) : e > 0 && f.dispatchEvent(c("ps-scroll-" + d)), r && a(t, h)), t.reach[h] && (e || l) && f.dispatchEvent(c("ps-" + h + "-reach-" + t.reach[h]))
|
||||
}
|
||||
|
||||
function u(t) {
|
||||
return parseInt(t, 10) || 0
|
||||
}
|
||||
|
||||
function d(t) {
|
||||
return r(t, "input,[contenteditable]") || r(t, "select,[contenteditable]") || r(t, "textarea,[contenteditable]") || r(t, "button,[contenteditable]")
|
||||
}
|
||||
|
||||
function f(e) {
|
||||
var i = t(e);
|
||||
return u(i.width) + u(i.paddingLeft) + u(i.paddingRight) + u(i.borderLeftWidth) + u(i.borderRightWidth)
|
||||
}
|
||||
|
||||
function p(t, e) {
|
||||
return t.settings.minScrollbarLength && (e = Math.max(e, t.settings.minScrollbarLength)), t.settings.maxScrollbarLength && (e = Math.min(e, t.settings.maxScrollbarLength)), e
|
||||
}
|
||||
|
||||
function b(t, i) {
|
||||
var r = {
|
||||
width: i.railXWidth
|
||||
},
|
||||
l = Math.floor(t.scrollTop);
|
||||
i.isRtl ? r.left = i.negativeScrollAdjustment + t.scrollLeft + i.containerWidth - i.contentWidth : r.left = t.scrollLeft, i.isScrollbarXUsingBottom ? r.bottom = i.scrollbarXBottom - l : r.top = i.scrollbarXTop + l, e(i.scrollbarXRail, r);
|
||||
var n = {
|
||||
top: l,
|
||||
height: i.railYHeight
|
||||
};
|
||||
i.isScrollbarYUsingRight ? i.isRtl ? n.right = i.contentWidth - (i.negativeScrollAdjustment + t.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth : n.right = i.scrollbarYRight - t.scrollLeft : i.isRtl ? n.left = i.negativeScrollAdjustment + t.scrollLeft + 2 * i.containerWidth - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth : n.left = i.scrollbarYLeft + t.scrollLeft, e(i.scrollbarYRail, n), e(i.scrollbarX, {
|
||||
left: i.scrollbarXLeft,
|
||||
width: i.scrollbarXWidth - i.railBorderXWidth
|
||||
}), e(i.scrollbarY, {
|
||||
top: i.scrollbarYTop,
|
||||
height: i.scrollbarYHeight - i.railBorderYWidth
|
||||
})
|
||||
}
|
||||
|
||||
function g(t, e) {
|
||||
function i(e) {
|
||||
b[d] = g + Y * (e[a] - v), o(t, f), R(t), e.stopPropagation(), e.preventDefault()
|
||||
}
|
||||
|
||||
function r() {
|
||||
s(t, f), t[p].classList.remove(m.state.clicking), t.event.unbind(t.ownerDocument, "mousemove", i)
|
||||
}
|
||||
var l = e[0],
|
||||
n = e[1],
|
||||
a = e[2],
|
||||
c = e[3],
|
||||
h = e[4],
|
||||
u = e[5],
|
||||
d = e[6],
|
||||
f = e[7],
|
||||
p = e[8],
|
||||
b = t.element,
|
||||
g = null,
|
||||
v = null,
|
||||
Y = null;
|
||||
t.event.bind(t[h], "mousedown", function(e) {
|
||||
g = b[d], v = e[a], Y = (t[n] - t[l]) / (t[c] - t[u]), t.event.bind(t.ownerDocument, "mousemove", i), t.event.once(t.ownerDocument, "mouseup", r), t[p].classList.add(m.state.clicking), e.stopPropagation(), e.preventDefault()
|
||||
})
|
||||
}
|
||||
var v = "undefined" != typeof Element && (Element.prototype.matches || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector),
|
||||
m = {
|
||||
main: "ps",
|
||||
element: {
|
||||
thumb: function(t) {
|
||||
return "ps__thumb-" + t
|
||||
},
|
||||
rail: function(t) {
|
||||
return "ps__rail-" + t
|
||||
},
|
||||
consuming: "ps__child--consume"
|
||||
},
|
||||
state: {
|
||||
focus: "ps--focus",
|
||||
clicking: "ps--clicking",
|
||||
active: function(t) {
|
||||
return "ps--active-" + t
|
||||
},
|
||||
scrolling: function(t) {
|
||||
return "ps--scrolling-" + t
|
||||
}
|
||||
}
|
||||
},
|
||||
Y = {
|
||||
x: null,
|
||||
y: null
|
||||
},
|
||||
X = function(t) {
|
||||
this.element = t, this.handlers = {}
|
||||
},
|
||||
w = {
|
||||
isEmpty: {
|
||||
configurable: !0
|
||||
}
|
||||
};
|
||||
X.prototype.bind = function(t, e) {
|
||||
void 0 === this.handlers[t] && (this.handlers[t] = []), this.handlers[t].push(e), this.element.addEventListener(t, e, !1)
|
||||
}, X.prototype.unbind = function(t, e) {
|
||||
var i = this;
|
||||
this.handlers[t] = this.handlers[t].filter(function(r) {
|
||||
return !(!e || r === e) || (i.element.removeEventListener(t, r, !1), !1)
|
||||
})
|
||||
}, X.prototype.unbindAll = function() {
|
||||
var t = this;
|
||||
for (var e in t.handlers) t.unbind(e)
|
||||
}, w.isEmpty.get = function() {
|
||||
var t = this;
|
||||
return Object.keys(this.handlers).every(function(e) {
|
||||
return 0 === t.handlers[e].length
|
||||
})
|
||||
}, Object.defineProperties(X.prototype, w);
|
||||
var y = function() {
|
||||
this.eventElements = []
|
||||
};
|
||||
y.prototype.eventElement = function(t) {
|
||||
var e = this.eventElements.filter(function(e) {
|
||||
return e.element === t
|
||||
})[0];
|
||||
return e || (e = new X(t), this.eventElements.push(e)), e
|
||||
}, y.prototype.bind = function(t, e, i) {
|
||||
this.eventElement(t).bind(e, i)
|
||||
}, y.prototype.unbind = function(t, e, i) {
|
||||
var r = this.eventElement(t);
|
||||
r.unbind(e, i), r.isEmpty && this.eventElements.splice(this.eventElements.indexOf(r), 1)
|
||||
}, y.prototype.unbindAll = function() {
|
||||
this.eventElements.forEach(function(t) {
|
||||
return t.unbindAll()
|
||||
}), this.eventElements = []
|
||||
}, y.prototype.once = function(t, e, i) {
|
||||
var r = this.eventElement(t),
|
||||
l = function(t) {
|
||||
r.unbind(e, l), i(t)
|
||||
};
|
||||
r.bind(e, l)
|
||||
};
|
||||
var W = function(t, e, i, r, l) {
|
||||
void 0 === r && (r = !0), void 0 === l && (l = !1);
|
||||
var n;
|
||||
if ("top" === e) n = ["contentHeight", "containerHeight", "scrollTop", "y", "up", "down"];
|
||||
else {
|
||||
if ("left" !== e) throw new Error("A proper axis should be provided");
|
||||
n = ["contentWidth", "containerWidth", "scrollLeft", "x", "left", "right"]
|
||||
}
|
||||
h(t, i, n, r, l)
|
||||
},
|
||||
L = {
|
||||
isWebKit: "undefined" != typeof document && "WebkitAppearance" in document.documentElement.style,
|
||||
supportsTouch: "undefined" != typeof window && ("ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch),
|
||||
supportsIePointer: "undefined" != typeof navigator && navigator.msMaxTouchPoints,
|
||||
isChrome: "undefined" != typeof navigator && /Chrome/i.test(navigator && navigator.userAgent)
|
||||
},
|
||||
R = function(t) {
|
||||
var e = t.element,
|
||||
i = Math.floor(e.scrollTop);
|
||||
t.containerWidth = e.clientWidth, t.containerHeight = e.clientHeight, t.contentWidth = e.scrollWidth, t.contentHeight = e.scrollHeight, e.contains(t.scrollbarXRail) || (n(e, m.element.rail("x")).forEach(function(t) {
|
||||
return l(t)
|
||||
}), e.appendChild(t.scrollbarXRail)), e.contains(t.scrollbarYRail) || (n(e, m.element.rail("y")).forEach(function(t) {
|
||||
return l(t)
|
||||
}), e.appendChild(t.scrollbarYRail)), !t.settings.suppressScrollX && t.containerWidth + t.settings.scrollXMarginOffset < t.contentWidth ? (t.scrollbarXActive = !0, t.railXWidth = t.containerWidth - t.railXMarginWidth, t.railXRatio = t.containerWidth / t.railXWidth, t.scrollbarXWidth = p(t, u(t.railXWidth * t.containerWidth / t.contentWidth)), t.scrollbarXLeft = u((t.negativeScrollAdjustment + e.scrollLeft) * (t.railXWidth - t.scrollbarXWidth) / (t.contentWidth - t.containerWidth))) : t.scrollbarXActive = !1, !t.settings.suppressScrollY && t.containerHeight + t.settings.scrollYMarginOffset < t.contentHeight ? (t.scrollbarYActive = !0, t.railYHeight = t.containerHeight - t.railYMarginHeight, t.railYRatio = t.containerHeight / t.railYHeight, t.scrollbarYHeight = p(t, u(t.railYHeight * t.containerHeight / t.contentHeight)), t.scrollbarYTop = u(i * (t.railYHeight - t.scrollbarYHeight) / (t.contentHeight - t.containerHeight))) : t.scrollbarYActive = !1, t.scrollbarXLeft >= t.railXWidth - t.scrollbarXWidth && (t.scrollbarXLeft = t.railXWidth - t.scrollbarXWidth), t.scrollbarYTop >= t.railYHeight - t.scrollbarYHeight && (t.scrollbarYTop = t.railYHeight - t.scrollbarYHeight), b(e, t), t.scrollbarXActive ? e.classList.add(m.state.active("x")) : (e.classList.remove(m.state.active("x")), t.scrollbarXWidth = 0, t.scrollbarXLeft = 0, e.scrollLeft = 0), t.scrollbarYActive ? e.classList.add(m.state.active("y")) : (e.classList.remove(m.state.active("y")), t.scrollbarYHeight = 0, t.scrollbarYTop = 0, e.scrollTop = 0)
|
||||
},
|
||||
T = {
|
||||
"click-rail": function(t) {
|
||||
t.event.bind(t.scrollbarY, "mousedown", function(t) {
|
||||
return t.stopPropagation()
|
||||
}), t.event.bind(t.scrollbarYRail, "mousedown", function(e) {
|
||||
var i = e.pageY - window.pageYOffset - t.scrollbarYRail.getBoundingClientRect().top > t.scrollbarYTop ? 1 : -1;
|
||||
t.element.scrollTop += i * t.containerHeight, R(t), e.stopPropagation()
|
||||
}), t.event.bind(t.scrollbarX, "mousedown", function(t) {
|
||||
return t.stopPropagation()
|
||||
}), t.event.bind(t.scrollbarXRail, "mousedown", function(e) {
|
||||
var i = e.pageX - window.pageXOffset - t.scrollbarXRail.getBoundingClientRect().left > t.scrollbarXLeft ? 1 : -1;
|
||||
t.element.scrollLeft += i * t.containerWidth, R(t), e.stopPropagation()
|
||||
})
|
||||
},
|
||||
"drag-thumb": function(t) {
|
||||
g(t, ["containerWidth", "contentWidth", "pageX", "railXWidth", "scrollbarX", "scrollbarXWidth", "scrollLeft", "x", "scrollbarXRail"]), g(t, ["containerHeight", "contentHeight", "pageY", "railYHeight", "scrollbarY", "scrollbarYHeight", "scrollTop", "y", "scrollbarYRail"])
|
||||
},
|
||||
keyboard: function(t) {
|
||||
function e(e, r) {
|
||||
var l = Math.floor(i.scrollTop);
|
||||
if (0 === e) {
|
||||
if (!t.scrollbarYActive) return !1;
|
||||
if (0 === l && r > 0 || l >= t.contentHeight - t.containerHeight && r < 0) return !t.settings.wheelPropagation
|
||||
}
|
||||
var n = i.scrollLeft;
|
||||
if (0 === r) {
|
||||
if (!t.scrollbarXActive) return !1;
|
||||
if (0 === n && e < 0 || n >= t.contentWidth - t.containerWidth && e > 0) return !t.settings.wheelPropagation
|
||||
}
|
||||
return !0
|
||||
}
|
||||
var i = t.element,
|
||||
l = function() {
|
||||
return r(i, ":hover")
|
||||
},
|
||||
n = function() {
|
||||
return r(t.scrollbarX, ":focus") || r(t.scrollbarY, ":focus")
|
||||
};
|
||||
t.event.bind(t.ownerDocument, "keydown", function(r) {
|
||||
if (!(r.isDefaultPrevented && r.isDefaultPrevented() || r.defaultPrevented) && (l() || n())) {
|
||||
var o = document.activeElement ? document.activeElement : t.ownerDocument.activeElement;
|
||||
if (o) {
|
||||
if ("IFRAME" === o.tagName) o = o.contentDocument.activeElement;
|
||||
else
|
||||
for (; o.shadowRoot;) o = o.shadowRoot.activeElement;
|
||||
if (d(o)) return
|
||||
}
|
||||
var s = 0,
|
||||
a = 0;
|
||||
switch (r.which) {
|
||||
case 37:
|
||||
s = r.metaKey ? -t.contentWidth : r.altKey ? -t.containerWidth : -30;
|
||||
break;
|
||||
case 38:
|
||||
a = r.metaKey ? t.contentHeight : r.altKey ? t.containerHeight : 30;
|
||||
break;
|
||||
case 39:
|
||||
s = r.metaKey ? t.contentWidth : r.altKey ? t.containerWidth : 30;
|
||||
break;
|
||||
case 40:
|
||||
a = r.metaKey ? -t.contentHeight : r.altKey ? -t.containerHeight : -30;
|
||||
break;
|
||||
case 32:
|
||||
a = r.shiftKey ? t.containerHeight : -t.containerHeight;
|
||||
break;
|
||||
case 33:
|
||||
a = t.containerHeight;
|
||||
break;
|
||||
case 34:
|
||||
a = -t.containerHeight;
|
||||
break;
|
||||
case 36:
|
||||
a = t.contentHeight;
|
||||
break;
|
||||
case 35:
|
||||
a = -t.contentHeight;
|
||||
break;
|
||||
default:
|
||||
return
|
||||
}
|
||||
t.settings.suppressScrollX && 0 !== s || t.settings.suppressScrollY && 0 !== a || (i.scrollTop -= a, i.scrollLeft += s, R(t), e(s, a) && r.preventDefault())
|
||||
}
|
||||
})
|
||||
},
|
||||
wheel: function(e) {
|
||||
function i(t, i) {
|
||||
var r = Math.floor(o.scrollTop),
|
||||
l = 0 === o.scrollTop,
|
||||
n = r + o.offsetHeight === o.scrollHeight,
|
||||
s = 0 === o.scrollLeft,
|
||||
a = o.scrollLeft + o.offsetWidth === o.scrollWidth;
|
||||
return !(Math.abs(i) > Math.abs(t) ? l || n : s || a) || !e.settings.wheelPropagation
|
||||
}
|
||||
|
||||
function r(t) {
|
||||
var e = t.deltaX,
|
||||
i = -1 * t.deltaY;
|
||||
return void 0 !== e && void 0 !== i || (e = -1 * t.wheelDeltaX / 6, i = t.wheelDeltaY / 6), t.deltaMode && 1 === t.deltaMode && (e *= 10, i *= 10), e !== e && i !== i && (e = 0, i = t.wheelDelta), t.shiftKey ? [-i, -e] : [e, i]
|
||||
}
|
||||
|
||||
function l(e, i, r) {
|
||||
if (!L.isWebKit && o.querySelector("select:focus")) return !0;
|
||||
if (!o.contains(e)) return !1;
|
||||
for (var l = e; l && l !== o;) {
|
||||
if (l.classList.contains(m.element.consuming)) return !0;
|
||||
var n = t(l);
|
||||
if ([n.overflow, n.overflowX, n.overflowY].join("").match(/(scroll|auto)/)) {
|
||||
var s = l.scrollHeight - l.clientHeight;
|
||||
if (s > 0 && !(0 === l.scrollTop && r > 0 || l.scrollTop === s && r < 0)) return !0;
|
||||
var a = l.scrollWidth - l.clientWidth;
|
||||
if (a > 0 && !(0 === l.scrollLeft && i < 0 || l.scrollLeft === a && i > 0)) return !0
|
||||
}
|
||||
l = l.parentNode
|
||||
}
|
||||
return !1
|
||||
}
|
||||
|
||||
function n(t) {
|
||||
var n = r(t),
|
||||
s = n[0],
|
||||
a = n[1];
|
||||
if (!l(t.target, s, a)) {
|
||||
var c = !1;
|
||||
e.settings.useBothWheelAxes ? e.scrollbarYActive && !e.scrollbarXActive ? (a ? o.scrollTop -= a * e.settings.wheelSpeed : o.scrollTop += s * e.settings.wheelSpeed, c = !0) : e.scrollbarXActive && !e.scrollbarYActive && (s ? o.scrollLeft += s * e.settings.wheelSpeed : o.scrollLeft -= a * e.settings.wheelSpeed, c = !0) : (o.scrollTop -= a * e.settings.wheelSpeed, o.scrollLeft += s * e.settings.wheelSpeed), R(e), (c = c || i(s, a)) && !t.ctrlKey && (t.stopPropagation(), t.preventDefault())
|
||||
}
|
||||
}
|
||||
var o = e.element;
|
||||
void 0 !== window.onwheel ? e.event.bind(o, "wheel", n) : void 0 !== window.onmousewheel && e.event.bind(o, "mousewheel", n)
|
||||
},
|
||||
touch: function(e) {
|
||||
function i(t, i) {
|
||||
var r = Math.floor(h.scrollTop),
|
||||
l = h.scrollLeft,
|
||||
n = Math.abs(t),
|
||||
o = Math.abs(i);
|
||||
if (o > n) {
|
||||
if (i < 0 && r === e.contentHeight - e.containerHeight || i > 0 && 0 === r) return 0 === window.scrollY && i > 0 && L.isChrome
|
||||
} else if (n > o && (t < 0 && l === e.contentWidth - e.containerWidth || t > 0 && 0 === l)) return !0;
|
||||
return !0
|
||||
}
|
||||
|
||||
function r(t, i) {
|
||||
h.scrollTop -= i, h.scrollLeft -= t, R(e)
|
||||
}
|
||||
|
||||
function l(t) {
|
||||
return t.targetTouches ? t.targetTouches[0] : t
|
||||
}
|
||||
|
||||
function n(t) {
|
||||
return !(t.pointerType && "pen" === t.pointerType && 0 === t.buttons || (!t.targetTouches || 1 !== t.targetTouches.length) && (!t.pointerType || "mouse" === t.pointerType || t.pointerType === t.MSPOINTER_TYPE_MOUSE))
|
||||
}
|
||||
|
||||
function o(t) {
|
||||
if (n(t)) {
|
||||
var e = l(t);
|
||||
u.pageX = e.pageX, u.pageY = e.pageY, d = (new Date).getTime(), null !== p && clearInterval(p)
|
||||
}
|
||||
}
|
||||
|
||||
function s(e, i, r) {
|
||||
if (!h.contains(e)) return !1;
|
||||
for (var l = e; l && l !== h;) {
|
||||
if (l.classList.contains(m.element.consuming)) return !0;
|
||||
var n = t(l);
|
||||
if ([n.overflow, n.overflowX, n.overflowY].join("").match(/(scroll|auto)/)) {
|
||||
var o = l.scrollHeight - l.clientHeight;
|
||||
if (o > 0 && !(0 === l.scrollTop && r > 0 || l.scrollTop === o && r < 0)) return !0;
|
||||
var s = l.scrollLeft - l.clientWidth;
|
||||
if (s > 0 && !(0 === l.scrollLeft && i < 0 || l.scrollLeft === s && i > 0)) return !0
|
||||
}
|
||||
l = l.parentNode
|
||||
}
|
||||
return !1
|
||||
}
|
||||
|
||||
function a(t) {
|
||||
if (n(t)) {
|
||||
var e = l(t),
|
||||
o = {
|
||||
pageX: e.pageX,
|
||||
pageY: e.pageY
|
||||
},
|
||||
a = o.pageX - u.pageX,
|
||||
c = o.pageY - u.pageY;
|
||||
if (s(t.target, a, c)) return;
|
||||
r(a, c), u = o;
|
||||
var h = (new Date).getTime(),
|
||||
p = h - d;
|
||||
p > 0 && (f.x = a / p, f.y = c / p, d = h), i(a, c) && t.preventDefault()
|
||||
}
|
||||
}
|
||||
|
||||
function c() {
|
||||
e.settings.swipeEasing && (clearInterval(p), p = setInterval(function() {
|
||||
e.isInitialized ? clearInterval(p) : f.x || f.y ? Math.abs(f.x) < .01 && Math.abs(f.y) < .01 ? clearInterval(p) : (r(30 * f.x, 30 * f.y), f.x *= .8, f.y *= .8) : clearInterval(p)
|
||||
}, 10))
|
||||
}
|
||||
if (L.supportsTouch || L.supportsIePointer) {
|
||||
var h = e.element,
|
||||
u = {},
|
||||
d = 0,
|
||||
f = {},
|
||||
p = null;
|
||||
L.supportsTouch ? (e.event.bind(h, "touchstart", o), e.event.bind(h, "touchmove", a), e.event.bind(h, "touchend", c)) : L.supportsIePointer && (window.PointerEvent ? (e.event.bind(h, "pointerdown", o), e.event.bind(h, "pointermove", a), e.event.bind(h, "pointerup", c)) : window.MSPointerEvent && (e.event.bind(h, "MSPointerDown", o), e.event.bind(h, "MSPointerMove", a), e.event.bind(h, "MSPointerUp", c)))
|
||||
}
|
||||
}
|
||||
},
|
||||
H = function(r, l) {
|
||||
var n = this;
|
||||
if (void 0 === l && (l = {}), "string" == typeof r && (r = document.querySelector(r)), !r || !r.nodeName) throw new Error("no element is specified to initialize PerfectScrollbar");
|
||||
this.element = r, r.classList.add(m.main), this.settings = {
|
||||
handlers: ["click-rail", "drag-thumb", "keyboard", "wheel", "touch"],
|
||||
maxScrollbarLength: null,
|
||||
minScrollbarLength: null,
|
||||
scrollingThreshold: 1e3,
|
||||
scrollXMarginOffset: 0,
|
||||
scrollYMarginOffset: 0,
|
||||
suppressScrollX: !1,
|
||||
suppressScrollY: !1,
|
||||
swipeEasing: !0,
|
||||
useBothWheelAxes: !1,
|
||||
wheelPropagation: !0,
|
||||
wheelSpeed: 1
|
||||
};
|
||||
for (var o in l) n.settings[o] = l[o];
|
||||
this.containerWidth = null, this.containerHeight = null, this.contentWidth = null, this.contentHeight = null;
|
||||
var s = function() {
|
||||
return r.classList.add(m.state.focus)
|
||||
},
|
||||
a = function() {
|
||||
return r.classList.remove(m.state.focus)
|
||||
};
|
||||
this.isRtl = "rtl" === t(r).direction, this.isNegativeScroll = function() {
|
||||
var t = r.scrollLeft,
|
||||
e = null;
|
||||
return r.scrollLeft = -1, e = r.scrollLeft < 0, r.scrollLeft = t, e
|
||||
}(), this.negativeScrollAdjustment = this.isNegativeScroll ? r.scrollWidth - r.clientWidth : 0, this.event = new y, this.ownerDocument = r.ownerDocument || document, this.scrollbarXRail = i(m.element.rail("x")), r.appendChild(this.scrollbarXRail), this.scrollbarX = i(m.element.thumb("x")), this.scrollbarXRail.appendChild(this.scrollbarX), this.scrollbarX.setAttribute("tabindex", 0), this.event.bind(this.scrollbarX, "focus", s), this.event.bind(this.scrollbarX, "blur", a), this.scrollbarXActive = null, this.scrollbarXWidth = null, this.scrollbarXLeft = null;
|
||||
var c = t(this.scrollbarXRail);
|
||||
this.scrollbarXBottom = parseInt(c.bottom, 10), isNaN(this.scrollbarXBottom) ? (this.isScrollbarXUsingBottom = !1, this.scrollbarXTop = u(c.top)) : this.isScrollbarXUsingBottom = !0, this.railBorderXWidth = u(c.borderLeftWidth) + u(c.borderRightWidth), e(this.scrollbarXRail, {
|
||||
display: "block"
|
||||
}), this.railXMarginWidth = u(c.marginLeft) + u(c.marginRight), e(this.scrollbarXRail, {
|
||||
display: ""
|
||||
}), this.railXWidth = null, this.railXRatio = null, this.scrollbarYRail = i(m.element.rail("y")), r.appendChild(this.scrollbarYRail), this.scrollbarY = i(m.element.thumb("y")), this.scrollbarYRail.appendChild(this.scrollbarY), this.scrollbarY.setAttribute("tabindex", 0), this.event.bind(this.scrollbarY, "focus", s), this.event.bind(this.scrollbarY, "blur", a), this.scrollbarYActive = null, this.scrollbarYHeight = null, this.scrollbarYTop = null;
|
||||
var h = t(this.scrollbarYRail);
|
||||
this.scrollbarYRight = parseInt(h.right, 10), isNaN(this.scrollbarYRight) ? (this.isScrollbarYUsingRight = !1, this.scrollbarYLeft = u(h.left)) : this.isScrollbarYUsingRight = !0, this.scrollbarYOuterWidth = this.isRtl ? f(this.scrollbarY) : null, this.railBorderYWidth = u(h.borderTopWidth) + u(h.borderBottomWidth), e(this.scrollbarYRail, {
|
||||
display: "block"
|
||||
}), this.railYMarginHeight = u(h.marginTop) + u(h.marginBottom), e(this.scrollbarYRail, {
|
||||
display: ""
|
||||
}), this.railYHeight = null, this.railYRatio = null, this.reach = {
|
||||
x: r.scrollLeft <= 0 ? "start" : r.scrollLeft >= this.contentWidth - this.containerWidth ? "end" : null,
|
||||
y: r.scrollTop <= 0 ? "start" : r.scrollTop >= this.contentHeight - this.containerHeight ? "end" : null
|
||||
}, this.isAlive = !0, this.settings.handlers.forEach(function(t) {
|
||||
return T[t](n)
|
||||
}), this.lastScrollTop = Math.floor(r.scrollTop), this.lastScrollLeft = r.scrollLeft, this.event.bind(this.element, "scroll", function(t) {
|
||||
return n.onScroll(t)
|
||||
}), R(this)
|
||||
};
|
||||
return H.prototype.update = function() {
|
||||
this.isAlive && (this.negativeScrollAdjustment = this.isNegativeScroll ? this.element.scrollWidth - this.element.clientWidth : 0, e(this.scrollbarXRail, {
|
||||
display: "block"
|
||||
}), e(this.scrollbarYRail, {
|
||||
display: "block"
|
||||
}), this.railXMarginWidth = u(t(this.scrollbarXRail).marginLeft) + u(t(this.scrollbarXRail).marginRight), this.railYMarginHeight = u(t(this.scrollbarYRail).marginTop) + u(t(this.scrollbarYRail).marginBottom), e(this.scrollbarXRail, {
|
||||
display: "none"
|
||||
}), e(this.scrollbarYRail, {
|
||||
display: "none"
|
||||
}), R(this), W(this, "top", 0, !1, !0), W(this, "left", 0, !1, !0), e(this.scrollbarXRail, {
|
||||
display: ""
|
||||
}), e(this.scrollbarYRail, {
|
||||
display: ""
|
||||
}))
|
||||
}, H.prototype.onScroll = function(t) {
|
||||
this.isAlive && (R(this), W(this, "top", this.element.scrollTop - this.lastScrollTop), W(this, "left", this.element.scrollLeft - this.lastScrollLeft), this.lastScrollTop = Math.floor(this.element.scrollTop), this.lastScrollLeft = this.element.scrollLeft)
|
||||
}, H.prototype.destroy = function() {
|
||||
this.isAlive && (this.event.unbindAll(), l(this.scrollbarX), l(this.scrollbarY), l(this.scrollbarXRail), l(this.scrollbarYRail), this.removePsClasses(), this.element = null, this.scrollbarX = null, this.scrollbarY = null, this.scrollbarXRail = null, this.scrollbarYRail = null, this.isAlive = !1)
|
||||
}, H.prototype.removePsClasses = function() {
|
||||
this.element.className = this.element.className.split(" ").filter(function(t) {
|
||||
return !t.match(/^ps([-_].+|)$/)
|
||||
}).join(" ")
|
||||
}, H
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,280 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /assets/js/print.js
|
||||
Desc. : JS Class Printer & Printer POS
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : May 27th, 2007.
|
||||
Last Modified : January 26th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var cPRINTER = function(url, options){
|
||||
var vars = {
|
||||
'url': '',
|
||||
'zoom': 90,
|
||||
'param': []
|
||||
};
|
||||
this.construct = function(url, options){
|
||||
$.extend(vars, options);
|
||||
vars.url = url;
|
||||
};
|
||||
this.set_url = function (url){
|
||||
vars.url = url;
|
||||
};
|
||||
this.set_zoom = function (zoom){
|
||||
if (zoom) vars.zoom = zoom;
|
||||
},
|
||||
this.add_param = function (par_id, par_val){
|
||||
var _getvalue = (par_val) ? par_id + "=" + escape(par_val) : par_id;
|
||||
vars.param.push(_getvalue);
|
||||
},
|
||||
this.doPrint = function(){
|
||||
if (!vars.url) {
|
||||
console.warn(vars.param + ", cek url php!");
|
||||
return false;
|
||||
}
|
||||
vars.data = FoniaJS.RequestParam(vars.param);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: vars.url,
|
||||
data: (vars.data).join('&'),
|
||||
success: function(txt){
|
||||
var $printData = $('#dataPrint');
|
||||
if (!$printData.length) {
|
||||
var $printData = $('<div/>', {id:'dataPrint','class':'d-none d-print-block print-body'}).appendTo('body');
|
||||
}
|
||||
$printData.html(txt);
|
||||
window.print();
|
||||
},
|
||||
error: (typeof vars.onFailure === "function") ? vars.onFailure : null,
|
||||
});
|
||||
return this;
|
||||
};
|
||||
this.doPreview = function(){
|
||||
if (!vars.url) console.warn(vars.param + ", cek url php!");
|
||||
vars.data = FoniaJS.RequestParam(vars.param);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: vars.url,
|
||||
data: (vars.data).join('&'),
|
||||
success: function(txt){
|
||||
if ('' == txt) {
|
||||
FoniaJS.showInfo('Tidak ada data untuk pembuatan laporan !');
|
||||
return false;
|
||||
}
|
||||
var _wtxt =
|
||||
'<div class="modal fade" id="winAPPPrint" tabindex="-1" role="dialog" data-keyboard="false" data-show="false" data-backdrop="static" aria-labelledby="winAPPPrintLabel" aria-hidden="true">'+
|
||||
'<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-fs" role="document">'+
|
||||
'<div class="modal-content">'+
|
||||
'<div class="modal-header"><h5 class="modal-title" id="winAPPPrintLabel">Preview Laporan</h5><div class="ml-auto"><button class="btn btn-cetak" id="tombCetak" type="button" aria-label="Cetak"><i class="cui-print"></i><span aria-hidden="true"> Cetak</span></button><button class="btn btn-cetak" type="button" data-dismiss="modal" aria-label="Tutup"><i class="cui-x"></i><span aria-hidden="true"> Tutup</span></button></div></div>'+
|
||||
'<div class="modal-body print-body" id="divPrintP">'+txt+'</div>'+
|
||||
'</div></div></div>';
|
||||
if ($('#winAPPPrint')) $('#winAPPPrint').modal('dispose').remove();
|
||||
$(_wtxt).on('shown.coreui.modal', function(e){
|
||||
$('#winAPPPrint').find('#tombCetak').click(function(){
|
||||
var $printData = $('#dataPrint');
|
||||
if (!$printData.length) {
|
||||
var $printData = $('<div/>', {id:'dataPrint','class':'d-none d-print-block print-body'}).appendTo('body');
|
||||
}
|
||||
$printData.html($('#divPrintP').html());
|
||||
FoniaJS.closeWindow($('#winAPPPrint'));
|
||||
window.print();
|
||||
});
|
||||
}).on('hidden.coreui.modal', function(e){
|
||||
$(this).remove();
|
||||
}).modal('show');
|
||||
},
|
||||
error: (typeof vars.onFailure === "function") ? vars.onFailure : null,
|
||||
});
|
||||
};
|
||||
this.construct(url, options);
|
||||
};
|
||||
|
||||
/*
|
||||
showPreview: function() {
|
||||
toolbar: true,
|
||||
toolbarPosition: "top",
|
||||
toolbarHeight: 35,
|
||||
toolbarMenu: "PP,_,PS,PN,PB",
|
||||
toolbarOnload: function() {
|
||||
$("butPPrint").addEvent("click", function() {
|
||||
if (this.winPreview) {
|
||||
this.winPreview.close();
|
||||
}
|
||||
window.print();
|
||||
}.bind(this));
|
||||
$("butPNormal").addEvent("click", function() {
|
||||
this.winPreview.options.zoomfont = 100;
|
||||
$("winPreview_content").setStyle("font-size", this.winPreview.options.zoomfont + "%");
|
||||
}.bind(this));
|
||||
$("butPSmall").addEvent("click", function() {
|
||||
this.winPreview.options.zoomfont -= 10;
|
||||
$("winPreview_content").setStyle("font-size", this.winPreview.options.zoomfont + "%");
|
||||
}.bind(this));
|
||||
$("butPBig").addEvent("click", function() {
|
||||
this.winPreview.options.zoomfont += 10;
|
||||
$("winPreview_content").setStyle("font-size", this.winPreview.options.zoomfont + "%");
|
||||
}.bind(this));
|
||||
$("winPreview_content").setStyle("font-size", this.options.zoom + "%");
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
});*/
|
||||
|
||||
var cPRINTERPOS = function(url, options) {
|
||||
var b_default = false;
|
||||
var _options = {
|
||||
'url': '',
|
||||
'param': [],
|
||||
'printer': null
|
||||
};
|
||||
this.construct = function(url, options) {
|
||||
$.extend(_options, options);
|
||||
_options.url = url;
|
||||
if (FoniaJS._def_printer) _options.printer = FoniaJS._def_printer;
|
||||
/*if ($('#configPrinter')) {
|
||||
_options.printer = $('#configPrinter').html();
|
||||
}*/
|
||||
};
|
||||
this.detectPrinter = function() {
|
||||
if (!qz.websocket.isActive()) {
|
||||
FoniaJS.showInfo('Status Printer belum Active !');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
this.getPrinters = function() {
|
||||
return [];
|
||||
};
|
||||
this.setPrinter = function(nprint) {
|
||||
(nprint != null) && (_options.printer = nprint);
|
||||
};
|
||||
this.useDefaultPrinter = function() {
|
||||
b_default = true;
|
||||
};
|
||||
this.set_url = function(url) {
|
||||
_options.url = url;
|
||||
};
|
||||
this.add_param = function(par_id, par_val) {
|
||||
var _getvalue = (par_val) ? par_id + '=' + escape(par_val) : par_id;
|
||||
_options.param.push(_getvalue);
|
||||
};
|
||||
this.exec = function() {
|
||||
if (!this.detectPrinter()) return;
|
||||
if (this.b_default) {
|
||||
var parent = this;
|
||||
qz.printers.getDefault().then(function(data) {
|
||||
var nama_p = data;
|
||||
if (data.name != undefined) {
|
||||
nama_p = data.name;
|
||||
}
|
||||
/*if ($('#configPrinter')) {
|
||||
$('#configPrinter').html(nama_p);
|
||||
}*/
|
||||
parent._options.param.push('Printer='+nama_p);
|
||||
return parent.do_print(nama_p, parent._options.url, parent._options.param);
|
||||
}, function(data) {
|
||||
FoniaJS.showInfo(data);
|
||||
});
|
||||
} else {
|
||||
var _nprinter = _options.printer;
|
||||
if (typeof _nprinter === 'object' && _nprinter.name == undefined) {
|
||||
if (_nprinter.file != undefined) _nprinter = _nprinter.file;
|
||||
if (_nprinter.host != undefined) _nprinter = _nprinter.host + ":" + _nprinter.port;
|
||||
} else {
|
||||
if (_nprinter.name != undefined) _nprinter = _nprinter.name;
|
||||
if (_nprinter== undefined) _nprinter = 'None';
|
||||
}
|
||||
_options.param.push('Printer='+_nprinter);
|
||||
this.do_print(_options.printer, _options.url, _options.param);
|
||||
}
|
||||
};
|
||||
this.do_print = function(nama_p, url, params) {
|
||||
var qzcfg = qz.configs.create(nama_p);
|
||||
new Request.JSON({
|
||||
url: url,
|
||||
sendParam: params,
|
||||
onSuccess: function(ajson) {
|
||||
if (typeof ajson === "object") {
|
||||
var hasil_cetak = (ajson.type == "escp") ? this.gen_escp(ajson) : this.gen_epl(ajson);
|
||||
qz.print(qzcfg, hasil_cetak);
|
||||
} else {
|
||||
FoniaJS.showInfo('Error dalam proses Cetak.');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
};
|
||||
this.gen_escp = function(adata) {
|
||||
var cut_paper = "\x1D\x56\x41";
|
||||
var open_draw = "\x1B\x70\x30\x19\x19";
|
||||
var nv_image = "\x1D\x28\x4C\x06\x00\x30\x45\x30\x30\x01\x01";
|
||||
var chr_norm = "\x1B\x21\x01";
|
||||
var chr_bold = "\x1B\x21\x10";
|
||||
var chr_sbold = "\x1B\x21\x31";
|
||||
var chr_uline = "\x1B\x21\x80";
|
||||
var ohead = [];
|
||||
var osheet = [], ocetak = [];
|
||||
ohead.push("\x1B\x40");
|
||||
ohead.push("\x1B\x61\x01");
|
||||
if (adata.config.logo != null) {
|
||||
ohead.push({type:'raw',format:'image',data:adata.config.logo,options:{language:'ESCPOS',dotDensity:'double'}});
|
||||
ohead.push("\x1B\x32");
|
||||
}
|
||||
if (parseInt(adata.config.fontsize) == 2) {
|
||||
chr_norm = "\x1B\x21\x02";
|
||||
}
|
||||
if (adata.config.nvlogo) {
|
||||
ohead.push((this.options.nv_cmd?this.options.nv_cmd:nv_image));
|
||||
ohead.push(chr_norm);
|
||||
}
|
||||
if (adata.header.length > 0) {
|
||||
for (i = 0; i < adata.header.length; i++) {
|
||||
if (i==0 && !adata.config.nvlogo && adata.config.logo==null) ohead.push(chr_bold);
|
||||
ohead.push(adata.header[i] + "\x0A");
|
||||
if (i==0 && !adata.config.nvlogo && adata.config.logo==null) ohead.push(chr_norm);
|
||||
}
|
||||
}
|
||||
for (s = 0; s < adata.content.length; s++) {
|
||||
if (adata.content[s].length == 0) continue;
|
||||
osheet = ohead.slice(0);
|
||||
for (i = 0; i < adata.content[s].length; i++) {
|
||||
var tmp_cont = adata.content[s][i];
|
||||
tmp_cont = tmp_cont.replace('_SBOLD_', chr_sbold)
|
||||
.replace('_BOLD_', chr_bold)
|
||||
.replace('_NORM_', chr_norm)
|
||||
.replace('_ULINE_', chr_uline);
|
||||
osheet.push(tmp_cont + "\x0A");
|
||||
}
|
||||
if (adata.config.cutpaper) {
|
||||
osheet.push(cut_paper + "\x0A");
|
||||
}
|
||||
//osheet.push("\x1B\x65\x02");//feed up 2row
|
||||
ocetak = ocetak.concat(osheet);
|
||||
}
|
||||
var notaout = [];
|
||||
if (adata.config.opendraw && adata.config.opendrawbegin) {
|
||||
notaout.push(open_draw);
|
||||
}
|
||||
for (i = 0; i < adata.config.times; i++) {
|
||||
notaout = notaout.concat(ocetak);
|
||||
}
|
||||
if (adata.config.opendraw && adata.config.opendrawbegin == false) {
|
||||
notaout.push(open_draw);
|
||||
}
|
||||
return notaout;
|
||||
};
|
||||
this.gen_epl = function(adata) {
|
||||
var cetak = [];
|
||||
for (i = 0; i < adata.content.length; i++) {
|
||||
cetak.push(adata.content[i] + "\r\n");
|
||||
}
|
||||
var notaout = [];
|
||||
for (i = 0; i < adata.config.times; i++) {
|
||||
notaout = notaout.concat(cetak);
|
||||
}
|
||||
return notaout;
|
||||
};
|
||||
this.construct(url, options);
|
||||
};
|
||||
@@ -0,0 +1,83 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /js3/qz/qz-start.js
|
||||
Desc. : JS Setup QZ Connection
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : May 27th, 2007.
|
||||
Last Modified : January 9th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
function startConnection() {
|
||||
if (!qz.websocket.isActive()) {
|
||||
_updateState('Waiting');
|
||||
qz.websocket.connect().then(function() {
|
||||
_updateState('Active');
|
||||
_findDefaultPrinter();
|
||||
});
|
||||
} else {
|
||||
console.info('An active connection with QZ already exists.');
|
||||
}
|
||||
}
|
||||
|
||||
function endConnection(){
|
||||
if (qz.websocket.isActive()) {
|
||||
qz.websocket.disconnect().then(function() {
|
||||
_updateState('Inactive');
|
||||
});
|
||||
} else {
|
||||
console.info('No active connection with QZ exists.');
|
||||
}
|
||||
}
|
||||
|
||||
function _findDefaultPrinter(){
|
||||
qz.printers.getDefault().then(function(data) {
|
||||
var _printer = data;
|
||||
if (typeof data === 'object' && data.name == undefined) {
|
||||
if (data.file != undefined) _printer = "FILE: " + data.file;
|
||||
if (data.host != undefined) _printer = "HOST: " + data.host + ":" + data.port;
|
||||
} else {
|
||||
if (data.name != undefined) _printer = data.name;
|
||||
if (data== undefined) _printer = 'NONE';
|
||||
}
|
||||
FoniaJS._def_printer = data;
|
||||
FoniaJS._def_printname = _printer;
|
||||
$(_divStatus).html($(_divStatus).html() + ' // ' + _printer);
|
||||
});
|
||||
}
|
||||
|
||||
function _updateState(text){
|
||||
$(_divStatus).html(text);
|
||||
if (text == "Active") {
|
||||
$(_divStatus).css("background-color", "#AAFFAA");
|
||||
} else {
|
||||
$(_divStatus).css("background-color", "#FFFFC0");
|
||||
}
|
||||
}
|
||||
|
||||
var _divStatus = '#divQZStatus';
|
||||
|
||||
if (typeof qz !== 'undefined') {
|
||||
qz.security.setCertificatePromise(function(resolve, reject) {
|
||||
jQuery.ajax({ url:FoniaJS.WEB_PATH+'assets/signing/cert.pem', cache:false, dataType:'text' }).then(resolve, reject);
|
||||
});
|
||||
qz.security.setSignaturePromise(function(toSign) {
|
||||
return function(resolve, reject) {
|
||||
jQuery.post(FoniaJS.WEB_PATH+"assets/signing/sign.php?req="+toSign).then(resolve, reject);
|
||||
};
|
||||
});
|
||||
qz.websocket.setClosedCallbacks(function(evt) {
|
||||
_updateState('Inactive');
|
||||
if (evt.reason) console.info("Connection closed: " + evt.reason);
|
||||
});
|
||||
qz.websocket.setErrorCallbacks(function(evt){
|
||||
_updateState('Error');
|
||||
if (evt.target != undefined) {
|
||||
var err = (evt.target.readyState >= 2) ? "Connection to QZ Tray was closed" : "A connection error occurred, check log for details";
|
||||
console.info(err)
|
||||
}
|
||||
});
|
||||
startConnection();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /assets/js/simulator.js
|
||||
Desc. : JS Class Simulator Data dalam Code
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : March 18th, 2021.
|
||||
Last Modified : April 9th, 2021.
|
||||
|
||||
(c) 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var cSIMULATOR = function(url, options){
|
||||
var vars = {
|
||||
'url': '',
|
||||
'param': []
|
||||
};
|
||||
this.construct = function(url, options){
|
||||
$.extend(vars, options);
|
||||
vars.url = url;
|
||||
};
|
||||
this.set_url = function (url){
|
||||
vars.url = url;
|
||||
};
|
||||
this.add_param = function (par_id, par_val){
|
||||
var _getvalue = (par_val) ? par_id + "=" + escape(par_val) : par_id;
|
||||
vars.param.push(_getvalue);
|
||||
},
|
||||
this.doPreview = function(){
|
||||
if (!vars.url) console.warn(vars.param + ", cek url php!");
|
||||
vars.data = FoniaJS.RequestParam(vars.param);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: vars.url,
|
||||
data: (vars.data).join('&'),
|
||||
success: function(data){
|
||||
if (data.length == 0) {
|
||||
FoniaJS.showInfo('Tidak ada data !');
|
||||
return false;
|
||||
}
|
||||
var _divd = '';
|
||||
for (var no = 0; no < data.length; no++) {
|
||||
_divd += '<div class="sim-code px-2 py-2 mb-1 border border-info">' + data[no] + '</div>';
|
||||
}
|
||||
var _wtxt =
|
||||
'<div class="modal fade" id="winAPPSim" tabindex="-1" role="dialog" data-keyboard="false" data-show="false" data-backdrop="static" aria-labelledby="winAPPSimLabel" aria-hidden="true">'+
|
||||
'<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-fs" role="document">'+
|
||||
'<div class="modal-content">'+
|
||||
'<div class="modal-header"><h5 class="modal-title" id="winAPPSimLabel">Code Simulator</h5><div class="ml-auto"><button class="btn btn-cetak" id="tombSalin" type="button" aria-label="Salin Semua"><i class="cui-copy"></i><span aria-hidden="true"> Salin Semua</span></button><button class="btn btn-cetak" type="button" data-dismiss="modal" aria-label="Tutup"><i class="cui-x"></i><span aria-hidden="true"> Tutup</span></button></div></div>'+
|
||||
'<div class="modal-body">'+_divd+'</div>'+
|
||||
'</div></div></div>';
|
||||
if ($('#winAPPSim')) $('#winAPPSim').modal('dispose').remove();
|
||||
$(_wtxt).on('shown.coreui.modal', function(e){
|
||||
$('#winAPPSim').find('#tombSalin').click(function(){
|
||||
window.getSelection().removeAllRanges();
|
||||
$('.sim-code').each(function(i, ele) {
|
||||
var range = document.createRange();
|
||||
range.selectNode(ele);
|
||||
window.getSelection().addRange(range);
|
||||
});
|
||||
document.execCommand('copy');
|
||||
window.getSelection().removeAllRanges();
|
||||
FoniaJS.showInfo('Sukses salin semua Kode !');
|
||||
});
|
||||
$('#winAPPSim').find('.sim-code').click(function(){
|
||||
var range = document.createRange();
|
||||
range.selectNode(this);
|
||||
window.getSelection().removeAllRanges();
|
||||
window.getSelection().addRange(range);
|
||||
document.execCommand('copy');
|
||||
window.getSelection().removeAllRanges();
|
||||
//$(this).addClass('bg-success');
|
||||
$(this).addClass('d-none');
|
||||
});
|
||||
}).on('hidden.coreui.modal', function(e){
|
||||
$(this).remove();
|
||||
}).modal('show');
|
||||
},
|
||||
error: (typeof vars.onFailure === "function") ? vars.onFailure : null,
|
||||
dataType: 'json'
|
||||
});
|
||||
};
|
||||
this.construct(url, options);
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,442 @@
|
||||
(function(define) {
|
||||
define(['jquery'], function($) {
|
||||
return (function() {
|
||||
var $container;
|
||||
var listener;
|
||||
var toastId = 0;
|
||||
var toastType = {
|
||||
error: 'error',
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning'
|
||||
};
|
||||
var toastr = {
|
||||
clear: clear,
|
||||
remove: remove,
|
||||
error: error,
|
||||
getContainer: getContainer,
|
||||
info: info,
|
||||
options: {},
|
||||
subscribe: subscribe,
|
||||
success: success,
|
||||
version: '2.1.4',
|
||||
warning: warning
|
||||
};
|
||||
var previousToast;
|
||||
return toastr;
|
||||
|
||||
function error(message, title, optionsOverride) {
|
||||
return notify({
|
||||
type: toastType.error,
|
||||
iconClass: getOptions().iconClasses.error,
|
||||
message: message,
|
||||
optionsOverride: optionsOverride,
|
||||
title: title
|
||||
});
|
||||
}
|
||||
|
||||
function getContainer(options, create) {
|
||||
if (!options) {
|
||||
options = getOptions();
|
||||
}
|
||||
$container = $('#' + options.containerId);
|
||||
if ($container.length) {
|
||||
return $container;
|
||||
}
|
||||
if (create) {
|
||||
$container = createContainer(options);
|
||||
}
|
||||
return $container;
|
||||
}
|
||||
|
||||
function info(message, title, optionsOverride) {
|
||||
return notify({
|
||||
type: toastType.info,
|
||||
iconClass: getOptions().iconClasses.info,
|
||||
message: message,
|
||||
optionsOverride: optionsOverride,
|
||||
title: title
|
||||
});
|
||||
}
|
||||
|
||||
function subscribe(callback) {
|
||||
listener = callback;
|
||||
}
|
||||
|
||||
function success(message, title, optionsOverride) {
|
||||
return notify({
|
||||
type: toastType.success,
|
||||
iconClass: getOptions().iconClasses.success,
|
||||
message: message,
|
||||
optionsOverride: optionsOverride,
|
||||
title: title
|
||||
});
|
||||
}
|
||||
|
||||
function warning(message, title, optionsOverride) {
|
||||
return notify({
|
||||
type: toastType.warning,
|
||||
iconClass: getOptions().iconClasses.warning,
|
||||
message: message,
|
||||
optionsOverride: optionsOverride,
|
||||
title: title
|
||||
});
|
||||
}
|
||||
|
||||
function clear($toastElement, clearOptions) {
|
||||
var options = getOptions();
|
||||
if (!$container) {
|
||||
getContainer(options);
|
||||
}
|
||||
if (!clearToast($toastElement, options, clearOptions)) {
|
||||
clearContainer(options);
|
||||
}
|
||||
}
|
||||
|
||||
function remove($toastElement) {
|
||||
var options = getOptions();
|
||||
if (!$container) {
|
||||
getContainer(options);
|
||||
}
|
||||
if ($toastElement && $(':focus', $toastElement).length === 0) {
|
||||
removeToast($toastElement);
|
||||
return;
|
||||
}
|
||||
if ($container.children().length) {
|
||||
$container.remove();
|
||||
}
|
||||
}
|
||||
|
||||
function clearContainer(options) {
|
||||
var toastsToClear = $container.children();
|
||||
for (var i = toastsToClear.length - 1; i >= 0; i--) {
|
||||
clearToast($(toastsToClear[i]), options);
|
||||
}
|
||||
}
|
||||
|
||||
function clearToast($toastElement, options, clearOptions) {
|
||||
var force = clearOptions && clearOptions.force ? clearOptions.force : false;
|
||||
if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
|
||||
$toastElement[options.hideMethod]({
|
||||
duration: options.hideDuration,
|
||||
easing: options.hideEasing,
|
||||
complete: function() {
|
||||
removeToast($toastElement);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function createContainer(options) {
|
||||
$container = $('<div/>').attr('id', options.containerId).addClass(options.positionClass);
|
||||
$container.appendTo($(options.target));
|
||||
return $container;
|
||||
}
|
||||
|
||||
function getDefaults() {
|
||||
return {
|
||||
tapToDismiss: true,
|
||||
toastClass: 'toast',
|
||||
containerId: 'toast-container',
|
||||
debug: false,
|
||||
showMethod: 'fadeIn',
|
||||
showDuration: 300,
|
||||
showEasing: 'swing',
|
||||
onShown: undefined,
|
||||
hideMethod: 'fadeOut',
|
||||
hideDuration: 1000,
|
||||
hideEasing: 'swing',
|
||||
onHidden: undefined,
|
||||
closeMethod: false,
|
||||
closeDuration: false,
|
||||
closeEasing: false,
|
||||
closeOnHover: true,
|
||||
extendedTimeOut: 1000,
|
||||
iconClasses: {
|
||||
error: 'toast-error',
|
||||
info: 'toast-info',
|
||||
success: 'toast-success',
|
||||
warning: 'toast-warning'
|
||||
},
|
||||
iconClass: 'toast-info',
|
||||
positionClass: 'toast-top-right',
|
||||
timeOut: 5000,
|
||||
titleClass: 'toast-title',
|
||||
messageClass: 'toast-message',
|
||||
escapeHtml: false,
|
||||
target: 'body',
|
||||
closeHtml: '<button type="button">×</button>',
|
||||
closeClass: 'toast-close-button',
|
||||
newestOnTop: true,
|
||||
preventDuplicates: false,
|
||||
progressBar: false,
|
||||
progressClass: 'toast-progress',
|
||||
rtl: false
|
||||
};
|
||||
}
|
||||
|
||||
function publish(args) {
|
||||
if (!listener) {
|
||||
return;
|
||||
}
|
||||
listener(args);
|
||||
}
|
||||
|
||||
function notify(map) {
|
||||
var options = getOptions();
|
||||
var iconClass = map.iconClass || options.iconClass;
|
||||
if (typeof(map.optionsOverride) !== 'undefined') {
|
||||
options = $.extend(options, map.optionsOverride);
|
||||
iconClass = map.optionsOverride.iconClass || iconClass;
|
||||
}
|
||||
if (shouldExit(options, map)) {
|
||||
return;
|
||||
}
|
||||
toastId++;
|
||||
$container = getContainer(options, true);
|
||||
var intervalId = null;
|
||||
var $toastElement = $('<div/>');
|
||||
var $titleElement = $('<div/>');
|
||||
var $messageElement = $('<div/>');
|
||||
var $progressElement = $('<div/>');
|
||||
var $closeElement = $(options.closeHtml);
|
||||
var progressBar = {
|
||||
intervalId: null,
|
||||
hideEta: null,
|
||||
maxHideTime: null
|
||||
};
|
||||
var response = {
|
||||
toastId: toastId,
|
||||
state: 'visible',
|
||||
startTime: new Date(),
|
||||
options: options,
|
||||
map: map
|
||||
};
|
||||
personalizeToast();
|
||||
displayToast();
|
||||
handleEvents();
|
||||
publish(response);
|
||||
if (options.debug && console) {
|
||||
console.log(response);
|
||||
}
|
||||
return $toastElement;
|
||||
|
||||
function escapeHtml(source) {
|
||||
if (source == null) {
|
||||
source = '';
|
||||
}
|
||||
return source.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
|
||||
function personalizeToast() {
|
||||
setIcon();
|
||||
setTitle();
|
||||
setMessage();
|
||||
setCloseButton();
|
||||
setProgressBar();
|
||||
setRTL();
|
||||
setSequence();
|
||||
setAria();
|
||||
}
|
||||
|
||||
function setAria() {
|
||||
var ariaValue = '';
|
||||
switch (map.iconClass) {
|
||||
case 'toast-success':
|
||||
case 'toast-info':
|
||||
ariaValue = 'polite';
|
||||
break;
|
||||
default:
|
||||
ariaValue = 'assertive';
|
||||
}
|
||||
$toastElement.attr('aria-live', ariaValue);
|
||||
}
|
||||
|
||||
function handleEvents() {
|
||||
if (options.closeOnHover) {
|
||||
$toastElement.hover(stickAround, delayedHideToast);
|
||||
}
|
||||
if (!options.onclick && options.tapToDismiss) {
|
||||
$toastElement.click(hideToast);
|
||||
}
|
||||
if (options.closeButton && $closeElement) {
|
||||
$closeElement.click(function(event) {
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
if (options.onCloseClick) {
|
||||
options.onCloseClick(event);
|
||||
}
|
||||
hideToast(true);
|
||||
});
|
||||
}
|
||||
if (options.onclick) {
|
||||
$toastElement.click(function(event) {
|
||||
options.onclick(event);
|
||||
hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function displayToast() {
|
||||
$toastElement.hide();
|
||||
$toastElement[options.showMethod]({
|
||||
duration: options.showDuration,
|
||||
easing: options.showEasing,
|
||||
complete: options.onShown
|
||||
});
|
||||
if (options.timeOut > 0) {
|
||||
intervalId = setTimeout(hideToast, options.timeOut);
|
||||
progressBar.maxHideTime = parseFloat(options.timeOut);
|
||||
progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
|
||||
if (options.progressBar) {
|
||||
progressBar.intervalId = setInterval(updateProgress, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setIcon() {
|
||||
if (map.iconClass) {
|
||||
$toastElement.addClass(options.toastClass).addClass(iconClass);
|
||||
}
|
||||
}
|
||||
|
||||
function setSequence() {
|
||||
if (options.newestOnTop) {
|
||||
$container.prepend($toastElement);
|
||||
} else {
|
||||
$container.append($toastElement);
|
||||
}
|
||||
}
|
||||
|
||||
function setTitle() {
|
||||
if (map.title) {
|
||||
var suffix = map.title;
|
||||
if (options.escapeHtml) {
|
||||
suffix = escapeHtml(map.title);
|
||||
}
|
||||
$titleElement.append(suffix).addClass(options.titleClass);
|
||||
$toastElement.append($titleElement);
|
||||
}
|
||||
}
|
||||
|
||||
function setMessage() {
|
||||
if (map.message) {
|
||||
var suffix = map.message;
|
||||
if (options.escapeHtml) {
|
||||
suffix = escapeHtml(map.message);
|
||||
}
|
||||
$messageElement.append(suffix).addClass(options.messageClass);
|
||||
$toastElement.append($messageElement);
|
||||
}
|
||||
}
|
||||
|
||||
function setCloseButton() {
|
||||
if (options.closeButton) {
|
||||
$closeElement.addClass(options.closeClass).attr('role', 'button');
|
||||
$toastElement.prepend($closeElement);
|
||||
}
|
||||
}
|
||||
|
||||
function setProgressBar() {
|
||||
if (options.progressBar) {
|
||||
$progressElement.addClass(options.progressClass);
|
||||
$toastElement.prepend($progressElement);
|
||||
}
|
||||
}
|
||||
|
||||
function setRTL() {
|
||||
if (options.rtl) {
|
||||
$toastElement.addClass('rtl');
|
||||
}
|
||||
}
|
||||
|
||||
function shouldExit(options, map) {
|
||||
if (options.preventDuplicates) {
|
||||
if (map.message === previousToast) {
|
||||
return true;
|
||||
} else {
|
||||
previousToast = map.message;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function hideToast(override) {
|
||||
var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
|
||||
var duration = override && options.closeDuration !== false ? options.closeDuration : options.hideDuration;
|
||||
var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
|
||||
if ($(':focus', $toastElement).length && !override) {
|
||||
return;
|
||||
}
|
||||
clearTimeout(progressBar.intervalId);
|
||||
return $toastElement[method]({
|
||||
duration: duration,
|
||||
easing: easing,
|
||||
complete: function() {
|
||||
removeToast($toastElement);
|
||||
clearTimeout(intervalId);
|
||||
if (options.onHidden && response.state !== 'hidden') {
|
||||
options.onHidden();
|
||||
}
|
||||
response.state = 'hidden';
|
||||
response.endTime = new Date();
|
||||
publish(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delayedHideToast() {
|
||||
if (options.timeOut > 0 || options.extendedTimeOut > 0) {
|
||||
intervalId = setTimeout(hideToast, options.extendedTimeOut);
|
||||
progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
|
||||
progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
|
||||
}
|
||||
}
|
||||
|
||||
function stickAround() {
|
||||
clearTimeout(intervalId);
|
||||
progressBar.hideEta = 0;
|
||||
$toastElement.stop(true, true)[options.showMethod]({
|
||||
duration: options.showDuration,
|
||||
easing: options.showEasing
|
||||
});
|
||||
}
|
||||
|
||||
function updateProgress() {
|
||||
var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
|
||||
$progressElement.width(percentage + '%');
|
||||
}
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
return $.extend({}, getDefaults(), toastr.options);
|
||||
}
|
||||
|
||||
function removeToast($toastElement) {
|
||||
if (!$container) {
|
||||
$container = getContainer();
|
||||
}
|
||||
if ($toastElement.is(':visible')) {
|
||||
return;
|
||||
}
|
||||
$toastElement.remove();
|
||||
$toastElement = null;
|
||||
if ($container.children().length === 0) {
|
||||
$container.remove();
|
||||
previousToast = undefined;
|
||||
}
|
||||
}
|
||||
})();
|
||||
});
|
||||
}(typeof define === 'function' && define.amd ? define : function(deps, factory) {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
window.toastr = factory(window.jQuery);
|
||||
}
|
||||
}));
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
|
||||
name: [File.Upload, Request.File]
|
||||
description: Ajax file upload with MooTools.
|
||||
license: MIT-style license
|
||||
author: Matthew Loberg
|
||||
requires: [Request]
|
||||
provides: [File.Upload, Request.File]
|
||||
credits: Based off of MooTools-Form-Upload (https://github.com/arian/mootools-form-upload/) by Arian Stolwijk
|
||||
|
||||
*/
|
||||
|
||||
File.Upload = new Class({
|
||||
|
||||
Implements: [Options, Events],
|
||||
|
||||
options: {
|
||||
onComplete: function(){}
|
||||
},
|
||||
|
||||
initialize: function(options){
|
||||
var self = this;
|
||||
this.setOptions(options);
|
||||
this.uploadReq = new Request.File({
|
||||
onComplete: function(){
|
||||
self.fireEvent('complete', arguments);
|
||||
this.reset();
|
||||
}
|
||||
});
|
||||
if(this.options.data) this.data(this.options.data);
|
||||
if(this.options.images) this.addMultiple(this.options.images);
|
||||
},
|
||||
|
||||
data: function(data){
|
||||
var self = this;
|
||||
if(this.options.url.indexOf('?') < 0) this.options.url += '?';
|
||||
Object.each(data, function(value, key){
|
||||
if(self.options.url.charAt(self.options.url.length - 1) != '?') self.options.url += '&';
|
||||
self.options.url += encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
||||
});
|
||||
},
|
||||
|
||||
addMultiple: function(inputs){
|
||||
var self = this;
|
||||
inputs.each(function(input){
|
||||
self.add(input);
|
||||
});
|
||||
},
|
||||
|
||||
add: function(input){
|
||||
var input = document.id(input),
|
||||
name = input.get('name'),
|
||||
file = input.files[0];
|
||||
this.uploadReq.append(name, file);
|
||||
},
|
||||
|
||||
send: function(input){
|
||||
if(input) this.add(input);
|
||||
this.uploadReq.send({
|
||||
url: this.options.url
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Request.File = new Class({
|
||||
|
||||
Extends: Request,
|
||||
|
||||
options: {
|
||||
emulation: false,
|
||||
urlEncoded: false
|
||||
},
|
||||
|
||||
initialize: function(options){
|
||||
this.xhr = new Browser.Request();
|
||||
this.formData = new FormData();
|
||||
this.setOptions(options);
|
||||
this.headers = this.options.headers;
|
||||
},
|
||||
|
||||
append: function(key, value){
|
||||
this.formData.append(key, value);
|
||||
return this.formData;
|
||||
},
|
||||
|
||||
reset: function(){
|
||||
this.formData = new FormData();
|
||||
},
|
||||
|
||||
send: function(options){
|
||||
var url = options.url || this.options.url;
|
||||
|
||||
this.options.isSuccess = this.options.isSuccess || this.isSuccess;
|
||||
this.running = true;
|
||||
|
||||
var xhr = this.xhr;
|
||||
xhr.open('POST', url, true);
|
||||
xhr.onreadystatechange = this.onStateChange.bind(this);
|
||||
|
||||
Object.each(this.headers, function(value, key){
|
||||
try{
|
||||
xhr.setRequestHeader(key, value);
|
||||
}catch(e){
|
||||
this.fireEvent('exception', [key, value]);
|
||||
}
|
||||
}, this);
|
||||
|
||||
this.fireEvent('request');
|
||||
xhr.send(this.formData);
|
||||
|
||||
if(!this.options.async) this.onStateChange();
|
||||
if(this.options.timeout) this.timer = this.timeout.delay(this.options.timeout, this);
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "siaupheng/fonia3",
|
||||
"type": "library",
|
||||
"description": "Fonia Web Application Framework v3",
|
||||
"keywords": [
|
||||
"siaupheng",
|
||||
"fonia3"
|
||||
],
|
||||
"homepage": "https://github.com/siaupheng/fonia3",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Siau Pheng",
|
||||
"email": "[email protected]",
|
||||
"homepage": "https://www.3fonia.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php" : ">=7.2",
|
||||
"mpdf/mpdf": ">=8.0",
|
||||
"matthiasmullie/minify": ">=1.3",
|
||||
"endroid/qr-code": ">=3.9",
|
||||
"phpoffice/phpspreadsheet": ">=1.17"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit" : ">=8.0",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"siaupheng\\fonia3\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"src/Function/Auth.php",
|
||||
"src/Function/JSON.php",
|
||||
"src/Function/Misc.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"siaupheng\\fonia3\\": "tests"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "phpunit",
|
||||
"check-style": "phpcs src tests",
|
||||
"fix-style": "phpcbf src tests"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /App.php
|
||||
Desc. : v3 - HTML5 Page Generator v3 (jQuery & CoreUI)
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : January 10th, 2008.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3;
|
||||
|
||||
final class App {
|
||||
public $version = "3.0.0";
|
||||
private $apps = array();
|
||||
private $auser = array();
|
||||
private $cache = null;
|
||||
private $menu = null;
|
||||
private $reg = null;
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
|
||||
$this->apps = $_SESSION['__WEB_APP'];
|
||||
$this->apps['TEMPLATE'] = "index.php";
|
||||
if (isset($_SESSION['__WEB_USER'])) {
|
||||
$this->auser = $_SESSION['__WEB_USER'];
|
||||
$this->auser['user_info'] = tgl_sql2str($this->auser['Last_Date'], true) ." // ". $this->auser['Last_IP'].'<input type="hidden" id="Desktop_User_ID" value="'.intval($this->auser['UserID']).'"><input type="hidden" id="Desktop_User_Level" value="'.intval($this->auser['Level']).'"><input type="hidden" id="Desktop_User_UID" value="'.$this->auser['Username'].'">';
|
||||
$this->auser['user_img'] = "profile.webp";
|
||||
if (file_exists($this->apps['REAL_PATH']."assets/images/profiles/".$this->auser['ID'].".webp")) {
|
||||
$this->auser['user_img'] = $this->auser['ID'].".webp";
|
||||
}
|
||||
}
|
||||
$this->reg = new \siaupheng\fonia3\Web\Register($this->__db);
|
||||
$this->cache = new \siaupheng\fonia3\Data\Cache($this->__db);
|
||||
$this->menu = new \siaupheng\fonia3\Web\Menu($this->__db);
|
||||
}
|
||||
|
||||
public function TampilApp($aoption = array()) {
|
||||
// cek register
|
||||
if ($this->reg->reg_check()) {
|
||||
if (!user_logged()) {
|
||||
$this->apps['TEMPLATE'] = "login.php";
|
||||
}
|
||||
} else {
|
||||
$this->apps['TEMPLATE'] = "404.php";
|
||||
}
|
||||
|
||||
// loading template file
|
||||
$buffer = "";
|
||||
if (file_exists($this->apps['REAL_PATH']."assets/templates/".$this->apps['TEMPLATE'])) {
|
||||
$buffer = file_get_contents($this->apps['REAL_PATH']."assets/templates/".$this->apps['TEMPLATE']);
|
||||
$compos = 0;
|
||||
if (strpos(strtoupper($buffer), "<!DOCTYPE") !== false) {
|
||||
$compos = strpos(strtoupper($buffer), "<!DOCTYPE");
|
||||
}
|
||||
$buffer = substr($buffer, $compos);
|
||||
}
|
||||
|
||||
// penambahan file css + js + app-js
|
||||
$headers = '<link rel="stylesheet" type="text/css" href="'.$this->cache->Main("css").'">'."\n";
|
||||
$headers .= '<script type="text/javascript" src="'.$this->cache->Main("js").'"></script>'."\n";
|
||||
if (user_logged()) $headers .= '<script type="text/javascript" src="'.$this->cache->Apps().'"></script>'."\n";
|
||||
|
||||
$_secret = $this->apps['APP_CODE'] .";". $this->apps['APP_SID'] .";". $_SERVER['HTTP_HOST'] .";". $this->apps['WEB_PATH'] .";". "http://".$_SERVER['HTTP_HOST'].$this->apps['WEB_PATH'] .";". ($this->apps['AUTH_LEVEL']?$this->apps['AUTH_LEVEL']:0) .";". $this->version;
|
||||
$_suser = (user_logged()) ? $this->auser['Username'] .";". $this->auser['UserID'] .";". $this->auser['Grup_MenuID'] .";". $this->auser['Level'] : "";
|
||||
$tnaviside = $tnavihead = "";
|
||||
$headers .= '<script type="text/javascript" language="javascript">'."\n";
|
||||
$headers .= 'FoniaJS.setConfig("'.base64_encode($_secret).'", "'.base64_encode($_suser).'");';
|
||||
$headers .= '$(document).ready(function(){';
|
||||
if (user_logged()) {
|
||||
$headers .= 'FoniaJS.loadMenu();';
|
||||
$tnaviside = $this->menu->Menu_Sidebar();
|
||||
$tnavihead = $this->menu->Menu_Header();
|
||||
}
|
||||
$headers .= '});';
|
||||
$headers .= '</script>'."\n";
|
||||
|
||||
// informasi tahun aplikasi dan pembuatan menu
|
||||
if (strpos($buffer, '_CREATOR_YEAR_')===false) {
|
||||
$this->apps['REG_YEAR'] = ($this->apps['REG_YEAR']!=date('Y')) ? $this->apps['REG_YEAR']." - ".date('Y') : $this->apps['REG_YEAR'];
|
||||
} else {
|
||||
$this->apps['CREATOR_YEAR'] = ($this->apps['CREATOR_YEAR']!=date('Y')) ? $this->apps['CREATOR_YEAR']." - ".date('Y') : $this->apps['CREATOR_YEAR'];
|
||||
}
|
||||
|
||||
// perubahan variabel dari data konfigurasi
|
||||
$asrc = array("[_CREATOR_NAME_]", "[_CREATOR_WEBSITE_]", "[_CREATOR_YEAR_]", "[_APP_NAME_VER_]", "[_APP_NAMES_VER_]", "[_APP_NAME_]", "[_APP_NAMES_]", "[_APP_NAMES_UP_]", "[_APP_VER_]", "[_APP_UPDATED_]", "[_REG_ID_]", "[_REG_NAME_]", "[_REG_NAME_UP_]", "[_REG_ADDRESS_]", "[_REG_CITY_]", "[_REG_CITY_UP_]", "[_REG_PHONE_]", "[_REG_FAX_]", "[_REG_EMAIL_]", "[_REG_POSTCODE_]", "[_REG_WEBSITE_]", "[_REG_YEAR_]", "[_USER_LASTLOG_]", "[_USER_IMG_]", "[_WEB_PATH_]", "[_NAVI_SIDEBAR_]", "[_NAVI_HEADER_]");
|
||||
$adst = array($this->apps['CREATOR_NAME'], $this->apps['CREATOR_WEBSITE'], $this->apps['CREATOR_YEAR'], $this->apps['APP_NAME']." v".$this->apps['APP_VER'], $this->apps['APP_NAMES']." v".$this->apps['APP_VER'], $this->apps['APP_NAME'], $this->apps['APP_NAMES'], strtoupper($this->apps['APP_NAMES']), $this->apps['APP_VER'], $this->apps['APP_UPDATED'], $this->reg->reg_id(), $this->apps['REG_NAME'], strtoupper($this->apps['REG_NAME']), $this->apps['REG_ADDRESS'], $this->apps['REG_CITY'], strtoupper($this->apps['REG_CITY']), $this->apps['REG_PHONE'], $this->apps['REG_FAX'], $this->apps['REG_EMAIL'], $this->apps['REG_POSTCODE'], $this->apps['REG_WEBSITE'], $this->apps['REG_YEAR'], $this->auser['user_info'] ?? "[none]", "profiles/".$this->auser['user_img'], $this->apps['WEB_PATH'], $tnaviside, $tnavihead);
|
||||
$buffer = str_replace($asrc, $adst, $buffer);
|
||||
|
||||
if (isset($this->auser) && is_array($this->auser)) {
|
||||
$buffer = str_replace("[_USER_ID_]", $this->auser['UserID'], $buffer);
|
||||
$buffer = str_replace("[_USER_USER_]", $this->auser['Username'], $buffer);
|
||||
$buffer = str_replace("[_USER_NAME_]", $this->auser['Nama'], $buffer);
|
||||
$buffer = str_replace("[_USER_POSISI_]", $this->auser['Posisi'], $buffer);
|
||||
|
||||
// menu modul
|
||||
$t_modul = "";
|
||||
if (isset($this->auser['MENU_MODUL']) && is_array($this->auser['MENU_MODUL']) && count($this->auser['MENU_MODUL'])>0) {
|
||||
$t_modul = '<div class="dropdown-divider"></div>';
|
||||
if ($_SERVER['SERVER_ADDR'] == "127.0.0.1") {
|
||||
$href1 = $this->apps['WEB_PATH'].'../';
|
||||
$href2 = "";
|
||||
} else {
|
||||
if ($this->apps['PARENT_SUB']==true) {
|
||||
$tmp_url = parse_url($this->apps['PARENT_SITE']);
|
||||
$href1 = $tmp_url['scheme'] . "://";
|
||||
$href2 = ".".$tmp_url['host'];
|
||||
} else {
|
||||
$href1 = $this->apps['PARENT_SITE'].'/';
|
||||
$href2 = "";
|
||||
}
|
||||
}
|
||||
foreach ($this->auser['MENU_MODUL'] as $modul) {
|
||||
$href = $href1.$modul['APP_PATH'].$href2;
|
||||
$href .= '/?auth='.$_SESSION['APP_TOKEN'];
|
||||
$t_modul .= '<a class="dropdown-item slink" href="'.$href.'"><i class="c-icon mr-2 '.$modul['Icon'].'"></i> '.$modul['Judul'].'</a>';
|
||||
}
|
||||
}
|
||||
$buffer = str_replace("[_MENU_MODUL_]", $t_modul, $buffer);
|
||||
}
|
||||
|
||||
// penyisipan header
|
||||
$headpos = 0;
|
||||
if (strpos(strtolower($buffer), "</head>") !== false) {
|
||||
$headpos = strpos(strtolower($buffer), "</head>");
|
||||
}
|
||||
$split_1_buffer = substr($buffer, 0, $headpos);
|
||||
$split_2_buffer = substr($buffer, $headpos);
|
||||
$buffer = $split_1_buffer.$headers.$split_2_buffer;
|
||||
|
||||
// penyisipan option (pilihan tahun, tanggal login, dll)
|
||||
if (count($aoption) > 0) {
|
||||
foreach ($aoption as $__key => $val) {
|
||||
if (strpos($__key, "OPTION")!==false) {
|
||||
$opt_var = (new cFORM())->option("Pilihan", $__key, $val['value'], true, $val['option']);
|
||||
$buffer = str_replace("[_".$__key."_]", $opt_var, $buffer);
|
||||
} else if (strpos($__key, "PICKDATE")!==false) {
|
||||
$txt_var = (new cFORM())->datebox("Tanggal", $__key, $val['value'], true);
|
||||
$buffer = str_replace("[_".$__key."_]", $txt_var, $buffer);
|
||||
} else if (strpos($__key, "CUSTOM")!==false) {
|
||||
$buffer = str_replace("[_".$__key."_]", $val['value'], $buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /DB/CheckSQL.php
|
||||
Desc. : v3 - Class Check SQL / Repair Database
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : May 11th, 2011.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2011 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\DB;
|
||||
|
||||
final class CheckSQL {
|
||||
private $__atabel = array();
|
||||
private $__aignore = array();
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
|
||||
$this->__db->Query("SELECT TABLE_NAME,ENGINE,TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='".$this->__db->getDBName()."' AND TABLE_TYPE='BASE TABLE'");
|
||||
while ($this->__db->Next()) {
|
||||
$this->__atabel[] = array($this->__db->Row("TABLE_NAME"), ' <i>('.$this->__db->Row("ENGINE").')</i>',' <i>('.uang($this->__db->Row("TABLE_ROWS")).' Records)</i>');
|
||||
}
|
||||
}
|
||||
|
||||
public function ignore_table() {
|
||||
$tmp_arr = func_get_args();
|
||||
if (is_array($tmp_arr[0])) $tmp_arr = $tmp_arr[0];
|
||||
$this->__aignore = $tmp_arr;
|
||||
}
|
||||
|
||||
private function _check_db($atabel=array()) {
|
||||
$hasil = "";
|
||||
if (!in_array($atabel[0], $this->__aignore)) {
|
||||
$pesan = "<span style=\"color:blue;\">OK</span>";
|
||||
$this->__db->Query("CHECK TABLE ".$atabel[0]);
|
||||
if ($this->__db->Next()) {
|
||||
if (strtoupper($this->__db->Row("Msg_text"))<>"OK") {
|
||||
$pesan = "<span style=\"color:red;\">ERROR</span>";
|
||||
$this->__db->Query("REPAIR TABLE ".$atabel[0]);
|
||||
if ($this->__db->Next()) {
|
||||
if (strtoupper($this->__db->Row("Msg_text"))=="OK") {
|
||||
$pesan .= " -> <span style=\"color:blue;\">FIXED</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$hasil = $atabel[0] . $atabel[2] ." ... ". $pesan ."<br>";
|
||||
}
|
||||
return $hasil;
|
||||
}
|
||||
|
||||
public function count_db() {
|
||||
return count($this->__atabel);
|
||||
}
|
||||
|
||||
public function check_db() {
|
||||
$hasil = "=== CEK DATABASE ===<br>";
|
||||
for ($n=0;$n<count($this->__atabel);$n++) {
|
||||
$hasil .= $this->_check_db($this->__atabel[$n]);
|
||||
}
|
||||
return $hasil;
|
||||
}
|
||||
|
||||
public function check_db_step($n) {
|
||||
$hasil .= $this->_check_db($this->__atabel[$n]);
|
||||
}
|
||||
|
||||
public function repair_db() {
|
||||
$hasil = "=== REPAIR DATABASE ===<br>";
|
||||
for ($n=0;$n<count($this->__atabel);$n++) {
|
||||
if (!in_array($this->__atabel[$n][0], $this->__aignore)) {
|
||||
$pesan = "<span style=\"color:blue;\">OK</span>";
|
||||
$this->__db->Query("REPAIR TABLE ".$this->__atabel[$n][0]);
|
||||
while ($this->__db->Next()) {
|
||||
$pesan = (strtoupper($this->__db->Row("Msg_text"))=="OK") ? "<span style=\"color:blue;\">OK</span>" : "<span style=\"color:red;\">ERROR</span>";
|
||||
}
|
||||
$hasil .= $this->__atabel[$n][0] . $this->__atabel[$n][1] ." ... ". $pesan ."<br>";
|
||||
}
|
||||
}
|
||||
return $hasil;
|
||||
}
|
||||
|
||||
public function optimize_db() {
|
||||
$hasil = "=== OPTIMALISASI DATABASE ===<br>";
|
||||
for ($n=0;$n<count($this->__atabel);$n++) {
|
||||
if (!in_array($this->__atabel[$n][0], $this->__aignore)) {
|
||||
$pesan = "<span style=\"color:blue;\">OK</span>";
|
||||
$this->__db->Query("OPTIMIZE TABLE ".$this->__atabel[$n][0]);
|
||||
while ($this->__db->Next()) {
|
||||
$pesan = (strtoupper($this->__db->Row("Msg_text"))=="OK" || strtoupper($this->__db->Row("Msg_text"))=="TABLE IS ALREADY UP TO DATE") ? "<span style=\"color:blue;\">OK</span>" : "<span style=\"color:red;\">ERROR</span>";
|
||||
}
|
||||
$hasil .= $this->__atabel[$n][0] . $this->__atabel[$n][1] ." ... ". $pesan ."<br>";
|
||||
}
|
||||
}
|
||||
return $hasil;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /DB/DumpSQL.php
|
||||
Desc. : v3 - Class Dump Data SQL
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : May 11th, 2011.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2011 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\DB;
|
||||
|
||||
final class DumpSQL {
|
||||
private $__adata = array();
|
||||
private $__aignore = array("vi_%","rep_%");
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
|
||||
$this->__adata = $this->__db->getConfig();
|
||||
}
|
||||
|
||||
public function set_db($nama_db = "") {
|
||||
if ($nama_db<>"") $this->__adata['db'] = $nama_db;
|
||||
}
|
||||
|
||||
public function ignore_table() {
|
||||
$tmp_arr = func_get_args();
|
||||
if (is_array($tmp_arr[0])) $tmp_arr = $tmp_arr[0];
|
||||
$this->__aignore = array_merge($this->__aignore, $tmp_arr);
|
||||
}
|
||||
|
||||
private function ignore_prepare() {
|
||||
$ahasil = array();
|
||||
foreach($this->__aignore as $_val) {
|
||||
if (strpos($_val, "%")===false) {
|
||||
$ahasil[] = $_val;
|
||||
} else {
|
||||
$this->__db->Query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='".$this->__db->getDBName()."' AND TABLE_NAME LIKE '".$_val."'");
|
||||
while ($this->__db->Next()) {
|
||||
$ahasil[] = $this->__db->Row("TABLE_NAME");
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ahasil;
|
||||
}
|
||||
|
||||
public function create_backup($folder="backups") {
|
||||
$namafile = date("Ymd").".gz";
|
||||
$folder = $_SESSION['__WEB_APP']['REAL_PATH'].$folder."/".date("Y");
|
||||
if (!is_dir($folder)) mkdir($folder);
|
||||
if (file_exists($folder."/".$namafile)) unlink($folder."/".$namafile);
|
||||
$_cmd = "mysqldump -C --hex-blob -h ".$this->__adata['host']." -P ".$this->__adata['port']." -u ".$this->__adata['user']." -p".$this->__adata['pwd']." ".$this->__adata['db'];
|
||||
$itable = $this->ignore_prepare();
|
||||
foreach($itable as $_val) $_cmd .= " --ignore-table=".$this->__adata['db'].".".$_val;
|
||||
$_cmd .= " | gzip -9 > ".$folder."/".$namafile;
|
||||
system($_cmd);
|
||||
}
|
||||
|
||||
private function get_file_list($directory) {
|
||||
$arrayItems = array();
|
||||
$skipByExclude = false;
|
||||
$handle = opendir($directory);
|
||||
if ($handle) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
preg_match("/(^(([\.]){1,2})$|(\.(svn|git|md))|(Thumbs\.db|\.DS_STORE))$/iu", $file, $skip);
|
||||
$skipByExclude = in_array($file, array(",",".."));
|
||||
if (!$skip && !$skipByExclude) {
|
||||
if (is_dir($directory. DIRECTORY_SEPARATOR . $file)) {
|
||||
$arrayItems = array_merge($arrayItems, $this->get_file_list($directory. DIRECTORY_SEPARATOR . $file));
|
||||
} else {
|
||||
$file = $directory . DIRECTORY_SEPARATOR . $file;
|
||||
$arrayItems[] = str_replace("\\", "/", $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
return $arrayItems;
|
||||
}
|
||||
|
||||
private function format_bytes($bytes) {
|
||||
if ($bytes < 1024) return $bytes.' B';
|
||||
elseif ($bytes < 1048576) return uang2($bytes / 1024).' KB';
|
||||
elseif ($bytes < 1073741824) return uang2($bytes / 1048576).' MB';
|
||||
elseif ($bytes < 1099511627776) return uang2($bytes / 1073741824).' GB';
|
||||
else return uang2($bytes / 1099511627776).' TB';
|
||||
}
|
||||
|
||||
public function disk_space() {
|
||||
$_free = disk_free_space($_SESSION['__WEB_APP']['REAL_PATH']);
|
||||
$_tot = disk_total_space($_SESSION['__WEB_APP']['REAL_PATH']);
|
||||
$_used = $_tot - $_free;
|
||||
$_aret = array();
|
||||
$_aret['TOTAL'] = $this->format_bytes($_tot);
|
||||
$_aret['USED'] = $this->format_bytes($_used);
|
||||
$_aret['FREE'] = $this->format_bytes($_free);
|
||||
$_aret['USED_P'] = ($_used/$_tot) * 100;
|
||||
$_aret['FREE_P'] = ($_free/$_tot) * 100;
|
||||
return $_aret;
|
||||
}
|
||||
|
||||
public function update_list($folder="backups") {
|
||||
$folder = $_SESSION['__WEB_APP']['REAL_PATH'].$folder;
|
||||
$this->__db->Query("TRUNCATE TABLE app_backup");
|
||||
$afile = $this->get_file_list($folder);
|
||||
foreach($afile as $_key => $_val) {
|
||||
if (file_exists($_val)) {
|
||||
$_file = str_replace($folder."/", "", $_val);
|
||||
$_waktu = date("Y-m-d H:i:s", filemtime($_val));
|
||||
$_ukuran = $this->format_bytes(filesize($_val));
|
||||
$this->__db->Query("INSERT INTO app_backup SET Nama_File='".$_file."',Tanggal='".$_waktu."',Ukuran='".$_ukuran."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,228 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /DB/MySQL.php
|
||||
Desc. : v3 - Class database MySQL / MariaDB
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : February 2nd, 2007.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\DB;
|
||||
|
||||
final class MySQL {
|
||||
private $cnn;
|
||||
private $rs = 0;
|
||||
private $rec = array();
|
||||
private $row = 0;
|
||||
private $halt_on_error = 1; //1: halt w message, 2: not halt w message, 3: not halt no message
|
||||
private $auto_free = 0; //1: free query automatically, 0: must call free method to free query
|
||||
private $db_config = null;
|
||||
private $err_num = 0;
|
||||
private $err_msg = '';
|
||||
private $debug_msg = 1;
|
||||
private $ischangingdb = false;
|
||||
|
||||
public function __construct() {
|
||||
if (!is_array($this->db_config)) $this->setConfig();
|
||||
$this->debug_msg = ($_SERVER['SERVER_ADDR'] == "127.0.0.1") ? 1 : 0;
|
||||
}
|
||||
|
||||
private function setConfig() {
|
||||
global $APP_DATA;
|
||||
if (!is_array($APP_DATA)) {
|
||||
if (file_exists($_SESSION['__WEB_APP']['REAL_PATH']."apps/cfg/mysql.php"))
|
||||
require_once($_SESSION['__WEB_APP']['REAL_PATH']."apps/cfg/mysql.php");
|
||||
}
|
||||
$this->db_config = $APP_DATA;
|
||||
}
|
||||
|
||||
public function getConfig() {
|
||||
return $this->db_config;
|
||||
}
|
||||
|
||||
function Connect() {
|
||||
if (!$this->cnn) {
|
||||
$this->cnn = @mysqli_connect($this->db_config['host'], $this->db_config['user'], $this->db_config['pwd'], $this->db_config['db'], intval($this->db_config['port']), $this->db_config['sock']);
|
||||
if (!$this->cnn) {
|
||||
$this->ErrHandler("Connection failed!");
|
||||
return 0;
|
||||
} else {
|
||||
@mysqli_query($this->cnn, "SET NAMES utf8");
|
||||
@mysqli_query($this->cnn, "SET CHARACTER SET utf8");
|
||||
@mysqli_query($this->cnn, "SET character_set_connection=utf8");
|
||||
}
|
||||
}
|
||||
return $this->cnn;
|
||||
}
|
||||
|
||||
function Connection() {
|
||||
return $this->cnn;
|
||||
}
|
||||
|
||||
function ResultSet() {
|
||||
return $this->rs;
|
||||
}
|
||||
|
||||
function Free() {
|
||||
if (is_resource($this->rs)) @mysqli_free_result($this->rs);
|
||||
$this->rs = 0;
|
||||
$this->row = 0;
|
||||
$this->rec = array();
|
||||
$this->err_num = 0;
|
||||
$this->err_msg = '';
|
||||
}
|
||||
|
||||
function SafeSQL($str) {
|
||||
if (!$this->cnn) $this->Connect();
|
||||
return mysqli_real_escape_string($this->cnn, $str);
|
||||
}
|
||||
|
||||
function &Query($stqry = "", $dbname = "") {
|
||||
if ($stqry == "") return 0;
|
||||
if (!$this->Connect()) return 0;
|
||||
if ($dbname != "" || $this->ischangingdb) {
|
||||
if ($dbname != "") {
|
||||
if (!@mysqli_select_db($this->cnn, $dbname)) {
|
||||
$this->ErrHandler("Cannot select database!");
|
||||
return 0;
|
||||
}
|
||||
$this->ischangingdb = true;
|
||||
} else {
|
||||
if (!@mysqli_select_db($this->cnn, $this->db_config['db'])) {
|
||||
$this->ErrHandler("Cannot select database!");
|
||||
return 0;
|
||||
}
|
||||
$this->ischangingdb = false;
|
||||
}
|
||||
}
|
||||
if ($this->rs) $this->Free();
|
||||
$this->rs = @mysqli_query($this->cnn, $stqry);
|
||||
$this->row = 0;
|
||||
$this->err_msg = @mysqli_error($this->cnn);
|
||||
if (!$this->rs) $this->ErrHandler("Invalid SQL!: ".$stqry);
|
||||
return $this->rs;
|
||||
}
|
||||
|
||||
function Next() {
|
||||
if (!$this->rs) {
|
||||
$this->ErrHandler("Cannot move cursor to next record!");
|
||||
return 0;
|
||||
}
|
||||
$this->rec = @mysqli_fetch_array($this->rs, MYSQLI_ASSOC);
|
||||
$this->row += 1;
|
||||
$this->err_msg = @mysqli_error($this->cnn);
|
||||
$result = is_array($this->rec);
|
||||
if (!$result && $this->auto_free) $this->Free();
|
||||
return $result;
|
||||
}
|
||||
|
||||
function Reset() {
|
||||
@mysqli_data_seek($this->rs, 0);
|
||||
}
|
||||
|
||||
function Seek($rownum = 0) {
|
||||
return @mysqli_data_seek($this->rs, $rownum);
|
||||
}
|
||||
|
||||
function Row($name = "", $defval = "") {
|
||||
if (isset($this->rec[$name])) {
|
||||
return (($this->rec[$name] == "") ? $defval : $this->rec[$name]);
|
||||
} else {
|
||||
return (($defval != "") ? $defval : "");
|
||||
}
|
||||
}
|
||||
|
||||
function RowNumeric($name = "", $defval = 0) {
|
||||
$defval = is_numeric($defval) ? $defval : 0;
|
||||
if (isset($this->rec[$name])) {
|
||||
if (is_numeric($this->rec[$name])) return $this->rec[$name];
|
||||
return $defval;
|
||||
} else return $defval;
|
||||
}
|
||||
|
||||
function RowFloat($name = "", $defval = 0) {
|
||||
$defval = is_numeric($defval) ? $defval : 0;
|
||||
if (isset($this->rec[$name])) {
|
||||
if ($this->rec[$name]) $defval = $this->rec[$name];
|
||||
}
|
||||
return floatval($defval);
|
||||
}
|
||||
|
||||
function AllRow() {
|
||||
return $this->rec;
|
||||
}
|
||||
|
||||
function ValueArray($colname = "") {
|
||||
$currrow = $this->row;
|
||||
@mysqli_data_seek($this->rs, 0);
|
||||
$result = array();
|
||||
while ($__row = mysqli_fetch_array($this->rs))
|
||||
if (isset($__row[$colname])) array_push($result, $__row[$colname]);
|
||||
@mysqli_data_seek($this->rs, $currrow);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function ValueArrayFormater($colname = "", $formater = "") {
|
||||
$currrow = $this->row;
|
||||
$formater = $formater == ""?$formater = "return \$__row[\$colname];":"return ".str_replace("<value>", "\$__row[\$colname]", $formater).";";
|
||||
@mysqli_data_seek($this->rs, 0);
|
||||
$result = array();
|
||||
while ($__row = mysqli_fetch_array($this->rs))
|
||||
if (isset($__row[$colname])) array_push($result, eval($formater));
|
||||
@mysqli_data_seek($this->rs, $currrow);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function ValueList($colname = "", $delim = ",") {
|
||||
$result = @$this->ValueArray($colname);
|
||||
return @implode($delim, $result);
|
||||
}
|
||||
|
||||
function CurrentRow() {
|
||||
return $this->row;
|
||||
}
|
||||
|
||||
function AffectedRows() {
|
||||
return @mysqli_affected_rows($this->cnn);
|
||||
}
|
||||
|
||||
function RecordCount() {
|
||||
return @mysqli_num_rows($this->rs);
|
||||
}
|
||||
|
||||
function NumFields() {
|
||||
return @mysqli_num_fields($this->rs);
|
||||
}
|
||||
|
||||
function LastInsertID() {
|
||||
$lastinsertid = -1;
|
||||
$crs = @mysqli_query($this->cnn, "SELECT LAST_INSERT_ID() AS lastinsertid");
|
||||
$crow = @mysqli_fetch_array($crs);
|
||||
if (isset($crow["lastinsertid"])) if (is_numeric($crow["lastinsertid"])) $lastinsertid = $crow["lastinsertid"];
|
||||
return $lastinsertid;
|
||||
}
|
||||
|
||||
function ErrHandler($err_msg = "") {
|
||||
$this->err_msg = @mysqli_error($this->cnn);
|
||||
if ($this->halt_on_error == 3) return;
|
||||
if ($err_msg == "") $err_msg = "Undefined error!";
|
||||
if ($this->debug_msg) {
|
||||
printf('<span style="font-size:1.2em;"><b>MySQL Error : %s</b> %s</span><br>', $this->db_config['db'], $this->err_msg);
|
||||
printf('<span style="font-size:1.2em;"><b>Database error : </b> %s</span><br>', $err_msg);
|
||||
}
|
||||
if ($this->halt_on_error == 1) die("");
|
||||
}
|
||||
|
||||
function getDBName() {
|
||||
return $this->db_config['db'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /DB/SQL.php
|
||||
Desc. : v3 - Class Query database
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : February 2nd, 2007.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\DB;
|
||||
|
||||
final class SQL {
|
||||
private $__ttable = "";
|
||||
private $__afield = array();
|
||||
private $__avalue = array();
|
||||
private $__anomor = array();
|
||||
private $__twhere = "";
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
}
|
||||
|
||||
public function SafeSQL($ttext = "") {
|
||||
return $this->__db->SafeSQL($ttext);
|
||||
}
|
||||
|
||||
public function set_table($ttable = "") {
|
||||
$this->__ttable = $ttable;
|
||||
}
|
||||
|
||||
public function add_param($tparam = "", $tvalue = null, $bnomor = false) {
|
||||
$this->__afield[] = $tparam;
|
||||
$this->__avalue[] = (is_null($tvalue) && isset($_REQUEST[$tparam])) ? $this->__db->SafeSQL($_REQUEST[$tparam]) : $tvalue;
|
||||
$this->__anomor[] = $bnomor;
|
||||
}
|
||||
|
||||
public function add_param_date($tparam = "", $tvalue = null) {
|
||||
$this->__afield[] = $tparam;
|
||||
$this->__avalue[] = tgl_sql2str((is_null($tvalue) && isset($_REQUEST[$tparam])) ? $this->__db->SafeSQL($_REQUEST[$tparam]) : $tvalue);
|
||||
$this->__anomor[] = false;
|
||||
}
|
||||
|
||||
public function add_param_stamp($tparam = "DateStamp") {
|
||||
$this->__afield[] = $tparam;
|
||||
$this->__avalue[] = "NOW()";
|
||||
$this->__anomor[] = true;
|
||||
}
|
||||
|
||||
public function add_param_unix() {
|
||||
$this->__afield[] = "Unix";
|
||||
$this->__avalue[] = user_unix();
|
||||
$this->__anomor[] = false;
|
||||
}
|
||||
|
||||
public function add_param_userid($tparam = "UserID") {
|
||||
$this->__afield[] = $tparam;
|
||||
$this->__avalue[] = user_id();
|
||||
$this->__anomor[] = false;
|
||||
}
|
||||
|
||||
public function add_where_unix() {
|
||||
$this->__twhere .= (($this->__twhere=="") ? " WHERE " : " AND ") . "(Unix='".user_unix()."')";
|
||||
}
|
||||
|
||||
public function add_where_date($tfield = "", $tvalue = null) {
|
||||
$tvalue = ($tvalue == null) ? "0000-00-00" : tgl_sql2str($tvalue);
|
||||
$this->add_where($tfield, $tvalue);
|
||||
}
|
||||
|
||||
public function add_where($tfield = "", $tvalue = null) {
|
||||
$__tvalue = (is_null($tvalue) && isset($_REQUEST[$tfield])) ? $this->__db->SafeSQL($_REQUEST[$tfield]) : $tvalue;
|
||||
$this->__twhere .= (($this->__twhere=="") ? " WHERE " : " AND ") . "(".$tfield."='".$__tvalue."')";
|
||||
}
|
||||
|
||||
public function clear_param() {
|
||||
$this->__afield = array();
|
||||
$this->__avalue = array();
|
||||
$this->__anomor = array();
|
||||
}
|
||||
|
||||
public function clear_where() {
|
||||
$this->__twhere = "";
|
||||
}
|
||||
|
||||
public function InsertDB() {
|
||||
$tsql = "INSERT INTO ".$this->__ttable." (";
|
||||
$tfield = "";
|
||||
$tvalue = "";
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$tfield .= ",".$this->__afield[$i];
|
||||
$tvalue .= ",".(($this->__anomor[$i])?"":"'").$this->__avalue[$i].(($this->__anomor[$i])?"":"'");
|
||||
}
|
||||
$tsql .= substr($tfield,1);
|
||||
$tsql .= ") VALUES (";
|
||||
$tsql .= substr($tvalue,1);
|
||||
$tsql .= ")";
|
||||
$this->__db->Query($tsql);
|
||||
}
|
||||
|
||||
public function UpdateDB() {
|
||||
$tsql = "UPDATE ".$this->__ttable." SET ";
|
||||
$tfield = "";
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$tfield .= ",".$this->__afield[$i]."=".(($this->__anomor[$i])?"":"'").$this->__avalue[$i].(($this->__anomor[$i])?"":"'");
|
||||
}
|
||||
$tsql .= substr($tfield,1);
|
||||
$tsql .= ($this->__twhere=="") ? "" : $this->__twhere;
|
||||
$this->__db->Query($tsql);
|
||||
}
|
||||
|
||||
public function DeleteDB() {
|
||||
$tsql = "DELETE FROM ".$this->__ttable;
|
||||
$tsql .= ($this->__twhere=="") ? "" : $this->__twhere;
|
||||
$this->__db->Query($tsql);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Data/CSV.php
|
||||
Desc. : v3 - Class pembuatan file CSV
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : April 2rd, 2011.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2011 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Data;
|
||||
|
||||
define( DELI_CSV, ";" );
|
||||
define( CRLF_CSV, "\r\n" );
|
||||
|
||||
final class CSV {
|
||||
private $__avalue = array();
|
||||
private $__atabel = array();
|
||||
|
||||
public function add_field($tnama="", $ffunc="") {
|
||||
$this->__atabel[] = array($tnama, $ffunc);
|
||||
}
|
||||
|
||||
public function add_value() {
|
||||
$tmp_arr = func_get_args();
|
||||
if (is_array($tmp_arr[0])) $tmp_arr = $tmp_arr[0];
|
||||
$tmp_out = "";
|
||||
for ($i=0; $i<count($this->__atabel); $i++) {
|
||||
$tmp_val = $tmp_arr[$i];
|
||||
if (is_array($this->__atabel[$i][1]) && trim($tmp_val)<>"") {
|
||||
$tmp_val = $this->__atabel[$i][1][$tmp_val];
|
||||
} else if (function_exists($this->__atabel[$i][1]) && trim($tmp_val)<>"") {
|
||||
$tmp_val = call_user_func($this->__atabel[$i][1], $tmp_val);
|
||||
}
|
||||
$tmp_out .= DELI_CSV . $tmp_val;
|
||||
}
|
||||
$tmp_out = substr($tmp_out, 1);
|
||||
$this->__avalue[] = $tmp_out;
|
||||
}
|
||||
|
||||
public function download($nama_file="export.csv") {
|
||||
$out = "";
|
||||
// add header
|
||||
$tmp_out = "";
|
||||
for ($i=0; $i<count($this->__atabel); $i++) {
|
||||
$tmp_out .= DELI_CSV . $this->__atabel[$i][0];
|
||||
}
|
||||
$out .= substr($tmp_out, 1) . CRLF_CSV;
|
||||
// add content
|
||||
for ($i=0; $i<count($this->__avalue); $i++) {
|
||||
$out .= $this->__avalue[$i] . CRLF_CSV;
|
||||
}
|
||||
|
||||
header("Content-type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=\"".$nama_file."\"");
|
||||
echo $out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Data/Cache.php
|
||||
Desc. : v3 - Class cache aplikasi
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : March 16th, 2008.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Data;
|
||||
|
||||
use MatthiasMullie\Minify;
|
||||
|
||||
final class Cache {
|
||||
private $__cachedays = 0;
|
||||
private $__cachedir = "";
|
||||
private $__cssdir = "";
|
||||
private $__localedir = "";
|
||||
private $__jsdir = "";
|
||||
private $__jsapp = "";
|
||||
private $__realpath = "";
|
||||
private $__ini = array();
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
|
||||
$rootdir = $_SESSION['__WEB_APP']['REAL_PATH'];
|
||||
$this->__cachedir = $rootdir . 'cache/';
|
||||
$this->__cssdir = __DIR__ . '/../../assets/css/';
|
||||
$this->__localedir = $rootdir . 'assets/locale/';
|
||||
$this->__jsdir = __DIR__ . '/../../assets/js/';
|
||||
$this->__jsapp = $rootdir . 'apps/js/';
|
||||
$this->__realpath = $rootdir;
|
||||
if (!file_exists($this->__cachedir . "cache.ini")) {
|
||||
$this->__ini = array('css'=>array('login_stamp'=>"0",'login_file'=>"",'index_stamp'=>"0",'index_file'=>""), 'js'=>array('login_stamp'=>"0",'login_file'=>"",'index_stamp'=>"0",'index_file'=>""));
|
||||
$this->save_ini();
|
||||
}
|
||||
$this->__ini = parse_ini_file($this->__cachedir . "cache.ini", true);
|
||||
}
|
||||
|
||||
private function gen_file($type="css", $mode="index") {
|
||||
$afile = array();
|
||||
if ($type == "css") {
|
||||
$_afile = array_unique($GLOBALS['A_CSS']);
|
||||
foreach ($_afile as $__key => $val) {
|
||||
$afile[] = $this->__cssdir .$val;
|
||||
}
|
||||
if (file_exists($this->__realpath . 'assets/css/')) {
|
||||
if ($handle = opendir($this->__realpath . 'assets/css/')) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file == '.' || $file == '..' || is_dir($this->__realpath . 'assets/css/'.$file)) continue;
|
||||
$afile[] = $this->__realpath . 'assets/css/' . $file;
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
} else if ($type == "js") {
|
||||
$_afile = array_unique($GLOBALS['A_JS']);
|
||||
foreach ($_afile as $__key => $val) {
|
||||
$afile[] = $this->__jsdir .$val;
|
||||
}
|
||||
if (file_exists($this->__realpath . 'assets/js/')) {
|
||||
if ($handle = opendir($this->__realpath . 'assets/js/')) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file == '.' || $file == '..' || is_dir($this->__realpath . 'assets/js/'.$file)) continue;
|
||||
$afile[] = $this->__realpath . 'assets/js/' . $file;
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
// add locale file
|
||||
$ljs = (isset($_SESSION['__WEB_USER']['LOCALE'])?$_SESSION['__WEB_USER']['LOCALE']:$_SESSION['__WEB_APP']['DEF_LOCALE']).".js";
|
||||
if ($handle = opendir($this->__localedir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
$file = $this->__localedir . $file;
|
||||
if (substr($file, -5) == $ljs) $afile[] = $this->__localedir .basename(str_replace("\\", "/", $file));
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
$afile[] = $this->__jsapp . $mode . ".js";
|
||||
} else if ($type == "app") {
|
||||
$afile[] = $this->__jsapp ."sys/profile.js";
|
||||
$afile[] = $this->__jsapp ."sys/chpasswd.js";
|
||||
$amenu = explode(",", $_SESSION['__WEB_USER']['Menu_Grup'] .",". $_SESSION['__WEB_USER']['Menu']);
|
||||
$tmenu = implode("','", array_unique($amenu));
|
||||
$this->__db->Query("SELECT * FROM app_menu WHERE Link<>'' AND Kode IN ('".$tmenu."') ORDER BY Level, Urut");
|
||||
while ($this->__db->Next()) {
|
||||
$afile[] = $this->__jsapp . str_replace("php", "js", $this->__db->Row("Link"));
|
||||
}
|
||||
}
|
||||
return $afile;
|
||||
}
|
||||
|
||||
private function check_file($afile) {
|
||||
$lastmod = 0;
|
||||
foreach ($afile as $nfile) {
|
||||
if (file_exists($nfile)) {
|
||||
$lastmod += filemtime($nfile);
|
||||
}
|
||||
}
|
||||
if ($this->__cachedays > 0) {
|
||||
if ($handle = opendir($this->__cachedir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file == '.' || $file == '..' || is_dir($this->__cachedir.$file)) continue;
|
||||
if ((time()-filemtime($this->__cachedir.$file)) > (86400*$this->__cachedays)) {
|
||||
unlink($this->__cachedir . $file);
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
return $lastmod;
|
||||
}
|
||||
|
||||
private function create_cache($type="css", $mode="index", $afile=array(), $lastmod=0) {
|
||||
$contents = '';
|
||||
$bpublic = ($_SERVER['SERVER_ADDR'] == "127.0.0.1") ? false : true;
|
||||
if ($bpublic == true) {
|
||||
if ($type=="css") {
|
||||
$smini = new Minify\CSS;
|
||||
} else {
|
||||
$smini = new Minify\JS;
|
||||
}
|
||||
}
|
||||
foreach ($afile as $nfile) {
|
||||
if (file_exists($nfile)) {
|
||||
if ($bpublic == true) {
|
||||
$smini->add($nfile);
|
||||
} else {
|
||||
$contents .= "\n". file_get_contents($nfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($bpublic) $contents = $smini->minify();
|
||||
$cachefile = md5($mode . $lastmod) . ($type=="app"?".app":"") . ($type=="css" ? ".css" : ".js");
|
||||
file_put_contents($this->__cachedir . $cachefile, $contents);
|
||||
if ($type == "app") return;
|
||||
$this->__ini[$type][$mode.'_stamp'] = $lastmod;
|
||||
$this->__ini[$type][$mode.'_file'] = $cachefile;
|
||||
$this->save_ini();
|
||||
}
|
||||
|
||||
private function save_ini(){
|
||||
$content = "";
|
||||
foreach ($this->__ini as $key => $elem) {
|
||||
$content .= ($content==""?"":"\n"). "[".$key."]\n";
|
||||
foreach ($elem as $key2 => $elem2) {
|
||||
if ($elem2=="") $content .= $key2." = \n";
|
||||
else $content .= $key2." = \"".$elem2."\"\n";
|
||||
}
|
||||
}
|
||||
file_put_contents($this->__cachedir . "cache.ini", $content);
|
||||
}
|
||||
|
||||
public function Main($type="css") {
|
||||
$mode = (isset($_SESSION['__WEB_USER']) && is_array($_SESSION['__WEB_USER']) && $_SESSION['__WEB_USER']['UserID']>0) ? "index" : "login";
|
||||
$afile = $this->gen_file($type, $mode);
|
||||
$lastmod = $this->check_file($afile);
|
||||
if ($lastmod <> intval($this->__ini[$type][$mode.'_stamp']) || !file_exists($this->__cachedir . $this->__ini[$type][$mode.'_file'])) {
|
||||
$this->create_cache($type, $mode, $afile, $lastmod);
|
||||
}
|
||||
return $_SESSION['__WEB_APP']['WEB_PATH'] ."cache/". $this->__ini[$type][$mode.'_file'];
|
||||
}
|
||||
|
||||
public function Apps() {
|
||||
$id_user = (isset($_SESSION['__WEB_USER']) && is_array($_SESSION['__WEB_USER'])) ? $_SESSION['__WEB_USER']['UserID'] : 0;
|
||||
$afile = $this->gen_file("app", $id_user);
|
||||
$lastmod = $this->check_file($afile);
|
||||
$appfile = md5($id_user . $lastmod) . ".app.js";
|
||||
if (!file_exists($this->__cachedir . $appfile)) {
|
||||
$this->create_cache("app", $id_user, $afile, $lastmod);
|
||||
}
|
||||
return $_SESSION['__WEB_APP']['WEB_PATH'] ."cache/". $appfile;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Data/PDF.php
|
||||
Desc. : v3 - Class pembuatan file PDF
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : April 18th, 2015.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2015 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Data;
|
||||
|
||||
use Mpdf;
|
||||
|
||||
final class PDF {
|
||||
private $__avalue = array();
|
||||
private $__atabel = array();
|
||||
private $__theader = "";
|
||||
private $__tcolname = "";
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function add_field($tnama="", $nlebar=0, $talign="L", $ffunc="", $nkol=1) {
|
||||
$this->__atabel[] = array($tnama, $nlebar.'%', $ffunc, $talign, $nkol);
|
||||
}
|
||||
|
||||
public function show_fields() {
|
||||
$tmp_out = "<thead><tr>";
|
||||
for ($i=0; $i<count($this->__atabel); $i++) {
|
||||
if ($this->__atabel[$i][4]==0) continue;
|
||||
$tmp_out .= $this->set_align($this->__atabel[$i][0], $this->__atabel[$i][1], "C", false, true, $this->__atabel[$i][4]);
|
||||
}
|
||||
$tmp_out .= "</tr></thead>";
|
||||
$this->__tcolname = $tmp_out;
|
||||
}
|
||||
|
||||
public function clear() {
|
||||
$this->__avalue = array();
|
||||
$this->__theader = "";
|
||||
$this->__tcolname = "";
|
||||
}
|
||||
|
||||
public function set_header($tlapor="", $tperiod="") {
|
||||
$thasil = '<div style="text-align:center;font-size:12pt;"><b>'.strtoupper($_SESSION['__WEB_APP']['REG_NAME']);
|
||||
$thasil .= (($tlapor=="") ? "" : '<br>'.$tlapor) . '</b>';
|
||||
$thasil .= ($tperiod=="") ? "" : '<br><span style="font-size:11pt;">'.$tperiod.'</span>';
|
||||
$thasil .= '</div><br>';
|
||||
$this->__theader = $thasil;
|
||||
}
|
||||
|
||||
public function add_value() {
|
||||
$tmp_arr = func_get_args();
|
||||
if (is_array($tmp_arr[0])) $tmp_arr = $tmp_arr[0];
|
||||
$tmp_out = "<tr>";
|
||||
for ($i=0; $i<count($this->__atabel); $i++) {
|
||||
$tmp_val = $tmp_arr[$i];
|
||||
if (is_array($this->__atabel[$i][2]) && trim($tmp_val)<>"") {
|
||||
$tmp_val = $this->__atabel[$i][2][$tmp_val];
|
||||
} else if (function_exists($this->__atabel[$i][2]) && trim($tmp_val)<>"") {
|
||||
$tmp_val = call_user_func($this->__atabel[$i][2], $tmp_val);
|
||||
}
|
||||
$tmp_val = $this->set_align($tmp_val, $this->__atabel[$i][1], $this->__atabel[$i][3]);
|
||||
$tmp_out .= $tmp_val;
|
||||
}
|
||||
$tmp_out .= "</tr>";
|
||||
$this->__avalue[] = $tmp_out;
|
||||
}
|
||||
|
||||
public function add_span() {
|
||||
$tmp_arr = func_get_args();
|
||||
$tmp_out = "<tr>";
|
||||
for ($i=0; $i<count($tmp_arr); $i++) {
|
||||
$tmp_val = $tmp_arr[$i];// CONTENT, COLSPAN=1, L, FUNC
|
||||
if (function_exists($tmp_val[3]) && trim($tmp_val[0])<>"") {
|
||||
$tmp_val[0] = call_user_func($tmp_val[3], $tmp_val[0]);
|
||||
}
|
||||
$tmp_val = $this->set_align($tmp_val[0], 0, $tmp_val[2], false, false, $tmp_val[1]);
|
||||
$tmp_out .= $tmp_val;
|
||||
}
|
||||
$tmp_out .= "</tr>";
|
||||
$this->__avalue[] = $tmp_out;
|
||||
}
|
||||
|
||||
public function add_empty() {
|
||||
$this->__avalue[] = $this->set_align(" ", 0, "L,NB", true);
|
||||
}
|
||||
|
||||
public function add_stamp($ctk_ke=1, $bnama=false) {
|
||||
$this->__avalue[] = $this->set_align($_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):""), 0, "L,NB", true);
|
||||
}
|
||||
|
||||
public function get_stamp($ctk_ke=1, $bnama=false) {
|
||||
return $_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):"");
|
||||
}
|
||||
|
||||
public function createPDF($nama_file = "Nama_File.pdf", $nfontz = 8, $orien = "P") {
|
||||
$html = '
|
||||
<style>
|
||||
#pdf_area {
|
||||
width: 100%;
|
||||
color: #000;
|
||||
}
|
||||
#pdf_area p { margin: 0; padding: 0; }
|
||||
#pdf_cont table {
|
||||
border: 1px solid #ccc;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
overflow: auto;
|
||||
}
|
||||
#pdf_cont table th, #pdf_cont table td {
|
||||
font-size: 12pt;
|
||||
text-align: left;
|
||||
}
|
||||
#pdf_cont table th {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
padding: 2mm;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
#pdf_cont table td {
|
||||
padding: 1mm;
|
||||
}
|
||||
#pdf_cont table td.left { text-align: left; }
|
||||
#pdf_cont table td.center { text-align: center; }
|
||||
#pdf_cont table td.right { text-align: right; }
|
||||
#pdf_cont table td.bold { font-weight: bold; }
|
||||
#pdf_cont table td.italic { font-style: italic; }
|
||||
</style>
|
||||
<body class="pdf_area">
|
||||
<htmlpagefooter name="RepFoot">
|
||||
<table width="100%" style="border:none;"><tr><td width="50%" style="text-align:left;border:none;">'.$this->get_stamp(1, true).'</td><td width="50%" style="text-align:right;font-style:italic;border:none;">Halaman : {PAGENO} dari {nbpg}</td></tr></table>
|
||||
</htmlpagefooter>
|
||||
<sethtmlpagefooter name="RepFoot" show-this-page="1" value="on" />';
|
||||
if ($this->__theader<>"") $html .= $this->__theader;
|
||||
$html .= '<div id="pdf_cont"><table>';
|
||||
if ($this->__tcolname<>"") $html .= $this->__tcolname;
|
||||
$html .= '<tbody>';
|
||||
|
||||
// content out
|
||||
for ($i=0; $i<count($this->__avalue); $i++) {
|
||||
$html .= $this->__avalue[$i];
|
||||
}
|
||||
$html .= '</tbody></table></div></div></body>';
|
||||
$mpdf = new mPDF('c', 'A4'.($orien=="L"?"-L":""), $nfontz, '', 5, 5, 5, 10, 5, 5);
|
||||
$mpdf->useSubstitutions = false;
|
||||
$mpdf->WriteHTML($html);
|
||||
$mpdf->Output($nama_file.".pdf", "I");
|
||||
}
|
||||
|
||||
public function set_align($ttext, $nlen, $tdir="L", $bline=false, $bhead=false, $ncol=1) {
|
||||
$tstyle = $this->create_style($tdir);
|
||||
if (strpos(strtolower($ttext), "<tr>")===false) { //jika tidak ada <tr> up 2011-04-14
|
||||
if ($bline===true) {
|
||||
return '<tr><td colspan="'.count($this->__atabel).'" class="'.$tstyle.'">'.$ttext."</td></tr>";
|
||||
} else {
|
||||
return (($bhead===true)?"<th":"<td").(($ncol>1)?' colspan="'.$ncol.'"':"").' class="'.$tstyle.'" '.(($bhead===true)?'width="'.$nlen.'"':"").">".$ttext.(($bhead===true)?"</th>":"</td>");
|
||||
}
|
||||
} else {
|
||||
return (($bline===true) ? $ttext : (($bhead===true)?"<th":"<td").(($ncol>1)?" colspan=\"".$ncol."\"":"")." class=\"".$tstyle." \" ".(($bhead===true)?"width=\"".$nlen."\"":"").">".$ttext.(($bhead===true)?"</th>":"</td>"));
|
||||
}
|
||||
}
|
||||
|
||||
private function create_style($tstyle="L") {
|
||||
$apad = array("L"=>"left", "R"=>"right", "C"=>"center", "NB"=>"nb", "NL"=>"noleft", "NR"=>"noright", "B"=>"bold", "I"=>"italic");
|
||||
$_astyle = explode(",", $tstyle);
|
||||
$thasil = "";
|
||||
foreach ($_astyle as $_key => $_val) {
|
||||
$thasil .= " ".$apad[$_val];
|
||||
}
|
||||
return substr($thasil,1);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Function/Auth.php
|
||||
Desc. : Fungsi Custom Auth
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : January 27th, 2008.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!function_exists('user_level')) {
|
||||
function user_level($level = 9) {
|
||||
if ($_SESSION['__WEB_USER']['Level'] <= $level) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('user_logged')) {
|
||||
function user_logged() {
|
||||
if (isset($_SESSION['__WEB_USER'])) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('user_id')) {
|
||||
function user_id($idigit = 0) {
|
||||
if ($idigit > 0) return isi_nol($_SESSION['__WEB_USER']['UserID'], $idigit);
|
||||
return $_SESSION['__WEB_USER']['UserID'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('user_user')) {
|
||||
function user_user() {
|
||||
return $_SESSION['__WEB_USER']['Username'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('user_unix')) {
|
||||
function user_unix() {
|
||||
return $_SESSION['__WEB_USER']['UNIX'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('user_nama')) {
|
||||
function user_nama() {
|
||||
return $_SESSION['__WEB_USER']['Nama'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Function/JSON.php
|
||||
Desc. : Fungsi Custom JSON
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : April 14th, 2012.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2012 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!function_exists('send_json')) {
|
||||
function send_json($ajson = array(), $bempty = false) {
|
||||
if (count($ajson) > 0 || $bempty == true) {
|
||||
header('Cache-Control: no-cache, must-revalidate');
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Content-type: application/json');
|
||||
echo json_encode($ajson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,326 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Function/Misc.php
|
||||
Desc. : Fungsi Custom Lain Lain
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : January 27th, 2008.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*************************** FORMAT ANGKA / CURRENCY *****************************/
|
||||
|
||||
if (!function_exists('rupiah')) {
|
||||
function rupiah($angka = 0, $desi = 0) {
|
||||
return number_format(doubleval($angka), intval($desi), ",", ".");
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('rupiah2')) {
|
||||
function rupiah2($angka = 0) {
|
||||
return rupiah($angka, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('rupiah30')) {
|
||||
function rupiah30($angka = 0) {
|
||||
$nilai = explode(".", $angka);
|
||||
$hasil = (intval($nilai[1])==0) ? rupiah($angka, 0) : rupiah($angka, 3);
|
||||
return $hasil;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('kurung_rup')) {
|
||||
function kurung_rup($angka = 0, $desi = 0) {
|
||||
$thasil = rupiah(abs($angka), $desi);
|
||||
if ($angka<0) return "(".$thasil.")";
|
||||
return $thasil." ";
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('kurung')) {
|
||||
function kurung($angka = 0, $desi = 0) {
|
||||
$thasil = uang(abs($angka), $desi);
|
||||
if ($angka<0) return "(".$thasil.")";
|
||||
return $thasil." ";
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('kurung2')) {
|
||||
function kurung2($angka = 0) {
|
||||
return kurung($angka, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('uang')) {
|
||||
function uang($angka = 0, $desi = 0) {
|
||||
$angka = str_replace(",","",$angka);
|
||||
return number_format(doubleval($angka), intval($desi));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('uang2')) {
|
||||
function uang2($angka = 0) {
|
||||
return uang($angka, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('koma30')) {
|
||||
function koma30($angka = 0) {
|
||||
$nilai = explode(".", $angka);
|
||||
$hasil = (intval($nilai[1])==0) ? uang($angka, 0) : uang($angka, 3);
|
||||
return $hasil;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('items')) {
|
||||
function items($item = 0) {
|
||||
return rupiah($item)." Items";
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('records')) {
|
||||
function records($item = 0) {
|
||||
return rupiah($item)." Records";
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('baris')) {
|
||||
function baris($item = 0) {
|
||||
return rupiah($item)." Baris";
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('npwp')) {
|
||||
function npwp($nomor = "000000000000000") {
|
||||
return substr($nomor,0,2).".".substr($nomor,2,3).".".substr($nomor,5,3).".".substr($nomor,8,1)."-".substr($nomor,9,3).".".substr($nomor,12,3);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('romawi')) {
|
||||
function romawi($n) {
|
||||
$hasil = "";
|
||||
$iromawi = array("","I","II","III","IV","V","VI","VII","VIII","IX","X",20=>"XX",30=>"XXX",40=>"XL",50=>"L",60=>"LX",70=>"LXX",80=>"LXXX",90=>"XC",100=>"C",200=>"CC",300=>"CCC",400=>"CD",500=>"D",600=>"DC",700=>"DCC",800=>"DCCC",900=>"CM",1000=>"M",2000=>"MM",3000=>"MMM");
|
||||
if (array_key_exists($n,$iromawi)) {
|
||||
$hasil = $iromawi[$n];
|
||||
} else if ($n >= 11 && $n <= 99) {
|
||||
$i = $n % 10;
|
||||
$hasil = $iromawi[$n-$i] . Romawi($n % 10);
|
||||
} else if ($n >= 101 && $n <= 999) {
|
||||
$i = $n % 100;
|
||||
$hasil = $iromawi[$n-$i] . Romawi($n % 100);
|
||||
} else {
|
||||
$i = $n % 1000;
|
||||
$hasil = $iromawi[$n-$i] . Romawi($n % 1000);
|
||||
}
|
||||
return $hasil;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('abjad')) {
|
||||
function abjad($n) {
|
||||
$_str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
return substr($_str, ($n-1), 1);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************** FORM CONTROL *****************************/
|
||||
|
||||
if (!function_exists('checkbox')) {
|
||||
function checkbox($nilai = 0) {
|
||||
$bhasil = ((is_string($nilai) && ($nilai=="N" || $nilai=="0")) or (is_numeric($nilai) && $nilai==0) or (is_bool($nilai) && $nilai==false)) ? true : false;
|
||||
return '<input type="checkbox" '.(($bhasil)?"":"checked").' readonly />';
|
||||
}
|
||||
}
|
||||
|
||||
/*************************** FORMAT TANGGAL / KALENDER *****************************/
|
||||
|
||||
if (!function_exists('sqltgl')) {
|
||||
function sqltgl($waktu = "0") {
|
||||
return tgl_sql2str($waktu);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('sqltgls')) {
|
||||
function sqltgls($waktu = "0") {
|
||||
return tgl_sql2str($waktu, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('sqljam')) {
|
||||
function sqljam($waktu = "0") {
|
||||
return tgl_sql2str($waktu, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('sqljams')) {
|
||||
function sqljams($waktu = "0") {
|
||||
return tgl_sql2str($waktu, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_sql2str')) {
|
||||
function tgl_sql2str($waktu = "0", $jam = false, $short = false) {
|
||||
if ($waktu=="0" || $waktu=="") return;
|
||||
$atgl = explode(" ", $waktu);
|
||||
$sjam = ($jam) ? ((empty($atgl[1]))?date("H:i:s"):$atgl[1]) : "";
|
||||
$atgl = explode("-", $atgl[0]);
|
||||
$stgl = $atgl[2]."-".$atgl[1]."-".$atgl[0];
|
||||
if ($short) $stgl = $atgl[2].".".$atgl[1].".".substr($atgl[0],2);
|
||||
return $stgl.(($jam)?" ".$sjam:"");
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_ymd')) {
|
||||
function tgl_ymd($jam = false) {
|
||||
return (($jam) ? date("Y-m-d H:i:s") : date("Y-m-d"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_dmy')) {
|
||||
function tgl_dmy($jam = false) {
|
||||
return (($jam) ? date("d-m-Y H:i:s") : date("d-m-Y"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_operasi')) {
|
||||
function tgl_operasi($dtgl = "", $nhari = 0, $nbln = 0, $nthn = 0) {
|
||||
$atgl = explode("-", $dtgl);
|
||||
return date("d-m-Y", mktime(0,0,0, $atgl[1]+$nbln, $atgl[0]+$nhari, $atgl[2]+$nthn));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_range_hari')) {
|
||||
function tgl_range_hari($dftgl="", $dttgl="", $bhitung_awal=false) {
|
||||
$_start = strtotime(tgl_sql2str($dftgl));
|
||||
$_end = strtotime(tgl_sql2str($dttgl));
|
||||
return ceil(abs($_end - $_start) / 86400) + (($bhitung_awal==true)?1:0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('bulan_array')) {
|
||||
function bulan_array() {
|
||||
return array("1"=>"Januari","2"=>"Februari","3"=>"Maret","4"=>"April","5"=>"Mei","6"=>"Juni","7"=>"Juli","8"=>"Agustus","9"=>"September","10"=>"Oktober","11"=>"November","12"=>"Desember");
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_akhbln')) {
|
||||
function tgl_akhbln($tgl) {
|
||||
$atgl = explode("-", $tgl);
|
||||
$ablna = array(31,28,31,30,31,30,31,31,30,31,30,31);
|
||||
// jika tahun masehi dan bulan 2
|
||||
if ( (round($atgl[2]/4)==($atgl[2]/4)) && intval($atgl[1])==2 ) return "29-02-".$atgl[2];
|
||||
return $ablna[(intval($atgl[1])-1)]."-".isi_nol($atgl[1],2)."-".$atgl[2];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_panjang')) {
|
||||
function tgl_panjang($dtgl = "") {
|
||||
if (trim($dtgl)=="") $dtgl = tgl_dmy();
|
||||
$atgl = explode("-", $dtgl);
|
||||
$abulan = bulan_array();
|
||||
return $atgl[0]." ".$abulan[intval($atgl[1])]." ".$atgl[2];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('tgl_hari')) {
|
||||
function tgl_hari($dtgl = "") {
|
||||
$nhari = date("w");
|
||||
if (trim($dtgl)!="") {
|
||||
//$atgl = getdate($dtgl);
|
||||
//$nhari = $atgl[wday];
|
||||
$nhari = date("w", strtotime(tgl_sql2str($dtgl)));
|
||||
}
|
||||
$ahari = array("0"=>"Minggu","1"=>"Senin","2"=>"Selasa","3"=>"Rabu","4"=>"Kamis","5"=>"Jum'at","6"=>"Sabtu");
|
||||
return $ahari[$nhari];
|
||||
}
|
||||
}
|
||||
if (!function_exists('tgl_triwulan')) {
|
||||
function tgl_triwulan($dtgl = "") {
|
||||
if ($dtgl == "") {
|
||||
$dtgl = date("m");
|
||||
} else {
|
||||
$atgl = explode("-", $tgl);
|
||||
$dtgl = $atgl[1];
|
||||
}
|
||||
$hasil = 0;
|
||||
if ($dtgl >= 1 && $dtgl <= 3) $hasil = 1;
|
||||
if ($dtgl >= 4 && $dtgl <= 6) $hasil = 2;
|
||||
if ($dtgl >= 7 && $dtgl <= 9) $hasil = 3;
|
||||
if ($dtgl >= 10 && $dtgl <= 12) $hasil = 4;
|
||||
return $hasil;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************** FORMAT TAMPILAN & ERROR *****************************/
|
||||
|
||||
if (!function_exists('subjudul')) {
|
||||
function subjudul($tjudul) {
|
||||
return '<table border="0" align="center" valign="middle" width="100%" height="26px"><tr><td width="50%"><hr /></td><td> <span style="text-align:center;font-weight:bold;white-space:nowrap;">'.$tjudul.'</span> </td><td width="50%"><hr /></td></tr></table>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('showerror')) {
|
||||
function showerror($terror) {
|
||||
echo '<input type="hidden" id="_Error" class="error" value="'.$terror.'!" />';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('br2nl')) {
|
||||
function br2nl($string) {
|
||||
return preg_replace('/\<br(\s*)?\/?\>/i', "\n\r", $string);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('isi_nol')) {
|
||||
function isi_nol($nilai = "0", $panjang = 1) {
|
||||
$nilai = strval($nilai);
|
||||
return str_repeat("0", $panjang-strlen($nilai)).$nilai;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('isLinux')) {
|
||||
function isLinux() {
|
||||
$agen = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if (stripos($agen, 'linux') !== false) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('isIE')) {
|
||||
function isIE() {
|
||||
$agen = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if (stripos($agen,'msie') !== false) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('isChrome')) {
|
||||
function isChrome() {
|
||||
$agen = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if (stripos($agen,'chrome') !== false) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('isFirefox')) {
|
||||
function isFirefox() {
|
||||
$agen = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if (stripos($agen,'firefox') !== false) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('potong')) {
|
||||
function potong($nilai) {//utk rkpd
|
||||
return substr($nilai, 0, 60);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Auth.php
|
||||
Desc. : v3 - Fungsi login dan user checking
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : March 16th, 2008.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Auth {
|
||||
private $__id_reg = 0;
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
|
||||
$this->__id_reg = $_SESSION['__WEB_APP']['REG_ID'];
|
||||
}
|
||||
|
||||
public function set_id_reg($id = 0) {
|
||||
if ($id > 0) $this->__id_reg = $id;
|
||||
}
|
||||
|
||||
public function user_check($user, $pass) {
|
||||
$i_hasil = 0;
|
||||
$this->__db->Query("SELECT COUNT(*) Ada FROM app_operator WHERE Username='".$this->__db->safeSQL($user)."' AND Password=MD5('".$this->__db->safeSQL($pass)."') AND Aktif=1");
|
||||
if ($this->__db->Next()) $i_hasil = $this->__db->Row("Ada", 0);
|
||||
return ($i_hasil > 0 ? true : false);
|
||||
}
|
||||
|
||||
public function user_data($user) {
|
||||
$adata = array();
|
||||
$this->__db->Query("SELECT *,DECODE(Menu,'".$this->__id_reg."') Menu2 FROM app_operator WHERE Username='".$this->__db->SafeSQL($user)."'");
|
||||
if ($this->__db->Next()) {
|
||||
$adata = $this->__db->AllRow();
|
||||
$adata['Menu'] = $adata['Menu2'];
|
||||
unset($adata['Menu2']);
|
||||
}
|
||||
if (!isset($_SESSION['APP_TOKEN'])) {
|
||||
$_token = $this->genToken(60);
|
||||
$_SESSION['APP_TOKEN'] = $_token;
|
||||
$this->__db->Query("INSERT INTO app_token SET Token='".$_token."',UserID='".$adata['UserID']."',IP='".$_SERVER['REMOTE_ADDR']."'");
|
||||
}
|
||||
$adata['UNIX'] = time();
|
||||
$adata['LOCALE'] = $_SESSION['__WEB_APP']['DEF_LOCALE'];
|
||||
return $adata;
|
||||
}
|
||||
|
||||
public function gen_module_menu() {
|
||||
$amodul = array();
|
||||
$aallow = array();
|
||||
if ($_SESSION['__WEB_APP']['APP_MODULE']) {
|
||||
$this->__db->Query("SELECT * FROM app_menu_grup WHERE Grup_MenuID='".$_SESSION['__WEB_USER']['Grup_MenuID']."' LIMIT 1");
|
||||
if ($this->__db->Next()) $aallow = ($this->__db->Row("Modul_Akses")=="") ? array() : explode(",", $this->__db->Row("Modul_Akses"));
|
||||
if (count($aallow) > 0) {
|
||||
$this->__db->Query("SELECT * FROM (SELECT APP_MODULE,APP_PATH FROM app_config) A LEFT JOIN (SELECT Modul,Urut,Judul,Icon FROM app_menu WHERE Level=0) B ON (A.APP_MODULE=B.Modul) ORDER BY B.Urut");
|
||||
while ($this->__db->Next()) {
|
||||
if (!in_array($this->__db->Row("Modul"), $aallow) || $this->__db->Row("Modul")==$_SESSION['__WEB_APP']['APP_MODULE']) continue;
|
||||
$amodul[] = $this->__db->AllRow();
|
||||
}
|
||||
}
|
||||
}
|
||||
$_SESSION['__WEB_USER']['MENU_MODUL'] = $amodul;
|
||||
}
|
||||
|
||||
public function user_allmenu($id_grup = 0) {
|
||||
$allmenu = "";
|
||||
$this->__db->Query("SELECT DECODE(Menu,'".$this->__id_reg."') MenuX FROM app_menu_grup WHERE Grup_MenuID='".$id_grup."'");
|
||||
if ($this->__db->Next()) $allmenu = $this->__db->Row("MenuX");
|
||||
return $allmenu;
|
||||
}
|
||||
|
||||
public function user_check_level($user, $level = 9) {
|
||||
$i_hasil = 0;
|
||||
$this->__db->Query("SELECT COUNT(*) Ada FROM app_operator WHERE Username='".$this->__db->safeSQL($user)."' AND Level<='".$this->__db->safeSQL($level)."' AND Aktif=1");
|
||||
if ($this->__db->Next()) $i_hasil = $this->__db->Row("Ada", 0);
|
||||
return ($i_hasil > 0 ? true : false);
|
||||
}
|
||||
|
||||
public function user_log() {
|
||||
if ($_SESSION['__WEB_APP']['USER_LOG'] == false) return;
|
||||
$a_hasil = array();
|
||||
$this->__db->Query("SELECT * FROM app_logs WHERE UserID='".user_id()."' ORDER BY Last_Date DESC LIMIT 1");
|
||||
if ($this->__db->Next()) $a_hasil = $this->__db->AllRow();
|
||||
if (count($a_hasil) > 0) {
|
||||
$this->__db->Query("UPDATE app_operator SET Last_IP='".$a_hasil['Last_IP']."',Last_Date='".$a_hasil['Last_Date']."' WHERE UserID='".user_id()."'");
|
||||
}
|
||||
//$tgl_lalu = tgl_sql2str(tgl_operasi(tgl_dmy(), 0, -3));
|
||||
//$this->__db->Query("DELETE FROM app_logs WHERE UserID='".user_id()."' AND Last_Date<'".$tgl_lalu."'");
|
||||
$this->__db->Query("INSERT IGNORE INTO app_logs SELECT UserID,Token,IP,DateStamp FROM app_token WHERE Token='".$_SESSION['APP_TOKEN']."'");
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
$this->__db->Query("DELETE FROM app_token WHERE Token='".$_SESSION['APP_TOKEN']."'");
|
||||
}
|
||||
|
||||
public function token_check() {
|
||||
$hasil = false;
|
||||
$this->__db->Query("SELECT * FROM app_token WHERE Token='".$_SESSION['APP_TOKEN']."'");
|
||||
if ($this->__db->Next()) $hasil = true;
|
||||
if ($hasil == true) $this->__db->Query("UPDATE app_token SET DateStamp=NOW() WHERE Token='".$_SESSION['APP_TOKEN']."'");
|
||||
return $hasil;
|
||||
}
|
||||
|
||||
public function token_update() {
|
||||
$this->__db->Query("UPDATE app_token SET DateStamp=NOW() WHERE Token='".$_SESSION['APP_TOKEN']."'");
|
||||
}
|
||||
|
||||
public function redirect($appUrl) {
|
||||
$source = parse_url($appUrl);
|
||||
$desti = "";
|
||||
$this->__db->Query("SELECT * FROM app_host WHERE Nama_Host='".$source['host']."'");
|
||||
if ($this->__db->Next()) {
|
||||
$desti = $source['scheme'].$source['host'].$source['path'].'?'.'auth='.$_SESSION['APP_TOKEN'];
|
||||
}
|
||||
return $desti;
|
||||
}
|
||||
|
||||
private function genToken($length = 16) {
|
||||
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
return substr(str_shuffle(str_repeat($pool, 5)), 0, $length);
|
||||
}
|
||||
|
||||
public function getUserByToken($token) {
|
||||
$hasil = "";
|
||||
$this->__db->Query("SELECT * FROM app_operator WHERE UserID IN (SELECT UserID FROM app_token WHERE Token='".$token."') LIMIT 1");
|
||||
if ($this->__db->Next()) $hasil = $this->__db->Row("Username");
|
||||
return $hasil;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Form.php
|
||||
Desc. : v3 - Form Generator v3 (jQuery & CoreUI)
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : February 27th, 2008.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Form {
|
||||
private $__aform = array();
|
||||
private $__ahide = array();
|
||||
private $__button = null;
|
||||
private $__nbtnsize = 2;
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
|
||||
$this->__button = new Button();
|
||||
}
|
||||
|
||||
public function option($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null, $bmulti=false) {//oke
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ($tchange==null) ? "" : ' onchange="'.$tchange.'"';
|
||||
$_multi = ($bmulti==true) ? ' multiple=true' : "";
|
||||
$tout = '<select class="form-control option-tags" id="'.$tfield.'" name="'.$tfield.'"'.$_enab.$_change.$_req.$_multi.' >';
|
||||
if (count($aarr)>0) {
|
||||
foreach ($aarr as $key => $val) {
|
||||
$_val2 = $val; $olabel = "";
|
||||
if (is_array($val)) {
|
||||
$_val2 = $val[0];
|
||||
$olabel = (isset($val[1])) ? ' olabel="'.$val[1].'"' : "";
|
||||
}
|
||||
$tout .= '<option value="'.$key.'"'.$olabel;
|
||||
$aval = array($tvalue);
|
||||
if ($bmulti==true) $aval = explode(",", $tvalue);
|
||||
$tout .= (in_array($key, $aval)) ? ' selected="selected"' : "";
|
||||
$tout .= '>'.$_val2.'</option>';
|
||||
}
|
||||
}
|
||||
$tout .= '</select>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function option_db($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $ttable=null, $afield=null, $twhere=null, $addarray=null, $thelp="", $tchange=null) {//oke
|
||||
$afield = ($afield==null) ? array("ID", "Nama", "Label") : $afield;
|
||||
$_twhere = ($twhere==null) ? "" : " WHERE ".$twhere;
|
||||
$_twhere .= ($twhere===null || stripos($twhere,"ORDER BY")===false) ? " ORDER BY ".$afield[1] : "";
|
||||
$ahasil = array();
|
||||
if (is_array($addarray)) $ahasil[$addarray[0]] = (!isset($afield[2])) ? $addarray[1] : array($addarray[1], $addarray[2]);
|
||||
if ($ttable<>null) {
|
||||
$this->__db->Query("SELECT ".implode(",", $afield)." FROM ".$ttable.$_twhere);
|
||||
while ($this->__db->Next()) {
|
||||
$ahasil[$this->__db->Row($afield[0])] = (!isset($afield[2])) ? $this->__db->Row($afield[1]) : array($this->__db->Row($afield[1]), $this->__db->Row($afield[2]));
|
||||
}
|
||||
}
|
||||
$tout = $this->option($tlabel, $tfield, $tvalue, $benable, $breq, $ahasil, $thelp, $tchange);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function option_que($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $tquery=null, $afield=null, $addarray=null, $thelp="", $tchange=null) {//oke
|
||||
$afield = ($afield==null) ? array("ID", "Nama", "Label") : $afield;
|
||||
$ahasil = array();
|
||||
if (is_array($addarray)) $ahasil[$addarray[0]] = (!isset($afield[2])) ? $addarray[1] : array($addarray[1], $addarray[2]);
|
||||
if ($tquery<>null) {
|
||||
$this->__db->Query($tquery);
|
||||
while ($this->__db->Next()) {
|
||||
$ahasil[$this->__db->Row($afield[0])] = (!isset($afield[2])) ? $this->__db->Row($afield[1]) : array($this->__db->Row($afield[1]), $this->__db->Row($afield[2]));
|
||||
}
|
||||
}
|
||||
$tout = $this->option($tlabel, $tfield, $tvalue, $benable, $breq, $ahasil, $thelp, $tchange);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function option_jkl($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tchange=null) {//oke
|
||||
$akel = array("L" => "Laki-Laki", "P" => "Perempuan");
|
||||
$tout = $this->option($tlabel, $tfield, $tvalue, $benable, $breq, $akel, $thelp, $tchange);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function option_ulevel($tlabel="", $tfield, $tvalue=9, $benable=true, $breq=false, $thelp="", $tchange=null) {//oke
|
||||
$tout = $this->option($tlabel, $tfield, $tvalue, $benable, $breq, $_SESSION['__WEB_APP']['USER_LEVEL'], $thelp, $tchange);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function radio($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null) {//oke
|
||||
if ($tvalue == null) {
|
||||
$tmp_key = array_keys($aarr);
|
||||
$tvalue = $tmp_key[0];
|
||||
}
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ($tchange==null) ? "" : ' onchange="'.$tchange.'"';
|
||||
$tout = '<input type="hidden" id="'.$tfield.'" value="'.$tvalue.'" />';
|
||||
if (count($aarr)>0) {
|
||||
foreach ($aarr as $key => $val) {
|
||||
$tout .= '<div class="form-check form-check-inline mr-2"><input class="form-check-input" id="'.$tfield.$key.'" type="radio" value="'.$key.'" name="'.$tfield.'"';
|
||||
$tout .= ($key == $tvalue) ? ' checked="checked"' : '';
|
||||
$tout .= ' onclick="if(this.checked)$(\'#'.$tfield.'\').val(this.value);"'.$_enab.$_change.$_req;
|
||||
$tout .= '><label class="form-check-label" for="'.$tfield.$key.'">'.$val.'</label></div>';
|
||||
}
|
||||
}
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function radio_jkl($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tchange=null) {//oke
|
||||
$tout = $this->radio($tlabel, $tfield, $tvalue, $benable, $breq, array("L" => "Laki-Laki", "P" => "Perempuan"), $thelp, $tchange);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function radio_gd($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tchange=null) {//oke
|
||||
$tvalue = ($tvalue=="") ? "X" : $tvalue;
|
||||
$tout = $this->radio($tlabel, $tfield, $tvalue, $benable, $breq, array("A"=>"A", "B"=>"B", "AB"=>"AB", "O"=>"O", "X"=>"NONE"), $thelp, $tchange);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function checkbox($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $avalue=array(), $thelp="", $tchange=null) {//oke
|
||||
$bhasil = ((is_string($tvalue) && in_array($tvalue,array("N","T","0"))) or (is_numeric($tvalue) && $tvalue==0) or (is_bool($tvalue) && $tvalue===false) or empty($tvalue)) ? true : false;
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.$tchange.'"';
|
||||
$tout .= '<div class="form-check form-check-inline mr-1"><input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req;
|
||||
$tout .= ($bhasil==false) ? ' checked="checked"' : '';
|
||||
$tout .= '></div>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function switch_sq($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null) {//oke
|
||||
$_key = array_keys($aarr); $_val = array_values($aarr);
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';'.$tchange.'"';
|
||||
$tout = '<label class="c-switch c-switch-label c-switch-info"><input class="c-switch-input" type="checkbox" id="'.$tfield.'" name="'.$tfield.'" value="'.$tvalue.'"'.$_enab.$_change.$_req;
|
||||
$tout .= ($_key[0] == $tvalue) ? ' checked="checked"' : '';
|
||||
$tout .= '><span class="c-switch-slider" data-checked="'.$_val[0].'" data-unchecked="'.$_val[1].'"></span></label>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
/* belum diupgrade !! */
|
||||
public function form_group_cbox($tfield, $tkey=null, $tclass=null, $ttable=null, $afield=null, $ncol=2) {
|
||||
if ($ttable==null) return;
|
||||
$avalue = explode(",", $tkey);
|
||||
$afield = ($afield==null) ? array("ID", "Nama") : $afield;
|
||||
$_twhere = ($twhere=="") ? " ORDER BY ".$afield[0] : " WHERE ".$twhere;
|
||||
$tout = "<input id=\"".$tfield."\" value=\"".$tkey."\" type='hidden' class='cgrpbox' /><table width='100%' style='margin:1px 0;padding:2px 2px;'><tr>";
|
||||
|
||||
$nkol = 1;
|
||||
$this->__db->Query("SELECT ".implode(",", $afield)." FROM ".$ttable.$_twhere);
|
||||
while ($this->__db->Next()) {
|
||||
$tout .= "<td width='".round(100/$ncol)."%'><label><input type='checkbox' id='".$tfield."_cgrpbox_".$this->__db->Row($afield[0])."' value='".$this->__db->Row($afield[0])."'";
|
||||
for ($i=0; $i<count($avalue); $i++) {
|
||||
if ($avalue[$i]==$this->__db->Row($afield[0])) {
|
||||
$tout .= " checked=\"checked\"";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$tout .= " class='text ".$tclass."' /> ".$this->__db->Row($afield[1])."</label></td>";
|
||||
if ($nkol==$ncol) {
|
||||
$tout .= "</tr><tr>";
|
||||
$nkol = 0;
|
||||
}
|
||||
$nkol++;
|
||||
}
|
||||
$tout .= "</tr></table>";
|
||||
$this->__aform[$tfield] = $tout;
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function textbox($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $ttype="text", $holdtxt=null, $nmaxsize=null, $thelp="", $tkeyup=null, $tblur=null) {//oke
|
||||
$_enab = ($benable==true) ? "" : ' readonly';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_max = ($nmaxsize==null) ? "" : ' maxlength="'.$nmaxsize.'"';
|
||||
$_keyup = ($tkeyup==null) ? "" : ' onkeyup="'.$tkeyup.'"';
|
||||
$_blur = ($tblur==null) ? "" : ' onblur="'.$tblur.'"';
|
||||
$_holdtxt = ($holdtxt==null) ? "" : ' placeholder="'.$holdtxt.'"';
|
||||
$_tclass = "";
|
||||
if (in_array($ttype,array("pickdate","picktime"))) {
|
||||
$_tclass = ' '.$ttype;
|
||||
$ttype = "text";
|
||||
}
|
||||
if (in_array($ttype,array("double"))) {
|
||||
$_tclass = ' '.$ttype;
|
||||
$tvalue = uang2($tvalue);
|
||||
}
|
||||
$tout = '<input type="'.$ttype.'" class="form-control'.$_tclass.'" id="'.$tfield.'" name="'.$tfield.'" value="'.$tvalue.'"'.$_enab.$_max.$_keyup.$_blur.$_holdtxt.$_req.' />';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function textauto($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="") {//oke
|
||||
$tvalue = ($tvalue==null) ? array('value'=>0, 'text'=>"") : $tvalue;
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_max = ($nmaxsize==null) ? "" : ' maxlength="'.$nmaxsize.'"';
|
||||
$_holdtxt = ($holdtxt==null) ? "" : ' placeholder="'.$holdtxt.'"';
|
||||
$tout = '<select class="form-control" id="'.$tfield.'" name="'.$tfield.'" default-value="'.$tvalue['value'].'" default-text="'.$tvalue['text'].'"'.$_enab.$_max.$_holdtxt.$_req.' /></select>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function datebox($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tkeyup=null, $tblur=null) {//oke
|
||||
if ($tvalue<>null) $tvalue = tgl_sql2str($tvalue);
|
||||
$tout = '<div class="input-group">';
|
||||
$tout .= $this->textbox($tlabel, $tfield, $tvalue, $benable, $breq, "pickdate", "dd-mm-yyyy", 12, $thelp, $tkeyup, $tblur);
|
||||
$tout .= '<div class="input-group-append"><span class="input-group-text"><i class="cui-calendar"></i></span></div></div>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function timebox($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tkeyup=null, $tblur=null) {//oke
|
||||
$tout = $this->textbox($tlabel, $tfield, $tvalue, $benable, $breq, "picktime", "hh:mm:ss", 10, $thelp, $tkeyup, $tblur);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function textarea($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $nrows=1, $holdtxt=null, $thelp="", $tkeyup=null, $tblur=null) {//oke
|
||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||
$_req = ($breq==true) ? " required=true" : "";
|
||||
$_rows = ($nrows==null) ? "" : ' rows="'.$nrows.'"';
|
||||
$_keyup = ($tkeyup==null) ? "" : ' onkeyup="'.$tkeyup.'"';
|
||||
$_blur = ($tblur==null) ? "" : ' onblur="'.$tblur.'"';
|
||||
$_holdtxt = ($holdtxt==null) ? "" : ' placeholder="'.$holdtxt.'"';
|
||||
$tout = '<textarea class="form-control" id="'.$tfield.'" name="'.$tfield.'"'.$_enab.$_rows.$_keyup.$_blur.$_holdtxt.$_req.' >'.$tvalue.'</textarea>';
|
||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function password($tlabel="", $tfield, $tvalue="", $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="", $tkeyup=null) {//oke
|
||||
$tout = $this->textbox($tlabel, $tfield, $tvalue, $benable, $breq, "password", $holdtxt, $nmaxsize, $thelp, $tkeyup, $tblur);
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function hidden($tfield, $tvalue="", $tclass="text") {//oke
|
||||
$tout = '<input type="hidden" id="'.$tfield.'" value="'.$tvalue.'" class="'.$tclass.'" />';
|
||||
$this->__ahide[$tfield] = $tout;
|
||||
return $tout;
|
||||
}
|
||||
|
||||
public function clear() {//oke
|
||||
$this->__aform = array();
|
||||
}
|
||||
|
||||
public function show($tstr) {//oke
|
||||
foreach ($this->__aform as $_key => $_val) {
|
||||
$tval = '<div class="form-row mb-1"><label class="col-sm-5 col-lg-4 col-form-label" for="'.$_key.'">'.$_val['label'].'</label><div class="col-sm-7 col-lg-8">'.$_val['form'].($_val['help']==""?'':'<span class="help-block"><small>'.$_val['help'].'</small></span>').'</div></div>';
|
||||
$tstr = str_replace("_".$_key."_", $tval, $tstr);
|
||||
}
|
||||
$txtbtn = $this->__button->Button($this->__nbtnsize);
|
||||
if (""<>$txtbtn) {
|
||||
$tstr .= '<div class="row mb-1"><div class="col"><hr class="my-2"></div></div>';
|
||||
$tstr .= $txtbtn;
|
||||
}
|
||||
foreach ($this->__ahide as $_key => $_val) {
|
||||
$tstr = str_replace("_".$_key."_", $_val, $tstr);
|
||||
}
|
||||
$tstr = str_replace("\n", "", $tstr);
|
||||
$tstr = str_replace("\t", "", $tstr);
|
||||
echo $tstr;
|
||||
}
|
||||
|
||||
public function btn_separator() {//oke
|
||||
$this->__button->separator();
|
||||
}
|
||||
public function btn_primary($id="", $label="", $bmiss=false) {//oke
|
||||
$this->__button->primary($id, $label, $bmiss);
|
||||
}
|
||||
public function btn_info($id="", $label="", $bmiss=false) {//oke
|
||||
$this->__button->info($id, $label, $bmiss);
|
||||
}
|
||||
public function btn_danger($id="", $label="", $bmiss=false) {//oke
|
||||
$this->__button->danger($id, $label, $bmiss);
|
||||
}
|
||||
public function btn_warning($id="", $label="", $bmiss=false) {//oke
|
||||
$this->__button->warning($id, $label, $bmiss);
|
||||
}
|
||||
public function btn_success($id="", $label="", $bmiss=false) {//oke
|
||||
$this->__button->success($id, $label, $bmiss);
|
||||
}
|
||||
public function btn_secondary($id="", $label="", $bmiss=false) {//oke
|
||||
$this->__button->secondary($id, $label, $bmiss);
|
||||
}
|
||||
public function Button($size=2) {//oke
|
||||
$this->__nbtnsize = $size;
|
||||
}
|
||||
}
|
||||
|
||||
class Button {
|
||||
private $__abutton = array();
|
||||
private $__bsepa = false;
|
||||
|
||||
public function __construct() {}
|
||||
private function add($type="info", $id="", $label="", $bmiss=false) {//oke
|
||||
if ($id=="") $id = "random".rand(1000, 10000);
|
||||
$this->__abutton[] = array('type'=>$type, 'id'=>$id, 'label'=>$label, 'bmiss'=>$bmiss);
|
||||
}
|
||||
|
||||
public function separator() {//oke
|
||||
$this->__abutton[] = array('type'=>"separator");
|
||||
$this->__bsepa = true;
|
||||
}
|
||||
public function primary($id="", $label="", $bmiss=false) {//oke
|
||||
$this->add("primary", $id, $label, $bmiss);
|
||||
}
|
||||
public function info($id="", $label="", $bmiss=false) {//oke
|
||||
$this->add("info", $id, $label, $bmiss);
|
||||
}
|
||||
public function danger($id="", $label="", $bmiss=false) {//oke
|
||||
$this->add("danger", $id, $label, $bmiss);
|
||||
}
|
||||
public function warning($id="", $label="", $bmiss=false) {//oke
|
||||
$this->add("warning", $id, $label, $bmiss);
|
||||
}
|
||||
public function success($id="", $label="", $bmiss=false) {//oke
|
||||
$this->add("success", $id, $label, $bmiss);
|
||||
}
|
||||
public function secondary($id="", $label="", $bmiss=false) {//oke
|
||||
$this->add("secondary", $id, $label, $bmiss);
|
||||
}
|
||||
|
||||
public function Button($size=2) {//oke
|
||||
if (0==count($this->__abutton)) return "";
|
||||
$items = count($this->__abutton) - ($this->__bsepa==true ? 1 : 0);
|
||||
$sepa_size = (12 == $items*$size) ? 0 : 12 - ($items*$size);
|
||||
$_out = '<div class="row mb-3">';
|
||||
foreach ($this->__abutton as $item) {
|
||||
if ("separator" == $item['type']) {
|
||||
if (0 < $sepa_size) $_out .= '<div class="d-none d-lg-block col-lg-'.$sepa_size.'"> </div>';
|
||||
} else {
|
||||
$_out .= '<div class="col-md-'.floor($size*2).' col-lg-'.$size.' mb-1 mb-sm-0"><button type="button" class="btn btn-block btn-'.$item['type'].'" id="'.$item['id'].'"'.(true==$item['bmiss']?' data-dismiss="modal"':'').'>'.$item['label'].'</button></div>';
|
||||
}
|
||||
}
|
||||
$_out .= '</div>';
|
||||
return $_out;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Menu.php
|
||||
Desc. : v3 - Class menu
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : January 16th, 2008.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Menu {
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
}
|
||||
|
||||
private function Menu_Query($qry = "", $order = "Kode") {
|
||||
$twhere = ($qry!="") ? "WHERE ".$qry : "";
|
||||
$this->__db->Query("SELECT * FROM app_menu ".$twhere." ORDER BY ".$order." ASC");
|
||||
$ahasil = array();
|
||||
while ($this->__db->Next()) {
|
||||
$ahasil[] = $this->__db->AllRow();
|
||||
}
|
||||
return $ahasil;
|
||||
}
|
||||
|
||||
public function Menu_Sidebar() {
|
||||
$a_modul = array();
|
||||
$is_modul = (isset($_SESSION['__WEB_APP']['APP_MODULE']) && $_SESSION['__WEB_APP']['APP_MODULE'] <> "") ? true : false;
|
||||
if ($is_modul == true) {
|
||||
$a_modul[] = $_SESSION['__WEB_APP']['APP_MODULE'];
|
||||
} else {
|
||||
$atmp = $this->Menu_Query("Level=0 AND Aktif=1 AND Modul<>'IND'", "Urut");
|
||||
for ($i=0; $i<count($atmp); $i++) {
|
||||
$a_modul[] = $atmp[$i]['Modul'];
|
||||
}
|
||||
}
|
||||
|
||||
$my_menu = explode(",", (($_SESSION['__WEB_USER']['Menu_Grup'])?$_SESSION['__WEB_USER']['Menu_Grup'].",":"").$_SESSION['__WEB_USER']['Menu']);
|
||||
$tsql = " AND Modul IN ('".implode("','",$a_modul)."')";
|
||||
$tsql .= ($is_modul == true) ? " AND Level>0" : "";
|
||||
$tsql .= " AND Kode IN ('".implode("','",$my_menu)."')";
|
||||
|
||||
$amodul = $this->Menu_Query("Aktif=1".$tsql, "Kode");
|
||||
$thasil = '';
|
||||
|
||||
$last_level = 0; $last_divider = false;
|
||||
for ($i=0; $i<count($amodul); $i++) {
|
||||
if (($i>0) and ($amodul[$i]['Level']<$amodul[$i-1]['Level'])) {
|
||||
$thasil .= str_repeat("</ul></li>", $amodul[$i-1]['Level']-$amodul[$i]['Level']);
|
||||
}
|
||||
if (($amodul[$i]['Level']>=0) && (isset($amodul[$i+1]) && ($amodul[$i+1]['Level']>$amodul[$i]['Level']))) {
|
||||
$ticon = ($amodul[$i]['Icon']) ? $amodul[$i]['Icon'] : "cui-puzzle";
|
||||
$thasil .= '<li class="c-nav-item c-nav-dropdown '.($i==0?'c-open':'').'"><a class="c-nav-link c-nav-dropdown-toggle" title="'.$amodul[$i]['Judul'].'"><i class="c-nav-icon '.$ticon.'"></i> '.$amodul[$i]['Menu'].'</a><ul class="c-nav-dropdown-items">';
|
||||
} else if (trim($amodul[$i]['Menu'])=="-") {
|
||||
$thasil .= '<li class="c-nav-divider"></li>';
|
||||
} else {
|
||||
$thasil .= '<li class="c-nav-item"><a class="c-nav-link mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'"><span class="c-nav-icon"></span> '.$amodul[$i]['Menu'].'</a></li>';
|
||||
}
|
||||
$last_level = $amodul[$i]['Level'];
|
||||
}
|
||||
if ($last_level>1) $thasil .= str_repeat("</ul></li>", $last_level-1);
|
||||
return $thasil;
|
||||
}
|
||||
|
||||
public function Menu_Header() {
|
||||
$a_modul = array();
|
||||
$is_modul = (isset($_SESSION['__WEB_APP']['APP_MODULE']) && $_SESSION['__WEB_APP']['APP_MODULE'] <> "") ? true : false;
|
||||
$mulai_level = 0;
|
||||
if ($is_modul == true) {
|
||||
$a_modul[] = $_SESSION['__WEB_APP']['APP_MODULE'];
|
||||
$mulai_level = 1;
|
||||
} else {
|
||||
$atmp = $this->Menu_Query("Level=0 AND Aktif=1 AND Modul<>'IND'", "Urut");
|
||||
for ($i=0; $i<count($atmp); $i++) {
|
||||
$a_modul[] = $atmp[$i]['Modul'];
|
||||
}
|
||||
}
|
||||
|
||||
$my_menu = explode(",", (($_SESSION['__WEB_USER']['Menu_Grup'])?$_SESSION['__WEB_USER']['Menu_Grup'].",":"").$_SESSION['__WEB_USER']['Menu']);
|
||||
$tsql = " AND Modul IN ('".implode("','",$a_modul)."')";
|
||||
$tsql .= ($is_modul == true) ? " AND Level>0" : "";
|
||||
$tsql .= " AND Kode IN ('".implode("','",$my_menu)."')";
|
||||
|
||||
$amodul = $this->Menu_Query("Aktif=1".$tsql, "Kode");
|
||||
$thasil = '';
|
||||
|
||||
$last_level = 0;
|
||||
for ($i=0; $i<count($amodul); $i++) {
|
||||
if (($i>0) and ($amodul[$i]['Level']<$amodul[$i-1]['Level'])) {
|
||||
$thasil .= str_repeat("</ul></li>", $amodul[$i-1]['Level']-$amodul[$i]['Level']);
|
||||
}
|
||||
if (isset($amodul[$i+1]) && ($amodul[$i+1]['Level']>$amodul[$i]['Level'])) {
|
||||
if ($amodul[$i]['Level']==$mulai_level) {
|
||||
$ticon = ($amodul[$i]['Icon']) ? " mr-1 ".$amodul[$i]['Icon'] : "";
|
||||
$thasil .= '<li class="c-header-nav-item px-3"><a class="c-header-nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="'.$amodul[$i]['Judul'].'"><i class="c-nav-icon'.$ticon.'"></i> '.$amodul[$i]['Menu'].'<b class="caret"></b></a><ul class="dropdown-menu multi-level">';
|
||||
} else if ($amodul[$i]['Level']==($mulai_level+1)) {
|
||||
$thasil .= '<li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle slink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="'.$amodul[$i]['Judul'].'"><i class="c-nav-icon"></i> '.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu">';
|
||||
}
|
||||
} else if (trim($amodul[$i]['Menu'])=="-" && $amodul[$i]['Level']>$mulai_level) {
|
||||
$thasil .= '<li class="dropdown-divider"></li>';
|
||||
} else if ($amodul[$i]['Level']==$mulai_level) {
|
||||
$ticon = ($amodul[$i]['Icon']) ? " mr-1 ".$amodul[$i]['Icon'] : "";
|
||||
$thasil .= '<li class="c-header-nav-item px-3"><a class="c-header-nav-link mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'"><span class="c-nav-icon'.$ticon.'"></span> '.$amodul[$i]['Menu'].'</a></li>';
|
||||
} else {
|
||||
$thasil .= '<li><a class="dropdown-item mlink" data-toggle="collapse" data-target=".dropdown-menu.show" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$amodul[$i]['Menu'].'</a></li>';
|
||||
}
|
||||
$last_level = $amodul[$i]['Level'];
|
||||
}
|
||||
if ($last_level>$mulai_level) $thasil .= str_repeat("</ul></li>", $last_level-$mulai_level);
|
||||
return $thasil;
|
||||
}
|
||||
|
||||
static function MenuJSON($db = null, $page = "", $tquery = "") {
|
||||
if (is_resource($db)) { $_mdb = $db; }
|
||||
else $_mdb = new \siaupheng\fonia3\DB\MySQL();
|
||||
$_query = ($tquery=="") ? "" : ",'".$tquery."'";
|
||||
$ajson = array('login' => true);
|
||||
$apage = array('Link' => "");
|
||||
|
||||
$acus_page = array(
|
||||
'SYSP' => array('Kode'=>"SYSP", 'Judul'=>"Profil Pengguna", 'Link'=>"sys/profile.php", 'JS'=>"SYSProfileJS", 'Width'=>600, 'Button'=>"_,C,S"),
|
||||
'SYSC' => array('Kode'=>"SYSC", 'Judul'=>"Ubah Password", 'Link'=>"sys/chpasswd.php", 'JS'=>"SYSChpasswdJS", 'Width'=>400, 'Button'=>"_,C,S")
|
||||
);
|
||||
|
||||
if ($acus_page[$page]) {
|
||||
$apage = $acus_page[$page];
|
||||
} else if ($page <> "") {
|
||||
$_mdb->Query("SELECT * FROM app_menu WHERE Kode='".$page."'");
|
||||
if ($_mdb->Next()) $apage = $_mdb->AllRow();
|
||||
}
|
||||
|
||||
$ajson['iswindow'] = ($apage['Width'] > 0) ? true : false;
|
||||
$ajson['width'] = $apage['Width'];
|
||||
$ajson['title'] = $apage['Judul'];
|
||||
$ajson['button'] = $apage['Button'];
|
||||
$ajson['php'] = $apage['Link'];
|
||||
$ajson['func'] = $apage['JS'];
|
||||
$ajson['kode'] = $apage['Kode'];
|
||||
|
||||
if ($ajson['iswindow'] == false) {
|
||||
$tsql = (isset($_SESSION['__WEB_APP']['APP_MODULE']) && $_SESSION['__WEB_APP']['APP_MODULE'] <> "") ? " AND Modul='".$_SESSION['__WEB_APP']['APP_MODULE']."' AND Level>0" : "";
|
||||
$a_bread = array(); $i_level = null;
|
||||
$_mdb->Query("SELECT Kode,Level,Menu FROM app_menu WHERE Kode<='".$page."'".$tsql." ORDER BY Kode DESC");
|
||||
while ($_mdb->Next()) {
|
||||
if ($page == $_mdb->Row("Kode") || $i_level > $_mdb->Row("Level")) {
|
||||
$a_bread[] = $_mdb->Row("Menu");
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
$i_level = $_mdb->Row("Level");
|
||||
}
|
||||
$a_bread[] = "Beranda";
|
||||
$ajson['bread'] = $a_bread;
|
||||
}
|
||||
if (!file_exists($_SESSION['__WEB_APP']['REAL_PATH']."apps/php/".$apage['Link'])) $ajson['php'] = "";
|
||||
return $ajson;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Param.php
|
||||
Desc. : Class akses data parameter dari client side
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : November 14th, 2013.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2013 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Param {
|
||||
private static $__ahasil = array();
|
||||
|
||||
public function __construct() {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
}
|
||||
|
||||
private static function __data() {
|
||||
$_asumber = array_merge($_REQUEST, $_POST, $_GET);
|
||||
foreach ($_asumber as $__key => $__val) {
|
||||
self::$__ahasil[$__key] = self::safeSQL($__val);
|
||||
}
|
||||
}
|
||||
|
||||
public static function safeSQL($tstr = "") {
|
||||
$_se = array("\\","\0","\n","\r","\x1a","'",'"');
|
||||
$_re = array("\\\\","\\0","\\n","\\r","\Z","\'",'\"');
|
||||
return str_replace($_se, $_re, $tstr);
|
||||
}
|
||||
|
||||
public static function Get($tkey = "", $tdef = null) {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
if (isset(self::$__ahasil[$tkey]) && self::$__ahasil[$tkey]) return self::$__ahasil[$tkey];
|
||||
return $tdef;
|
||||
}
|
||||
|
||||
public static function Get_Text($tkey = "", $tdef = null) {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
$_str = (isset(self::$__ahasil[$tkey])) ? self::$__ahasil[$tkey] : $tdef;
|
||||
$_str = str_replace("\\r", "", $_str);
|
||||
$_str = str_replace("\\n", " ", $_str);
|
||||
$_str = str_replace("\\t", " ", $_str);
|
||||
return (trim($_str));
|
||||
}
|
||||
|
||||
public static function Get_Array() {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
return self::$__ahasil;
|
||||
}
|
||||
|
||||
public static function Get_ArrayCBOX() {
|
||||
if (count(self::$__ahasil)==0) self::__data();
|
||||
$_ahasil = array();
|
||||
foreach (self::$__ahasil as $__key => $__val) {
|
||||
if (strpos($__key, "_cbox_")>0) {
|
||||
$_tmpkey = substr($__key, strpos($__key, "_cbox_")+6);
|
||||
$_ahasil[$_tmpkey] = $__val;
|
||||
}
|
||||
}
|
||||
return $_ahasil;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,451 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Print.php
|
||||
Desc. : Fungsi-fungsi pembuatan laporan
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : June 15th, 2008.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Print {
|
||||
private $__avalue = array();
|
||||
private $__astyle = array();
|
||||
private $__atabel = array();
|
||||
private $__css = "pnormal";
|
||||
|
||||
public function __construct() {//
|
||||
}
|
||||
|
||||
public function set_css($style = "") {//
|
||||
if ($style=="") return;
|
||||
$this->__css = $style;
|
||||
}
|
||||
|
||||
public function add_field($tnama="", $nlebar=0, $talign="L", $ffunc="", $nkol=1) {//up 2012-03-07
|
||||
$this->__atabel[] = array($tnama, $nlebar, $ffunc, $talign, $nkol);
|
||||
}
|
||||
|
||||
public function show_fields() {//
|
||||
$tmp_out = "<tr>";
|
||||
for ($i=0; $i<count($this->__atabel); $i++) {
|
||||
if ($this->__atabel[$i][4]==0) continue;
|
||||
$tmp_out .= $this->set_align($this->__atabel[$i][0], $this->__atabel[$i][1], "C", false, true, $this->__atabel[$i][4]);
|
||||
}
|
||||
$tmp_out .= "</tr>";
|
||||
$this->__avalue[] = $tmp_out;
|
||||
$this->__astyle[] = "L";
|
||||
}
|
||||
|
||||
public function clear() {//
|
||||
$this->__avalue = array();
|
||||
$this->__astyle = array();
|
||||
}
|
||||
|
||||
public function add_value() {//
|
||||
$tmp_arr = func_get_args();
|
||||
if (is_array($tmp_arr[0])) $tmp_arr = $tmp_arr[0]; //up 2009-09-27
|
||||
$tmp_out = "<tr>";
|
||||
for ($i=0; $i<count($this->__atabel); $i++) {
|
||||
$tmp_val = $tmp_arr[$i];
|
||||
if (is_array($this->__atabel[$i][2]) && trim($tmp_val)<>"") { //up 2010-05-28
|
||||
$tmp_val = $this->__atabel[$i][2][$tmp_val];
|
||||
} else if (function_exists($this->__atabel[$i][2]) && trim($tmp_val)<>"") {
|
||||
$tmp_val = call_user_func($this->__atabel[$i][2], $tmp_val);
|
||||
}
|
||||
$tmp_val = $this->set_align($tmp_val, $this->__atabel[$i][1], $this->__atabel[$i][3]);
|
||||
$tmp_out .= $tmp_val;
|
||||
}
|
||||
$tmp_out .= "</tr>";
|
||||
$this->__avalue[] = $tmp_out;
|
||||
$this->__astyle[] = "L";
|
||||
}
|
||||
|
||||
public function add_span() {
|
||||
$tmp_arr = func_get_args();
|
||||
$tmp_out = "<tr>";
|
||||
for ($i=0; $i<count($tmp_arr); $i++) {
|
||||
$tmp_val = $tmp_arr[$i];// CONTENT, COLSPAN=1, L, FUNC, EXTRA
|
||||
if (!isset($tmp_val[1])) $tmp_val[1] = 1;
|
||||
if (!isset($tmp_val[2])) $tmp_val[2] = "L";
|
||||
if (!isset($tmp_val[4])) $tmp_val[4] = "";
|
||||
if (isset($tmp_val[3])) {
|
||||
if (function_exists($tmp_val[3]) && trim($tmp_val[0])<>"") {
|
||||
$tmp_val[0] = call_user_func($tmp_val[3], $tmp_val[0]);
|
||||
}
|
||||
}
|
||||
$tmp_val = $this->set_align($tmp_val[0], 0, $tmp_val[2], false, false, $tmp_val[1], $tmp_val[4]);
|
||||
$tmp_out .= $tmp_val;
|
||||
}
|
||||
$tmp_out .= "</tr>";
|
||||
$this->__avalue[] = $tmp_out;
|
||||
$this->__astyle[] = "L";
|
||||
}
|
||||
|
||||
public function add($ttext = "", $tstyle = "L") {//todo:delete
|
||||
$this->__avalue[] = $ttext;
|
||||
$this->__astyle[] = $tstyle;
|
||||
}
|
||||
|
||||
public function addl($ttext = "") {//todo:delete
|
||||
$this->add($ttext);
|
||||
}
|
||||
|
||||
public function addr($ttext = "") {//todo:delete
|
||||
$this->add($ttext, "R");
|
||||
}
|
||||
|
||||
public function addc($ttext = "") {//todo:delete
|
||||
$this->add($ttext, "C");
|
||||
}
|
||||
|
||||
public function add_line() {//todo:delete
|
||||
$this->add("__LINE ");
|
||||
}
|
||||
|
||||
public function add_empty($nrep = 1) {//todo:delete
|
||||
for ($i=0;$i<$nrep;$i++) $this->add(" ");
|
||||
}
|
||||
|
||||
public function add_pagebreak() {//up 2012-10-11
|
||||
$this->add("</tbody></table><p id=\"linebreak\">................ page break ................</p>", "PB");
|
||||
$this->add("<p id=\"pagebreak\"> </p><table class=\"".$this->__css."\" border=\"0\" width=\"100%\" cellspading=\"0\" cellspacing=\"0\"><tbody>", "PB");
|
||||
}
|
||||
|
||||
public function show_pagebreak() {//del
|
||||
echo "<p id=\"linebreak\">................ page break ................</p><p id=\"pagebreak\"> </p>";
|
||||
}
|
||||
|
||||
public function add_stamp($ctk_ke=1, $bnama=false) {//up 2011-03-25
|
||||
$this->add($_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):""), "NB");
|
||||
}
|
||||
|
||||
public function get_stamp($ctk_ke=1, $bnama=false) {//up 2012-10-11
|
||||
return $_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):"");
|
||||
}
|
||||
|
||||
public function show($jumlah_ctk=1) {//up 2012-10-11
|
||||
$out = "<p id=\"autopage\"> </p>";
|
||||
$out .= "<table class=\"".$this->__css."\" width=\"100%\"><tbody>";
|
||||
|
||||
// content out
|
||||
for ($i=0; $i<count($this->__avalue); $i++) {
|
||||
$tmp_str = $this->__avalue[$i];
|
||||
if ($this->__astyle[$i]=="PB") {
|
||||
$out .= $tmp_str;
|
||||
continue;
|
||||
}
|
||||
if (strpos($tmp_str, "_LINE")>0) $tmp_str = "<hr />";
|
||||
$out .= $this->set_align($tmp_str, 0, $this->__astyle[$i], true);
|
||||
}
|
||||
$out .= "</tbody></table>";
|
||||
|
||||
for ($i=1; $i<=$jumlah_ctk; $i++) echo $out;
|
||||
}
|
||||
|
||||
public function set_align($ttext, $nlen, $tdir="L", $bline=false, $bhead=false, $ncol=1, $textra="") {//up 2011-04-14
|
||||
$tstyle = $this->create_style($tdir);
|
||||
if (strpos(strtolower($ttext), "<tr>")===false) { //jika tidak ada <tr> up 2011-04-14
|
||||
if ($bline===true) {
|
||||
return "<tr><td colspan=\"".count($this->__atabel)."\" class=\"".$tstyle." ".$textra."\">".$ttext."</td></tr>";
|
||||
} else {
|
||||
return (($bhead===true)?"<th":"<td").(($ncol>1)?" colspan=\"".$ncol."\"":"")." class=\"".$tstyle." ".$textra."\" ".(($bhead===true)?"width=\"".$nlen."\"":"").">".$ttext.(($bhead===true)?"</th>":"</td>");
|
||||
}
|
||||
} else {
|
||||
return (($bline===true) ? $ttext : (($bhead===true)?"<th":"<td").(($ncol>1)?" colspan=\"".$ncol."\"":"")." class=\"".$tstyle." ".$textra."\" ".(($bhead===true)?"width=\"".$nlen."\"":"").">".$ttext.(($bhead===true)?"</th>":"</td>"));
|
||||
}
|
||||
}
|
||||
|
||||
private function create_style($tstyle="L") { //up 2014-10-12
|
||||
// style = Left Right Center No-Border No-Left No-Right Bold Italic
|
||||
$apad = array("L"=>"left", "R"=>"right", "C"=>"center", "NB"=>"nb", "NL"=>"noleft", "NR"=>"noright", "B"=>"bold", "I"=>"italic");
|
||||
$_astyle = explode(",", $tstyle);
|
||||
$thasil = "";
|
||||
foreach ($_astyle as $_key => $_val) {
|
||||
$thasil .= " ".$apad[$_val];
|
||||
}
|
||||
return substr($thasil,1);
|
||||
}
|
||||
}
|
||||
|
||||
class RawPrint {
|
||||
private $_header = array();
|
||||
private $_avalue = array();
|
||||
private $_atabel = array();
|
||||
private $_ncont = 0;
|
||||
private $_maxchr = 40;
|
||||
private $_spacekol = " ";
|
||||
private $_config = array(
|
||||
'fontsize' => "01",
|
||||
'nvlogo' => false,
|
||||
'opendraw' => false,
|
||||
'opendrawbegin' => false,
|
||||
'cutpaper' => false );
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function set_opendrawer($bbegin = true) {
|
||||
$this->_config['opendraw'] = true;
|
||||
$this->_config['opendrawbegin'] = $bbegin;
|
||||
}
|
||||
|
||||
public function set_cutpaper() {
|
||||
$this->_config['cutpaper'] = true;
|
||||
}
|
||||
|
||||
public function set_maxchr($nmax = 0) {//up: 2015-03-22
|
||||
if ($nmax > 0) $this->_maxchr = $nmax;
|
||||
}
|
||||
|
||||
public function set_fontsize($nsize = 1) {//up: 2015-09-30
|
||||
if ($nsize > 0) $this->_config['fontsize'] = str_pad($nsize, 2, "0", STR_PAD_LEFT);
|
||||
|
||||
}
|
||||
|
||||
public function set_printnv_logo() {//up: 2015-03-23
|
||||
$this->_config['nvlogo'] = true;
|
||||
}
|
||||
|
||||
public function add_header($nvlogo = false, $extra = array()) {//up: 2016-11-12
|
||||
$this->_config['nvlogo'] = $nvlogo;
|
||||
$this->_header[] = $_SESSION['__WEB_APP']['REG_NAME'];
|
||||
if (count($extra) > 0) {
|
||||
foreach ($extra as $_val) {
|
||||
$this->_header[] = $_val;
|
||||
}
|
||||
}
|
||||
$this->_header[] = $_SESSION['__WEB_APP']['REG_CITY'];
|
||||
}
|
||||
|
||||
public function add_sheet() {//up: 20170321
|
||||
$this->_ncont++;
|
||||
}
|
||||
|
||||
public function add_field($tnama="", $nlebar=0, $talign="L", $ffunc="") {
|
||||
$this->_atabel[] = array($tnama, $nlebar, $ffunc, $talign);
|
||||
}
|
||||
|
||||
public function show_fields() {
|
||||
$tmp_out = "<b>";
|
||||
for ($i=0; $i<count($this->_atabel); $i++) {
|
||||
$tmp_out .= $this->set_align($this->_atabel[$i][0], $this->_atabel[$i][1], "C");
|
||||
if ($i < (count($this->_atabel)-1)) $tmp_out .= $this->_spacekol;
|
||||
}
|
||||
$tmp_out .= "</b>";
|
||||
$this->_avalue[$this->_ncont][] = "__LINE -";
|
||||
$this->_avalue[$this->_ncont][] = $tmp_out;
|
||||
$this->_avalue[$this->_ncont][] = "__LINE -";
|
||||
}
|
||||
|
||||
public function add_value() {
|
||||
$tmp_arr = func_get_args();
|
||||
if (is_array($tmp_arr[0])) $tmp_arr = $tmp_arr[0]; //up 2009-09-27
|
||||
$tmp_out = "";
|
||||
for ($i=0; $i<count($this->_atabel); $i++) {
|
||||
$tmp_val = $tmp_arr[$i];
|
||||
if (is_array($this->_atabel[$i][2]) && trim($tmp_val)<>"") { //up 2010-05-28
|
||||
$tmp_val = $this->_atabel[$i][2][$tmp_val];
|
||||
} else if (function_exists($this->_atabel[$i][2]) && trim($tmp_val)<>"") {
|
||||
$tmp_val = call_user_func($this->_atabel[$i][2], $tmp_val);
|
||||
}
|
||||
$tmp_val = $this->set_align($tmp_val, $this->_atabel[$i][1], $this->_atabel[$i][3]);
|
||||
if ($i < (count($this->_atabel)-1)) $tmp_val .= $this->_spacekol;
|
||||
$tmp_out .= $tmp_val;
|
||||
}
|
||||
$this->_avalue[$this->_ncont][] = $tmp_out;
|
||||
}
|
||||
|
||||
public function add($ttext = "") {
|
||||
$this->_avalue[$this->_ncont][] = $ttext;
|
||||
}
|
||||
|
||||
public function add_line($tmp = "-") {
|
||||
$this->add("__LINE ".$tmp);
|
||||
}
|
||||
|
||||
public function add_empty($nrep = 1) {
|
||||
for ($i=0;$i<$nrep;$i++) $this->add("");
|
||||
}
|
||||
|
||||
public function add_stamp($ctk_ke=1, $bnama=false) {
|
||||
$this->add($_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):""));
|
||||
}
|
||||
|
||||
private function _json_out() {//up: 2016-11-12
|
||||
$acontent = array();
|
||||
$nmax = $this->_maxchr;
|
||||
|
||||
for ($s=0; $s<count($this->_avalue); $s++) {
|
||||
for ($i=0; $i<count($this->_avalue[$s]); $i++) {
|
||||
$tmp_str = $this->_avalue[$s][$i];
|
||||
if (strpos($tmp_str, "_LINE")>0) {
|
||||
$tmp_arr = explode(" ", $tmp_str);
|
||||
$tmp_str = str_pad($tmp_arr[1], $nmax, $tmp_arr[1]);
|
||||
}
|
||||
$acontent[$s][] = $tmp_str;
|
||||
}
|
||||
}
|
||||
|
||||
$aout = array('type' => "escp");
|
||||
$aout['config'] = $this->_config;
|
||||
$aout['header'] = $this->_header;
|
||||
$aout['content'] = $acontent;
|
||||
send_json($aout);
|
||||
}
|
||||
|
||||
public function show($jumlah_ctk=1) {
|
||||
$this->_config['times'] = $jumlah_ctk;
|
||||
$this->_json_out();
|
||||
}
|
||||
|
||||
public function set_align($ttext, $nlen, $tdir="L") {
|
||||
$apad = array("L"=>STR_PAD_RIGHT, "R"=>STR_PAD_LEFT, "C"=>STR_PAD_BOTH);
|
||||
$ttext = (strlen($ttext)>$nlen) ? substr($ttext, 0, $nlen) : $ttext;
|
||||
return str_pad($ttext, $nlen, " ", $apad[$tdir]);
|
||||
}
|
||||
}
|
||||
|
||||
/* VERSI BARU DENGAN MULTI SHEET */
|
||||
class POSPrint {//up: 20180108
|
||||
private $_header = array();
|
||||
private $_avalue = array();
|
||||
private $_astyle = array();
|
||||
private $_ncont = 0;
|
||||
private $_maxchr = 40;
|
||||
private $_config = array(
|
||||
'fontsize' => 1,
|
||||
'nvlogo' => false,
|
||||
'opendraw' => false,
|
||||
'opendrawbegin' => true,
|
||||
'cutpaper' => false,
|
||||
'logo' => null );
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function set_opendrawer($bbegin = true) {
|
||||
$this->_config['opendraw'] = true;
|
||||
$this->_config['opendrawbegin'] = $bbegin;
|
||||
}
|
||||
|
||||
public function set_cutpaper() {
|
||||
$this->_config['cutpaper'] = true;
|
||||
}
|
||||
|
||||
public function set_maxchr($nmax = 0) {//up: 2015-03-22
|
||||
if ($nmax > 0) $this->_maxchr = $nmax;
|
||||
}
|
||||
|
||||
public function set_fontsize($nsize = 1) {//up: 2015-09-30
|
||||
if ($nsize > 0) $this->_config['fontsize'] = $nsize;
|
||||
}
|
||||
|
||||
public function set_printnv_logo() {//up: 2015-03-23
|
||||
$this->_config['nvlogo'] = true;
|
||||
}
|
||||
|
||||
public function set_header_logo($logo_file = "") {//up: 2019-01-08
|
||||
if ($logo_file=="") return;
|
||||
if (file_exists($_SESSION['__WEB_APP']['REAL_PATH']."assets/images/".$logo_file)) {
|
||||
$this->_config['logo'] = $_SESSION['__WEB_APP']['WEB_PATH']."assets/images/".$logo_file;
|
||||
}
|
||||
}
|
||||
|
||||
public function add_header($nvlogo = false, $extra = array()) {//up: 2018-12-25
|
||||
$this->_config['nvlogo'] = $nvlogo;
|
||||
if ($nvlogo==false && $this->_config['logo']==null) $this->_header[] = $_SESSION['__WEB_APP']['REG_NAME'];
|
||||
if (count($extra) > 0) {
|
||||
foreach ($extra as $_val) {
|
||||
$this->_header[] = $_val;
|
||||
}
|
||||
}
|
||||
$this->_header[] = $_SESSION['__WEB_APP']['REG_CITY'];
|
||||
}
|
||||
|
||||
public function add_sheet() {//up: 20170321
|
||||
$this->_ncont++;
|
||||
}
|
||||
|
||||
public function add() {//up: 20180524
|
||||
$val_arr = func_get_args(); $ttext = ""; $tstyle = "L";
|
||||
if (is_array($val_arr[0])) {
|
||||
foreach($val_arr as $aval) {
|
||||
$ttext .= $this->set_align((isset($aval[0])?$aval[0]:""), (isset($aval[1])?$aval[1]:0), (isset($aval[2])?$aval[2]:$tstyle));
|
||||
}
|
||||
} else {
|
||||
$ttext = (isset($val_arr[0])) ? $val_arr[0] : "";
|
||||
$tstyle = (isset($val_arr[1])) ? $val_arr[1] : $tstyle;
|
||||
}
|
||||
$this->_avalue[$this->_ncont][] = $ttext;
|
||||
$this->_astyle[$this->_ncont][] = $tstyle;
|
||||
}
|
||||
|
||||
public function addl($ttext = "") {
|
||||
$this->add($ttext);
|
||||
}
|
||||
|
||||
public function addr($ttext = "") {
|
||||
$this->add($ttext, "R");
|
||||
}
|
||||
|
||||
public function addc($ttext = "") {
|
||||
$this->add($ttext, "C");
|
||||
}
|
||||
|
||||
public function add_line($tmp = "-") {
|
||||
$this->add("__LINE ".$tmp);
|
||||
}
|
||||
|
||||
public function add_empty($nrep = 1) {
|
||||
for ($i=0;$i<$nrep;$i++) $this->add("");
|
||||
}
|
||||
|
||||
public function add_stamp($ctk_ke=1, $bnama=false) {
|
||||
$this->add($_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):""));
|
||||
}
|
||||
|
||||
private function _json_out() {//up: 2016-11-12
|
||||
$acontent = array();
|
||||
$nmax = $this->_maxchr;
|
||||
|
||||
for ($s=0; $s<count($this->_avalue); $s++) {
|
||||
for ($i=0; $i<count($this->_avalue[$s]); $i++) {
|
||||
$tmp_str = $this->_avalue[$s][$i];
|
||||
if (strpos($tmp_str, "_LINE")>0) {
|
||||
$tmp_arr = explode(" ", $tmp_str);
|
||||
$tmp_str = str_pad($tmp_arr[1], $nmax, $tmp_arr[1]);
|
||||
}
|
||||
$acontent[$s][] = ($this->_astyle[$s][$i]=="X") ? $tmp_str : $this->set_align($tmp_str, $nmax, $this->_astyle[$s][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
$aout = array('type' => "escp");
|
||||
$aout['config'] = $this->_config;
|
||||
$aout['header'] = $this->_header;
|
||||
$aout['content'] = $acontent;
|
||||
send_json($aout);
|
||||
}
|
||||
|
||||
public function show($jumlah_ctk=1) {
|
||||
$this->_config['times'] = $jumlah_ctk;
|
||||
$this->_json_out();
|
||||
}
|
||||
|
||||
public function set_align($ttext, $nlen=0, $tdir="L") {//up: 20180524
|
||||
$apad = array("L"=>STR_PAD_RIGHT, "R"=>STR_PAD_LEFT, "C"=>STR_PAD_BOTH);
|
||||
$nlen = ($nlen==0) ? strlen($ttext) : $nlen;
|
||||
$ttext = (strlen($ttext)>$nlen) ? substr($ttext, 0, $nlen) : $ttext;
|
||||
return str_pad($ttext, $nlen, " ", $apad[$tdir]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Register.php
|
||||
Desc. : v3 - Class Registrasi Aplikasi
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : November 23th, 2011.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2011 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Register {
|
||||
protected $__db = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
}
|
||||
|
||||
static public function reg_id() {
|
||||
$id = $_SESSION['__WEB_APP']['REG_ID'];
|
||||
return (substr($id,0,3).".".substr($id,3,3).".".substr($id,6));
|
||||
}
|
||||
|
||||
static public function reg_code() {
|
||||
$id = $_SESSION['__WEB_APP']['REG_CODE'];
|
||||
return (substr($id,0,6)."-".substr($id,6,5)."-".substr($id,11,5)."-".substr($id,16,5)."-".substr($id,21,5)."-".substr($id,26,6));
|
||||
}
|
||||
|
||||
public function reg_check() {
|
||||
$isreg = false;
|
||||
$this->__db->Query("SELECT UPPER(CONVERT(MD5(CONCAT(REG_YEAR,CONVERT(MD5(CONCAT(REG_ID,REG_NAME)) using latin1),REG_ID,REG_NAME)) using latin1)) KODE_REGISTER FROM app_config WHERE REG_ID='".$_SESSION['__WEB_APP']['APP_CODE']."' LIMIT 1");
|
||||
if ($this->__db->Next()) {
|
||||
if ($this->__db->Row("KODE_REGISTER","")==$_SESSION['__WEB_APP']['REG_CODE']) $isreg = true;
|
||||
}
|
||||
return $isreg;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,293 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Table.php
|
||||
Desc. : v3 - HTML Table v3 (jQuery & CoreUI)
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : January 16th, 2008.
|
||||
Last Modified : May 8th, 2021.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Table {
|
||||
private $__tquery = "";
|
||||
private $__tquery_footer = "";
|
||||
private $__aheader = array();
|
||||
private $__afield = array();
|
||||
private $__astyle = array();
|
||||
private $__aformat = array();
|
||||
private $__afooter = array();
|
||||
private $__arowcol = array();
|
||||
private $__arow_func = array();
|
||||
private $__tfunc_select = "";
|
||||
private $__tfunc_navi = "";
|
||||
private $__btxtbutton = false;
|
||||
private $__bnobutton = false;
|
||||
private $__bscrollbar = false;
|
||||
private $__acontrol = array('field'=>false, 'value'=>"");
|
||||
private $__acbox = array();
|
||||
private $__aoption = array();
|
||||
private $__npage_rec = 10; //baris per halaman
|
||||
private $__nreclimit = 0;
|
||||
private $__nscrollheight = 0;
|
||||
private $__ord_field = "";
|
||||
private $__ord_dir = "A";
|
||||
private $__tcss = "";
|
||||
protected $__cdb = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__cdb = $db; }
|
||||
else $this->__cdb = new \siaupheng\fonia3\DB\MySQL();
|
||||
}
|
||||
|
||||
public function set_query($tquery = "") {
|
||||
$this->__tquery = $tquery;
|
||||
}
|
||||
|
||||
public function set_query_footer($tquery = "") {
|
||||
$this->__tquery_footer = $tquery;
|
||||
}
|
||||
|
||||
public function set_css($tcss = "") {
|
||||
$this->__tcss = $tcss;
|
||||
}
|
||||
|
||||
public function set_limit($nlimit = 0) {
|
||||
$this->__nreclimit = $nlimit;
|
||||
}
|
||||
|
||||
public function set_field_order($tfield = "", $torder = "A") {
|
||||
$this->__ord_field = $tfield;
|
||||
$this->__ord_dir = $torder;
|
||||
}
|
||||
|
||||
public function set_textbtn($bistxt = true) {
|
||||
$this->__btxtbutton = $bistxt;
|
||||
}
|
||||
|
||||
public function set_scrollbar($bisscroll = true, $nheight = 200) {
|
||||
$this->__bscrollbar = $bisscroll;
|
||||
$this->__nscrollheight = $nheight;
|
||||
}
|
||||
|
||||
public function set_row_color($tfield = "", $tval = "", $tcss = "") {
|
||||
if ($tfield=="") return;
|
||||
$this->__arowcol[] = array('F'=>$tfield, 'V'=>$tval, 'C'=>$tcss);
|
||||
}
|
||||
|
||||
public function set_func_navi($tfunc = "") {
|
||||
$this->__tfunc_navi = $tfunc;
|
||||
}
|
||||
|
||||
public function set_func_select($tfunc = "") {
|
||||
$this->__tfunc_select = $tfunc;
|
||||
}
|
||||
|
||||
public function set_func_btn($tfunc = "", $tlabel = "") {
|
||||
$this->__arow_func[] = array('label' => $tlabel, 'func' => $tfunc);
|
||||
}
|
||||
|
||||
public function set_row_control($tfield = "", $tvalue = "Y") {
|
||||
$this->__acontrol['field'] = $tfield;
|
||||
$this->__acontrol['value'] = $tvalue;
|
||||
}
|
||||
|
||||
public function add_row_btn($ticon = "", $tlabel = "", $tfunc = "", $tfield = "", $tvalue = "") {
|
||||
$this->__aoption[] = array('type' => "button", 'func' => $tfunc, 'icon' => $ticon, 'label' => $tlabel, 'field' => $tfield, 'value' => $tvalue);
|
||||
}
|
||||
|
||||
public function add_row_del($tlabel = "", $tfunc = "", $tfield = "Unix", $tvalue = "") {
|
||||
$this->__aoption[] = array('type' => "button", 'func' => $tfunc, 'icon' => "x", 'label' => $tlabel, 'field' => $tfield, 'value' => $tvalue);
|
||||
}
|
||||
|
||||
public function add_row_edit($tlabel = "", $tfunc = "") {
|
||||
$this->add_row_btn("note", $tlabel, $tfunc);
|
||||
}
|
||||
|
||||
public function add_row_checkbox($tfield = "ID", $tcontrol = "Edit", $avalue = array("Y","N")) {
|
||||
$this->__acbox['field'] = $tfield;
|
||||
$this->__acbox['control'] = $tcontrol;
|
||||
$this->__acbox['avalue'] = $avalue;
|
||||
$this->__aoption[] = array('type' => "checkbox", 'field' => $tfield, 'avalue' => $avalue);
|
||||
}
|
||||
|
||||
public function no_button() {
|
||||
$this->__bnobutton = true;
|
||||
}
|
||||
|
||||
public function add_field($tfield = "", $theader = "", $tstyle = "left", $tformat = "", $tfooter = "") {
|
||||
$this->__aheader[] = $theader;
|
||||
$this->__afield[] = $tfield;
|
||||
$this->__astyle[] = $tstyle;
|
||||
$this->__aformat[] = $tformat;
|
||||
$this->__afooter[] = $tfooter;
|
||||
}
|
||||
|
||||
public function json_table($nama_tabel = "tabel_", $baris_tabel = 10) {
|
||||
$adata = array();
|
||||
$dbpage = intval(\siaupheng\fonia3\Web\Param::Get($nama_tabel.'_pg', 0));
|
||||
|
||||
// adding header
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$adata['header'][] = array('f'=>$this->__astyle[$i], 'o'=>$this->__afield[$i], 'c'=>$this->__aheader[$i]);//add width later
|
||||
$njml_kol += ($this->__astyle[$i]=="hidden") ? 0 : 1;
|
||||
}
|
||||
|
||||
// adding footer
|
||||
if ($this->__tquery_footer) {
|
||||
$this->__cdb->Query($this->__tquery_footer);
|
||||
$this->__cdb->Next();
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$tval = $this->__cdb->Row($this->__afield[$i], 0);
|
||||
if (is_array($this->__afooter[$i])) {
|
||||
$tval2 = $this->__afooter[$i][$tval];
|
||||
} else if (function_exists($this->__afooter[$i])) {
|
||||
$tval2 = call_user_func($this->__afooter[$i], $tval);
|
||||
} else {
|
||||
$tval2 = ($this->__afooter[$i]<>"") ? $this->__afooter[$i] : $tval;
|
||||
}
|
||||
$adata['footer'][] = array('c'=>$tval2);
|
||||
}
|
||||
}
|
||||
|
||||
$acontent = array();
|
||||
$this->__cdb->Query($this->__tquery);
|
||||
while ($this->__cdb->Next()) {
|
||||
$abaris = array();
|
||||
$aoption = array('button'=>array());
|
||||
if (count($this->__aoption)>0) {
|
||||
if ((($this->__acontrol['field']===false) || ($this->__cdb->Row($this->__acontrol['field'])==$this->__acontrol['value'])) && $this->__bnobutton===false) {
|
||||
// adding all option
|
||||
for ($i=0; $i<count($this->__aoption); $i++) {
|
||||
if ($this->__aoption[$i]['type']=="button") {
|
||||
if (($this->__aoption[$i]['field']!="") && ($this->__cdb->Row($this->__aoption[$i]['field'])<>(trim("".$this->__aoption[$i]['value'])!="" ? $this->__aoption[$i]['value'] : $_SESSION['__WEB_USER']['UNIX']))) {} else {
|
||||
$aoption['button'][] = $this->__aoption[$i]['icon'];
|
||||
}
|
||||
}
|
||||
}
|
||||
// adding checkbox option
|
||||
if (array_key_exists("field", $this->__acbox)) {
|
||||
$aoption['checkbox']['field'] = $this->__cdb->Row($this->__acbox['field']);
|
||||
$aoption['checkbox']['value'] = $this->__cdb->Row($this->__acbox['control']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($this->__arowcol)>0) {//up: 2014-06-13
|
||||
for ($i=0; $i<count($this->__arowcol); $i++) {
|
||||
if ($this->__cdb->Row($this->__arowcol[$i]['F']) == $this->__arowcol[$i]['V']) $aoption['rowcss'] = $this->__arowcol[$i]['C'];
|
||||
}
|
||||
}
|
||||
$abaris[] = $aoption;
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$tval = stripslashes($this->__cdb->Row($this->__afield[$i]));//up: 2015-01-05
|
||||
if (is_array($this->__aformat[$i])) {
|
||||
$tval = $this->__aformat[$i][$tval];
|
||||
} else if (function_exists($this->__aformat[$i])) {
|
||||
$tval = call_user_func($this->__aformat[$i], $tval);
|
||||
}
|
||||
$abaris[] = $tval;
|
||||
}
|
||||
$acontent[] = $abaris;
|
||||
}
|
||||
|
||||
// navigator
|
||||
$anavi = array('func_navi' => $this->__tfunc_navi, 'button' => $this->__arow_func );
|
||||
|
||||
$adata['type'] = "table";
|
||||
$adata['id'] = $nama_tabel;
|
||||
$adata['config'] = array('css' => $this->__tcss, 'page' => $dbpage, 'row_count' => $baris_tabel, 'func_select' => $this->__tfunc_select, 'nobutton' => $this->__bnobutton, 'txtbutton' => $this->__btxtbutton, 'scrollbar' => $this->__bscrollbar, 'scroll_height' => $this->__nscrollheight, 'sort_col' => $this->__ord_field, 'sort_dir' => $this->__ord_dir);
|
||||
$adata['option'] = $this->__aoption;
|
||||
$adata['navi'] = $anavi;
|
||||
$adata['content'] = $acontent;
|
||||
return $adata;
|
||||
}
|
||||
|
||||
public function json_table_db($nama_tabel = "tabel_", $baris_tabel = 10) {//new
|
||||
$adata = array();
|
||||
$dbpage = \siaupheng\fonia3\Web\Param::Get($nama_tabel.'_pg', 0);
|
||||
|
||||
// adding header
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$adata['header'][] = array('f'=>$this->__astyle[$i], 'o'=>$this->__afield[$i], 'c'=>$this->__aheader[$i]);//add width later
|
||||
$njml_kol += ($this->__astyle[$i]=="hidden") ? 0 : 1;
|
||||
}
|
||||
|
||||
// adding footer
|
||||
if ($this->__tquery_footer) {
|
||||
$this->__cdb->Query($this->__tquery_footer);
|
||||
$this->__cdb->Next();
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$tval = $this->__cdb->Row($this->__afield[$i], 0);
|
||||
if (is_array($this->__afooter[$i])) {
|
||||
$tval2 = $this->__afooter[$i][$tval];
|
||||
} else if (function_exists($this->__afooter[$i])) {
|
||||
$tval2 = call_user_func($this->__afooter[$i], $tval);
|
||||
} else {
|
||||
$tval2 = ($this->__afooter[$i]<>"") ? $this->__afooter[$i] : $tval;
|
||||
}
|
||||
$adata['footer'][] = array('c'=>$tval2);
|
||||
}
|
||||
}
|
||||
|
||||
$acontent = array();
|
||||
$this->__cdb->Query($this->__tquery);
|
||||
while ($this->__cdb->Next()) {
|
||||
$abaris = array();
|
||||
$aoption = array('button'=>array());
|
||||
if (count($this->__aoption)>0) {
|
||||
if ((($this->__acontrol['field']===false) || ($this->__cdb->Row($this->__acontrol['field'])==$this->__acontrol['value'])) && $this->__bnobutton===false) {
|
||||
// adding all option
|
||||
for ($i=0; $i<count($this->__aoption); $i++) {
|
||||
if ($this->__aoption[$i]['type']=="button") {
|
||||
if (($this->__aoption[$i]['field']!="") && ($this->__cdb->Row($this->__aoption[$i]['field'])<>(trim($this->__aoption[$i]['value'])!="" ? $this->__aoption[$i]['value'] : $_SESSION['__WEB_USER']['UNIX']))) {} else {
|
||||
$aoption['button'][] = $this->__aoption[$i]['icon'];
|
||||
}
|
||||
}
|
||||
}
|
||||
// adding checkbox option
|
||||
if (array_key_exists("field", $this->__acbox)) {
|
||||
$aoption['checkbox']['field'] = $this->__cdb->Row($this->__acbox['field']);
|
||||
$aoption['checkbox']['value'] = $this->__cdb->Row($this->__acbox['control']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($this->__arowcol)>0) {//up: 2014-06-13
|
||||
for ($i=0; $i<count($this->__arowcol); $i++) {
|
||||
if ($this->__cdb->Row($this->__arowcol[$i]['F']) == $this->__arowcol[$i]['V']) $aoption['rowcss'] = $this->__arowcol[$i]['C'];
|
||||
}
|
||||
}
|
||||
$abaris[] = $aoption;
|
||||
for ($i=0; $i<count($this->__afield); $i++) {
|
||||
$tval = stripslashes($this->__cdb->Row($this->__afield[$i]));//up: 2015-01-05
|
||||
if (is_array($this->__aformat[$i])) {
|
||||
$tval = $this->__aformat[$i][$tval];
|
||||
} else if (function_exists($this->__aformat[$i])) {
|
||||
$tval = call_user_func($this->__aformat[$i], $tval);
|
||||
}
|
||||
$abaris[] = $tval;
|
||||
}
|
||||
$acontent[] = $abaris;
|
||||
}
|
||||
|
||||
// navigator
|
||||
$anavi = array('func_navi' => $this->__tfunc_navi, 'button' => $this->__arow_func );
|
||||
|
||||
$adata['type'] = "table";
|
||||
$adata['id'] = $nama_tabel;
|
||||
$adata['config'] = array('page'=>$dbpage, 'row_count' => $baris_tabel, 'func_select' => $this->__tfunc_select, 'nobutton' => $this->__bnobutton, 'txtbutton' => $this->__btxtbutton, 'scrollbar' => $this->__bscrollbar, 'scroll_height' => $this->__nscrollheight, 'sort_col' => $this->__ord_field, 'sort_dir' => $this->__ord_dir);
|
||||
$adata['option'] = $this->__aoption;
|
||||
$adata['navi'] = $anavi;
|
||||
$adata['content'] = $acontent;
|
||||
return $adata;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Terbilang.php
|
||||
Desc. : Class Format Angka & Terbilang
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : February 12th, 2009.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2009 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Terbilang {
|
||||
private $numb = array("","Satu","Dua","Tiga","Empat","Lima","Enam","Tujuh","Delapan","Sembilan");
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
public function Terbilang($nilai=0, $muang="Rupiah") {
|
||||
$number = 0;
|
||||
$hasil = "";
|
||||
$int = trim($nilai);
|
||||
if (is_int(strpos($int,"-"))) {
|
||||
$number = substr($int,strpos($int,"-")+1,strlen($int));
|
||||
$hasil = "Minus";
|
||||
} else {
|
||||
$number = $int;
|
||||
}
|
||||
|
||||
# strpost : untuk mencari "." pada variabel number
|
||||
$xpos = strpos($number,".");
|
||||
if (is_int($xpos)) {
|
||||
# round : Untuk pembulatan angka desimal, strlen : untuk menghitung jumlah karakter
|
||||
$pecahan = round(substr($number,$xpos,strlen($number)),2);
|
||||
$last = substr($number,0,$xpos);
|
||||
} else {
|
||||
$pecahan = "";
|
||||
$last = $number;
|
||||
}
|
||||
if ($last==0 || $number==0) {
|
||||
return $hasil."NOL ".$muang;
|
||||
} else {
|
||||
# floor : Pembulatan angka terbaik dari desimal, pow : Ekspresi Eksponensial
|
||||
$triliun = floor($last/pow(10,12));
|
||||
$last = $this->mod($last,1000000000000);
|
||||
|
||||
$miliar = floor($last/pow(10,9));
|
||||
$last = $this->mod($last,1000000000);
|
||||
|
||||
$juta = floor($last/pow(10,6));
|
||||
$last = $this->mod($last,1000000);
|
||||
|
||||
$ribu = floor($last/pow(10,3));
|
||||
$last = $this->mod($last,1000);
|
||||
|
||||
$kata = $this->tigadigit($triliun, "Triliun");
|
||||
$kata .= $this->tigadigit($miliar, "Miliar");
|
||||
$kata .= $this->tigadigit($juta, "Juta");
|
||||
$kata .= $this->tigadigit($ribu, "Ribu");
|
||||
$kata .= $this->tigadigit($last, "");
|
||||
$kata .= " ".$muang;
|
||||
}
|
||||
if ($pecahan>0) {
|
||||
$kata .= " Dan". $this->tigadigit(round($pecahan*100),"Sen");
|
||||
}
|
||||
return $hasil . $kata;
|
||||
}
|
||||
|
||||
private function mod($a, $b) {
|
||||
return $a-$b*floor($a/$b);
|
||||
}
|
||||
|
||||
private function tigadigit($amount, $suffix="") {
|
||||
$last = (int) $amount;
|
||||
$kata = "";
|
||||
if ($last == 1 && $suffix=="Ribu") {
|
||||
$kata = " Seribu";
|
||||
return $kata;
|
||||
}
|
||||
if ($last < 20 && $last > 10) {
|
||||
if ($last==11) {
|
||||
$kata = " Sebelas";
|
||||
} else {
|
||||
$kata = " ".$this->numb[$last-10]." Belas";
|
||||
}
|
||||
if ($suffix != "") {
|
||||
$kata .= " ". $suffix;
|
||||
}
|
||||
return $kata;
|
||||
}
|
||||
$ratus = floor($last/100);
|
||||
if ($ratus <= 0) {
|
||||
$kata .= "";
|
||||
} elseif ($ratus == 1) {
|
||||
$kata .= " Seratus";
|
||||
} else {
|
||||
$kata .= " ".$this->numb[$ratus]." Ratus";
|
||||
}
|
||||
$last = $this->mod($last,100);
|
||||
if ($last < 20 && $last > 10) {
|
||||
if ($last == 11) {
|
||||
$kata .= " Sebelas ". $suffix;
|
||||
} else {
|
||||
$kata .= " ".$this->numb[$last-10]." Belas ". $suffix;
|
||||
}
|
||||
return $kata;
|
||||
}
|
||||
$puluh = floor($last/10);
|
||||
if ($puluh == 0) {
|
||||
$kata .= "";
|
||||
} elseif ($puluh == 1) {
|
||||
$kata .= " Sepuluh";
|
||||
} else {
|
||||
$kata .= " ".$this->numb[$puluh]." Puluh";
|
||||
}
|
||||
$last = $this->mod($last,10);
|
||||
if ($last>0 && $last<=9) {
|
||||
$kata .= " ".$this->numb[$last];
|
||||
}
|
||||
if ($amount>0 && $amount<=1000) {
|
||||
$kata .= " ".$suffix;
|
||||
}
|
||||
return $kata;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /Web/Update.php
|
||||
Desc. : Class Update Aplikasi Otomatis
|
||||
Created By : Siau Pheng (siaupheng@3fonia.com).
|
||||
Created Date : June 14th, 2013.
|
||||
Last Modified : May 6th, 2021.
|
||||
|
||||
(c) 2013 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3\Web;
|
||||
|
||||
final class Update {
|
||||
private $__amysql = array();
|
||||
protected $__linkdb = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__linkdb = $db; }
|
||||
else $this->__linkdb = new \siaupheng\fonia3\DB\MySQL();
|
||||
|
||||
$this->__amysql = $this->__linkdb->getConfig();
|
||||
}
|
||||
|
||||
public function check_update() {
|
||||
$_ainfo['build_cur'] = $_SESSION['__WEB_APP']['APP_BUILD'];
|
||||
$_ainfo['svr_status'] = "Server Online";
|
||||
$_read = array("","","");
|
||||
|
||||
$_url = "https://update.3fonia.com/".$_SESSION['__WEB_APP']['REG_ID']."/update.csv";
|
||||
$_fp = @fopen ($_url, 'r') or $_ainfo['svr_status'] = "Server Offline";
|
||||
if ($_fp) {
|
||||
$_read = fgetcsv ($_fp);
|
||||
fclose ($_fp);
|
||||
}
|
||||
|
||||
$_ainfo['build_new'] = $_read[0];
|
||||
$_ainfo['file_web'] = $_read[1];
|
||||
$_ainfo['file_sql'] = $_read[2];
|
||||
return $_ainfo;
|
||||
}
|
||||
|
||||
public function go_update($file_src="", $build_code="") {
|
||||
if ($file_src=="") return false;
|
||||
|
||||
$_folder = $_SESSION['__WEB_APP']['REAL_PATH']."temp";
|
||||
if (!is_dir($_folder)) mkdir($_folder);
|
||||
|
||||
$_dst = $_folder."/update.web.zip";
|
||||
if ($_dst) unlink($_dst);
|
||||
|
||||
$new_data = file_get_contents($file_src);
|
||||
if (!$new_data) return false;
|
||||
|
||||
$han_file = @fopen($_dst, 'w');
|
||||
if (!$han_file) return false;
|
||||
|
||||
if ( fwrite($han_file, $new_data) ) {
|
||||
fclose($han_file);
|
||||
$zip = new ZipArchive();
|
||||
if ($zip->open($_dst) === true) {
|
||||
$zip->extractTo($_SESSION['__WEB_APP']['REAL_PATH']);
|
||||
$zip->close();
|
||||
$_SESSION['__WEB_APP']['APP_BUILD'] = $build_code;
|
||||
$this->__linkdb->Query("UPDATE app_config SET APP_BUILD='".$build_code."' WHERE REG_ID='".$_SESSION['__WEB_APP']['APP_CODE']."' LIMIT 1");
|
||||
}
|
||||
}
|
||||
if (file_exists($_dst)) unlink($_dst);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update_mysql($file_sql="") {
|
||||
if ($file_sql=="") return false;
|
||||
|
||||
$_folder = $_SESSION['__WEB_APP']['REAL_PATH']."temp";
|
||||
if (!is_dir($_folder)) mkdir($_folder);
|
||||
|
||||
$_dst = $_folder."/update.sql.zip";
|
||||
if ($_dst) unlink($_dst);
|
||||
|
||||
$new_data = file_get_contents($file_sql);
|
||||
if (!$new_data) return false;
|
||||
|
||||
$han_file = @fopen($_dst, 'w');
|
||||
if (!$han_file) return false;
|
||||
|
||||
if ( fwrite($han_file, $new_data) ) {
|
||||
fclose($han_file);
|
||||
$zip = new ZipArchive();
|
||||
if ($zip->open($_dst) === true) {
|
||||
$zip->extractTo($_folder);
|
||||
$zip->close();
|
||||
}
|
||||
}
|
||||
if (file_exists($_dst)) unlink($_dst);
|
||||
if (!is_readable($_folder."/update.sql")) return false;
|
||||
|
||||
$_link = @new mysqli($this->__amysql['host'], $this->__amysql['user'], $this->__amysql['pwd'], $this->__amysql['db'], $this->__amysql['port'], $this->__amysql['sock']);
|
||||
if (!$_link->connect_error) return false;
|
||||
|
||||
$aSQL = file($_folder."/update.sql");
|
||||
foreach ($aSQL as $stmt) {
|
||||
if ($_link->query($stmt) === false) {
|
||||
$sqlECode = $_link->mysql_errno;
|
||||
$sqlEText = $_link->error;
|
||||
$sqlStmt = $stmt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (file_exists($_folder."/update.sql")) unlink($_folder."/update.sql");
|
||||
if ($sqlECode == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
/*echo "FAIL!<br/>";
|
||||
echo "Error code: $sqlErrorCode<br/>";
|
||||
echo "Error text: $sqlErrorText<br/>";
|
||||
echo "Statement:<br/> $sqlStmt<br/>";*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user