예제 #1
0
파일: edit_record.php 프로젝트: broozer/psa
}
if ($pk) {
    $q = "SELECT * FROM " . $req->get('table') . " WHERE id = " . $req->get('id');
} else {
    $q = "SELECT * FROM " . $req->get('table') . " WHERE ROWID = " . $req->get('id');
}
$sql->qo($q);
$res = $sql->fo_one();
// var_dump($res);
$html = new Page();
$html->setLanguage('nl_NL');
$html->build();
$head = new Head();
$head->setCharset('UTF-8');
$head->setTitle('PSA - edit record');
$head->setCss('./css/psa.css');
$head->build();
$body = new Body();
$body->build();
include_once './inc/menubar.php';
$form = new Form();
$form->setAction('controller.php');
$form->build();
$table = new Table();
$table->build();
$i = 0;
$inp = new Input();
$inp->setName('data_id');
$inp->setValue($req->get('id'));
$inp->setType('hidden');
$data_table = new Input();
예제 #2
0
파일: schema_db.php 프로젝트: broozer/psa
// PAGING
if (!$sessie->isS('bottom')) {
    $sessie->setS('bottom', 0);
}
$sql = new LitePDO('sqlite:' . $sessie->getS('psa-dir') . '/' . $sessie->getS('psa-db') . '.' . $sessie->getS('psa-ext') . '');
$q = "SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name";
$sql->qo($q);
$res = $sql->fo();
// echo "BOTTOM WAARDE  : <b><h1>".$sessie->getS('bottom')."</h1></b>";
$html = new Page();
$html->setLanguage('nl_NL');
$html->build();
$head = new Head();
$head->setCharset('UTF-8');
$head->setTitle('PSA - database schema');
$head->setCss('./css/psa.css', 'screen');
$head->setCss('./css/psaprint.css', 'print');
$head->setjs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
include_once './inc/menubar.php';
if (!$res) {
    $body->line('no tables defined yet');
} else {
    foreach ($res as $item) {
        $body->line('<div class="schema"><h3>' . $item->name . '</h3>');
        $q_fields = "PRAGMA table_info('" . $item->name . "')";
        $sql->qo($q_fields);
        $res_fields = $sql->fo();
        $table = new Table();