Ejemplo n.º 1
0
<?php

require dirname(__FILE__) . '/__init__.php';
Rhaco::import('tag.HtmlParser');
$db = new DbUtil(Event::connection());
$p = new HtmlParser('index.html');
$p->setVariable('event', $db->get(new Event(), new C(Q::depend(), Q::eq(Event::columnId(), Rhaco::constant('CURRENT_EVENT', 1)))));
$p->setVariable('hatena', Rhaco::obj('HatenaSyntax', array('headlevel' => 4, 'id' => 'event_description')));
$p->write();
Ejemplo n.º 2
0
<?php

require dirname(__FILE__) . '/__init__.php';
Rhaco::import('generic.Flow');
Rhaco::import('network.http.Header');
$flow = new Flow();
if (!$flow->isVariable('id')) {
    Header::redirect(Rhaco::url());
}
$db = new DbUtil(Event::connection());
if ($flow->isPost() && $flow->isVariable('pass')) {
    $participant = $db->get(new Participant($flow->getVariable('id')));
    if (Variable::istype('Participant', $participant) && $participant->hash === $flow->getVariable('pass')) {
        $db->delete($participant);
        Header::redirect(Rhaco::url());
    }
}
$flow->setVariable('hatena', Rhaco::obj('HatenaSyntax', array('headlevel' => 4, 'id' => 'event_description')));
$flow->write('cancel.html');