<?
session_start();
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Invalid User'); parent.document.location='../index.html' </script>";
 return;
}

include("../test.php");
if($unit=='Telcon')
include("../opendb.php");
else if($unit=='Mahindra')
{
$db=mysqli_connect("localhost","root");
mysqli_select_db("mahdb1") or die(mysqli_error());
print $unit;
}

?>
<form action='<?print $PHP_SELF?>' name='f1' method='POST'>
<table>
<tr><td>Date </td><td>dd <input type=text name='d' size=2 value='<?print date('d',time())?>'>
mm <input type=text name='m' size=2 value='<?print date('m',time())?>'>
yy <input type=text name='y' size=4 value='<?print date('Y',time())?>'></td>
<td><input type=button name='print' onclick='printfun()' value='Print'></td></tr>
</table>
</form>

<script>
function printfun(x)
{
var d=document.f1.d.value;
var m=document.f1.m.value;
var y=document.f1.y.value;

window.open("prndstate.php?d="+d+"&&m="+m+"&&y="+y,true);
}
</script>
<style>
 body,td{font-family:arial narrow;font-size:14;color:black;}
 th{font-family:arial narrow;font-size:14;color:black;background-color:silver}
 body{background-color:ivory;}
</style>