<?php 
include("../hotel1/DMMYSQLG.php"); 
include("../hotel1/DF80000.php"); 
 $fecha=$dt_empres['fec_alta']; 
  @$sqldia = mysqli_query($con ,"select count(n_reg) as ocupadas,(select count(*) as cantid from valeryus08 WHERE ntipo<>'MAESTRA') as total,
(select count(n_reg) from valeryus19 where cancelado='0'
 and ffecllegada='$fecha' and ftipocto<>'MAESTRA' and extra1='0') as entradas,
 (select count(n_reg)
 from valeryus19 where ffecsalida='$fecha' and cancelado='0' and ftipocto<>'MAESTRA' and extra1='0')salidas

from valeryus19 where cancelado='0' and '$fecha'>ffecllegada and '$fecha'<=ffecsalida 
and ftipocto<>'MAESTRA' and extra1='0' order by fnumcto

");
 $dia= mysqli_fetch_array($sqldia);
?>
<html>	
    <head>
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
            <!-- Font Awesome -->
            <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
            <!-- Ionicons -->
            <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
            <!-- Theme style -->
            <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
            <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
        page. However, you can choose any other skin. Make sure you
        apply the skin class to the body tag so the changes take effect. -->
            <link rel="stylesheet" href="dist/css/skins/skin-blue.min.css">
            <link rel="stylesheet" href="dist/css/skins/skin-green.min.css">
            
             <link rel='stylesheet' href='../hotel1/cf/fullcalendar.min.css' />
               <link href='../hotel1/cf/scheduler.css' rel='stylesheet' /> 
	

            <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
            <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
            <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
  <script src="bower_components/jquery/dist/jquery.min.js"></script>
         <script src='../hotel1/cf/moment.min.js'></script>
        <script src='../hotel1/cf/fullcalendar.min.js'></script>
       
  
  
  
          	
            <!-- Google Font -->
            <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
            
            <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
         <script src='../hotel1/cf/scheduler.js'></script><!-- <<< New plugin here --> 
        <script src="../hotel1/cf/es.js"></script> 
        <script>
            $(function () { // document ready 
            $('#calendar').fullCalendar({
                height: 470,
            header: {
                 schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
            left: 'today prev,next',
                    center: 'title',
                    right: 'timelineMonth,timelineYear'
            },
            defaultView: 'timelineMonth',
           
            eventRender: function(eventObj, $el) {
                    $el.popover({
                      title: eventObj.status,
                      content: eventObj.title,
                      trigger: 'hover',
                      placement: 'top',
                      container: 'body'
                    });
                  },
                    resourceRender: function (resourceObj, labelTds, bodyTds) {
                       
                    labelTds.css('background', resourceObj.color);
                    if($("#q").val().trim()!=''&&resourceObj.title.indexOf($("#q").val())!=-1){
                       
                    }else if($("#q").val().trim()!=''&&resourceObj.title.indexOf($("#q").val())==-1){
                        $(bodyTds).remove();
                        $(labelTds).remove();
                    }
                }, 
                    resourceLabelText: 'HABITACIONES',
                    resources: '../hotel1/cf/habitaciones.php',
                    events: '../hotel1/cf/reservaciones.php'   
            });
            });
        </script>
        
        
    </head>
<body>
<style>
i{
margin-top: 8px
}
.info-box{
 
    min-height: 30px;
}
.info-box-icon {
    border-top-left-radius: 2px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 2px;
    display: block;
    float: left;
    height: 30px;
    width: 30px;
    text-align: center;
    font-size: 15px;
    line-height: 30px;
    background: rgba(0,0,0,0.2);
}
.info-box-content {
    
    margin-left: 30px;
}
.info-box-text {
    display: block;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.info-box-number {
    display: block;
    font-weight: bold;
    font-size: 12px;
}
.fc-toolbar.fc-header-toolbar {
    margin-bottom: 0;
        font-size: 12px !important;
}
.fc-toolbar h2 {
    font-size: 20px;
}
</style>

     <section class="content">
      <!-- Info boxes -->
      <div class="row">
        <div class="col-md-2 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-aqua"><i class="fa fa-id-card-o"></i></span>

           
 
            <div class="info-box-content">
              <span class="info-box-text">Hab. Ocupadas</span>
              <span class="info-box-number"><?=$dia['ocupadas']?><small></small></span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-2 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-red"><i class="fa fa-address-book-o"></i></span>

            <div class="info-box-content">
              <span class="info-box-text">Entradas</span>
              <span class="info-box-number"><?=$dia['entradas']?>   </span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->

        <!-- fix for small devices only -->
        <div class="clearfix visible-sm-block"></div>

        <div class="col-md-2 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-green"><i class="fa fa-external-link"></i></span>

            <div class="info-box-content">
              <span class="info-box-text">Salidas</span>
              <span class="info-box-number"> <?=$dia['salidas']?>  </span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-2 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-yellow"><i class="fa fa-line-chart"></i></span>

            <div class="info-box-content">
              <span class="info-box-text">Cierre</span>
              <span class="info-box-number">    <?=($dia['ocupadas']+$dia['entradas'])-$dia['salidas']?></span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
         <div class="col-md-4 col-sm-6 col-xs-12">
         
           <form id="form">
		Enviar Mensaje a todos<br>
                    <input type="text" id="mensaje" name="mensaje"/>
                    <button type="submit" id="enviar" name="enviar">Enviar</button>
            <!-- /.info-box-content -->
          </form>
          <!-- /.info-box -->
        </div>
        
        <!-- /.col -->
      </div>
 
               

        
       <div id="busqueda" style="color:#000">
            <input type="text" style="width: 100%" id="q" name="q" value="" placeholder="Buscar Hab/tipo ejemplo: PLUS" />
		</div>
        <div id='calendar'></div>
       
              
      <!-- /.row -->
     </body>
    <script>
    $(function() {
		  theTable = $("table");
		  $("#q").keyup(function() {
                   
		$('#calendar').fullCalendar('refetchResources');
		  });
		});
</script>
<script src="../hotel1/js/chat.js"></script>
</html>
