merge app api

This commit is contained in:
Schneider Roland
2023-01-19 17:43:10 +01:00
570 changed files with 81491 additions and 1263 deletions

View File

@@ -1,5 +1,5 @@
<?php
use yii\base\Object;
use yii\base\BaseObject;
use common\models\Ticket;
?>
<style>
@@ -38,4 +38,4 @@ use common\models\Ticket;
<?php }?>
</table>
</div>
</div>

View File

@@ -1,57 +1,85 @@
<?php
use yii\helpers\Url;
?>
<?php
$route = Yii::$app->controller->id .'/'. Yii::$app->controller->action->id;
$route = Yii::$app->controller->id . '/' . Yii::$app->controller->action->id;
/** @noinspection PhpUnhandledExceptionInspection */
$todayDateTime = Yii::$app->formatter->asDatetime(strtotime('today UTC'));
$items = [
[ 'Recepció', ['customer/reception', 'number' => $card->number ]],
[ 'Termék eladás', ['product/sale', 'number' => $card->number ]],
[ 'Adatlap', ['customer/update', 'number' => $card->number ]],
[ 'Befizetések', ['ticket/index', 'number' => $card->number] ],
[ '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 ]],
[ 'Törölköző Bérlés', ['log/towel', 'id_card' => $card->id_card , 'LogSearch[start]' => $todayDateTime ]],
[ 'Ujjlenyomat', ['fingerprint/index', 'FingerprintSearch[id_card]' => $card->id_card ]],
[ 'Jelszó küldése', ['customer/password-change', 'id_card' => $card->id_card ]],
['Recepció', ['customer/reception', 'number' => $card->number]],
['Termék eladás', ['product/sale', 'number' => $card->number]],
['Adatlap', ['customer/update', 'number' => $card->number]],
['Befizetések', ['ticket/index', 'number' => $card->number]],
['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]],
['Törölköző Bérlés', ['log/towel', 'id_card' => $card->id_card, 'LogSearch[start]' => $todayDateTime]],
['Ujjlenyomat', ['fingerprint/index', 'FingerprintSearch[id_card]' => $card->id_card]],
['Jelszó küldése', ['customer/password-change', 'id_card' => $card->id_card]],
['Mobil Eszközök', ['mobile-device/index', 'id_card' => $card->id_card]],
];
?>
<style>
.fitness-nav {
}
.fitness-nav-item.active a, .fitness-nav-item a:hover {
background: #0b93d5;
}
.fitness-nav-item > a {
padding: 8px 16px;
display: block;
margin-bottom: 8px;
background: #204d74;
color: #ffffff;
border-radius: 4px;
text-align: center;
}
.fitness-nav-container{
background: #e2e2e2;
padding: 8px 8px 0 8px;
border-radius: 4px;
}
</style>
<div class="fitness-nav-container">
<ul class="nav nav-tabs">
<?php foreach ($items as $item){?>
<?php
if ( empty($title)){
if ( $item[1][0] == $route) {
$title = $item[0];
}
}
?>
<li role="presentation" class="<?php echo $item[1][0] == $route ? 'active' : '' ?>"><a href="<?php echo Url::toRoute($item[1])?>"><?php echo $item[0] ?></a></li>
<?php }?>
</ul>
<div class="row fitness-nav">
<?php foreach ($items as $item) { ?>
<?php
if (empty($title)) {
if ($item[1][0] == $route) {
$title = $item[0];
}
}
?>
<div role="presentation"
class="col-xs-12 col-md-3 col-lg-2 fitness-nav-item <?php echo $item[1][0] == $route ? 'active' : '' ?>"><a
href="<?php echo Url::toRoute($item[1]) ?>"><?php echo $item[0] ?></a></div>
<?php } ?>
</div>
</div>
<?php if ( !empty($title)) {?>
<h1><?php echo $title?></h1>
<?php if (!empty($title)) { ?>
<h1><?php echo $title ?></h1>
<p>Vendég: <?php echo $card->customer->name ?></p>
<p>Kártyaszám: <?php echo $card->number ?></p>
<?php }?>
<?php } ?>

View File

@@ -13,57 +13,69 @@ use yii\helpers\Url;
<?php
if ( $model->isCardWithCustomer() ){
$attributes = [
[
'label' => 'Kártyaszám',
'value' => $model->card->number
],
[
'label' => 'Vendég',
'value' => $model->customer->name
],
[
'label' => 'E-Mail',
'value' => $model->customer->email
],
[
'label' => 'Telefon',
'value' => $model->customer->phone
],
[
'label' => 'Kiadott törölközők',
'value' => $model->customer->towel_count
],
[
'label' => 'Kulcsok',
'value' =>
empty($model->keysText) ? '' : (
"<form method='POST' action='". Url::toRoute(['key/toggle', "number" => $model->card->number])."'>"
.$model->keysText
.Html::hiddenInput("KeyToggleForm[key]", $model->keysText)
.Html::submitButton("Visszaad", [ 'style' => 'float: right;', 'class' => 'btn btn-primary btn-xs'])
."</form>")
,
'format' => 'raw'
],
[
'label' => 'Fénykép',
'value' => $model->customer->image1 ? Html::img( Url::base( ) . Image::thumb( $model->customer->image1->path,160,120 )) : 'Nincs kép',
'format' => 'raw'
],
];
?>
<div class="row">
<div class="col-md-12">
<?php
echo DetailView::widget([
'model' => $model,
'attributes' =>[
[
'label' => 'Kártyaszám',
'value' => $model->card->number
],
[
'label' => 'Vendég',
'value' => $model->customer->name
],
[
'label' => 'E-Mail',
'value' => $model->customer->email
],
[
'label' => 'Telefon',
'value' => $model->customer->phone
],
[
'label' => 'Kiadott törölközők',
'value' => $model->customer->towel_count
],
[
'label' => 'Kulcsok',
'value' =>
empty($model->keysText) ? '' : (
"<form method='POST' action='". Url::toRoute(['key/toggle', "number" => $model->card->number])."'>"
.$model->keysText
.Html::hiddenInput("KeyToggleForm[key]", $model->keysText)
.Html::submitButton("Visszaad", [ 'style' => 'float: right;', 'class' => 'btn btn-primary btn-xs'])
."</form>")
,
'format' => 'raw'
],
[
'label' => 'Fénykép',
'value' => $model->customer->image1 ? Html::img( Url::base( ) . Image::thumb( $model->customer->image1->path,160,120 )) : 'Nincs kép',
'format' => 'raw'
],
]
'attributes' => $attributes
])
?>
<div>
<?php
echo Html::a('Menü',['customer/update', 'number' => $model->card->number],['class' => 'btn btn-success me-3']);
if ( isset($showLinkDevices) && $showLinkDevices === true ) {
echo Html::a('Eszköz aktiválása', ['mobile-device/index', 'id_card' => $model->card->id_card], ['class' => 'btn btn-success']);
}?>
</div>
</div>
</div>
<?php
}
?>
?>

View File

@@ -13,7 +13,7 @@ use yii\helpers\Url;
<?php
/** @var \common\models\Ticket $ticket */
$ticket = null;
if (count($model->tickets) > 0) {
if ( isset($model->tickets) && count($model->tickets) > 0) {
$ticket = $model->tickets[0];
}

View File

@@ -7,7 +7,6 @@ $options = [];
if ( $model instanceof frontend\models\CustomerCreate){
$options['image_data' ] = 'customercreate-photo_data';
}else{
}
$this->registerJs ( 'new Customer( '. json_encode($options).');' );
?>
@@ -16,14 +15,59 @@ $this->registerJs ( 'new Customer( '. json_encode($options).');' );
.photo{
border: 1px solid gray;
}
#video {
border: 1px solid black;
box-shadow: 2px 2px 3px black;
width: 160px;
height: 120px;
}
#photo {
border: 1px solid black;
box-shadow: 2px 2px 3px black;
width: 160px;
height: 120px;
}
#canvas {
display: none;
}
.camera {
width: 160px;
display: inline-block;
}
.output {
width: 340px;
display: inline-block;
vertical-align: top;
}
.contentarea {
font-size: 16px;
font-family: "Lucida Grande", "Arial", sans-serif;
width: 760px;
}
</style>
<div class="row" style='margin-top: 12px;' >
<div class="col-md-4">
<div id="my_camera" class='photo pull-left' style="width: 160px; height: 120px; margin-right: 12px;"></div>
<div id="my_result" class='photo pull-left' style="width: 160px; height: 120px;"></div>
</div>
<div class="col-md-4">
</div>
<!--<div class="row" style='margin-top: 12px;' >-->
<!-- <div class="col-md-4">-->
<!-- <div id="my_camera" class='photo pull-left' style="width: 160px; height: 120px; margin-right: 12px;"></div>-->
<!-- <div id="my_result" class='photo pull-left' style="width: 160px; height: 120px;"></div>-->
<!-- </div>-->
<!-- <div class="col-md-4">-->
<!-- </div>-->
<!--</div>-->
<div class="camera">
<video id="video">Video stream not available.</video>
<!-- <button id="startbutton">Take photo</button>-->
</div>
<canvas id="canvas"> </canvas>
<div class="output">
<img id="photo" alt="The screen capture will appear in this box." />
</div>
<a id="snap" class="btn btn-primary" style="margin-top: 6px;" >Fénykép</a>

