diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 1539c31..14b4342 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -15,7 +15,9 @@ I:updated jstree version
DB UPGRADE 1.6 -> 1.7
-----------------------------
alter table settings add column timezone;
+alter table settings add column dbversion;
update settings set timezone="GMT";
+update settings set dbversion=1;
diff --git a/data/pure.db b/data/pure.db
index 537e28c..a53558b 100644
Binary files a/data/pure.db and b/data/pure.db differ
diff --git a/doc/aes/aes.html b/doc/aes/aes.html
index 01b8829..a3be47d 100644
--- a/doc/aes/aes.html
+++ b/doc/aes/aes.html
@@ -1,4 +1,4 @@
-
+
JavaScript Implementation of AES Advanced Encryption Standard in Counter Mode
diff --git a/doc/sqlite-1.2.txt b/doc/sqlite.txt
similarity index 91%
rename from doc/sqlite-1.2.txt
rename to doc/sqlite.txt
index 7be89be..5fb06e5 100644
--- a/doc/sqlite-1.2.txt
+++ b/doc/sqlite.txt
@@ -17,12 +17,13 @@ CREATE TABLE item2file(itemid INTEGER,fileid INTEGER);
CREATE TABLE "item2inv" (itemid integer,invid integer);
CREATE TABLE item2soft (itemid INTEGER, softid INTEGER, instdate INTEGER);
CREATE TABLE itemlink (itemid1, itemid2);
-CREATE TABLE items (id INTEGER primary key autoincrement,itemtypeid integer, function, manufacturerid integer,model,sn,sn2,sn3,origin,warrantymonths integer,purchasedate integer,purchprice,dnsname,maintenanceinfo,comments,ispart integer,hd,cpu,ram,locationid integer,userid integer,ipv4,ipv6,usize integer,rackmountable integer,macs,remadmip,panelport,ports integer,switchport,switchid integer,rackid integer,rackposition integer,label,status integer, cpuno INTEGER, corespercpu INTEGER, rackposdepth integer, warrinfo);
+CREATE TABLE items (id INTEGER primary key autoincrement,itemtypeid integer, function, manufacturerid integer,model,sn,sn2,sn3,origin,warrantymonths integer,purchasedate integer,purchprice,dnsname,maintenanceinfo,comments,ispart integer,hd,cpu,ram,locationid integer,userid integer,ipv4,ipv6,usize integer,rackmountable integer,macs,remadmip,panelport,ports integer,switchport,switchid integer,rackid integer,rackposition integer,label,status integer, cpuno INTEGER, corespercpu INTEGER, rackposdepth integer, warrinfo, locareaid number);
CREATE TABLE itemtypes (id INTEGER PRIMARY KEY AUTOINCREMENT, typeid, typedesc, hassoftware integer);
-CREATE TABLE labelpapers (id INTEGER PRIMARY KEY AUTOINCREMENT,rows integer, cols integer, lwidth real, lheight real, vpitch real, hpitch real, tmargin real, bmargin real, lmargin real, rmargin real, name);
+CREATE TABLE labelpapers (id INTEGER PRIMARY KEY AUTOINCREMENT,rows integer, cols integer, lwidth real, lheight real, vpitch real, hpitch real, tmargin real, bmargin real, lmargin real, rmargin real, name, border, padding, headerfontsize, idfontsize, wantheadertext, wantheaderimage, headertext, fontsize, wantbarcode, barcodesize, image, imagewidth, imageheight, papersize);
CREATE TABLE locareas(id INTEGER PRIMARY KEY AUTOINCREMENT,locationid number,areaname,x1 number,y1 number,x2 number,y2 number);
CREATE TABLE locations (id INTEGER PRIMARY KEY AUTOINCREMENT, name, floor, floorplanfn);
-CREATE TABLE racks (id INTEGER PRIMARY KEY AUTOINCREMENT, locationid integer, usize integer, depth integer, comments,model,label, revnums integer);
+CREATE TABLE racks (id INTEGER PRIMARY KEY AUTOINCREMENT, locationid integer, usize integer, depth integer, comments,model,label, revnums integer, locareaid number);
+CREATE TABLE settings(companytitle, dateformat, currency, lang, version, timezone);
CREATE TABLE soft2inv(invid integer,softid integer);
CREATE TABLE software (id INTEGER PRIMARY KEY autoincrement, invoiceid integer,slicenseinfo ,stype ,manufacturerid integer ,stitle ,sversion ,sinfo ,purchdate integer,licqty integer, lictype integer);
CREATE TABLE software2file(softwareid INTEGER,fileid INTEGER);
diff --git a/index.php b/index.php
deleted file mode 120000
index 0bd42b9..0000000
--- a/index.php
+++ /dev/null
@@ -1 +0,0 @@
-itdb.php
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..301768a
--- /dev/null
+++ b/index.php
@@ -0,0 +1,405 @@
+\n";
+ break;
+ case "listagents":
+ $title="List Agents";
+ break;
+ case "editagent":
+ $title="Edit Agent";
+ break;
+ case "edititem":
+ $title="Edit Item";
+ $stitle="Item";
+ $head.="\n".
+ "\n".
+ "\n".
+ "\n".
+ "\n";
+ break;
+ case "editsoftware":
+ $title="Edit Software";
+ $stitle="Software";
+ $head.="\n".
+ "\n".
+ "\n".
+ "\n".
+ "\n";
+ break;
+ case "listsoftware":
+ $title="List Software";
+ $head.="\n";
+ break;
+ case "listcontracts":
+ $title="List Contracts";
+ break;
+ case "listinvoices":
+ $title="List Invoices";
+ break;
+ case "editinvoice":
+ $title="Edit Invoice";
+ $stitle="Invoice";
+ $head.="\n".
+ "\n".
+ "\n";
+ break;
+ case "listfiles":
+ $title="List Files";
+ break;
+ case "editfile":
+ $title="Edit File";
+ $stitle="File";
+ $head.="\n".
+ "\n".
+ "\n";
+ break;
+ case "listracks":
+ $title="List Racks";
+ break;
+ case "translations":
+ $title="Translations";
+ break;
+ case "settings":
+ $title="Settings";
+ break;
+ case "editrack":
+ $stitle="Rack";
+ $title="Edit Rack";
+ $head.="\n".
+ "\n".
+ "\n";
+ break;
+ case "edititypes":
+ $title="Edit Item Types";
+ break;
+ case "editcontract":
+ $title="Edit Contract";
+ $stitle="Contract";
+ $head.="\n".
+ "\n".
+ "\n";
+ break;
+ case "editcontracttypes":
+ $title="Edit Contract Types";
+ break;
+ case "edittags":
+ $title="Edit Tags";
+ break;
+ case "editusers":
+ $title="Edit Users";
+ break;
+ case "listlocations":
+ $title="List Locations";
+ break;
+ case "editlocation":
+ $title="Edit Location";
+ break;
+ case "editstatustypes":
+ $title="Edit Item Status Types";
+ break;
+ case "editfiletypes":
+ $title="Edit File Types";
+ break;
+ case "printlabels":
+ $title="Print Labels ";
+ break;
+ case "reports":
+ $title="Reports";
+ $head.="\n".
+ "\n".
+ "\n".
+ "\n".
+ "";
+ break;
+ case "showhist":
+ $title="History";
+ break;
+ case "browse":
+ $title="Browse Data";
+ $head.="";
+ break;
+ case "viewrack":
+ $title="Rack";
+ $stitle="Rack";
+ break;
+ case "about":
+ $title="About";
+ $stitle="About";
+ $req="php/about.php";
+ break;
+ default:
+ $title="";
+ $stitle="";
+ $req="php/home.php";
+ break;
+}
+if (isset($_GET['id']))
+ $id=$_GET['id'];
+else
+ $id="";
+
+if (strlen($stitle)) $stitle.=":".$id;
+
+$x="style_".$_GET['action'];
+$$x="color:#BAFF04 ";
+
+
+require('php/header.php');
+
+if (0 && $authstatus && (dbversion() != $dbversion)) {
+ echo "";
+ require ("php/itdbupdate.php");
+ echo "\n\n";
+ exit;
+}
+
+if ($dlg && $authstatus) {
+ echo "";
+ require($req);
+ echo "\n\n";
+ exit;
+}
+
+?>
+
+
+
+
+
+
+
+
+
+IT ITems DataBase
+
+
+
+
+
+
+
+ | |
+ | |
+
+ |
+
+
+ |
+ |
+
+
+
+ |
+ |
+
+
+
+ |
+ |
+
+
+
+
+ |
+ |
+
+
+
+ |
+ |
+
+
+
+
+ |
+ |
+
+
+
+ |
+ |
+
+
+
+
+ |
+ |
+
+
+ |
+
+ |
+ |
+ |
+ |
+
+ |
+
+ |
+ |
+
+ |
+ |
+ |
+
|
+
+ |
+ |
+DB Log |
+
+".
+ "
\n
".
+ "
\n".
+ "
";
+ "\n";
+}
+
+if ($authstatus) {
+ echo "\n
".
+ "
";
+
+
+ if (strlen($stitle)) {
+ $url="$fscriptname?action=$action&id=$id";
+
+ $sql="SELECT * FROM viewhist order by id DESC limit 1";
+ $sth=db_execute($dbh,$sql);
+ $viewhist=$sth->fetchAll(PDO::FETCH_ASSOC);
+ if (!$demomode) {
+ if ($viewhist[0]['url']!=$url) {
+ $sql="INSERT into viewhist (url,description)".
+ " VALUEs ('$url','$stitle')";
+ db_exec($dbh,$sql,1,1,$lastid);
+
+ $lastkeep=(int)($lastid)-40;
+ $sql="DELETE from viewhist where id<$lastkeep";
+ db_exec($dbh,$sql,1,1);
+ $sth=$dbh->exec($sql);
+ }
+ }
+ }
+
+ $sql="SELECT * FROM viewhist order by id DESC";
+ $sth=db_execute($dbh,$sql);
+ $viewhist=$sth->fetchAll(PDO::FETCH_ASSOC);
+
+ ?>
+
\n";
+ }
+
+ ?>
+
+
+$authmsg
";
+elseif (!strstr($authmsg,"elcome"))
+ echo "
$authmsg
";
+
+
+if ($authstatus) {
+?>
+
DB (SQLite)
+
Full Backup
+ ".
+ "Version $version
sivann\n";
+?>
+
+
+
+
+
+
+
+Please log in";
+ require("php/about.php");
+}
+
+$itdb_end=getmicrotime();
+
+echo "
";//
+
+echo "server time = ".number_format(($itdb_end - $itdb_start),3)." secs";
+
+?>
+
+