Ejemplo n.º 1
0
 private function mainTreeRender(Tree &$tree, $selectedKey)
 {
     $li = new Li();
     $mainDiv = new Div();
     $mainDiv->addStyleClasses(["expand", "text_non_select", "tree_text_node", "input_hover"]);
     $table = new Table();
     $tr = new Tr();
     $nodeIcon = new Td();
     $nodeText = new Td();
     $nodeText->addStyleClass("tree_text");
     $nodeSearchCount = new Td();
     $nodeSearchCount->addStyleClass("tree_search_count");
     if (count($tree->childrens) > 0) {
         $nodeIcon->addStyleClasses(["tree_btn"]);
         $icon = new Img();
         $icon->addAttribute("style", "top: 2px; position: relative; margin: 0 5px;");
         $icon->addAttribute("src", $this->treeLevel <= $this->DEFAULT_TREE_LEVEL_TO_SHOW || $tree->show ? "images/arrow90.png" : "images/arrow00.png");
         $nodeIcon->addChild($icon);
     } else {
         $nodeIcon->addStyleClass("tree_empty");
     }
     $link = new A();
     $link->addAttribute("href", URLBuilder::getCatalogLinkForTree($tree->key));
     $link->addChild($tree->value);
     $link->addStyleClass("input_hover");
     $nodeSelected = new Div();
     $nodeSelected->addStyleClass($tree->key == $selectedKey ? 'selected' : 'tree_empty');
     $link->addChild($nodeSelected);
     $nodeText->addChild($link);
     return $li->addChild($mainDiv->addChild($table->addChild($tr->addChildList([$nodeIcon, $nodeText, $nodeSearchCount]))));
 }
Ejemplo n.º 2
0
Archivo: table.php Proyecto: stgnet/pui
 public function asHtml($level)
 {
     /* add tags JIT */
     $columns = $this->columns_from_table($this->table_content);
     $this->add($this->thead_from_columns($columns));
     $tbody = new Tbody();
     foreach ($this->table_content as $index => $row) {
         $tr = new Tr();
         foreach ($row as $column => $data) {
             $td = new Td($data);
             $tr->Add($td);
         }
         $tbody->Add($tr);
     }
     $this->add($tbody);
     return parent::asHtml($level);
 }
