<?php

include "connection_openDB.php";
include "connection_closeDB.php";
include "getData.php";
$iterval = $_POST['itervalue'];
$file_id = $_POST['file_id'];
$db = connectDB();
createTransaction_file($db, $file_id);
$count = getTransaction_count_per_iter($db, $iterval);
echo $count;
closeDB($db);
// $file_id = $_POST['file_id'];
//
// $flag = $_POST['flag'];
//
// $db = connectDB();
//
// createTransaction_file($db,$file_id);
//
// if ($flag == 0){
//
//   getIterRange($db,$iterval);
//
// }else{
//
// $min = $_POST['min'];
// $start_range = $_POST['start'];
// $stop_range = $_POST['stop'];
//
// //    echo $file_id;
      this.processData = function(data){
     
        data_values = data;

        file_id = <?php 
echo $file_id;
?>
;

        iter_value = <?php 
echo $iteration;
?>
;

        transaction_count  = <?php 
$count = getTransaction_count_per_iter($db, $iteration);
echo $count;
?>
;

        time_info = <?php 
$i = 0;
$array = getTransaction_duration($db, $i);
$offset = $array[0];
$this_array = getTransaction_duration($db, $iteration);
$start = $this_array[0] - $offset;
$stop = $this_array[1] - $offset;
$total = $this_array[2];
$to_js = array();
array_push($to_js, $start);
array_push($to_js, $stop);