Example #1
0
 public function add()
 {
     if (Page::already($_POST['baseUrl'], $_POST['uri'], $_POST['language'])) {
         throw new Exception('PAGE ALREADY EXISTS', 409);
     }
     $page = new Page();
     $page->setBaseUrl($_POST['baseUrl']);
     $page->setUri($_POST['uri']);
     $page->setLanguage($_POST['language']);
     if (array_key_exists('content', $_POST) && !empty($_POST['content'])) {
         $page->setContent($_POST['content']);
     }
     $page->setModele($_POST['modele']);
     $page->setTitle($_POST['title']);
     if (array_key_exists('languageParentId', $_POST)) {
         $page->setLanguageParentId($_POST['languageParentId']);
     }
     if (array_key_exists('ajax', $_POST)) {
         $page->setAjax($_POST['ajax']);
     }
     if (array_key_exists('published', $_POST)) {
         $page->setPublished($_POST['published']);
     }
     if (array_key_exists('metas', $_POST)) {
         $page->setMetas($_POST['metas']);
     }
     if (array_key_exists('css', $_POST)) {
         $page->setCss($_POST['css']);
     }
     if (array_key_exists('js', $_POST)) {
         $page->setJs($_POST['js']);
     }
     if (array_key_exists('action', $_POST)) {
         $page->setAction($_POST['action']);
     }
     if (array_key_exists('method', $_POST)) {
         $page->setMethod($_POST['method']);
     }
     if (array_key_exists('priority', $_POST)) {
         $page->setPriority($_POST['priority']);
     }
     if (array_key_exists('datas', $_POST)) {
         $page->setDatas($_POST['datas']);
     }
     if (!array_key_exists('blockIds', $_POST)) {
         $blkIds = array();
         foreach ($_POST['blockIds'] as $blk) {
             if (array_key_exists('id', $blk) && MongoId::isValid($blk['id'])) {
                 $blkIds[] = $blk['id'];
             }
         }
         $this->page->setBlockIds($blkIds);
     }
     $page->save();
     return array('pageId' => $page->getId());
 }
Example #2
0
foreach ($res as $item) {
    if ($item->name == 'id') {
        $pk = true;
    }
    $col[] = $item->name;
}
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;
Example #3
0
<?php

/**
 * [type] file
 * [name] controller.php
 * [package] psa
 * [since] 2010.09.22
 * [update] 2013.12.19 : login added
 */
include_once 'autologin.php';
$cmd->setValue('base');
$submit->setValue('Go');
$html = new Page();
$html->setLanguage('en-en');
$html->build();
$head = new Head();
$head->setTitle('PSA - homepage');
$head->setCss('./css/psa.css');
$head->setJs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
// include_once('./inc/menubar.php');
$body->line('
<h3>PHP SQLite Admin tool - PSA in short...</h3>
<p>PSA stands for PHP - SQLite - Administration. This application lets you
do the basic operations with SQLite3 databases. The current version only
supports the very basics. Check out the manual for
more information.</p>
<p>Click <a href="login.php">here</a> to log in.</p>
<p>	The following issues are already implemented :</p>
Example #4
0
        header('location: controller.php');
        exit;
        /**/
    }
}
$submit->setValue('Let\'s go');
$inp_naam = new Input();
$inp_naam->setName('name');
$inp_naam->setSize(20);
$inp_naam->setAutofocus(true);
$inp_pass = new Input();
$inp_pass->setName('geheim');
$inp_pass->setType('password');
$inp_pass->setSize(20);
$html = new Page();
$html->setLanguage('nl-nl');
$html->build();
$head = new Head();
$head->setTitle('PSA - login');
$head->setCss('./css/psa.css');
$head->setJs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
$body->line('<h3>PHP SQLite Admin tool - log in</h3>');
$form = new Form();
$form->setAction('login.php');
$form->build();
$table = new Table();
$table->build();
$tr = new Tr();
Example #5
0
* [package] psa
* [since] 2010.09.22 - ok
*/
if (!$sessie->isS('psa-db')) {
    if ($req->get('db')) {
        $sessie->setS('psa-db', urldecode($req->get('db')));
    } else {
        $sessie->setS('psa-error', 'No database set.');
        header('location: controller.php?cmd=base');
        exit;
    }
}
$cmd->setValue('qs');
$submit->setValue('Go!');
$html = new Page();
$html->setLanguage('en_EN');
$html->build();
$head = new Head();
$head->setTitle('PSA - query');
$head->setCss('./css/psa.css');
$head->setJs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
include_once './inc/menubar.php';
$body->line('Insert raw sql query : ');
$form = new Form();
$form->setAction('controller.php');
$form->build();
$inp_text = new Textarea();
$inp_text->setRows(15);