当前位置: 首页>>代码示例>>PHP>>正文


PHP addErrorMessage函数代码示例

本文整理汇总了PHP中addErrorMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP addErrorMessage函数的具体用法?PHP addErrorMessage怎么用?PHP addErrorMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了addErrorMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _setView

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
$commentID = get_id(2);
$commentsClass = new comments();
$comment = $commentsClass->get($commentID);
if (!is_array($comment)) {
    addErrorMessage($langArray['wrong_comment'], '', 'error');
} else {
    abr('show_form', 'yes');
    abr('comment', $comment);
}
开发者ID:yunsite,项目名称:demila,代码行数:21,代码来源:reply.php

示例2: floatval

                $total_money = floatval($item['prepaid_price']) + floatval($item['your_profit']);
                $ordersClass->buy($total_money);
                refresh('/' . $languageURL . 'download/', $langArray['complete_buy_theme'], 'complete');
            }
        }
    } elseif ($_POST['licence'] == 'extended') {
        if (isset($_POST['pay_method']) && $_POST['pay_method'] == 'paymethod') {
            $orderID = $ordersClass->add($item['extended_price'], 'true');
            if (isset($_SESSION['tmp']['deposit_id'])) {
                unset($_SESSION['tmp']['deposit_id']);
            }
            $_SESSION['tmp']['order_id'] = $orderID;
            refresh('/' . $languageURL . 'items/payment/');
        } else {
            if ($_SESSION['user']['total'] < $item['extended_price']) {
                addErrorMessage($langArray['error_not_enought_money'], '', 'error');
            } else {
                $ordersClass->buy($item['extended_price'], true);
                refresh('/' . $languageURL . 'download/', $langArray['complete_buy_theme'], 'complete');
            }
        }
    }
}
#标签标记作品
require_once ROOT_PATH . '/apps/items/controllers/bookmark.php';
#是否免费文件
if ($item['free_file'] == 'true') {
    abr('freeFileMessage', langMessageReplace($langArray['free_file_info'], array('URL' => '/' . $languageURL . 'users/downloads/' . $item['id'])));
}
#加载其它作品
$otherItems = $itemsClass->getAll(0, 6, " `status` = 'active' AND `id` <> '" . intval($itemID) . "' AND `user_id` = '" . intval($item['user_id']) . "' ", "RAND()");
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:index.php

示例3: ccategories

#加载类别
$categoriesClass = new ccategories();
$categories = $categoriesClass->getAll(0, 0, " `visible` = 'true'");
abr('categories', $categories);
#发送联系支持请求
if (isset($_POST['action'])) {
    //验证码验证
    if (isset($_POST['verify'])) {
        if (empty($_POST['verify'])) {
            addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error');
        }
        require_once ROOT_PATH . '/classes/Verify.class.php';
        $verify = new Verify();
        $yz_verify = $verify->check($_POST['verify'], 1);
        if (!$yz_verify) {
            addErrorMessage($langArray['error_invalid_verify'], '', 'error');
        } else {
            $contactsClass = new contacts();
            $s = $contactsClass->add();
            if ($s === true) {
                refresh('/' . $languageURL . 'support/', $langArray['complete_send_email'], 'complete');
            } else {
                addErrorMessage($langArray['error_all_fields_required'], '', 'error');
            }
        }
    } else {
        addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error');
    }
}
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'contacts/" title="">' . $langArray['contacts'] . '</a>');
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:index.php

示例4: collections

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
require_once ROOT_PATH . '/apps/collections/models/collections.class.php';
$collectionsClass = new collections();
if (check_login_bool() && isset($_POST['add_collection'])) {
    $s = $collectionsClass->bookmark($itemID);
    if ($s === true) {
        refresh('/' . $languageURL . 'items/' . $itemID, $langArray['complete_bookmark_item'], 'complete');
    } else {
        addErrorMessage($s, '还没有创建书签集', 'error');
    }
}
if (check_login_bool()) {
    $collections = $collectionsClass->getAll(0, 0, " `user_id` = '" . intval($_SESSION['user']['user_id']) . "' ");
    abr('bookCollections', $collections);
}
开发者ID:yunsite,项目名称:demila,代码行数:25,代码来源:bookmark.php

