예제 #1
0
파일: Exec.php 프로젝트: laiello/webuntucms
 protected function logoutAction()
 {
     try {
         $userLogin = new Bobr_User_UserLogin();
         $userLogin->logOut();
         Lib_Messanger::addNote('Uzivatel byl odhlasen.');
         Bobr_Request_HttpRequest::redirect(Link::build('login/login'));
     } catch (UserLoginException $e) {
         echo $e->getMessage();
     }
     return '';
 }
예제 #2
0
파일: edit_record.php 프로젝트: broozer/psa
    if($length < 10) {
    	$size = 10;
    }
    */
    $inp = new Input();
    $inp->setName($colname);
    $inp->setValue($item);
    $inp->setSize(50);
    $inp->setMaxlength(128);
    /**/
    $tr = new Tr();
    $tr->add($colname);
    $tr->add($inp->dump());
    $tr->build();
    ++$i;
    /**/
}
$tr = new Tr();
$tr->add('&nbsp;');
$tr->add($submit->dump());
$tr->build();
unset($table);
unset($form);
$body->line('<hr />');
$backlink = new Link();
$backlink->setHref('controller.php?cmd=table_browse&table=' . $req->get('table'));
$backlink->setName('Back to list');
$backlink->build();
include_once './inc/footer.php';
unset($body);
unset($html);
예제 #3
0
파일: tableinfo.php 프로젝트: broozer/psa
if ($req->is('view')) {
    $q = "SELECT sql FROM sqlite_master WHERE type = 'view' AND name = '" . $req->get('table') . "' ";
} else {
    $q = "SELECT sql FROM sqlite_master WHERE type = 'table' AND name = '" . $req->get('table') . "' ";
}
$sql->qo($q);
$res = $sql->fo_one();
$body->line($res->sql);
$body->line('<hr>');
if (!$req->is('view')) {
    // $body->line('create indexes - overview indexes');
    $body->line('<h3>Indexes</h3>');
    $idxadd = new Link();
    $idxadd->setHref('controller.php?cmd=index_add&table=' . $req->get('table'));
    $idxadd->setName('Add index');
    $idxadd->build();
    $body->line();
    $q = "PRAGMA index_list(" . $req->get('table') . ")";
    $sql->qo($q);
    $res = $sql->fo();
    if (!$res) {
        $body->line('No indexes defined<br>');
    } else {
        $table = new Table();
        $table->setClas('result');
        $table->build();
        $th = new Th();
        $th->add('Name');
        $th->add('Unique ?');
        $th->add('Columns');
        $th->add('&nbsp;');
예제 #4
0
파일: table.php 프로젝트: broozer/psa
$html->build();
$head = new Head();
$head->setCharset('UTF-8');
$head->setTitle('PSA - show tables');
$head->setCss('./css/psa.css');
$head->setjs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
include_once './inc/menubar.php';
$body->line();
$link = new Link();
$link->setHref('controller.php?cmd=table_add');
$link->setClas('butter');
$link->setName('Add table');
$link->build();
$body->line('<hr>');
if (!$res) {
    $body->line('No tables defined.');
} else {
    $body->line('<h3>List tables</h3>');
    $table = new Table();
    $table->setClas('result');
    $table->build();
    foreach ($res as $item) {
        if ($item->name == 'sqlite_sequence') {
            continue;
        }
        $struct = new Link();
        $struct->setHref('controller.php?cmd=tableinfo&table=' . $item->name);
        $struct->setName('Structure');
예제 #5
0
 /**
  * Generates the pagination
  * 
  * @TODO: Clean this up, this is batshit insane.
  *
  * @return string
  */
 function pagination($class = '')
 {
     if (!$this->allowpaging) {
         return;
     }
     $this->set_boundaries();
     // Build links before passing to template to handle AJAX if necessary
     $firstpagelink = new Link($this->page_link(0), 1, $this->ajax, $this->id, $this->response_target);
     $prevpagelink = new Link($this->page_link($this->pageno - 2), "<div class='pagin-left'></div>", $this->ajax, $this->id, $this->response_target);
     $fourprevpagelink = new Link($this->page_link($this->pageno - 5), $this->pageno - 4, $this->ajax, $this->id, $this->response_target);
     $threeprevpagelink = new Link($this->page_link($this->pageno - 4), $this->pageno - 3, $this->ajax, $this->id, $this->response_target);
     $twoprevpagelink = new Link($this->page_link($this->pageno - 3), $this->pageno - 2, $this->ajax, $this->id, $this->response_target);
     $oneprevpagelink = new Link($this->page_link($this->pageno - 2), $this->pageno - 1, $this->ajax, $this->id, $this->response_target);
     $onenextpagelink = new Link($this->page_link($this->pageno), $this->pageno + 1, $this->ajax, $this->id, $this->response_target);
     $twonextpagelink = new Link($this->page_link($this->pageno + 1), $this->pageno + 2, $this->ajax, $this->id, $this->response_target);
     $threenextpagelink = new Link($this->page_link($this->pageno + 2), $this->pageno + 3, $this->ajax, $this->id, $this->response_target);
     $fournextpagelink = new Link($this->page_link($this->pageno + 3), $this->pageno + 4, $this->ajax, $this->id, $this->response_target);
     $nextpagelink = new Link($this->page_link($this->pageno), "<div class='pagin-right'></div>", $this->ajax, $this->id, $this->response_target);
     $lastpagelink = new Link($this->page_link($this->lastpage - 1), $this->lastpage, $this->ajax, $this->id, $this->response_target);
     $template = new Template($this->pagination_template);
     $rendered = $template->render(array('count' => $this->count, 'lowerBound' => $this->lowerBound, 'upperBound' => $this->upperBound, 'pageno' => $this->pageno, 'firstpage' => $this->firstpage, 'lastpage' => $this->lastpage, 'firstpagelink' => $firstpagelink->build(), 'prevpagelink' => $prevpagelink->build(), 'fourprevpagelink' => $fourprevpagelink->build(), 'threeprevpagelink' => $threeprevpagelink->build(), 'twoprevpagelink' => $twoprevpagelink->build(), 'oneprevpagelink' => $oneprevpagelink->build(), 'onenextpagelink' => $onenextpagelink->build(), 'twonextpagelink' => $twonextpagelink->build(), 'threenextpagelink' => $threenextpagelink->build(), 'fournextpagelink' => $fournextpagelink->build(), 'nextpagelink' => $nextpagelink->build(), 'lastpagelink' => $lastpagelink->build(), 'class' => $class));
     return $rendered;
 }
예제 #6
0
 $next = new Link();
 if ($is_view) {
     $next->setHref('controller.php?cmd=table_browse&amp;table=' . $req->get('table') . '&amp;direction=next&view=true');
 } else {
     $next->setHref('controller.php?cmd=table_browse&amp;table=' . $req->get('table') . '&amp;direction=next');
 }
 $next->setName('[&gt;]');
 $next->build();
 $lastlink = new Link();
 if ($is_view) {
     $lastlink->setHref('controller.php?cmd=table_browse&amp;table=' . $req->get('table') . '&amp;direction=last&view=true');
 } else {
     $lastlink->setHref('controller.php?cmd=table_browse&amp;table=' . $req->get('table') . '&amp;direction=last');
 }
 $lastlink->setName('[--&gt;&gt;]');
 $lastlink->build();
 $low = $sessie->getS('bottom') + 1;
 $high = $sessie->getS('bottom') + LIMIT;
 if ($high > $records) {
     $high = $records;
 }
 $body->line(' (total # of records : <b> ' . $records . '</b> -- showing <b>' . $low . '</b> till <b>' . $high . '</b>)<br />');
 $titles = FALSE;
 $table = new Table();
 $table->setClas('result');
 $table->setId('listing');
 $table->build();
 foreach ($res as $item) {
     /**/
     if (!$titles) {
         $tr = new Th();