<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<style>
.parentDisable
{
z-index:999;
width:100%;
height:100%;
display:none;
position:absolute;
top:0;
left:0;
color: #aaa;
opacity: .9;
filter: alpha(opacity=95);
}
#popup
{
width:200;
height:300;
position:absolute;
top:250px;
left:655px;
color: #000;
background-color: #fff;
-moz-box-shadow:5px 5px 7px 8px #999;
-webkit-box-shadow:5px 5px 7px 8px #999;
box-shadow:5px 5px 7px 8px #999;
padding:10px;
border:#000 2px solid;
}
</style>
<script type="text/javascript">
function pop(div,id)
{
 document.getElementById('divid').value=id; 
 document.getElementById('remarksmecount').innerHTML="Remarks "+id;
 document.getElementById(div).style.display='block';
 return false
}


function hide(div)
{
 
document.getElementById('gremark').value=document.getElementById('gremarktext').value;
document.getElementById(div).style.display='none';
return false
}

function hide2(div)
{
rid=document.getElementById('divid').value;
document.getElementById('remark_'+rid).value=document.getElementById('remarktext').value;
document.getElementById(div).style.display='none';
return false
}
</script>


<script type="text/javascript">
	
 function showparameters(testcode,sample_id,idx){
 
 
 				for(var k=1;k<=12;k++){
 	                    	document.getElementById("parameter_"+k).value = '';
							document.getElementById("result_"+k).value = '';
     						document.getElementById("min_val_"+k).value = '';
							document.getElementById("max_val_"+k).value = '';
							document.getElementById("result_indicator_"+k).value =''; 
							document.getElementById("test_date_"+k).value = '';
					 }
 
		    xmlhttp = getAjaxHandler();			
			url2="<?php echo _ROOT ;?>authorizations/getparameter3/"+testcode+"-"+sample_id;	  
			xmlhttp.onreadystatechange=function()
			{
			 
					if (xmlhttp.readyState==4 && xmlhttp.status==200)
					{ 
						   var x= xmlhttp.responseText;	
						   					   
						 if(x!=0){
							var s = x.split("//");
							var fleng=s.length;
							var j=1;
							for(var i=0;i<(fleng-1);i++){ 
							 var s2 = s[i].split("=");								 
							document.getElementById("parameter_"+j).value = s2[0];
							document.getElementById("result_"+j).value = s2[1];
							var rang=s2[2].split("-");
							document.getElementById("min_val_"+j).value = rang[0];
							document.getElementById("max_val_"+j).value = rang[1];
							document.getElementById("result_indicator_"+j).value = s2[3]; 
							document.getElementById("test_date_"+j).value = s2[4];
							j++;
							 
							}									
					 }
							
								 
				  }
			}	  
					xmlhttp.open("GET",url2,true);
					xmlhttp.send();
		 
		
	}
	
	
function enableField()
	{
			$("#requst_no,#requst_date,#patient_no,#patient_name,#visit_no,#sex,#age,#requst_mail").val('');
			 $("#requst_no,#requst_date,#patient_no,#requst_mail").attr({readonly:'', disabled:'', class:'gridborder'});
			 $("#authbutton,#deauthbutton,#locationbutton,#globalbutton,#remarkbutton_1,#remarkbutton_2,#remarkbutton_3,#remarkbutton_4,#remarkbutton_5,#remarkbutton_6,#remarkbutton_7,#remarkbutton_8,#remarkbutton_9,#remarkbutton_10,#remarkbutton_11,#remarkbutton_12,#canclebutton,#savebutton").attr({ disabled:'disabled', class:'buttonsdisabled'});
			 $("#requst_no").focus();
			 $("#requst_no,#requst_date,#patient_no").readonly=false;
			 $("#requst_no,#requst_date,#patient_no").css("background-color","#FFFFFF");
			//document.getElementById('mrno').style.background="#FFFFFF" 
	}
	
 
  $(document).ready(function() {
				  $("#requst_date").datepicker({ dateFormat: 'yy-mm-dd' ,changeMonth: true,
							changeYear: true,
							yearRange: '-80:+20'});
							
						  });
						  
						  
	  function FetchData(){
			var requst_no =$("#requst_no").val();
		var patient_no=$("#patient_no").val();
		var requst_date=$("#requst_date").val();
		
		 
		requst_no = requst_no.split('/');
		patient_no = patient_no.split('/');
		
		
		var rno = requst_no[0]+"_"+requst_no[1]+"_"+requst_no[2];
		var pno = patient_no[0]+"_"+patient_no[1]+"_"+patient_no[2]
		
		var url = "<?php echo _ROOT ?>authorizations/index/";
				
		if(requst_no!=""){
				url+="requst_no:"+rno+"/";
				location.replace(url);
		}
		else if(patient_no!='')
		{
			url+="patient_no:"+pno+"/";
			location.replace(url);
		}	
		else if(requst_date!='')
		{
			url+="requst_date:"+requst_date+"/";
			location.replace(url);
		}		
		else{
			alert("Please enter the search criteria");
			//return;
		}
		
		
	}
	

