<?php
namespace App\Bsp\HotUA\Lines\Transaction; class BKS24 extends \App\Bsp\HotUA\HOTBase { protected $children = [ ['key'=>'SMSG', 'type'=>'Constant', 'val'=>'BKS', 'len'=>3, 'label'=>'Standard Message Identifier'], ['key'=>'SQNR', 'type'=>'Integer', 'len'=>8, 'label'=>'Sequence Number'], ['key'=>'STNQ', 'type'=>'Constant', 'val'=>'24', 'len'=>2, 'label'=>'Standard Numeric Qualifier'], ['key'=>'DAIS', 'type'=>'Date', 'fmt'=>'YYMMDD', 'len'=>6, 'label'=>'Date of Issue'], ['key'=>'TRNN', 'type'=>'Integer', 'len'=>6, 'label'=>'Transaction Number'], ['key'=>'TDNR_airline', 'type'=>'StringRaw', 'len'=>3, 'label'=>'Ticket/Document Number(airline number)'], ['key'=>'TDNR_ticketNumber', 'type'=>'StringRaw', 'len'=>10, 'label'=>'Ticket/Document Number'], ['key'=>'TDNR_extra', 'type'=>'StringRaw', 'len'=>1, 'label'=>'Ticket/Document Number(extra digits)'], ['key'=>'CDGT', 'type'=>'Digits', 'len'=>1, 'label'=>'Check Digit'], ['key'=>'CPUI', 'type'=>'StringRaw', 'len'=>4, 'label'=>'Coupon Use Indicator'], ['key'=>'CJCP', 'type'=>'StringTrim', 'len'=>3, 'label'=>'Conjunction Ticket Indicator'], ['key'=>'AGTN', 'type'=>'Digits', 'len'=>8, 'label'=>'Agent Numeric Code'], ['key'=>'RFIC', 'type'=>'StringRaw', 'len'=>1, 'label'=>'Reason for issuance code'], ['key'=>'TOUR', 'type'=>'StringRaw', 'len'=>15, 'label'=>'Tour Code'], ['key'=>'TRNC', 'type'=>'StringRaw', 'len'=>4, 'label'=>'Transaction Code'], ['key'=>'TODC', 'type'=>'StringRaw', 'len'=>10, 'label'=>'True Origin/Destination City Codes'], ['key'=>'PNRR', 'type'=>'StringRaw', 'len'=>13, 'label'=>'PNR Reference and/or Airline Data'], ['key'=>'TIIS', 'type'=>'StringRaw', 'len'=>4, 'label'=>'Time of issue'], ['key'=>'RESD', 'type'=>'StringTrim', 'len'=>34, 'label'=>'Reserved Space'], ]; protected function postExtract(\App\Utils\BaseParser\TextParser\ExtractedBlock $ret) { $TODC = rtrim($ret->extractedData['TODC']); if(strlen($TODC)==6) { $ret->extractedData['TODC_departure'] = substr($TODC, 0, 3); $ret->extractedData['TODC_destination'] = substr($TODC, 3, 3); } $PNRR = rtrim($ret->extractedData['PNRR']); $m = []; preg_match("/^(?P<RECLOC>[A-Z0-9]{6})\/(?P<supp>.+)/", $PNRR, $m); $ret->extractedData['PNRR_RECLOC'] = $m['RECLOC']; $ret->extractedData['PNRR_supplier'] = $m['supp']; return $ret; } } 