<?php 
/********************************************************************************* 
 *  This file is part of Sentrifugo.
 *  Copyright (C) 2014 Sapplica
 *   
 *  Sentrifugo is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Sentrifugo is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Sentrifugo.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Sentrifugo Support <support@sentrifugo.com>
 ********************************************************************************/
?>

<div class="total-iframe-controller">

<div id="error_message_force" style="display:none;"></div>


<?php 
if(!empty($this->dataArray))
{
	$result = array(); $result = $this->dataArray;
	?>
    <div class="new-details-ui">
        <label>Name :</label>
        <div class="textshow">
        <?php echo $result[0]['username'];?>
        </div>
     </div>
	 <div class="all-grid-control btm-brdr-hide">
          <div class="table-header"><span>Agency Information</span></div>
            <div class="details_data_display_block newtablegrid">
                <table width="100%" cellspacing="0" cellpadding="4" border="0" align="center" class="grid">
                    <thead>
                        <tr>
                            <th width="20%">Checktype</th>
                            <th width="23%">Agency assigned</th>
                            <th width="17%">Status</th>
                            <th width="40%">Explanation</th>
                        </tr>
                    </thead>
                <tbody>
	<?php
	$j = 0;
	for($i=0;$i<sizeof($result);$i++)
	{
		if($result[$i]['process_status'] == 'In process' || $result[$i]['process_status'] == 'On hold')
		{
			if($i == 0) $classVal = '1';
			else if($i%2 == 0) $classVal = '2';
			else $classVal = '1';
		?>
			<input type="hidden" id="spec_id" value="<?php echo $result[$i]['specimentId']; ?>" />
			<input type="hidden" id="flag" value="<?php echo $result[$i]['flag']; ?>" />
			<input type="hidden" id="<?php echo "id_".$j ?>" name="status[]" value="<?php echo $result[$i]['id']; ?>" />
            
    
                	<tr class="row-<?php echo $classVal;?>">
                        <td valign="top"><?php echo $result[$i]['type']; ?></td>
                        <td><?php echo $result[$i]['agencyname']; ?></td>
                        <td><?php echo $result[$i]['process_status']; ?></td>
                        <td>
							<textarea id="text_<?php echo $j; ?>" class="exp-textarea"></textarea>
							 <span class="errors" id="error_<?php echo $j; ?>"></span>
						</td>
                    </tr>
                    
                
            
            
		<?php
			$j = $j + 1;
		}
	}
?>
</tbody>
         </table>
         </div>       
    </div>
 <div class="note">Note : Enter Explanation for every checktype.</div>   
<div class="new-form-ui-submit new-form-ui-setter">
    <input type="hidden" id="inprocesscount" value="<?php echo $j;?>" />
    <input type="button" class="clssbmtbtn" onclick="saveExplanation();" value="Save" />
</div>
<?php
	
}
?>

</div>
