Changeset 16894
- Timestamp:
- 06/23/13 09:54:35 (12 years ago)
- Location:
- schedule
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/Scheduling.php
r16750 r16894 1 1 <?php 2 2 include '../include/factdb.php'; 3 4 3 include '../function/SplitDelete.php'; 5 4 ?> -
schedule/Module/calendar.php
r16758 r16894 14 14 <script src="js/chart.js"></script> 15 15 <script src="js/Graph.js"></script> 16 16 17 <script src="Module/src/js/lang/en.js"></script> 17 18 <style type="text/css"> … … 83 84 year =this.selection.print("%Y").join("\n"); 84 85 GetData(); 85 86 GetDate(); 86 87 $('#Scheduling').load('Module/Scheduling.php?days='+year+'-'+month+'-'+day); 87 //$.get("function/function.php", {day:year+'-'+month+'-'+day}); 88 //$.get("function/function.php", {days:year+'-'+month+'-'+day}); 89 //$load("function/function.php?days:year+-'+month+'-'+day); 88 90 //$.get("function/SplitDelete.php", {days:year+'-'+month+'-'+day}); 89 91 -
schedule/Transaction/insert.php
r16738 r16894 1 1 <?php 2 //Build by: khristofer Usman 3 //Modified by: Jaypee Tanio 4 // June 14,2013 5 2 6 include '../include/factdb.php'; 3 4 5 6 $Time =$_GET['Time']; 7 $SelectedSource = $_GET['Source']; 8 $Date = $_GET['Date']; 9 10 $SelectedMeasure = $_GET['measure']; 11 $TimeEX = explode("-",$Date); 12 13 $TimeEX2 = "day=".$TimeEX[0]."&month=".$TimeEX[1]."&year=".$TimeEX[2]; 14 $limtex = count(explode(",",$SelectedSource)); 15 $insertdate = $TimeEX[2]."-".$TimeEX[1]."-".$TimeEx[0]; 16 $value = $_GET['Data']; 17 $date = $_GET['Date']; 18 //$date = new DateTime($_GET['Date']); 7 $Time =$_POST['Time']; 8 $SelectedSource = $_POST['Source']; 9 $Date = $_POST['Date']; 10 echo $Date; 11 $SelectedMeasure = $_POST['measure']; 12 $value = $_POST['Data']; 13 $date = $_POST['Date']; 19 14 $n_value = explode(",",$value); 20 15 echo "<br />"; 21 //echo $date->format('Y-m-d H:i:s'); 22 //fdgdfgdf 23 $Times = explode(",",$Time); 16 $Times = explode(",",$Time); 24 17 $select = explode(",",$SelectedSource); 25 18 $measure = explode(",",$SelectedMeasure); 19 $limtex = count(explode(",",$SelectedMeasure)); 26 20 echo "<br />"; 27 $temp = ""; 28 $insert_count = 0; 29 30 31 32 33 34 35 36 37 38 39 for($i=0;$i<=$limtex-1;$i++){ 21 for($i=0;$i<=$limtex-1;$i++) 22 { 40 23 $select = explode(",",$SelectedSource); 41 $n1 = $n_value[$i]; 42 43 $selectf = $select[$i]; 44 //////Time//// 45 //$Timef = $Time[$i]; 46 47 //////// for measurement ///////// 48 24 $n1 = $n_value[$i]; 25 $selectf = $select[$i]; 26 //////// for measurement ///////// 49 27 $measuref = $measure[$i]; 50 51 28 //////// Date parsing into format//////// 52 29 $dateTime=new DateTime($date." ".$Times[$i]); … … 55 32 56 33 $select = mysql_query("SELECT * FROM schedule WHERE fLastUpdate = '$parsed_date'"); 57 if($select){ 58 while($row = mysql_fetch_array($select)){ 34 if($select) 35 { 36 while($row = mysql_fetch_array($select)) 37 { 38 $new = $row['fMeasurementID'] + 1 ; 39 } 40 } 41 else 42 { 43 $new = 0; 44 } 45 $insert = mysql_query("INSERT INTO schedule values('','$parsed_date','$parsed_date','$measuref','','$n1','$selectf','$measuref')") or die(mysql_error()); 46 59 47 60 61 $new = $row['fMeasurementID'] + 1 ; 62 63 64 65 } 66 }else{ 67 68 $new = 0; 69 70 } 71 72 $insert = mysql_query("INSERT IGNORE INTO schedule values('','$parsed_date','$parsed_date','$new','','$n1','$selectf','$measuref')") or die(mysql_error()); 73 48 74 49 } 75 if($insert){76 77 ?>78 <script type="text/javascript">79 80 alert("Sucessfully save");81 window.location = '../index.php?days=<?php echo $date; ?>';82 </script>83 <?php84 85 }86 50 87 51 ?> -
schedule/Transaction/update.php
r16740 r16894 1 1 2 <?php 3 //Build by: khristofer Usman 4 //Modified by: Jaypee Tanio 5 // June 22,2013 2 6 include '../include/factdb.php'; 3 4 5 6 $Time =$_GET['Time']; 7 $SelectedSource = $_GET['Source']; 8 $Date = $_GET['Date']; 9 10 $SelectedMeasure = $_GET['measure']; 11 $TimeEX = explode("-",$Date); 12 13 $TimeEX2 = "day=".$TimeEX[0]."&month=".$TimeEX[1]."&year=".$TimeEX[2]; 14 $limtex = count(explode(",",$SelectedSource)); 15 $insertdate = $TimeEX[2]."-".$TimeEX[1]."-".$TimeEx[0]; 16 $value = $_GET['Data']; 17 $date = $_GET['Date']; 18 //$date = new DateTime($_GET['Date']); 7 $Time =$_POST['Time']; 8 $SelectedSource = $_POST['Source']; 9 $SelectedMeasure = $_POST['measure']; 10 $limtex = count(explode(",",$SelectedSource)); 11 $Upd=$_POST['upd']; 12 $Upt=$_POST['upt']; 13 $value = $_POST['Data']; 14 $date = $_POST['Date']; 19 15 $n_value = explode(",",$value); 20 echo "<br />"; 21 //echo $date->format('Y-m-d H:i:s'); 22 //fdgdfgdf 23 $Times = explode(",",$Time); 16 $Times = explode(",",$Time); 24 17 $select = explode(",",$SelectedSource); 25 18 $measure = explode(",",$SelectedMeasure); 26 echo "<br />"; 27 $temp = ""; 28 $insert_count = 0; 29 19 //date_default_timezone_set('Asia/Manila'); // Setting up the localTimeZone in asia 20 $UpdateDate=(date('Y-m-d H:i:s')); 30 21 31 22 … … 34 25 $fetch = mysql_query("SELECT * FROM schedule") or die(mysql_error()); 35 26 36 while($rows = mysql_fetch_array($fetch)){ 37 $timestamp=strtotime($rows['fLastUpdate']); 27 while($rows = mysql_fetch_array($fetch)) 28 { 29 $timestamp=strtotime($rows['fStart']); 38 30 $timestamp2 = date('Y-m-d',$timestamp); 39 31 $date_time = date('H:i',$timestamp); 40 32 //$time_new = $date_time->format('H:i:s') 41 if($days == $timestamp2){ 33 if($days == $timestamp2) 34 { 42 35 43 $delete = mysql_query("DELETE FROM `schedule` WHERE `fLastUpdate`='{$rows['fLastUpdate']}'");36 $delete = mysql_query("DELETE FROM `schedule` WHERE `fStart`='{$rows['fStart']}'"); 44 37 45 }38 } 46 39 } 47 40 48 49 50 51 52 53 41 54 for($i=0;$i<=$limtex-1;$i++){ 42 for($i=0;$i<=$limtex;$i++) 43 { 55 44 $select = explode(",",$SelectedSource); 56 $n1 = $n_value[$i]; 57 58 $selectf = $select[$i]; 59 //////Time//// 60 //$Timef = $Time[$i]; 61 62 //////// for measurement ///////// 63 64 $measuref = $measure[$i]; 65 66 //////// Date parsing into format//////// 67 $dateTime=new DateTime($date." ".$Times[$i]); 68 $parsed_date = $dateTime->format('Y-m-d H:i:s'); 69 $new = 0; 70 71 $select = mysql_query("SELECT * FROM schedule WHERE fLastUpdate = '$parsed_date'"); 72 if($select){ 73 while($row = mysql_fetch_array($select)){ 74 75 76 $new = $row['fMeasurementID'] + 1 ; 77 45 $n1 = $n_value[$i]; 46 $selectf = $select[$i]; 47 $measuref = $measure[$i]; 48 $dateTime=new DateTime($date." ".$Times[$i]); 49 $parsed_date = $dateTime->format('Y-m-d H:i:s'); 50 51 mysql_query("INSERT INTO schedule VALUES('null','".$parsed_date."','".$UpdateDate."','".$measuref."','','".$n1."','".$selectf."','".$measuref."')"); 78 52 79 80 } 81 }else{ 82 83 $new = 0; 84 85 } 86 87 $insert = mysql_query("INSERT IGNORE INTO schedule values('','$parsed_date','$parsed_date','$new','','$n1','$selectf','$measuref')") or die(mysql_error()); 88 89 } 90 if($insert){ 91 92 ?> 93 <script type="text/javascript"> 94 95 alert("Sucessfully save"); 96 window.location = '../index.php?days=<?php echo $date; ?>'; 97 </script> 98 <?php 99 100 } 101 53 } 102 54 ?> -
schedule/authenticate/body.php
r16738 r16894 5 5 include 'function/sourcelist.php'; 6 6 7 include 'function/function.php';7 //include 'function/function.php'; 8 8 ?> 9 9 … … 17 17 <meta name="keywords" content="" /> 18 18 <meta name="description" content="" /> 19 <script src="js/function.js"></script> 19 20 <link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" /> 20 21 </head> … … 56 57 </div> 57 58 </div> 58 <div style="width:100%;" align="right">59 59 60 60 <div style="width:100%;" align="right" id='btn'> 61 61 <?php include 'function/button.php'; ?> 62 63 62 </div> 64 63 <div style="border:2px solid white; width:100%;" id="Scheduling"> 65 64 <?php 66 67 65 include 'function/SplitDelete.php'; 68 69 66 ?> 70 71 <script type="text/javascript">72 // $(document).ready(function(){73 74 75 // $('#Scheduling').fadeOut('slow').load('Module/Scheduling.php').fadeIn('slow');76 77 // });78 </script>79 67 <table width="100%" id="TableHolder" > 80 68 81 <tr>82 <td width="184" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Time</td>83 84 <td width="170" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Measurement</td>85 <td width="145" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Source list</td>86 <td width="316" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Value</td>87 <td width="141" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Transaction</td>88 </tr>89 <tr>90 91 92 <td style="border:0px solid white; color:#37DFB1; font-size:14px;" colspan="4"> </td>93 </tr>69 <tr> 70 <td width="229" style="border:1px solid white; color:#37DFB1; font-size:12px;" align="center" >Time</td> 71 72 <td width="184" style="border:1px solid white; color:#37DFB1; font-size:12px;" align="center" >Measurement</td> 73 <td width="210" style="border:1px solid white; color:#37DFB1; font-size:12px;" align="center" >Source list</td> 74 <td width="280" style="border:1px solid white; color:#37DFB1; font-size:12px;" align="center" >Value</td> 75 <td width="69" style="border:1px solid white; color:#37DFB1; font-size:12px;" align="center" >Transaction</td> 76 </tr> 77 <tr> 78 79 80 <td style="border:0px solid white; color:#37DFB1; font-size:14px;" colspan="4"> </td> 81 </tr> 94 82 95 </table>96 <table width="100%" id="TableH" class="myTable">97 </table>98 <table width="100%" id="TableH1" class="myTable">99 </table>83 </table> 84 <table width="100%" id="TableH" class="myTable"> 85 </table> 86 <table width="100%" id="TableH1" class="myTable"> 87 </table> 100 88 101 <table width="100%">102 <tr>103 104 105 <td style="border:0px solid white; color:#37DFB1; font-size:14px;" width="80%" align="center"> </td>106 107 </tr>108 </table>89 <table width="100%"> 90 <tr> 91 92 93 <td style="border:0px solid white; color:#37DFB1; font-size:14px;" width="80%" align="center"> </td> 94 95 </tr> 96 </table> 109 97 </div> 110 98 <div style="border:2px solid white; width:100%;" align="center" id="SchedulingAppend"> -
schedule/css/styles.css
r16419 r16894 11 11 .myTable td.first 12 12 { 13 width: 190px;13 width:200px; 14 14 } 15 15 -
schedule/function/SplitDelete.php
r16873 r16894 33 33 cnt++; 34 34 35 <<<<<<< .mine 36 $('#save').hide(); 37 $('#update').show(); 38 39 var div= document.createElement("div"); 40 div.setAttribute('id','TableHolder'); 41 ======= 35 42 $('#save').hide(); 36 43 $('#update').show(); 37 44 var div= document.createElement("div"); 38 45 div.setAttribute('id','TableHolder'); 46 >>>>>>> .r16893 39 47 var table = document.createElement("table"); 40 48 table.setAttribute('id',"table"+cnt); … … 62 70 63 71 72 <<<<<<< .mine 73 64 74 if($('#Time').val() != ""){ var splitting = $('#Time').val().split(':'); var add = 01; 75 ======= 76 if($('#Time').val() != ""){ var splitting = $('#Time').val().split(':'); var add = 01; 77 >>>>>>> .r16893 65 78 66 79 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 96 109 getTableId =get; 97 110 111 <<<<<<< .mine 112 113 name="name"; value=""; meas = "name"; meas2 = "time"; //getTableId = $(this).attr('name'); 114 split1(); }else{ alert("please enter value for time to add measurement"); } 115 116 ======= 98 117 99 118 name="name"; value=""; meas = "name"; meas2 = "time"; // getTableId = $(this).attr('name'); 100 119 split1(); }else{ alert("please enter value for time to add measurement"); } 101 120 121 >>>>>>> .r16893 102 122 103 123 } … … 178 198 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 179 199 td4.appendChild( 200 <<<<<<< .mine 201 ======= 180 202 button = document.createElement('input'), 181 203 button.setAttribute("type",'button'), … … 223 245 ); 224 246 td4.appendChild( 247 >>>>>>> .r16893 225 248 button=document.createElement('input'), 226 249 button.setAttribute('type','button'), … … 276 299 button.setAttribute('name','#table2'), 277 300 button.onclick=function(){ 301 <<<<<<< .mine 302 var aa; 303 $('div#TableHolder #table2 #Time').each(function(){ 304 aa = $(this).val(); 305 }); 306 if(aa != ""){ var splitting =aa.split(':'); var add = 01; 307 ======= 278 308 var aa; 279 309 $('div#TableHolder #table2 #Time').each(function(){ … … 281 311 }); 282 312 if(aa != ""){ var splitting =aa.split(':'); var add = 01; 313 >>>>>>> .r16893 283 314 284 315 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 386 417 var td4=document.createElement('td'); 387 418 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 419 388 420 td4.appendChild( 421 <<<<<<< .mine 422 ======= 389 423 button = document.createElement('input'), 390 424 button.setAttribute("type",'button'), … … 426 460 ); 427 461 td4.appendChild( 462 >>>>>>> .r16893 428 463 button=document.createElement('input'), 429 464 button.setAttribute('type','button'), … … 443 478 tr.appendChild(td4); 444 479 table.appendChild(tr); 480 <<<<<<< .mine 445 481 div.appendChild(table); 446 482 $('#TableH1').append(div); 447 483 448 484 var div= document.createElement("div"); 449 485 div.setAttribute('id','TableHolder'); 486 ======= 487 div.appendChild(table); 488 $('#TableH1').append(div); 489 490 var div= document.createElement("div"); 491 div.setAttribute('id','TableHolder'); 492 >>>>>>> .r16893 450 493 var table = document.createElement("table"); 451 494 table.setAttribute('id',"table1"); … … 471 514 button.setAttribute('name','#table1'), 472 515 button.onclick=function(){ 516 <<<<<<< .mine 517 var aa; 518 $('div#TableHolder #table2 #Time').each(function(){ 519 aa = $(this).val(); 520 }); 521 if(aa !='') { var splitting =aa.split(':'); var add = 01; 522 ======= 473 523 var aa; 474 524 $('div#TableHolder #table1 #Time').each(function(){ … … 477 527 478 528 if(aa != ""){ var splitting = aa.split(':'); var add = 01; 529 >>>>>>> .r16893 479 530 480 531 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 489 540 return str; 490 541 542 <<<<<<< .mine 543 }; 544 545 546 var s = 0; var get; 547 548 $("table").each(function() { 549 if($(this).attr("name")=='#table2'){ 550 get = "#"+$(this).attr("id"); 551 552 s =1; 553 }else{ 554 if(s==0){ 555 get = '#table'+cnt; 556 } 557 } 558 }); 559 getTableId =get; 560 name="name"; value=""; 561 562 name="name"; value=""; meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name'); 563 split2(); }else{ alert("please enter value for time to add measurement"); } 564 ======= 491 565 }; 492 566 … … 506 580 }); 507 581 getTableId =get; 582 >>>>>>> .r16893 508 583 509 584 … … 565 640 button.setAttribute('name','#table1'), 566 641 button.onclick=function(){ 642 <<<<<<< .mine 643 $('div#TableHolder #table1 #Time').each(function(){ 644 aa = $(this).val(); 645 }); 646 647 if(aa != ""){ timeValue = aa; name="name"; value="#table1"; meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); } 648 ======= 567 649 var aa; 568 650 $('div#TableHolder #table1 #Time').each(function(){ … … 571 653 572 654 if(aa != ""){ timeValue = aa; name="name"; value="#table1"; meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); } 655 >>>>>>> .r16893 573 656 574 657 … … 585 668 var td4=document.createElement('td'); 586 669 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 670 587 671 td4.appendChild( 672 <<<<<<< .mine 673 ======= 588 674 button = document.createElement('input'), 589 675 button.setAttribute("type",'button'), … … 632 718 ); 633 719 td4.appendChild( 720 >>>>>>> .r16893 634 721 button=document.createElement('input'), 635 722 button.setAttribute('type','button'), … … 655 742 } 656 743 var meas; 744 <<<<<<< .mine 745 var timeValue; 746 var pad; 747 if(cnt==0){ cnt=2; } 748 function split2() 749 ======= 657 750 var timeValue; 658 751 var pad; 659 752 if(cnt==0){ cnt=2; } 660 753 function split2() 754 >>>>>>> .r16893 661 755 { 662 756 … … 703 797 if(aa != ""){var splitting = aa.split(':'); var add = 01; 704 798 799 705 800 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 706 801 … … 716 811 } 717 812 813 <<<<<<< .mine 718 814 var s = 0; var get; 719 815 var nn; … … 733 829 734 830 name="name"; value=$(this).attr('name'); 831 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 832 833 ======= 834 var s = 0; var get; 835 var nn; 836 nn = $(this).attr('name'); 837 $("table").each(function() { 838 if($(this).attr("name")==nn){ 839 840 get = "#"+$(this).attr("id"); 841 //get = $(this).attr("name"); 842 s =1; 843 }else{ 844 if(s==0){ 845 get = '#table'+cnt; 846 } 847 } 848 }); 849 850 name="name"; value=$(this).attr('name'); 735 851 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 736 852 853 >>>>>>> .r16893 737 854 738 855 } … … 762 879 763 880 ); 881 <<<<<<< .mine 882 var td1=document.createElement('td'); 883 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); 884 td1.appendChild( 885 measurementcbo= document.createElement('select'), 886 measurementcbo.setAttribute('id','measurement'), 887 ======= 764 888 var td1=document.createElement('td'); 765 889 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); … … 767 891 measurementcbo= document.createElement('select'), 768 892 measurementcbo.setAttribute('id','measurement'), 893 >>>>>>> .r16893 769 894 <?php 770 895 $measure=mysql_query("SELECT*FROM measurement"); … … 772 897 { 773 898 ?> 774 775 776 777 778 899 measurementcbo.appendChild( 900 option=document.createElement('option'), 901 option.setAttribute('value','<?php echo $rowmeasure['fMeasurementKey']; ?>'), 902 option.setAttribute('selected',true), 903 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>")) 779 904 ), 780 905 <?php … … 823 948 var td4=document.createElement('td'); 824 949 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 950 825 951 td4.appendChild( 952 <<<<<<< .mine 953 ======= 826 954 button = document.createElement('input'), 827 955 button.setAttribute("type",'button'), … … 866 994 ); 867 995 td4.appendChild( 996 >>>>>>> .r16893 868 997 button=document.createElement('input'), 869 998 button.setAttribute('type','button'), … … 1017 1146 button.setAttribute('name','#table'+cnt), 1018 1147 button.onclick=function(){ 1148 <<<<<<< .mine 1149 1150 if($('#Time').val() != ""){ timeValue = $('#Time').val(); 1151 name = "name"; value = $(this).attr('name'); meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split1(); }else{ alert("please enter value for time to add measurement"); } 1152 ======= 1019 1153 var aa; 1020 1154 $('div#TableHolder #table'+cnt+' #Time').each(function(){ … … 1023 1157 if(aa != ""){ timeValue = aa; 1024 1158 name = "name"; value = $(this).attr('name'); meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split1(); }else{ alert("please enter value for time to add measurement"); } 1159 >>>>>>> .r16893 1025 1160 1026 1161 … … 1038 1173 var td4=document.createElement('td'); 1039 1174 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 1175 1040 1176 td4.appendChild( 1177 <<<<<<< .mine 1178 ======= 1041 1179 button = document.createElement('input'), 1042 1180 button.setAttribute("type",'button'), … … 1077 1215 ); 1078 1216 td4.appendChild( 1217 >>>>>>> .r16893 1079 1218 button=document.createElement('input'), 1080 1219 button.setAttribute('type','button'), -
schedule/function/button.php
r16739 r16894 1 <?php 2 include '../include/factdb.php'; 3 $x = 0; 4 $day = $_GET['days']; 5 $days = Date('Y-m-d',strtotime($day)); 6 7 $fetch = mysql_query("SELECT * FROM schedule") or die(mysql_error()); 8 9 while($rows = mysql_fetch_array($fetch)){ 10 $timestamp=strtotime($rows['fLastUpdate']); 11 $timestamp2 = date('Y-m-d',$timestamp); 12 $date_time = date('H:i',$timestamp); 13 //$time_new = $date_time->format('H:i:s') 14 if($days == $timestamp2){ 15 $x++; 16 17 } 18 19 } 20 21 22 if($x==0){ 23 24 ?><input type="button" id="save" value="SAVE" class="button" title="Click to save"> <input type="button" id="LoadPrev" value="Load Previous Night" class="button" title="Click to load previous night"> 25 <?php 26 27 }else{ 28 ?><input type="button" id="update" value="UPDATE" class="button" title="Click to save"> <input type="button" id="LoadPrev" value="Load Previous Night" class="button" title="Click to load previous night"> 29 <?php 30 31 } 32 33 ?> 1 <input type="button" id="save" value="SAVE" class="button" title="Click to save"> 2 3 <input type="button" id="LoadPrev" value="Load Previous Night" class="button" title="Click to load previous night"> 34 4 35 5 -
schedule/function/function.php
r16738 r16894 1 1 <div id="saving"> 2 2 3 <script type="text/javascript"> 4 5 6 7 8 9 10 11 12 $(document).ready(function GetDate(){ 3 <script type="text/javascript"> 4 $(document).ready(function GetDate(day ,month ,year){ 13 5 // for fupdate 14 6 <?php … … 25 17 26 18 if(isset($_GET['days'])){ 27 echo $_GET['days']; ; 28 }else{ 19 echo $_GET['days']; 20 } 21 else 22 { 29 23 30 24 echo date("Y-m-d"); … … 33 27 34 28 ?>'; 29 30 var InputValue = []; 31 var selectedSource = []; 32 var selectedTime = []; 33 var selectedMeasurement = []; 34 var Time; 35 var Source; 36 var measure; 37 var value; 38 var checks = 0; 39 for(var i=1;i <= cnt;i++) 40 { 41 if($('#Time'+i).val() != '') 42 { 43 Time=$('#Time'+i).val(); 44 Source=$('select[id="source'+i+'"]').val(); 45 measure=$('select[id="measurement'+i+'"]').val(); 46 value=$('#txtData'+i).val(); 47 selectedMeasurement.push(measure); 48 selectedSource.push(Source); 49 selectedTime.push(Time); 50 InputValue.push(value); 51 52 } 53 else 54 { 55 checks++; 56 57 } 58 } 59 if(checks == 0) 60 { 61 alert(dtr); 62 $.ajax({ 63 type: "POST", 64 cache: false, 65 url: "Transaction/insert.php", 66 data: "Time="+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr, 67 dataType: "json", 68 success: function(data) { 69 alert('Success: The text is now stored in the database.'); 70 } 71 }); 72 //window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 73 } 74 else 75 { 76 77 alert("Please fill all the details!"); 78 } 79 }); 80 81 82 83 84 85 86 87 88 89 90 91 $('#update').click(function() 92 { 35 93 //alert(dtr); 36 94 var InputValue = []; … … 62 120 } 63 121 64 if(checks == 0){ 65 window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 66 }else{ 67 68 alert("Please fill all the details!"); 69 } 70 }); 71 72 73 74 75 76 77 78 79 80 81 82 $('#update').click(function(){ 83 var dtr; 84 dtr = '<?php 85 86 if(isset($_GET['days'])){ 87 echo $_GET['days']; ; 88 }else{ 89 90 echo date("Y-m-d"); 91 92 } 93 94 ?>'; 95 //alert(dtr); 96 var InputValue = []; 97 var selectedSource = []; 98 var selectedTime = []; 99 var selectedMeasurement = []; 100 var Time; 101 var Source; 102 var measure; 103 var value; 104 var checks = 0; 105 for(var i=1;i <= cnt;i++) 122 if(checks == 0) 106 123 { 107 if($('#Time'+i).val() != '') 108 { 109 Time=$('#Time'+i).val(); 110 Source=$('select[id="source'+i+'"]').val(); 111 measure=$('select[id="measurement'+i+'"]').val(); 112 value=$('#txtData'+i).val(); 113 selectedMeasurement.push(measure); 114 selectedSource.push(Source); 115 selectedTime.push(Time); 116 InputValue.push(value); 117 118 }else{ 119 checks++; 120 124 125 $.ajax({ 126 type: "POST", 127 cache: false, 128 url: "Transaction/update.php", 129 data: "Time="+selectedTime, 130 dataType: "json", 131 success: function(data) { 132 alert('Success: The text is now stored in the database.'); 121 133 } 134 }); 135 //window.location = 'Transaction/update.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 122 136 } 123 124 if(checks == 0){ 125 window.location = 'Transaction/update.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 126 }else{ 137 else 138 { 127 139 128 140 alert("Please fill all the details!"); -
schedule/js/chart.js
r16747 r16894 3 3 var source = new Array(); 4 4 //calls the xml request in a loop based on the current sources 5 $('#box2View option').each(function(){ 5 $('#box2View option').each(function() 6 { 6 7 source.push($(this).text()); 7 8
Note:
See TracChangeset
for help on using the changeset viewer.