<?php 
include 'ini.php';
include 'funciones.php';
session_start();
session_validation();

$strRandom = rand();
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="images/icon192.png">
  <link rel="apple-touch-icon" sizes="72x72" href="images/icon72.png" /> 
  <link rel="apple-touch-icon" sizes="114x114" href="images/icon114.png" />
  
  <title><?php echo $sAppName;?> <?php echo $BRANCHNAME;?></title>
  
<!-- EXTJS -->
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/xtheme-gray.css" />
    <link rel="stylesheet" type="text/css" href="extjs/gridsummary.css"/>
    <link rel="stylesheet" type="text/css" href="layout-browser.css">

    <script type="text/javascript" src="js/init.js"></script>
    <script type="text/javascript">

    var gbIntIdUsuario = <?php echo $_SESSION['user_id'];?>;
    if(gbIntIdUsuario=='' || gbIntIdUsuario==null){ document.location.href="index.php"; }

    var objUsuario = new Persona(<?php echo $_SESSION['user_id'];?>, '<?php echo $_SESSION['user_name'];?>', '', <?php echo $_SESSION['user_type'];?>, 0, <?php echo $_SESSION['intEmpresa'];?>);
    var strStartTime = '10:00:00';
    var strEndTime = '20:00:00';

    </script>

    <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="extjs/ext-all.js"></script>
    <script type="text/javascript" src="js/gridsummary.js"></script>

    <script type="text/javascript" src="extjs/examples/ux/RowExpander.js"></script>
    <script type="text/javascript" src="extjs/Ext.ux.GridPrinter.js"></script>
    
<!-- JQuery -->
    
    <script src="//code.jquery.com/jquery-1.9.1.min.js"></script>

    <link rel="stylesheet" href="css/jquery.mobile-1.3.2.css?<?php echo $strRandom; ?>">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui.min.js"></script>
    
    <link rel="stylesheet" href="css/jquery-ui.css?<?php echo $strRandom; ?>">
    <script src="//code.jquery.com/jquery-1.9.1.js"></script>
	<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

    <!-- PLUGINS-->
    <link rel="stylesheet" type="text/css" href="js/DatePicker/css/ui.daterangepicker.css"/>
	  <script type="text/javascript" src="js/DatePicker/js/daterangepicker.jQuery.js"></script>
	
	  <script type="text/javascript" src="js/accounting.js"></script>
     
<!-- GENERAL -->
    <link rel="stylesheet" type="text/css" href="css/menu.css?<?php echo $strRandom; ?>">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css?<?php echo $strRandom; ?>">
    <link rel="stylesheet" type="text/css" href="css/styles.css?<?php echo $strRandom; ?>">

    <script type="text/javascript" src="js/core.js?<?php echo $strRandom; ?>" ></script>

    <script type="text/javascript" src="js/Funciones.js?<?php echo $strRandom; ?>"></script>
    <!-- Uploader -->
    <script type="text/javascript" src="js/ajaxfileupload.js"></script>
    <script type="text/javascript" src="js/moment.js"></script>

<!-- SISTEMA -->    
    <script type="text/javascript" src="js/tabDashboard.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabAgenda.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabRegistroDiario.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabMonitorConsultas.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabSignosVitales.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabExpediente.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabCatClientes.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabCatUsuarios.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabCatTipoUsuarios.js?<?php echo $strRandom; ?>"></script>
    
    <script type="text/javascript" src="js/tabCatMedicamentos.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabCatDiagnosticos.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/tabConsultas.js?<?php echo $strRandom; ?>"></script>
    
    <script type="text/javascript" src="js/tabReporteActividad.js?<?php echo $strRandom; ?>"></script>
    <script type="text/javascript" src="js/takepicture.js?<?php echo $strRandom; ?>"></script>
    
    <link href='js/fullcalendar-2.2.2/fullcalendar.css?<?php echo $strRandom; ?>' rel='stylesheet' />
    <link href='js/fullcalendar-2.2.2/fullcalendar.print.css' rel='stylesheet' media='print' />
    <script src='js/fullcalendar-2.2.2/lib/moment.min.js'></script>
    <script src='js/fullcalendar-2.2.2/fullcalendar.min.js'></script>
    <script src='js/fullcalendar-2.2.2/lang/es.js'></script>

  <style>
  .panel-content {
    padding: 0px;
    margin: 0px;
  }
  .ui-panel-content-wrap-closed{
  	background:#fff;
  }
  
  </style>
  
