本文整理汇总了PHP中db::isError方法的典型用法代码示例。如果您正苦于以下问题:PHP db::isError方法的具体用法?PHP db::isError怎么用?PHP db::isError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db
的用法示例。
在下文中一共展示了db::isError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
function add($postArray)
{
if (User::isAdmin()) {
$bm = BandMember::get($postArray['member_id']);
} else {
$uo = User::getCurrent();
$bm = BandMember::getByUserID($uo->getID());
}
if (db::isError($bm)) {
return $bm;
}
$db = new db();
$member_id = $bm->getID();
$title = $db->sanitize_to_db($postArray['title']);
$_dt = strtotime($postArray['date']);
$dt = date('Y-m-d', $_dt) . ' ' . $postArray['time'];
$dateTime = date("Y-m-d H:i:s", strtotime($dt));
$body = $db->sanitize_to_db($postArray['body']);
if (!$title) {
$title = '(untitled)';
}
$r = @mysql_query("insert into Band_Diaries (title, member_id, date_time, body, is_active) values ('{$title}','{$member_id}','{$dateTime}','{$body}'," . DEFAULT_ACTIVE . ")");
if (!$r) {
return Error::MySQL();
} else {
$bd = BandMemberDiary::get(mysql_insert_id());
return $bd;
}
}
示例2: isset
}
?>
</div>
<?php
}
if (db::isError($res)) {
$res->outputList();
}
if (User::isAdmin()) {
if (!db::isError($ma)) {
?>
<h1>areas:</h1>
<?php
$areas = isset($maAdd) && !db::isError($maAdd) ? $maAdd->getAreas() : MediaArea::getAreas();
if ($areas) {
?>
<ul class="sub-list">
<?php
foreach ($areas as $a) {
?>
<li><b><a href="<?php
echo $PHP_SELF;
?>
?area=<?php
echo $a->getID();
?>
&id=<?php
echo $ma->getID();
?>
示例3:
&type=<?php
echo $type;
?>
">Media ></a>
Edit Media >
</div>
<?php
$canEdit = User::isAdmin();
if ($res) {
// it's an error
if (db::isError($res)) {
$res->outputList();
}
}
if (!db::isError($mi)) {
if ($_GET['task'] == 'edit' && $canEdit) {
$exitURL = 'show_media_edit.php?id=' . $_GET['id'] . '&media_instance_id=' . $_GET['media_instance_id'];
include 'layout/media_edit.php';
} else {
$exitURL = 'show_media.php?id=' . $_GET['id'] . '&type=' . $type;
include 'layout/media_view.php';
}
} else {
$mi->outputDialog('Return to Shows', 'show.php?id=' . $_GET['id']);
}
} else {
?>
<div id="breadcrumb">
<a href="index.php">Audition ></a>
示例4:
">View/Edit Release ></a>
<a href="release_track_edit.php?id=<?php
echo $rt->getID();
?>
">View/Edit Release Track ></a>
Media >
</div>
<?php
if ($res) {
// it's an error
if (db::isError($res)) {
$res->outputList();
}
}
if (is_object($ma) && !db::isError($ma)) {
$exitURL = "release_track_edit.php?id=" . $_GET['id'];
$canEdit = User::isAdmin();
$exitText = "Return to Track";
if ($canEdit) {
$addURL = "release_track_media_add.php?id=" . $_GET['id'];
}
$editURL = "release_track_media_edit.php?id={$_GET['id']}&";
include 'layout/media_list.php';
} else {
if (User::isAdmin()) {
$ma->outputDialog('Register Track', $PHP_SELF . '?task=register_media&id=' . $_GET['id']);
} else {
$ma->outputDialog('Return to Track', 'release_track_edit.php?id=' . $_GET['id']);
}
}
示例5: include_class
<?php
include_class('venues');
include_class('locations');
$so = $args['show'];
if (is_object($so) && !db::isError($so)) {
$ID = $so->getID();
$venue = $so->getVenueObject();
if (db::isError($venue) || !is_object($venue)) {
unset($venue);
} else {
$venueName = $venue->getName();
$venueAddress1 = $venue->getAddress1();
$venueAddress2 = $venue->getAddress2();
$venueCity = $venue->getCity();
$venueStateProvince = $venue->getStateProvince();
$venuePostalCode = $venue->getPostalCode();
$venueCountry = $venue->getCountry();
}
$name = USE_MOD_REWRITE ? '<a href="' . SITE_WEB_DIRECTORY . '/show/' . $ID . '">' . $so->getName() . '</a>' : '<a href="' . SITE_WEB_DIRECTORY . '/shows.php?id=' . $ID . '">' . $so->getName() . '</a>';
$access = $so->isAllAges() ? "All Ages!" : "21 and Over";
$uo = $so->getUserObject();
$cost = $so->getCost();
$date = $so->getDate("F d, Y");
$time = $so->getTime("g:i A");
if ($uo->isBandMember()) {
$bm = BandMember::getByUserID($uo->getID());
if ($bm->isActive()) {
if (USE_MOD_REWRITE) {
$poster = '<a href="' . SITE_WEB_DIRECTORY . '/member/' . $ID . '/">Read More</a>';
} else {
示例6: SectionTemplate
$tst = new SectionTemplate();
$tst->file = "tour_shows.php";
$tst->args['tour'] = $t;
$photoArea = $t->getPhotoAreaObject();
if (!db::isError($photoArea)) {
$numPhotos = $photoArea->getNumFiles();
if ($numPhotos > 0) {
$photos = new SectionTemplate();
$photos->file = "gallery.php";
$photos->args['area'] =& $photoArea;
if (USE_MOD_REWRITE) {
$photos->args['url'] = '/tour/' . $t->getID();
} else {
$photos->args['url'] = '/tours.php?id=' . $t->getID();
}
}
}
$avArea = $t->getAVAreaObject();
if (!db::isError($avArea)) {
$numAudio = $avArea->getNumFiles();
if ($numAudio > 0) {
$av = new SectionTemplate();
$av->file = "media_list.php";
$av->args['area'] =& $avArea;
if (USE_MOD_REWRITE) {
$av->args['url'] = '/tour/' . $t->getID();
} else {
$av->args['url'] = '/tours.php?id=' . $t->getID();
}
}
}
示例7:
if (!db::isError($r)) {
?>
<div id="breadcrumb">
<a href="index.php">Audition ></a>
<a href="releases.php">Releases ></a>
<a href="release_edit.php?id=<?php
echo $_GET['id'];
?>
">View/Edit Release ></a>
Add Track
</div>
<?php
if (User::isAdmin()) {
if (db::isError($rt)) {
$rt->outputList();
}
?>
<h1>add new entry:</h1>
<div class="inset">
<form id="add_new_entry" action="<?php
echo $PHP_SELF;
?>
?id=<?php
echo $_GET['id'];
?>
" method="post">
<table border="0" class="edit-form" cellspacing="0" cellpadding="0">
<tr>
示例8:
echo $l->getName();
?>
</a></td>
<td valign="top"><?php
echo $l->getURL();
if (!$l->isActive()) {
?>
<img src="images/inactive.gif" alt="Entry is Inactive" width="10" height="10" title="Entry is Inactive"><?php
}
?>
</td>
</tr>
<?php
}
}
if (count($ll) == 0 || db::isError($ll)) {
?>
<tr>
<td colspan="2"><strong>No Links</strong></td>
</tr>
<?php
}
?>
</table>
</p>
</div>
<?php
}
}
?>
示例9:
<?php
if (is_object($ma)) {
// inherited, required. We're trusting the parent to check ma for errors.
?>
<h1>media:</h1>
<div class="inset">
<?php
$mArray = $ma->getMedia();
if (!db::isError($mArray)) {
if (count($mArray) > 0) {
?>
<table class="list" border="0" cellspacing="1" cellpadding="0">
<tr>
<?php
if ($canEdit) {
?>
<td class="header"> </td>
<?php
}
?>
<td class="header">Filename</td>
<td class="header">Title</td>
</tr>
<?php
for ($i = 0; $i < count($mArray); $i++) {
$me = $mArray[$i];
?>
示例10: array
$stylesheet = 'popup.css';
include 'layout/header_popup.php';
if (User::isAdmin()) {
?>
<?php
if (!db::isError($r)) {
$selectedBMArray = $r->getReleaseBandMembers();
if (!db::isError($selectedBMArray)) {
$bmIDArray = array();
foreach ($selectedBMArray as $bm) {
$bmIDArray[] = $bm->getID();
}
unset($selectedBMArray);
$bmArray = BandMemberList::get_band_members();
if (!db::isError($selectedBbmArrayMArray)) {
?>
<h1><?php
echo $r->getTitle();
?>
</h1>
<div class="inset">
<form id="add_alias" action="<?php
echo $PHP_SELF;
?>
?task=select&id=<?php
echo $_GET['id'];
?>
" method="post">
<table class="list" border="0" cellspacing="1" cellpadding="0">
示例11: UserList
$ul = new UserList();
$userlist = $ul->get($_GET['entries_per_page'], $_GET['start']);
$news_total = $ul->getTotal();
include 'layout/header.php';
?>
<div id="breadcrumb">
<a href="index.php">Audition ></a> <a href="admin.php">Administer Audition ></a> Users
</div>
<?php
$u = User::getCurrent();
if (!$u->isAdmin()) {
Error::outputDialog('Return to Main Menu', 'index.php', 'Only an administrator may access administrator options.');
} else {
if (db::isError($newslist)) {
$newslist->outputList();
}
?>
<h1>users:</h1>
<div class="inset">
<p>
<form id="amount_form" action="<?php
echo $PHP_SELF;
?>
" method="get">
<a href="admin_user_add.php">Add User</a><span class="padded">|</span>
<?php
include 'layout/paging.php';
?>
示例12: mergeErrors
function mergeErrors($errorArray)
{
$e = new Error();
foreach ($errorArray as $_e) {
if (db::isError($_e)) {
$_error = $_e->_error;
foreach ($_error as $es) {
$e->add($es);
}
}
}
return $e;
}
示例13: array
$calendar = true;
$section = 'band_members';
$editors = array('equipment', 'influences', 'bio');
$page_title = 'Add Band Member';
include 'layout/header.php';
?>
<div id="breadcrumb">
<a href="index.php">Audition ></a> <a href="band.php">Manage Band ></a> <a href="band_members.php">Band Members ></a> Add Band Member
</div>
<?php
if (!User::isAdmin()) {
$bm->outputDialog('Return to Band Members', 'band_members.php', 'You may not add a band member.');
} else {
if (db::isError($bm)) {
$bm->outputList();
}
?>
<h1>add band member:</h1>
<div class="inset">
<form id="edit_entry" action="<?php
echo $PHP_SELF;
?>
" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="edit-form">
<tr>
<td width="50%"><strong>Username</strong><br/><input type="text" name="username" value="<?php
示例14: registerMedia
function registerMedia($mediaType)
{
$type = $mediaType == 'av' ? 'av' : 'photos';
if (User::isAdmin()) {
if ($type == 'av' && $this->av_area_id < 1 || $type == 'photos' && $this->photo_area_id < 1) {
$areaTitle = $type == 'av' ? "Tour Audio/Video: " : "Tour Photos: ";
$areaIDField = $type == 'av' ? "av_area_id" : "photo_area_id";
if ($type == 'av') {
$allowed_extensions = MEDIA_EXTENSIONS_ALLOWED_AV;
$display = "list";
} else {
$allowed_extensions = MEDIA_EXTENSIONS_ALLOWED_PHOTO;
$display = "grid";
}
$ma = MediaArea::add(0, $areaTitle . $this->title, null, $allowed_extensions, $display);
if (db::isError($ma)) {
return $ma;
}
$ma->activate();
$q = "update Tours set {$areaIDField} = " . $ma->getID() . " where ID = {$this->ID}";
$r = mysql_query($q);
if (!$r) {
return Error::MySQL();
} else {
return $r;
}
return $r;
} else {
return Error::create("A tour with an ID of {$this->ID} is already registered.");
}
} else {
return Error::create('Only an admin user may authorize a tour for media.');
}
}
示例15: header
header('Location: release_edit.php?id=' . $r->getID());
}
}
$editors = array('notes', 'press_notes');
$calendar = true;
$page_title = 'Add Release';
include 'layout/header.php';
?>
<div id="breadcrumb">
<a href="index.php">Audition ></a>
<a href="releases.php">Releases ></a>
</div>
<?php
if (db::isError($r)) {
$r->outputList();
}
if (User::isAdmin()) {
?>
<h1>new entry:</h1>
<div class="inset">
<form id="add_new_entry" action="<?php
echo $PHP_SELF;
?>
" method="post">
<table border="0" class="edit-form" cellspacing="0" cellpadding="0">
<tr>
<td width="33%"><strong>Title</strong><br/><input type="text" name="title" class="text" value="<?php
echo $_POST['title'];