function authorizedby(){
		var tcound=$("#hiddenid").val();
		var values=$("#hiddenuserid").val();
		for(var i=1;i<tcound;i++){
			 $("#authoriz_by_"+i).val(values);
		}
}



function deauthorizeby(){
		
		var tcound=$("#hiddenid").val();
		for(var i=1;i<tcound;i++){
			 $("#authoriz_by_"+i).val('');
		}
}
	
</script>

<div id="pop1" class="parentDisable">
<table border="0" id="popup" cellpadding="0" cellspacing="0">
<tr><td align="right" valign="top"><a href="#" onClick="return hide('pop1')">Close</a></td></tr>
<tr><td><strong>Global Remark</strong></td></tr>
<tr><td><textarea name="gremarktext" id="gremarktext" rows="12" cols="25"></textarea></td></tr>
</table> 
</div>


<div id="pop2" class="parentDisable">
<table border="0" id="popup" cellpadding="0" cellspacing="0">
<tr><td align="right" valign="top"><input type="hidden" id="divid" value=""><a href="#" onClick="return hide2('pop2')">Close</a></td></tr>
<tr><td><strong id="remarksmecount">Remark</strong></td></tr> 
<tr><td><textarea name="remarktext" id="remarktext" rows="12" cols="25"></textarea></td></tr>
</table> 
</div>


