45 lines
1.6 KiB
PHP
45 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Actions\Generate\Gutachten;
|
|
|
|
use App\Utilities\Html;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class Paragraph6Tabelle
|
|
{
|
|
public static function load($projekts_id)
|
|
{
|
|
$data = DB::table('raumorientierung')
|
|
->join('raumalles', 'raumorientierung.id', '=', 'raumalles.raumorientierung_id')
|
|
->join('orientierungs', 'raumorientierung.orientierungs_id', '=', 'orientierungs.id')
|
|
->select('raumorientierung.top_nr', 'raumorientierung.type', 'raumalles.geschoss', 'orientierungs.name')
|
|
->where('raumorientierung.projekts_id', $projekts_id)
|
|
->whereIn('raumalles.methodes_id', [1, 5, 6, 9])
|
|
->groupBy('raumorientierung.id')
|
|
->orderBy('raumalles.methodes_id', 'ASC')
|
|
->orderBy('raumorientierung.top_nr', 'ASC')
|
|
->get();
|
|
|
|
$html = '<table class="table-striped bl bt m20">';
|
|
|
|
$html .= '<tr>';
|
|
$html .= Html::td('Top', 'head center br bb');
|
|
$html .= Html::td('Geschoß', 'head center br bb');
|
|
$html .= Html::td('Orientierung', 'head center br bb');
|
|
$html .= Html::td('Typ', 'head center br bb');
|
|
$html .= '</tr>';
|
|
foreach ($data as $value) {
|
|
|
|
$html .= '<tr>';
|
|
$html .= Html::td($value->top_nr, 'center br bb');
|
|
$html .= Html::td($value->geschoss, 'center br bb');
|
|
$html .= Html::td(($value->name == 'Ohne Zuordnung') ? '' : $value->name, 'center br bb');
|
|
$html .= Html::td($value->type, 'center br bb');
|
|
$html .= '</tr>';
|
|
}
|
|
$html .= '</table>';
|
|
|
|
return $html;
|
|
}
|
|
}
|