Repository navigation
Expand file tree
/
Copy pathrooms.js
More file actions
executable file
·88 lines (78 loc) · 2.11 KB
/
Copy pathrooms.js
File metadata and controls
executable file
·88 lines (78 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
$(function(){
var baseURL = getBaseURL();
$('.button').button();
$('.room_status').change(function() {
$.post(baseURL + 'room/update_room_status', {
room_id: $(this).parent().parent().attr('name').trim(),
room_status: $(this).parent().parent().find('select option:selected').text().trim()
}, function(results){
}, 'json');
});
$('.room_score').change(function() {
var room_score = $(this).parent().parent().find('.room_score').val().trim();
if(room_score >= 0 && room_score <=10)
{
$.post(baseURL + 'room/update_room_score', {
room_id: $(this).parent().parent().attr('name').trim(),
room_score: room_score
}, function(results){
if(results.success)
{
//alert('Room Score saved');
}
}, 'json');
}
else
{
alert(l('please enter score b/w 0 to 10'));
$(this).parent().parent().find('.room_score').val(0);
}
});
setTimeout(function(){
$('.table-rating tbody tr').each(function(i,v){
var width = $(this).find('.star-rating').val()*16;
if(width)
{
$(this).find('.stars').find('.rateit-selected').css('width',width+'px');
}
});
},2000);
$("#clean_all_rooms_dialog").dialog({
autoOpen: false,
title: l('Confirmation'),
resizable: false,
modal: false,
buttons: [
{
text: "Ok",
click: function() {
$.post(baseURL + 'room/set_rooms_clean', function(results) {
alert(l('All rooms set clean'));
window.location = baseURL + "room/";
});
$(this).dialog("close");
}
},
{
text: l("Cancel"),
click: function() { $(this).dialog("close"); }
} ]
});
$('#set_rooms_clean').click(function (){
$("#clean_all_rooms_dialog" ).dialog('open');
});
// when 'view notes' is clicked, open a dialog for viewing notes
$(".room_notes").click(function() {
var roomID = $(this).attr('name');
var url = baseURL + 'room/view_room_note_form/' + roomID + '/1';
// open the booking dialog once the content is loaded
$('#room_notes').html($('<iframe />', {
'id': 'room-note-dialog-iframe',
'scrolling': 'no',
'frameborder': 0,
'width': 460,
'height': 330,
"src": url
}));
});
});