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


PHP CContact::getError方法代码示例

本文整理汇总了PHP中CContact::getError方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::getError方法的具体用法?PHP CContact::getError怎么用?PHP CContact::getError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CContact的用法示例。


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

示例1: isset

<?php

/* ADMIN $Id: do_user_aed.php,v 1.13 2005/03/11 00:46:46 gregorerhardt Exp $ */
include $AppUI->getModuleClass('contacts');
$del = isset($_REQUEST['del']) ? $_REQUEST['del'] : FALSE;
$obj = new CUser();
$contact = new CContact();
if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('User');
// !User's contact information not deleted - left for history.
if ($del) {
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg("deleted", UI_MSG_ALERT, true);
        $AppUI->redirect('', -1);
    }
    return;
}
$isNewUser = !$_REQUEST['user_id'];
if ($isNewUser) {
    // check if a user with the param Username already exists
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:do_user_aed.php

示例2: die

<?php

/* CONTACTS $Id: do_contact_aed.php 5872 2009-04-25 00:09:56Z merlinyoda $ */
if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
$obj = new CContact();
$msg = '';
if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
$del = dPgetParam($_POST, 'del', 0);
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Contact');
if ($del) {
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg("deleted", UI_MSG_ALERT, true);
        $AppUI->redirect("m=contacts");
    }
} else {
    $isNotNew = @$_POST['contact_id'];
    if ($msg = $obj->store()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        $AppUI->setMsg($isNotNew ? 'updated' : 'added', UI_MSG_OK, true);
    }
    $AppUI->redirect();
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:do_contact_aed.php

示例3: header

$result = $user->loadAll(null, "user_username = '{$username}'");
if (count($result)) {
    header('Location: newuser.php?msg=existing-user');
}
$email = w2PgetParam($_POST, 'contact_email', 0);
$contact = new CContact();
$result = $contact->loadAll(null, "contact_email = '{$email}'");
if (count($result)) {
    header('Location: newuser.php?msg=existing-email');
}
if (!$user->bind($_POST)) {
    $AppUI->setMsg($user->getError(), UI_MSG_ERROR);
    header('Location: newuser.php?msg=user');
}
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    header('Location: newuser.php?msg=contact');
}
$result = $contact->store();
if (count($contact->getError())) {
    header('Location: newuser.php?msg=contact');
} else {
    $user->user_contact = $contact->contact_id;
    $result = $user->store(null, true);
    if (count($user->getError())) {
        header('Location: newuser.php?msg=user');
    } else {
        notifyNewExternalUser($contact->contact_email, $contact->contact_first_name, $user->user_username, $_POST['user_password']);
        notifyHR(w2PgetConfig('admin_email', 'admin@web2project.net'), 'w2P System Human Resources', $contact->contact_email, $contact->contact_first_name, $user->user_username, $_POST['user_password'], $user->user_id);
        $AppUI->setMsg('The User Administrator has been notified to grant you access to the system and an email message was sent to you with your login info. Thank you.', UI_MSG_OK);
    }
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:do_user_aed.php


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