source: schedule/js/function.js@ 15497

Last change on this file since 15497 was 15497, checked in by tanio, 12 years ago
update with database
File size: 11.6 KB
Line 
1 $(document).ready(function(){
2 var cnt=2;
3 var table = document.createElement("table");
4 table.setAttribute('id',"table2");
5 table.setAttribute('width','100%');
6 var tr = document.createElement('tr');
7 var td3=document.createElement('td');
8 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
9 td3.appendChild(
10 input = document.createElement("input"),
11 input.setAttribute("type","time"),
12 input.setAttribute("id","Time"),
13 input.setAttribute("max","24"),
14 input.setAttribute("min","1"),
15 input.setAttribute("required")
16 )
17 var td=document.createElement('td');
18 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
19 td.appendChild(
20 sourcecbo= document.createElement('select'),
21 sourcecbo.setAttribute('id','source'),
22 sourcecbo.appendChild(
23 option=document.createElement('option'),
24
25 option.setAttribute('value','1'),
26 option.setAttribute('selected',true),
27
28 option.appendChild(document.createTextNode("Mrk 501"))
29
30
31 ),
32 sourcecbo.setAttribute('id','source')
33
34 );
35 var td1=document.createElement('td');
36 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
37 td1.appendChild(
38 measurementcbo= document.createElement('select'),
39 measurementcbo.setAttribute('id','measurement'),
40 measurementcbo.appendChild(
41 option=document.createElement('option'),
42 option.setAttribute('value','1'),
43 option.setAttribute('selected',true),
44 option.appendChild(document.createTextNode("Calibration"))
45 ),
46 measurementcbo.setAttribute('id','measurement')
47 );
48 var td2=document.createElement('td');
49 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
50 td2.appendChild(
51 input = document.createElement('input'),
52 input.setAttribute('type','text'),
53 input.setAttribute('id','txtData')
54
55 );
56 var td4=document.createElement('td');
57 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
58 td4.appendChild(
59 button = document.createElement('input'),
60 button.setAttribute("type",'button'),
61 button.setAttribute('id','btnSplit'),
62 button.setAttribute('value','Split'),
63 button.onclick= function()
64 {
65 split1();
66 }
67 );
68 td4.appendChild(
69 button=document.createElement('input'),
70 button.setAttribute('type','button'),
71 button.setAttribute('value','Delete'),
72 button.setAttribute('id','btnDelete'),
73 button.onclick=function(){
74 $('#table2').remove();
75 }
76 );
77 tr.appendChild(td3);
78 tr.appendChild(td);
79 tr.appendChild(td1);
80 tr.appendChild(td2);
81 tr.appendChild(td4);
82 table.appendChild(tr);
83 $('#TableH1').append(table);
84
85
86 var table = document.createElement("table");
87 table.setAttribute('id',"table1");
88 table.setAttribute('width','100%');
89 var tr = document.createElement('tr');
90 tr.setAttribute('id','');
91 tr.setAttribute('class','');
92 var td3=document.createElement('td');
93 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
94 td3.appendChild(
95 input = document.createElement("input"),
96 input.setAttribute("type","time"),
97 input.setAttribute("id","Time"),
98 input.setAttribute("max","24"),
99 input.setAttribute("min","1"),
100 input.setAttribute("required")
101 )
102 var td=document.createElement('td');
103 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
104 td.appendChild(
105 sourcecbo= document.createElement('select'),
106 sourcecbo.setAttribute('id','source'),
107 sourcecbo.appendChild(
108 option=document.createElement('option'),
109 option.setAttribute('value','1'),
110 option.setAttribute('selected',true),
111 option.appendChild(document.createTextNode("Mrk 501"))
112
113 ),
114 sourcecbo.setAttribute('id','source')
115
116 );
117 var td1=document.createElement('td');
118 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
119 td1.appendChild(
120 measurementcbo= document.createElement('select'),
121 measurementcbo.setAttribute('id','measurement'),
122 measurementcbo.appendChild(
123 option=document.createElement('option'),
124 option.setAttribute('value','1'),
125 option.setAttribute('selected',true),
126 option.appendChild(document.createTextNode("Calibration"))
127 ),
128 measurementcbo.setAttribute('id','measurement')
129 );
130 var td2=document.createElement('td');
131 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
132 td2.appendChild(
133 input = document.createElement('input'),
134 input.setAttribute('type','text'),
135 input.setAttribute('id','txtData')
136
137 );
138 var td4=document.createElement('td');
139 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
140 td4.appendChild(
141 button = document.createElement('input'),
142 button.setAttribute("type",'button'),
143 button.setAttribute('id','btnSplit'),
144 button.setAttribute('value','Split'),
145 button.onclick= function()
146 {
147 split();
148 }
149 );
150 td4.appendChild(
151 button=document.createElement('input'),
152 button.setAttribute('type','button'),
153 button.setAttribute('value','Delete'),
154 button.setAttribute('id','btnDelete'),
155 button.onclick=function(){
156 $('#table1').remove();
157
158 }
159 );
160 tr.appendChild(td3);
161 tr.appendChild(td);
162 tr.appendChild(td1);
163 tr.appendChild(td2);
164 tr.appendChild(td4);
165 table.appendChild(tr);
166 $('#TableH').append(table);
167
168 function split()
169 {
170 cnt++;
171 var table = document.createElement("table");
172 table.setAttribute('id',"table"+cnt);
173 table.setAttribute('width','100%');
174 var tr = document.createElement('tr');
175 tr.setAttribute('id','');
176 tr.setAttribute('class','');
177 var td3=document.createElement('td');
178 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
179 td3.appendChild(
180 input = document.createElement("input"),
181 input.setAttribute("type","time"),
182 input.setAttribute("id","Time"),
183 input.setAttribute("max","24"),
184 input.setAttribute("min","1"),
185 input.setAttribute("required")
186 )
187 var td=document.createElement('td');
188 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
189 td.appendChild(
190 sourcecbo= document.createElement('select'),
191 sourcecbo.setAttribute('id','source'),
192 sourcecbo.appendChild(
193 option=document.createElement('option'),
194 option.setAttribute('value','1'),
195 option.setAttribute('selected',true),
196 option.appendChild(document.createTextNode("Mrk 501"))
197
198 ),
199 sourcecbo.setAttribute('id','source')
200
201 );
202 var td1=document.createElement('td');
203 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
204 td1.appendChild(
205 measurementcbo= document.createElement('select'),
206 measurementcbo.setAttribute('id','measurement'),
207 measurementcbo.appendChild(
208 option=document.createElement('option'),
209 option.setAttribute('value','1'),
210 option.setAttribute('selected',true),
211 option.appendChild(document.createTextNode("Calibration"))
212 ),
213 measurementcbo.setAttribute('id','measurement')
214 );
215 var td2=document.createElement('td');
216 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
217 td2.appendChild(
218 input = document.createElement('input'),
219 input.setAttribute('type','text'),
220 input.setAttribute('id','txtData')
221
222 );
223 var td4=document.createElement('td');
224 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
225 td4.appendChild(
226 button = document.createElement('input'),
227 button.setAttribute("type",'button'),
228 button.setAttribute('id','btnSplit'),
229 button.setAttribute('value','Split'),
230 button.onclick=function(){
231 split();
232 }
233 );
234 td4.appendChild(
235 button=document.createElement('input'),
236 button.setAttribute('type','button'),
237 button.setAttribute('value','Delete'),
238 button.setAttribute('id','btnDelete'),
239 button.onclick=function(){
240 $('#table'+cnt).remove();
241 cnt--;
242 }
243 );
244 tr.appendChild(td3);
245 tr.appendChild(td);
246 tr.appendChild(td1);
247 tr.appendChild(td2);
248 tr.appendChild(td4);
249 table.appendChild(tr);
250 $('#TableH').append(table);
251 }
252 function split1()
253 {
254 cnt++;
255 var table = document.createElement("table");
256 table.setAttribute('id',"table"+cnt);
257 table.setAttribute('width','100%');
258 var tr = document.createElement('tr');
259 tr.setAttribute('id','');
260 tr.setAttribute('class','');
261 var td3=document.createElement('td');
262 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
263 td3.appendChild(
264 input = document.createElement("input"),
265 input.setAttribute("type","time"),
266 input.setAttribute("id","Time"),
267 input.setAttribute("max","24"),
268 input.setAttribute("min","1"),
269 input.setAttribute("required")
270 )
271 var td=document.createElement('td');
272 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
273 td.appendChild(
274 sourcecbo= document.createElement('select'),
275 sourcecbo.setAttribute('id','source'),
276 sourcecbo.appendChild(
277 option=document.createElement('option'),
278 option.setAttribute('value','1'),
279 option.setAttribute('selected',true),
280 option.appendChild(document.createTextNode("Mrk 501"))
281
282 ),
283 sourcecbo.setAttribute('id','source')
284
285 );
286 var td1=document.createElement('td');
287 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
288 td1.appendChild(
289 measurementcbo= document.createElement('select'),
290 measurementcbo.setAttribute('id','measurement'),
291 measurementcbo.appendChild(
292 option=document.createElement('option'),
293 option.setAttribute('value','1'),
294 option.setAttribute('selected',true),
295 option.appendChild(document.createTextNode("Calibration"))
296 ),
297 measurementcbo.setAttribute('id','measurement')
298 );
299 var td2=document.createElement('td');
300 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
301 td2.appendChild(
302 input = document.createElement('input'),
303 input.setAttribute('type','text'),
304 input.setAttribute('id','txtData')
305
306 );
307 var td4=document.createElement('td');
308 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
309 td4.appendChild(
310 button = document.createElement('input'),
311 button.setAttribute("type",'button'),
312 button.setAttribute('id','btnSplit'),
313 button.setAttribute('value','Split'),
314 button.onclick=function(){
315 split();
316 }
317 );
318 td4.appendChild(
319 button=document.createElement('input'),
320 button.setAttribute('type','button'),
321 button.setAttribute('value','Delete'),
322 button.setAttribute('id','btnDelete'),
323 button.onclick=function(){
324 $('#table'+cnt).remove();
325 cnt--;
326 });
327 tr.appendChild(td3);
328 tr.appendChild(td);
329 tr.appendChild(td1);
330 tr.appendChild(td2);
331 tr.appendChild(td4);
332 table.appendChild(tr);
333 $('#TableH1').append(table);
334 }
335 });
Note: See TracBrowser for help on using the repository browser.