View File

@@ -0,0 +1,86 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use common\models\MobileDevice;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\CollectionSearch */
/* @var $card \common\models\Card */
/* @var $dataProvider \frontend\controllers\MobileDeviceController */
$this->title = "Vendég - mobil eszközök";
$this->params['breadcrumbs'][] = "Vendég";
$this->params['breadcrumbs'][] = "Mobil eszközök";
echo \frontend\components\CustomerTabWidget::widget(['card' => $card]);
echo GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'card_number',
'label' => 'Kártyaszám',
],
[
'attribute' => 'device_name',
'label' => 'Eszköz neve',
],
[
'attribute' => 'device_created_at',
'label' => 'Létrehozva',
'format' => 'datetime'
],
[
'attribute' => 'device_status',
'label' => 'Státusz',
'value' => function ($model, $key, $index, $column) {
return MobileDevice::toStatusHumanReadable($model['device_status']);
}
],
['class' => 'yii\grid\ActionColumn',
'header' => 'Műveletek',
'template' => '{activate} {delete}',
'buttons' => [
'activate' => function ($url, $model, $key) {
$status = $model['device_status'];
if ($status == MobileDevice::STATUS_ACTIVE) {
return null;
}
$options = [
'title' => 'Az aktuális eszköz aktiválása',
'data-confirm' => "Biztosan aktiválni szerenté ezt az eszközt?",
'data-method' => 'post',
'class' => 'btn btn-xs btn-success'
];
return Html::a('Aktivál', $url, $options);
},
'delete' => function ($url, $model, $key) {
$status = $model['device_status'];
if ($status !== MobileDevice::STATUS_ACTIVE) {
return null;
}
$options = [
'title' => 'Az aktuális eszköz törlése',
'data-confirm' => "Biztosan törölni szerenté ezt az eszközt?",
'data-method' => 'post',
'class' => 'btn btn-xs btn-danger'
];
return Html::a('Töröl', $url, $options);
},
],
'urlCreator' => function ($action, $model, $key, $index) {
$status = MobileDevice::STATUS_DELETED_MANUAL;
if ($action === 'activate') {
$status = MobileDevice::STATUS_ACTIVE;
}
$url = Url::to(['mobile-device/status', 'id_device' => $model['device_id'], 'status' => $status]);
return $url;
}
],
],
]); ?>

View File

@@ -24,7 +24,7 @@ $this->params['breadcrumbs'][] = $this->title;
$dt->sub( new DateInterval( 'P2D') );
echo \common\components\DateUtil::formatUtc($dt);
echo \common\components\DateUtil::formatDateTimeUtc($dt);
echo " - ";
@@ -33,7 +33,7 @@ $this->params['breadcrumbs'][] = $this->title;
$ticketType->time_unit_count = 3;
$dt2 = \common\components\Helper::getTicketExpirationDate($dt, $ticketType);
echo \common\components\DateUtil::formatUtc($dt2);
echo \common\components\DateUtil::formatDateTimeUtc($dt2);
// $dt2 = \common\components\Helper::getTicketExpirationDate($dt, $ticketType);
// echo \common\components\DateUtil::formatUtc($dt2);