本文整理汇总了PHP中FormLib::queryStringtoJSON方法的典型用法代码示例。如果您正苦于以下问题:PHP FormLib::queryStringtoJSON方法的具体用法?PHP FormLib::queryStringtoJSON怎么用?PHP FormLib::queryStringtoJSON使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormLib
的用法示例。
在下文中一共展示了FormLib::queryStringtoJSON方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: row
/**
Format data for display
@param $data a two dimensional array of data
@param $headers a header row (optional)
@param $format output format (html | xls | csv)
@return formatted string
*/
public function render_data($data, $headers = array(), $footers = array(), $format = 'html')
{
$url = $this->config->get('URL');
$ret = "";
switch (strtolower($format)) {
case 'html':
if ($this->multi_counter == 1) {
if (!$this->new_tablesorter) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// windows has trouble with symlinks
$this->add_css_file($url . 'src/javascript/tablesorter-2.0.5b/themes/blue/style.css');
} else {
$this->add_css_file($url . 'src/javascript/tablesorter/themes/blue/style.css');
}
} else {
$this->add_css_file($url . 'src/javascript/tablesorter-2.22.1/css/theme.bootstrap.css');
}
if (!$this->window_dressing) {
$ret .= '<!DOCTYPE html><html><head>' . '<meta http-equiv="Content-Type" ' . 'content="text/html; charset=iso-8859-1">' . '</head><body>';
$ret .= '<script type="text/javascript">
function highlightCell(e)
{
if ($(this).css(\'background-color\') != \'rgb(255, 255, 0)\') {
$(this).css(\'background-color\',\'yellow\');
} else {
$(this).css(\'background-color\',\'\');
}
}
</script>';
}
$ret .= '<div id="pre-report-content">';
$uri = filter_input(INPUT_SERVER, 'REQUEST_URI');
if (\COREPOS\Fannie\API\data\DataConvert::excelSupport()) {
$ret .= sprintf('<a href="%s%sexcel=xls">Download Excel</a>
', $uri, strstr($uri, '?') === false ? '?' : '&');
}
$json = FormLib::queryStringtoJSON(filter_input(INPUT_SERVER, 'QUERY_STRING'));
$ret .= sprintf('<a href="%s%sexcel=csv">Download CSV</a>
<a href="?json=%s">Back</a>', $uri, strstr($uri, '?') === false ? '?' : '&', base64_encode($json));
$ret = array_reduce($this->defaultDescriptionContent(count($data)), function ($carry, $line) {
return $carry . (substr($line, 0, 1) == '<' ? '' : '<br />') . $line;
}, $ret);
$ret = array_reduce($this->report_description_content(), function ($carry, $line) {
return $carry . (substr($line, 0, 1) == '<' ? '' : '<br />') . $line;
}, $ret);
$ret .= '</div>';
}
if ($this->sortable || $this->no_sort_but_style) {
$ret .= '<table class="mySortableTable tablesorter tablesorter-bootstrap">';
} else {
$ret .= '<table class="mySortableTable" cellspacing="0"
cellpadding="4" border="1">' . "\n";
}
break;
case 'csv':
foreach ($this->defaultDescriptionContent(count($data)) as $line) {
$ret .= $this->csvLine(array(strip_tags($line)));
}
foreach ($this->report_description_content() as $line) {
$ret .= $this->csvLine(array(strip_tags($line)));
}
case 'xls':
break;
}
if (!empty($headers)) {
$headers1 = $this->select_headers(False);
if (!$this->multi_report_mode && strtolower($format) != 'xls') {
$this->header_index++;
}
switch (strtolower($format)) {
case 'html':
$ret .= '<thead>' . "\n";
$ret .= $this->htmlLine($headers1, True);
$ret .= '</thead>' . "\n";
break;
case 'csv':
$ret .= $this->csvLine($headers1);
break;
case 'xls':
break;
}
}
for ($i = 0; $i < count($data); $i++) {
switch (strtolower($format)) {
case 'html':
if ($i == 0) {
$ret .= "<tbody>\n";
}
$ret .= $this->htmlLine($data[$i]);
if ($i == count($data) - 1) {
$ret .= "</tbody>\n";
}
//.........这里部分代码省略.........