Finish version/v.0.0.90
This commit is contained in:
commit
d3df0f057d
@ -389,10 +389,18 @@ class CardController extends \backend\controllers\BackendController {
|
||||
$command = $connection->createCommand( Ticket::$SQL_UPDATE );
|
||||
$result = $command->execute();
|
||||
\Yii::info("Tickets updated: " . $result );
|
||||
|
||||
|
||||
\Yii::$app->session->setFlash('success', 'Módosított bérletek száma: ' . $result);
|
||||
|
||||
$command = $connection->createCommand( Card::$SQL_CLEARS_STATUS_DOOR );
|
||||
$result = $command->execute();
|
||||
\Yii::info("Door flag cleared: " . $result );
|
||||
|
||||
$command = $connection->createCommand( Card::$SQL_FIX_KEY_STATUS );
|
||||
$result = $command->execute();
|
||||
\Yii::info("Key flag fixed: " . $result );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $this->render("recalculate");
|
||||
|
||||
@ -144,6 +144,10 @@ class ContractController extends Controller {
|
||||
*
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
* @throws NotFoundHttpException
|
||||
* @throws \Exception
|
||||
* @throws \yii\db\Exception
|
||||
*/
|
||||
public function actionDelete($id) {
|
||||
$model = $this->findModel ( $id );
|
||||
|
||||
@ -63,7 +63,7 @@ class CardSearch extends Card
|
||||
'customer.name as customer_name' ,
|
||||
'customer.id_customer as customer_id_customer',
|
||||
'key.number as key_number',
|
||||
'card.flag as card_flag',
|
||||
'card.validity as card_validity',
|
||||
|
||||
|
||||
]);
|
||||
@ -107,7 +107,7 @@ class CardSearch extends Card
|
||||
'asc' => ['key.number' => SORT_ASC ],
|
||||
'desc' => ['key.number' => SORT_DESC],
|
||||
],
|
||||
'card_flag' => [
|
||||
'card_validity' => [
|
||||
'asc' => ['card.flag' => SORT_ASC ],
|
||||
'desc' => ['card.flag' => SORT_DESC],
|
||||
],
|
||||
|
||||
@ -69,10 +69,10 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'label' => 'Kulcs száma'
|
||||
],
|
||||
[
|
||||
'attribute' => 'card_flag',
|
||||
'attribute' => 'card_validity',
|
||||
'label' => 'Info',
|
||||
'value' => function ($model, $key, $index, $column){
|
||||
return Helper::getArrayValue(DoorLog::getCardFlagTexts(), $model['card_flag'], "Ismeretlen ok");
|
||||
return Helper::getArrayValue(DoorLog::getCardFlagTexts(), $model['card_validity'], "Ismeretlen ok");
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
-0.0.90
|
||||
- add new trigger, flag/flag_out changes changes
|
||||
- flag state page for reception
|
||||
- add today views for transfer, account_state on reception
|
||||
-0.0.89
|
||||
- fix TransferPayout overridePaymentMethod array_search returns 0 for first element
|
||||
which false false...
|
||||
|
||||
@ -12,6 +12,34 @@ use yii\i18n\Formatter;
|
||||
|
||||
class DateUtil
|
||||
{
|
||||
/**
|
||||
* Get UTC today @00:00:00 .
|
||||
* Helper method to generate date for mysql
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public static function todayStart( ){
|
||||
$d2 = new \DateTime();
|
||||
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
|
||||
$d2->setTime(0, 0, 0);
|
||||
return $d2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UTC t @00:00:00 .
|
||||
* Helper method to generate date for mysql
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public static function tomorrowStart( ){
|
||||
$d2 = new \DateTime();
|
||||
$d2->add(new \DateInterval('P1D'));
|
||||
$d2->setTimezone( new \DateTimeZone( "UTC" ) );
|
||||
$d2->setTime(0, 0, 0);
|
||||
return $d2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function addMonth($timestamp, $monthCount = 1)
|
||||
{
|
||||
@ -65,4 +93,12 @@ class DateUtil
|
||||
return $formatter->asDatetime($dateTimeObject);
|
||||
}
|
||||
|
||||
public static function formatDateUtc($dateTimeObject)
|
||||
{
|
||||
$formatter = new Formatter;
|
||||
$formatter->datetimeFormat = 'php:Y-m-d';
|
||||
$formatter->timeZone = 'UTC';
|
||||
return $formatter->asDatetime($dateTimeObject);
|
||||
}
|
||||
|
||||
}
|
||||
@ -321,6 +321,17 @@ class Helper {
|
||||
return \Yii::$app->params ['ticket_create_price_editable'] == true ;
|
||||
}
|
||||
|
||||
public static function isReceptionTransferListToday(){
|
||||
return \Yii::$app->params['reception_transfer_list_only_today'];
|
||||
}
|
||||
public static function isReceptionAccountStateIndexToday(){
|
||||
return \Yii::$app->params['reception_account_state_index_only_today'];
|
||||
}
|
||||
|
||||
public static function isReceptionTransferIndexEnabled(){
|
||||
return !Helper::isReceptionTransferListToday();
|
||||
}
|
||||
|
||||
public static function getRealUserIp() {
|
||||
$client = @$_SERVER ['HTTP_CLIENT_IP'];
|
||||
$forward = @$_SERVER ['HTTP_X_FORWARDED_FOR'];
|
||||
@ -386,6 +397,12 @@ class Helper {
|
||||
return $flag;
|
||||
}
|
||||
|
||||
public static function isBitOn($flag,$n){
|
||||
$result = +$flag & (1 << +$n) ;
|
||||
$result = $result > 0;
|
||||
return $result ;
|
||||
}
|
||||
|
||||
|
||||
public static function generateRandomString($length = 6,$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWX' ) {
|
||||
$charactersLength = strlen($characters);
|
||||
|
||||
@ -5,7 +5,7 @@ return [
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'infoEmail' => 'info@rocho-net.hu',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.0.89',
|
||||
'version' => 'v0.0.90',
|
||||
'company' => 'movar',//gyor
|
||||
'company_name' => "Freimann Kft.",
|
||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||
@ -30,6 +30,9 @@ return [
|
||||
* Hány napig láthatják visszamenőleg a recepciósok az adatokat
|
||||
* */
|
||||
'reception_visibility_days' => 3,
|
||||
'reception_account_state_index_only_today' => false,
|
||||
'reception_transfer_list_only_today' => false,
|
||||
|
||||
'backend_skin' => 'skin-red', //skin-green
|
||||
/**User cart module on/off*/
|
||||
'user_cart_on' => true,
|
||||
|
||||
@ -15,6 +15,7 @@ use common\components\Helper;
|
||||
* @property integer $flag
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
* @property int flag_out
|
||||
*/
|
||||
class Card extends \common\models\BaseFitnessActiveRecord
|
||||
{
|
||||
@ -30,7 +31,32 @@ class Card extends \common\models\BaseFitnessActiveRecord
|
||||
|
||||
|
||||
public static $FLAG_TICKET = 0;
|
||||
public static $FLAG_STATUS = 1;
|
||||
public static $FLAG_DOOR = 1;
|
||||
public static $FLAG_KEY = 2;
|
||||
public static $FLAG_STATUS = 3;
|
||||
|
||||
/**
|
||||
* This script is used in daily scripts, to clear the flag door log status
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $SQL_CLEARS_STATUS_DOOR = "
|
||||
UPDATE card set flag = ( flag & ~(1 << 1 ) ), flag_out= ( flag_out & ~(1 << 1 ) ) where card.type <> 50
|
||||
";
|
||||
|
||||
public static $SQL_FIX_KEY_STATUS = "
|
||||
update card as c1
|
||||
left join card_key_assignment k
|
||||
on k.id_card = c1.id_card
|
||||
set flag = CASE WHEN k.id_key is null then (c1.flag | 1 << 2) else ( c1.flag & ~(1 << 2 ) ) end,
|
||||
flag_out = CASE WHEN k.id_key is null then ( c1.flag_out & ~(1 << 2 )) else (c1.flag_out | 1 << 2 ) end
|
||||
WHERE c1.type <> 50
|
||||
";
|
||||
|
||||
public static $SQL_CLEARS_STATUS_DOOR_IN = "
|
||||
UPDATE card set flag = ( flag & ~(1 << 1 ) ) WHERE card.type <> 50 and card.id_card = :id
|
||||
";
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
@ -175,13 +201,17 @@ class Card extends \common\models\BaseFitnessActiveRecord
|
||||
return ;
|
||||
}
|
||||
$db = \Yii::$app->db;
|
||||
|
||||
$command = $db->createCommand(Ticket::$SQL_UPDATE_CARD,[':id' => $id]);
|
||||
$command->execute();
|
||||
|
||||
$command = $db->createCommand(Card::$SQL_CLEARS_STATUS_DOOR_IN,[':id' => $id]);
|
||||
$command->execute();
|
||||
}
|
||||
|
||||
public function beforeSave($insert) {
|
||||
if (parent::beforeSave($insert)){
|
||||
$this->flag = Helper::setBit($this->flag, Card::$FLAG_STATUS, ( $this->status != Card::STATUS_ACTIVE));
|
||||
$this->flag = Helper::setBit( $this->flag , Card::$FLAG_STATUS, ( $this->status != Card::STATUS_ACTIVE ) );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -189,7 +219,42 @@ class Card extends \common\models\BaseFitnessActiveRecord
|
||||
|
||||
|
||||
public function getFlagText(){
|
||||
return Helper::getArrayValue(DoorLog::getCardFlagTexts(), $this->flag, "Ismeretlen");
|
||||
return Helper::getArrayValue(DoorLog::getCardFlagTexts(), $this->validity, "Ismeretlen");
|
||||
}
|
||||
|
||||
public function setFlagsHasKey($hasKey){
|
||||
|
||||
$pos = Card::$FLAG_KEY;
|
||||
$this->flag = $hasKey ? ( $this->flag & ~(1 << $pos) ) : ( $this->flag | 1 << $pos );
|
||||
$this->flag_out = $hasKey ? ( $this->flag_out | 1 << $pos ) : ( $this->flag_out & ~(1 << $pos) );
|
||||
\Yii::info("flag has key: ".$this->flag .";".$this->flag_out);
|
||||
}
|
||||
|
||||
|
||||
public function isFlagValidity(){
|
||||
return Helper::isBitOn($this->flag,Card::$FLAG_TICKET);
|
||||
}
|
||||
|
||||
public function isFlagDoor(){
|
||||
return Helper::isBitOn($this->flag,Card::$FLAG_DOOR);
|
||||
}
|
||||
|
||||
public function isFlagKey(){
|
||||
return Helper::isBitOn($this->flag,Card::$FLAG_KEY);
|
||||
}
|
||||
|
||||
public function isFlagStatus(){
|
||||
return Helper::isBitOn($this->flag,Card::$FLAG_STATUS);
|
||||
}
|
||||
|
||||
public function isFlagOutDoor(){
|
||||
return Helper::isBitOn($this->flag_out,Card::$FLAG_DOOR);
|
||||
}
|
||||
|
||||
public function isFlagOutKey(){
|
||||
return Helper::isBitOn($this->flag_out,Card::$FLAG_KEY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ class DoorLog extends \yii\db\ActiveRecord
|
||||
$dlog->id_account = Account::readDefault();
|
||||
|
||||
if ( $dlog->direction == 0){
|
||||
$dlog->card_flag = $card->flag;
|
||||
$dlog->card_flag = $card->validity;
|
||||
}else{
|
||||
$dlog->card_flag = -1;
|
||||
}
|
||||
|
||||
@ -47,7 +47,8 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
order by id_card desc
|
||||
) as t
|
||||
on t.id_card = c1.id_card
|
||||
SET c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
|
||||
SET c1.validity = case when t.id_card is null then ( c1.validity | 1 << 0 ) else ( c1.validity & ~(1 << 0) ) end
|
||||
, c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
|
||||
, c1.id_ticket_current = case when t.id_ticket is null then null else t.id_ticket end
|
||||
WHERE c1.type <> 50";
|
||||
|
||||
@ -63,7 +64,8 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
order by id_card desc
|
||||
) as t
|
||||
on t.id_card = c1.id_card
|
||||
SET c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
|
||||
SET c1.validity = case when t.id_card is null then ( c1.validity | 1 << 0 ) else ( c1.validity & ~(1 << 0) ) end
|
||||
,c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
|
||||
, c1.id_ticket_current = case when t.id_ticket is null then null else t.id_ticket end
|
||||
WHERE c1.type <> 50 and c1.id_card = :id";
|
||||
|
||||
|
||||
@ -336,7 +336,7 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
TicketInstallmentRequest::$STATUS_SENT=> 'Beküldve',
|
||||
TicketInstallmentRequest::$STATUS_CANCELED=> 'Törölve',
|
||||
TicketInstallmentRequest::$STATUS_REJECTED=> 'Visszautasítva',
|
||||
TicketInstallmentRequest::$STATUS_ACCEPTED=> 'Sikeresen beszedés',
|
||||
TicketInstallmentRequest::$STATUS_ACCEPTED=> 'Sikeres beszedés',
|
||||
TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL=> 'Személyesen fizetve',
|
||||
];
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ class DoorlogController extends Controller{
|
||||
|
||||
|
||||
$card = $subject->card;
|
||||
echo "in:" . $subject->usage_count. " | out:" . $subject->count_move_out . " | max: " .$subject->max_usage_count. " | card flag: " . $card->flag ."\n";
|
||||
echo "in:" . $subject->usage_count. " | out:" . $subject->count_move_out . " | max: " .$subject->max_usage_count. " | card validity: " . $card->validity ."\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
25
console/controllers/ProductConsoleController.php
Normal file
25
console/controllers/ProductConsoleController.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace console\controllers;
|
||||
|
||||
use Yii;
|
||||
use common\models;
|
||||
use yii\console\Controller;
|
||||
use common\models\Ticket;
|
||||
use common\models\DoorLog;
|
||||
use yii\helpers\VarDumper;
|
||||
use common\models\Customer;
|
||||
use common\models\Log;
|
||||
|
||||
class ProductConsoleController extends Controller{
|
||||
|
||||
|
||||
|
||||
|
||||
public function actionIndex( )
|
||||
{
|
||||
\Yii::info("product console command");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace console\controllers;
|
||||
|
||||
use common\models\Card;
|
||||
use Yii;
|
||||
use yii\console\Controller;
|
||||
use common\models\Ticket;
|
||||
@ -16,12 +17,21 @@ use yii\helpers\Html;
|
||||
use common\models\Subscriber;
|
||||
|
||||
class TicketController extends Controller {
|
||||
|
||||
public function actionIndex() {
|
||||
$connection = \Yii::$app->db;
|
||||
$command = $connection->createCommand ( Ticket::$SQL_UPDATE );
|
||||
|
||||
$command = $connection->createCommand ( Card::$SQL_CLEARS_STATUS_DOOR );
|
||||
$result = $command->execute ();
|
||||
\Yii::info ( "Tickets updated flag door: " . $result );
|
||||
|
||||
$command = $connection->createCommand ( Ticket::$SQL_UPDATE );
|
||||
$result = $command->execute ();
|
||||
\Yii::info ( "Tickets updated: " . $result );
|
||||
echo "Tickets updated: " . $result;
|
||||
|
||||
|
||||
$command = $connection->createCommand ( Card::$SQL_FIX_KEY_STATUS );
|
||||
$result = $command->execute ();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160919_061627_alter__table__card__add__column__validity extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("card", "validity", "int default 0");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160919_061627_alter__table__card__add__column__validity cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
php /var/www/virtual/fitnessadmin.hu/htdocs/cutler/yii ticket/index
|
||||
php /var/www/virtual/fitnessadmin.hu/htdocs/cutler/yii ticket/daily
|
||||
@ -11,117 +11,127 @@ use backend\models\AccountSearch;
|
||||
use common\models\Account;
|
||||
use common\components\Helper;
|
||||
|
||||
class FrontendMenuStructure{
|
||||
class FrontendMenuStructure
|
||||
{
|
||||
|
||||
public $menuItems;
|
||||
public $start;//start date and time
|
||||
public $tomorrow;//tomorrow date and time
|
||||
public $menuItems;
|
||||
public $start;//start date and time
|
||||
public $tomorrow;//tomorrow date and time
|
||||
|
||||
public $startDate;//start date
|
||||
public $tomorrowDate;//tomorrow date
|
||||
public $yesterDay;//yesterday date
|
||||
public $startDate;//start date
|
||||
public $tomorrowDate;//tomorrow date
|
||||
public $yesterDay;//yesterday date
|
||||
|
||||
public function __construct(){
|
||||
$this->menuItems = [];
|
||||
public function __construct()
|
||||
{
|
||||
$this->menuItems = [];
|
||||
|
||||
$this->yesterDay = \Yii::$app->formatter->asDatetime( strtotime('yesterday UTC') );
|
||||
$this->start = \Yii::$app->formatter->asDatetime( strtotime('today UTC') );
|
||||
$this->tomorrow = Yii::$app->formatter->asDatetime( strtotime('tomorrow UTC') );
|
||||
$this->startDate = Yii::$app->formatter->asDate( strtotime('today UTC') );
|
||||
$this->tomorrowDate = Yii::$app->formatter->asDate( strtotime('tomorrow UTC') );
|
||||
$this->yesterDay = \Yii::$app->formatter->asDatetime(strtotime('yesterday UTC'));
|
||||
$this->start = \Yii::$app->formatter->asDatetime(strtotime('today UTC'));
|
||||
$this->tomorrow = Yii::$app->formatter->asDatetime(strtotime('tomorrow UTC'));
|
||||
$this->startDate = Yii::$app->formatter->asDate(strtotime('today UTC'));
|
||||
$this->tomorrowDate = Yii::$app->formatter->asDate(strtotime('tomorrow UTC'));
|
||||
|
||||
Yii::info("Start date is : ". $this->start);
|
||||
Yii::info("Start date is : " . $this->start);
|
||||
|
||||
|
||||
if ($this->isLogged()) {
|
||||
$lastAccountState = AccountState::find()->andWhere(['id_user' => Yii::$app->user->id])->andWhere(['type' => AccountState::TYPE_OPEN])->orderBy(['account_state.created_at' => SORT_DESC])->limit(1)->one();
|
||||
if (isset($lastAccountState)) {
|
||||
$this->start = Yii::$app->formatter->asDatetime(strtotime($lastAccountState->created_at . ' UTC'));
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->isLogged() ){
|
||||
$lastAccountState = AccountState::find()->andWhere(['id_user' => Yii::$app->user->id])->andWhere(['type' => AccountState::TYPE_OPEN ])->orderBy(['account_state.created_at' => SORT_DESC])->limit(1)->one();
|
||||
if ( isset($lastAccountState) ){
|
||||
$this->start = Yii::$app->formatter->asDatetime(strtotime( $lastAccountState->created_at . ' UTC' ));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function can($authItem){
|
||||
$result = false;
|
||||
if (\Yii::$app->user->can($authItem)) {
|
||||
$result = true;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
protected function can($authItem)
|
||||
{
|
||||
$result = false;
|
||||
if (\Yii::$app->user->can($authItem)) {
|
||||
$result = true;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
protected function isLogged(){
|
||||
return !Yii::$app->user->isGuest;
|
||||
}
|
||||
protected function isLogged()
|
||||
{
|
||||
return !Yii::$app->user->isGuest;
|
||||
}
|
||||
|
||||
|
||||
protected function addRecepcio(){
|
||||
if ( $this->isLogged() ){
|
||||
protected function addRecepcio()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
|
||||
$isadmin =Yii::$app->user->can('admin') ||Yii::$app->user->can('employee');
|
||||
$isadmin = Yii::$app->user->can('admin') || Yii::$app->user->can('employee');
|
||||
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/customer','Reception'), 'url' => ['/customer/reception'] ];
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/customer', 'Reception'), 'url' => ['/customer/reception']];
|
||||
|
||||
$items = [
|
||||
['label' => Yii::t('frontend/account-state','Default account'), 'url' => ['/account/select'] ],
|
||||
['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/index' ,'AccountstateSearch[id_account]' => Account::readDefault(), 'AccountstateSearch[start]' => $this->yesterDay] ],
|
||||
['label' => Yii::t('frontend/account-state','Open account state'), 'url' => ['/account-state/open'] ],
|
||||
['label' => Yii::t('frontend/account-state','Close account state'), 'url' => ['/account-state/close'] ],
|
||||
$items = [];
|
||||
|
||||
['label' => Yii::t('frontend/money-movement','Money movements'), 'url' => [ '/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow ] ],
|
||||
$items[] = ['label' => Yii::t('frontend/account-state', 'Default account'), 'url' => ['/account/select']];
|
||||
|
||||
];
|
||||
|
||||
if ( Helper::isCompanyMovar() ){
|
||||
$items[] = ['label' => Yii::t('frontend/transfer','Daily transfers'), 'url' => [ '/transfer/list', 'TransferListSearch[id_account]' => Account::readDefault(), 'TransferListSearch[start]' => $this->start, 'TransferListSearch[end]' => $this->tomorrow ] ];
|
||||
$items[] = ['label' => Yii::t('frontend/transfer','Sales detailed'), 'url' => [ '/transfer/sale', 'TransferSaleSearch[id_user]' =>\Yii::$app->user->id, 'TransferSaleSearch[id_account]' => Account::readDefault(), 'TransferSaleSearch[start]' => $this->start, 'TransferSaleSearch[end]' => $this->tomorrow ] ];
|
||||
$items[] = ['label' => Yii::t('frontend/transfer','Ticket sale detailed'), 'url' => [ '/transfer/tickets','TransferTicketSearch[id_user]' =>\Yii::$app->user->id, 'TransferTicketSearch[id_account]' => Account::readDefault(), 'TransferTicketSearch[start]' => $this->start, 'TransferTicketSearch[end]' => $this->tomorrow ] ];
|
||||
}
|
||||
if ( Helper::isReceptionAccountStateIndexToday() ){
|
||||
$items[] = ['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/today' ]];
|
||||
}else{
|
||||
$items[] = ['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/index', 'AccountstateSearch[id_account]' => Account::readDefault(), 'AccountstateSearch[start]' => $this->yesterDay]];
|
||||
}
|
||||
|
||||
// if ( $isadmin || Yii::$app->user->can('reception.transfers') ){
|
||||
$items[] = ['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[id_user]' =>\Yii::$app->user->id, 'TransferSearch[id_account]' => Account::readDefault(), 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ];
|
||||
//$items[] = ['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ];
|
||||
// }
|
||||
$items[] = ['label' => Yii::t('frontend/account-state', 'Open account state'), 'url' => ['/account-state/open']];
|
||||
$items[] = ['label' => Yii::t('frontend/account-state', 'Close account state'), 'url' => ['/account-state/close']];
|
||||
$items[] = ['label' => Yii::t('frontend/money-movement', 'Money movements'), 'url' => ['/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow]];
|
||||
|
||||
$items[] = ['label' => Yii::t('frontend/card','Vendégek'), 'url' => [ '/card/index' ] ];
|
||||
|
||||
if (Helper::isCompanyMovar()) {
|
||||
$items[] = ['label' => Yii::t('frontend/transfer', 'Daily transfers'), 'url' => ['/transfer/list', 'TransferListSearch[id_account]' => Account::readDefault(), 'TransferListSearch[start]' => $this->start, 'TransferListSearch[end]' => $this->tomorrow]];
|
||||
$items[] = ['label' => Yii::t('frontend/transfer', 'Sales detailed'), 'url' => ['/transfer/sale', 'TransferSaleSearch[id_user]' => \Yii::$app->user->id, 'TransferSaleSearch[id_account]' => Account::readDefault(), 'TransferSaleSearch[start]' => $this->start, 'TransferSaleSearch[end]' => $this->tomorrow]];
|
||||
$items[] = ['label' => Yii::t('frontend/transfer', 'Ticket sale detailed'), 'url' => ['/transfer/tickets', 'TransferTicketSearch[id_user]' => \Yii::$app->user->id, 'TransferTicketSearch[id_account]' => Account::readDefault(), 'TransferTicketSearch[start]' => $this->start, 'TransferTicketSearch[end]' => $this->tomorrow]];
|
||||
}
|
||||
|
||||
if ( Helper::isReceptionTransferListToday()){
|
||||
$items[] = ['label' => Yii::t('frontend/transfer', 'Transfers'), 'url' => ['/transfer/today', ]];
|
||||
}else{
|
||||
$items[] = ['label' => Yii::t('frontend/transfer', 'Transfers'), 'url' => ['/transfer/index', 'TransferSearch[id_user]' => \Yii::$app->user->id, 'TransferSearch[id_account]' => Account::readDefault(), 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow]];
|
||||
}
|
||||
|
||||
$items[] = ['label' => Yii::t('frontend/card', 'Vendégek'), 'url' => ['/card/index']];
|
||||
// $items[] = ['label' => Yii::t('frontend/card','Leltár'), 'url' => [ '/product/inventory' ] ];
|
||||
// $items[] = ['label' => Yii::t('frontend/card','Leltár'), 'url' => [ '/inventory/index' ] ];
|
||||
|
||||
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
|
||||
'items' => $items
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
|
||||
'items' => $items
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
protected function addLoginMainMenu()
|
||||
{
|
||||
if (Yii::$app->user->isGuest) {
|
||||
$mainMenuItem = ['label' => Yii::t('frontend/site', 'Login'), 'url' => ['/site/login']];
|
||||
} else {
|
||||
$mainMenuItem = [
|
||||
'label' => Yii::t('frontend/transfer', 'Logout') . '(' . Yii::$app->user->identity->username . ')',
|
||||
'url' => ['/site/logout'],
|
||||
'linkOptions' => ['data-method' => 'post']
|
||||
];
|
||||
}
|
||||
$this->menuItems[] = $mainMenuItem;
|
||||
}
|
||||
|
||||
|
||||
protected function addLoginMainMenu(){
|
||||
if (Yii::$app->user->isGuest) {
|
||||
$mainMenuItem= ['label' => Yii::t('frontend/site','Login'), 'url' => ['/site/login']];
|
||||
} else {
|
||||
$mainMenuItem= [
|
||||
'label' => Yii::t('frontend/transfer','Logout'). '(' . Yii::$app->user->identity->username . ')',
|
||||
'url' => ['/site/logout'],
|
||||
'linkOptions' => ['data-method' => 'post']
|
||||
];
|
||||
}
|
||||
$this->menuItems[] = $mainMenuItem;
|
||||
}
|
||||
|
||||
|
||||
public function run(){
|
||||
$this->addRecepcio();
|
||||
$this->addLoginMainMenu();
|
||||
return $this->menuItems;
|
||||
}
|
||||
public function run()
|
||||
{
|
||||
$this->addRecepcio();
|
||||
$this->addLoginMainMenu();
|
||||
return $this->menuItems;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -2,12 +2,13 @@
|
||||
|
||||
namespace frontend\controllers;
|
||||
|
||||
use common\components\DateUtil;
|
||||
use frontend\models\AccountstateSearchToday;
|
||||
use Yii;
|
||||
use common\models\AccountState;
|
||||
use frontend\models\AccountstateSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use common\models\Account;
|
||||
use common\components\DailyListing;
|
||||
use common\models\User;
|
||||
@ -46,12 +47,17 @@ class AccountStateController extends Controller {
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all AccountState models.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
/**
|
||||
* Lists all AccountState models.
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionIndex() {
|
||||
|
||||
if ( Helper::isReceptionAccountStateIndexToday()){
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
$searchModel = new AccountstateSearch ();
|
||||
|
||||
$searchModel->accounts = Account::read ();
|
||||
@ -65,6 +71,23 @@ class AccountStateController extends Controller {
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all AccountState models.
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionToday() {
|
||||
|
||||
$searchModel = new AccountstateSearchToday();
|
||||
|
||||
$dataProvider = $searchModel->search ( Yii::$app->request->queryParams );
|
||||
|
||||
return $this->render ( 'today', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new AccountState model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
@ -92,9 +115,14 @@ class AccountStateController extends Controller {
|
||||
$mail->sednMail();
|
||||
}
|
||||
|
||||
$redirectTo = 'index';
|
||||
|
||||
if ( Helper::isReceptionAccountStateIndexToday() ){
|
||||
$redirectTo = 'today';
|
||||
}
|
||||
|
||||
return $this->redirect ( [
|
||||
'index'
|
||||
$redirectTo
|
||||
] );
|
||||
} else {
|
||||
|
||||
@ -140,8 +168,15 @@ class AccountStateController extends Controller {
|
||||
$mail->sednMail();
|
||||
}
|
||||
|
||||
$redirectTo = 'index';
|
||||
|
||||
if ( Helper::isReceptionAccountStateIndexToday() ){
|
||||
$redirectTo = 'today';
|
||||
}
|
||||
|
||||
|
||||
return $this->redirect ( [
|
||||
'index'
|
||||
$redirectTo
|
||||
] );
|
||||
// return $this->redirect(['view', 'id' => $model->id_account_state]);
|
||||
} else {
|
||||
@ -179,7 +214,14 @@ class AccountStateController extends Controller {
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id) {
|
||||
if (($model = AccountState::findOne ( $id )) !== null) {
|
||||
$query = AccountState::find();
|
||||
$query->andWhere(['id_account_state'=> $id]);
|
||||
if ( Helper::isReceptionAccountStateIndexToday()){
|
||||
$query->andWhere(['id_user'=>\Yii::$app->user->id]);
|
||||
$query->andWhere(['>=','account_state.created_at', DateUtil::formatDateUtc(DateUtil::todayStart()) ]);
|
||||
}
|
||||
$model = $query->one();
|
||||
if ( $model !== null ) {
|
||||
return $model;
|
||||
} else {
|
||||
throw new NotFoundHttpException ( 'The requested page does not exist.' );
|
||||
@ -256,7 +298,7 @@ class AccountStateController extends Controller {
|
||||
$details = null;
|
||||
if ($accountState->isTypeClose ()) {
|
||||
|
||||
$prev;
|
||||
$prev = null;
|
||||
if ($accountState->type == AccountState::TYPE_CLOSE) {
|
||||
if (isset ( $accountState->prev_state )) {
|
||||
$prev = AccountState::findOne ( $accountState->prev_state );
|
||||
@ -311,7 +353,7 @@ class AccountStateController extends Controller {
|
||||
|
||||
if ($accountState->isTypeClose ()) {
|
||||
|
||||
$prev;
|
||||
$prev = null;
|
||||
if ($accountState->type == AccountState::TYPE_CLOSE) {
|
||||
if (isset ( $accountState->prev_state )) {
|
||||
$prev = AccountState::findOne ( $accountState->prev_state );
|
||||
|
||||
@ -91,6 +91,14 @@ class CardController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionInfo($id_card){
|
||||
|
||||
$card = $this->findModel($id_card);
|
||||
|
||||
|
||||
return $this->render("info",['card' => $card]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -143,12 +143,14 @@ class CustomerController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing Customer model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
/**
|
||||
* Updates an existing Customer model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param null $number
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
* @internal param int $id
|
||||
*/
|
||||
public function actionUpdate($number = null)
|
||||
{
|
||||
$card = null;
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace frontend\controllers;
|
||||
|
||||
use frontend\models\TransferSearchToday;
|
||||
use Yii;
|
||||
use common\models\Transfer;
|
||||
use frontend\models\TransferSearch;
|
||||
@ -71,12 +72,18 @@ class TransferController extends Controller
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Transfer models.
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
if ( !Helper::isReceptionTransferIndexEnabled()){
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
$searchModel = new TransferSearch();
|
||||
$searchModel->accounts = Account::read();
|
||||
$searchModel->load(Yii::$app->request->queryParams);
|
||||
@ -90,6 +97,27 @@ class TransferController extends Controller
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Transfer models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionToday()
|
||||
{
|
||||
$searchModel = new TransferSearchToday();
|
||||
$searchModel->id_account = Account::readDefault();
|
||||
$searchModel->load(Yii::$app->request->queryParams);
|
||||
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
//$searchModel->totalsTransfers(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('today', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
85
frontend/models/AccountstateSearchToday.php
Normal file
85
frontend/models/AccountstateSearchToday.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\models;
|
||||
|
||||
use common\components\DateUtil;
|
||||
use common\models\Account;
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\AccountState;
|
||||
use common\components\Helper;
|
||||
|
||||
/**
|
||||
* AccountstateSearch represents the model behind the search form about `common\models\AccountState`.
|
||||
*/
|
||||
class AccountstateSearchToday extends AccountState
|
||||
{
|
||||
|
||||
public $start;
|
||||
public $end;
|
||||
|
||||
public $timestampStart;
|
||||
public $timestampEnd;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = AccountState::find();
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
'sort' => false
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
$query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
|
||||
$query->innerJoinWith('account');
|
||||
$query->innerJoinWith('account.userAccountAssignments');
|
||||
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id]);
|
||||
$query->andWhere([
|
||||
'account_state.id_user' => \Yii::$app->user->id,
|
||||
'account_state.id_account' => Account::readDefault()
|
||||
]);
|
||||
|
||||
$query->andWhere( [ '>=','account_state.created_at', DateUtil::formatDateUtc( DateUtil::todayStart() ) ] );
|
||||
|
||||
$query->orderBy( 'account_state.created_at desc' );
|
||||
|
||||
$query->limit = 20;
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,9 @@ use common\models\Card;
|
||||
/**
|
||||
* ContactForm is the model behind the contact form.
|
||||
*
|
||||
* @property \common\models\Card $card
|
||||
* @property \common\models\Key $key
|
||||
*
|
||||
*/
|
||||
class KeyToggleForm extends Model
|
||||
{
|
||||
@ -97,6 +100,9 @@ class KeyToggleForm extends Model
|
||||
$assignment->save(false);
|
||||
\Yii::$app->session->setFlash ( 'success', 'Kulcs kiadva!' );
|
||||
|
||||
$this->card->setFlagsHasKey(true);
|
||||
$this->card->save(false);
|
||||
|
||||
Log::log([
|
||||
'type' =>Log::$TYPE_KEY_ASSIGN,
|
||||
'message' => 'Kulcs kiadás - Kártya/Kulcs/Vendég:' .$this->card->number ."/" .$this->keyModel->number . "/".$this->customer->name,
|
||||
@ -113,6 +119,8 @@ class KeyToggleForm extends Model
|
||||
|
||||
public function unassign(){
|
||||
CardKeyAssignment::deleteAll(['id_key' => $this->keyModel->id_key]);
|
||||
$this->card->setFlagsHasKey(false);
|
||||
$this->card->save(false);
|
||||
\Yii::$app->session->setFlash ( 'success', 'Kulcs visszaadva!' );
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ class ReceptionForm extends Model
|
||||
|
||||
$dlog->id_account = Account::readDefault();
|
||||
|
||||
$dlog->card_flag = $this->card->flag;
|
||||
$dlog->card_flag = $this->card->validity;
|
||||
|
||||
$dlog->created_at = date('Y-m-d H:i:s');
|
||||
$dlog->save(false);
|
||||
|
||||
117
frontend/models/TransferSearchToday.php
Normal file
117
frontend/models/TransferSearchToday.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\models;
|
||||
|
||||
use common\components\DateUtil;
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\Transfer;
|
||||
use yii\base\Object;
|
||||
use yii\db\Query;
|
||||
use yii\db\Expression;
|
||||
use common\models\Account;
|
||||
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\components\Helper;
|
||||
use yii\web\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* TransferSearch represents the model behind the search form about `common\models\Transfer`.
|
||||
*/
|
||||
class TransferSearchToday extends Transfer
|
||||
{
|
||||
|
||||
|
||||
|
||||
public $totals;
|
||||
|
||||
public $accounts;
|
||||
|
||||
public $types;
|
||||
|
||||
public $timestampStart;
|
||||
|
||||
public $timestampEnd;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
['types', 'each', 'rule' => ['integer']],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
* @return ActiveDataProvider
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
|
||||
if ( !isset( $this->id_account ) ){
|
||||
throw new NotFoundHttpException("Kassza nem található");
|
||||
}
|
||||
|
||||
|
||||
$this->timestampStart = DateUtil::formatDateUtc( DateUtil::todayStart() ) ;
|
||||
$this->timestampEnd = DateUtil::formatDateUtc( DateUtil::tomorrowStart() );
|
||||
$query = Transfer::find();
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
$this->load($params);
|
||||
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
$query->where('0=1');
|
||||
}
|
||||
$query->andWhere( ['or',['id_user' => Yii::$app->user->id ] , ['paid_by' => Yii::$app->user->id],] );
|
||||
$query->andWhere(['transfer.id_account' => $this->id_account]);
|
||||
|
||||
$query->andFilterWhere([
|
||||
'type' => $this->type,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['in' ,'type', $this->types]);
|
||||
|
||||
$created_condition = ['and',[ '>=', 'transfer.created_at', $this->timestampStart ] ,[ '<', 'transfer.created_at', $this->timestampEnd ] ];
|
||||
$paid_condition = ['and',[ '>=', 'transfer.paid_at', $this->timestampStart ] ,[ '<', 'transfer.paid_at', $this->timestampEnd ] ];
|
||||
|
||||
$query->andFilterWhere(['or' , $created_condition , $paid_condition]);
|
||||
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
public function totalsTransfers($params){
|
||||
$accountTotals = [];
|
||||
$fullTotal = [
|
||||
'label' => Yii::t('common/transfer', 'Total'),
|
||||
'money' => 0
|
||||
];
|
||||
|
||||
|
||||
$accounts = Account::find()->orderBy("name asc")->all();
|
||||
$accountMap = ArrayHelper::map( $accounts ,'id_account','name' );
|
||||
$idUser = Yii::$app->user->id;
|
||||
|
||||
|
||||
$this->totals = Transfer::mkTotals($this->timestampStart, $this->timestampEnd, $idUser, $this->types, $this->id_account, $accounts, $accountMap);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
64
frontend/views/account-state/_search_today.php
Normal file
64
frontend/views/account-state/_search_today.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use kartik\widgets\DateTimePicker;
|
||||
use frontend\components\HtmlHelper;
|
||||
use common\models\AccountState;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\models\AccountstateSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
<?php
|
||||
$accountOptions = ['' =>'Mind']+ HtmlHelper::mkAccountOptions( $model->accounts );
|
||||
$userOptions = ['' => 'Mind'] + HtmlHelper::mkOptions($model->users,'id','username');
|
||||
$typeOptions = ['' => 'Mind'] + AccountState::types();
|
||||
?>
|
||||
<div class="account-state-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['today'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'type')->dropDownList($typeOptions) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label('Időszak kezdete') ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label("Időszak vége") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('frontend/account-state', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
37
frontend/views/account-state/today.php
Normal file
37
frontend/views/account-state/today.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\ListView;
|
||||
use yii\base\Widget;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\models\AccountstateSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('frontend/account-state', 'Account States');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<style>
|
||||
.notes-view table thead th,
|
||||
.notes-view table td{
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
<div class="account-state-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search_today', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('frontend/account-state', 'Open Account State'), ['open'], ['class' => 'btn btn-success']) ?>
|
||||
<?= Html::a(Yii::t('frontend/account-state', 'Close Account State'), ['close'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?php echo ListView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'itemView' => '_item_view'
|
||||
])?>
|
||||
|
||||
</div>
|
||||
@ -24,7 +24,11 @@ if ( $model ->type == AccountState::TYPE_OPEN ){
|
||||
}else{
|
||||
$this->title = "Kassza zárás";
|
||||
}
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
|
||||
if ( \common\components\Helper::isReceptionAccountStateIndexToday()){
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['today']];
|
||||
}else{
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
|
||||
}
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
|
||||
69
frontend/views/card/info.php
Normal file
69
frontend/views/card/info.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use frontend\components\CustomerTabWidget;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $card \common\models\Card */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = "Kártya info";
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<?php echo CustomerTabWidget::widget(['card' => $card]) ?>
|
||||
|
||||
|
||||
<h2>Belépés jelző</h2>
|
||||
<ul>
|
||||
<li>Bérlet:
|
||||
<?php if ($card->isFlagValidity()) {
|
||||
echo Html::tag("span", "Nincs (Bérletet kell venni) - Nem OK", ['class' => 'text-danger']);
|
||||
} else {
|
||||
echo Html::tag("span", "Van - OK", ['class' => 'text-success']);
|
||||
} ?>
|
||||
</li>
|
||||
<li>Vendég tartózkodás jelző
|
||||
<?php if ($card->isFlagDoor()) {
|
||||
echo Html::tag("span", "Nem léphet be (már bennt van, vagy a bérlet típus nem enged több belépést)", ['class' => 'text-danger']);
|
||||
} else {
|
||||
echo Html::tag("span", "Beléphet - OK", ['class' => 'text-success']);
|
||||
} ?>
|
||||
<p class="small">Ez az adat jelzi, hogy a vendég az adott napon már belépett -e a terembe vagy sem. <br>
|
||||
Ha a vendégnek pl 10 alkalmas bérlete van, akkor egy nap többször is beléphet.
|
||||
Viszont ha korlátlan belépési számú bérlete van (pl: havi bérlet ), akkor naponta csak egyszer léphet be.
|
||||
</p>
|
||||
</li>
|
||||
<li>Kulcs feltétel:
|
||||
<?php if ($card->isFlagKey()) {
|
||||
echo Html::tag("span", "Nincs kulcs ( Kulcsot kell kérni)", ['class' => 'text-danger']);
|
||||
} else {
|
||||
echo Html::tag("span", "Van kulcs - OK", ['class' => 'text-success']);
|
||||
} ?>
|
||||
</li>
|
||||
<li>Kártya státusza:
|
||||
<?php if ($card->isFlagStatus()) {
|
||||
echo Html::tag("span", "Kártya tiltva - Nem OK", ['class' => 'text-danger']);
|
||||
} else {
|
||||
echo Html::tag("span", "Kártya nincs tiltva - OK", ['class' => 'text-success']);
|
||||
} ?>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<h2>Kilépés jelző</h2>
|
||||
<ul>
|
||||
<li>Vendég tartózkodás jelző:
|
||||
<?php if ($card->isFlagOutDoor()) {
|
||||
echo Html::tag("span", "Nem léphet ki (rendszer szerint nincs a teremben) - Nem OK", ['class' => 'text-danger']);
|
||||
} else {
|
||||
echo Html::tag("span", "Kiléphet - OK", ['class' => 'text-success']);
|
||||
} ?>
|
||||
</li>
|
||||
<li>Kulcs jelző:
|
||||
<?php if ($card->isFlagOutKey()) {
|
||||
echo Html::tag("span", "Van kulcs (le kell adni) - Nem OK", ['class' => 'text-danger']);
|
||||
} else {
|
||||
echo Html::tag("span", "Nincs kulcs - OK", ['class' => 'text-success']);
|
||||
} ?>
|
||||
</li>
|
||||
</ul>
|
||||
@ -21,6 +21,7 @@ $items = [
|
||||
[ 'Kulcsok', ['key/index', 'id_card' => $card->id_card] ],
|
||||
[ 'Szerződések', ['contract/index', 'id_card' => $card->id_card ]],
|
||||
[ 'Kosár', ['transfer/customer-cart', 'id_card' => $card->id_card ]],
|
||||
[ 'Kártya', ['card/info', 'id_card' => $card->id_card ]],
|
||||
];
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
use yii\base\Object;
|
||||
use common\models\Ticket;
|
||||
use frontend\model\ReceptionForm;
|
||||
use \frontend\models\ReceptionForm;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use common\models\Contract;
|
||||
@ -10,7 +10,7 @@ use common\models\Card;
|
||||
use common\models\DoorLog;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\model\ReceptionForm */
|
||||
/* @var $model \frontend\models\ReceptionForm */
|
||||
?>
|
||||
<style>
|
||||
</style>
|
||||
@ -22,7 +22,7 @@ if ( count($model->tickets) > 0 ){
|
||||
|
||||
if ( isset($model->card)){
|
||||
if ( isset($model->customer)){
|
||||
if ( $model->card->flag == 0 ){
|
||||
if ( $model->card->validity == 0 ){
|
||||
if ( isset($ticket)){
|
||||
echo Html::beginTag("div",['class'=>"alert alert-success" , "role"=>"alert"]);
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
@ -53,7 +53,7 @@ if ( isset($model->card)){
|
||||
echo "Kártya korlátozás:";
|
||||
echo "<br>";
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo Helper::getArrayValue(DoorLog::getCardFlagTexts(), $model->card->flag, "Ismeretlen ok") ;
|
||||
echo Helper::getArrayValue(DoorLog::getCardFlagTexts(), $model->card->validity, "Ismeretlen ok") ;
|
||||
echo Html::endTag("strong");
|
||||
echo Html::endTag("div");
|
||||
}
|
||||
|
||||
36
frontend/views/transfer/_search_today.php
Normal file
36
frontend/views/transfer/_search_today.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use kartik\widgets\DatePicker;
|
||||
use frontend\components\HtmlHelper;
|
||||
use common\models\Transfer;
|
||||
use kartik\widgets\DateTimePicker;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TransferSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
|
||||
<div class="transfer-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['today'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?php echo $form->field($model, 'types')->checkboxList( Transfer::types()) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
32
frontend/views/transfer/today.php
Normal file
32
frontend/views/transfer/today.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\ListView;
|
||||
use yii\base\Widget;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel common\models\TransferSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
$this->title = Yii::t('frontend/transfer', 'Transfers');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<style>
|
||||
.dl-transfer{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.item-transfer{
|
||||
border: 1px solid #b4b4b4;
|
||||
margin-top: 12px;
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
</style>
|
||||
<div class="transfer-index">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php echo $this->render('_search_today', ['model' => $searchModel]); ?>
|
||||
<?php echo ListView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'itemView' => '_view' ,
|
||||
'itemOptions' => ['class' => 'item-transfer']
|
||||
] )
|
||||
?>
|
||||
</div>
|
||||
179
trigger_door_log_flag_out.sql
Normal file
179
trigger_door_log_flag_out.sql
Normal file
@ -0,0 +1,179 @@
|
||||
DROP TRIGGER IF EXISTS trigger_inc_ticket_usage_count;
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER trigger_inc_ticket_usage_count
|
||||
AFTER INSERT ON `door_log` FOR EACH ROW
|
||||
begin
|
||||
/*DECLARE p_usage_count Integer;*/
|
||||
DECLARE p_count_all Integer;
|
||||
DECLARE p_count_all_2 Integer;
|
||||
DECLARE p_from DATETIME;
|
||||
DECLARE p_usage_count Integer;
|
||||
DECLARE p_max_usage_count Integer;
|
||||
DECLARE p_mo_ticket_id Integer; -- ticket id at moving out
|
||||
DECLARE p_mo_ticket_max_usage_count Integer; -- ticket max usage count at moving out
|
||||
DECLARE p_allow_multiple_enter boolean; -- flag, if we allow multiple enter per day
|
||||
DECLARE p_allow_enter boolean;
|
||||
-- fejlesztői log törlése
|
||||
delete from devlog;
|
||||
|
||||
/*van vendég és kártya*/
|
||||
IF NEW.id_customer is not null and NEW.id_card is not null
|
||||
THEN
|
||||
-- BEMOZÁG folyamatban - érvényes bérlettel
|
||||
IF (NEW.direction = 7 or New.direction = 3 ) and NEW.id_ticket_current is not null
|
||||
then
|
||||
INSERT INTO devlog ( msg) values('belepes feldoglozas indit');
|
||||
/*Mai belépések számának betöltése */
|
||||
select count(*) into @p_count_all from door_log where created_at >= CURDATE() and id_ticket_current = New.id_ticket_current and ( direction = 7 or direction = 3);
|
||||
INSERT INTO devlog ( msg) values( concat( 'count all' ,@p_count_all ) );
|
||||
|
||||
/*Ha a main napon ez az első belépés*/
|
||||
IF @p_count_all = 1
|
||||
THEN
|
||||
/*Beolvasás usage_count és max_usage_count */
|
||||
select usage_count, max_usage_count into @p_usage_count ,@p_max_usage_count from ticket where id_ticket = NEW.id_ticket_current;
|
||||
|
||||
/*Növeljük a usage count-ot a bérleten*/
|
||||
update ticket set usage_count = usage_count +1 where id_ticket = NEW.id_ticket_current;
|
||||
|
||||
/*Log írása*/
|
||||
INSERT INTO log (type,message, app, id_ticket, id_door_log,created_at, updated_at)
|
||||
values(
|
||||
30, concat('Bérlet használat (elotte: ',@p_usage_count, ' > utana: ' , @p_usage_count +1 , ' max: ', @p_max_usage_count, ')' ), ' trigger_inc_ticket',New.id_ticket_current, New.id_door_log,now(),now());
|
||||
else
|
||||
/*
|
||||
Innentől kezdve biztos, hogy nem ez az első belépés az aktuális napon.
|
||||
Ki kell számolnunk hányadik 3 órás intervallumban vagyunk az első belépéstől számítva.
|
||||
Pl. ha 06:00 kor volt az első belépés, akkor 07: 30 még nem von le újabb használatot,
|
||||
de a 09:00 már igen
|
||||
|
||||
( HOUR( TIMEDIFF( min(created_at) , now() ) ) /3 ) -> napi első b
|
||||
*/
|
||||
select min(created_at) + INTERVAL (3 * FLOOR( ( ( HOUR( TIMEDIFF( min(created_at) , now() ) ) /3 ) ) ) ) hour as last_date
|
||||
into @p_from
|
||||
from door_log
|
||||
where created_at > CURDATE() and id_customer is not null and id_ticket_current = NEW.id_ticket_current and ( direction = 7 or direction = 3);
|
||||
|
||||
-- Belépések számának betöltése az aktuális 3 órás intervalumban
|
||||
select count(*) into @p_count_all_2 from door_log where created_at >= @p_from and id_ticket_current = New.id_ticket_current and ( direction = 7 or direction = 3);
|
||||
|
||||
INSERT INTO devlog ( msg) values(CONCAT( 'Belépések száma az aktuális 3 órás intervalumban: ', @p_count_all_2) );
|
||||
|
||||
-- Ha az első belépéstől számítot aktuális 3 órás intervallumban ez az elős belépés, akkor növeljük a használatot
|
||||
IF @p_count_all_2 = 1
|
||||
THEN
|
||||
INSERT INTO devlog ( msg) values( 'Az aktuális intervallumban ez az első belépés, usage_count növelése' );
|
||||
-- A bérlet usage_count és max_usage_count betöltése
|
||||
select usage_count, max_usage_count into @p_usage_count ,@p_max_usage_count from ticket where id_ticket = NEW.id_ticket_current;
|
||||
-- A bérlet usage_count növelése
|
||||
update ticket set usage_count = usage_count +1 where id_ticket = New.id_ticket_current;
|
||||
-- log írása
|
||||
INSERT INTO log (type,message, app, id_ticket, id_door_log,created_at, updated_at)
|
||||
values(
|
||||
40, concat('Bérlet használat/egy nap tobbszori (elotte: ',@p_usage_count, ' > utana: ' , @p_usage_count +1 , ' max: ', @p_max_usage_count, ')' ), ' trigger_inc_ticket',New.id_ticket_current, New.id_door_log,now(),now());
|
||||
END IF; -- end @p_count_all_2 = 1
|
||||
END IF; -- @p_count_all > 1
|
||||
End IF; -- vége bemozgás érvényes bérlettel end type == 7 or 3 ( move in )
|
||||
|
||||
-- KILÉPÉS -- count_move_out beállítása usage_count-ra
|
||||
IF NEW.direction = 5 or New.direction = 1 -- type move out
|
||||
then
|
||||
INSERT INTO devlog ( msg) values('Kilépés van folyamatban, kilépések számának beállítása');
|
||||
update ticket set count_move_out = usage_count where id_ticket = NEW.id_ticket_current;
|
||||
END IF; -- end type move out
|
||||
|
||||
INSERT INTO devlog ( msg) values( 'Kártya validáció módosítása' );
|
||||
-- KÁRTYA VALIDÁCIÓ - validity [0|1] , flag | 1 << [0|1]
|
||||
UPDATE card as c1
|
||||
left JOIN ( select ticket.id_card as id_card , max(ticket.id_ticket) as id_ticket
|
||||
from ticket
|
||||
where ticket.start <= CURDATE()
|
||||
and ticket.end >= curdate()
|
||||
and ticket.status = 10
|
||||
and ticket.count_move_out < ticket.max_usage_count
|
||||
and ticket.id_card = New.id_card
|
||||
group by id_card
|
||||
order by id_card desc ) as t
|
||||
on t.id_card = c1.id_card
|
||||
SET c1.validity = case when t.id_card is null then ( c1.validity | 1 << 0 ) else ( c1.validity & ~(1 << 0) ) end
|
||||
, c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
|
||||
, c1.id_ticket_current = case when t.id_ticket is null then null else t.id_ticket end
|
||||
WHERE c1.type <> 50 and c1.id_card = New.id_card;
|
||||
|
||||
|
||||
-- KILÉPÉS van folyamatban - kilépés flag_out kikapcsolása, belépés flag bekapcsolása , ha van érvényes bérlet
|
||||
IF NEW.direction = 5 or New.direction = 1 -- type move out
|
||||
then
|
||||
|
||||
-- AKTUÁLIS ÉRVÉNYES BÉRLET AZONOSÍTÓ BETÖLTÉSE
|
||||
-- meg kell néznünk, hogy engedélyezett -e a napi többszöri belépés
|
||||
-- ezt a aktuális bérlet max_usage_count mezője állapítja meg
|
||||
select max(ticket.id_ticket) into @p_mo_ticket_id
|
||||
from ticket
|
||||
where ticket.start <= CURDATE()
|
||||
and ticket.end >= curdate()
|
||||
and ticket.status = 10
|
||||
and ticket.count_move_out < ticket.max_usage_count
|
||||
and ticket.id_card = New.id_card
|
||||
group by id_card
|
||||
order by id_card desc;
|
||||
|
||||
-- alapertelmezesben a belépés engedélyezve van
|
||||
set @p_allow_enter = true;
|
||||
|
||||
|
||||
/*
|
||||
-- NAPI TÖBSZÖRI BELÉPÉS FIGYELÉSE ITT - CSAK MÉSGEM KELLETT
|
||||
|
||||
set @p_allow_multiple_enter = true;
|
||||
|
||||
set @p_count_all = 0;
|
||||
set @p_mo_ticket_max_usage_count = 9999;
|
||||
IF @p_mo_ticket_id IS NOT NULL
|
||||
THEN
|
||||
select max_usage_count into @p_mo_ticket_max_usage_count from ticket where id_ticket = @p_mo_ticket_id;
|
||||
|
||||
select coalesce(count(*),0) into @p_count_all from door_log where created_at >= CURDATE() and id_ticket_current = @p_mo_ticket_id and ( direction = 7 or direction = 3);
|
||||
|
||||
IF @p_mo_ticket_max_usage_count > 30 THEN
|
||||
set @p_allow_multiple_enter = false;
|
||||
END IF; -- end allow mulitple enter
|
||||
else
|
||||
set @p_allow_multiple_enter = true;
|
||||
END IF; -- END TICKET IS THERE
|
||||
|
||||
-- Ha nincs engedélyezve a napi többszöri belépés, és már egyszer beléptünk
|
||||
-- akkor további belépés nem lesz lehetséges
|
||||
IF @p_allow_multiple_enter = false AND @p_count_all >= 1
|
||||
THEN
|
||||
set @p_allow_enter = false;
|
||||
END IF;
|
||||
*/
|
||||
|
||||
INSERT INTO devlog ( msg) values( concat( 'Kilépés: Aktuális bérlet/belépések száma/többszire belépés on/belépés on: '
|
||||
, coalesce(@p_mo_ticket_id,''),'/', coalesce(@p_count_all,'') , '/', coalesce(@p_allow_multiple_enter,''),'/', coalesce(@p_allow_enter,'' ) ) );
|
||||
|
||||
update card set
|
||||
flag_out = ( flag_out | 1 << 1 ) , -- nem léphet ki ( 1. bit beállíátsa 1-re )
|
||||
flag = case when @p_allow_enter then ( flag & ~(1 << 1) ) else ( flag | 1 << 1 ) end
|
||||
WHERE type <> 50 and id_card = New.id_card;
|
||||
|
||||
END IF;
|
||||
|
||||
-- BELÉPÉS van folyamatban - kilépés flag_out bekapcsolása, belépés flag kikapcsolása
|
||||
IF (NEW.direction = 7 or New.direction = 3 ) and NEW.id_ticket_current is not null
|
||||
THEN
|
||||
INSERT INTO devlog ( msg) values( 'kilépés flag_out bekapcsolása, belépés flag kikapcsolása' );
|
||||
update card set
|
||||
flag_out = ( flag_out & ~(1 << 1 ) ) , -- kilpés engedélyezése ( 1. bit beállítása 0-ra )
|
||||
flag = ( flag | 1 << 1 ) -- belépés nem lehetséges ( 1.bit beállítsa 1-re )
|
||||
WHERE type <> 50 and id_card = New.id_card;
|
||||
END IF; -- END - BELÉPÉS - KILÉPÉS KAPCSOLÓ BEKPACSOLÁSA
|
||||
|
||||
END IF; -- VAN VENDÉG , VAN KÁRTYA
|
||||
END;
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user