Ejemplo n.º 3
0
$inp_ext->setName('extension');
$inp_ext->setSize(10);
$inp_ext->setValue($result->extension);
$inp_lines = new Input();
$inp_lines->setName('nr_rows');
$inp_lines->setSize(7);
$inp_lines->setValue($result->nr_rows);
$form = new Form();
$form->setAction('controller.php');
$form->build();
$table = new Table();
$table->build();
$tr = new Tr();
$tr->add('Directory : ');
$tr->add($inp_dir->dump());
$tr->add($cmd->dump());
$tr->build();
$tr = new Tr();
$tr->add('Extension : ');
$tr->add($inp_ext->dump());
$tr->build();
$tr = new Tr();
$tr->add('# records in view : ');
$tr->add($inp_lines->dump());
$tr->build();
$tr = new Tr();
$tr->add('&nbsp;');
$tr->add($submit->dump());
$tr->build();
unset($table);
unset($form);
Ejemplo n.º 4
0
    $table = new Table();
    $table->setClas('result');
    $table->setId('listing');
    $table->build();
    $odd = TRUE;
    foreach ($res as $item) {
        if (!$titles) {
            $tr = new Th();
            $names = array_keys(get_object_vars($item));
            foreach ($names as $title) {
                $tr->add($title);
            }
            $tr->build();
            $titles = TRUE;
        }
        $tr = new Tr();
        if ($odd) {
            $tr->setGlobalClass('even');
            $odd = FALSE;
        } else {
            $tr->setGlobalClass('odd');
            $odd = TRUE;
        }
        foreach ($item as $data) {
            // display odd characters
            $tr->add(htmlentities($data));
        }
        $tr->build();
    }
    unset($table);
}
Ejemplo n.º 5
0
 $th->add('Name');
 $th->add('Unique ?');
 $th->add('Columns');
 $th->add('&nbsp;');
 $th->build();
 foreach ($res as $item) {
     if ($item->unique == 1) {
         $uniq = 'Y';
     } else {
         $uniq = 'N';
     }
     $drop = new Link();
     $drop->setHref('controller.php?cmd=drop_idx&idxname=' . $item->name . '&table=' . $req->get('table'));
     $drop->setName('[ drop ]');
     $drop->setJs(' onclick="return PSA.really_drop(\' index [' . $item->name . ']\');" ');
     $tr = new Tr();
     if ($odd) {
         $tr->setGlobalClass('even');
         $odd = FALSE;
     } else {
         $tr->setGlobalClass('odd');
         $odd = TRUE;
     }
     $tr->add($item->name);
     $tr->setClas('center');
     $tr->add($uniq);
     $q = "PRAGMA index_info(" . $item->name . ")";
     $sql->qo($q);
     $rescol = $sql->fo();
     $list = '';
     foreach ($rescol as $itcol) {
Ejemplo n.º 6
0
    $table->build();
    foreach ($res as $item) {
        if ($item->name == 'sqlite_sequence') {
            continue;
        }
        $struct = new Link();
        $struct->setHref('controller.php?cmd=tableinfo&table=' . $item->name . '&view=true');
        $struct->setName('Structure');
        $browse = new Link();
        $browse->setHref('controller.php?cmd=table_browse&table=' . $item->name . '&view=true');
        $browse->setName('Browse');
        $dump = new Link();
        $dump->setHref('controller.php?cmd=table_dump&table=' . $item->name . '&view=true');
        $dump->setName('Dump');
        $drop = new Link();
        $drop->setHref('controller.php?cmd=drop_view&table=' . $item->name . '&view==true');
        $drop->setName('Drop');
        $drop->setJs(' onclick="return PSA.really_drop(\'view\');" ');
        $tr = new Tr();
        $tr->add($item->name);
        $tr->add($struct->dump());
        $tr->add($browse->dump());
        $tr->add($dump->dump());
        $tr->add($drop->dump());
        $tr->build();
    }
    unset($table);
}
include_once './inc/footer.php';
unset($body);
unset($html);
Ejemplo n.º 7
0
     $dflt = '-';
 } else {
     $dflt = $item_fields->dflt_value;
 }
 if ($item_fields->notnull == 0) {
     $nn = 'Y';
 } else {
     $nn = 'N';
 }
 if ($item_fields->pk == 0) {
     $name = $item_fields->name;
 } else {
     $name = $item_fields->name . ' <span class="red">(PK)</span>';
     $nn = '-';
 }
 $tr = new Tr();
 if ($odd) {
     $tr->setGlobalClass('even');
     $odd = FALSE;
 } else {
     $tr->setGlobalClass('odd');
     $odd = TRUE;
 }
 $tr->add($name);
 $tr->add($type);
 $tr->setClas('rechts');
 $tr->add($size);
 $tr->setClas('center');
 $tr->add($nn);
 $tr->add($dflt);
 $tr->build();
