本文整理汇总了PHP中Photograph::attach_file_bus_personnel方法的典型用法代码示例。如果您正苦于以下问题:PHP Photograph::attach_file_bus_personnel方法的具体用法?PHP Photograph::attach_file_bus_personnel怎么用?PHP Photograph::attach_file_bus_personnel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photograph
的用法示例。
在下文中一共展示了Photograph::attach_file_bus_personnel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Photograph
$session->message("Success! Your password was updated. ");
redirect_to('admin-view-profile.php');
} else {
$session->message("Error! Your password could not be updated. ");
}
} else {
$session->message("Error! The existing password did not match. ");
}
}
if (isset($_POST['upload'])) {
$photo = new Photograph();
$photo->related_object_type = '4';
$photo->related_object_id = $user->id;
$photo->photo_type = 9;
// photo_type 9 is "User Profile"
$photo->attach_file_bus_personnel($_FILES['file_upload'], $user->id, $user->first_name, $user->last_name);
if ($photo->save()) {
$session->message("Success! The photo was uploaded successfully. ");
redirect_to('admin-view-profile.php');
} else {
$message = join("<br />", $photo->errors);
}
}
} else {
//everyone else
$session->message("Error! You do not have sufficient priviledges to view the requested page. ");
redirect_to("index.php");
}
}
} else {
//not logged in... GTFO!
示例2: Photograph
$session->message("Success! The user's password was updated. ");
redirect_to('admin-list-bus-personnel.php');
} else {
$session->message("Error! The user's password could not be updated. ");
}
} else {
$session->message("Error! The existing password did not match. ");
}
}
if (isset($_POST['upload'])) {
$photo_to_upload = new Photograph();
$photo_to_upload->related_object_type = '4';
$photo_to_upload->related_object_id = $_GET['personnelid'];
$photo_to_upload->photo_type = '9';
// photo_type 9 is "User Profile"
$photo_to_upload->attach_file_bus_personnel($_FILES['file_upload'], $bus_personnel_to_read_update->id, $bus_personnel_to_read_update->first_name, $bus_personnel_to_read_update->last_name);
if ($photo_to_upload->save()) {
$session->message("Success! The photo was uploaded successfully. ");
redirect_to('admin-list-bus-personnel.php');
} else {
$message = join("<br />", $photo_to_upload->errors);
}
}
} else {
//everyone else
$session->message("Error! You do not have sufficient priviledges to view the requested page. ");
redirect_to("index.php");
}
} else {
//not logged in... GTFO!
$session->message("Error! You must login to view the requested page. ");