Changeset 16894 for schedule/Transaction/insert.php
- Timestamp:
- 06/23/13 09:54:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ?>
Note:
See TracChangeset
for help on using the changeset viewer.