Ejemplo n.º 8
0
     if (!$is_view) {
         $tr->add('edit');
         $tr->add('delete');
     }
     if (!$pk) {
         $tr->add('ROWID');
     }
     // $names = array_keys(get_object_vars($item));
     for ($i = 0; $i < sizeof($col); ++$i) {
         $tr->add($col[$i]);
     }
     $tr->build();
     $titles = TRUE;
 }
 /**/
 $tr = new Tr();
 if ($odd) {
     $tr->setGlobalClass('even');
     $odd = FALSE;
 } else {
     $tr->setGlobalClass('odd');
     $odd = TRUE;
 }
 if (!$is_view) {
     $edit = new Link();
     $edit->setHref('controller.php?cmd=edit_record&amp;table=' . $req->get('table') . '&amp;id=' . $item->id);
     $edit->setName('[edit]');
     // $edit->setTarget('edit_del');
     $del = new Link();
     $del->setHref('controller.php?cmd=drop_record&amp;table=' . $req->get('table') . '&amp;id=' . $item->id);
     $del->setName('[del]');
Ejemplo n.º 9
0
$colsize->setJs(' onblur="PSA.checknumeric();" ');
$colnull = new Input();
$colnull->setName('colnull');
$colnull->setType('checkbox');
$colnull->setId('colnull');
$coldefault = new Input();
$coldefault->setName('coldefault');
$coldefault->setSize(25);
$coldefault->setMaxlength(128);
$coldefault->setId('coldefault');
$fieldadd = new Input();
$fieldadd->setType('button');
$fieldadd->setName('fieldadd');
$fieldadd->setValue('add');
$fieldadd->setJs(' onclick="PSA.addField();" ');
$tr = new Tr();
$tr->add($colname->dump());
$tr->add($coltype->dump());
$tr->setClas('center');
$tr->add($colprime->dump());
$tr->setClas('center');
$tr->add($colsize->dump());
$tr->setClas('center');
$tr->add($colnull->dump());
$tr->add($coldefault->dump());
$tr->add($fieldadd->dump());
$tr->build();
unset($table);
$body->line('<hr />');
$table = new Table();
$table->setId('tfields');
Ejemplo n.º 10
0
$tps = $psa->prepare($q);
$tps->execute();
$res = $tps->fetchAll();
if (!$res) {
    $body->line('no queries found.');
} else {
    $table = new Table();
    $table->setClas('result');
    $table->build();
    $th = new Th();
    $th->add('database');
    $th->add('date - time');
    $th->add('query (click to copy in execution field)');
    $th->build();
    foreach ($res as $item) {
        $tr = new Tr();
        if ($item['fine'] == 0) {
            $tr->setGlobalClass('query_error');
            $tr->add($item['db']);
            $tr->add($item['datum']);
            $tr->add(str_repeat("&nbsp;", 2) . $item['qs']);
        } else {
            $tr->add($item['db']);
            $tr->add($item['datum']);
            $tr->add('<div class="qs">
				<a href="#" 
				onClick="PSA.to_text(\'' . str_replace('"', "&&", str_replace("'", "##", trim(str_replace("\r\n", " ", $item['qs'])))) . '\');">' . nl2br($item['qs']) . '</a></div>');
        }
        $tr->build();
    }
    unset($table);
Ejemplo n.º 11
0
Archivo: base.php Proyecto: broozer/psa
    $table->build();
    for ($i = 0; $i < sizeof($files); ++$i) {
        $link = new Link();
        $link->setHref('controller.php?cmd=table&amp;db=' . urlencode($files[$i]));
        $link->setName('[' . $files[$i] . ']');
        $vacuum = new Link();
        $vacuum->setHref('controller.php?cmd=vacuum_db&amp;db=' . urlencode($files[$i]));
        $vacuum->setName('[vacuum]');
        $drop = new Link();
        $drop->setHref('controller.php?cmd=drop_db&amp;db=' . urlencode($files[$i]));
        $drop->setName('[drop]');
        $drop->setJs(' onclick="return PSA.really_drop(\'database\');" ');
        $schema = new Link();
        $schema->setHref('controller.php?cmd=schema_db&amp;db=' . urlencode($files[$i]));
        $schema->setName('[schema]');
        $tr = new Tr();
        if ($odd) {
            $tr->setGlobalClass('even');
            $odd = FALSE;
        } else {
            $tr->setGlobalClass('odd');
            $odd = TRUE;
        }
        $tr->add($link->dump());
        $tr->add($vacuum->dump());
        $tr->add($drop->dump());
        $tr->add($schema->dump());
        $tr->build();
    }
    unset($table);
}