本文整理汇总了PHP中Photograph::get_profile_picture方法的典型用法代码示例。如果您正苦于以下问题:PHP Photograph::get_profile_picture方法的具体用法?PHP Photograph::get_profile_picture怎么用?PHP Photograph::get_profile_picture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photograph
的用法示例。
在下文中一共展示了Photograph::get_profile_picture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Photograph
$photo_object = new Photograph();
$admin_user_object = new AdminUser();
$bus_personnel_object = new BusPersonnel();
$route_object = new BusRoute();
$bus_object = new Bus();
$bus_bus_personnel_object = new BusBusPersonnel();
//check login
if ($session->is_logged_in()) {
if ($session->object_type == 5) {
$session->message("The requested page is for use by Bus Personnel only. ");
redirect_to("index.php");
} else {
if ($session->object_type == 4) {
//bus personnel
$user = $bus_personnel_object->find_by_id($_SESSION['id']);
$profile_picture = $photo_object->get_profile_picture($session->object_type, $user->id);
if ($user->role == 1 || $user->role == 4 || $user->role == 5) {
//bus_personnel that is logged in is an owner (role is 1 (Owner), 4 (Owner + Driver) or 5 (Owner + Conductor))
$buses = $bus_bus_personnel_object->get_buses_for_personnel($user->id);
} else {
if ($user->role == 2 || $user->role == 3) {
//bus_personnel that is logged in is not an owner
$buses = $bus_bus_personnel_object->get_buses_for_personnel($user->id);
}
}
} else {
//everyone else
$session->message("Error! You do not have sufficient priviledges to view the requested page. ");
redirect_to("index.php");
}
}
示例2: foreach
<tbody align="center">
<?php
foreach ($buses_bus_personnel as $bbp) {
$assigned_bus_personnel = $bus_personnel_object->find_by_id($bbp->bus_personnel_id);
?>
<tr>
<td>
<a href="admin-read-update-bus-personnel.php?personnelid=<?php
echo $assigned_bus_personnel->id;
?>
">
<?php
$pic = new Photograph();
$bus_personnel_profile_picture = $pic->get_profile_picture('4', $assigned_bus_personnel->id);
if (!empty($bus_personnel_profile_picture->filename)) {
echo '<img src="../../' . $bus_personnel_profile_picture->image_path() . '" width="100" class="img-rounded" />';
} else {
echo '<img src="../assets/img/default-prof-pic.jpg" width="100" class="img-rounded" alt="Please upload a profile picture" />';
}
?>
</a>
</td>
<td><a class="btn btn-block btn-info" href="admin-read-update-bus-personnel.php?personnelid=<?php
echo $assigned_bus_personnel->id;
?>
"><?php
echo $assigned_bus_personnel->full_name();
?>
</a></td>
示例3: AdminLevel
<td>Admin Level</td>
<td> </td>
<td> </td>
</tr>
<?php
for ($i = 0; $i < count($users); $i++) {
if ($users[$i]->id != $user->id) {
?>
<tr align="center">
<td>
<?php
$admin_level = new AdminLevel();
$pic = new Photograph();
$user_profile_picture = $pic->get_profile_picture('5', $users[$i]->id);
if (!empty($user_profile_picture->filename)) {
echo '<img src="../../' . $user_profile_picture->image_path() . '" width="100" class="img-rounded" />';
} else {
echo '<img src="../img/default-prof-pic.jpg" width="100" class="img-rounded" alt="Please upload a profile picture" />';
}
?>
</td>
<td><?php
echo $users[$i]->full_name();
?>
</td>
<td><?php
echo $users[$i]->username;
?>
</td>