<?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 id="error_message" style="display:none;"></div>
<?php 
if($this->call == 'ajaxcall'){
	$div = ''; $endDiv = ''; 
} else { 
	$div = '<div id="grid_'.$this->dataArray[0]['objectname'].'" class="all-grid-control">'; $endDiv = '</div>';
}
	echo $div.'<div id="msg" style="display:none;font-style: oblique; font-weight: bold; color: green;""></div>'.$this->grid($this->dataArray[0]).$endDiv;
?>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
         <?php 
            if(isset($_SESSION['role_msg']))
            {
                if($_SESSION['role_cls'] == 'success')
                {
    ?>
                successmessage('<?php echo $_SESSION['role_msg']; ?>');                    
    <?php 
                }
                else 
                {
    ?>
                error_message('<?php echo $_SESSION['role_msg']; ?>');                    
    <?php                 
                }
          
           unset($_SESSION['role_msg']);
           unset($_SESSION['role_cls']);
           }
    ?>
});

</script>