%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.26 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/ppaobm/backend/modules/booking_data/views/bookingdata/ |
Upload File : |
<?php
use yii\helpers\Html;
//use yii\grid\GridView;
use kartik\grid\GridView;
use yii\helpers\ArrayHelper;
use kartik\export\ExportMenu;
use backend\modules\location_center\models\LocationCenter;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\booking_data\models\BookingDataSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'การใช้ห้องประชุมและอาคารสถานที่ประจำสัปดาห์';
$this->params['breadcrumbs'][] = $this->title;
$backend = Yii::getAlias('@back');
$time = time();
?>
<?php
$JSDayClick = <<<EOF
function(date, jsEvent, view, resourceObj) {
var booking_room_date = $(this).attr('data-date');
var booking_room_name = $(this).attr('id');
$.get('/bookingdata/booking-data/create_2',{'booking_room_name':booking_room_name,'booking_room_date':booking_room_date}, function (data) {
$('#modal-eventcreate-bookingdata').modal('show')
.find('#modalContent-eventcreate-bookingdata')
.html(data);
});
}
EOF;
$JSEventClick = <<<EOF
function(calEvent, jsEvent, view) {
// alert('Event: ' + calEvent.id);
// alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
// alert('View: ' + view.name);
$.get('/bookingdata/booking-data/update_2',{'id':calEvent.id}, function (data) {
$('#modal-eventedit-bookingdata').modal('show')
.find('#modalContent-eventedit-bookingdata')
.html(data);
});
}
EOF;
$JSEventMouseover = <<<EOF
function(event, jsEvent, element) {
$(this).popover({
placement: 'auto',
trigger: 'hover',
animation: true,
html: true,
title: "<div id='popoverbmtitle'>เวลา "+event.nonstandard.start+" น. - "+event.nonstandard.end+" น.</div>",
content: "<ul id='ulppaobm'><li>"+event.nonstandard.location+"</li><li>"+event.nonstandard.room+"</li><li>"+event.nonstandard.title+"</li><li>จำนวนผู้เข้าใช้ "+event.nonstandard.num_user+" คน</li></ul>",
container: 'body',
}).popover('toggle');
}
EOF;
$JSDayRender = <<<EOF
function(date, cell) {
var theDate = $(cell).data('date');
var fcDaySkel = $("#calendar div.fc-bg td[data-date='"+theDate+"'].fc-day");
fcDaySkel.attr("id","1");
}
EOF;
$JSEventRender = <<<EOF
function(event, element) {
element.find(".fc-title").html(event.title);
element.find(".fc-time").html('');
}
EOF;
?>
<?php
$gridColumns = [
[
'class' => 'kartik\grid\SerialColumn',
'contentOptions' => ['class' => 'kartik-sheet-style'],
'width' => '0.5%',
'header' => '',
'headerOptions' => ['class' => 'kartik-sheet-style']
],
'id',
[
'attribute' => 'created_at',
'label' => 'วันที่ขอ',
'hAlign' => 'center',
'width' => '8%',
'vAlign' => 'middle',
'xlFormat' => "mmm\\-dd\\, \\-yyyy",
'format' => 'html',
'filterType' => GridView::FILTER_DATE,
'filterWidgetOptions' => (
[
'model' => $searchModel,
'type' => 1,
'language' => 'th',
'attribute' => 'created_at',
'convertFormat' => true,
'pluginOptions' => [
'autoclose' => true,
'format' => 'yyyy-MM-dd',
],
]
),
'headerOptions' => ['class' => 'kv-sticky-column text-center'],
'contentOptions' => function ($model) {
return [
'style' => 'color:#D2691E;font-weight: 500;text-align: center;cursor:pointer;',
'name' => 'modal-circular-view-button',
'id' => $model['id'],
'onclick' => 'window.location.href = "/booking_data/bookingdata/view?id="+(this.id)',
];
},
'value' => function ($model) {
return Yii::$app->thaiFormatter->asDate($model->created_at, 'medium');
},
],
[
'attribute' => 'location_center_id',
'vAlign' => 'middle',
'width' => '12%',
'headerOptions' => ['class' => 'kv-sticky-column text-center'],
'contentOptions' => function ($model) {
return [
'style' => 'color:#1E90FF;text-align: center;cursor:pointer;overflow: auto;white-space: normal; word-wrap: break-word;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/booking_data/bookingdata/view?id="+(this.id)',
];
},
'value' => function ($model) {
$model = LocationCenter::find()->where(['id' => $model->location_center_id])->one();
return substr($model->name, 96);
},
'filterType' => GridView::FILTER_SELECT2,
// 'filter' => ArrayHelper::map(LocationCenter::find()->all(), 'id', 'name'),
'filter' => [
1 => 'อำเภอเมืองพิษณุโลก',
2 => 'อำเภอบางระกำ',
3 => 'อำเภอบางกระทุ่ม',
4 => 'อำเภอพรหมพิราม',
5 => 'อำเภอวังทอง',
6 => 'อำเภอวัดโบสถ์',
7 => 'อำเภอเนินมะปราง',
8 => 'อำเภอนครไทย',
9 => 'อำเภอชาติตระการ',
],
'filterWidgetOptions' => [
'options' => ['prompt' => ''],
'pluginOptions' => ['allowClear' => true],
],
],
[
'attribute' => 'name',
'vAlign' => 'middle',
'width' => '15%',
'headerOptions' => ['class' => 'kv-sticky-column text-center'],
'contentOptions' => function ($model) {
return [
'style' => 'color:#1E90FF;text-align: center;cursor:pointer;overflow: auto;white-space: normal; word-wrap: break-word;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/booking_data/bookingdata/view?id="+(this.id)',
];
},
],
[
'attribute' => 'department_name',
'vAlign' => 'middle',
'width' => '15%',
'headerOptions' => ['class' => 'kv-sticky-column text-center'],
'contentOptions' => function ($model) {
return [
'style' => 'color:#1E90FF;text-align: center;cursor:pointer;overflow: auto;white-space: normal; word-wrap: break-word;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/booking_data/bookingdata/view?id="+(this.id)',
];
},
],
[
'attribute' => 'title',
'vAlign' => 'middle',
'headerOptions' => ['class' => 'kv-sticky-column text-center'],
'contentOptions' => function ($model) {
return [
'style' => 'color:#1E90FF;text-align: center;cursor:pointer;overflow: auto;white-space: normal; word-wrap: break-word;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/booking_data/bookingdata/view?id="+(this.id)',
];
},
],
[
'attribute' => 'datein',
'width' => '15%',
'vAlign' => 'middle',
'headerOptions' => ['class' => 'kv-sticky-column text-center'],
'xlFormat' => "mmm\\-dd\\, \\-yyyy",
'format' => 'html',
'filterType' => GridView::FILTER_DATE,
'filterWidgetOptions' => (
[
'model' => $searchModel,
'type' => 2,
'language' => 'th',
'attribute' => 'datein',
'convertFormat' => true,
'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-MM-dd'],
]
),
'contentOptions' => function ($model) {
return [
'style' => 'color:#D2691E;text-align: center;cursor:pointer;overflow: auto;white-space: normal; word-wrap: break-word;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/booking_data/bookingdata/view?id="+(this.id)',
];
},
'value' => function ($model) {
if ($model->datein !== null) {
return Yii::$app->thaiFormatter->asDateTime($model->datein, 'php:d M Y เวลา H:i');
} else {
return 'ไม่ได้ระบุ';
}
},
],
[
'attribute' => 'tel',
'vAlign' => 'middle',
'width' => '10%',
'headerOptions' => ['class' => 'kv-sticky-column text-center'],
'contentOptions' => function ($model) {
return [
'style' => 'text-align: center;cursor:pointer;overflow: auto;white-space: normal; word-wrap: break-word;',
'id' => $model['id'],
'onclick' => 'window.location.href = "/booking_data/bookingdata/view?id="+(this.id)',
];
},
],
[
'class' => 'kartik\grid\FormulaColumn',
'header' => 'สถานะ',
'vAlign' => 'middle',
'format' => 'raw',
'value' => function ($model) {
if ($model->status == 0) {
return '<i class="m-menu__link-icon fa fa-minus" style="color:red"></i>';
}
if ($model->status == 1) {
return '<i class="m-menu__link-icon fa fa-check" style="color:blue"></i>';
}
if ($model->status == 2) {
return '<i class="m-menu__link-icon fa fa-times" style="color:red"></i>';
}
},
'headerOptions' => ['class' => 'kartik-sheet-style'],
'hAlign' => 'center',
'mergeHeader' => true,
],
[
'class' => 'kartik\grid\ActionColumn',
'header' => 'การจัดการ',
'vAlign' => 'middle',
'template' => '{edit} | {delete}',
'buttons' => [
'edit' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-edit"></span>', ['/booking_data/bookingdata/update', 'id' => $model->id, 'id' => $model->id], [
'data-pjax' => '0',
'data-toggle' => 'tooltip',
'title' => 'แก้ไขข้อมูลเข้าเยี่ยมชม'
]);
},
'delete' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-remove"></span>', ['/booking_data/bookingdata/delete', 'id' => $model->id, 'id' => $model->id], [
'data-pjax' => '0',
'data' => [
'confirm' => 'คุณต้องการลบข้อมูลนี้',
'method' => 'post',
],
'data-toggle' => 'tooltip',
'title' => 'ลบข้อมูลรายการขอใช้ห้องประชุมและอาคารสถานที่'
]);
},
],
],
];
?>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= Html::encode($this->title) ?>
<small>ศูนย์ประสานแผนพัฒนาท้องถิ่นประจำอำเภอ</small>
</h1>
</section>
<section class="content">
<div class="row" id="calendar-booking">
<?php
$room_data = LocationCenter::find()->all();
foreach ($room_data as $row) {
$JSDayRender[$row->id] = <<<EOF
function(date, cell) {
var theDate = $(cell).data('date');
var fcDaySkel = $("#calendar$row->id div.fc-bg td[data-date='"+theDate+"'].fc-day");
fcDaySkel.attr("id","$row->id");
}
EOF;
?>
<div class="col-lg-4">
<div class="box">
<div class="box-header with-border" style="background-color: #<?= $row->color ?>">
<h3 class="box-title" style="color: #fff">
<?= substr($row->name,96); ?>
</h3>
</div>
<div class="m-portlet__body" style="padding: 1.2rem 1.2rem;">
<?php
?>
<?php
echo edofre\fullcalendar\Fullcalendar::widget([
'options' => [
'id' => 'calendar' . $row->id,
'language' => 'th',
'class' => 'fc fc-unthemed fc-ltr',
],
'header' => [
'left' => 'prev,next',
'right' => 'title',
'center' => '',
],
'clientOptions' => [
// 'contentHeight' => 'auto',
'contentHeight' => 400,
'defaultView' => 'listWeek',
'eventMouseover' => new \yii\web\JsExpression($JSEventMouseover),
// 'dayClick' => new \yii\web\JsExpression($JSDayClick),
// 'eventClick' => new \yii\web\JsExpression($JSEventClick),
// 'dayRender' => new \yii\web\JsExpression($JSDayRender[$row->id]),
'eventRender' => new \yii\web\JsExpression($JSEventRender),
],
'events' => Url::to(['/booking_data/bookingdata/jsoncalendar', 'id' => $row->id]),
'theme' => true,
]);
?>
</div>
</div>
</div>
<?php
}
?>
</div>
</section>
</div>