1 | <?php
|
---|
2 | include '../include/factdb.php';
|
---|
3 |
|
---|
4 | $Time =$_GET['Time'];
|
---|
5 | $SelectedSource = $_GET['Source'];
|
---|
6 | $Date = $_GET['Date'];
|
---|
7 |
|
---|
8 | $SelectedMeasure = $_GET['measure'];
|
---|
9 | $TimeEX = explode("-",$Date);
|
---|
10 |
|
---|
11 | echo $TimeEX2 = "day=".$TimeEX[0]."&month=".$TimeEX[1]."&year=".$TimeEX[2];
|
---|
12 | echo $limtex = count(explode(",",$SelectedSource));
|
---|
13 | $insertdate = $TimeEX[2]."-".$TimeEX[1]."-".$TimeEx[0];
|
---|
14 | $value = $_GET['Data'];
|
---|
15 | $Date = $_GET['Date2'];
|
---|
16 | //$date = new DateTime($_GET['Date']);
|
---|
17 | $n_value = explode(",",$value);
|
---|
18 | echo "<br />";
|
---|
19 | //echo $date->format('Y-m-d H:i:s');
|
---|
20 | //fdgdfgdf
|
---|
21 | $Time = explode(",",$Time);
|
---|
22 | $select = explode(",",$SelectedSource);
|
---|
23 | $measure = explode(",",$SelectedMeasure);
|
---|
24 | echo "<br />";
|
---|
25 | for($i=0;$i<=$limtex-1;$i++){
|
---|
26 |
|
---|
27 |
|
---|
28 | $n1 = $n_value[$i];
|
---|
29 |
|
---|
30 | $select[$i];
|
---|
31 |
|
---|
32 |
|
---|
33 | $selectf = $select[$i];
|
---|
34 | $Timef = $Time[$i];
|
---|
35 | $dateTime=new DateTime($date." ".$Time[$i]);
|
---|
36 |
|
---|
37 | echo $parsed_date = $dateTime->format('Y-m-d H:i:s');
|
---|
38 | $measuref = $measure[$i];
|
---|
39 |
|
---|
40 |
|
---|
41 | $insert = mysql_query("INSERT INTO schedule values('','$parsed_date','$parsed_date','','','$n1','$selectf','$measuref')") or die(mysql_error());
|
---|
42 |
|
---|
43 | }
|
---|
44 | if($insert){
|
---|
45 |
|
---|
46 | ?>
|
---|
47 | <script type="text/javascript">
|
---|
48 | alert("Sucessfully save");
|
---|
49 | </script>
|
---|
50 | <?php
|
---|
51 |
|
---|
52 | }
|
---|
53 |
|
---|
54 | ?> |
---|