示例#1
0
文件: sticky.php 项目: rjha/gloov2
<?php

include 'gloo.inc';
require_once $_SERVER['GLOO_INC_DIR'] . 'class_loader.inc';
require_once $_SERVER['GLOO_INC_DIR'] . 'session.inc';
require_once $_SERVER['GLOO_INC_DIR'] . 'error.inc';
unset($_SESSION);
$page = new Gloo_Page();
$connx = Gloo_DB::getInstance()->get_connection();
$form1 = 'form1';
$form2 = 'form2';
$map1 = array('name' => 'Rajeev Jha', 'age' => 33);
$map2 = array('name' => 'Sanjeev Jha', 'age' => 25);
$page->set_sticky_map($form1, $map1);
$page->set_sticky_map($form2, $map2);
Gloo_DB::getInstance()->close_connection();
//var_dump($page);
$arr = $_SESSION['sticky_maps'];
print_r($arr);
echo ' <br/> -- sticky_maps printed -- <br/>';
$sticky = $page->get_sticky_map($form1);
echo $sticky->get('name');
echo '<br/>';
echo $sticky->get('age');
echo '<br/>';
echo $sticky->get('address', 'J-202');
echo ' -- form1 sticky printed -- <br/>';
$arr = $_SESSION['sticky_maps'];
$sticky = $page->get_sticky_map($form2);
echo $sticky->get('name');
echo '<br/>';
示例#2
0
文件: add.php 项目: rjha/gloov2
<?php

include 'gloo.inc';
require_once $_SERVER['GLOO_INC_DIR'] . 'class_loader.inc';
require_once $_SERVER['GLOO_INC_DIR'] . 'session.inc';
require_once $_SERVER['GLOO_INC_DIR'] . 'error.inc';
//web/ca/note/frm/add.php
// Save Button pressed
if (isset($_POST['save']) && $_POST['save'] == 'Save') {
    $fhandler = new Gloo_Form_Handler('ca_note_form', $_POST);
    $fhandler->add('title', 'Title', 50, true, true);
    $fhandler->validate();
    $fvalues = $fhandler->getValues();
    $ferrors = $fhandler->getErrors();
    $page = new Gloo_Page();
    $menuKey = $page->get_data('menu_key');
    $location = "/app2/ca/note/add/text.php";
    //Error case
    if ($fhandler->hasErrors()) {
        $page->set_message('ca_note_form', $fhandler->getErrors());
        $page->set_sticky_map('ca_note_form', $fvalues);
        //@todo get this value from page workflow data
        $location = "/app2/ca/note/add/text.php";
    }
    //Everything went fine
    header("location: " . $location);
}