本文整理汇总了PHP中Frame::TimeStampToDuration方法的典型用法代码示例。如果您正苦于以下问题:PHP Frame::TimeStampToDuration方法的具体用法?PHP Frame::TimeStampToDuration怎么用?PHP Frame::TimeStampToDuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame::TimeStampToDuration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConstructFlightEventsList
//.........这里部分代码省略.........
// This method has several options, check the source code documentation for more information.
$pdf->AddPage();
if ($imageFile !== '') {
unlink($imageFile);
}
// set text shadow effect
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => [196, 196, 196], 'opacity' => 1, 'blend_mode' => 'Normal'));
// Pasport
$strStyle = "text-align:center; font-size: xx-large; font-weight: bold; color: rgb(0, 10, 64);";
$str = '<p style="' . $strStyle . '">' . $this->lang->pasport . '</p>';
$pdf->writeHTML($str, true, false, false, false, '');
// Pasport info
$strStyle = "text-align:center;";
$str = '<p style="' . $strStyle . '">' . $this->lang->bruType . ' - ' . $bruInfo['bruType'] . '. <br>' . $this->lang->bort . ' - ' . $flightInfo['bort'] . '; ' . $this->lang->voyage . ' - ' . $flightInfo['voyage'] . '; ' . $this->lang->route . ' : ' . ($new_string = preg_replace('/[^a-zA-z0-9]/', '', $flightInfo['departureAirport']) . ' - ' . preg_replace('/[^a-zA-z1-9]/', '', $flightInfo['arrivalAirport']) . '. <br>' . $this->lang->flightDate . ' - ' . date('H:i:s d-m-Y', $flightInfo['startCopyTime']) . '; ' . $this->lang->duration . ' - ' . $flightDuration . '. <br>');
$fileName = date('Y-m-d_H.i.s', $flightInfo['startCopyTime']) . '_' . $flightInfo['bort'] . '_' . $flightInfo['voyage'] . '_' . $bruInfo['bruType'];
if (strpos($bruInfo['aditionalInfo'], ";") >= 0) {
$counterNeedBrake = false;
$aditionalInfoArr = explode(";", $flightInfo['flightAditionalInfo']);
foreach ($aditionalInfoArr as $aditionalInfo) {
if ($aditionalInfo != "") {
$nameVal = explode(":", $aditionalInfo);
if (count($nameVal) > 1) {
$name = $nameVal[0];
$val = $nameVal[1];
if ($counterNeedBrake) {
$str .= (isset($this->lang->{$name}) ? $this->lang->{$name} : $name) . " - " . $val . "; </br>";
$counterNeedBrake = !$counterNeedBrake;
} else {
$str .= (isset($this->lang->{$name}) ? $this->lang->{$name} : $name) . " - " . $val . "; ";
$counterNeedBrake = !$counterNeedBrake;
}
}
}
}
}
$str .= "</p>";
$pdf->writeHTML($str, true, false, false, false, '');
if ($flightInfo['exTableName'] != "") {
$FEx = new FlightException();
$excEventsList = $FEx->GetFlightEventsList($flightInfo['exTableName']);
$Frame = new Frame();
// change frame num to time
for ($i = 0; $i < count($excEventsList); $i++) {
$event = $excEventsList[$i];
$excEventsList[$i]['start'] = date("H:i:s", $excEventsList[$i]['startTime'] / 1000);
$reliability = "checked";
// converting false alarm to reliability
if ($excEventsList[$i]['falseAlarm'] == 0) {
$reliability = true;
} else {
$reliability = false;
}
$excEventsList[$i]['reliability'] = $reliability;
$excEventsList[$i]['end'] = date("H:i:s", $excEventsList[$i]['endTime'] / 1000);
$excEventsList[$i]['duration'] = $Frame->TimeStampToDuration($excEventsList[$i]['endTime'] - $excEventsList[$i]['startTime']);
}
unset($Frame);
// if isset events
if (!empty($excEventsList)) {
$pdf->SetFont('dejavusans', '', 9, '', true);
$strStyle = 'style="text-align:center; font-weight: bold; background-color:#708090; color:#FFF"';
$str = '<p><table border="1" cellpadding="1" cellspacing="1">' . '<tr ' . $strStyle . '><td width="70"> ' . $this->lang->start . '</td>' . '<td width="70">' . $this->lang->end . '</td>' . '<td width="70">' . $this->lang->duration . '</td>' . '<td width="70">' . $this->lang->code . '</td>' . '<td width="260">' . $this->lang->eventName . '</td>' . '<td width="110">' . $this->lang->algText . '</td>' . '<td width="180">' . $this->lang->aditionalInfo . '</td>' . '<td width="110">' . $this->lang->comment . '</td></tr>';
for ($i = 0; $i < count($excEventsList); $i++) {
$event = $excEventsList[$i];
$excInfo = $FEx->GetExcInfo($bruInfo['excListTableName'], $event['refParam'], $event['code']);
$codePrefix = substr($event['code'], 0, 3);
if ($event['reliability'] && (in_array($codePrefix, $sections) || !preg_match('/00[0-9]/', $codePrefix) && in_array('other', $sections))) {
if ($colored && $excInfo['status'] == "C") {
$style = "background-color:LightCoral";
} else {
if ($colored && $excInfo['status'] == "D") {
$style = "background-color:LightYellow";
} else {
if ($colored && $excInfo['status'] == "E") {
$style = "background-color:LightGreen";
} else {
$style = "";
}
}
}
$excAditionalInfo = $event['excAditionalInfo'];
$excAditionalInfo = str_replace(";", ";<br>", $excAditionalInfo);
$excInfo['algText'] = str_replace('<', "less", $excInfo['algText']);
$str .= '<tr style="' . $style . '" nobr="true">' . '<td width="70" style="text-align:center;">' . $event['start'] . '</td>' . '<td width="70" style="text-align:center;">' . $event['end'] . '</td>' . '<td width="70" style="text-align:center;">' . $event['duration'] . '</td>' . '<td width="70" style="text-align:center;">' . $event['code'] . '</td>' . '<td width="260" style="text-align:center;">' . $excInfo['comment'] . '</td>' . '<td width="110" style="text-align:center;">' . $excInfo['algText'] . '</td>' . '<td width="180" style="text-align:center;">' . $excAditionalInfo . '</td>' . '<td width="110" style="text-align:center;"> ' . $event['userComment'] . '</td></tr>';
}
}
unset($FEx);
$str .= "</table></p>";
$pdf->writeHTML($str, false, false, false, false, '');
$pdf->SetFont('dejavusans', '', 12, '', true);
$str = "</br></br>" . $this->lang->performer . ' : ' . '_____________________ ' . $flightInfo['performer'] . ', ' . date('d-m-Y') . '';
$pdf->writeHTML($str, false, false, false, false, '');
} else {
$strStyle = "text-align:center; font-size: xx-large; font-weight: bold; color: rgb(128, 10, 0);";
$str = '<p style="' . $strStyle . '">' . $this->lang->noEvents . '</p>';
$pdf->writeHTML($str, false, false, false, false, '');
}
}
$pdf->Output($fileName, 'I');
}
示例2: ShowEventsList
public function ShowEventsList($extFlightId)
{
$flightId = $extFlightId;
$Fl = new Flight();
$flightInfo = $Fl->GetFlightInfo($flightId);
$bruType = $flightInfo['bruType'];
$exTableName = $flightInfo['exTableName'];
unset($Fl);
$Bru = new Bru();
$bruInfo = $Bru->GetBruInfo($bruType);
$flightApHeaders = $Bru->GetBruApHeaders($bruType);
$flightBpHeaders = $Bru->GetBruBpHeaders($bruType);
$excListTableName = $bruInfo['excListTableName'];
unset($Bru);
$eventsList = "";
$eventTypeCount = [];
if ($exTableName != "") {
$FEx = new FlightException();
$excEventsList = $FEx->GetFlightEventsList($exTableName);
$Frame = new Frame();
//change frame num to time
for ($i = 0; $i < count($excEventsList); $i++) {
$event = $excEventsList[$i];
$excEventsList[$i]['start'] = date("H:i:s", $excEventsList[$i]['startTime'] / 1000);
$reliability = "checked";
//converting false alarm to reliability
if ($excEventsList[$i]['falseAlarm'] == 0) {
$reliability = "checked";
} else {
$reliability = "";
}
$excEventsList[$i]['reliability'] = $reliability;
$excEventsList[$i]['end'] = date("H:i:s", $excEventsList[$i]['endTime'] / 1000);
$excEventsList[$i]['duration'] = $Frame->TimeStampToDuration($excEventsList[$i]['endTime'] - $excEventsList[$i]['startTime']);
}
unset($Frame);
//if isset events
if (!empty($excEventsList)) {
$accordion = [];
$eventsListTable = sprintf("<table align='center' class='ExeptionsTable NotSelectable'>\r\n <tr class='ExeptionsTableHeader'><td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell' width='210px'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell' width='50px'> %s </td>\r\n <td class='ExeptionsCell' width='210px'> %s </td></tr>", $this->lang->start, $this->lang->end, $this->lang->duration, $this->lang->code, $this->lang->eventName, $this->lang->algText, $this->lang->aditionalInfo, $this->lang->reliability, $this->lang->comment);
for ($ii = 0; $ii < count(self::$exceptionTypes); $ii++) {
if ($ii == 0) {
$accordion[self::$exceptionTypes[$ii]] = sprintf('<div class="exceptions-accordion">' . '<div class="exceptions-accordion-title" data-shown="true" data-section="%s"><p>%s - %s</p></div>' . '<div class="exceptions-accordion-content"> %s', self::$exceptionTypes[$ii], $this->lang->eventCodeMask000, self::$exceptionTypes[$ii], $eventsListTable);
} else {
if ($ii == 1) {
$accordion[self::$exceptionTypes[$ii]] = sprintf('<div class="exceptions-accordion">' . '<div class="exceptions-accordion-title" data-shown="true" data-section="%s"><p>%s - %s</p></div>' . '<div class="exceptions-accordion-content"> %s', self::$exceptionTypes[$ii], $this->lang->eventCodeMask001, self::$exceptionTypes[$ii], $eventsListTable);
} else {
if ($ii == 2) {
$accordion[self::$exceptionTypes[$ii]] = sprintf('<div class="exceptions-accordion">' . '<div class="exceptions-accordion-title" data-shown="true" data-section="%s"><p>%s - %s</p></div>' . '<div class="exceptions-accordion-content"> %s', self::$exceptionTypes[$ii], $this->lang->eventCodeMask002, self::$exceptionTypes[$ii], $eventsListTable);
} else {
if ($ii == 3) {
$accordion[self::$exceptionTypes[$ii]] = sprintf('<div class="exceptions-accordion">' . '<div class="exceptions-accordion-title" data-shown="true" data-section="%s"><p>%s - %s</p></div>' . '<div class="exceptions-accordion-content"> %s', self::$exceptionTypes[$ii], $this->lang->eventCodeMask003, self::$exceptionTypes[$ii], $eventsListTable);
} else {
$accordion[self::$exceptionTypes[$ii]] = sprintf('<div class="exceptions-accordion">' . '<div class="exceptions-accordion-title" data-shown="true" data-section="%s"><p>%s - %s</p></div>' . '<div class="exceptions-accordion-content"> %s', self::$exceptionTypes[$ii], $this->lang->eventCodeMask, self::$exceptionTypes[$ii], $eventsListTable);
}
}
}
}
}
for ($i = 0; $i < count($excEventsList); $i++) {
$event = $excEventsList[$i];
$excInfo = $FEx->GetExcInfo($excListTableName, $event['refParam'], $event['code']);
if ($excInfo['status'] == "C") {
$style = "background-color:LightCoral";
} else {
if ($excInfo['status'] == "D") {
$style = "background-color:LightYellow";
} else {
if ($excInfo['status'] == "E") {
$style = "background-color:LightGreen";
} else {
$style = "background-color:none;";
}
}
}
$excAditionalInfo = $event['excAditionalInfo'];
$excAditionalInfo = str_replace(";", ";</br>", $excAditionalInfo);
$eventsListRow = sprintf("<tr style='%s' class='ExceptionTableRow'\r\n data-refparam='%s'\r\n data-startframe='%s'\r\n data-endframe='%s'><td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell'> %s </td>\r\n <td class='ExeptionsCell' style='text-align:center;'>\r\n <input class='reliability' data-excid='%s' type='checkbox' %s></input>\r\n </td>\r\n <td class='ExeptionsCell events_user-comment' data-excid='%s'> %s </td></tr>", $style, $event['refParam'], $event['frameNum'], $event['endFrameNum'], $event['start'], $event['end'], $event['duration'], $event['code'], $excInfo['comment'], $excInfo['algText'], $excAditionalInfo, $event['id'], $event['reliability'], $event['id'], $event['userComment']);
$codePrefix = substr($event['code'], 0, 3);
if (in_array($codePrefix, self::$exceptionTypes)) {
$accordion[$codePrefix] .= $eventsListRow;
$eventTypeCount[$codePrefix] = true;
} else {
$accordion[self::$exceptionTypeOther] .= $eventsListRow;
$eventTypeCount[self::$exceptionTypeOther] = true;
}
}
for ($ii = 0; $ii < count(self::$exceptionTypes); $ii++) {
$accordion[self::$exceptionTypes[$ii]] .= sprintf("</table></div></div>");
if (!isset($eventTypeCount[self::$exceptionTypes[$ii]]) || !$eventTypeCount[self::$exceptionTypes[$ii]]) {
unset($accordion[self::$exceptionTypes[$ii]]);
}
}
$eventsList = '';
foreach ($accordion as $item) {
$eventsList .= $item;
}
unset($FEx);
} else {
$eventsList .= sprintf("<table border='1' align='center' style='padding:2px'>\r\n <tr><td> %s </td></tr>\r\n </table>", $this->lang->noEvents);
//.........这里部分代码省略.........