示例5: c2r_user_number_default

    }
    if ($dnid = $_POST['default']) {
        c2r_user_number_default($uid, $dnid);
    }
} else {
    if (isset($_POST['validate_unid']) && ($vunid = $_POST['validate_unid'])) {
        c2r_user_number_activate($vunid, $_POST['code']);
    }
    if (isset($_POST['number']) && ($number = $_POST['number'])) {
        if (!eregi("^\\+[0-9]+\$", $number)) {
            addErrorMessage(t('This phone number has a wrong format. Please use the + sign, followed by country code, area code and your individual number.'));
        } else {
            $sql = "select number from users u, user_number un where u.is_active=True and un.user_id=u.id and number='{$number}'";
            $result = query($sql);
            if (pg_fetch_row($result)) {
                addErrorMessage('This number is already used!');
            } else {
                c2r_user_number_add($user->id, $number);
                addInfoMessage(t('Please validate ') . $number . t('. Enter the Code you get via SMS.'));
            }
        }
    }
    if (isset($_GET['number_delete']) && ($del_unid = $_GET['number_delete'])) {
        addInfoMessage(t('Phone number deleted'));
        c2r_user_number_delete($del_unid);
    }
    if (isset($_POST['default']) && ($dnid = $_POST['default'])) {
        c2r_user_number_default($user->id, $dnid);
    }
    if (isset($_POST['dlid']) && ($dlid = $_POST['dlid']) && isset($_POST['language']) && ($lng = $_POST['language'])) {
        c2r_user_update_default_location($user->id, $dlid);
开发者ID:smarti04,项目名称:open-carpool,代码行数:31,代码来源:profile.php

示例6: c2r_userinfo_insert

                $has_errors = true;
            }
        }
    }
    if (!$has_errors) {
        c2r_userinfo_insert($_POST['name'], $_POST['email'], $_POST['cid'], $_POST['dlid'], $_POST['gid'], $_POST['is_active'], $_POST['number']);
        unset($_POST);
    } else {
        if ($duplicate_email) {
            $e_msg = 'Duplicate Email: ' . $_POST['email'];
            addErrorMessage($e_msg);
            c2r_log_error('Add User', $e_msg);
        }
        if ($duplicate_number) {
            $e_msg = 'Duplicate Numbers: ' . $_POST['number'];
            addErrorMessage($e_msg);
            c2r_log_error('Add User', $e_msg);
        }
    }
}
$users = c2r_users_get($user->group_id < 3 ? $user->company_id : 0);
foreach ($users as $uid => $u) {
    $ui = c2r_get_user_info_object($uid);
    $users[$uid]->ui = $ui;
}
$locations = c2r_locations_get(0, $user->group_id < 3 ? $user->company_id : 0);
$companies = c2r_companies_get();
$smarty->assign('companies', $companies);
$smarty->assign('locations', $locations);
$smarty->assign('has_errors', $has_errors);
$smarty->assign('users', $users);
开发者ID:smarti04,项目名称:open-carpool,代码行数:31,代码来源:users.php

示例7: _setView

_setView(__FILE__);
_setTitle($langArray['make_payment_setTitle']);
$deposit_id = 0;
if (isset($_SESSION['tmp']['deposit_id'])) {
    $deposit_id = (int) $_SESSION['tmp']['deposit_id'];
}
require_once ROOT_PATH . '/apps/users/models/deposit.class.php';
$cms = new deposit();
$deposit_info = $cms->get($deposit_id);
//充值信息
if ($deposit_info) {
    $payments = glob(dirname(dirname(dirname(__FILE__))) . '/payments/controllers/*.php');
    $payments_data = array();
    //充值方式
    if ($payments) {
        $order_obj = array();
        $key = 'chinabank';
        require_once ROOT_PATH . '/apps/payments/models/' . $key . '.class.php';
        $order_obj[$key] = new $key();
        $payments_data[$key] = array('title' => '网银在线', 'description' => '网银在线订单支付', 'form' => $order_obj[$key]->generateDepositForm($deposit_info), 'logo' => '');
        if ($payments_data) {
            abr('payments_data', $payments_data);
        } else {
            addErrorMessage($langArray['no_payment_methods'], '', 'error');
        }
    } else {
        addErrorMessage($langArray['no_payment_methods'], '', 'error');
    }
} else {
    addErrorMessage($langArray['deposit_is_expired'], '', 'error');
}
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:payment.php

