array('db.count','Tables count(*)'),
array('[db.]html_menu','Html menu for tables with links'),
+ array('[table.]rows','Dump one table, use format='),
array('[table.]fields','List fields'),
array('table.count','Table count(*)'),
array('table.sql','Get the sql source'),
-----------------------------------------------------------------*/
function rows_begin_xml() {
return ''
- .'<?xml version=“1.0” encoding=“utf-8”?>'.PHP_EOL #<?
+ .'<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL #<?
#.'<database name="'.$this->db->name.'" table="'.$this->name.'" type="'.$this->db->type.'">'.PHP_EOL
- .'<table name="'.$this->name.'" database="'.$this->db->name.'" database-type="'.$this->db->type.'">'.PHP_EOL
+ .'<rows name="'.$this->name.'" database="'.$this->db->name.'" database-type="'.$this->db->type.'">'.PHP_EOL
;
}
function rows_rec_xml(&$row) {
$xml = '';
- $xml .= "\t<rec>".PHP_EOL;
+ $xml .= "\t<row>".PHP_EOL;
foreach ($row as $k=>$v) {
if ($v !== '') $xml .= ''
. "\t\t<".$k.">"
. '</'.$k.'>'
.PHP_EOL;
}
- $xml .= "\t</rec>".PHP_EOL;
+ $xml .= "\t</row>".PHP_EOL;
return $xml;
}
function rows_end_xml() {
- return '</table>'.PHP_EOL;
+ return '</rows>'.PHP_EOL;
}
/*-----------------------------------------------------------------
} elseif ($action == 'table.rows' or $action == 'rows') {
#if ($this->p('page')==='0') $this->pset('inc',1);
+ $this->db->print_header($this->p('format'));
$this->rows(); return true;
# NB 06.03.16 } elseif ($action == 'table') {
'head' => 'out_csv_head',
'function' => 'out_csv',
),
+ 'labels' => array(
+ 'enclose' => array("<center>".OUT_EOL,"</center>"),
+ 'tag_enclose' => 'labels',
+ 'tag' => 'label',
+ 'function' => 'out_tag',
+ 'head' => 'out_tag_head',
+ ),
'table' => array(
'enclose' => array("<table>".OUT_EOL,"</table>"),
'tag_enclose' => 'tr',
#function out_tag_head(&$row,$o) { return ''; }
function out_tag_head(&$data,$o) {
#return var_dump($row,true); return '';
- $o['tag'] = $o['tag_head'];
+ $o['tag'] = isset($o['tag_head']) ? $o['tag_head'] : $o['tag'];
$row = out::ar_first($data);
if (!out::is_hash($row)) $row = $data;
#if (!is_array($row)) return out_csv(array_fill(0,count($row),'?'));