<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />    
        <link rel="shortcut icon" href="<?php echo base_url() ?>img/sps.png?ver=1">
        <title><?php echo $layout_title; ?></title>
        <?php echo put_headers(); ?>
        <?php echo $this->layouts->print_includes(); ?>
        <script type="text/javascript">
            
            function conf_online_upgrade(){
                if(confirm("Do click on OK to confirm")){
                    window.location = "<?php echo base_url();?>admin/online_upgrade"
                }
            }
            $(document).ready(function() {
                $('#en').click(function() {
                    var urls = "<?php echo base_url(); ?>admin/session/en";
                    $.ajax({
                        type: "POST",
                        url: urls,
                        success: function() {
                            location.reload();
                        },
                    });       // Here your ajax action after delete confirmed
                });
                $('#ms').click(function() {
                    var urls = "<?php echo base_url(); ?>admin/session/ms";
                    $.ajax({
                        type: "POST",
                        url: urls,
                        success: function() {
                            location.reload();
                        },
                    });       // Here your ajax action after delete confirmed
                });
                $('#ch').click(function() {
                    var urls = "<?php echo base_url(); ?>admin/session/ch";
                    $.ajax({
                        type: "POST",
                        url: urls,
                        success: function() {
                            location.reload();
                        },
                    });       // Here your ajax action after delete confirmed
                });


                $('#ar').click(function() {
                    var urls = "<?php echo base_url(); ?>admin/session/ar";
                    $.ajax({
                        type: "POST",
                        url: urls,
                        success: function() {
                            location.reload();
                        },
                    });       // Here your ajax action after delete confirmed
                });



            });
        </script>
    </head>
    <body data-baseurl="<?php echo base_url(); ?>">
        <?php if (isset($this->poke)): ?>
            <div class="pokeMe">
                <span><?php echo $this->poke; ?></span>			
            </div>
        <?php endif; ?>
        <!-- Modals -->
        <div id="popupModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div id="popuHeader" class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="_popupTitle">Modal header</h3>
            </div>
            <div id="_popupContent" class="modal-body">
                <p>no Content</p>
            </div>
            <div id="_popupFooter" class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">Close</sbutton>
                    <button class="btn btn-primary">Save changes</button>
            </div>
        </div>
        <!--end modals -->
        <div id="_msgbox" style="display: block; margin-left: -210px; width: 500px;" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div id="_msgbody" class="modal-body">
                <div id="_msgicon" class="conformCritical" ></div>
                <div id="_msgcontent">
                    <h3 id="_title" style="margin-left: 150px; margin-top: -35px; font-size: 23px;">default</h3>
                    <p id="_message" style="margin-left: 10px; font-size: 13.5px; line-height: 1.3;">default</p>
                </div>
            </div>
            <div style="padding:10px 11px 11px;" id="_msgfooter" class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
            </div>
        </div>   
        <style>

        </style>

        <div <?php echo ($this->session->userdata('is_latest') == "no") ? "style='display:block; margin:0;'" : "style='display:none;margin:0;'"; ?> id="upgrator_bar" class="alert alert-success no-margin">
            <button  type="button" class="close" data-dismiss="alert">&times;</button>
            <p style="font-size:14px;"><strong>SPS Version <span id="latest_sps_version_"><?php echo $this->session->userdata('latest_sps_version'); ?></span> is ready! </strong>  You are currently using sps version  <span id="sps_version_"><?php echo $this->config->item("application_version"); ?></span> <button class="btn-form btn-danger-form" onclick="conf_online_upgrade(this)" type="button"> Upgrade Now</button></p> 
        </div>



        <div id="wrapper">
            <div id="header">			
                <div class="wrap">                
                    <a href="<?php echo base_url(); ?>" class="mainlogo"></a>        				
                    <div class="buttons fl">
                        <div class="item">
                            <a href="javascript:" class="btn-header btn-resize c_layout">
                                <span class="i-layout-8"></span>                            
                            </a>
                        </div>
                        <div class="item">
                            <div align="center">
                                <a href="javascript:" class="btn-header btn-resize c_screen">
                                    <span class="i-stretch"></span>                            
                                </a>
                            </div>
                        </div>                    
                    </div> 
                    <div class="buttons fr rightSideButtons">						
                        <div class="item">                        
                            <div class="btn-group">                        
                                <a href="javascript:" class="btn-header btn-resize dropdown-toggle" data-toggle="dropdown" title="information">			
                                    <i class="i-info"></i>
                                </a>
                                <ul class="dropdown-menu">
                                    <li class="themes backgrounds" style="padding:5px;">
                                        <span class="btn-language tal" style="width:90%;" target="_blank" >
                                            <?php
                                            $siteUrl = base_url();
                                            preg_match('/(localhost)/', $siteUrl, $matches);

                                            if (!empty($matches)) {
                                                $exec = exec("hostname"); //the "hostname" is a valid command in both windows and linux
                                                $hostname = trim($exec); //remove any spaces before and after
                                                $ip = gethostbyname($hostname);
                                                $siteUrl = str_replace($matches[0], $ip, $siteUrl);
                                                echo $siteUrl;
                                            } else {
                                                echo base_url();
                                            }
                                            ?>
                                        </span>
                                    </li>
                                </ul> 
                            </div>
                        </div>
                        <div class="item">                        
                            <div class="btn-group">                        
                                <a href="javascript:" class="btn-header btn-resize dropdown-toggle" data-toggle="dropdown" title="themes">			
                                    <i class="i-star"></i>
                                </a>
                                <ul class="dropdown-menu">
                                    <div class="head-user">
                                        <h6>Themes | Backgrounds </h6>
                                    </div>
                                    <li class="themes backgrounds">
                                        <div class="controls-row" title="Themes">
                                            <a href="#" class="default tip" data-theme="" title="Theme 1"></a>
                                            <a href="#" class="dark tip" data-theme="themeDark" title="Theme 2"></a>
                                            <a href="#" class="simple tip" data-theme="themeSimple" title="Theme 3"></a>		
                                        </div>                                   
                                        <div class="controls-row" title="Backgrounds">
                                            <a href="#" class="tip b_sps" data-theme="" data-back="b_sps" title="Background 1"></a>                                            
                                            <a href="#" class="tip b_sps" data-back="b_sps" title="Background 2"></a>
                                            <a href="#" class="tip b_sps" data-back="b_sps" title="Background 3"></a>	
                                        </div>
                                    </li>									
                                </ul> 
                            </div>
                        </div>   
                        <div class="item">                        
                            <div class="btn-group">                        
                                <a href="#" class="btn-header btn-resize dropdown-toggle" data-toggle="dropdown" title="language">									
                                    <i class="i-earth"></i>
                                </a>
                                <ul class="dropdown-menu">
                                    <li class="user-languages">
                                        <div class="dropdown">
                                            <a href="#" id="en" title="English" class="btn-language"><img src="<?php echo base_url() ?>img/english.png"/> English</a>
                                            <a href="#" id="ms" title="Bahasa Melayu" class="btn-language"><img src="<?php echo base_url() ?>img/malay.png"/> Bahasa Melayu</a>
                                            <a href="#" id="ar" title="Arabic" class="btn-language"><img src="<?php echo base_url() ?>img/arabic.png"/> Arabic</a>
                                        </div>                                   

                                    </li>									
                                </ul> 
                            </div>
                        </div>             
                        <div class="item">                        
                            <div class="btn-group">                        
                                <a href="#" class="btn-header btn-resize dropdown-toggle" data-toggle="dropdown" title="login">
                                    <i class="i-user"></i>
                                    <span class="i-arrow-down-4"></span>
                                </a>
                                <ul class="dropdown-menu">
                                    <li class="user-header">
                                        <img src="<?php echo base_url() . 'images/thumbs/' . element('role', $this->session->userdata('logged_in')) . '.JPG'; ?>"/>
                                        <p>
                                            <a href="#"><?php echo element('username', $this->session->userdata('logged_in')); ?></a>
                                        </p>               

<!--<img src="<?php echo base_url() . 'images/thumbs/929958-P.jpg'; ?>" />                              		
         <p><?php echo element('compName', $this->session->userdata('logged_in')) ?></p>
         <span>[<?php echo element('compNo', $this->session->userdata('logged_in')) ?> ] </span>
                                        -->     

                                    </li>									
                                    <li class="user-footer">
                                        <div class="pull-left">
                                            <a href="<?php echo base_url() ?>UserSetting/UserMaster" class="btn-user-profile"><?php echo $this->lang->line('profile') ?></a>
                                        </div>
                                        <div class="pull-right">
                                            <a href='<?php echo base_url() . "logout" ?>' class="btn-user-logout"><?php echo $this->lang->line('logout') ?></a>
                                        </div>
                                    </li>
                                </ul> 
                            </div>
                        </div>                               

                    </div> <!-- button -->
                </div> <!-- Wrap -->           
            </div> <!-- header -->
            <!--</div> wrapper -->
