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


PHP Room::update方法代码示例

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


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

示例1: doEdit

function doEdit()
{
    $rmid = $_GET['id'];
    if (isset($_POST['save'])) {
        if ($_POST['rmname'] == "" or $_POST['roomdesc'] == "") {
            $message = "All field is required!";
            redirect('index.php?view=edit&id=' . $rmid);
        } else {
            $room = new Room();
            $rmid = $_POST['roomid'];
            $rmname = $_POST['rmname'];
            $rmdesc = $_POST['roomdesc'];
            $room->ROOM_ID = $rmid;
            $room->ROOM_NAME = $rmname;
            $room->ROOM_DESC = $rmdesc;
            $room->update($rmid);
            $message = $rmname . " has updated successfully!";
            redirect('index.php');
        }
    }
}
开发者ID:allybitebo,项目名称:CCECourseCatalogue,代码行数:21,代码来源:controller.php

示例2: save_order

 public function save_order()
 {
     $room_array = $_POST['room_id'];
     $order_array = $_POST['order'];
     $room = new Room();
     foreach ($room_array as $key => $value) {
         $room_id = $value;
         $room_order = $order_array[$key];
         $room->update('Room', array('sequence' => $room_order), 'id=' . $room_id);
     }
     Flash::set('success', __('This room sequence has been saved.'));
     redirect(get_url('room'));
 }
开发者ID:sindotnet,项目名称:dashhotel,代码行数:13,代码来源:RoomController.php

示例3: Room

 public static function Room($type, $data)
 {
     require_once 'room.class.php';
     $class = new Room();
     $status = false;
     $class->setData($data);
     switch ($type) {
         case 'add':
             $status = $class->add();
             break;
         case 'update':
             $status = $class->update();
             break;
         case 'delete':
             $status = $class->delete();
             break;
         case 'getsingle':
             $status = $class->getsingle();
             break;
         case 'getpage':
             $status = $class->getpage();
             break;
         case 'search':
             $status = $class->search();
             break;
         default:
             break;
     }
     if ($status) {
         wp_send_json_success($status);
     } else {
         wp_send_json_error($class->error);
     }
 }
开发者ID:khiconit,项目名称:Device-manager,代码行数:34,代码来源:ManagementAdmin.class.php

示例4: switch

                 }
             }
             break;
     }
 } else {
     switch ($verb) {
         case 'POST':
             echo 'Cannot overwrite existing room.';
             exit_with_status_code(409);
         case 'PUT':
             $room_name = $_REQUEST['name'];
             if (empty($room_name)) {
                 echo 'Room name cannot be null.';
                 exit_with_status_code(400);
             } else {
                 $updated_room = Room::update($room_id, $room_name);
                 if ($updated_room) {
                     echo 'Successfully updated room.';
                     exit_with_status_code(201);
                 } else {
                     echo 'Error updating room.';
                     exit_with_status_code(400);
                 }
             }
         case 'GET':
             $room = Room::get($room_id);
             if ($room) {
                 echo $room->to_json();
                 exit_with_status_code(200);
             } else {
                 echo 'Room not found.';
开发者ID:Ollie1700,项目名称:webscrp-coursework,代码行数:31,代码来源:api.1.0.php

示例5: setEventMessage

        setEventMessage('<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")) . '</div>');
    }
    $res = $obj_room->fetch($roomid);
    if (!$res) {
        $error++;
        setEventMessage('<div class="error">' . $langs->trans("ErrorFailedToLoadRoom", $langs->transnoentities("Id")) . '</div>');
    }
    if (!$error) {
        $obj_room->ref = $ref;
        $obj_room->label = GETPOST("label", 'alpha');
        $obj_room->fk_floor = GETPOST("fk_floor", 'int');
        $obj_room->type_code = GETPOST("fk_type_room", 'alpha');
        $obj_room->capacity = GETPOST("capacity", 'int');
        $obj_room->note_public = GETPOST("note_public");
        $obj_room->note_private = GETPOST("note_private");
        $result = $obj_room->update($user);
        if ($result > 0) {
            Header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
            exit;
        } else {
            setEventMessage('<div class="error">' . $obj_room->error . '</div>');
            $action = 'editroom';
        }
    } else {
        $action = 'editroom';
    }
} else {
    if ($action == 'confirm_deleteroom' && $confirm == 'yes' && $user->rights->place->write) {
        $ret = $obj_room->fetch($roomid);
        if ($ret) {
            $result = $obj_room->delete($user);
开发者ID:abbenbouchta,项目名称:immobilier,代码行数:31,代码来源:rooms.php


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