当前位置: 首页>>代码示例>>PHP>>正文


PHP Photograph::attach_file_bus_stop方法代码示例

本文整理汇总了PHP中Photograph::attach_file_bus_stop方法的典型用法代码示例。如果您正苦于以下问题:PHP Photograph::attach_file_bus_stop方法的具体用法?PHP Photograph::attach_file_bus_stop怎么用?PHP Photograph::attach_file_bus_stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Photograph的用法示例。


在下文中一共展示了Photograph::attach_file_bus_stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Photograph

         $stop_to_read_update->name = $_POST['name'];
         $stop_to_read_update->location_latitude = $_POST['location_latitude'];
         $stop_to_read_update->location_longitude = $_POST['location_longitude'];
         if ($stop_to_read_update->update()) {
             $session->message("Success! The Bus Stop details were updated. ");
             redirect_to('admin-list-stops.php');
         } else {
             $session->message("Error! The Bus Stop details could not be updated. ");
         }
     }
     if (isset($_POST['upload'])) {
         $photo_to_upload = new Photograph();
         $photo_to_upload->related_object_type = '2';
         $photo_to_upload->related_object_id = $_GET['stopid'];
         $photo_to_upload->photo_type = $_POST['photo_type'];
         $photo_to_upload->attach_file_bus_stop($_FILES['file_upload'], $photo_to_upload->stop_id, $photo_to_upload->photo_type);
         if ($photo_to_upload->save()) {
             $session->message("Success! The photo was uploaded successfully. ");
             redirect_to('admin-list-stops.php');
         } else {
             $message = join("<br />", $photo_to_upload->errors);
         }
     }
 } 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);
     } else {
         //everyone else
         $session->message("Error! You do not have sufficient priviledges to view the requested page. ");
开发者ID:afthaj,项目名称:gaman-new,代码行数:31,代码来源:admin-read-update-stop.php


注:本文中的Photograph::attach_file_bus_stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。