<?php echo $this->Form->create('Authorization', array('action'=>'add',"enctype"=>"multipart/form-data","onsubmit"=>"return validate();")); ?>
<table width="710" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="border-bg"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr>
		  	<td>
			<fieldset class="bggreen">
			<legend class="boldtext">Query Criteria</legend>
		  	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" >
			  <tr>
				<td width="14%" class="paddfeild" nowrap="nowrap" align="left" valign="middle">Request No.:</td>
				<td width="16%" align="left" valign="top"><input type="text" name="data[Authorization][requst_no]" class="gridborder" id="requst_no" readonly style="background:#e6e6e6; width:110px;" value="<?php if(isset($fillRes[0]['Samplecollection'])) echo $fillRes[0]['Samplectest'][0]['order_no'];?>"></td>
				<td width="17%" class="paddfeild" align="left" valign="middle">Request Date:</td>
				<td width="1%" align="left" valign="top"><input type="text" name="data[Authorization][requst_date]" class="gridborder gridborderlast" id="requst_date" readonly style="background:#e6e6e6;width:67px;" value="<?php if(isset($fillRes[0]['Samplecollection'])) echo $fillRes[0]['Samplecollection']['order_date'];?>"></td>
				
				<td width="41%" class="paddfeild" align="left" valign="top">Mail to: </td>
				<td><input type="text" name="data[Authorization][requst_mail]" class="gridborder gridborderlast" id="requst_mail" readonly style="background:#e6e6e6;width:200px;" value="<?php if(isset($fillRes[0]['Samplecollection'])){ 					 
			$hismail=$hisnav->getmail($fillRes[0]['Samplecollection']['mrno']);
		echo $hismail[0]['Address'][0]['email'];
			} 
	?>" > </td>
				   
			 
			  </tr>
			  
				<tr>
				<td width="14%" class="paddfeild" nowrap="nowrap" valign="middle" align="left">Patient: No. </td>
				<td width="16%" align="left" valign="top"><input id="patient_no" type="text" name="data[Authorization][patient_no]" class="gridborder "  readonly style="background:#e6e6e6;width:110px;" value="<?php 	if(isset($fillRes[0]['Samplecollection'])) echo $fillRes[0]['Samplecollection']['patient_no'] ;?>" onBlur="fillscData(this.value);"/></td>
				<td class="paddfeild" valign="middle" align="left">Patient Name:</td>
				<td colspan="2" align="left" valign="top"><input type="text" name="data[Authorization][patient_name]" class="gridborder gridborderlast bottom" id="patient_name" readonly style="background:#e6e6e6;width:395px;" value="<?php if(isset($fillRes[0]['Samplecollection'])) echo $fillRes[0]['Samplecollection']['patient_name'] ;?>"></td>
				</tr>
				
				
				  <tr>
    <td height="5"></td>
    <td></td>
    <td></td>
  </tr>
				
				<tr>
				<td width="14%" class="paddfeild" nowrap="nowrap" valign="middle" align="left">Gender:</td>
				<td align="left" valign="top"><input type="text" class="gridborder" name="data[Authorization][sex]" id="sex" readonly style="background:#e6e6e6;width:110px;" value="<?php  if(isset($fillRes[0]['Samplecollection'])){ if($fillRes[0]['Samplecollection']['sex']=="M"){echo "Male";}else{  echo "Female";} }?>"></td>
				<td  class="paddfeild" nowrap="nowrap" valign="middle" align="left">Age(YY-MM-DD):</td>
				<td colspan="2" align="left" valign="top"><input type="text" id="age" class="smallinput2 gridborder bottom" name="data[Authorization][age]" value="<?php if(isset($authRes[0]['Samplecollection'])) echo $authRes[0]['Samplecollection']['age'];?>" readonly style="background:#e6e6e6;"/><input type="text" id="month" class="age gridborder bottom" name="data[Authorization][month]" value="<?php if(isset($authRes[0]['Authorization'])) echo $authRes[0]['Authorization']['month'];?>" readonly style="background:#e6e6e6;" /><input type="text" id="day" class="age gridborder gridborderlast bottom" name="data[Authorization][day]" value="<?php if(isset($authRes[0]['Authorization'])) echo $authRes[0]['Authorization']['day'];?>" readonly style="background:#e6e6e6;"/>
				
				<span style="padding-left:12px;" class="paddfeild">Notification : <select name="data[Authorization][notification]"  style="background:#e6e6e6;width:70px;color:#000;" readonly="" class="gridborder" >
									<option value="a">All</option>
									<option value="p">Patient by</option>
								</select></span>
			 
				
				</td>
	 		
				
				</tr>
				<tr>
					<td colspan="8" height="8"></td>
				</tr>
			</table>
			</fieldset>
			</td>
			</tr>
			<tr>
			<td height="5" style="height:25px;">&nbsp;</td>
			</tr>
	  <tr>
	  <td>
	  <fieldset>
	  <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
      <tr>
        <td colspan="10">
		<div class="scrolling" readonly style="height:113px;">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
	  		<td align="left" class="paddfeild">Test Code </td>	
            <td align="left" class="paddfeild">Panel Code </td>   
			<td align="left" class="paddfeild" nowrap="nowrap">Sample No. </td>
			<td align="left" class="paddfeild">Test Status </td>
			<td align="left" class="paddfeild" nowrap="nowrap">Authorized Date </td>
			<td align="left" class="paddfeild">Authorized</td>
			<td align="left" class="paddfeild">Authorized By </td>
			</tr>

		<?php 

			$i=1;
			/*echo "<pre />";
			print_r($authRes);*/
			 if(isset($authRes[0]['Samplectest']))
				foreach($authRes[0]['Samplectest'] as $key=>$val)
				  { 
		 ?>
		 	 <tr>
			 <td align="left">
			 <input id="test_code_<?php echo $i?>" type="text" name="data[Authorization][test_code][]" class="gridborder"   readonly style="background:#e6e6e6;width:100px;" value="<?php if(isset($val))echo $val['test_code'];?>" onclick="showparameters(this.value,<?php echo $val['samplecollection_id'];?>,<?php echo $i?>);";/></td>
			 
			 <td align="left"><input id="panel_code_<?php echo $i?>" type="text" name="data[Authorization][panel_code][]" class="gridborder"  readonly style="background:#e6e6e6;width:120px;" value=""/></td>
			 
			 <td align="left"><input id="sample_no_<?php echo $i?>" type="text" name="data[Authorization][sample_no][]" class="gridborder" readonly style="background:#e6e6e6;width:90px;" value="<?php if(isset($val)) echo $val['sample_no'];?>"/></td>
			 
			 <td align="left"><select id="test_status_<?php echo $i?>" name="data[Authorization][test_status][]" class="gridborder"  readonly style="background:#e6e6e6;color:#000;width:90px;"  >
      <option value="Result Entered" <?php if(isset($val))if($val['g_snow_no']=='Y') echo 'selected';?>>Result Entered</option>
      <option value="Requested" <?php if(isset($val))if($val['g_snow_no']=='N') echo 'selected';?>>Requested</option>
      <option value="Result Entered" <?php if(isset($val))if($val['g_snow_no']=='C') echo 'selected';?>>Canceled</option>
      <option value="Authorized" <?php if(isset($val))if($val['g_snow_no']=='Authorized') echo 'selected';?>>Authorized</option>
</select></td>
			 
		 <td align="left"><input id="authoriz_date_<?php echo $i?>" type="text" name="data[Authorization][authoriz_date][]" class="gridborder"  readonly style="background:#e6e6e6;width:100px;" value="<?php echo date("Y-m-d");?>"/></td>
			 
			 <td align="left"><select name="data[Authorization][authoriz][]" id="authoriz_<?php echo $i?>" class="gridborder"  readonly style="background:#e6e6e6;width:70px;color:#000;" 		><option value="Yes">Yes</option>
			 <option value="No">No</option></select></td>
			 
			 <td align="left"><input id="authoriz_by_<?php echo $i?>" type="text" name="data[Authorization][authoriz_by][]" class="gridborder"  readonly style="background:#e6e6e6;width:100px;" value=""/>
			</td>
			 </tr>
		   <?php
					$i++;
					}
					?>
					 <input type="hidden" name="data[Authorization][ilast]" id="hiddenid" value="<?php echo $i;?>">
					 <input type="hidden" name="data[Authorization][gremark]" id="gremark" value="">					 
					 <input type="hidden" name="hiddenuserid" id="hiddenuserid" value="<?php echo $_SESSION['userid'];?>" >
					<?
					if($i==0){
					$i=0;
					}
					else
					$ilast = $i;
					$i=$i;
					for($i;$i<=12;$i++)
					  {
		  ?>
		  
		  
            <tr>
			 <td width="11%" align="left"><input id="test_code_<?php echo $i?>" type="text" name="data[Authorization][test_code][]" class="gridborder"   readonly style="background:#e6e6e6;width:100px;" value=""/></td>
			 <td width="11%" align="left"><input id="panel_code_<?php echo $i?>" type="text" name="data[Authorization][panel_code][]" class="gridborder"  readonly style="background:#e6e6e6;width:120px;" value=""/></td>
			 <td width="11%" align="left"><input id="data[Authorization][sample_no][]" type="text" name="data[Authorization][sample_no][]2" class="gridborder" readonly style="background:#e6e6e6;width:90px;" value=""/></td>
			 <td width="13%" align="left"><select id="test_status_<?php echo $i?>" name="data[Authorization][test_status][]" class="gridborder"  readonly style="background:#e6e6e6;color:#ooo;width:90px;" disabled><option value="Requested">Requested</option><option value="Result Entered">Result Entered</option><option value="Authorized">Authorized</option><option value="Canceled">Canceled</option></select></td>
			 <td width="10%" align="left"><input id="authoriz_date_<?php echo $i?>" type="text" name="data[Authorization][authoriz_date][]" class="gridborder"  readonly style="background:#e6e6e6;width:100px;" value=""/></td>
			 <td width="11%" align="left"><select name="data[Authorization][authoriz][]" id="authoriz_<?php echo $i?>" class="gridborder"  readonly style="background:#e6e6e6;width:70px;" disabled><option value="Yes">Yes</option><option value="No">No</option></select></td>
			 <td width="11%" align="left"><input id="authoriz_by_<?php echo $i?>" type="text" name="data[Authorization][authoriz_by][]" class="gridborder"  readonly style="background:#e6e6e6;width:100px;" value=""/></td>
			 </tr>		  
		  <?php } ?>
		 <tr><td><input type="hidden" name="data[Authorization][gremarks]" id="gremarks" value=""></td></tr> 
 </table>
	<div readonly style="background:#e6e6e6;clear:both;"></div>
		</div>	
		</td>
      </tr>
	  <tr>
	  	<td height="30" colspan="9">
			<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><input type="button"  id="authbutton" value="Authorize"  onClick="authorizedby()" <?php if(isset($val)) {?>class="buttonsview"<?}else {?> disabled="disabled" class="buttonsdisabled"  <?}?> ></td>
	 
    <td><input type="button" value="De-Authorize"  id="deauthbutton" <?php if(isset($val)) {?>class="buttonsview"<?}else {?> disabled="disabled" class="buttonsdisabled"  <?}?> onClick="deauthorizeby()"></td>
	
    <td><input type="button" value="Test Location"  id="locationbutton" <?php if(isset($val)) {?>class="buttonsview"<?}else {?> disabled="disabled" class="buttonsdisabled"  <?}?> ></td>
    <td><input type="button" value="Global Remark"  id="globalbutton"   onClick="return pop('pop1');"  <?php if(isset($val)) {?>class="buttonsview"<?}else {?> disabled="disabled" class="buttonsdisabled"  <?}?>>
	</td>
  </tr>
