-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
137 lines (131 loc) · 5.14 KB
/
index.html
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Prueba Plugin</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link href="css/calhotel.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="js/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
<script src="js/moment-with-langs.min.js" type="text/javascript"></script>
<script src="js/jquery.calhotel.js" type="text/javascript"></script>
</head>
<body>
<div class="calhotel">
</div>
<script type="text/javascript">
//~$('.calhotel').calhotel();
//~$('.calhotel').calhotel('cambiaVista','semana');
//~$('.calhotel').calhotel({vistadef:'dia'});
//~$('.calhotel').calhotel('getVista');
$('.calhotel').calhotel({
//~vistadef: 'dia',
rooms:[
{
ser_codigo:1,//codigo de servicio
cuartonro:101,
numdescri: '101 EJS',
numcamas: 1
},
{
ser_codigo:2,//codigo de servicio
cuartonro:102,
numdescri: '102 EJS',
numcamas: 1
},
{
ser_codigo:3,//codigo de servicio
cuartonro:103,
numdescri: '103 EJS',
numcamas: 1
},
{
ser_codigo:4,//codigo de servicio
cuartonro:104,
numdescri: '104 EJD',
numcamas: 2
},
{
ser_codigo:5,//codigo de servicio
cuartonro:105,
numdescri: '105 EJD',
numcamas: 2
},
{
ser_codigo:6,//codigo de servicio
cuartonro:106,
numdescri: '106 EJT',
numcamas: 3
}
],
datosroom:[
{
fecha_inicia: moment('2014-04-22 10:40'), //obligatorio
fecha_fin: moment('2014-04-22 11:50'), //obligatorio
nombre_persona: 'Sr. Lopez',//obligatorio
cuartonro:101,
estado: 1 //ocupado
},
{
fecha_inicia: moment('2014-04-22 07:00'), //obligatorio
fecha_fin: moment('2014-04-23 19:00'), //obligatorio
nombre_persona: 'Sr. Almeida',//obligatorio
cuartonro:102,
estado: 0 //reservado
},
{
fecha_inicia: moment('2014-04-24 12:00'), //obligatorio
fecha_fin: moment('2014-04-24 13:00'), //obligatorio
nombre_persona: 'Mantenimiento',//obligatorio
cuartonro:104,
estado: 2
},
{
fecha_inicia: moment('2014-04-25 12:00'), //obligatorio
fecha_fin: moment('2014-04-25 13:00'), //obligatorio
nombre_persona: 'Bloqueado',//obligatorio
cuartonro:105,
estado: 3//bloqueado
},
{
fecha_inicia: moment('2014-04-21 12:00'), //obligatorio
fecha_fin: moment('2014-04-21 13:00'), //obligatorio
nombre_persona: 'Sr. Vargas',//obligatorio
cuartonro:103,
estado: 4 //pagado
},
{
fecha_inicia: moment('2014-04-20 12:00'), //obligatorio
fecha_fin: moment('2014-04-20 13:00'), //obligatorio
nombre_persona: 'Sr. Vargas',//obligatorio
cuartonro:101,
estado: 4 //pagado
}
],
clickHuesped: function(datos){
//~datos.estado = 1;
alert('Nombre: '+ datos.nombre_persona+"\n"+'Cuarto: '+ datos.cuartonro);
//~$('.calhotel').calhotel('renderOcupados');
},
selectCelda: function(fecini,fecfin,cuartos){
var cts = '';
var aux = '';
var f='';
if(fecini.isSame(fecfin)){
f=fecini.format('dddd D [de] MMMM, YYYY ');
}else{
f=fecini.format('dddd D [de] MMMM, YYYY ')+' - '+fecfin.format('dddd D [de] MMMM, YYYY ');
}
for(var i=0; i<cuartos.length;i++){
cts+='[ '+cuartos[i].numdescri + ' ] ';
}
alert(f+'\n'+cts);
}
});
//~ $('.calhotel').calhotel('renderOcupados');
//~$('.calhotel').calhotel('anterior');
//~$('.calhotel').calhotel('cambiaVista','dia');
//~$('.calhotel').calhotel('siguiente');
</script>
</body>
</html>