本文整理汇总了PHP中Club::get_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Club::get_by_id方法的具体用法?PHP Club::get_by_id怎么用?PHP Club::get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Club
的用法示例。
在下文中一共展示了Club::get_by_id方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if (count($achievements) > 0) {
//echo ' <p>';
echo ' Achievements: ';
//echo ' <ul>';
foreach ($achievements as $achievement) {
echo ' ' . $achievement->name . ', ';
}
echo ' <br />';
//echo ' </div>';
}
if (count($clubusers) > 0) {
//echo ' <p>';
echo ' Clubs: ';
//echo ' <ul>';
foreach ($clubusers as $clubuser) {
$club = Club::get_by_id($clubuser->clubid);
echo ' <a href="club.php?id=' . $club->id . '">' . $club->name . '</a>, ';
}
echo ' <br />';
//echo ' </div>';
}
if (count($groupusers) > 0) {
//echo ' <br />';
echo ' Groups: ';
//echo ' <ul>';
foreach ($groupusers as $groupuser) {
$group = Group::get_by_id($groupuser->groupid);
echo ' <a href="group.php?id=' . $group->id . '">' . $group->name . '</a>, ';
}
//echo ' </p>';
//echo ' </div>';
示例2: header
<?php
require_once "header.php";
if (isset($_GET['id'])) {
$object = Club::get_by_id($_GET['id']);
if ($object == false || $object == null || $object == "") {
header("location: index.php");
}
} else {
header("location: index.php?negative");
}
if (!$session->is_logged_in()) {
header("location: index.php?negative");
} else {
$user = User::get_by_id($session->user_id);
if ($user->enabled == DISABLED) {
header("location: index.php?disabled");
}
if (!ClubUser::amIAdmin($session->user_id, $object->id) && !$user->is_super_admin()) {
header("location: index.php?negative");
}
}
$pathinfo = pathinfo($_SERVER["PHP_SELF"]);
$basename = $pathinfo["basename"];
$currentFile = str_replace(".php", "", $basename);
?>
<div class="container-fluid">
<div class="row-fluid">
<div class="span1"></div>
<div class="span9">
<form id="theform" class="form-horizontal" method="post" action="#" enctype="multipart/form-data">
示例3: ClubUser
$notification->itemtype = "sectionuser";
$notification->title = "Invites you";
$notification->create();
$response = "success";
} else {
$theuser = SectionUser::getUser($user->id, $_GET['sectionid']);
if ($theuser->pending == 0) {
$response = "This user is already a member.";
} else {
$response = "This user is already pending.";
}
}
} else {
if (isset($_GET['clubid'])) {
if (!ClubUser::userExists($user->id, $_GET['clubid'])) {
$club = Club::get_by_id($_GET['clubid']);
$object = new ClubUser();
$object->userid = $user->id;
$object->clubid = $club->id;
$object->level = 0;
$object->role = "student";
$object->enabled = 1;
$object->pending = 1;
$object->create();
$notification = new Notification();
$notification->fromuserid = $session->user_id;
$notification->touserid = $user->id;
$notification->itemid = $object->id;
$notification->itemtype = "clubuser";
$notification->title = "Invites you";
$notification->create();
示例4:
if ($notification->itemtype == "batchuser") {
$object = BatchUser::get_by_id($notification->itemid);
$batch = Batch::get_by_id($object->batchid);
$school = School::get_by_id($object->schoolid);
$html .= "Now a member in Batch <a href='batch.php?id=" . $batch->id . "'>" . $batch->get_batchyear() . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>";
} else {
if ($notification->itemtype == "sectionuser") {
$object = SectionUser::get_by_id($notification->itemid);
$section = Section::get_by_id($object->sectionid);
$batch = Batch::get_by_id($object->batchid);
$school = School::get_by_id($object->schoolid);
$html .= "Now a member in Section <a href='section.php?id=" . $section->id . "'>" . $section->name . "</a> of Batch <a href='batch.php?id=" . $batch->id . "'>" . $batch->get_batchyear() . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>";
} else {
if ($notification->itemtype == "clubuser") {
$object = ClubUser::get_by_id($notification->itemid);
$club = Club::get_by_id($object->clubid);
$school = School::get_by_id($object->schoolid);
$html .= "Now a member in Club <a href='club.php?id=" . $club->id . "'>" . $club->name . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>";
} else {
if ($notification->itemtype == "groupuser") {
$object = GroupUser::get_by_id($notification->itemid);
$group = Group::get_by_id($object->groupid);
$school = School::get_by_id($object->schoolid);
$html .= "Now a member in Group <a href='group.php?id=" . $group->id . "'>" . $group->name . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>";
}
}
}
}
}
}
$html .= "\t\t<button class='btn btn-mini btndelete pull-right'>x<span hidden class='notificationid'>" . $notification->id . "</span></button>";
示例5: Log
<?php
require_once "../initialize.php";
$id = $_GET['id'];
$object = Club::get_by_id($id);
ClubUser::delete_all_by_sectionid($object->id);
$object->delete();
$log = new Log($session->user_id, $clientip, "WEB", "DELETED CLUB: " . $object->id);
$log->create();
echo "success";
示例6: File
<?php
require_once "../initialize.php";
$message = "";
if (isset($_POST['clubid']) && $_POST['clubid'] != "" && isset($_POST['name']) && $_POST['name'] != "") {
$object = Club::get_by_id($_POST['clubid']);
$file = new File($_FILES['logo']);
if ($file->valid) {
$object->logo = $file->data;
} else {
$object->cover = base64_decode($object->cover);
}
$file = new File($_FILES['cover']);
if ($file->valid) {
$object->cover = $file->data;
} else {
$object->cover = base64_decode($object->cover);
}
if ($message == "") {
if (isset($_POST['schoolselect']) && $_POST['schoolselect'] != "NOTHING") {
$school = School::get_by_id($_POST['schoolselect']);
}
$object->schoolid = $school->id;
$object->name = $_POST['name'];
$object->about = $_POST['about'];
$object->enabled = $_POST['enabled'];
$object->comments = $_POST['comments'];
$object->fbcomments = $_POST['fbcomments'];
$object->update();
$log = new Log($session->user_id, $clientip, "WEB", "UPDATED CLUB: " . $object->id);
$log->create();