Location: PHPKode > projects > TherapyDoc > therapydoc_1.3.1_3/menu.php
<?php
/*
 This file is a part of TherapyDoc 2.0, created by Matthew Ellis.
 If you modify this work, please retain this original notice.
 http://www.therapydoc.net for more information or to get TherapyDoc.
 */
session_start();
if(!$_SESSION['myusername']){
	header("location:../index.php");
}

include 'globals.inc';
require_once "include_b.php";
include './classes/therapydoc/pending.php';
if(!isset($_GET['error'])){
	$_GET['error']="";
}
$error=$_GET['error'];
if($error=='1'){
	echo "The requested document has already been started. Please continue from the list below.";
}
$tid=$_SESSION['id'];
$_SESSION['docs']="SELECT id,name,TableName,d_date,updated,patient_id FROM pending_view WHERE tid=$tid AND deleted='0' AND incomplete='1' ORDER BY d_date"
?>
<html>
<head>
<script type="text/javascript" src="./classes/therapydoc/menu.js"></script>
<script src="./classes/rico21/src/prototype.js" type="text/javascript"></script>
<script src="./classes/rico21/src/rico.js" type="text/javascript"></script>
<script type="text/javascript">
var therapist='<?php echo $_SESSION['therapist']; ?>';
if (therapist=='1'){
Rico.loadModule('LiveGridAjax','LiveGridMenu','greenHdg.css');
	Rico.onLoad(function() {
	  var buffer = new Rico.Buffer.AjaxSQL('classes/therapydoc/pending/xml_maker.php');

//----Eval Context Menu----
	  function docsMenu(grid,r,c,onBlankRow) {
		  var id=buffer.getWindowValue(r,0)
		  var pid=buffer.getWindowValue(r,5)
		  var tid=buffer.getWindowValue(r,2);
		  if(tid==="EVAL"){
			  a='1';
			  }
		  else if(tid==="POC"){
			  a='2';
			  }
		  else if(tid==="DC"){
			  a='3';
			  }
		  else if(tid==="TP-2"){
			  a='4';
			  }
		  if (buffer.getWindowValue(r,c) !== null)
		    grid.menu.addMenuItem("Continue", continuer);
		    grid.menu.addMenuItem("Delete", delete_eval);

		    function continuer() {
		    	window.location = "./view/documentation/page_1.php?a="+a+"&&doc_id="+id +"&&pid="+pid;
		    }
		    function delete_eval() {
				var answer1 = confirm("Are you sure you want to Delete this document?")
				if (answer1){
					window.location = "./classes/therapydoc/documentation/delete.php?doc_id="+id +"&&table=e";
				}
				else{
				}
				}
		}
		
	  var grid_options = { prefetchBuffer: true,
 			 			  hdrIconsFirst: true,
  						   FilterLocation: -1,  
  			  			 sortAscendImg: 'sort_asc.gif',
  			  			 sortDescendImg: 'sort_desc.gif',
  			 			  highlightElem: 'cursorRow',
  			 			  scrollBarWidth: 20,
  			 			  minPageRows: 15,
  			 			  maxPageRows: 20,
			  			   columnSpecs: [{width:50},{filterUI: 't',width:180},{filterUI: 't3',width:80},{width:100},{width:100},{width:70}],
			  			   menuEvent: 'contextmenu'
			  };
	   
	  var grid = new Rico.LiveGrid('docs', buffer, grid_options);
		grid.menu=new Rico.GridMenu();
		grid.menu.options.dataMenuHandler=docsMenu;
	  });
}
else {
	}
	
</script>
<link href="./CSS/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper"><?php include './classes/therapydoc/menu.php';?>
<div class="txt">
<h1><? echo "{$cinfo['name']} - $appname"; ?></h1>
<h2>Pending Documents for <? echo "{$_SESSION['fname']} {$_SESSION['lname']}"; ?></h2></div>
<table id="wrapper_table" class="plain">
	<tr>
	<td><table id="table1" class="plain" width="620"><tr><td class="center">
	<?php 
		if($_SESSION['therapist']==1) {
						echo "<p class='ricoBookmark'><span id='docs_bookmark'> </span></p>		
						<table width='1024' class='plain' id='docs'><tr>
						<th>ID</th>
						<th>Name</th>
						<th>Type</th>
    					<th>Date</th>
    					<th>Updated</th><th></th></tr></table></td></tr></table>";
}
				else{}
				?>
</td></tr></td></tr></table>
</table>
</div>
</body>
</html>
Return current item: TherapyDoc