示例8: _setView

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
if (!isset($_GET['email'])) {
    refresh('/');
}
require_once ROOT_PATH . "/apps/bulletin/models/bulletin.class.php";
$bulletinClass = new bulletin();
$bulletinClass->deleteEmail($_GET['email']);
addErrorMessage($_GET['email'] . $langArray['complete_unsubscribe'], '', 'complete');
开发者ID:yunsite,项目名称:demila,代码行数:19,代码来源:delete.php

示例9: _setView

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['view']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
if (!isset($_GET['p'])) {
    $_GET['p'] = '';
}
$cms = new contacts();
$data = $cms->get($_GET['id']);
if (isset($_POST['send'])) {
    $s = $cms->sendAnswer();
    if ($s === true) {
        refresh('?m=' . $_GET['m'] . '&c=list', $langArray['complete_answer_issue'], 'complete');
    } else {
        addErrorMessage($langArray['error_answer_issue'], '', 'error');
    }
}
$_POST = $data;
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:view.php

示例10: quiz

$quizClass = new quiz();
$answersClass = new answers();
$questions = $quizClass->getAll(0, 0, '', 'RAND()');
abr('questions', $questions);
$answers = $answersClass->getAll(0, 0, '', true);
abr('answers', $answers);
if ($_SESSION['user']['quiz'] != 'false') {
    refresh('/' . $languageURL . 'author_dashboard/');
}
#检查测验
if (isset($_POST['submit'])) {
    $rightAnswers = 0;
    if (isset($_POST['answers']) && is_array($_POST['answers'])) {
        foreach ($_POST['answers'] as $question => $answer) {
            if (isset($answers[$question][$answer]) && $answers[$question][$answer]['right'] == 'true') {
                $rightAnswers++;
            }
        }
    }
    if ($rightAnswers > 0 && count($questions) == $rightAnswers) {
        $_SESSION['user']['quiz'] = 'true';
        require_once ROOT_PATH . '/apps/users/models/users.class.php';
        $usersClass = new users();
        $usersClass->updateQuiz($_SESSION['user']['user_id'], 'true');
        refresh('/' . $languageURL . 'users/dashboard/', $langArray['complete_score_quiz'], 'complete');
    } else {
        addErrorMessage(langMessageReplace($langArray['error_quiz'], array('RIGHT' => $rightAnswers, 'TOTAL' => count($questions))), '', 'error');
    }
}
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'quiz/" title="">' . $langArray['quiz'] . '</a>');
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:index.php

示例11: subscribeGroup

/**
 * do several things??? with groups and memberships
 *
 * TODO: rename, maybe to groupMembership?
 *
 * @return string; html form
 */
