<?php
require_once('calendar/classes/tc_calendar.php');
?>
<html>
<head>
<link href="calendar/calendar.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="calendar/calendar.js"></script>

<style>
 td{font-family:verdana;font-size:14;color:black;}
 th{font-family:verdana;font-size:14;color:white;background-color:#5b5858}
 body{background-color:silver;}
 select
  {border-style:ridge;
   border-color:black;
   height:25px;
   border-size=1;
   font-family:verdana;
   color:black;
  }
 input
  {border-style:ridge;
   border-color:#22437f;
   background-color:white;
   height:25px;
   font-weight:bold;
   border-size=1;
   font-family:sans-serif;
   color:BLACK;
  }
</style>
</head>
<center><p>&nbsp;<p>&nbsp;<p>&nbsp;
<B>SET ACCOUNTING PERIOD</B>
<?
/*$link=mysqli_connect("localhost.localdomain","root");
mysqli_select_db("alpdb") or die ("<h3> Error:Database could not be connected-".mysqli_error());
*/
include("opendb.php");
include("test.php");
$result=mysqli_query($db,"select * from acperiod") or die (mysqli_error());
$row=mysqli_fetch_row($result) or die (mysqli_error());
$df=explode("-",$row[0]);
$dt=explode("-",$row[1]);
print $row[0];
print $row[1];

?>
<body onLoad=document.f1.d.focus()>

<form name=f1 action='svperiod.php'>

<table border=1>
                  <td nowrap>From :</td>
                  <td><script language="javascript">
						<!--
						function myChanged(v){
							alert("Hello, value has been changed : "+document.getElementById("date1").value+"["+v+"]");
						}
						//-->
						</script>
                    <?php
					  $myCalendar = new tc_calendar("date1", true);
					  $myCalendar->setIcon("calendar/images/iconCalendar.gif");
					  $myCalendar->setDate($df[2], $df[1], $df[0]);
					  $myCalendar->setPath("calendar/");
					  $myCalendar->setYearInterval(1960, 2015);
					  $myCalendar->dateAllow('2009-01-01', '2050-03-31');
					  //$myCalendar->setHeight(350);
					  //$myCalendar->autoSubmit(true, "form1");
					  $myCalendar->setSpecificDate(array("2011-08-15", "2011-10-02", "2012-01-26"), 0, 'day');
					  //$myCalendar->setOnChange("myChanged('test')");
					  //$myCalendar->rtl = true;
					  $myCalendar->writeScript();
					  ?></td></tr>
                  <td nowrap>To :</td>
                  <td><script language="javascript">
						<!--
						function myChanged(v){
							alert("Hello, value has been changed : "+document.getElementById("date1").value+"["+v+"]");
						}
						//-->
						</script>
                    <?php
					  $myCalendar = new tc_calendar("date2", true);
					  $myCalendar->setIcon("calendar/images/iconCalendar.gif");
					  $myCalendar->setDate($dt[2], $dt[1], $dt[0]);	
					  
					  $myCalendar->setPath("calendar/");
					  $myCalendar->setYearInterval(1960, 2015);
					  $myCalendar->dateAllow('2009-01-01', '2050-03-31');
					  //$myCalendar->setHeight(350);
					  //$myCalendar->autoSubmit(true, "form1");
					  $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-13", "2011-04-25"), 0, 'day');
					 // $myCalendar->setOnChange("myChanged('test')");
					  //$myCalendar->rtl = true;
					  $myCalendar->writeScript();
					  ?></td>
<tr><td colspan=2 align=center><input type=submit value="Update"> <input type=button value='Cancel' onClick=document.location='blank.html'> </td>  </tr>
</table>

