echo "<a href='" . $moduleRelPath . '/' . $CONF['pdf']['tmpPathRel'] . '/' . $pdfFile . "' target='_blank'>PDF is ready</a>"; echo "\n\n" . $moduleRelPath . '/' . $CONF['pdf']['tmpPathRel'] . '/' . $pdfFile; } else { echo "ERROR: PDF creation failed"; } exit; } // Add the limit $query .= "LIMIT {$startNum}," . $PREFS->itemsPerPage; // now the real query $res = $db->sql_query($query); if ($res <= 0) { echo "<H3> Error in query! </H3>\n"; exit; } $legend .= " :: " . _SORTED_BY . " " . replace_spaces($sortDesc); $legendRight = generate_flights_pagination(getLeonardoLink(array('op' => 'list_flights', 'sortOrder' => $sortOrder) + $queryExtraArray), $itemsNum, $PREFS->itemsPerPage, $page_num * $PREFS->itemsPerPage - 1, TRUE); $endNum = $startNum + $PREFS->itemsPerPage; if ($endNum > $itemsNum) { $endNum = $itemsNum; } $legendRight .= " [ " . ($startNum + 1) . "-" . $endNum . " " . _From . " " . $itemsNum . " ]"; if ($itemsNum == 0) { $legendRight = "[ 0 ]"; } if (0) { echo "<div class='tableTitle'>\n\t<div class='titleDiv'>{$legend}</div>\n\t<div class='pagesDiv' style='white-space:nowrap'>{$legendRight}</div>\n\t</div>"; } if (INLINE_VIEW != 1) { require_once dirname(__FILE__) . "/MENU_second_menu.php"; echo "<div class='list_header'>\n\t\t\t\t<div class='list_header_r'></div>\n\t\t\t\t<div class='list_header_l'></div>\n\t\t\t\t<h1>{$legend}</h1>\n\t\t\t\t<div class='pagesDiv'>{$legendRight}</div>\n\t\t\t</div>";
?> /assets/images/work/mobile-video-posters/<?php echo $slide['media'][3]; ?> );"></div><?php } ?> --> <?php if (wp_is_mobile()) { ?> <div class="full-bleed"></div><?php } ?> <div class="video-start play-full-screen" data-video="<?php echo replace_spaces(strtolower($companyName)); ?> -video-<?php echo $index; ?> "> <div></div> <div></div> <i></i> </div> <?php if (!$detect->isTablet() && !$detect->isMobile()) { ?> <video class="work-video work-full-video video-js vjs-default-skin" data-src="<?php echo $full_video;
function clean_spaces($string, $spaces = ['\\s'], $min = 1, $replace = ' ') { $string = replace_nbsp($string); $string = trim($string); return replace_spaces($string, $replace, $min, $spaces); }
$itemsNum = $row["itemNum"]; $startNum = ($page_num - 1) * $PREFS->itemsPerPage; $pagesNum = ceil($itemsNum / $PREFS->itemsPerPage); if ($pilotID >= 0) { $query = "SELECT * ,{$flightsTable}.ID as ID FROM {$flightsTable}," . $prefix . "_users" . $extra_table_str . " WHERE " . $flightsTable . ".userID=" . $prefix . "_users.user_id " . $where_clause . " ORDER BY " . $sortOrderFinal . " " . $ord . " LIMIT {$startNum}," . $PREFS->itemsPerPage; } else { $query = "SELECT * ,{$flightsTable}.ID as ID FROM {$flightsTable} " . $extra_table_str . " WHERE (1=1) " . $where_clause . " ORDER BY " . $sortOrderFinal . " " . $ord . " LIMIT {$startNum}," . $PREFS->itemsPerPage; } // echo $query; $res = $db->sql_query($query); if ($res <= 0) { echo "<H3> Error in query! </H3>\n"; exit; } // $legend.=_SORTED_BY." ".$sortDesc; $legend .= "<img src='{$moduleRelPath}/img/icon_sort.png' border=0 align=absmiddle> " . replace_spaces($sortDesc); listFlights($res, $legend, $query_str, $sortOrder); function printHeader($width, $headerSelectedBgColor, $headerUnselectedBgColor, $sortOrder, $fieldName, $fieldDesc, $query_str) { global $moduleRelPath; global $Theme, $module_name; if ($width == 0) { $widthStr = ""; } else { $widthStr = "width='" . $width . "'"; } if ($sortOrder == $fieldName) { echo "<td {$widthStr} bgcolor='{$headerSelectedBgColor}'>\n\t\t<div class='whiteLetter' align=left>\n\t\t<a href='?name={$module_name}&op=list_flights&sortOrder={$fieldName}{$query_str}'>{$fieldDesc}<img src='{$moduleRelPath}/img/icon_arrow_down.png' border=0 width=10 height=10></div></td>"; } else { echo "<td {$widthStr} bgcolor='{$headerUnselectedBgColor}'>\n\t\t<div align=left>\n\t\t<a href='?name={$module_name}&op=list_flights&sortOrder={$fieldName}{$query_str}'>{$fieldDesc}</div></td>"; }
<?php function replace_spaces($text) { $lambda = function ($matches) { return str_replace(' ', ' ', $matches[1]) . ' '; }; return preg_replace_callback('/( +) /', $lambda, $text); } echo replace_spaces("1 2 3\n"); echo replace_spaces("1 2 3\n"); echo replace_spaces("1 2 3\n"); echo "Done\n";