<?php session_start();?>
<?php
// include_once('lib_gene.php');
include_once('fnc_gene.php');

if(empty($cfg_empr))
{$cfg_empr=substr($_SERVER['SERVER_NAME'],0,strpos($_SERVER['SERVER_NAME'],'.'));}

$link_data=msql_connect('','','',$cfg_empr);
$empr0=data_maes('empr',$cfg_empr);
$enti_empr=data_maes('enti',$empr0['empr_ruc']);

$empr_descri=$enti_empr['enti_descri'];
$empr_nomcom=$enti_empr['enti_descri'];
$empr_descri2=$empr_descri;
$maxlenlin=21;

if(substr($empr0['empr_ruc'],2,1)!='9' and mb_substr_count($empr_descri,' ')==3)
{
   $empr_descri2 =' ';
   $empr_descri2.=$enti_empr['enti_ape1'];
   $empr_descri2.=' ';
   $empr_descri2.=$enti_empr['enti_ape2'];
   $empr_descri2.=' ';
   $empr_descri2.='<br class="btn-navbar">';
   $empr_descri2.=$enti_empr['enti_nom1'];
   $empr_descri2.=' ';
   $empr_descri2.=$enti_empr['enti_nom2'];
}

if(substr($empr0['empr_ruc'],2,1)=='9')
{
   $empr_descri2=' ';
   $lenlin=0;
   $empr_descria=explode(' ',$empr_descri);
   for($idx=0;$idx<=count($empr_descria);$idx++)
   {
      $lenlin=$lenlin+strlen($empr_descria[$idx]);
      if($lenlin>=$maxlenlin)
      {
         $empr_descri2.='<br class="btn-navbar">';
         $lenlin=strlen($empr_descria[$idx]);
      }
      $empr_descri2.=' ';
      $empr_descri2.=$empr_descria[$idx];
   }
}

$empr_descri=$empr_descri2;
?>
<!DOCTYPE html>
<html translate="no">
<head>
    <title><?php echo strtoupper($cfg_empr); ?></title>
    <style>
    </style>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
     <!--   letra opaca  -->
     <!--   elimina input clearable  -->
    <link href="//vcrxol.com/css/bootstrap232.min.css" rel="stylesheet">
    <link href="//vcrxol.com/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
    <link href="//vcrxol.com/css/slimmenu.min.css" rel="stylesheet" media="screen">
    <link href="//vcrxol.com/css/style.css" rel="stylesheet" media="all">

     <style>
      .container{background-color:<?php echo $empr0['empr_color1'];?>}
/*       .container{background-color:white;} */
      .brand{background-color:<?php echo $empr0['empr_color1'];?>}
      .nav{background-color:<?php echo $empr0['empr_color1'];?>}
      .navbar{background-color:<?php echo $empr0['empr_color1'];?>}
      .navbar-inner{background-color:<?php echo $empr0['empr_color1'];?>}
      .navbar-inverse{background-color:<?php echo $empr0['empr_color1'];?>}
      
      .menu-collapser{color:black;background-color:<?php echo $empr0['empr_color2'];?>;}
      .collapse-button{color:black;background-color:<?php echo $empr0['empr_color1'];?>;}
      .collapse-button:focus{color:<?php echo $empr0['empr_color1'];?>;background-color:yellow;}
      .collapse-button:hover{color:<?php echo $empr0['empr_color1'];?>;background-color:<?php echo $empr0['empr_color1'];?>;}
      .slimmenu {background-color:<?php echo $empr0['empr_color2'];?>}
      ul.slimmenu li{background-color:<?php echo $empr0['empr_color2'];?>}
/*       ul.slimmenu li ul{} */
      ul.slimmenu li ul li{background-color:<?php echo $empr0['empr_color3'];?>}
/*       ul.slimmenu li a:hover{background-color:#999} */
   </style>
  
</head>
<body>
     <script>
     </script>

<!--      redirecciona ssl      -->
     <script>
          var xhref=location.href;if(xhref.indexOf('https:')<0){window.location=xhref.replace('http:','https:');}
//           _urlinker='../_lib/linker.php';
//           _urlinker='https://vcrxol.com/_lib/_linker.php';
          _urlinker='//vcrxol.com/_lib/_linker.php';
//           _urlinker='/_lib/_linker.php';
//           _urlinker='/_lib/_linker.php';
//           _urlinker='/../_linker.php';
     </script>
          