<!-- CSS CAMERA WEBCAM-->
<link rel="stylesheet" type="text/css" href="assets/css/styles.css?<?php echo $strRandom; ?>" />
<link rel="stylesheet" type="text/css" href="assets/fancybox/jquery.fancybox-1.3.4.css" />
<link rel="stylesheet" type="text/css" href="css/fontawesome-all.css" />

</head>
<body>

<header>
    <div id="divHeader" class="ui-header /*ui-bar-b*/ non-selectable clsBgGradiente" style="">
      
      <div id="divHeaderMenu" class="" style=" width: 100%; min-width: 8px; height: auto; float: left; background: none; position: inherit;">
        <table style="width:100%">
      		<tbody>
      		    <tr>
          			<!--<td align="left" width="200"><a id="alinkMenu" href="javascript: viewMenu();" style="float: left; margin: 5px 13px 0px 8px;  display: none;"><i class="fa fa-bars" style="font-weight:500;"></i></a>< ?php echo $BRANCHNAME; ?></td>
          			<td align="left" width="190" style="padding-top:8px; padding-bottom:4px; padding-left:5px; ">< ?php echo $_SESSION['user_name']; ?></td>
                    <td style="padding-left:10px;"><div id="divNotificaciones" style="display:none; opacity:0; -khtml-opacity: 0; -moz-opacity:0; filter: alpha(opacity=0); -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)'; font-size:14px; color:#333; font-family:Arial, Helvetica, sans-serif; height:18px; padding-left:10px; padding-right:10px; padding-top:3px; padding-bottom:3px; background-color:#FC0; border:1px solid #F90; z-index: 10000; position: relative;"></div></td>
                    <td align="right" style="width:120px; padding-right:0px; font-family:Arial, Helvetica, sans-serif; font-size:14px; ">< ?php echo $sAppName; ?></td>
          			<td align="right" width="80"><a id="alinkSalir" href="javascript: window.location = 'logout.php';" style="float: right;margin: 3px 5px 0px 8px;color: white;display: inline-block;"><i class="fa fa-sign-out" style="font-size:15px; font-weight:500;"></i></a></td>
          		    -->
          		    
          		    <td align="left" width="200"><a id="alinkMenu" href="javascript: showMenu();" style="float: left; margin: 7px 13px 0px 1px; display: block;"><i class="fa fa-bars clsIcoI" style="font-size:15px; font-weight:500;"></i></a><span style="margin: 8px 0 0 0; float: left;"><?php echo $_SESSION['user_name'];?></span></td>
                    <td style="padding-left:10px;"><div id="divNotificaciones" style="display:none; opacity:0; -khtml-opacity: 0; -moz-opacity:0; filter: alpha(opacity=0); -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';  color:#333; font-family:Arial, Helvetica, sans-serif; height:18px; padding:3px 10px; background-color:#FC0; border:1px solid #F90; z-index: 10000; position: relative;"></div></td>
                    <td align="right" style="width:120px; padding: 7px 0 0 0; font-family:Arial, Helvetica, sans-serif; "><?php echo $strAppName; ?></td>
          			<td align="right" width="80"><a id="alinkSalir" href="javascript: window.location = 'logout.php';" style="float: right; margin: 6px 5px 0px 8px; display: inline-block; cursor:pointer;"><i class="fa fa-sign-out clsIcoI" style="font-size:15px; font-weight:500;"></i></a></td>


          		</tr>
          	</tbody>
        </table>
      </div>
      <!--<div id="divHeaderCliente" class="menu_bar" style=" text-align: right; background: none; width: 300px;height: auto;float: right;position: relative;padding: 10px 10px;">
       < ?php echo $_SESSION['str_type'] ." ". $_SESSION['user_name']; ?>
      </div>-->
    </div>
</header>
  
