Esempio n. 1
0
        case 'delete':
            $ses->msg('Не реализовано. Используйте Отклонить.');
            break;
        default:
    }
    if ($actData->pid[0] == 0) {
        $url = '?pid=' . $actData->rid[0];
    } else {
        $url = '?pid=' . $actData->pid[0];
    }
    header("Location: {$url}");
    $tpl->assign('BODY', "Если браузер не перешел автоматически используйте ссылку:<BR><A HREF='{$url}'>Просмотр заявки</A>");
} else {
    switch (@$_GET['action']) {
        case 'usercomment':
            ech();
            if (isset($_GET['rid'])) {
                $rid = $_GET['rid'];
            } else {
                $rid = $_POST['RID'];
            }
            $actData = new Request5($rid);
            if (strlen($actData->comment[0]) > 0) {
                $actData->comment[0] .= "\n";
            }
            $actData->comment[0] .= date('d-m-y H:i', time()) . ' ' . $ses->login() . ' ' . $_POST['TEXT'];
            $actData->update();
            inform($actData, $ses->login(), REQ_USERREM);
            break;
        case 'donereq':
        case 'myreq':
Esempio n. 2
0
File: index.php Progetto: nikis/Go
    {
        if ($reverse) {
            return $value;
            // just back the given value
        }
        return md5($value);
    }
}
$user = User::init();
for ($i = 1; $i <= 10; $i++) {
    try {
        $newUser = $user->row()->create(array('email' => 'user' . $i . '@mail.com', 'password' => 'user_pass' . $i, 'gender' => 'male'));
        ech($newUser->id, 'with', $newUser->email, 'is created');
    } catch (onDuplicateRow $e) {
        ech($e->getRow()->email, 'already exist');
    }
}
$row = $user->first();
ech('First', $row->email, 'or', $user->result->email);
$row = $user->last();
ech('Last', $row->email, 'or', $user->result->email);
$user->all();
foreach ($user->result as $userRow) {
    ech('User', $userRow->email, 'is', $userRow->gender);
}
ech($user->count(), 'total users');
ech('min', $user->min());
ech('max', $user->max());
ech('avg', $user->avg());
ech('sum', $user->sum());