Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$couch_dsn = "http://localhost:5984/";
$couch_db = "inout";
require_once "../lib/couch.php";
require_once "../lib/couchClient.php";
require_once "../lib/couchDocument.php";
$client = new couchClient($couch_dsn,$couch_db);
$window = new GtkWindow();
$window->set_size_request(420, 175);
$window->connect_simple('destroy', array('Gtk','main_quit'));
$vbox = new GtkVBox();
$label = new GtkLabel();
$label->set_markup('<span color="blue" font_desc="Times New Roman Italic 12">
In/Out Status of Computer Gentle Staff</span>');
$table = new GtkTable();
$data = $client->getView('users','all');
$data = $data->rows;
display_table($table, $data);
function display_table($table, $data) {
$row = 0;
foreach($data as $item) {
$key = new GtkLabel();
$table->attach($key, 0, 1, $row, $row+1, Gtk::FILL, Gtk::SHRINK);
//$table->attach($key, 0, 1, $row, $row+1, Gtk::FILL, Gtk::SHRINK);
$value = new GtkLabel($item->value->Status);
$table->attach($value, 1, 2, $row, $row+1, Gtk::FILL, Gtk::SHRINK);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment