Esempio n. 1
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');
Esempio n. 2
0
<?php

require dirname(__FILE__) . '/__init__.php';
Rhaco::import('generic.Flow');
$flow = new Flow();
$db = new DbUtil(Event::connection());
if ($flow->isPost() && $flow->isVariable('answer') && strtolower($flow->getVariable('answer')) == strtolower(Rhaco::constant('ANSWER'))) {
    $p = $flow->toObject(new Participant());
    if ($db->insert($p)) {
        $flow->setVariable('participant', $p);
        $flow->write('thanks.html');
        Rhaco::end();
    }
} else {
    ExceptionTrigger::raise(new GenericException('登録に失敗しました'));
}
$flow->setVariable('event', $db->get(new Event(), new C(Q::depend(), Q::eq(Event::columnId(), Rhaco::constant('CURRENT_EVENT', 1)))));
$flow->setVariable('hatena', Rhaco::obj('HatenaSyntax', array('headlevel' => 4, 'id' => 'event_description')));
$flow->write('index.html');