本文整理汇总了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');
}
}
}
示例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'));
}
示例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);
}
}
示例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.';
示例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);