<?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>
 ********************************************************************************/
?>

<?php if (count($this->messages)) 
{?>
	<div id="dispscreeningtype" class="settingssuccess">
		<?php 
			foreach ($this->messages as $message)
			{
				$flag = array();				
				$flag = array_keys($message);
				echo "<div id='messageData' class='ml-alert-1-$flag[0]'><div style='display:block;'><span class='style-1-icon $flag[0]'></span>";
				echo $message[$flag[0]];
				echo "</div></div>";
			} 
		?>
	</div>	
	
<?php } 
if($this->call != 'ajaxcall'){
?>
<div id="error_message"></div>
<div class="total-form-controller">
    <div class="new-form-ui" style="height:auto;">         
        <div class="division"><select id="statusid" name="statusid" class="select2-offscreen" tabindex="-1" onchange = "displayStatusdata('approvedrequisitions')">           
            <option value="<?php echo sapp_Global::_encrypt(2);?>">Approved</option>
            <option value="<?php echo sapp_Global::_encrypt(4);?>">Closed</option>
            <option value="<?php echo sapp_Global::_encrypt(6);?>">Complete</option>
			<option value="<?php echo sapp_Global::_encrypt(7);?>">In process</option>
			<option value="<?php echo sapp_Global::_encrypt(5);?>">On hold</option>
           </select>
        </div>
    </div>
</div>
<?php 
}
if($this->call == 'ajaxcall'){
	$div = ''; $endDiv = ''; 
} else { 
	$div = '<div id="grid_'.$this->dataArray['objectname'].'" class="all-grid-control mrgetop10">'; $endDiv = '</div>';
}
	echo $div.'<div id="msg" style="display:none;font-style: oblique; font-weight: bold; color: green;""></div>'.$this->requisitiongrid($this->dataArray).$endDiv;
?>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
   
        <?php $flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');?>
    <?php if ($flashMessenger->setNamespace('success')->hasMessages()): ?>
            <?php foreach ($flashMessenger->getMessages() as $msg): ?>
                    successmessage('<?php echo trim($msg); ?>');                    
            <?php endforeach; ?>
    <?php endif; ?>
});

<?php if($this->statusidstring !=''){ ?>
       $('#statusid').val('<?php echo $this->statusidstring; ?>');
<?php }?>
</script>