</table>
		</td>
	  </tr>
	  </table>
	  </fieldset>
	  </td>
	  </tr>
	   <tr>
        <td height="6"></td>
      </tr>
	  <tr>
	  <td>
	  <fieldset>
	  <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
      <tr>
	  		<td width="10%" align="left" class="paddfeild">Parameter</td>	
            <td width="24%" align="center" class="paddfeild">Result</td>   
			<td width="12%" align="center" class="paddfeild" nowrap="nowrap">Minimum</td>
			<td width="12%" align="center" class="paddfeild">Maximum</td>
			<td width="15%" align="center" class="paddfeild">Result Indicator </td>
			<td width="11%" align="center" class="paddfeild">Test Date </td>
			<td width="16%" align="left" class="paddfeild">&nbsp;</td>
			</tr>
      <tr>
        <td colspan="10">
		<div class="scrolling" readonly style="background:#e6e6e6;height:113px;">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
		<?php 
			$i=1;
			  if(isset($authRes[0]['Authorizationremark']))
				foreach($authRes[0]['Authorizationremark'] as $key=>$val)
				  {		 ?>
				  
				  
		 	 <tr>
			 <td width="10%" align="left"><input id="parameter_<?php echo $i;?>" type="text" name="data[Authorization][parameter][]" class="gridborder"   readonly style="background:#e6e6e6;width:80px;" value="<?php if(isset($val))echo $val['parameter'];?>"/></td>
			 <td width="23%" align="left"><input id="result_<?php echo $i;?>" type="text" name="data[Authorization][result][]" class="gridborder" readonly style="background:#e6e6e6;width:170px;" value="<?php if(isset($val))echo $val['result'];?>"/></td>
			 <td width="12%" align="left"><input id="min_val_<?php echo $i;?>" type="text" name="data[Authorization][min_val][]" class="gridborder" readonly style="background:#e6e6e6;width:80px;" value="<?php if(isset($val))echo $val['min_val'];?>"/></td>
			 <td width="11%" align="left"><input id="max_val_<?php echo $i;?>" type="text" name="data[Authorization][max_val][]" class="gridborder"  readonly style="background:#e6e6e6;width:80px;" value="<?php if(isset($val))echo $val['max_val'];?>"/></td>
			 <td width="13%" align="left"><input id="result_indicator_<?php echo $i;?>" type="text" name="data[Authorization][result_indicator][]" class="gridborder"  readonly style="background:#e6e6e6;width:90px;" value="<?php if(isset($val))echo $val['result_indicator'];?>"/></td>
			 <td width="14%" align="left"><input id="test_date_<?php echo $i;?>" type="text" name="data[Authorization][test_date][]" class="gridborder"  readonly style="background:#e6e6e6;width:90px;" value="<?php if(isset($val))echo $val['test_date'];?>"/></td>
			 <td width="17%" align="left"><input type="hidden" name="data[Authorization][remarks][]" id="remarks_<?php echo $i;?>" value="<?php if(isset($val))echo $val['remark'];?>">
			 <input type="button" value="Remarks" onClick="pop('pop2' ,'<?php echo $i; ?>')" disabled="disabled" class="buttonsdisabled" />
			 <input type="hidden" name="data[Authorization][remark][]" id="remark_<?php echo $i;?>" value=""></td>
			 </tr> 
		   <?php
					$i++;
					}
					if($i==0){
					$i=0;
					}
					else
					$ilast = $i;
					$i=$i;
					for($i;$i<=12;$i++)
					  {
		  ?>
<tr>
			 <td width="10%" align="left"><input id="parameter_<?php echo $i;?>" type="text" name="data[Authorization][parameter][]" class="gridborder"   readonly style="background:#e6e6e6;width:80px;" value=""/></td>
			 <td width="23%" align="left"><input id="result_<?php echo $i;?>" type="text" name="data[Authorization][result][]" class="gridborder" readonly style="background:#e6e6e6;width:170px;" value=""/></td>
			 <td width="12%" align="left"><input id="min_val_<?php echo $i;?>" type="text" name="data[Authorization][min_val][]" class="gridborder"   readonly style="background:#e6e6e6;width:80px;" value=""/></td>
			 <td width="11%" align="left"><input id="max_val_<?php echo $i;?>" type="text" name="data[Authorization][max_val][]" class="gridborder"  readonly style="background:#e6e6e6;width:80px;" value=""/></td>
			 <td width="13%" align="left"><input id="result_indicator_<?php echo $i;?>" type="text" name="data[Authorization][result_indicator][]" class="gridborder"  readonly style="background:#e6e6e6;width:90px;" value=""/></td>
			 <td width="14%" align="left"><input id="test_date_<?php echo $i;?>" type="text" name="data[Authorization][test_date][]" class="gridborder"  readonly style="background:#e6e6e6;width:90px;" value=""/></td>
			 <td width="17%" align="left"><input type="hidden" name="data[Authorization][remarks][]" id="remarks_<?php echo $i;?>" value=""><input type="button" value="Remarks"  id="remarkbutton_<?php echo $i; ?>"  onClick="pop('pop2','<?php echo $i; ?>');" <?php if(isset($val)) {?>class="buttonsview"<?}else {?> disabled="disabled" class="buttonsdisabled"  <?}?>>
			  <input type="hidden" name="data[Authorization][remark][]" id="remark_<?php echo $i;?>" value=""></td>
			 </tr>
			 <?php } ?>		  
		  
		  
 </table>
	<div readonly style="background:#e6e6e6;clear:both;"></div>
		</div>	
		</td>
      </tr>
	  <tr>
	  	<td height="8" colspan="10"></td>
	  </tr>
	  
	  </table>
	
	  </fieldset>
	  </td>
	  </tr>
	 <tr>
	 	<td>
			<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
			<tr>
            <td  colspan="0"></td>
            <td align="left" colspan="0" readonly style="background:#e6e6e6;text-align:right; padding-left:100px;">
			<input name="submit" type="submit"  value="Save"  id="savebutton" <?php if(isset($val)) {?>class="buttonsview"<?}else {?> disabled="disabled" class="buttonsdisabled"  <?}?> />
			<input name="cancel" type="button"  value="Cancel" id="canclebutton" onClick="docancel()" <?php if(isset($val)) {?>class="buttonsview"<?}else {?> disabled="disabled" class="buttonsdisabled"  <?}?>/></td>
          </tr>
		 
		  </table>
		</td>
	 </tr>
    </table></td>
  </tr>
</table>
 <?php	echo $this->Form->end(); ?>
 
 <table width="200" border="1">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" width="1%">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

</body>
</html>