function subscribeGroup()
{
    global $user;
    include_once CHURCHDB . '/churchdb_db.php';
    $sql_gruppenteilnahme = "SELECT g.bezeichnung, gpg.*\n                           FROM {cdb_gemeindeperson_gruppe} gpg, {cdb_gemeindeperson} gp, {cdb_gruppe} g\n                           WHERE gpg.gemeindeperson_id=gp.id AND gp.person_id=:person_id AND gpg.gruppe_id=g.id AND g.id=:g_id";
    $sGroup = getVar("subscribegroup");
    //   if ($sGroup = getVar("subscribegroup")) { // should also work
    if ($sGroup > 0) {
        $res = db_query("SELECT * FROM {cdb_gruppe}\n                     WHERE id=:id AND offen_yn=1", array(":id" => $sGroup))->fetch();
        if (!$res) {
            addErrorMessage(t("error.requesting.group.membership"));
        } else {
            include_once CHURCHDB . '/churchdb_ajax.php';
            $grp = db_query($sql_gruppenteilnahme, array(":person_id" => $user->id, ":g_id" => $sGroup))->fetch();
            if (!$grp) {
                churchdb_addPersonGroupRelation($user->id, $res->id, -2, null, null, null, t("request.by.form"));
            } else {
                _churchdb_editPersonGroupRelation($user->id, $res->id, -2, null, "null", t("request.quit.membership.by.form"));
            }
            addInfoMessage(t("membership.requested.by.form.leader.will.be.informed", "<i>{$res->bezeichnung}</i>"));
        }
    }
    $uGroup = getVar("unsubscribegroup");
    //  if ($uGroup = getVar("unsubscribegroup")) { // should also work
    if ($uGroup > 0) {
        $res = db_query($sql_gruppenteilnahme, array(":person_id" => $user->id, ":g_id" => $uGroup))->fetch();
        if (!$res) {
            addErrorMessage(t("error.quitting.membership"));
        } else {
            include_once CHURCHDB . '/churchdb_ajax.php';
            _churchdb_editPersonGroupRelation($user->id, $res->gruppe_id, -1, null, "null", t("request.quit.membership.by.form"));
            addInfoMessage(t("membership.marked.for.deleting", "<i>{$res->bezeichnung}</i>"));
        }
    }
    // get groups the user is member of or requested membership
    $res = db_query("SELECT gpg.gruppe_id, status_no\n                   FROM {cdb_gemeindeperson_gruppe} gpg, {cdb_gemeindeperson} gp\n                   WHERE gpg.gemeindeperson_id=gp.id AND gp.person_id={$user->id}");
    $mygroups = array();
    foreach ($res as $p) {
        $mygroups[$p->gruppe_id] = $p;
    }
    // get all open groups
    $res = db_query("SELECT * FROM {cdb_gruppe} p\n                   WHERE offen_yn=1 AND ((abschlussdatum IS NULL) OR (DATE_ADD( abschlussdatum, INTERVAL 1 DAY ) > NOW( )))");
    $txt = "";
    $txt_subscribe = "";
    $txt_unsubscribe = "";
    foreach ($res as $g) {
        // groups user is not member of
        if (!isset($mygroups[$g->id]) || $mygroups[$g->id]->status_no == -1) {
            if ($g->max_teilnehmer == null || churchdb_countMembersInGroup($g->id) < $g->max_teilnehmer) {
                $txt_subscribe .= "<option value='{$g->id}'>{$g->bezeichnung}";
                if ($g->max_teilnehmer) {
                    $txt_subscribe .= " (max. {$g->max_teilnehmer})";
                }
            }
        } else {
            if ($mygroups[$g->id]->status_no <= 0) {
                $txt_unsubscribe .= "<option value='{$g->id}'>{$g->bezeichnung}";
                if ($mygroups[$g->id]->status_no == -2) {
                    $txt_unsubscribe .= " [beantragt]";
                }
            }
        }
    }
    if ($txt_subscribe || $txt_unsubscribe) {
        $txt = '<form method="GET" action="?q=home">';
        if ($txt_subscribe) {
            $txt .= '<p>' . t("apply.for.group.membership") . ':<p><select name="subscribegroup"><option>' . $txt_subscribe . '</select>';
        }
        if ($txt_unsubscribe) {
            $txt .= '<p>' . t("quit.group.membership") . ':<p><select name="unsubscribegroup"><option>' . $txt_unsubscribe . '</select>';
        }
        $txt .= '<P><button class="btn" type="submit" name="btn">' . t("send") . '</button>';
        $txt .= '</form>';
    }
    return $txt;
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:83,代码来源:churchdb.php

示例12: refresh

if (check_login_bool() && isset($_POST['add'])) {
    $s = $commentsClass->add();
    if ($s === true) {
        refresh('/' . $languageURL . 'items/comments/' . $itemID, $langArray['complete_add_comment'], 'complete');
    } else {
        addErrorMessage($langArray['error_item_comment'], '', 'error');
    }
} elseif (isset($_POST['add_reply'])) {
    if (!isset($_POST['comment_id'])) {
        $_POST['comment_id'] = 0;
    }
    $s = $commentsClass->add($_POST['comment_id']);
    if ($s === true) {
        refresh('/' . $languageURL . 'items/comments/' . $itemID, $langArray['complete_add_reply'], 'complete');
    } else {
        addErrorMessage($langArray['error_item_comment'], '', 'error');
    }
}
$comments = $commentsClass->getAll(START, LIMIT, " `item_id` = '" . intval($itemID) . "' AND `reply_to` = '0' ", true, '`datetime` ASC');
if (is_array($comments)) {
    $users = $usersClass->getAll(0, 0, $commentsClass->usersQuery);
    abr('users', $users);
    $ordersClass = new orders();
    $buyFromUsers = $ordersClass->isItemBuyed($itemID, $commentsClass->usersQuery);
    abr('buyFromUsers', $buyFromUsers);
}
abr('comments', $comments);
abr('paging', paging('/' . $languageURL . 'items/comments/' . $itemID . '/?p=', '', PAGE, LIMIT, $commentsClass->foundRows));
#标签标记作品
require_once ROOT_PATH . '/apps/items/controllers/bookmark.php';
#是否免费文件
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:comments.php

示例13: c2r_routes_get

    if (!$has_error) {
        if ($_GET['route']) {
            $r = c2r_routes_get($_GET['route_id']);
            $res = c2r_request_ride_route($_GET['user_number_id'], $_GET['location_id'], $r->key, $_GET['reverse'], $time_earliest, $time_latest, $sdate);
        } else {
            $sp = c2r_pickuppoints_get($_GET['start_point']);
            $ep = c2r_pickuppoints_get($_GET['end_point']);
            $res = c2r_request_ride($_GET['user_number_id'], $_GET['location_id'], $sp->key, $ep->key, $time_earliest, $time_latest, $sdate);
        }
        if ($res) {
            addInfoMessage($res);
            header("Location: " . OCP_BASE_URL . "matchingoffers.php");
            /* Redirect browser */
            exit;
        } else {
            addErrorMessage(t('An error occurred'));
        }
    }
}
smarty_display('request');
exit;
$title = 'Request';
$page_id = 'index';
include 'design/header.php';
?>

