source: schedule/Transaction/insert.php@ 16066

Last change on this file since 16066 was 16066, checked in by tanio, 12 years ago
File size: 2.3 KB
Line 
1<?php
2include '../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
13echo $TimeEX2 = "day=".$TimeEX[0]."&month=".$TimeEX[1]."&year=".$TimeEX[2];
14echo $limtex = count(explode(",",$SelectedSource));
15$insertdate = $TimeEX[2]."-".$TimeEX[1]."-".$TimeEx[0];
16$value = $_GET['Data'];
17$Date = $_GET['Date2'];
18//$date = new DateTime($_GET['Date']);
19$n_value = explode(",",$value);
20echo "<br />";
21//echo $date->format('Y-m-d H:i:s');
22//fdgdfgdf
23 $Time = explode(",",$Time);
24$select = explode(",",$SelectedSource);
25$measure = explode(",",$SelectedMeasure);
26echo "<br />";
27$temp = "";
28$insert_count = 0;
29
30
31
32/////// for measurement id///////
33$new_limit = $limtex;
34 for($j=0;$j<=$new_limit-1;$j++){
35
36 echo $Time[$i];
37 echo "sgsdgdsg";
38 $ex_counter = explode(":",$Time[$i]);
39 //$ex_counter2 = explode(" ",$ex_counter[1]);
40
41 $counter[$j] = $ex_counter[0];
42
43 }
44
45 if($new_limit > 0){
46 for($j=0;$j<=$new_limit-1;$j++){
47
48 for($y=0;$y<=$new_limit-1;$y++){
49
50 if($counter[$j]==$counter[$y+1]){
51
52 if(empty($by_count[$j])){
53
54 $by_count[$j] = $y;
55 }
56 }
57
58 }
59 }
60
61 }else{
62
63
64 $by_count[0]=0;
65
66 }
67
68
69
70
71
72
73for($i=0;$i<=$limtex-1;$i++){
74
75 $n1 = $n_value[$i];
76 $select[$i];
77 $selectf = $select[$i];
78 //////Time////
79 //$Timef = $Time[$i];
80
81 //////// for measurement /////////
82
83 $measuref = $measure[$i];
84
85 //////// Date parsing into format////////
86 $dateTime=new DateTime($date." ".$Time[$i]);
87 $parsed_date = $dateTime->format('Y-m-d H:i:s');
88
89 echo $by_count[$i]."----".$counter[$i];
90 echo "<br />";
91
92
93 //$insert = mysql_query("INSERT INTO schedule values('','$parsed_date','$parsed_date','','','$n1','$selectf','$measuref')") or die(mysql_error());
94
95}
96 if($insert){
97
98 ?>
99 <script type="text/javascript">
100
101 alert("Sucessfully save");
102 // window.location = '../index.php?<?php echo $TimeEX2; ?>';
103 </script>
104 <?php
105
106 }
107
108?>
Note: See TracBrowser for help on using the repository browser.