<div id="navMenu" class="clsMenu" >
    
	<ul id="ulMenuLis">	
        <li id="litabLogo" class="liSubMenuChild0" style="text-align: center; padding: 15px 0 10px 0; border-bottom: none; display: block; visibility: visible;"><i class="fa fa-id-card-alt" style="font-size: 50px; color:#ffffff; "></i> <!--<img src="images/icon72.png" style="margin:10px;">--></li>
        <li id="litabUsuario" class="liSubMenuChild0" style="font-size: 24px; text-align: center; padding: 15px 0 10px 0; display: block; visibility: visible; color:#ffffff;"><?php echo $_SESSION['user_name'];?></li>

        <li id="litabDashboard" class="liSubMenuChild"><a href="javascript: showPage('tabDashboard');"><i class="fa fa-file-user" style="font-size: 14px;"></i> Dashboard</a></li>
        
        <li id="litabProcesos" class="liSubMenu clsBgGradiente"><i class="fa fa-cog" style="font-size: 15px;"></i> Procesos</li>
            <li id="litabAgenda" class="liSubMenuChild"><a href="javascript: showPage('tabAgenda');"><i class="fa fa-calendar-alt" style="font-size: 14px;"></i> Ver/Agendar Citas</a></li>
            
            <li id="litabMonitorConsultas" class="liSubMenuChild"><a href="javascript: showPage('tabMonitorConsultas');"><i class="fa fa-ambulance" style="font-size: 13px;"></i> Pedir Ambulancia</a></li>
          
            <!--<li id="litabRegistroDiario" class="liSubMenuChild"><a href="javascript: showPage('tabRegistroDiario');"><i class="fa-regular fa-pen-to-square" style="font-size: 14px;"></i> Registro diario</a></li>
            <li id="litabMonitorConsultas" class="liSubMenuChild"><a href="javascript: showPage('tabMonitorConsultas');"><i class="fa fa-tv" style="font-size: 13px;"></i> Monitor de Consultas</a></li>
            <li id="litabSignosVitales" class="liSubMenuChild"><a href="javascript: showPage('tabSignosVitales');"><i class="fa-solid fa-heart-pulse" style="font-size: 14px;"></i> Signos Vitales</a></li>-->
            
            <!--<li id="litabCorteCaja" class="liSubMenuChild"><a href="javascript: showPage('tabCorteCaja');">Corte de caja</a></li>-->
            
        <li id="litabReportes" class="liSubMenu clsBgGradiente"><i class="fa fa-history" style="font-size: 17px;"></i> Historial</li>
            <li id="litabConsultas" class="liSubMenuChild"><a href="javascript: showPage('tabConsultas');"><i class="fa fa-search" style="font-size: 14px;"></i> Recetas Medicas</a></li>
            <li id="litabReporteActividad" class="liSubMenuChild"><a href="javascript: showPage('tabReporteActividad');"><i class="fa fa-file-search" style="font-size: 14px;"></i> Estudios Realizados</a></li>
            <li id="litabReporteActividad" class="liSubMenuChild"><a href="javascript: showPage('tabReporteActividad');"><i class="fa fa-file-search" style="font-size: 14px;"></i> Rayos X</a></li>

        <li id="litabCatalogos" class="liSubMenu clsBgGradiente"><i class="fa fa-th-list" style="font-size: 15px;"></i> Catalogos</li>
            <li id="litabCatClientes" class="liSubMenuChild"><a href="javascript: showPage('tabCatUsuarios');"><i class="fa fa-users" style="font-size: 14px;"></i> Familiares</a></li>
            <!--<li id="litabCatCuenta" class="liSubMenuChild"><a href="javascript: showPage('tabCatCuenta')">Cuenta</a></li>-->
            
            <li id="litabCatMedicamentos" class="liSubMenuChild"><a href="javascript: showPage('tabCatMedicamentos');"><i class="fa fa-tablets" style="font-size: 14px;"></i> Medicamentos</a></li>
            <!--<li id="litabCatDiagnosticos" class="liSubMenuChild"><a href="javascript: showPage('tabCatDiagnosticos');"><i class="fa fa-clipboard-user" style="font-size: 14px;"></i> Diagnosticos</a></li>-->
            <li id="litabCatHospitales" class="liSubMenuChild"><a href="javascript: showPage('tabCatHospitales');"><i class="fa fa-hospital" style="font-size: 14px;"></i> Hospitales</a></li>
            <!--<li id="litabCatUsuarios" class="liSubMenuChild"><a href="javascript: showPage('tabCatUsuarios');"><i class="fa fa-users-medical" style="font-size: 14px;"></i> Usuarios</a></li>-->
        
        <!--<li id="litabEspBlanco" class="liSubMenu clsBgGradiente"><i class="fa fa-door-open" style="font-size: 15px;"></i> Otros</li>
            <li id="litabSalir" class="liSubMenuChild"><a href="javascript: salir();">Salir</a></li>-->
            
	</ul>
