<?
require("_database.php");
require("_functions.php");
require("_layout.php");
?>
<html>
<head>
 <META HTTP-EQUIV=REFRESH CONTENT=30>
<script src = "note.js" ></script>
<!-- TREE YUI -->
   <!-- Required CSS -->
  <link type="text/css" rel="stylesheet" href="yui/build/treeview/assets/skins/sam/treeview.css"> 
  <!-- Dependency source files --> 
  <script src = "yui/build/yahoo/yahoo-min.js" ></script>
  <script src = "yui/build/event/event-min.js" ></script>
  <!-- TreeView source file --> 
  <script src = "yui/build/treeview/treeview-min.js" ></script>
  <!--bring in the folder-style CSS for the TreeView Control-->
  <link rel="stylesheet" type="text/css" href="yui/examples/treeview/assets/css/folders/tree.css"> 

<style type="text/css">


.icon-ppt { padding-left: 20px; background: transparent url(yui/examples/treeview/assets/img/icons.png) 0 0px no-repeat; }
.icon-dmg { padding-left: 20px; background: transparent url(yui/examples/treeview/assets/img/icons.png) 0 -36px no-repeat; }
.icon-prv { padding-left: 20px; background: transparent url(yui/examples/treeview/assets/img/icons.png) 0 -72px no-repeat; }
.icon-gen { padding-left: 20px; background: transparent url(yui/examples/treeview/assets/img/icons.png) 0 -108px no-repeat; }
.icon-doc { padding-left: 20px; background: transparent url(yui/examples/treeview/assets/img/icons.png) 0 -144px no-repeat; }
.icon-jar { padding-left: 20px; background: transparent url(yui/examples/treeview/assets/img/icons.png) 0 -180px no-repeat; }
.icon-zip { padding-left: 20px; background: transparent url(yui/examples/treeview/assets/img/icons.png) 0 -216px no-repeat; }
</style>

<style type="text/css">
<? include("_style_base.php"); ?>

body {
  margin:0;
  overflow:visible;
}

textarea {
  position:absolute; 
  overflow:auto; 
  left:2px; 
  top:1em; 
  right:2px; 
  bottom:1em; 
  margin-top:8px; 
  margin-bottom:2px; 
  border:1px solid #ccc;
}

label {
  position:absolute; 
  overflow:auto; 
  left:2px; 
  top:1em; 
  right:2px; 
  bottom:1em; 
  margin-top:8px; 
  margin-bottom:2px; 
  border:1px solid #ccc;
}

#table {
  position:absolute; 
  overflow:auto; 
  left:2px; 
  top:1em; 
  right:2px; 
  bottom:1em; 
  margin-top:8px; 
  margin-bottom:2px; 
  border:1px solid #ccc;
}


iframe {
  height:200px;
}

#setup-offline a {
  color:red!important;
  font-weight:bold!important;
}


#tempstatus{
  position:relative;
  top:5px;
  left:0px;
}

#status {
  position:relative;
  top:0px;
  left:0px;
  bottom: 0px;
}

#contact {
  position:relative;
  top:5px;
  left:0px;
  bottom: 5px;
}

.tree{
  position:relative;
  top:5px;
  left:0px;
  right:15px;
  bottom: 0px
}

.info{
  font-size: 120%;
  position:relative;
  top: 5px;
  left: 0px;
  right:0px;
  bottom:5px;
  padding: 10px;
}
</style>

<style type="text/css">
<? include("_style_base.php"); ?>

body {
  margin:0;
  overflow:visible;
}

</style>
<?php
  global $SITE_SECRET;
$con = mysql_connect("localhost","root","");
if (!$con)
  {
	  die('Could not connect: ' . mysql_error());
  }
$id = validateUserCookie();
validateUserCookie(true );
$id = db_escape($id);

if($id)
{
	$result = db_query_get("SELECT * FROM users where id=$id" );
	$data = $result[0]['content'];
	$path = $result[0]['path'];
	$email = $result[0]['email'];
	$email = db_escape($email);
	$mcname = $result[0]['mcname'];
	$mcname = db_escape($mcname);
	$row = db_query_get("SELECT * FROM users where email='$email'");
	$count = count($row);
}
else
{
	header('Location: login.php');
}

?>
<title> View Mode </title>
<script src = "note.js" ></script>
</head>

<? masthead("View"); ?>
<!-- Display db-->
<?
		echo "<body onload=\"init()\" class=\"folder\">";
		echo "<script type=\"text/javascript\" src=\"wz_tooltip.js\"></script>";
//		echo "<script src = \"note.js\" ></script>";
		echo "<div id=\"status\" class=\"green\">View.</div>";
		foreach($row as $o)
		{
			$i=db_escape($o['id']);
			$c=db_escape($o['content']);
			$mcname = db_escape($o['mcname']);
			echo "<b>$mcname</b>";
			$tagname='treeDiv'.$i;
			echo "<input type=\"hidden\" name=\"$tagname\"  value=\"$mcname\"/>";
			echo "<div id=$tagname name=$tagname class=\"tree\">TREE YUI: $tagname</div><br/>";	
			echo "<script  type=\"text/javascript\">";
			echo "disp_it('$c', $tagname, '$mcname' );";
			echo "</script>";
		
		}
?>

<script type="text/javascript" src="base.js"></script>
<script type="text/javascript" src="cookies.js"></script>
<script type="text/javascript" src="xhr.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="datastore.js"></script>
<script src = "note.js" ></script>
</body>
</html>