<!--      orientation -->
     <script>
     window.onload = function ()
     {
//           alert(get_color('f9f9f9'));
//        _urlinker='../_lib/_linker.php';

        // Detect whether device supports orientationchange event,otherwise fall back to the resize event.
        var supportsOrientationChange = "onorientationchange" in window,
            orientationEvent = supportsOrientationChange ? "orientationchange" : "resize";
       get_para();
       var osPlat=getOS();     
       exe_func('set_osplat("'+osPlat+'")');
 
        orient=0;
        if(screen.width<screen.height){orient=1;}
        window.addEventListener(orientationEvent,function()
        {
           orient=0;
           if(screen.width<screen.height){orient=1;}
//            alert('HOLY ROTATING SCREENS BATMAN:' + window.orientation + " " + screen.width + " " + screen.height);
        },false);  

     //    document.getElementById('scriphp').scrollIntoView();
     //     $('html, body').animate({ scrollTop: $('scriphp').top}, 1000);   
     }   
     </script>   
     
     <?php if(empty($prnt)){ ?>  
     <div class=" container noprint" >
         <div class="navbar navbar-inverse navbar-fixed-top" style="position:fixed;">
             <div class="navbar-inner">
                 <div class="container" style="width:100%;">
                    <?php include('vrmenu1.php'); ?>
                 </div>
             </div>
                 <div class="container" style="width:100%;">
                    <?php include('vrmenu2.php'); ?>
                 </div>
         </div>
          
          <div id="login" class="modalDialog">
               <div  style="max-width:20em;">
                    <a href="#close" title="Close" class="close">×</a>
                    <?php $plabel='Usuario'; $pid='user_codigo'; $pobj=4; $pwidth=15; $psize=1.0; include('vrinput.php'); ?>
                    <?php $plabel='Clave';   $pid='user_passwd'; $pobj=4; $pwidth=15; $psize=1.0; $ptype='password'; include('vrinput.php'); ?>
                    
<!--                     <h2>Mi modal</h2> -->
<!--                     <p>Este es un ejemplo de modal, creado gracias al poder de CSS3.</p> -->
<!--                     <p>Puedes hacer un montón de cosas aquí, como alertas o incluso crear un formulario de registro aquí mismo.</p> -->
               </div>
          </div>
          
          
     </div>
     <div class="noprint" >
     <br><br><br><br><br><br>
     </div>
     <?php } ?>

          
     <script src="//vcrxol.com/js/jquery.min.js"></script>
     <script src="//vcrxol.com/js/jquery.numeric.js"></script>
     <script src="//vcrxol.com/js/bootstrap232.min.js"></script>
     <script src="//vcrxol.com/js/jquery.slimmenu.min.js"></script>
     <script src="//vcrxol.com/js/jquery.easing.min.js"></script>
     <script src="//vcrxol.com/_lib/fnc_gene.js"></script>

<!--      only numeric -->
<!--      quitar type number -->
     <script type="text/javascript">
       $(document).ready(function(){ 
          $('.numeric-cod').numeric(false);
          $('.numeric-val').numeric(false);
          $('.numeric-int').numeric(false);
          $('.numeric-dec').numeric(".");
        });
     </script>   

     
     <div id='main1'>
     <?php 
     if(!mb_stristr($scri,'.php')){$scri.='.php';}
     $scri='../_lib/'.$scri;
     if(!file_exists($scri)){$scri='vrblank.php';}
     include($scri);
     ?>
     </div>
     
     
<!--      slimmenu      -->
     <script>
     $(function() {
         $('.nav a,.brand,a[data-target]').click(function(){
             $('html,body').animate({
                 scrollTop: $($(this).attr('data-target')).offset().top-50
             },500)
         })
     });

     $('ul.slimmenu').slimmenu(
     {
         resizeWidth: '800',
         collapserTitle: 'Menu',
         easingEffect:'easeInOutQuint',
         animSpeed:'fast',
         indentChildren: true,
         childrenIndenter: '&raquo;',
         expandIcon:'&#9660',
         collapseIcon:'&#9650',
         initiallyVisible:false
         
     });

     $('body').on('keydown', 'input, select, textarea', function (e)
     {
       var self = $(this);
       var form = self.parents('body:eq(0)');
       var focusable,next;
       var key = (window.event) ? e.keyCode : e.which;

       if(key == 13)
       { 
           focusable = form.find('input,a,select,textarea').filter(':visible');
           next = focusable.eq(focusable.index(this) + 1);
           if(next.length)
           {next.focus();}
           else
           {focusable.click();}
           return false;
       }
     });  

     </script>

     <!--clearable -->
     <script>
//      Array.prototype.forEach.call
     [].forEach.call
     (document.querySelectorAll('.clearable-input>[data-clear-input]'),
     function(el){el.addEventListener('click', function(e) {e.target.nextElementSibling.value = '';});}
     );
     </script>   

     <script>
     </script>     
     <result></result>     
</body>
</html>