</div>
		
<div id="divContGeneral" class="clsContGeneral" onMouseDown="mouseEvent()">

    <div id="divDashboard" style="height: 100%; margin:10px;"></div>
    <div id="divAgenda" style="height: 100%; margin:10px;"></div>
    <div id="divRegistroDiario" style="height: 100%;"></div>
    <div id="divMonitorConsultas" style="height: 100%;"></div>
    <div id="divSignosVitales" style="height: 100%;"></div>
    
    <div id="divCatClientes" style="height: calc(100% - 37px);"></div>
    <div id="divCatUsuarios" style="height: 100%;"></div>
    <div id="divCatMedicamentos" style=""></div>
    <div id="divCatDiagnosticos" style=""></div>
    <div id="divCatHospitales" style=""></div>
    
    <div id="divConsultas" style="display: contents;"></div>
    <!--<div id="divCatCuenta" style=""></div>-->
    <div id="divRepActividad" style=""></div>

</div>
  
<div id="divLoading" class="divLoader">
  <div class="divLoaderChild "><img src="images/cargando2.gif"/></div>
</div>

<div id="dialog-cita" title="Cita" style="background: white;">
  <input type="hidden" id="intPaciente" />
  <div id="divDetalleCita" style="margin-top: 18px;"></div>
</div>

<div id="dialog-buscar-cliente" title="Cita" style="background: white; overflow: hidden; width: 95%; padding-right: 0;">
<input type="text" id="txtPaciente" class="custom-combobox2" style="width: 98%;"  />
<div id="divGridPacientes" style="margin-top: 8px; width: 100%"></div>
</div>
 
<!--
<div style="float:left;">
  <div id="camera" style="z-index:1000;">
    <span class="camTop"></span>
    
    <div id="screen"></div>
    <div id="buttons">
        <div class="buttonPane">
            <a id="shootButton" href="" class="blueButton">Tomar!</a> <a id="cerrarCamara" href="javascript: abrirCamara();" class="blueButton">Cancelar</a>
        </div>
        <div class="buttonPane hidden">
            <a id="cancelButton" href="" class="blueButton">Cancelar</a> <a id="uploadButton" href="" class="greenButton">Subir!</a>
        </div>
    </div>
    <span class="settings"></span>
  </div>
</div>-->

<div id="divConCamera" style="float:left;">
  <div id="camera" style="z-index:1000;">
    <span class="camTop"></span>
    
    <div id="screen">
        
        <video id="videoObj" autoplay="true" ></video>
        <!--<button id="startbutton">Take photo</button>-->
        <canvas id="canvasObj"></canvas>
        <img id="photoObj" alt="photo" src="http://placekitten.com/g/200/150" >

    </div>
    
    <div id="buttons">
        <div class="buttonPane">
            <!--<a id="shootButton" href="" class="blueButton">Tomar!</a> <a id="cerrarCamara" href="javascript: abrirCamara();" class="blueButton">Cancelar</a>-->
            <a id="startbutton" href="" class="blueButton">Tomar!</a> <a id="cerrarCamara" href="javascript: abrirCamara();" class="blueButton">Cancelar</a>
        </div>
        <div class="buttonPane hidden">
            <a id="cancelButton" href="" class="blueButton">Cancelar</a> <a id="uploadButton" href="" class="greenButton">Subir!</a>
        </div>
    </div>
    <!--<span class="settings"></span>-->
  </div>
</div> 



<!-- WINDOW WEBCAM-->
<!--
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
-->
<script src="assets/fancybox/jquery.easing-1.3.pack.js"></script>
<script src="assets/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script src="assets/webcam/webcam.js"></script>
<script src="assets/js/script.js?<?php echo $strRandom; ?>"></script>

</body>
</html>