本文整理汇总了PHP中Photograph::attach_file_bus方法的典型用法代码示例。如果您正苦于以下问题:PHP Photograph::attach_file_bus方法的具体用法?PHP Photograph::attach_file_bus怎么用?PHP Photograph::attach_file_bus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photograph
的用法示例。
在下文中一共展示了Photograph::attach_file_bus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Photograph
$bus_to_read_update->route_id = $_POST['route_id'];
$bus_to_read_update->reg_number = $_POST['reg_number'];
$bus_to_read_update->name = $_POST['name'];
if ($bus_to_read_update->update()) {
$session->message("Success! The Bus details were updated. ");
redirect_to('admin-list-buses.php');
} else {
$session->message("Error! The Bus details could not be updated. ");
}
}
if (isset($_POST['upload'])) {
$photo_to_upload = new Photograph();
$photo_to_upload->related_object_type = '3';
$photo_to_upload->related_object_id = $_GET['busid'];
$photo_to_upload->photo_type = $_POST['photo_type'];
$photo_to_upload->attach_file_bus($_FILES['file_upload'], $photo_to_upload->bus_id, $photo_to_upload->photo_type);
if ($photo_to_upload->save()) {
$session->message("Success! The photo was uploaded successfully. ");
redirect_to('admin-list-buses.php');
} else {
$message = join("<br />", $photo_to_upload->errors);
}
}
if (isset($_POST['assign'])) {
$buses_bus_personnel_to_read_update = new BusBusPersonnel();
$buses_bus_personnel_to_read_update->bus_id = $_GET['busid'];
$buses_bus_personnel_to_read_update->bus_personnel_id = $_POST['bus_personnel_id'];
if ($buses_bus_personnel_to_read_update->create()) {
$session->message("Success! The Bus Personnel was assigned to the given Bus. ");
redirect_to('admin-list-buses.php');
} else {