From eb68634582878741b214e4e49f2e7996f5f13108 Mon Sep 17 00:00:00 2001 From: Truong Vo <41848815+vmtruong301296@users.noreply.github.com> Date: Sat, 21 Sep 2024 10:24:20 +0700 Subject: [PATCH] =?UTF-8?q?Hi=E1=BB=87u=20ch=E1=BB=89nh=20format=20c?= =?UTF-8?q?=E1=BB=99t=20b=E1=BA=A3ng=20d=E1=BB=AF=20li=E1=BB=87u=20export?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/EvaluationController.php | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/BACKEND/Modules/Admin/app/Http/Controllers/EvaluationController.php b/BACKEND/Modules/Admin/app/Http/Controllers/EvaluationController.php index 2023d29..dbe194a 100644 --- a/BACKEND/Modules/Admin/app/Http/Controllers/EvaluationController.php +++ b/BACKEND/Modules/Admin/app/Http/Controllers/EvaluationController.php @@ -199,17 +199,18 @@ class EvaluationController extends Controller ]); $table->addRow(); - $table->addCell(2500)->addText('Criteria', ['bold' => true]); - $table->addCell(2500)->addText('Note', ['bold' => true]); - $table->addCell(2500)->addText('Created By', ['bold' => true]); - $table->addCell(2500)->addText('Point', ['bold' => true]); + + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Criteria', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Note', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Created By', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Point', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); foreach ($sprint['criterias'] as $criteria) { $table->addRow(); $table->addCell(2500)->addText($criteria['criteria']); $table->addCell(2500)->addText($criteria['note']); $table->addCell(2500)->addText($criteria['createdBy']); - $table->addCell(2500)->addText($criteria['point']); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER, 'valign' => 'center'])->addText($criteria['point'] > 0 ? $criteria['point'] : '', [], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); } $section->addText(' ', [], [ @@ -233,17 +234,18 @@ class EvaluationController extends Controller 'cellMargin' => 80, ]); $table->addRow(); - $table->addCell(2500)->addText('Level', ['bold' => true]); - $table->addCell(2500)->addText('Name', ['bold' => true]); - $table->addCell(2500)->addText('Point', ['bold' => true]); - $table->addCell(2500)->addText('Last Update', ['bold' => true]); + + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Level', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Name', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Point', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER])->addText('Last Update', ['bold' => true], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); foreach ($technicalData as $technical) { $updated_at = $technical['updated_at'] ? Carbon::parse($technical['updated_at'])->format('d/m/Y H:i:s') : null; $table->addRow(); - $table->addCell(2500)->addText($technical['level']); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER, 'valign' => 'center'])->addText($technical['level'], [], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); $table->addCell(2500)->addText($technical['name']); - $table->addCell(2500)->addText($technical['point']); + $table->addCell(2500, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER, 'valign' => 'center'])->addText($technical['point'], [], ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER]); $table->addCell(2500)->addText($updated_at); }