<?php echo '
<link rel="stylesheet" href="includes/media/css/TableTools_JUI.css" type="text/css" />
<script type="text/javascript" language="javascript" src="includes/media/js/ZeroClipboard.js"></script>
<script type="text/javascript" language="javascript" src="includes/media/js/TableTools.js"></script>
'; ?>
<script language="javascript">
	var asInitVals = new Array();
	
	$(document).ready(function() {
		$("#tabs").tabs( {
			"show": function(event, ui) {
				var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
				var tab3 = $("#tabs-3").is(":visible");
				
				if(tab3)
					$("#tab_id").val("3");
				
				if ( oTable.length > 0 ) {
					oTable.fnAdjustColumnSizing();
				}
			}
		} );
	} );
	
	function assign_partid(val)
	{
		$("#partcpnt_id").val(val["reg_id"]);
		close_frame();
		partcpnt_id_old = $("#partcpnt_id_old").val();
		
		if(partcpnt_id_old != "" && partcpnt_id_old != $("#partcpnt_id").val())
		{
			$("#dataTable").hide();
			$("#submit_div").hide();
			$("#partcpnt_id_old").val($("#partcpnt_id").val());
		}
		else
			$("#partcpnt_id_old").val($("#partcpnt_id").val());
	}
        
	function specimen_data()
	{
		part_id = $("#partcpnt_id").val();
		prd_frm = $("#prd_frm").val();
		prd_to = $("#prd_to").val();
		
		if(part_id == "")
		{
			alert("Please Provide Participant ID");
			$('#prd_frm').focus();
			$('#dataTable').html('');
			return false;
		}
		
		var url = "";
		var loc = window.location;
		var pathName = loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1);
		url = loc.href.substring(0, loc.href.length - ((loc.pathname + loc.search + loc.hash).length - pathName.length));
		
		$.ajax({
			type: "POST",
			data: "page="+getUrlVars()["page"]+"&mode=edit&attr=print&partcpnt_id="+part_id+"&prd_frm="+prd_frm+"&prd_to="+prd_to,
			url: url+"index.php",
			error: function(msg){
				alert( msg.status );
			},
			success: function(msg){
				//alert(msg);
				$('#dataTable').show();
				$('#dataTable').html(msg);
				n = msg.indexOf("No menu items to display");
				if(msg != '' && n < 1)
					$("#submit_div").show();
				else
					$("#submit_div").hide();
			}
		});
	}
</script>
<style>
	#dataTable table, #dataTable{
		line-height: 15px !important
	}
</style>
<?php
	$dt_fmt = str_replace("mm", "m", DT_FMT);
	$dt_fmt = str_replace("dd", "d", $dt_fmt);
	$dt_fmt = str_replace("yyyy", "Y", $dt_fmt);
	
	$dt = date($dt_fmt);
?>
<div style="width: 95%; margin: 0 auto; padding: 10px;">
	<div id="frm_display">
        <div id="tabs">
            <ul>
                <li class="active"><a href="#tabs-3">&nbsp;Lab Results&nbsp;</a></li>
            </ul>
            <form class="form" name="recuirtment" id="recuirtment" method="post" action="<?php echo $action; ?>" style="width: 85%;">
                <div id="tabs-3">
                    <div class="questionrow" style="width: 50%; margin: 0 auto;">
                        <div class="question"><strong>Particpant ID</strong></div>
                        <div class="answer">
                            <input type="hidden" name="partcpnt_id_old" id="partcpnt_id_old" value="" />
                        	<input type="text" name="partcpnt_id" id="partcpnt_id" value="" readonly />
							<img src="includes/images/search_img.png" style="vertical-align: middle;" onclick="open_frame('autocomplete.php');">
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow" align="center">
						<br/><input type="button" name="print" value="Go" onclick="return specimen_data();" /><br/><br/>
                    </div>
					<div class="questionrow" id="dataTable" style="display: none; overflow: auto; width: 60%; max-height: 350px; margin: 0 auto;">
					</div>
					<div class="clear_form">
					</div>
                    <div class="questionrow">
                        <div style="padding: 5px; display: none;" align="center" id="submit_div">
                            <!--<input type="submit" name="excel" value="Excel" />-->
                            <input type="submit" name="pdf" value="Pdf" />
                        </div>
                    </div>
                </div>
            </form>
		</div>
	</div>
</div>