source: schedule/function/SplitDelete.php@ 16276

Last change on this file since 16276 was 16276, checked in by tanio, 12 years ago
File size: 13.3 KB
Line 
1<script type="text/javascript">
2 $(document).ready(function(){
3 var cnt=2;
4 var table = document.createElement("table");
5 table.setAttribute('id',"table2");
6 table.setAttribute('width','100%');
7 var tr = document.createElement('tr');
8 var td3=document.createElement('td');
9 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
10 td3.appendChild(
11 input = document.createElement("input"),
12 input.setAttribute("type","time"),
13 input.setAttribute("id","Time1"),
14 input.setAttribute("max","24"),
15 input.setAttribute("min","1"),
16 input.setAttribute("required")
17 )
18 var td=document.createElement('td');
19 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
20 td.appendChild(
21 sourcecbo= document.createElement('select'),
22 sourcecbo.setAttribute('id','source1'),
23<?php
24 $source=mysql_query("SELECT*FROM source");
25 while($rowsource=mysql_fetch_array($source))
26 {
27?>
28 sourcecbo.appendChild(
29 option=document.createElement('option'),
30
31 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
32 option.setAttribute('selected',true),
33
34 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
35
36
37 ),
38<?php
39 }
40?>
41 sourcecbo.setAttribute('id','source1')
42
43 );
44 var td1=document.createElement('td');
45 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
46 td1.appendChild(
47 measurementcbo= document.createElement('select'),
48 measurementcbo.setAttribute('id','measurement1'),
49<?php
50 $measure=mysql_query("SELECT*FROM measurement");
51 while($rowmeasure=mysql_fetch_array($measure))
52 {
53?>
54 measurementcbo.appendChild(
55 option=document.createElement('option'),
56 option.setAttribute('value','<?php echo $rowmeasure['fMeasurementKey']; ?>'),
57 option.setAttribute('selected',true),
58 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
59 ),
60<?php
61 }
62?>
63 measurementcbo.setAttribute('id','measurement1')
64 );
65 var td2=document.createElement('td');
66 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
67 td2.appendChild(
68 input = document.createElement('input'),
69 input.setAttribute('type','text'),
70 input.setAttribute('id','txtData1')
71
72 );
73 var td4=document.createElement('td');
74 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
75 td4.appendChild(
76 button = document.createElement('input'),
77 button.setAttribute("type",'button'),
78 button.setAttribute('id','btnSplit'),
79 button.setAttribute('value','Split'),
80 button.onclick= function()
81 {
82 split1();
83 }
84 );
85 td4.appendChild(
86 button=document.createElement('input'),
87 button.setAttribute('type','button'),
88 button.setAttribute('value','Delete'),
89 button.setAttribute('id','btnDelete'),
90 button.onclick=function(){
91 $('#table2').remove();
92 }
93 );
94 tr.appendChild(td3);
95 tr.appendChild(td1);
96 tr.appendChild(td);
97
98 tr.appendChild(td2);
99 tr.appendChild(td4);
100 table.appendChild(tr);
101 $('#TableH1').append(table);
102
103
104 var table = document.createElement("table");
105 table.setAttribute('id',"table1");
106 table.setAttribute('width','100%');
107 var tr = document.createElement('tr');
108 tr.setAttribute('id','');
109 tr.setAttribute('class','');
110 var td3=document.createElement('td');
111 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
112 td3.appendChild(
113 input = document.createElement("input"),
114 input.setAttribute("type","time"),
115 input.setAttribute("id","Time2"),
116 input.setAttribute("max","24"),
117 input.setAttribute("min","1"),
118 input.setAttribute("required")
119 )
120 var td=document.createElement('td');
121 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
122 td.appendChild(
123 sourcecbo= document.createElement('select'),
124 sourcecbo.setAttribute('id','source2'),
125<?php
126 $source=mysql_query("SELECT*FROM source");
127 while($rowsource=mysql_fetch_array($source))
128 {
129?>
130 sourcecbo.appendChild(
131 option=document.createElement('option'),
132 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
133 option.setAttribute('selected',true),
134 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
135
136 ),
137<?php
138 }
139 ?>
140 sourcecbo.setAttribute('id','source2')
141
142 );
143 var td1=document.createElement('td');
144 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
145 td1.appendChild(
146 measurementcbo= document.createElement('select'),
147 measurementcbo.setAttribute('id','measurement2'),
148<?php
149 $measure=mysql_query("SELECT*FROM measurement");
150 while($rowmeasure=mysql_fetch_array($measure))
151 {
152?>
153 measurementcbo.appendChild(
154 option=document.createElement('option'),
155 option.setAttribute('value','<?php echo $rowmeasure['fMeasurementKey']; ?>'),
156 option.setAttribute('selected',true),
157 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
158 ),
159<?php
160 }
161?>
162 measurementcbo.setAttribute('id','measurement2')
163 );
164 var td2=document.createElement('td');
165 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
166 td2.appendChild(
167 input = document.createElement('input'),
168 input.setAttribute('type','text'),
169 input.setAttribute('id','txtData2')
170
171 );
172 var td4=document.createElement('td');
173 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
174 td4.appendChild(
175 button = document.createElement('input'),
176 button.setAttribute("type",'button'),
177 button.setAttribute('id','btnSplit'),
178 button.setAttribute('value','Split'),
179 button.onclick= function()
180 {
181 split();
182 }
183 );
184 td4.appendChild(
185 button=document.createElement('input'),
186 button.setAttribute('type','button'),
187 button.setAttribute('value','Delete'),
188 button.setAttribute('id','btnDelete'),
189 button.onclick=function(){
190 $('#table1').remove();
191
192 }
193 );
194 tr.appendChild(td3);
195 tr.appendChild(td1);
196 tr.appendChild(td);
197
198 tr.appendChild(td2);
199 tr.appendChild(td4);
200 table.appendChild(tr);
201 $('#TableH').append(table);
202
203 function split()
204 {
205 cnt++;
206 var table = document.createElement("table");
207 table.setAttribute('id',"table"+cnt);
208 table.setAttribute('width','100%');
209 var tr = document.createElement('tr');
210 tr.setAttribute('id','');
211 tr.setAttribute('class','');
212 var td3=document.createElement('td');
213 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
214 td3.appendChild(
215 input = document.createElement("input"),
216 input.setAttribute("type","time"),
217 input.setAttribute("id","Time"+cnt),
218 input.setAttribute("max","24"),
219 input.setAttribute("min","1"),
220 input.setAttribute("required")
221 )
222 var td=document.createElement('td');
223 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
224 td.appendChild(
225 sourcecbo= document.createElement('select'),
226 sourcecbo.setAttribute('id','source'+cnt),
227<?php
228 $source=mysql_query("SELECT*FROM source");
229 while($rowsource=mysql_fetch_array($source))
230 {
231?>
232 sourcecbo.appendChild(
233 option=document.createElement('option'),
234 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
235 option.setAttribute('selected',true),
236 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
237
238 ),
239<?php
240 }
241 ?>
242 sourcecbo.setAttribute('id','source'+cnt)
243
244 );
245 var td1=document.createElement('td');
246 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
247 td1.appendChild(
248 measurementcbo= document.createElement('select'),
249 measurementcbo.setAttribute('id','measurement'+cnt),
250<?php
251 $measure=mysql_query("SELECT*FROM measurement");
252 while($rowmeasure=mysql_fetch_array($measure))
253 {
254?>
255 measurementcbo.appendChild(
256 option=document.createElement('option'),
257 option.setAttribute('value','<?php echo $rowmeasure['fMeasurementKey']; ?>'),
258 option.setAttribute('selected',true),
259 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
260 ),
261<?php
262 }
263?>
264 measurementcbo.setAttribute('id','measurement'+cnt)
265 );
266 var td2=document.createElement('td');
267 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
268 td2.appendChild(
269 input = document.createElement('input'),
270 input.setAttribute('type','text'),
271 input.setAttribute('id','txtData'+cnt)
272
273 );
274 var td4=document.createElement('td');
275 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
276 td4.appendChild(
277 button = document.createElement('input'),
278 button.setAttribute("type",'button'),
279 button.setAttribute('id','btnSplit'),
280 button.setAttribute('value','Split'),
281 button.onclick=function(){
282 split();
283 }
284 );
285 td4.appendChild(
286 button=document.createElement('input'),
287 button.setAttribute('type','button'),
288 button.setAttribute('value','Delete'),
289 button.setAttribute('id','btnDelete'),
290 button.onclick=function(){
291 $('#table'+cnt).remove();
292 cnt--;
293 }
294 );
295 tr.appendChild(td3);
296 tr.appendChild(td1);
297 tr.appendChild(td);
298
299 tr.appendChild(td2);
300 tr.appendChild(td4);
301 table.appendChild(tr);
302 $('#TableH1').append(table);
303 }
304 function split1()
305 {
306 cnt++;
307 var table = document.createElement("table");
308 table.setAttribute('id',"table"+cnt);
309 table.setAttribute('width','100%');
310 var tr = document.createElement('tr');
311 tr.setAttribute('id','');
312 tr.setAttribute('class','');
313 var td3=document.createElement('td');
314 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
315 td3.appendChild(
316 input = document.createElement("input"),
317 input.setAttribute("type","time"),
318 input.setAttribute("id","Time"+cnt),
319 input.setAttribute("max","24"),
320 input.setAttribute("min","1"),
321 input.setAttribute("required")
322 )
323 var td=document.createElement('td');
324 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
325 td.appendChild(
326 sourcecbo= document.createElement('select'),
327 sourcecbo.setAttribute('id','source'+cnt),
328<?php
329 $source=mysql_query("SELECT*FROM source");
330 while($rowsource=mysql_fetch_array($source))
331 {
332?>
333 sourcecbo.appendChild(
334 option=document.createElement('option'),
335 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
336 option.setAttribute('selected',true),
337 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
338
339 ),
340<?php
341 }
342 ?>
343 sourcecbo.setAttribute('id','source'+cnt)
344
345 );
346 var td1=document.createElement('td');
347 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
348 td1.appendChild(
349 measurementcbo= document.createElement('select'),
350 measurementcbo.setAttribute('id','measurement'+cnt),
351<?php
352 $measure=mysql_query("SELECT*FROM measurement");
353 while($rowmeasure=mysql_fetch_array($measure))
354 {
355?>
356 measurementcbo.appendChild(
357 option=document.createElement('option'),
358 option.setAttribute('value','<?php echo $rowmeasure['fMeasurementKey']; ?>'),
359 option.setAttribute('selected',true),
360 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
361 ),
362<?php
363 }
364?>
365 measurementcbo.setAttribute('id','measurement'+cnt)
366 );
367 var td2=document.createElement('td');
368 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
369 td2.appendChild(
370 input = document.createElement('input'),
371 input.setAttribute('type','text'),
372 input.setAttribute('id','txtData'+cnt)
373
374 );
375 var td4=document.createElement('td');
376 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
377 td4.appendChild(
378 button = document.createElement('input'),
379 button.setAttribute("type",'button'),
380 button.setAttribute('id','btnSplit'),
381 button.setAttribute('value','Split'),
382 button.onclick=function(){
383 split();
384 }
385 );
386 td4.appendChild(
387 button=document.createElement('input'),
388 button.setAttribute('type','button'),
389 button.setAttribute('value','Delete'),
390 button.setAttribute('id','btnDelete'),
391 button.onclick=function(){
392 $('#table'+cnt).remove();
393 cnt--;
394 });
395 tr.appendChild(td3);
396 tr.appendChild(td1);
397 tr.appendChild(td);
398
399 tr.appendChild(td2);
400 tr.appendChild(td4);
401 table.appendChild(tr);
402 $('#TableH1').append(table);
403 }
404 });
405 </script>
Note: See TracBrowser for help on using the repository browser.