%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\widgets\DetailView;
use dektrium\user\models\Profile;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use backend\modules\booking_data\models\BookingData;
use backend\modules\department_type\models\DepartmentType;
use backend\modules\location_center\models\LocationCenter;
use backend\modules\location_room\models\LocationRoom;
use dominus77\sweetalert2\Alert;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $model backend\modules\booking_data\models\BookingData */
$this->title = 'รายงานสรุปประจำปี การขอใช้ห้องประชุมและอาคารสถานที่';
$this->params['breadcrumbs'][] = ['label' => 'Booking Datas', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<?php
//$model = backend\modules\booking_data\models\BookingData::find()->all();
?>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= Html::encode($this->title) ?>
<small>ศูนย์ประสานแผนพัฒนาท้องถิ่นประจำอำเภอ</small>
</h1>
</section>
<section class="content">
<div class="booking-data-view">
<?php Pjax::begin(['id' => 'PjaxBooking']); ?>
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div style="text-align: center;padding-top: 10px;">
<span class="hidden-print" style="font-size: 1.8rem;">รายงานสรุปประจำปี</span>
<span class="visible-print" style="font-size: 1.8rem;">รายงานสรุปประจำปี พ.ศ.<?=$year+543?></span>
<p class="visible-print" style="font-size: 1.8rem;padding-top: 10px;">การขอใช้ห้องประชุมและอาคารสถานที่ศูนย์ประสานแผนพัฒนาท้องถิ่นประจำอำเภอ</p>
<?= Html::beginForm(['reportyear'], 'post', ['id' => 'formBooking', 'data-pjax' => 'true']); ?>
<div class="box-header with-border hidden-print">
<h3 class="box-title"></h3>
<?=
Html::dropDownList('year', $year, ['2019' => 2562, '2020' => 2563, '2021' => 2564, '2022' => 2565], [
'prompt' => '',
'onchange' => '$("#formBooking").submit()'
])
?>
<p style="font-size: 1.8rem;padding-top: 10px;">การขอใช้ห้องประชุมและอาคารสถานที่ศูนย์ประสานแผนพัฒนาท้องถิ่นประจำอำเภอ</p>
</div>
<?= Html::endForm() ?>
</div>
<div class="box-body">
<table id="ppaobmreportyear" class="table table-bordered table-striped">
<thead>
<tr>
<th>สถานที่</th>
<th>จำนวนผู้ขอใช้(ราย)</th>
<th>ส่วนราชการ(ราย)</th>
<th>เอกชน(ราย)</th>
<th>จำนวนผู้ขอยกเว้นค่าตอบแทน(ราย)</th>
<th>ค่าตอบแทน(บาท)</th>
</tr>
</thead>
<tbody>
<?php
$sumnumuser = 0;
$sumlocation1 = 0;
$sumlocation2 = 0;
$sumcountcost = 0;
$sumcost = 0;
$rows = LocationCenter::find()->all();
foreach ($rows as $row) {
?>
<tr>
<td><?= $row->name ?></td>
<td style="text-align: center;"><?php
// $data = BookingData::find()->where(['location_center_id' => $row->id])->count();
$data = BookingData::find()->where(['location_center_id' => $row->id])->andWhere(['DATE_FORMAT(datein, "%Y")' => $year])->andWhere(['status' => 1])->count();
$sumnumuser = $sumnumuser + $data;
echo $data;
?></td>
<td style="text-align: center;"><?php
$data = BookingData::find()->where(['location_center_id' => $row->id])->andWhere(['DATE_FORMAT(datein, "%Y")' => $year])->andWhere(['department_type_id' => 1])->andWhere(['status' => 1])->count();
$sumlocation1 = $sumlocation1 + $data;
echo $data;
?></td>
<td style="text-align: center;"><?php
$data = BookingData::find()->where(['location_center_id' => $row->id])->andWhere(['DATE_FORMAT(datein, "%Y")' => $year])->andWhere(['department_type_id' => 2])->andWhere(['status' => 1])->count();
$sumlocation2 = $sumlocation2 + $data;
echo $data;
?></td>
<td style="text-align: center;"><?php
$data = BookingData::find()->where(['location_center_id' => $row->id])->andWhere(['DATE_FORMAT(datein, "%Y")' => $year])->andWhere(['cost' => 0])->andWhere(['status' => 1])->count();
$sumcountcost = $sumcountcost + $data;
echo $data;
?></td>
<td style="text-align: center;">
<?php
$data = BookingData::find()->where(['location_center_id' => $row->id])->andWhere(['DATE_FORMAT(datein, "%Y")' => $year])->andWhere(['status' => 1])->sum('cost');
$sumcost = $sumcost + $data;
if($data == null){
$data = 0;
}
echo $data;
?>
</td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th></th>
<th><?= $sumnumuser ?></th>
<th><?= $sumlocation1 ?></th>
<th><?= $sumlocation2 ?></th>
<th><?= $sumcountcost ?></th>
<th><?= $sumcost ?></th>
</tr>
</tfoot>
</table>
</div>
<div class="form-group box-footer">
<p style="text-align: center;">
<button type="button" class="btn btn-app hidden-print hidden-print" onclick="window.print();"><i class="fa fa-print"></i> พิมพ์รายงาน</button>
</p>
</div>
</div>
</div>
<?php Pjax::end(); ?>
</div>
</section>
</div>