Merge branch 'release/v0.1.11'
This commit is contained in:
commit
27b404e6ea
@ -60,11 +60,13 @@ class ContractController extends Controller {
|
||||
'dataProvider' => $dataProvider
|
||||
] );
|
||||
}
|
||||
/**
|
||||
* Lists all Contract models.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Lists all Contract models.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionIndexCustomer($id) {
|
||||
$model = Customer::findOne ( $id );
|
||||
|
||||
@ -82,13 +84,14 @@ class ContractController extends Controller {
|
||||
'dataProvider' => $dataProvider
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single Contract model.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Displays a single Contract model.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionView($id) {
|
||||
return $this->render ( 'view', [
|
||||
'model' => $this->findModel ( $id )
|
||||
@ -115,14 +118,15 @@ class ContractController extends Controller {
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing Contract model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Updates an existing Contract model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionUpdate($id) {
|
||||
$model = $this->findModel ( $id );
|
||||
|
||||
@ -217,7 +221,13 @@ class ContractController extends Controller {
|
||||
'index'
|
||||
] );
|
||||
}
|
||||
public function actionDetails($id) {
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return string
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionDetails($id) {
|
||||
$contract = Contract::findOne ( $id );
|
||||
// ticket_installment_request
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace backend\models;
|
||||
|
||||
use common\components\Helper;
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
@ -15,6 +16,7 @@ class ContractSearch extends Contract
|
||||
{
|
||||
|
||||
public $customer_name;
|
||||
public $card_number;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@ -23,7 +25,7 @@ class ContractSearch extends Contract
|
||||
{
|
||||
return [
|
||||
[['id_contract', 'id_customer', 'status', 'flag', 'part_paid', 'part_count', 'part_required', 'id_ticket_type'], 'integer'],
|
||||
[['customer_name' ], 'safe'],
|
||||
[['customer_name' ,'card_number'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -65,7 +67,8 @@ class ContractSearch extends Contract
|
||||
$query->from('contract');
|
||||
$query->innerJoin('user' ,'user.id = contract.id_user');
|
||||
$query->innerJoin('customer' ,'customer.id_customer = contract.id_customer');
|
||||
|
||||
$query->leftJoin('card as card' ,'card.id_card = customer.id_customer_card');
|
||||
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
@ -133,6 +136,9 @@ class ContractSearch extends Contract
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
if ( isset($this->card_number)){
|
||||
$this->card_number = Helper::fixAsciiChars($this->card_number);
|
||||
}
|
||||
|
||||
$query->andFilterWhere([
|
||||
'contract.id_contract' => $this->id_contract,
|
||||
@ -147,6 +153,7 @@ class ContractSearch extends Contract
|
||||
'contract.created_at' => $this->created_at,
|
||||
'contract.updated_at' => $this->updated_at,
|
||||
'contract.id_ticket_type' => $this->id_ticket_type,
|
||||
'card.number' => $this->card_number,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
|
||||
|
||||
@ -26,6 +26,7 @@ use yii\widgets\ActiveForm;
|
||||
<?= $form->field($model, 'customer_name')->label('Vendég neve') ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'card_number')->label('Kártyaszám') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
-0.1.11
|
||||
- add rest application and ge
|
||||
-0.1.10
|
||||
- allow card read log for account(s) in reception2
|
||||
-0.1.09
|
||||
|
||||
@ -3,3 +3,4 @@ Yii::setAlias('common', dirname(__DIR__));
|
||||
Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend');
|
||||
Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
|
||||
Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
|
||||
Yii::setAlias('rest', dirname(dirname(__DIR__)) . '/rest');
|
||||
@ -5,7 +5,7 @@ return [
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'infoEmail' => 'info@rocho-net.hu',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.1.10',
|
||||
'version' => 'v0.1.11',
|
||||
'company' => 'movar',//gyor
|
||||
'company_name' => "Freimann Kft.",
|
||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use yii\db\ActiveRecord;
|
||||
use yii\db\Query;
|
||||
use yii\db\Expression;
|
||||
use common\components\Helper;
|
||||
@ -36,6 +35,7 @@ use common\components\Helper;
|
||||
* @property string $original_end;
|
||||
*
|
||||
* @property \common\models\Card card
|
||||
* @property \common\models\Ticket transfer
|
||||
*/
|
||||
class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
{
|
||||
@ -241,18 +241,23 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \common\models\Card $card the card to which we are looking for
|
||||
*
|
||||
* @return array|\yii\db\ActiveRecord[]
|
||||
*/
|
||||
public static function readActive($card){
|
||||
/**
|
||||
* @param \common\models\Card $card the card to which we are looking for
|
||||
*
|
||||
* @param \DateTime $validOnDay on which day must be the ticket valid
|
||||
* @return array|\yii\db\ActiveRecord[]
|
||||
*/
|
||||
public static function readActive($card, $validOnDay = null){
|
||||
|
||||
if ( $card == null )
|
||||
return [];
|
||||
|
||||
$query = Ticket::find();
|
||||
$today = date('Y-m-d');
|
||||
if (!isset( $validOnDay ) ){
|
||||
$today = date('Y-m-d');
|
||||
}else{
|
||||
$today = $validOnDay->format('Y-m-d');
|
||||
}
|
||||
|
||||
$query->andWhere(['ticket.id_card' => $card->id_card]);
|
||||
$query->andWhere( 'ticket.start <= :today' ,[ 'today' => $today] );
|
||||
|
||||
@ -135,14 +135,6 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
$started_at = $contract->started_at;
|
||||
$date = \DateTime::createFromFormat("Y-m-d H:i:s", $started_at, new \DateTimeZone( 'UTC'));
|
||||
$date = DateUtil::addMonth( $date,$this->priority + 1 );
|
||||
// $date = \DateTime::createFromFormat("Y-m-d H:i:s", $this->request_target_time_at, new \DateTimeZone( 'UTC'));
|
||||
// $date = DateUtil::addMonth( $date, 1 );
|
||||
// $date->modify("+1 month");
|
||||
// $date->modify("-1 day");
|
||||
|
||||
// $date = \DateTime::createFromFormat("Y-m-d H:i:s", $this->request_target_time_at, new \DateTimeZone( 'UTC'));
|
||||
// $date->modify("+1 month");
|
||||
// $date->modify("-1 day");
|
||||
|
||||
$date->setTime(0, 0, 0);
|
||||
|
||||
@ -201,7 +193,6 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
if ( $status == static::$STATUS_ACCEPTED || $status == static::$STATUS_ACCEPTED_MANUAL){
|
||||
if ( !$this->isStatusAccepted() ){
|
||||
$contract->part_paid = $contract->part_paid +1;
|
||||
// $tranfer = $this->addTransfer();
|
||||
$result = Transfer::sellContractTicket($contract, $this, Account::findOne(1), Transfer::STATUS_PAID, Transfer::PAYMENT_METHOD_TRANSFER);
|
||||
$transfer = $result[0];
|
||||
$ticket = $result[1];
|
||||
@ -236,15 +227,6 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
}
|
||||
}
|
||||
|
||||
// protected function applyNewTicketState($partRequired = false){
|
||||
// if ( $partRequired ){
|
||||
// $this->ticket->setPartRequired($this);
|
||||
// }
|
||||
// $this->ticket->applyTicketInstallmentRequest($this);
|
||||
// $this->ticket->save(false);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* @return Transfer
|
||||
*/
|
||||
@ -340,7 +322,11 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL=> 'Személyesen fizetve',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $id_status
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function toStatusName($id_status){
|
||||
$result = "Ismeretlen";
|
||||
$statuses = TicketInstallmentRequest::statuses();
|
||||
@ -349,7 +335,10 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function getStatusName(){
|
||||
return static::toStatusName($this->status);
|
||||
}
|
||||
|
||||
@ -71,6 +71,8 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
*/
|
||||
public static function findIdentityByAccessToken($token, $type = null)
|
||||
{
|
||||
$authorization = base64_decode($token);
|
||||
\Yii::info("findIdentityByAccessToken", $authorization);
|
||||
throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.');
|
||||
}
|
||||
|
||||
|
||||
151
console/controllers/ContractController.php
Normal file
151
console/controllers/ContractController.php
Normal file
@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
namespace console\controllers;
|
||||
|
||||
use common\models\Card;
|
||||
use common\models\Contract;
|
||||
use common\models\Customer;
|
||||
use common\models\ShoppingCart;
|
||||
use common\models\Ticket;
|
||||
use common\models\TicketInstallmentRequest;
|
||||
use common\models\Transfer;
|
||||
use yii\console\Controller;
|
||||
use yii\console\Exception;
|
||||
|
||||
class ContractController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $cardNumber
|
||||
* @throws Exception
|
||||
* @throws \yii\db\Exception
|
||||
*/
|
||||
public function actionRestoreCanceled($cardNumber)
|
||||
{
|
||||
|
||||
$card = Card::findOne(['number' => $cardNumber]);
|
||||
if (!isset($card)) {
|
||||
throw new Exception("Card not found: " . $cardNumber);
|
||||
}
|
||||
|
||||
$this->info("Card loaded");
|
||||
$this->info($card->id_card);
|
||||
$this->info($card->number);
|
||||
|
||||
$customer = Customer::findOne(['id_customer_card' => $card->id_card]);
|
||||
if (!isset($customer)) {
|
||||
throw new Exception("Customer not found for card: " . $cardNumber);
|
||||
}
|
||||
|
||||
$this->info("Customer loaded");
|
||||
$this->info($customer->id_customer);
|
||||
$this->info($customer->name);
|
||||
|
||||
|
||||
// find latest contract for customer
|
||||
/** @var \common\models\Contract $contract */
|
||||
$contract = Contract::find()
|
||||
->andWhere(['id_customer' => $customer->id_customer])
|
||||
->orderBy(['created_at' => SORT_DESC])
|
||||
->limit(1)
|
||||
->one();
|
||||
|
||||
if (!isset($contract)) {
|
||||
throw new Exception("Contract not found for customer: " . $customer->id_customer);
|
||||
}
|
||||
|
||||
$this->info("Contract loaded");
|
||||
$this->info($contract->id_contract);
|
||||
$this->info(Contract::toFlangName($contract->flag));
|
||||
|
||||
$parts = TicketInstallmentRequest::findAll(['id_contract' => $contract->id_contract]);
|
||||
$this->info("Parts loaded");
|
||||
|
||||
$tx = \Yii::$app->db->beginTransaction();
|
||||
try {
|
||||
if (!$contract->isFlagActive()) {
|
||||
$contract->flag = Contract::$FLAG_ACTIVE;
|
||||
$I_CONTRACT = "Contract - change flag " . Contract::toStatusName($contract->flag) . "=>" .
|
||||
Contract::toStatusName(Contract::$FLAG_ACTIVE);
|
||||
$contract->save(false);
|
||||
$this->info($I_CONTRACT);
|
||||
}
|
||||
|
||||
foreach ($parts as $part) {
|
||||
$this->info("Part #" . $part->priority . " ->" . TicketInstallmentRequest::toStatusName($part->status));
|
||||
if ($part->status == TicketInstallmentRequest::$STATUS_CANCELED) {
|
||||
$part->status = TicketInstallmentRequest::$STATUS_PENDING;
|
||||
$part->request_processed_at = null;
|
||||
$part->save(false);
|
||||
$this->info("Change status: "
|
||||
. TicketInstallmentRequest::toStatusName(TicketInstallmentRequest::$STATUS_CANCELED)
|
||||
. "->"
|
||||
. TicketInstallmentRequest::toStatusName(TicketInstallmentRequest::$STATUS_PENDING)
|
||||
);
|
||||
} else if ($part->isStatusAccepted()) {
|
||||
$this->info("loading ticket: #" .$part->id_ticket);
|
||||
$ticket = null;
|
||||
try{
|
||||
/** @var \common\models\Ticket $ticket */
|
||||
// $ticket = Ticket::findOne(['id_ticket' => $part->id_ticket]);
|
||||
}catch (\Throwable $e){
|
||||
\Yii::info("Failed to load ticket: " . $e->getMessage());
|
||||
}
|
||||
if (isset($ticket)) {
|
||||
$this->info("Ticket found: " . $ticket->id_ticket . "/" . $ticket->ticetType->name);
|
||||
if ($ticket->status == Ticket::STATUS_DELETED) {
|
||||
$ticket->status = Ticket::STATUS_ACTIVE;
|
||||
$ticket->save(false);
|
||||
$this->info("Ticket restored: ");
|
||||
$this->info($ticket->id_ticket);
|
||||
$this->info(Ticket::toStatusName(Ticket::STATUS_DELETED)
|
||||
. "->"
|
||||
. Ticket::toStatusName(Ticket::STATUS_ACTIVE)
|
||||
);
|
||||
|
||||
}
|
||||
/** @var \common\models\Transfer $transfer */
|
||||
$transfer = $ticket->transfer;
|
||||
if ($transfer->status == Transfer::STATUS_STORNO) {
|
||||
$transfer->status = Transfer::STATUS_PAID;
|
||||
$transfer->save(false);
|
||||
|
||||
$this->info("Restore transfer: ");
|
||||
$this->info($transfer->id_transfer);
|
||||
$this->info(Transfer::toStatusName(Transfer::STATUS_STORNO)
|
||||
. "->"
|
||||
. Ticket::toStatusName(Transfer::STATUS_PAID)
|
||||
);
|
||||
|
||||
if (!isset($transfer->paid_at)) {
|
||||
$cart = new ShoppingCart();
|
||||
$cart->id_customer = $contract->customer->id_customer;
|
||||
$cart->id_transfer = $transfer->id_transfer;
|
||||
if (!$cart->save(false)) {
|
||||
/** @noinspection SpellCheckingInspection */
|
||||
$E_FAILED_TO_SAVE = "Vendég kosár hozzárendelés sikertelen!";
|
||||
\Yii::error($E_FAILED_TO_SAVE);
|
||||
throw new \Exception($E_FAILED_TO_SAVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
\Yii::info("Ticket not found");
|
||||
}
|
||||
}
|
||||
}
|
||||
$tx->commit();
|
||||
$this->info("Ready");
|
||||
} catch (\Throwable $e) {
|
||||
$tx->rollBack();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function info($msg)
|
||||
{
|
||||
echo $msg . "\n";
|
||||
}
|
||||
|
||||
}
|
||||
44
console/migrations/m180829_155430_add_rest_user.php
Normal file
44
console/migrations/m180829_155430_add_rest_user.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
use common\models\User;
|
||||
|
||||
class m180829_155430_add_rest_user extends Migration
|
||||
{
|
||||
/**
|
||||
* @return bool|void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$user = new User();
|
||||
$user->username = "discount_system";
|
||||
$user->email = "discount_system@rocho-net.hu";
|
||||
$user->setPassword("NmqFb\ivjtX1=yT*Aw5Y");
|
||||
$user->generateAuthKey();
|
||||
$user->save();
|
||||
|
||||
$role = Yii::$app->authManager->createRole('discount_system');
|
||||
Yii::$app->authManager->add($role);
|
||||
Yii::$app->authManager->assign($role, $user->id);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m180829_155430_add_rest_user cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
BIN
doc/cutler_kartya_grafika.zip
Normal file
BIN
doc/cutler_kartya_grafika.zip
Normal file
Binary file not shown.
@ -9,5 +9,6 @@ docker run \
|
||||
-p 86:80 \
|
||||
--name fitness-web \
|
||||
--hostname test.fintess_web.hu \
|
||||
--link mariadb1:mariadb1 \
|
||||
-e XDEBUG_CONFIG="idekey=PHPSTORM" \
|
||||
docker_fitness-ub-php-7:latest
|
||||
|
||||
21
environments/dev/rest/config/main-local.php
Normal file
21
environments/dev/rest/config/main-local.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$config = [
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
if (!YII_ENV_TEST) {
|
||||
// configuration adjustments for 'dev' environment
|
||||
$config['bootstrap'][] = 'debug';
|
||||
$config['modules']['debug'] = 'yii\debug\Module';
|
||||
|
||||
$config['bootstrap'][] = 'gii';
|
||||
$config['modules']['gii'] = 'yii\gii\Module';
|
||||
}
|
||||
|
||||
return $config;
|
||||
3
environments/dev/rest/config/params-local.php
Normal file
3
environments/dev/rest/config/params-local.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
return [
|
||||
];
|
||||
18
environments/dev/rest/web/index-test.php
Normal file
18
environments/dev/rest/web/index-test.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
// NOTE: Make sure this file is not accessible when deployed to production
|
||||
if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) {
|
||||
die('You are not allowed to access this file.');
|
||||
}
|
||||
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'test');
|
||||
|
||||
require(__DIR__ . '/../../vendor/autoload.php');
|
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
|
||||
require(__DIR__ . '/../../common/config/bootstrap.php');
|
||||
require(__DIR__ . '/../config/bootstrap.php');
|
||||
|
||||
$config = require(__DIR__ . '/../../tests/codeception/config/frontend/acceptance.php');
|
||||
|
||||
(new yii\web\Application($config))->run();
|
||||
18
environments/dev/rest/web/index.php
Normal file
18
environments/dev/rest/web/index.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||
|
||||
require(__DIR__ . '/../../vendor/autoload.php');
|
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
|
||||
require(__DIR__ . '/../../common/config/bootstrap.php');
|
||||
require(__DIR__ . '/../config/bootstrap.php');
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require(__DIR__ . '/../../common/config/main.php'),
|
||||
require(__DIR__ . '/../../common/config/main-local.php'),
|
||||
require(__DIR__ . '/../config/main.php'),
|
||||
require(__DIR__ . '/../config/main-local.php')
|
||||
);
|
||||
|
||||
$application = new yii\web\Application($config);
|
||||
$application->run();
|
||||
@ -36,6 +36,8 @@ return [
|
||||
'backend/web/assets',
|
||||
'frontend/runtime',
|
||||
'frontend/web/assets',
|
||||
'rest/runtime',
|
||||
'rest/web/assets',
|
||||
],
|
||||
'setExecutable' => [
|
||||
'yii',
|
||||
@ -44,6 +46,7 @@ return [
|
||||
'setCookieValidationKey' => [
|
||||
'backend/config/main-local.php',
|
||||
'frontend/config/main-local.php',
|
||||
'rest/config/main-local.php',
|
||||
],
|
||||
],
|
||||
'Production' => [
|
||||
@ -53,6 +56,8 @@ return [
|
||||
'backend/web/assets',
|
||||
'frontend/runtime',
|
||||
'frontend/web/assets',
|
||||
'rest/runtime',
|
||||
'rest/web/assets',
|
||||
],
|
||||
'setExecutable' => [
|
||||
'yii',
|
||||
@ -60,6 +65,7 @@ return [
|
||||
'setCookieValidationKey' => [
|
||||
'backend/config/main-local.php',
|
||||
'frontend/config/main-local.php',
|
||||
'rest/config/main-local.php',
|
||||
],
|
||||
],
|
||||
'rochonet' => [
|
||||
@ -69,6 +75,8 @@ return [
|
||||
'backend/web/assets',
|
||||
'frontend/runtime',
|
||||
'frontend/web/assets',
|
||||
'rest/runtime',
|
||||
'rest/web/assets',
|
||||
],
|
||||
'setExecutable' => [
|
||||
'yii',
|
||||
@ -76,6 +84,7 @@ return [
|
||||
'setCookieValidationKey' => [
|
||||
'backend/config/main-local.php',
|
||||
'frontend/config/main-local.php',
|
||||
'rest/config/main-local.php',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
9
environments/prod/rest/config/main-local.php
Normal file
9
environments/prod/rest/config/main-local.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
return [
|
||||
'components' => [
|
||||
'request' => [
|
||||
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
|
||||
'cookieValidationKey' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
3
environments/prod/rest/config/params-local.php
Normal file
3
environments/prod/rest/config/params-local.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
return [
|
||||
];
|
||||
18
environments/prod/rest/web/index.php
Normal file
18
environments/prod/rest/web/index.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', false);
|
||||
defined('YII_ENV') or define('YII_ENV', 'prod');
|
||||
|
||||
require(__DIR__ . '/../../vendor/autoload.php');
|
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
|
||||
require(__DIR__ . '/../../common/config/bootstrap.php');
|
||||
require(__DIR__ . '/../config/bootstrap.php');
|
||||
|
||||
$config = yii\helpers\ArrayHelper::merge(
|
||||
require(__DIR__ . '/../../common/config/main.php'),
|
||||
require(__DIR__ . '/../../common/config/main-local.php'),
|
||||
require(__DIR__ . '/../config/main.php'),
|
||||
require(__DIR__ . '/../config/main-local.php')
|
||||
);
|
||||
|
||||
$application = new yii\web\Application($config);
|
||||
$application->run();
|
||||
@ -13,14 +13,14 @@ return [
|
||||
'bootstrap' => ['log'],
|
||||
'controllerNamespace' => 'frontend\controllers',
|
||||
'components' => [
|
||||
'assetsAutoCompress' =>
|
||||
[
|
||||
'class' => '\iisns\assets\AssetsCompressComponent',
|
||||
'enabled' => true,
|
||||
'jsCompress' => true,
|
||||
'cssFileCompile' => true,
|
||||
'jsFileCompile' => true,
|
||||
],
|
||||
// 'assetsAutoCompress' =>
|
||||
// [
|
||||
// 'class' => '\iisns\assets\AssetsCompressComponent',
|
||||
// 'enabled' => true,
|
||||
// 'jsCompress' => true,
|
||||
// 'cssFileCompile' => true,
|
||||
// 'jsFileCompile' => true,
|
||||
// ],
|
||||
'request' => [
|
||||
'enableCsrfValidation'=>false,
|
||||
],
|
||||
|
||||
@ -65,13 +65,14 @@ class ContractController extends Controller {
|
||||
'dataProvider' => $dataProvider
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single Contract model.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Displays a single Contract model.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionView($id) {
|
||||
$model = $this->findModel ( $id );
|
||||
$customer = $model->customer;
|
||||
@ -110,14 +111,15 @@ class ContractController extends Controller {
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing Contract model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Updates an existing Contract model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionUpdate($id) {
|
||||
$model = $this->findModel ( $id );
|
||||
|
||||
@ -132,14 +134,16 @@ class ContractController extends Controller {
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing Contract model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Deletes an existing Contract model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
* @throws \yii\db\StaleObjectException
|
||||
*/
|
||||
public function actionDelete($id) {
|
||||
$this->findModel ( $id )->delete ();
|
||||
|
||||
@ -196,10 +200,15 @@ class ContractController extends Controller {
|
||||
'id' => $contract->id_contract
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* EGY RÉSZLET KIFIZETÉSE
|
||||
*/
|
||||
|
||||
/**
|
||||
* Cancel contract.
|
||||
* @param $id
|
||||
* @param $flag
|
||||
* @return \yii\web\Response
|
||||
* @throws NotFoundHttpException
|
||||
* @throws \yii\db\Exception
|
||||
*/
|
||||
public function actionCancel($id,$flag) {
|
||||
$contract = $this->findModel ( $id );
|
||||
|
||||
@ -235,7 +244,8 @@ class ContractController extends Controller {
|
||||
$productBuntetes = Product::find ()->andWhere ( [
|
||||
'product_number' => Product::$BUNTETES
|
||||
] )->one ();
|
||||
|
||||
|
||||
// if there is a fee , generate fee and put it to the shopping cart
|
||||
if (isset ( $productBuntetes )) {
|
||||
if ($buntetes > 0) {
|
||||
|
||||
@ -286,7 +296,12 @@ class ContractController extends Controller {
|
||||
] );
|
||||
}
|
||||
|
||||
public function actionMake($id) {
|
||||
/**
|
||||
* @param $id
|
||||
* @return string|\yii\web\Response
|
||||
* @throws \yii\db\Exception
|
||||
*/
|
||||
public function actionMake($id) {
|
||||
$customer = Customer::findOne ( $id );
|
||||
|
||||
if (! isset ( $customer )) {
|
||||
@ -326,8 +341,13 @@ class ContractController extends Controller {
|
||||
'model' => $model
|
||||
] );
|
||||
}
|
||||
|
||||
public function actionContract($id){
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @throws NotFoundHttpException
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function actionContract($id){
|
||||
$model = $this->findModel($id);
|
||||
|
||||
//$mpdf=new \mPDF('utf-8', 'A4');
|
||||
|
||||
30
rest/assets/AppAsset.php
Normal file
30
rest/assets/AppAsset.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
namespace rest\assets;
|
||||
|
||||
use yii\web\AssetBundle;
|
||||
|
||||
/**
|
||||
* @author Qiang Xue <qiang.xue@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
class AppAsset extends AssetBundle
|
||||
{
|
||||
public $basePath = '@webroot';
|
||||
public $baseUrl = '@web';
|
||||
public $css = [
|
||||
'css/site.css',
|
||||
];
|
||||
public $js = [
|
||||
'js/app.js',
|
||||
];
|
||||
public $depends = [
|
||||
'yii\web\YiiAsset',
|
||||
'yii\bootstrap\BootstrapAsset',
|
||||
];
|
||||
}
|
||||
37
rest/assets/config-assets.php
Normal file
37
rest/assets/config-assets.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration file for the "yii asset" console command.
|
||||
* Note that in the console environment, some path aliases like '@webroot' and '@web' may not exist.
|
||||
* Please define these missing path aliases.
|
||||
*/
|
||||
Yii::setAlias('@webroot', realpath(__DIR__ . '/../web'));
|
||||
Yii::setAlias('@web', '/');
|
||||
return [
|
||||
// Adjust command/callback for JavaScript files compressing:
|
||||
'jsCompressor' => 'java -jar compiler.jar --js {from} --js_output_file {to} --warning_level QUIET',
|
||||
// Adjust command/callback for CSS files compressing:
|
||||
'cssCompressor' => 'java -jar yuicompressor.jar --type css {from} -o {to}',
|
||||
// The list of asset bundles to compress:
|
||||
'bundles' => [
|
||||
'rest\assets\AppAsset',
|
||||
'yii\web\YiiAsset',
|
||||
'yii\web\JqueryAsset',
|
||||
'yii\bootstrap\BootstrapAsset',
|
||||
'yii\bootstrap\BootstrapPluginAsset'
|
||||
],
|
||||
// Asset bundle for compression output:
|
||||
'targets' => [
|
||||
'allRest' => [
|
||||
'class' => 'rest\assets\MyAsset' ,
|
||||
'basePath' => '@webroot/assets',
|
||||
'baseUrl' => '@web/assets',
|
||||
'js' => 'js/all-{hash}.js',
|
||||
'css' => 'css/all-{hash}.css',
|
||||
],
|
||||
],
|
||||
// Asset manager configuration:
|
||||
'assetManager' => [
|
||||
'basePath' => '@webroot/assets',
|
||||
'baseUrl' => '@web/assets',
|
||||
],
|
||||
];
|
||||
2
rest/config/.gitignore
vendored
Normal file
2
rest/config/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
main-local.php
|
||||
params-local.php
|
||||
1
rest/config/bootstrap.php
Normal file
1
rest/config/bootstrap.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
||||
43
rest/config/main.php
Normal file
43
rest/config/main.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$params = array_merge(
|
||||
require(__DIR__ . '/../../common/config/params.php'),
|
||||
require(__DIR__ . '/../../common/config/params-local.php'),
|
||||
require(__DIR__ . '/params.php'),
|
||||
require(__DIR__ . '/params-local.php')
|
||||
);
|
||||
|
||||
return [
|
||||
'id' => 'app-rest',
|
||||
'name' =>'Fitness recepció',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'bootstrap' => ['log'],
|
||||
'controllerNamespace' => 'rest\controllers',
|
||||
'components' => [
|
||||
'request' => [
|
||||
'enableCsrfValidation'=>false,
|
||||
'csrfParam' => '_csrf-rest',
|
||||
'parsers' => [
|
||||
'application/json' => 'yii\web\JsonParser',
|
||||
]
|
||||
],
|
||||
'user' => [
|
||||
'identityClass' => 'common\models\User',
|
||||
'enableSession' => false,
|
||||
'enableAutoLogin' => false,
|
||||
'loginUrl' => null,
|
||||
],
|
||||
'log' => [
|
||||
'traceLevel' => YII_DEBUG ? 3 : 0,
|
||||
'targets' => [
|
||||
[
|
||||
'class' => 'yii\log\FileTarget',
|
||||
'levels' => ['error', 'warning'],
|
||||
],
|
||||
],
|
||||
],
|
||||
'errorHandler' => [
|
||||
'errorAction' => 'site/error',
|
||||
],
|
||||
],
|
||||
'params' => $params,
|
||||
];
|
||||
4
rest/config/params.php
Normal file
4
rest/config/params.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
];
|
||||
103
rest/controllers/CustomerController.php
Normal file
103
rest/controllers/CustomerController.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: rocho
|
||||
* Date: 2018.08.29.
|
||||
* Time: 21:58
|
||||
*/
|
||||
|
||||
namespace rest\controllers;
|
||||
|
||||
|
||||
use common\components\Helper;
|
||||
use common\models\Card;
|
||||
use common\models\Ticket;
|
||||
use yii\web\BadRequestHttpException;
|
||||
use yii\web\NotFoundHttpException;
|
||||
|
||||
class CustomerController extends RestController
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $number
|
||||
* @param int $lastXDays default 0. Search for valid tickets also in the last x days.
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function actionDiscountStatus($number, $lastXDays = null)
|
||||
{
|
||||
|
||||
$number = Helper::fixAsciiChars($number);
|
||||
|
||||
$query = Card::find();
|
||||
$query->andWhere(['or',
|
||||
['and', ['in', 'card.number', [$number]], "trim(coalesce(card.number, '')) <>'' "],
|
||||
['and', ['in', 'card.rfid_key', [$number]], "trim(coalesce(card.rfid_key, '')) <>'' "],
|
||||
|
||||
]);
|
||||
|
||||
$card = $query->one();
|
||||
|
||||
if (!isset($card)) {
|
||||
throw new NotFoundHttpException("Kártya nem található");
|
||||
}
|
||||
|
||||
$customer = $card->customer;
|
||||
|
||||
if (!isset($customer)) {
|
||||
throw new NotFoundHttpException("Vendég nem található");
|
||||
}
|
||||
|
||||
if (isset($lastXDays)) {
|
||||
if (!is_numeric($lastXDays)) {
|
||||
throw new BadRequestHttpException("lastXDays paraméter hibás");
|
||||
}
|
||||
if ($lastXDays > 6 || $lastXDays < 1) {
|
||||
throw new BadRequestHttpException("lastXDays paraméter érték hibás");
|
||||
}
|
||||
}
|
||||
|
||||
// check if has valid ticket today
|
||||
/** @var \common\models\Card $card */
|
||||
$tickets = Ticket::readActive($card);
|
||||
$hasValidTicket = count($tickets) > 0;
|
||||
|
||||
if (isset($lastXDays)) {
|
||||
// try to find any valid ticket in the lastXDays
|
||||
$minusDay = 1;
|
||||
while (!$hasValidTicket && $minusDay <= $lastXDays) {
|
||||
/** @var integer $minusDay */
|
||||
$day = $this->getDateMinusDays($minusDay);
|
||||
$tickets = Ticket::readActive($card, $day);
|
||||
$hasValidTicket = count($tickets) > 0;
|
||||
$minusDay = $minusDay + 1;
|
||||
}
|
||||
}
|
||||
|
||||
$result = [
|
||||
'discount' => $hasValidTicket
|
||||
];
|
||||
|
||||
if (isset($customer)) {
|
||||
$result['card_number'] = $card->number;
|
||||
$result['name'] = $customer->name;
|
||||
$result['provider'] = \Yii::$app->id;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $minusDays
|
||||
* @return \DateTime
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function getDateMinusDays($minusDays)
|
||||
{
|
||||
$date = new \DateTime('now');
|
||||
$date->sub(new \DateInterval('P' . $minusDays . 'D'));
|
||||
$date->setTime(0, 0, 0);
|
||||
return $date;
|
||||
}
|
||||
|
||||
}
|
||||
37
rest/controllers/RestController.php
Normal file
37
rest/controllers/RestController.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace rest\controllers;
|
||||
|
||||
|
||||
use common\models\User;
|
||||
use yii\filters\auth\HttpBasicAuth;
|
||||
use yii\rest\Controller;
|
||||
|
||||
class RestController extends Controller
|
||||
{
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
$behaviors = parent::behaviors();
|
||||
$behaviors['authenticator'] = [
|
||||
'class' => HttpBasicAuth::className(),
|
||||
'auth' => [$this, 'auth']
|
||||
];
|
||||
return $behaviors;
|
||||
}
|
||||
|
||||
public function auth($username, $password)
|
||||
{
|
||||
try {
|
||||
$user = User::findOne(['username' => $username]);
|
||||
if ($user->validatePassword($password)) {
|
||||
return $user;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Yii::error("Failed to load user: " . $e->getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
124
rest/controllers/SiteController.php
Normal file
124
rest/controllers/SiteController.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
namespace rest\controllers;
|
||||
|
||||
use Yii;
|
||||
use common\models\LoginForm;
|
||||
use yii\web\Controller;
|
||||
use yii\filters\VerbFilter;
|
||||
use yii\filters\AccessControl;
|
||||
use common\models\User;
|
||||
use common\components\Helper;
|
||||
use common\models\Log;
|
||||
|
||||
/**
|
||||
* Site controller
|
||||
*/
|
||||
class SiteController extends Controller
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'access' => [
|
||||
'class' => AccessControl::className(),
|
||||
'only' => ['logout' ],
|
||||
'rules' => [
|
||||
|
||||
[
|
||||
'actions' => ['logout'],
|
||||
'allow' => true,
|
||||
'roles' => ['@'],
|
||||
],
|
||||
],
|
||||
],
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'logout' => ['post'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function actions()
|
||||
{
|
||||
return [
|
||||
'error' => [
|
||||
'class' => 'yii\web\ErrorAction',
|
||||
],
|
||||
'captcha' => [
|
||||
'class' => 'yii\captcha\CaptchaAction',
|
||||
'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays homepage.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
return $this->render('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs in a user.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionLogin()
|
||||
{
|
||||
if (!\Yii::$app->user->isGuest) {
|
||||
return $this->goHome();
|
||||
}
|
||||
|
||||
$model = new LoginForm();
|
||||
if ($model->load(Yii::$app->request->post()) && $model->login()) {
|
||||
|
||||
$geoip = Helper::getGeoIp();
|
||||
|
||||
$message = "";
|
||||
$user = User::findOne(\Yii::$app->user->id);
|
||||
if ( isset($geoip)){
|
||||
$ip = isset( $geoip->ip ) ? $geoip->ip : "";
|
||||
$city = isset( $geoip->city ) ? $geoip->city : "";
|
||||
$message = "Bejelentkezés: " .$user->username. " Ip cím:". $ip . " Város: " . $city;
|
||||
}
|
||||
|
||||
Log::log([
|
||||
'type' =>Log::$TYPE_LOGIN,
|
||||
'message' => $message
|
||||
]);
|
||||
|
||||
return $this->redirect(['account/select']);
|
||||
} else {
|
||||
return $this->render('login', ['model' => $model,]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Logs out the current user.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionLogout()
|
||||
{
|
||||
Yii::$app->user->logout();
|
||||
|
||||
return $this->goHome();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
2
rest/runtime/.gitignore
vendored
Normal file
2
rest/runtime/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
84
rest/views/layouts/main.php
Normal file
84
rest/views/layouts/main.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\Nav;
|
||||
use yii\bootstrap\NavBar;
|
||||
use yii\widgets\Breadcrumbs;
|
||||
use rest\assets\AppAsset;
|
||||
use common\widgets\Alert;
|
||||
use kartik\widgets\AlertBlock;
|
||||
use yii\helpers\Url;
|
||||
|
||||
AppAsset::register($this);
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?= Html::csrfMetaTags() ?>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<script>
|
||||
var reception_card_url = '<?php echo Url::toRoute('customer/reception');?>';
|
||||
</script>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php $this->beginBody() ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php
|
||||
|
||||
|
||||
$items = [];
|
||||
|
||||
NavBar::begin([
|
||||
'brandLabel' => 'Web Recepció',
|
||||
'brandUrl' => Yii::$app->homeUrl,
|
||||
'options' => [
|
||||
'class' => 'navbar-inverse navbar-fixed-top',
|
||||
],
|
||||
]);
|
||||
echo Nav::widget([
|
||||
'options' => ['class' => 'navbar-nav navbar-right'],
|
||||
'items' => $items,
|
||||
]);
|
||||
NavBar::end();
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<?= Breadcrumbs::widget([
|
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||
]) ?>
|
||||
<?= Alert::widget() ?>
|
||||
<?= $content ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer" style="min-height: 60px; height: auto;">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="pull-left">© <?= Yii::$app->name ?> <?= Yii::$app->params['version'] ?> Fitness - WebAdmin <?= date('Y') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
Ingyenesen használható alkalmazás.
|
||||
Az oldalon szereplő adatok csak tájékoztató jellegűek.<br>
|
||||
Az adatok helyességéért és igazságtartalmáért felelősséget nem vállalunk.<br>
|
||||
Az oldal nem használható hivatalos adatforrásként.<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
27
rest/views/site/error.php
Normal file
27
rest/views/site/error.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $name string */
|
||||
/* @var $message string */
|
||||
/* @var $exception Exception */
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$this->title = $name;
|
||||
?>
|
||||
<div class="site-error">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<?= nl2br(Html::encode($message)) ?>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
The above error occurred while the Web server was processing your request.
|
||||
</p>
|
||||
<p>
|
||||
Please contact us if you think this is a server error. Thank you.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
14
rest/views/site/index.php
Normal file
14
rest/views/site/index.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
|
||||
$this->title = 'My Yii Application';
|
||||
?>
|
||||
<div class="site-index">
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Web Recepció</h1>
|
||||
<p class="lead">Üdvözöljük Web Recepció oldalunkon!</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
39
rest/views/site/login.php
Normal file
39
rest/views/site/login.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $form yii\bootstrap\ActiveForm */
|
||||
/* @var $model \common\models\LoginForm */
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
|
||||
$this->title = Yii::t('common/site' ,'Login');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="site-login">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>Please fill out the following fields to login:</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
|
||||
<?= $form->field($model, 'rememberMe')->checkbox() ?>
|
||||
|
||||
<div style="color:#999;margin:1em 0">
|
||||
<?= Html::a(Yii::t('common/site' ,'Forgot password'), ['site/request-password-reset']) ?>.
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('common/site' ,'Login'), ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
2
rest/web/.gitignore
vendored
Normal file
2
rest/web/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/index.php
|
||||
/index-test.php
|
||||
91
rest/web/css/site.css
Normal file
91
rest/web/css/site.css
Normal file
@ -0,0 +1,91 @@
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
min-height: 100%;
|
||||
height: auto;
|
||||
margin: 0 auto -60px;
|
||||
padding: 0 0 60px;
|
||||
}
|
||||
|
||||
.wrap > .container {
|
||||
padding: 70px 15px 20px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
height: 60px;
|
||||
background-color: #f5f5f5;
|
||||
border-top: 1px solid #ddd;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.jumbotron {
|
||||
text-align: center;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.jumbotron .btn {
|
||||
font-size: 21px;
|
||||
padding: 14px 24px;
|
||||
}
|
||||
|
||||
.not-set {
|
||||
color: #c55;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* add sorting icons to gridview sort links */
|
||||
a.asc:after, a.desc:after {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
display: inline-block;
|
||||
font-family: 'Glyphicons Halflings';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
a.asc:after {
|
||||
content: /*"\e113"*/ "\e151";
|
||||
}
|
||||
|
||||
a.desc:after {
|
||||
content: /*"\e114"*/ "\e152";
|
||||
}
|
||||
|
||||
.sort-numerical a.asc:after {
|
||||
content: "\e153";
|
||||
}
|
||||
|
||||
.sort-numerical a.desc:after {
|
||||
content: "\e154";
|
||||
}
|
||||
|
||||
.sort-ordinal a.asc:after {
|
||||
content: "\e155";
|
||||
}
|
||||
|
||||
.sort-ordinal a.desc:after {
|
||||
content: "\e156";
|
||||
}
|
||||
|
||||
.grid-view th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hint-block {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.error-summary {
|
||||
color: #a94442;
|
||||
background: #fdf7f7;
|
||||
border-left: 3px solid #eed3d7;
|
||||
padding: 10px 20px;
|
||||
margin: 0 0 15px 0;
|
||||
}
|
||||
BIN
rest/web/favicon.ico
Normal file
BIN
rest/web/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
0
rest/web/profile/.gitkeep
Normal file
0
rest/web/profile/.gitkeep
Normal file
2
rest/web/robots.txt
Normal file
2
rest/web/robots.txt
Normal file
@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
Loading…
Reference in New Issue
Block a user