<?php

//$t_php_name = "Pacific/Auckland";

//date_default_timezone_set($t_php_name);
  ini_set('display_errors', 'On');
  require __DIR__ . '/vendor/autoload.php';
  require_once('storage.php');
  
  
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
  
  	include("../php/configi.php");


  $theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string($conn, $theValue) : mysqli_escape_string($conn, $theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

	 include '../php/configi.php';
	 
	 	


		
		
	 include '../php/configi.php';
	 
	 	//	$invoice_date = date("Y-m-d");
		
			echo "gmdate is ". gmdate("Y-m-d");
			
			$invoice_date = gmdate("Y-m-d", strtotime('+12 hours'));
			
			echo "invoice date is ".$invoice_date;
		
			$due_date = strtotime("+7 day", strtotime($invoice_date));

			echo "invoice date is ".$invoice_date;

		
			$due_date = date("Y-m-d" , $due_date);
		
?>