<script type="text/javascript" charset="utf-8">
	function change_select (val) {
		if (val) {
			$('#point_select').hide();
			$('#route_select').show();
开发者ID:smarti04,项目名称:open-carpool,代码行数:31,代码来源:request.php

示例14: churchcore__logviewer

/**
 * view log
 *
 * TODO: maybe the html should be in a sort of template?
 */
function churchcore__logviewer()
{
    if (!user_access("view logfile", "churchcore")) {
        addErrorMessage(t("no.permission.for", "LogViewer"));
        return " ";
    }
    $txt = '<div class="row-fluid">';
    $txt .= '<div class="span3 bs-docs-sidebar">';
    $txt .= '<ul id="navlist" class="nav nav-list bs-docs-sidenav affix-top">';
    $txt .= '<li><a href="#log1">' . t("important.logs") . '</a>';
    $txt .= '<li><a href="#log2">' . t("last.accesses") . '</a>';
    $txt .= '<li><a href="#log3">' . t("top.accesses") . '</a>';
    $txt .= '</div>';
    $txt .= '<div class="span9">';
    $limit = 200;
    if (getVar("showmore")) {
        $limit = 1000;
    }
    $filter = "txt LIKE 'Sende Mail%' OR txt LIKE 'Gruppe:%' OR level<3";
    $val = "";
    $params = array();
    if ($f = getVar("filter")) {
        $filter = "txt LIKE :filter";
        $params[":filter"] = '%' . $f . '%';
        $val = $f;
    }
    $txt .= '<anchor id="log1"/><h2>' . t("logviewer") . '</h2>';
    $res = db_query("SELECT p.id p_id, p.vorname, p.name, log.datum, log.level, log.domain_type, log.domain_id, log.txt\n                   FROM {cdb_person} p RIGHT JOIN\n                     (SELECT person_id, datum, level, domain_type, domain_id, txt\n                      FROM {cdb_log} l\n                      WHERE {$filter}\n  \t\t\t\t      ORDER BY l.id DESC\n  \t\t\t\t      LIMIT 0,{$limit}) AS log ON (log.person_id=p.id)", $params);
    $txt .= '<form class="form-inline" action="">';
    $txt .= '<input type="hidden" name="q" value="churchcore/logviewer"/>';
    $txt .= '<input name="filter" class="input-medium" type="text" value="' . $val . '"></input> <input type="submit" class="btn" value="' . t("filter") . '"/></form>';
    $txt .= '<table class="table table-condensed table-bordered">';
    $txt .= "<tr><th>" . t("date") . "<th>#<th>Object<th>" . t("name") . "<th>Log";
    $counter = 0;
    foreach ($res as $arr) {
        $txt .= "<tr><td><nobr>{$arr->datum} &nbsp; </nobr><td>{$arr->level}<td>{$arr->domain_type}" . ($arr->domain_id != -1 ? "[{$arr->domain_id}]" : "");
        $txt .= "<td>";
        if (isset($arr->p_id)) {
            $txt .= "<nobr>{$arr->vorname} {$arr->name} [{$arr->p_id}]</nobr>";
        }
        $txt .= "<td><small style=\"color:grey\">{$arr->txt}</small>";
        $counter++;
    }
    $txt .= '</table>';
    if (!getVar("showmore") && $counter >= $limit) {
        $txt .= '<a href="?q=churchcore/logviewer&showmore=true" class="btn">' . t("show.more.rows") . '</a> &nbsp; ';
    }
    $txt .= '<anchor id="log2"><h2>' . t("last.accesses") . '</h2>';
    $txt .= "<table class=\"table table-condensed table-bordered\"><tr><th>" . t("name") . "<th>" . t("count.accesses") . "<th>" . t("last.accesses");
    $res = db_query("SELECT p.id pid, vorname, name, COUNT( l.id ) count, MAX( lastlogin ) maxdatum\n                   FROM {cdb_log} l, {cdb_person} p\n                   WHERE l.person_id=p.id\n                   GROUP BY pid, vorname, name\n                   ORDER BY max( lastlogin ) DESC ");
    foreach ($res as $arr) {
        $txt .= "<tr><td>{$arr->vorname} {$arr->name} [{$arr->pid}]<td>" . $arr->count . "<td>" . $arr->maxdatum . "<br/>";
    }
    $txt .= "</table><br/><br/>";
    $txt .= '<anchor id="log3"><h2>' . t("top.accesses") . '</h2>';
    $txt .= "<table class=\"table table-condensed table-bordered\"><tr><th>" . t("name") . "<th>" . t("count.accesses") . "<th>" . t("last.accesses");
    $res = db_query("SELECT p.id pid, vorname, name, COUNT( l.id ) count, MAX( lastlogin ) maxdatum\n                   FROM {cdb_log} l, {cdb_person} p\n                   WHERE l.person_id=p.id\n                   GROUP BY pid, vorname, name\n                   ORDER BY count(l.id) DESC ");
    foreach ($res as $arr) {
        $txt .= "<tr><td>{$arr->vorname} {$arr->name} [{$arr->pid}]<td>" . $arr->count . "<td>" . $arr->maxdatum . "<br/>";
    }
    $txt .= "</table><br/><br/>";
    $txt .= "</div></div>";
    $txt .= '
    <script>
      !function ($) {
        $(function(){
          // carousel demo
          $("#navlist").affix({offset: {top: 15}});
        })
      }(window.jQuery)
    </script>';
    return $txt;
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:78,代码来源:churchcore.php

示例15: churchtools_app

/**
 * TODO: put this into churchtools_main, no need for two functions
 *
 * Main entry point for churchtools.
 * This will be called from /index.php
 * Function loads i18n, configuration, check data security.
 * If everything is ok, it calls churchtools_processRequest()
 */
function churchtools_app()
{
    global $q, $q_orig, $currentModule, $add_header, $config, $mapping, $content, $base_url, $files_dir, $user, $embedded, $i18n;
    include_once CHURCHCORE . "/churchcore_db.php";
    $files_dir = DEFAULT_SITE;
    // which module is requested?
    $q = $q_orig = getVar("q", userLoggedIn() ? "home" : getConf("site_startpage", "home"));
    // $currentModule is needed for class autoloading and maybe other include paths
    list($currentModule) = explode('/', getVar("q"));
    // get first part of $q or churchcore
    $embedded = getVar("embedded", false);
    $base_url = getBaseUrl();
    $config = loadConfig();
    if ($config) {
        if (db_connect()) {
            // DBConfig overwrites the config files
            loadDBConfig();
            if (empty($config['site_name'])) {
                $config['site_name'] = 'ChurchTools';
            }
            //dont allow site_name to be empty
            date_default_timezone_set(getConf("timezone", "Europe/Berlin"));
            if (isset($_COOKIE["language"])) {
                $config["language"] = $_COOKIE["language"];
            }
            // Load i18n churchcore-bundle
            if (!isset($config["language"])) {
                if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
                    $config["language"] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
                } else {
                    $config["language"] = DEFAULT_LANGUAGE;
                }
            }
            $i18n = new TextBundle(CHURCHCORE . "/resources/messages");
            $i18n->load("churchcore", $config["language"] != null ? $config["language"] : null);
            // Session Init
            if (!file_exists($files_dir . "/tmp")) {
                @mkdir($files_dir . "/tmp", 0775, true);
            }
            if (!file_exists($files_dir . "/tmp")) {
                // Admin should act accordingly, default suggestion is 0755.
                addErrorMessage(t("permission.denied.write.dir", $files_dir));
            } else {
                session_save_path($files_dir . "/tmp");
            }
            session_name("ChurchTools_" . $config["db_name"]);
            session_start();
            register_shutdown_function('handleShutdown');
            // Check for offline mode. If it's activated display message and return false;
            if (getConf("site_offline") == 1) {
                if (!isset($_SESSION["user"]) || !in_array($_SESSION["user"]->id, getConf("admin_ids"))) {
                    echo t("site.is.down");
                    return false;
                }
            }
            $embedded = getVar("embedded", false);
            $mapping = loadMapping();
            $success = true;
            // Check for DB-Updates and loginstr only if this is not an ajax call.
            if (strrpos($q, "ajax") === false) {
                $success = checkForDBUpdates();
            }
            // Log if debug ist activated
            if (isset($config["debug"])) {
                logParams();
            }
            if ($success) {
                // Is there a loginstr which does not fit to the current logged in user?
                if (getVar("loginstr") && getVar("id") && userLoggedIn() && $_SESSION["user"]->id != getVar("id")) {
                    logout_current_user();
                    session_start();
                } else {
                    loadUserObjectInSession();
                }
            }
            if ($success) {
                if (isset($_SESSION['user'])) {
                    $user = $_SESSION['user'];
                }
                // Accept data security?
                if (userLoggedIn() && !isset($_SESSION["simulate"]) && $q != "logout" && isset($config["accept_datasecurity"]) && $config["accept_datasecurity"] == 1 && !isset($user->acceptedsecurity)) {
                    $content .= pleaseAcceptDatasecurity();
                } else {
                    $content .= churchtools_processRequest($q);
                }
            }
        }
    }
    // TODO: i changed header/footer to a sort of template
    // probably some more logic could be removed from them by setting some more variables here
    // put header/footer into new file layout.php and add a variable $content
    $lang = getConf("language");
//.........这里部分代码省略.........
开发者ID:toXel,项目名称:churchtools_basic,代码行数:101,代码来源:start.php


注:本文中的addErrorMessage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。