Changeset 16100
- Timestamp:
- 05/23/13 22:17:54 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Transaction/insert.php
r16070 r16100 11 11 $TimeEX = explode("-",$Date); 12 12 13 echo$TimeEX2 = "day=".$TimeEX[0]."&month=".$TimeEX[1]."&year=".$TimeEX[2];14 echo$limtex = count(explode(",",$SelectedSource));13 $TimeEX2 = "day=".$TimeEX[0]."&month=".$TimeEX[1]."&year=".$TimeEX[2]; 14 $limtex = count(explode(",",$SelectedSource)); 15 15 $insertdate = $TimeEX[2]."-".$TimeEX[1]."-".$TimeEx[0]; 16 16 $value = $_GET['Data']; … … 27 27 $temp = ""; 28 28 $insert_count = 0; 29 30 $new_limit = $limtex; 29 31 30 32 31 33 32 /////// for measurement id/////// 33 $new_limit = $limtex; 34 for($j=0;$j<=$new_limit-1;$j++){ 34 for($j=0;$j <= $new_limit;$j++){ 35 35 36 echo $Times[$j];37 echo "sgsdgdsg";36 //echo $Times[$j]; 37 38 38 $ex_counter = explode(":",$Times[$j]); 39 39 40 40 $counter[$j] = $ex_counter[0]; 41 42 43 44 41 45 42 46 } 43 echo "<br />"; 44 if($new_limit > 0){ 45 for($j=0;$j<=$new_limit;$j++){ 46 47 for($y=0;$y<=$new_limit;$y++){ 48 if($y > 0){ 49 if($counter[$j]==$counter[$y]){ 50 51 if(empty($by_count[$y]) || $by_count[$y] == 0){ 52 53 $by_count[$y] = $y; 54 }else{ 55 56 $by_count[$y] = 0; 57 } 58 } 59 }else{ 60 61 62 $by_count[$y] = 0; 63 64 65 } 66 67 } 68 } 69 70 }else{ 71 72 73 $by_count[0]=0; 74 75 } 76 77 78 79 47 48 80 49 81 50 … … 94 63 //////// Date parsing into format//////// 95 64 $dateTime=new DateTime($date." ".$Times[$i]); 96 echo $parsed_date = $dateTime->format('Y-m-d H:i:s'); 97 echo "<br />"; 98 echo $by_count[$i]."----".$counter[$i]; 99 echo "<br />"; 65 $parsed_date = $dateTime->format('Y-m-d H:i:s'); 100 66 67 68 // $select = mysql_query("SELECT * FROM schedule WHERE fLastUpdate = '$parsed_date'"); 69 // if($select){ 70 // while($row = mysql_fetch_array($select)){ 71 72 73 // $new = $row['fMeasurementID'] + 1 ; 74 101 75 102 //$insert = mysql_query("INSERT INTO schedule values('','$parsed_date','$parsed_date','','','$n1','$selectf','$measuref')") or die(mysql_error()); 76 77 // } 78 // }else{ 103 79 80 // $new = 0; 81 82 // } 83 //echo $new."<br />"; 84 85 $insert = mysql_query("INSERT INTO schedule values('','$parsed_date','$parsed_date','','','$n1','$selectf','$measuref')ON DUPLICATE KEY UPDATE fMeasurementID=fMeasurementID + 1") or die(mysql_error()); 86 104 87 } 105 88 if($insert){ … … 109 92 110 93 alert("Sucessfully save"); 111 //window.location = '../index.php?<?php echo $TimeEX2; ?>';94 window.location = '../index.php?<?php echo $TimeEX2; ?>'; 112 95 </script> 113 96 <?php
Note:
See TracChangeset
for help on using the changeset viewer.