Commit 0e982994 authored by Indra Raja's avatar Indra Raja

initial commit

parents
Pipeline #180 canceled with stages

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# Contributor Code of Conduct
The Zend Framework project adheres to [The Code Manifesto](http://codemanifesto.com)
as its guidelines for contributor interactions.
## The Code Manifesto
We want to work in an ecosystem that empowers developers to reach their
potential — one that encourages growth and effective collaboration. A space that
is safe for all.
A space such as this benefits everyone that participates in it. It encourages
new developers to enter our field. It is through discussion and collaboration
that we grow, and through growth that we improve.
In the effort to create such a place, we hold to these values:
1. **Discrimination limits us.** This includes discrimination on the basis of
race, gender, sexual orientation, gender identity, age, nationality, technology
and any other arbitrary exclusion of a group of people.
2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort
levels. Remember that, and if brought to your attention, heed it.
3. **We are our biggest assets.** None of us were born masters of our trade.
Each of us has been helped along the way. Return that favor, when and where
you can.
4. **We are resources for the future.** As an extension of #3, share what you
know. Make yourself a resource to help those that come after you.
5. **Respect defines us.** Treat others as you wish to be treated. Make your
discussions, criticisms and debates from a position of respectfulness. Ask
yourself, is it true? Is it necessary? Is it constructive? Anything less is
unacceptable.
6. **Reactions require grace.** Angry responses are valid, but abusive language
and vindictive actions are toxic. When something happens that offends you,
handle it assertively, but be respectful. Escalate reasonably, and try to
allow the offender an opportunity to explain themselves, and possibly correct
the issue.
7. **Opinions are just that: opinions.** Each and every one of us, due to our
background and upbringing, have varying opinions. The fact of the matter, is
that is perfectly acceptable. Remember this: if you respect your own
opinions, you should respect the opinions of others.
8. **To err is human.** You might not intend it, but mistakes do happen and
contribute to build experience. Tolerate honest mistakes, and don't hesitate
to apologize if you make one yourself.
# CONTRIBUTING
## RESOURCES
If you wish to contribute to Zend Framework, please be sure to
read/subscribe to the following resources:
- [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards)
- [Contributor's Guide](http://framework.zend.com/participate/contributor-guide)
- ZF Contributor's mailing list:
Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html
Subscribe: zf-contributors-subscribe@lists.zend.com
- ZF Contributor's IRC channel:
#zftalk.dev on Freenode.net
If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/ZendSkeletonApplication/issues/new).
## Reporting Potential Security Issues
If you have encountered a potential security vulnerability, please **DO NOT** report it on the public
issue tracker: send it to us at [zf-security@zend.com](mailto:zf-security@zend.com) instead.
We will work with you to verify the vulnerability and patch it as soon as possible.
When reporting issues, please provide the following information:
- Component(s) affected
- A description indicating how to reproduce the issue
- A summary of the security vulnerability and impact
We request that you contact us via the email address above and give the project
contributors a chance to resolve the vulnerability and issue a new release prior
to any public exposure; this helps protect users and provides them with a chance
to upgrade and/or update in order to protect their applications.
For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc).
## RUNNING TESTS
First, use [Composer](https://getcomposer.org) to install all dependencies:
```bash
$ composer install
```
Make sure that `zendframework/zend-test` is installed:
```bash
$ composer require --dev zendframework/zend-test
```
To run tests:
```bash
$ composer test
```
You can turn on conditional tests with the `phpunit.xml` file.
To do so:
- Copy `phpunit.xml.dist` file to `phpunit.xml`
- Edit `phpunit.xml` to enable any specific functionality you
want to test, as well as to provide test values to utilize.
## Running Coding Standards Checks
First, ensure you've installed dependencies via composer:
```bash
$ composer require --dev squizlabs/php_codesniffer
```
To run CS checks only:
```console
$ composer cs-check
```
To attempt to automatically fix common CS issues:
```console
$ composer cs-fix
```
If the above fixes any CS issues, please re-run the tests to ensure
they pass, and make sure you add and commit the changes after verification.
## Recommended Workflow for Contributions
Your first step is to establish a public repository from which we can
pull your work into the master repository. We recommend using
[GitHub](https://github.com), as that is where the component is already hosted.
1. Setup a [GitHub account](http://github.com/), if you haven't yet
2. Fork the repository (http://github.com/zendframework/ZendSkeletonApplication)
3. Clone the canonical repository locally and enter it.
```bash
$ git clone https://github.com/zendframework/ZendSkeletonApplication.git
$ cd ZendSkeletonApplication
```
4. Add a remote to your fork; substitute your GitHub username in the command
below.
```bash
$ git remote add {username} git@github.com:{username}/ZendSkeletonApplication.git
$ git fetch {username}
```
### Keeping Up-to-Date
Periodically, you should update your fork or personal repository to
match the canonical ZF repository. Assuming you have setup your local repository
per the instructions above, you can do the following:
```bash
$ git checkout master
$ git fetch origin
$ git rebase origin/master
# OPTIONALLY, to keep your remote up-to-date -
$ git push {username} master:master
```
If you're tracking other branches -- for example, the "develop" branch, where
new feature development occurs -- you'll want to do the same operations for that
branch; simply substitute "develop" for "master".
### Working on a patch
We recommend you do each new feature or bugfix in a new branch. This simplifies
the task of code review as well as the task of merging your changes into the
canonical repository.
A typical workflow will then consist of the following:
1. Create a new local branch based off either your master or develop branch.
2. Switch to your new local branch. (This step can be combined with the
previous step with the use of `git checkout -b`.)
3. Do some work, commit, repeat as necessary.
4. Push the local branch to your remote repository.
5. Send a pull request.
The mechanics of this process are actually quite trivial. Below, we will
create a branch for fixing an issue in the tracker.
```bash
$ git checkout -b hotfix/9295
Switched to a new branch 'hotfix/9295'
```
... do some work ...
```bash
$ git commit
```
... write your log message ...
```bash
$ git push {username} hotfix/9295:hotfix/9295
Counting objects: 38, done.
Delta compression using up to 2 threads.
Compression objects: 100% (18/18), done.
Writing objects: 100% (20/20), 8.19KiB, done.
Total 20 (delta 12), reused 0 (delta 0)
To ssh://git@github.com/{username}/ZendSkeletonApplication.git
b5583aa..4f51698 HEAD -> master
```
To send a pull request, you have two options.
If using GitHub, you can do the pull request from there. Navigate to
your repository, select the branch you just created, and then select the
"Pull Request" button in the upper right. Select the user/organization
"zendframework" as the recipient.
If using your own repository - or even if using GitHub - you can use `git
format-patch` to create a patchset for us to apply; in fact, this is
**recommended** for security-related patches. If you use `format-patch`, please
send the patches as attachments to:
- zf-devteam@zend.com for patches without security implications
- zf-security@zend.com for security patches
#### What branch to issue the pull request against?
Which branch should you issue a pull request against?
- For fixes against the stable release, issue the pull request against the
"master" branch.
- For new features, or fixes that introduce new elements to the public API (such
as new public methods or properties), issue the pull request against the
"develop" branch.
### Branch Cleanup
As you might imagine, if you are a frequent contributor, you'll start to
get a ton of branches both locally and on your remote.
Once you know that your changes have been accepted to the master
repository, we suggest doing some cleanup of these branches.
- Local branch cleanup
```bash
$ git branch -d <branchname>
```
- Remote branch removal
```bash
$ git push {username} :<branchname>
```
## Conduct
Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project.
FROM php:7.0-apache
RUN apt-get update \
&& apt-get install -y git zlib1g-dev \
&& docker-php-ext-install zip \
&& a2enmod rewrite \
&& sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf \
&& mv /var/www/html /var/www/public \
&& curl -sS https://getcomposer.org/installer \
| php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www
Copyright (c) 2005-2016, Zend Technologies USA, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Zend Technologies USA, Inc. nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ZendSkeletonApplication
## Introduction
This is a skeleton application using the Zend Framework MVC layer and module
systems. This application is meant to be used as a starting place for those
looking to get their feet wet with Zend Framework.
## Installation using Composer
The easiest way to create a new Zend Framework project is to use
[Composer](https://getcomposer.org/). If you don't have it already installed,
then please install as per the [documentation](https://getcomposer.org/doc/00-intro.md).
To create your new Zend Framework project:
```bash
$ composer create-project -sdev zendframework/skeleton-application path/to/install
```
Once installed, you can test it out immediately using PHP's built-in web server:
```bash
$ cd path/to/install
$ php -S 0.0.0.0:8080 -t public/ public/index.php
# OR use the composer alias:
$ composer run --timeout 0 serve
```
This will start the cli-server on port 8080, and bind it to all network
interfaces. You can then visit the site at http://localhost:8080/
- which will bring up Zend Framework welcome page.
**Note:** The built-in CLI server is *for development only*.
## Development mode
The skeleton ships with [zf-development-mode](https://github.com/zfcampus/zf-development-mode)
by default, and provides three aliases for consuming the script it ships with:
```bash
$ composer development-enable # enable development mode
$ composer development-disable # disable development mode
$ composer development-status # whether or not development mode is enabled
```
You may provide development-only modules and bootstrap-level configuration in
`config/development.config.php.dist`, and development-only application
configuration in `config/autoload/development.local.php.dist`. Enabling
development mode will copy these files to versions removing the `.dist` suffix,
while disabling development mode will remove those copies.
Development mode is automatically enabled as part of the skeleton installation process.
After making changes to one of the above-mentioned `.dist` configuration files you will
either need to disable then enable development mode for the changes to take effect,
or manually make matching updates to the `.dist`-less copies of those files.
## Running Unit Tests
To run the supplied skeleton unit tests, you need to do one of the following:
- During initial project creation, select to install the MVC testing support.
- After initial project creation, install [zend-test](https://zendframework.github.io/zend-test/):
```bash
$ composer require --dev zendframework/zend-test
```
Once testing support is present, you can run the tests using:
```bash
$ ./vendor/bin/phpunit
```
If you need to make local modifications for the PHPUnit test setup, copy
`phpunit.xml.dist` to `phpunit.xml` and edit the new file; the latter has
precedence over the former when running tests, and is ignored by version
control. (If you want to make the modifications permanent, edit the
`phpunit.xml.dist` file.)
## Using Vagrant
This skeleton includes a `Vagrantfile` based on ubuntu 16.04 (bento box)
with configured Apache2 and PHP 7.0. Start it up using:
```bash
$ vagrant up
```
Once built, you can also run composer within the box. For example, the following
will install dependencies:
```bash
$ vagrant ssh -c 'composer install'
```
While this will update them:
```bash
$ vagrant ssh -c 'composer update'
```
While running, Vagrant maps your host port 8080 to port 80 on the virtual
machine; you can visit the site at http://localhost:8080/
> ### Vagrant and VirtualBox
>
> The vagrant image is based on ubuntu/xenial64. If you are using VirtualBox as
> a provider, you will need:
>
> - Vagrant 1.8.5 or later
> - VirtualBox 5.0.26 or later
For vagrant documentation, please refer to [vagrantup.com](https://www.vagrantup.com/)
## Using docker-compose
This skeleton provides a `docker-compose.yml` for use with
[docker-compose](https://docs.docker.com/compose/); it
uses the `Dockerfile` provided as its base. Build and start the image using:
```bash
$ docker-compose up -d --build
```
At this point, you can visit http://localhost:8080 to see the site running.
You can also run composer from the image. The container environment is named
"zf", so you will pass that value to `docker-compose run`:
```bash
$ docker-compose run zf composer install
```
## Web server setup
### Apache setup
To setup apache, setup a virtual host to point to the public/ directory of the
project and you should be ready to go! It should look something like below:
```apache
<VirtualHost *:80>
ServerName zfapp.localhost
DocumentRoot /path/to/zfapp/public
<Directory /path/to/zfapp/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
</VirtualHost>
```
### Nginx setup
To setup nginx, open your `/path/to/nginx/nginx.conf` and add an
[include directive](http://nginx.org/en/docs/ngx_core_module.html#include) below
into `http` block if it does not already exist:
```nginx
http {
# ...
include sites-enabled/*.conf;
}
```
Create a virtual host configuration file for your project under `/path/to/nginx/sites-enabled/zfapp.localhost.conf`
it should look something like below:
```nginx
server {
listen 80;
server_name zfapp.localhost;
root /path/to/zfapp/public;
location / {
index index.php;
try_files $uri $uri/ @php;
}
location @php {
# Pass the PHP requests to FastCGI server (php-fpm) on 127.0.0.1:9000
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /path/to/zfapp/public/index.php;
include fastcgi_params;
}
}
```
Restart the nginx, now you should be ready to go!
## QA Tools
The skeleton does not come with any QA tooling by default, but does ship with
configuration for each of:
- [phpcs](https://github.com/squizlabs/php_codesniffer)
- [phpunit](https://phpunit.de)
Additionally, it comes with some basic tests for the shipped
`Application\Controller\IndexController`.
If you want to add these QA tools, execute the following:
```bash
$ composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test
```
We provide aliases for each of these tools in the Composer configuration:
```bash
# Run CS checks:
$ composer cs-check
# Fix CS errors:
$ composer cs-fix
# Run PHPUnit tests:
$ composer test
```
# TODO
This is a TODO list for the feature/zend-mvc-v3-minimal branch.
## Documentation
- ModuleRouteListener is removed from the skeleton. This won't affect existing
users, but *will* affect experienced users who originally relied on it being
active in new skeleton projects.
- The `/[:controller][/:action]]` route was removed from the skeleton. Again, it
will not affect existing users, but *will* affect experienced users who
originally relied on it being active in new skeleton projects.
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
# Install dependencies
apt-get update
apt-get install -y apache2 git curl php7.0 php7.0-bcmath php7.0-bz2 php7.0-cli php7.0-curl php7.0-intl php7.0-json php7.0-mbstring php7.0-opcache php7.0-soap php7.0-sqlite3 php7.0-xml php7.0-xsl php7.0-zip libapache2-mod-php7.0
# Configure Apache
echo '<VirtualHost *:80>
DocumentRoot /var/www/public
AllowEncodedSlashes On
<Directory /var/www/public>
Options +Indexes +FollowSymLinks
DirectoryIndex index.php index.html
Order allow,deny
Allow from all
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>' > /etc/apache2/sites-available/000-default.conf
a2enmod rewrite
service apache2 restart
if [ -e /usr/local/bin/composer ]; then
/usr/local/bin/composer self-update
else
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
fi
# Reset home directory of vagrant user
if ! grep -q "cd /var/www" /home/vagrant/.profile; then
echo "cd /var/www" >> /home/vagrant/.profile
fi
echo "** [ZF] Run the following command to install dependencies, if you have not already:"
echo " vagrant ssh -c 'composer install'"
echo "** [ZF] Visit http://localhost:8080 in your browser for to view the application **"
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'bento/ubuntu-16.04'
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.synced_folder '.', '/var/www'
config.vm.provision 'shell', inline: @script
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--name", "ZF Application - Ubuntu 16.04"]
end
end
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for Zend Framework zend-mvc applications",
"type": "project",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"mvc",
"zf"
],
"homepage": "http://framework.zend.com/",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^5.6 || ^7.0",
"zendframework/zend-component-installer": "^1.0 || ^0.7 || ^1.0.0-dev@dev",
"zendframework/zend-mvc": "^3.0.1",
"zfcampus/zf-development-mode": "^3.0",
"multidots/zf3-rest-api": "dev-master",
"zendframework/zend-db": "^2.9",
"zendframework/zend-inputfilter": "^2.8",
"zendframework/zend-session": "^2.8",
"zendframework/zend-cache": "^2.8"
},
"autoload": {
"psr-4": {
"Application\\": "module/Application/src/",
"Khansia\\": "vendor/Khansia/"
}
},
"autoload-dev": {
"psr-4": {
"ApplicationTest\\": "module/Application/test/"
}
},
"extra": [],
"scripts": {
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"development-disable": "zf-development-mode disable",
"development-enable": "zf-development-mode enable",
"development-status": "zf-development-mode status",
"post-create-project-cmd": [
"@development-enable"
],
"serve": "php -S 0.0.0.0:8080 -t public public/index.php",
"test": "phpunit"
}
}
This diff is collapsed.
<?php
/**
* If you need an environment-specific system or application configuration,
* there is an example in the documentation
* @see https://docs.zendframework.com/tutorials/advanced-config/#environment-specific-system-configuration
* @see https://docs.zendframework.com/tutorials/advanced-config/#environment-specific-application-configuration
*/
return [
// Retrieve list of modules used in this application.
'modules' => require __DIR__ . '/modules.config.php',
// These are various options for the listeners attached to the ModuleManager
'module_listener_options' => [
// This should be an array of paths in which modules reside.
// If a string key is provided, the listener will consider that a module
// namespace, the value of that key the specific path to that module's
// Module class.
'module_paths' => [
'./module',
'./vendor',
],
// An array of paths from which to glob configuration files after
// modules are loaded. These effectively override configuration
// provided by modules themselves. Paths may use GLOB_BRACE notation.
'config_glob_paths' => [
realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php',
],
// Whether or not to enable a configuration cache.
// If enabled, the merged configuration will be cached and used in
// subsequent requests.
'config_cache_enabled' => true,
// The key used to create the configuration cache file name.
'config_cache_key' => 'application.config.cache',
// Whether or not to enable a module class map cache.
// If enabled, creates a module class map cache which will be used
// by in future requests, to reduce the autoloading process.
'module_map_cache_enabled' => true,
// The key used to create the class map cache file name.
'module_map_cache_key' => 'application.module.cache',
// The path in which to cache merged configuration.
'cache_dir' => 'data/cache/',
// Whether or not to enable modules dependency checking.
// Enabled by default, prevents usage of modules that depend on other modules
// that weren't loaded.
// 'check_dependencies' => true,
],
// Used to create an own service manager. May contain one or more child arrays.
// 'service_listener_options' => [
// [
// 'service_manager' => $stringServiceManagerName,
// 'config_key' => $stringConfigKey,
// 'interface' => $stringOptionalInterface,
// 'method' => $stringRequiredMethodName,
// ],
// ],
// Initial configuration with which to seed the ServiceManager.
// Should be compatible with Zend\ServiceManager\Config.
// 'service_manager' => [],
];
local.php
*.local.php
About this directory:
=====================
By default, this application is configured to load all configs in
`./config/autoload/{,*.}{global,local}.php`. Doing this provides a
location for a developer to drop in configuration override files provided by
modules, as well as cleanly provide individual, application-wide config files
for things like database connections, etc.
<?php
/**
* Local Configuration Override for DEVELOPMENT MODE.
*
* This configuration override file is for providing configuration to use while
* in development mode. Run:
*
* <code>
* $ composer development-enable
* </code>
*
* from the project root to copy this file to development.local.php and enable
* the settings it contains.
*
* You may also create files matching the glob pattern `{,*.}{global,local}-development.php`.
*/
return [
'view_manager' => [
'display_exceptions' => true,
],
];
<?php
/**
* Global Configuration Override
*
* You can use this file for overriding configuration values from modules, etc.
* You would place values in here that are agnostic to the environment and not
* sensitive to security.
*
* @NOTE: In practice, this file will typically be INCLUDED in your source
* control, so do not include passwords or other sensitive information in this
* file.
*/
return [
// ...
];
<?php
/**
* Local Configuration Override
*
* This configuration override file is for overriding environment-specific and
* security-sensitive configuration information. Copy this file without the
* .dist extension at the end and populate values as needed.
*
* @NOTE: This file is ignored from Git by default with the .gitignore included
* in ZendSkeletonApplication. This is a good practice, as it prevents sensitive
* credentials from accidentally being committed into version control.
*/
return [
];
<?php
/**
* Global Configuration
*
*/
return [
'ApiRequest' => [
'responseFormat' => [
'statusKey' => 'status',
'statusOkText' => 'OK',
'statusNokText' => 'NOK',
'resultKey' => 'result',
'messageKey' => 'message',
'defaultMessageText' => 'Empty response!',
'errorKey' => 'error',
'defaultErrorText' => 'Unknown request!',
'authenticationRequireText' => 'Authentication Required.',
'pageNotFoundKey' => 'Request Not Found.'
],
'jwtAuth' => [
'cypherKey' => 'R1a#2%dY2fX@3g8r5&s4Kf6*sd(5dHs!5gD4s',
'tokenAlgorithm' => 'HS256'
],
]
];
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* This is configuration for the ZendDeveloperTools development toolbar.
*
* It will be enabled when you enable development mode.
*/
return [
'zenddevelopertools' => [
/**
* General Profiler settings
*/
'profiler' => [
/**
* Enables or disables the profiler.
*
* Expects: bool
* Default: true
*/
'enabled' => true,
/**
* Enables or disables the strict mode. If the strict mode is enabled, any error will throw an exception,
* otherwise all errors will be added to the report (and shown in the toolbar).
*
* Expects: bool
* Default: true
*/
'strict' => true,
/**
* If enabled, the profiler tries to flush the content before the it starts collecting data. This option
* will be ignored if the Toolbar is enabled.
*
* Note: The flush listener listens to the MvcEvent::EVENT_FINISH event with a priority of -9400. You have
* to disable this function if you wish to modify the output with a lower priority.
*
* Expects: bool
* Default: false
*/
'flush_early' => false,
/**
* The cache directory is used in the version check and for every storage type that writes to the disk.
* Note: The default value assumes that the current working directory is the application root.
*
* Expects: string
* Default: 'data/cache'
*/
'cache_dir' => 'data/cache',
/**
* If a matches is defined, the profiler will be disabled if the request does not match the pattern.
*
* Example: 'matcher' => array('ip' => '127.0.0.1')
* OR
* 'matcher' => array('url' => array('path' => '/admin')
* Note: The matcher is not implemented yet!
*/
'matcher' => [],
/**
* Contains a list with all collector the profiler should run. Zend Developer Tools ships with
* 'db' (Zend\Db), 'time', 'event', 'memory', 'exception', 'request' and 'mail' (Zend\Mail). If you wish to
* disable a default collector, simply set the value to null or false.
*
* Example: 'collectors' => array('db' => null)
* Expects: array
*/
'collectors' => [],
],
'events' => [
/**
* Set to true to enable event-level logging for collectors that will support it. This enables a wildcard
* listener onto the shared event manager that will allow profiling of user-defined events as well as the
* built-in ZF events.
*
* Expects: bool
* Default: false
*/
'enabled' => true,
/**
* Contains a list with all event-level collectors that should run. Zend Developer Tools ships with 'time'
* and 'memory'. If you wish to disable a default collector, simply set the value to null or false.
*
* Example: 'collectors' => array('memory' => null)
* Expects: array
*/
'collectors' => [],
/**
* Contains event identifiers used with the event listener. Zend Developer Tools defaults to listen to all
* events. If you wish to disable the default all-inclusive identifier, simply set the value to null or
* false.
*
* Example: 'identifiers' => array('all' => null, 'dispatchable' => 'Zend\Stdlib\DispatchableInterface')
* Expects: array
*/
'identifiers' => [],
],
/**
* General Toolbar settings
*/
'toolbar' => [
/**
* Enables or disables the Toolbar.
*
* Expects: bool
* Default: false
*/
'enabled' => true,
/**
* If enabled, every empty collector will be hidden.
*
* Expects: bool
* Default: false
*/
'auto_hide' => false,
/**
* The Toolbar position.
*
* Expects: string ('bottom' or 'top')
* Default: bottom
*/
'position' => 'bottom',
/**
* If enabled, the Toolbar will check if your current Zend Framework version is up-to-date.
* Note: The check will only occur once every hour.
*
* Expects: bool
* Default: false
*/
'version_check' => false,
/**
* Contains a list with all collector toolbar templates. The name of the array key must be same as the name
* of the collector.
*
* Example: 'profiler' => array(
* 'collectors' => array(
* // My_Collector_Example::getName() -> mycollector
* 'MyCollector' => 'My_Collector_Example',
* )
* ),
* 'toolbar' => array(
* 'entries' => array(
* 'mycollector' => 'example/toolbar/my-collector',
* )
* ),
* Expects: array
*/
'entries' => [],
],
],
];
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
return [
// Additional modules to include when in development mode
'modules' => [
'Khansia'
],
// Configuration overrides during development mode
'module_listener_options' => [
'config_glob_paths' => [realpath(__DIR__) . '/autoload/{,*.}{global,local}-development.php'],
'config_cache_enabled' => false,
'module_map_cache_enabled' => false,
],
];
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
return [
// Additional modules to include when in development mode
'modules' => [
],
// Configuration overrides during development mode
'module_listener_options' => [
'config_glob_paths' => [realpath(__DIR__) . '/autoload/{,*.}{global,local}-development.php'],
'config_cache_enabled' => false,
'module_map_cache_enabled' => false,
],
];
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* List of enabled modules for this application.
*
* This should be an array of module namespaces used in the application.
*/
return [
'Zend\InputFilter',
'Zend\Filter',
'Zend\Db',
'Zend\Router',
'Zend\Validator',
'RestApi',
'Application',
'Khansia'
];
zf:
build: .
dockerfile: Dockerfile
ports:
- "8080:80"
volumes:
- .:/var/www
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application;
use Zend\Router\Http\Literal;
use Zend\Router\Http\Segment;
use Zend\ServiceManager\Factory\InvokableFactory;
return [
'router' => [
'routes' => [
'404' => [
'type' => Segment::class,
'options' => [
'route' => '/:*',
'defaults' => [
'controller' => Master\RouteNotFoundController::class,
'action' => 'routenotfound',
],
],
'priority' => -1000,
],
'home' => [
'type' => Literal::class,
'options' => [
'route' => '/',
'defaults' => [
'controller' => Controller\QueueController::class,
'action' => 'beranda',
],
],
],
'dashboard' => [
'type' => Literal::class,
'options' => [
'route' => '/dasboard',
'defaults' => [
'controller' => Controller\AdminController::class,
'action' => 'dasboard',
],
],
],
'application' => [
'type' => Segment::class,
'options' => [
'route' => '/application[/:action]',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
],
'api' => [
'type' => Segment::class,
'options' => [
'route' => '/api[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => [
'controller' => Controller\ApiController::class,
'action' => 'index',
'isAuthorizationRequired' => false
],
],
],
'signin' => [
'type' => Segment::class,
'options' => [
'route' => '/api/login',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => [
'controller' => Controller\ApiController::class,
'action' => 'login',
'isAuthorizationRequired' => false
],
],
],
'login' => [
'type' => Segment::class,
'options' => [
'route' => '/login[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => [
'controller' => Controller\UserController::class,
'action' => 'login',
'isAuthorizationRequired' => false
],
],
],
'user' => [
'type' => Segment::class,
'options' => [
'route' => '/user[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => [
'controller' => Controller\UserController::class,
'action' => 'index',
'isAuthorizationRequired' => false
],
],
],
'queue' => [
'type' => Segment::class,
'options' => [
'route' => '/queue[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => [
'controller' => Controller\QueueController::class,
'action' => 'index',
'isAuthorizationRequired' => false
],
],
],
'admin' => [
'type' => Segment::class,
'options' => [
'route' => '/admin[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => [
'controller' => Controller\AdminController::class,
'action' => 'index',
'isAuthorizationRequired' => false
],
],
],
'umum' => [
'type' => Segment::class,
'options' => [
'route' => '/umum[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => [
'controller' => Controller\UmumController::class,
'action' => 'index',
'isAuthorizationRequired' => false
],
],
],
],
],
'controllers' => [
'factories' => [
Controller\IndexController::class => Factory\IndexControllerFactory::class,
Controller\UserController::class => Factory\UserControllerFactory::class,
Controller\QueueController::class => Factory\QueueControllerFactory::class,
Controller\AdminController::class => Factory\AdminControllerFactory::class,
Controller\UmumController::class => Factory\UmumControllerFactory::class,
// Master\GlobalActionController::class => Factory\GlobalActionControllerFactory::class,
Controller\ApiController::class => Factory\ApiControllerFactory::class,
// Controller\ApiController::class => InvokableFactory::class,
],
],
'view_manager' => [
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => [
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
],
'template_path_stack' => [
__DIR__ . '/../view',
],
],
'databases' => array(
'primary' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'username' => 'postgres',
'password' => '',
'port' => 5432,
'schema' => 'antrian',
),
),
'php' => array(
'display_errors' => false,
'error_reporting' => E_ALL,
'max_execution_time' => 200,
'session.gc_maxlifetime' => 86400, //24 jam
),
];
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Khansia\Generic\Result;
class AdminController extends \Application\Master\GlobalActionController
{
public function __construct($headScript)
{
$this->headScript = $headScript;
}
public function indexAction()
{
echo 'forbidden';die;
}
public function dasboardAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-panggil.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function antrianadminAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// echo "<pre>";
$id = $getpath[3];
// echo "<pre>";
// print_r($uri);die;
// $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
// $param = new \Application\Model\Param($storage);
// $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => "http://queue.indra/api/nextantrian",
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('inoantrian' => '1','idok' => '74','istatus' => '30'),
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// echo $response;
// function curl($url, $data){
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output = curl_exec($ch);
// curl_close($ch);
// return $output;
// }
// // Data Parameter yang Dikirim oleh cURL
// $data = array("inoantrian"=>"1","idok"=>"74","istatus"=>"40");
// print_r($data);
// $send = curl("http://queue.indra/api/nextantrian/",json_encode($data));
// echo json_encode(array('respon'=>$send),JSON_UNESCAPED_SLASHES);
$arr = json_decode(file_get_contents("php://input"));
if (empty($arr->inoantrian) OR empty($arr->idok) OR empty($arr->istatus)){
echo "Submit gagal!";
} else {
echo "Submit berhasil!".$arr->inoantrian."</b><b>".$arr->idok."</b>.<b>".$arr->istatus."</b>.";
}
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $id . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-admin.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function registrasidokterAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-registrasidokter.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolapasienAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolapasien.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolapoliAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolapoli.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function keloladokterAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-keloladokter.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function kelolaruanganAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-kelolaruang.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function tableAction()
{
$this->isLoggedIn();
$view = new ViewModel();
// $result = new Result();
/* get url */
// $uri = $this->getRequest()->getUri();
// $baseurl = sprintf('//%s', $uri->getHost());
//$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
//$this->headScript->appendFile('/action-js/index-js/action-listdata.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function cobainAction()
{
//$this->isLoggedIn();
// $view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
// $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
// $this->headScript->appendFile('/action-js/index-js/action-listdata.js');
$this->layout("layout/layoutAdmin");
return $view;
}
public function tampilanumumAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
// require_once(APPPATH.'vendor/autoload.php');
// $options = array(
// 'cluster' => 'ap1',
// 'useTLS' => true
// );
// $pusher = new PusherPusher(
// '6f23df2468d8c1c7d0a2', //ganti dengan App_key pusher Anda
// 'd2c2bf5a98edcdddfda2', //ganti dengan App_secret pusher Anda
// '1090832', //ganti dengan App_key pusher Anda
// $options
// );
// $data['message'] = 'success';
// $pusher->trigger('my-channel', 'my-event', $data);
$today = gmdate("d M Y ", time()+60*60*7);
$view->setVariable('today', $today);
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umum.js');
$this->layout("layout/layoutAdmin");
return $view;
}
}
This diff is collapsed.
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Khansia\Generic\Result;
class IndexController extends \Application\Master\GlobalActionController
{
public function __construct($headScript)
{
$this->headScript = $headScript;
}
public function indexAction()
{
$view = new ViewModel();
$result = new Result();
/* ini hanya contoh return dari factory IndexControllerFactory gan, dani tamvan */
$userSession = $this->getSession();
$owner = $userSession->owner();
if($owner){
/* session data */
$sessionArray = array(
'baseurl' => $userSession->get('baseurl'),
'user_id' => $userSession->get('user_id'),
'usernamed' => $userSession->get('usernamed'),
'passwd' => $userSession->get('passwd'),
'name' => $userSession->get('name'),
'role' => $userSession->get('role'),
'status' => $userSession->get('status'),
'deviceid' => $userSession->get('deviceid'),
'token' => $userSession->get('token'),
'retries' => $userSession->get('retries'),
'create_dtm' => $userSession->get('create_dtm'),
'access' => $userSession->get('access'),
'role_code' => $userSession->get('role_code'),
);
//print_r($result);die;
$view->setVariable('dataa', $sessionArray);
$baseurl = 'dani';
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/index-js/action-index.js');
return $view;
}else{
return $this->redirect()->toRoute('login');
}
}
}
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Khansia\Generic\Result;
class QueueController extends \Application\Master\GlobalActionController
{
public function __construct($headScript)
{
$this->headScript = $headScript;
}
public function indexAction()
{
echo 'forbidden';die;
}
public function berandaAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
// $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
// $this->headScript->appendFile('/action-js/index-js/action-listdata.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function daftarpasienAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-daftarpasien.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function resumecekpasienAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-datapasien.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function datapasienAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
$decodeid = base64_decode($getpath[3]);
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-datapasien.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function dokterAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-dokter.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function poliAction()
{
$this->isLoggedIn();
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/index-js/action-listdata.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function cekdatapasienAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-cekdatapasien.js');
$this->layout("layout/layoutQueue");
return $view;
}
public function cetakantrianAction()
{
$view = new ViewModel();
$result = new Result();
/* get url */
$uri = $this->getRequest()->getUri();
//echo "<pre>";
//print_r($uri);die;
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// print_($getpath);die;
$decodeid = base64_decode($getpath[3]);
$decodeiddok = base64_decode($getpath[4]);
// $decodeidpol = base64_decode($getpath[5]);
// $decodeidant = base64_decode($getpath[6]);
// print_r($decodeiddok );die;
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
$id = $decodeid ;
// $iddok = $decodeiddok ;
/* generate counter number */
$codeCounter = $param->loadUser($id);
// print_r($codeCounter);die;
foreach($codeCounter->data as $result) {
}
// print_r($codeCounter);
$view->setVariable('no_rekam_medis', $result['no_rekam_medis']);
$view->setVariable('nama', $result['nama']);
$view->setVariable('nama_dokter', $result['nama_dokter']);
$view->setVariable('kode_poli', $result['nama_poli']);
$view->setVariable('no_antrian', $result['no_antrian']);
$view->setVariable('no_antrian', $result['no_antrian']);
$view->setVariable('kode_dokter', $result['kode_dokter']);
$view->setVariable('sisa_antrian', $result['sisa_antrian']);
// print_r($result);die;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var no_rekam_medis_cetak = "' . $result['no_rekam_medis'] . '"');
$this->headScript->appendScript(' var nama_pasien_cetak = "' . $result['nama'] . '"');
$this->headScript->appendScript(' var nama_dokter_cetak = "' . $result['nama_dokter'] . '"');
$this->headScript->appendScript(' var kode_poli_cetak = "' . $result['nama_poli'] . '"');
$this->headScript->appendScript(' var no_antrian_cetak = "' . $result['no_antrian'] . '"');
$this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"');
$this->headScript->appendScript(' var sisa_antrian = "' . $result['sisa_antrian'] . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-cetak.js');
$this->layout("layout/layoutQueue");
return $view;
}
}
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Khansia\Generic\Result;
class UmumController extends \Application\Master\GlobalActionController
{
public function __construct($headScript)
{
$this->headScript = $headScript;
}
public function indexAction()
{
$view = new ViewModel();
$result = new Result();
// $today = gmdate("d M Y ", time()+60*60*7);
// $view->setVariable('today', $today);
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/tampilanantiran-js/action-pilihantrian.js');
$this->layout("layout/layoutUmum");
return $view;
}
public function umumtampilanAction()
{
$view = new ViewModel();
$result = new Result();
$today = gmdate("d M Y ", time()+60*60*7);
$view->setVariable('today', $today);
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// echo "<pre>";
$decodeid = base64_decode($getpath[3]);
// $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => "http://queue.indra/api/loadantrian?id_poli=$decodeid",
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('id_poli' => $decodeid),
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// // echo $response;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id_poli = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umumtampilan.js');
$this->layout("layout/layoutUmum");
return $view;
}
}
This diff is collapsed.
<?php
namespace Application\Factory;
use Zend\ServiceManager\Factory\FactoryInterface;
use Interop\Container\ContainerInterface;
class AdminControllerFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
/* get helpermanager gan */
$headScript = $container->get('ViewHelperManager')->get('headScript');
return new \Application\Controller\AdminController($headScript);
}
}
\ No newline at end of file
<?php
namespace Application\Factory;
use Zend\ServiceManager\Factory\FactoryInterface;
use Interop\Container\ContainerInterface;
class ApiControllerFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
/* get helpermanager gan */
$headScript = $container->get('ViewHelperManager')->get('headScript');
return new \Application\Controller\ApiController($headScript);
}
}
\ No newline at end of file
<?php
namespace Application\Factory;
use Zend\ServiceManager\Factory\FactoryInterface;
use Interop\Container\ContainerInterface;
class IndexControllerFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
/* get helpermanager gan */
$headScript = $container->get('ViewHelperManager')->get('headScript');
return new \Application\Controller\IndexController($headScript);
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment