Ignore:
Timestamp:
01/03/14 09:23:03 (11 years ago)
Author:
tanio
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedule/Transaction/insert.php

    r16926 r17422  
    1 <?php
    2 //Build by: khristofer Usman
    3 //Modified by: Jaypee Tanio
    4 // June 14,2013
     1 <?php
     2//connect to the mysql
     3$db = mysql_connect('localhost', 'root', '') or die("Could not connect database");
     4mysql_select_db('sandboxschedule', $db) or die("Could not select database");
    55
    6 include '../include/factdb.php';
    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'];
    14 echo "<br />";
    15 $n_value = explode(",",$value);
    16 $Times = explode(",",$Time);
    17 $select = explode(",",$SelectedSource);
    18 $measure = explode(",",$SelectedMeasure);
    19 $limtex = count(explode(",",$SelectedMeasure));
    20 echo "<br />";
    21 for($i=0;$i<=$limtex-1;$i++)
    22 {
    23         $n1 = $n_value[$i];             
    24         $selectf = $select[$i];
    25         $measuref = $measure[$i];
    26         $dateTime=new DateTime($date." ".$Times[$i]);
    27         $parsed_date =  $dateTime->format('Y-m-d H:i:s');
     6
     7        $GTimes=$_POST['GTime'];
     8        $Source=$_POST['Source'];
     9        $measure=$_POST['measure'];
     10        $data=$_POST['Data'];
     11        $Gdates = $_POST['GDate'];
     12        $seq = $_POST['seq'];
    2813       
    29                 mysql_query("INSERT INTO schedule VALUES('null','".$parsed_date."','".$UpdateDate."','".$measuref."','','".$n1."','".$selectf."','".$measuref."')");   
    30                        
    31 }
     14        $date = new DateTime($Gdates.$GTimes);
     15        $par=$date->format('Y-m-d H:i:s');
     16        $Timez = new DateTime($GTimes);
     17        $part = $Timez->format('H:i:s');       
     18                        //database query
     19                        mysql_query("INSERT INTO schedule VALUES('null','".$par."','".$part."','".$seq."','','".$data."','".$Source."','".$measure."')");
     20       
    3221       
    3322?>
Note: See TracChangeset for help on using the changeset viewer.