From c4b142a204d41d51a3895318477abc766151f8f5 Mon Sep 17 00:00:00 2001 From: Rudi Zhang <40914896+RudiZhang@users.noreply.github.com> Date: Sun, 31 Mar 2024 10:16:51 +0200 Subject: [PATCH] Update RWYCC (#5) * Add RWYCC * Update datis.php * Fix * Fix --- datis.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/datis.php b/datis.php index ab0015d..048f86a 100644 --- a/datis.php +++ b/datis.php @@ -206,14 +206,16 @@ print(' TEMP ' . $out_temp_data . ' DEW POINT ' . $out_dewpt_data . ' QNH ' . $decoded->getPressure()->getValue() . ' HPA '); -if ((in_array("DZ", $phenomenon[0]->getTypes())) - || (in_array("RA", $phenomenon[0]->getTypes())) - || (in_array("SN", $phenomenon[0]->getTypes())) - || (in_array("SG", $phenomenon[0]->getTypes())) -) { - print('ALL RWYS RWY CONDITION CODE 5 5 5 ISSUED AT ' . substr($rawMetar, 7, 4) . 'Z ALL PARTS WET DEPTH NOT REPORTED COVERAGE 100PCT '); +if (isset($phenomenon[0]) && !empty($phenomenon[0])) { + if ((in_array("DZ", $phenomenon[0]->getTypes())) + || (in_array("RA", $phenomenon[0]->getTypes())) + || (in_array("SN", $phenomenon[0]->getTypes())) + || (in_array("SG", $phenomenon[0]->getTypes())) + ) { + print('ALL RWYS RWY CONDITION CODE 5 5 5 ISSUED AT ' . substr($rawMetar, 7, 4) . 'Z ALL PARTS WET DEPTH NOT REPORTED COVERAGE 100PCT '); + } } -print ('REPORT RECEIPT OF ATIS ' . $_GET['info'] . ' ON ' . $decoded->getIcao()); +print('REPORT RECEIPT OF ATIS ' . $_GET['info'] . ' ON ' . $decoded->getIcao()); ?>