source: schedule/Module/control.php@ 17553

Last change on this file since 17553 was 17543, checked in by tose, 11 years ago
Updated disabled controls
File size: 28.4 KB
Line 
1<script>
2'use strict';
3var ctr;
4var testdata = "old data";
5var pastdata = false;
6var transPrevNight = 1;
7
8 function clearNode(node){
9 var child = node.childNodes[0];
10 while(child != null)
11 {
12 node.removeChild(child);
13 child = node.childNodes[0];
14 }
15 }
16
17 function addRow(table){
18 var targetView = table;
19 var cctr=$('.dataTable tr').length;
20 ctr=cctr+1;
21 var input_data;
22 var select;
23 var option;
24 var selection;
25 // CREATE ELEMENT
26 var newtr = document.createElement("tr");
27 newtr.setAttribute("class","tr");
28 var newtd_c1 = document.createElement("td");
29 newtd_c1.setAttribute("width","147");
30 newtd_c1.setAttribute("align","center");
31 newtd_c1.appendChild(
32 input_data = document.createElement("input"),
33 input_data.setAttribute("type","time"),
34 input_data.setAttribute("size","10"),
35 input_data.setAttribute("autofocus","true"),
36 input_data.setAttribute("hidden","true")
37 );
38 var newtd_c2 = document.createElement("td");
39 newtd_c2.setAttribute("width","138");
40 newtd_c2.setAttribute("align","center");
41 newtd_c2.appendChild(
42 select = document.createElement("select"),
43 select.setAttribute("class","measure"),
44 $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
45 type:"post",
46 url:"Transaction/measurement.php",
47 success:function(data){
48 var obj=$.parseJSON(data);
49 $.each(obj,function(){
50 select.appendChild(
51 option = document.createElement("option"),
52 option.setAttribute('value',this['fMeasurementKey']),
53 option.appendChild(document.createTextNode(this['fMeasurement']))
54 )
55 })
56 }
57 }) // End of retrieving
58 );
59 newtd_c2.setAttribute("width","115");
60 newtd_c2.setAttribute("align","center");
61 newtd_c2.appendChild(
62 input_data = document.createElement("input"),
63 input_data.setAttribute("type","button"),
64 input_data.setAttribute("value","+"),
65 input_data.onclick = function(){ return addRow(newtr);
66 ctr++;
67 }
68 );
69 var newtd_c3 = document.createElement("td");
70 newtd_c3.setAttribute("width","98");
71 newtd_c3.setAttribute("align","center");
72 newtd_c3.appendChild(
73 selection = document.createElement("select"),
74 selection.setAttribute("class","source"),
75 $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
76 type:"post",
77 url:"Transaction/source.php",
78 success:function(data)
79 {
80 var obj = $.parseJSON(data);
81 $.each(obj,function(){
82 selection.appendChild(
83 option=document.createElement('option'),
84 option.setAttribute('value',this['fSourceKEY']),
85 option.appendChild(document.createTextNode(this['fSourceName']))
86 )
87 });
88 }
89 }) // End of retrieving
90 );
91 var newtd_c4 = document.createElement("td");
92 newtd_c4.setAttribute("width","119");
93 newtd_c4.setAttribute("align","center");
94 newtd_c4.appendChild(
95 input_data = document.createElement("input"),
96 input_data.setAttribute("type","text"),
97 input_data.setAttribute("class","selected"),
98 input_data.setAttribute("size","12"),
99 input_data.setAttribute("placeholder","Value")
100 );
101 var newtd_c5 = document.createElement("td");
102 newtd_c5.setAttribute("width","115");
103 newtd_c5.setAttribute("align","center");
104 newtd_c5.appendChild(
105 input_data = document.createElement("input"),
106 input_data.setAttribute("type","button"),
107 input_data.setAttribute("value","Delete"),
108 input_data.onclick = function(){ return clearNode(newtr); }
109 );
110
111 newtr.appendChild(newtd_c2);
112 newtr.appendChild(newtd_c3);
113 newtr.appendChild(newtd_c4);
114 newtr.appendChild(newtd_c5);
115
116 $(targetView).after(newtr);
117 }
118<?php
119$cnt=0;
120$pastdate = 'false';
121$day=0;
122if(isset($_GET['days']))
123{
124 $day = $_GET['days'];
125?> addRowClone(); <?php
126}
127else
128{
129 $day =date("Y-m-d");
130}
131$prev = mysql_query("SELECT date(fStart) AS PrevDate FROM schedule WHERE (date(fStart) < '2014-01-26') ORDER BY date(fStart) DESC LIMIT 1");
132$prevnight = mysql_fetch_array($prev);
133 if(mysql_num_rows($prevnight) > 0) {
134 $prevday = date('Y-m-d', $prevnight['PrevDate']);
135 } else {
136 $prevday = date ('Y-m-d');
137 }
138$prevday = date('Y-m-d', strtotime($day .' -1 day'));
139$prev_time = array();
140?>
141
142function addRowCloneNew(nextrow){
143 var targetView = document.getElementById("Data");
144 // CREATE ELEMENT
145 // COUNT LIST
146 var list = $(".datalisting").length;
147 var newlist = list+1;
148 var cctr=$('.dataTable tr').length;
149 ctr=cctr+1;
150 var input_data;
151 var select;
152 var option;
153 var selection;
154 var newdiv = document.createElement("div");
155 newdiv.setAttribute("id","list_"+newlist);
156 newdiv.setAttribute("class","datalisting");
157 newdiv.setAttribute("style","margin:5px 0;");
158 var newtable = document.createElement("table");
159 newtable.setAttribute("class","dataTable");
160 newtable.setAttribute("width","100%");
161 newtable.setAttribute("border","1");
162 newtable.setAttribute("cellspacing","0");
163 newtable.setAttribute("cellpadding","0");
164 var newInnertable = document.createElement("table");
165 newInnertable.setAttribute("class","dataTable");
166 newInnertable.setAttribute("width","100%");
167 newInnertable.setAttribute("border","1");
168
169 newInnertable.setAttribute("cellspacing","0");
170 newInnertable.setAttribute("cellpadding","0");
171
172 var newtr = document.createElement("tr");
173 newtr.setAttribute('class','tr');
174 var newtd_c1 = document.createElement("td");
175 newtd_c1.setAttribute("width","200");
176 newtd_c1.setAttribute("align","center");
177 newtd_c1.setAttribute("valign", "top");
178 newtd_c1.appendChild(
179 input_data = document.createElement("input"),
180 input_data.setAttribute("type","time"),
181 input_data.setAttribute("class","time"),
182 input_data.setAttribute("size","10"),
183 input_data.setAttribute("autofocus","true")
184 );
185 newtd_c1.appendChild(
186 input_data = document.createElement("input"),
187 input_data.setAttribute("type","button"),
188 input_data.setAttribute("value","+"),
189 input_data.onclick = function(){
190 addRowCloneNew("list_"+newlist);
191 }
192 );
193 var newtd_c2 = document.createElement("td");
194
195 newtd_c2.setAttribute("width","138");
196 newtd_c2.setAttribute("align","center");
197 newtd_c2.appendChild(
198 select = document.createElement("select"),
199 select.setAttribute("class","measure"),
200 $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
201 type:"post",
202 url:"Transaction/measurement.php",
203 success:function(data){
204 var obj=$.parseJSON(data);
205 $.each(obj,function(){
206 select.appendChild(
207 option = document.createElement("option"),
208 option.setAttribute('value',this['fMeasurementKey']),
209 option.appendChild(document.createTextNode(this['fMeasurement']))
210 )
211 })
212
213 }
214 }) // End of retrieving
215
216 );
217 newtd_c2.setAttribute("width","115");
218 newtd_c2.setAttribute("align","center");
219 newtd_c2.appendChild(
220 input_data = document.createElement("input"),
221 input_data.setAttribute("type","button"),
222 input_data.setAttribute("value","+"),
223 input_data.onclick = function(){
224 return addRow(newtr);
225 ctr++;
226 });
227 var newtd_c3 = document.createElement("td");
228 newtd_c3.setAttribute("width","98");
229 newtd_c3.setAttribute("align","center");
230 newtd_c3.appendChild(
231 selection = document.createElement("select"),
232 selection.setAttribute("class","source"),
233 $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
234 type:"post",
235 url:"Transaction/source.php",
236 success:function(data)
237 {
238 var obj = $.parseJSON(data);
239 $.each(obj,function(){
240 selection.appendChild(
241 option=document.createElement('option'),
242 option.setAttribute('value',this['fSourceKEY']),
243 option.appendChild(document.createTextNode(this['fSourceName']))
244 )
245 });
246 }
247 }) // End of retrieving
248 );
249 var newtd_c4 = document.createElement("td");
250 newtd_c4.setAttribute("width","119");
251 newtd_c4.setAttribute("align","center");
252 newtd_c4.appendChild(
253 input_data = document.createElement("input"),
254 input_data.setAttribute("type","text"),
255 input_data.setAttribute("class","selected"),
256 input_data.setAttribute("size","12"),
257 input_data.setAttribute("placeholder","Value")
258 );
259 var newtd_c5 = document.createElement("td");
260 newtd_c5.setAttribute("width","115");
261 newtd_c5.setAttribute("align","center");
262 newtd_c5.setAttribute("width","115");
263 newtd_c5.setAttribute("align","center");
264 newtd_c5.appendChild(
265 input_data = document.createElement("input"),
266 input_data.setAttribute("type","button"),
267 input_data.setAttribute("value","Delete"),
268 input_data.onclick = function(){ return clearNode(newtr);
269 }
270 );
271 newtr.appendChild(newtd_c2);
272 newtr.appendChild(newtd_c3);
273 newtr.appendChild(newtd_c4);
274 newtr.appendChild(newtd_c5);
275 newInnertable.appendChild(newtr);
276 var newtd_c6 = document.createElement("td");
277 newtd_c6.appendChild(newInnertable);
278
279 var newtd_c7 = document.createElement("td");
280 newtd_c7.setAttribute("width","115");
281 newtd_c7.setAttribute("align","center");
282 newtd_c7.setAttribute("valign", "top");
283 newtd_c7.appendChild(
284 input_data = document.createElement("input"),
285 input_data.setAttribute("type","button"),
286 input_data.setAttribute("value","Delete Main"),
287 input_data.onclick = function(){ return clearNode(newdiv); }
288 );
289
290 var newOutertr = document.createElement("tr");
291
292 newtable.appendChild(newtd_c1);
293 newtable.appendChild(newtd_c6);
294 newtable.appendChild(newtd_c7);
295
296 newdiv.appendChild(newtable);
297 if(nextrow != null){
298 var doc = document.getElementById(nextrow);
299 $(doc).after(newdiv);
300 }else{
301 targetView.appendChild(newdiv);
302 }
303}
304
305function addRowClone(nextrow){
306<?php
307$fetch = mysql_query("SELECT * FROM schedule WHERE date(fStart) = '$day' ORDER BY fScheduleID ASC, fMeasurementID ASC") or die(mysql_error());
308$observationsTime = mysql_query("SELECT DISTINCT fStart FROM schedule WHERE date(fStart) = '$day'");
309$cnt3=0;
310$cnt2=0;
311$cnt4 = 0;
312$cnt5 = 0;
313$cnt = 0;
314$cntrow = 0;
315$pastdate = 'false';
316$pasttime = 'false';
317date_default_timezone_set("UTC");
318//$data = array();
319//$counter=0;
320 while($times = mysql_fetch_array($observationsTime))
321 {
322 $timestamp=strtotime($times['fStart']);
323 $testdate = date('Y-m-d H:i:s', $times['fStart']);
324 $testing = date('Y-m-d H:i', $timestamp);
325 $actualtime = date('Y-m-d H:i:s', $timestamp);
326 if(strtotime(date('Y-m-d', $timestamp)) == strtotime(date('Y-m-d', time()))) {
327 $fetch_next = mysql_query("SELECT * FROM schedule WHERE (fStart > '$testing' AND date(fStart) = '$day') ORDER BY fStart LIMIT 1");
328 $next_data = mysql_fetch_array($fetch_next);
329 if (mysql_num_rows($fetch_next) > 0) {
330 $next_date = strtotime($next_data['fStart']);
331 $test = date('Y-m-d H:i', $next_date);
332 if(strtotime(date('Y-m-d H:i', $next_date)) > strtotime(date('Y-m-d H:i', time()))) {
333 $pasttime = 'true';
334 } else {
335 $pasttime = 'false';
336 }
337 } else {
338 $pasttime = 'true';
339 }
340 }
341 else {
342 $pasttime = 'false';
343 }
344 $timestamp2 = date('Y-m-d',$timestamp);
345 $date_time = date('H:i',$timestamp);
346 $prev_time[$cnt3]= $date_time;
347
348
349 if(strtotime(date('Y-m-d H:i', $timestamp)) < strtotime(date('Y-m-d H:i', time()))) {
350 $pastdate = 'true';
351 }
352 else {
353 $pastdate = 'false';
354 }
355 ?>
356 $('#save').attr('value','UPDATE');
357 var targetView = document.getElementById("Data");
358 // CREATE ELEMENT
359 // COUNT LIST
360 var list = $(".datalisting").length;
361 var newlist = list+1;
362 <?php $cnt++;?>
363
364 var cctr=$('.dataTable tr').length;
365 ctr=cctr+1;
366 var select;
367 var input_data;
368 var option;
369 var selection;
370
371 var newdiv<?php echo $cnt; ?> = document.createElement("div");
372 newdiv<?php echo $cnt; ?>.setAttribute("id", "list_<?php echo $cnt; ?>");
373 newdiv<?php echo $cnt; ?>.setAttribute("class","datalisting");
374 newdiv<?php echo $cnt; ?>.setAttribute("style","margin:5px 0;");
375
376 var newtable = document.createElement("table");
377 newtable.setAttribute("class","dataTable");
378 newtable.setAttribute("width","100%");
379 newtable.setAttribute("border","1");
380 newtable.setAttribute("cellspacing","0");
381 newtable.setAttribute("cellpadding","0");
382
383
384 var newInnertable = document.createElement("table");
385 newInnertable.setAttribute("class","dataTable");
386 newInnertable.setAttribute("width","100%");
387 newInnertable.setAttribute("border","1");
388
389 newInnertable.setAttribute("cellspacing","0");
390 newInnertable.setAttribute("cellpadding","0");
391
392 var newtd_c1 = document.createElement("td");
393 newtd_c1.setAttribute("width","200");
394 newtd_c1.setAttribute("align","center");
395 newtd_c1.setAttribute("valign", "top");
396 <?php if ($pastdate == 'true') { ?>
397 newtd_c1.appendChild(
398 input_data = document.createElement("input"),
399 input_data.setAttribute("type","time"),
400 input_data.setAttribute("class","time"),
401 input_data.setAttribute("size","10"),
402 input_data.setAttribute("value","<?php echo $date_time; ?>"),
403 input_data.setAttribute("autofocus","true"),
404 input_data.setAttribute("disabled", "disabled")
405 );
406 <?php } else { ?>
407 newtd_c1.appendChild(
408 input_data = document.createElement("input"),
409 input_data.setAttribute("type","time"),
410 input_data.setAttribute("class","time"),
411 input_data.setAttribute("size","10"),
412 input_data.setAttribute("value","<?php echo $date_time; ?>"),
413 input_data.setAttribute("autofocus","true")
414 );
415 <?php }
416 if($pasttime == 'true') { ?>
417 newtd_c1.appendChild(
418 input_data = document.createElement("input"),
419 input_data.setAttribute("type","button"),
420 input_data.setAttribute("value","+"),
421 input_data.onclick = function(){
422 addRowCloneNew("list_<?php echo $cnt; ?>");
423 }
424 );
425 <?php } else { if ($pastdate == 'true') { ?>
426 newtd_c1.appendChild(
427 input_data = document.createElement("input"),
428 input_data.setAttribute("type","button"),
429 input_data.setAttribute("value","+"),
430 input_data.setAttribute("disabled", "disabled"),
431 input_data.onclick = function(){
432 addRowCloneNew("list_<?php echo $cnt; ?>");
433 }
434 );
435 <?php } else { ?>
436 newtd_c1.appendChild(
437 input_data = document.createElement("input"),
438 input_data.setAttribute("type","button"),
439 input_data.setAttribute("value","+"),
440 input_data.onclick = function(){
441 addRowCloneNew("list_<?php echo $cnt; ?>");
442 }
443 );
444 <?php } }
445 $observations = mysql_query("SELECT * FROM schedule WHERE fStart = '$actualtime'");
446
447 while($rows = mysql_fetch_array($observations))
448 {
449 $cntrow++;
450 ?>
451
452 var newtr<?php echo $cntrow; ?> = document.createElement("tr");
453 newtr<?php echo $cntrow; ?>.setAttribute('class','tr');
454
455 <?php if ($pastdate == 'true') { ?>
456 var newtd_c2 = document.createElement("td");
457 newtd_c2.setAttribute("width","138");
458 newtd_c2.setAttribute("align","center");
459 <?php
460 $cur_measurement = $rows[fMeasurementTypeKey];
461 $selectm = mysql_query("SELECT fMeasurement FROM measurement WHERE fMeasurementKey = '$cur_measurement'");
462 $rowmeasure = mysql_fetch_array($selectm);
463 ?>
464 newtd_c2.appendChild(
465 selection = document.createElement("input"),
466 selection.setAttribute("value", "<?php echo $rowmeasure['fMeasurement']; ?>"),
467 selection.setAttribute("type","text"),
468 selection.setAttribute("class","selected"),
469 selection.setAttribute("size", "12"),
470 selection.setAttribute("placeholder", "Value"),
471 selection.setAttribute("disabled", "disabled")
472 );
473 newtd_c2.setAttribute("width","115");
474 newtd_c2.setAttribute("align","center");
475 newtd_c2.appendChild(
476 input_data = document.createElement("input"),
477 input_data.setAttribute("type","button"),
478 input_data.setAttribute("value","+"),
479 input_data.setAttribute("disabled", "disabled"),
480 input_data.onclick = function(){
481 return addRow(newtr<?php echo $cntrow; ?>);
482 ctr++;
483 });
484
485 var newtd_c3 = document.createElement("td");
486 newtd_c3.setAttribute("width","98");
487 newtd_c3.setAttribute("align","center");
488 <?php
489 $cur_source = $rows['fSourceKey'];
490 $select = mysql_query("SELECT fSourceName FROM source WHERE fSourceKey = '$cur_source'");
491 $rowsource = mysql_fetch_array($select); ?>
492 newtd_c3.appendChild(
493 selection = document.createElement("input"),
494 selection.setAttribute("value", "<?php echo $rowsource['fSourceName']; ?>"),
495 selection.setAttribute("type","text"),
496 selection.setAttribute("class","selected"),
497 selection.setAttribute("size", "12"),
498 selection.setAttribute("placeholder", "Value"),
499 selection.setAttribute("disabled", "disabled")
500 );
501
502 var newtd_c4 = document.createElement("td");
503 newtd_c4.setAttribute("width","119");
504 newtd_c4.setAttribute("align","center");
505 newtd_c4.appendChild(
506 input_data = document.createElement("input"),
507 input_data.setAttribute("type","text"),
508 input_data.setAttribute("class","selected"),
509 input_data.setAttribute("size","12"),
510 input_data.setAttribute("value","<?php echo $rows['fData']; ?>"),
511 input_data.setAttribute("placeholder","Value"),
512 input_data.setAttribute("disabled", "disbaled")
513 );
514
515 var newtd_c5 = document.createElement("td");
516 newtd_c5.setAttribute("width","115");
517 newtd_c5.setAttribute("align","center");
518 newtd_c5.setAttribute("width","115");
519 newtd_c5.setAttribute("align","center");
520 newtd_c5.appendChild(
521 input_data = document.createElement("input"),
522 input_data.setAttribute("type","button"),
523 input_data.setAttribute("value","Delete"),
524 input_data.setAttribute("disabled", "disabled"),
525 input_data.onclick = function(){
526 return clearNode(newtr<?php echo $cntrow; ?>);
527 }
528 );
529 <?php } else { ?>
530 var newtd_c2 = document.createElement("td");
531 newtd_c2.setAttribute("width","138");
532 newtd_c2.setAttribute("align","center");
533 newtd_c2.appendChild(
534 selection = document.createElement("select"),
535 <?php
536 $selectm = mysql_query("SELECT * FROM measurement");
537 while($rowmeasure = mysql_fetch_array($selectm))
538 {
539 ?>
540 selection.appendChild(
541 option = document.createElement("option"),
542 option.setAttribute("value","<?php echo $rowmeasure['fMeasurementKey']; ?>"),
543 <?php if($rows['fMeasurementTypeKey']==$rowmeasure['fMeasurementKey']){ echo "option.setAttribute('selected',true),";} ?>
544 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
545 ),
546 <?php
547 }
548 ?>
549 selection.setAttribute('id','measure'),
550 selection.setAttribute('class','measure')
551 );
552 newtd_c2.setAttribute("width","115");
553 newtd_c2.setAttribute("align","center");
554 newtd_c2.appendChild(
555 input_data = document.createElement("input"),
556 input_data.setAttribute("type","button"),
557 input_data.setAttribute("value","+"),
558 input_data.onclick = function(){
559 return addRow(newtr<?php echo $cntrow; ?>);
560 ctr++;
561 });
562
563 var newtd_c3 = document.createElement("td");
564 newtd_c3.setAttribute("width","98");
565 newtd_c3.setAttribute("align","center");
566 newtd_c3.appendChild(
567 selection = document.createElement("select"),
568 <?php
569 $select = mysql_query("SELECT * FROM source");
570 while($rowsource = mysql_fetch_array($select))
571 {
572 ?>
573 selection.appendChild(
574 option = document.createElement("option"),
575 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
576 <?php if($rows['fSourceKey'] == $rowsource['fSourceKEY']){ echo "option.setAttribute('selected',true),"; } ?>
577 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
578 ),
579 <?php
580 }
581 ?>
582 selection.setAttribute('id','source'), // End of retrieving
583 selection.setAttribute('class','source') // End of retrieving
584 );
585
586 var newtd_c4 = document.createElement("td");
587 newtd_c4.setAttribute("width","119");
588 newtd_c4.setAttribute("align","center");
589 newtd_c4.appendChild(
590 input_data = document.createElement("input"),
591 input_data.setAttribute("type","text"),
592 input_data.setAttribute("class","selected"),
593 input_data.setAttribute("size","12"),
594 input_data.setAttribute("value","<?php echo $rows['fData']; ?>"),
595 input_data.setAttribute("placeholder","Value")
596 );
597
598 var newtd_c5 = document.createElement("td");
599 newtd_c5.setAttribute("width","115");
600 newtd_c5.setAttribute("align","center");
601 newtd_c5.setAttribute("width","115");
602 newtd_c5.setAttribute("align","center");
603 newtd_c5.appendChild(
604 input_data = document.createElement("input"),
605 input_data.setAttribute("type","button"),
606 input_data.setAttribute("value","Delete"),
607 input_data.onclick = function(){ return clearNode(newtr<?php echo $cntrow; ?>);
608
609 }
610 );
611 <?php } ?>
612 newtr<?php echo $cntrow; ?>.appendChild(newtd_c2);
613 newtr<?php echo $cntrow; ?>.appendChild(newtd_c3);
614 newtr<?php echo $cntrow; ?>.appendChild(newtd_c4);
615 newtr<?php echo $cntrow; ?>.appendChild(newtd_c5);
616 newInnertable.appendChild(newtr<?php echo $cntrow; ?>);
617
618 <?php
619
620 $prevtimestamp = $timestamp;
621 }
622 ?>
623
624 var newtd_c6 = document.createElement("td");
625 newtd_c6.appendChild(newInnertable);
626
627 var newtd_c7 = document.createElement("td");
628 newtd_c7.setAttribute("width","115");
629 newtd_c7.setAttribute("align","center");
630 newtd_c7.setAttribute("valign", "top");
631 <?php if ($pastdate == 'true') { ?>
632 newtd_c7.appendChild(
633 input_data = document.createElement("input"),
634 input_data.setAttribute("type","button"),
635 input_data.setAttribute("value","Delete Main"),
636 input_data.setAttribute("disabled", "disabled"),
637 input_data.onclick = function(){ return clearNode(newdiv<?php echo $cnt; ?>); }
638 );
639 <?php } else { ?>
640 newtd_c7.appendChild(
641 input_data = document.createElement("input"),
642 input_data.setAttribute("type","button"),
643 input_data.setAttribute("value","Delete Main"),
644 input_data.onclick = function(){ return clearNode(newdiv<?php echo $cnt; ?>); }
645 );
646 <?php } ?>
647
648 var newOutertr = document.createElement("tr");
649
650 newtable.appendChild(newtd_c1);
651 newtable.appendChild(newtd_c6);
652 newtable.appendChild(newtd_c7);
653
654 newdiv<?php echo $cnt; ?>.appendChild(newtable);
655 if(nextrow != null){
656 var doc = document.getElementById(nextrow);
657 $(doc).after(newdiv<?php echo $cnt;?>);
658 }else{
659 targetView.appendChild(newdiv<?php echo $cnt;?>);
660 //$(targetView).after(newtr<?php echo $cnt; ?>);
661 }
662 <?php
663}
664if(mysql_num_rows($fetch)<1)
665{
666?>
667 $('#save').attr('value','SAVE');
668 addRowCloneNew();
669<?php
670}
671
672?>
673
674}
675
676$('#LoadPrev').click(function() {
677if(transPrevNight == 1) {
678 $('#Scheduling').load('Module/Scheduling.php?days=<?php echo $prevday;?>');
679 transPrevNight = 0;
680}
681});
682
683</script>
684
Note: See TracBrowser for help on using the repository browser.