Changeset 16721
- Timestamp:
- 06/05/13 05:45:07 (12 years ago)
- Location:
- schedule
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/Scheduling.php
r16686 r16721 1 1 <?php 2 2 include '../include/factdb.php'; 3 include '../function/SplitDelete.php'; 3 4 //include '../function/SplitDelete.php'; 4 5 ?> 5 6 <table width="100%" id="TableHolder" > -
schedule/Transaction/insert.php
r16535 r16721 15 15 $insertdate = $TimeEX[2]."-".$TimeEX[1]."-".$TimeEx[0]; 16 16 $value = $_GET['Data']; 17 $ Date = $_GET['Date2'];17 $date = $_GET['Date']; 18 18 //$date = new DateTime($_GET['Date']); 19 19 $n_value = explode(",",$value); -
schedule/authenticate/body.php
r16279 r16721 60 60 </div> 61 61 <div style="border:2px solid white; width:100%;" id="Scheduling"> 62 <?php 63 64 include 'function/SplitDelete.php'; 65 // include 'Module/Scheduling'; 66 ?> 67 62 68 <script type="text/javascript"> 63 $(document).ready(function(){ 64 $('#Scheduling').fadeIn('slow').load('Module/Scheduling.php'); 65 }); 69 // $(document).ready(function(){ 70 71 72 // $('#Scheduling').fadeOut('slow').load('Module/Scheduling.php').fadeIn('slow'); 73 74 // }); 66 75 </script> 76 <table width="100%" id="TableHolder" > 77 78 <tr> 79 <td width="184" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Time</td> 80 81 <td width="170" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Measurement</td> 82 <td width="145" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Source list</td> 83 <td width="316" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Value</td> 84 <td width="141" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Transaction</td> 85 </tr> 86 <tr> 87 88 89 <td style="border:0px solid white; color:#37DFB1; font-size:14px;" colspan="4"> </td> 90 </tr> 91 92 </table> 93 <table width="100%" id="TableH" class="myTable"> 94 </table> 95 <table width="100%" id="TableH1" class="myTable"> 96 </table> 97 98 <table width="100%"> 99 <tr> 100 101 102 <td style="border:0px solid white; color:#37DFB1; font-size:14px;" width="80%" align="center"> </td> 103 104 </tr> 105 </table> 67 106 </div> 68 107 <div style="border:2px solid white; width:100%;" align="center" id="SchedulingAppend"> -
schedule/function/SplitDelete.php
r16608 r16721 1 1 <script type="text/javascript"> 2 2 $(document).ready(function(){ 3 3 4 var timeValue; 4 5 var meas; 5 6 var meas2; 6 7 var getTableId; 7 window.cnt=2; 8 window.cnt=0; 9 10 11 12 13 //-------------------------------- fetch----------------------------// 14 15 16 17 //-----------------------------------------------// 18 //end fetch 19 20 //------------------------------------------------// 21 var x = 0; 22 23 <?php 24 25 26 include '../include/factdb.php'; 27 $day = $_GET['days']; 28 $days = Date('Y-m-d',strtotime($day)); 29 ?> 30 //alert('<?php echo $day; ?>'); 31 32 <?php 33 34 35 $fetch = mysql_query("SELECT * FROM schedule") or die(mysql_error()); 36 37 while($rows = mysql_fetch_array($fetch)){ 38 $timestamp=strtotime($rows['fLastUpdate']); 39 $timestamp2 = date('Y-m-d',$timestamp); 40 $date_time = date('H:i',$timestamp); 41 //$time_new = $date_time->format('H:i:s') 42 if($days == $timestamp2){ 43 44 45 ?> 46 cnt++; 47 48 49 8 50 var table = document.createElement("table"); 51 table.setAttribute('id',"table"+cnt); 52 table.setAttribute('width','100%'); 53 var tr = document.createElement('tr'); 54 var td3=document.createElement('td'); 55 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); 56 td3.appendChild( 57 input = document.createElement("input"), 58 input.setAttribute("type","time"), 59 input.setAttribute("id","Time"+cnt), 60 input.setAttribute("max","24"), 61 input.setAttribute("min","1"), 62 input.setAttribute("required",true), 63 input.setAttribute("value",'<?php echo $date_time; ?>') 64 65 ); 66 td3.appendChild( 67 button=document.createElement('input'), 68 button.setAttribute('type','button'), 69 button.setAttribute('value','[+]'), 70 button.setAttribute('id','btnAddTime'), 71 button.onclick=function(){ 72 73 74 75 if($('#Time1').val() != ""){ var splitting = $('#Time1').val().split(':'); var add = 01; 76 77 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 78 79 function pad(number, length) { 80 81 var str = '' + number; 82 while (str.length < length) { 83 str = '0' + str; 84 } 85 86 return str; 87 88 } 89 90 meas = "name"; meas2 = "time"; getTableId = '#table'+cnt; split1(); }else{ alert("please enter value for time to add measurement"); } 91 92 93 } 94 ); 95 var td=document.createElement('td'); 96 td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); 97 td.appendChild( 98 sourcecbo= document.createElement('select'), 99 sourcecbo.setAttribute('id','source'+cnt), 100 <?php 101 $source=mysql_query("SELECT*FROM source"); 102 while($rowsource=mysql_fetch_array($source)) 103 { 104 ?> 105 sourcecbo.appendChild( 106 option=document.createElement('option'), 107 108 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'), 109 <?php if($rows['fSourceKey'] == $rowsource['fSourceKEY']){ echo"option.setAttribute('selected',true),"; } ?> 110 111 112 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>")) 113 114 115 ), 116 <?php 117 } 118 ?> 119 sourcecbo.setAttribute('id','source'+cnt) 120 121 ); 122 var td1=document.createElement('td'); 123 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); 124 td1.appendChild( 125 measurementcbo= document.createElement('select'), 126 measurementcbo.setAttribute('id','measurement'+cnt), 127 <?php 128 $measure=mysql_query("SELECT*FROM measurement"); 129 while($rowmeasure=mysql_fetch_array($measure)) 130 { 131 ?> 132 measurementcbo.appendChild( 133 option=document.createElement('option'), 134 option.setAttribute('value','<?php echo $rowmeasure['fMeasurementKey']; ?>'), 135 136 <?php if($rows['fMeasurementTypeKey']==$rowmeasure['fMeasurementKey']){ echo "option.setAttribute('selected',true),";} ?> 137 138 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>")) 139 ), 140 <?php 141 } 142 ?> 143 measurementcbo.setAttribute('id','measurement'+cnt) 144 ); 145 td1.appendChild( 146 button=document.createElement('input'), 147 button.setAttribute('type','button'), 148 button.setAttribute('value','[+]'), 149 button.setAttribute('id','btnAddTime'), 150 button.onclick=function(){ 151 if($('#Time1').val() != ""){ timeValue = $('#Time1').val(); meas = "hidden"; meas2 = true; getTableId = '#table'+cnt; split1(); }else{ alert("please enter value for time to add measurement"); } 152 153 154 } 155 ); 156 var td2=document.createElement('td'); 157 td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 158 td2.appendChild( 159 input = document.createElement('input'), 160 input.setAttribute('type','text'), 161 input.setAttribute('id','txtData'+cnt), 162 input.setAttribute('value','<?php echo $rows['fData']; ?>') 163 164 165 ); 166 var td4=document.createElement('td'); 167 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 168 td4.appendChild( 169 button = document.createElement('input'), 170 button.setAttribute("type",'button'), 171 button.setAttribute('id','btnSplit'), 172 button.setAttribute('value','Split'), 173 button.onclick= function() 174 { 175 176 if($('#Time1').val() != ""){ var splitting = $('#Time1').val().split(':'); var add = 30; 177 178 179 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); 180 181 function pad(number, length) { 182 183 var str = '' + number; 184 while (str.length < length) { 185 str = '0' + str; 186 } 187 188 return str; 189 190 }; 191 192 meas = "name"; meas2 = "time"; getTableId = '#table'+cnt; split1(); }else{ alert("please enter value for time to add measurement"); } 193 194 195 196 } 197 ); 198 td4.appendChild( 199 button=document.createElement('input'), 200 button.setAttribute('type','button'), 201 button.setAttribute('value','Delete'), 202 button.setAttribute('id','btnDelete'), 203 button.onclick=function(){ 204 $('#table'+cnt).remove(); 205 } 206 ); 207 208 tr.appendChild(td3); 209 tr.appendChild(td1); 210 tr.appendChild(td); 211 212 tr.appendChild(td2); 213 tr.appendChild(td4); 214 table.appendChild(tr); 215 216 $('#TableH1').append(table); 217 218 <?php 219 } 220 } 221 ?> 222 223 if(cnt==0){ 224 var table = document.createElement("table"); 9 225 table.setAttribute('id',"table2"); 10 226 table.setAttribute('width','100%'); 11 227 var tr = document.createElement('tr'); 228 tr.setAttribute('id',''); 229 tr.setAttribute('class',''); 12 230 var td3=document.createElement('td'); 13 231 td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;'); … … 19 237 input.setAttribute("min","1"), 20 238 input.setAttribute("required",true) 21 22 239 ); 23 240 td3.appendChild( … … 27 244 button.setAttribute('id','btnAddTime'), 28 245 button.onclick=function(){ 29 30 31 32 if($('#Time1').val() != ""){ var splitting = $('#Time1').val().split(':'); var add = 01; 246 if($('#Time2').val() != ""){ var splitting = $('#Time2').val().split(':'); var add = 01; 33 247 34 248 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 43 257 return str; 44 258 45 } 46 47 meas = "name"; meas2 = "time"; getTableId = '#table2'; split1(); }else{ alert("please enter value for time to add measurement"); } 259 }; meas = "name"; meas2 = "time"; getTableId = '#table1'; split(); }else{ alert("please enter value for time to add measurement"); } 48 260 49 261 … … 56 268 sourcecbo.setAttribute('id','source1'), 57 269 <?php 58 $source=mysql_query("SELECT*FROM source");59 while($rowsource=mysql_fetch_array($source))60 {61 ?> 270 $source=mysql_query("SELECT*FROM source"); 271 while($rowsource=mysql_fetch_array($source)) 272 { 273 ?> 62 274 sourcecbo.appendChild( 63 275 option=document.createElement('option'), 64 65 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'), 66 option.setAttribute('selected',true), 67 68 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>")) 69 70 71 ), 72 <?php 73 } 74 ?> 276 option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'), 277 option.setAttribute('selected',true), 278 option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>")) 279 280 ), 281 <?php 282 } 283 ?> 75 284 sourcecbo.setAttribute('id','source1') 76 285 … … 103 312 button.setAttribute('id','btnAddTime'), 104 313 button.onclick=function(){ 105 if($('#Time 1').val() != ""){ timeValue = $('#Time1').val(); meas = "hidden"; meas2 = true; getTableId = '#table2'; split1(); }else{ alert("please enter value for time to add measurement"); }314 if($('#Time2').val() != ""){ timeValue = $('#Time2').val(); meas = "hidden"; meas2 = true; getTableId = '#table1'; split(); }else{ alert("please enter value for time to add measurement"); } 106 315 107 316 … … 114 323 input.setAttribute('type','text'), 115 324 input.setAttribute('id','txtData1') 116 117 325 118 326 ); … … 126 334 button.onclick= function() 127 335 { 128 129 if($('#Time1').val() != ""){ var splitting = $('#Time1').val().split(':'); var add = 30; 130 336 if($('#Time2').val() != ""){ var splitting = $('#Time2').val().split(':'); var add = 30; 131 337 132 338 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); … … 141 347 return str; 142 348 143 }; 144 145 meas = "name"; meas2 = "time"; getTableId = '#table2'; split1(); }else{ alert("please enter value for time to add measurement"); } 146 349 } 350 351 meas = "name"; meas2 = "time"; getTableId = '#table1'; split(); }else{ alert("please enter value for time to add measurement"); } 147 352 148 149 353 } 150 354 ); … … 155 359 button.setAttribute('id','btnDelete'), 156 360 button.onclick=function(){ 157 $('#table2').remove(); 158 } 159 ); 160 361 $('#table1').remove(); 362 363 } 364 ); 365 161 366 tr.appendChild(td3); 162 367 tr.appendChild(td1); … … 166 371 tr.appendChild(td4); 167 372 table.appendChild(tr); 168 373 169 374 $('#TableH1').append(table); 170 171 172 375 173 376 var table = document.createElement("table"); … … 323 526 $('#TableH1').append(table); 324 527 325 var meas; 528 529 } 530 var meas; 326 531 var timeValue; 327 532 var pad; 328 533 if(cnt==0){ cnt=2; } 329 534 function split() 330 535 { -
schedule/function/function.php
r16688 r16721 12 12 $(document).ready(function GetDate(){ 13 13 // for fupdate 14 15 16 17 18 19 20 14 <?php 21 15 … … 27 21 ?> 28 22 $('#save').click(function(){ 29 30 23 var dtr; 24 dtr = '<?php echo $_GET['days']; ?>'; 25 //alert(dtr); 31 26 var InputValue = []; 32 27 var selectedSource = []; … … 58 53 59 54 if(checks == 0){ 60 window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+d ay+'-'+month+'-'+year;55 window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 61 56 }else{ 62 57
Note:
See TracChangeset
for help on using the changeset viewer.