
<div class="row">
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-aqua">
            <div class="inner">
              <h3><?php echo $this->lang->line('bills')?></h3>
            
              <p>   
                  <?php echo $this->lang->line('available')?>:<?php echo count($bills); ?>
              </p>
            </div>
            <div class="icon">
              <i class="fa fa-shopping-cart"></i>
            </div>
            <a href="<?=base_url('show/bill/')?>" class="small-box-footer">
              <?php echo $this->lang->line('show'); ?><i class="fa fa-arrow-circle-right"></i>
            </a>
          </div>
        </div>
        <!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-orange">
            <div class="inner">
              <h3><?php echo $this->lang->line('products')?></h3>

              <p><?php echo $this->lang->line('available')?> : <?php echo count($product); ?></p>
            </div>
            <div class="icon">
              <i class="ion ion-stats-bars"></i>
            </div>
            <a href="#" class="small-box-footer">
             <?php echo $this->lang->line('show')?><i class="fa fa-arrow-circle-right"></i>
            </a>
          </div>
        </div>
        <!-- ./col -->
        <!-- ./col -->
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-teal">
            <div class="inner">
              <h3><?php echo $this->lang->line('expense')?></h3>
              <p><?php echo $this->lang->line('total')?>:<?php echo count($expense); ?> </p>
            </div>
            <div class="icon">
              <i class="ion ion-pie-graph"></i>
            </div>
            <a href="#" class="small-box-footer">
           <?php echo $this->lang->line('show')?><i class="fa fa-arrow-circle-right"></i>
            </a>
          </div>
        </div>
        
        <div class="col-lg-3 col-xs-6">
          <!-- small box -->
          <div class="small-box bg-blue">
            <div class="inner">
              <h3><?php echo $this->lang->line('users')?></h3>

              <p><?php echo $this->lang->line('available')?> :<?php echo count($user); ?></p>
            </div>
            <div class="icon">
              <i class="ion ion-person-add"></i>
            </div>
            <a href="#" class="small-box-footer">
             <?php echo $this->lang->line('show')?><i class="fa fa-arrow-circle-right"></i>
            </a>
          </div>
        </div>
        <!-- ./col -->
      </div>
   <div class="col-md-2" style="float: left">
             <?php if(isset($msg) ): ?>
            <div class="alert alert-warning alert-dismissible">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <h4><i class="icon fa-warning"></i> تنبيه!</h4>
          <?php for (@$index = 0; @$index < count(@$msg); @$index++) :?>
     
 
                -<?= isset($msg[$index])? @$msg[@$index]: ''; ?><br>
                
                 <?php endfor; ?>
            </div>
        <?php endif; ?> </div>
  <div class="row">
   
        <div class="col-md-12">


    
  <div class="row">
    <!-- Main content -->
   
      <div class="row">
        <div class="col-md-12">
          <div class="box">
         
            <!-- /.box-header -->
            <div class="box-body" style="overflow-x: visible;">
        
                
                     <?php @$count=0; $all_groups= array(); foreach($all_groups as $row):?>
                <div class="col-lg-2 col-xs-6" style="max-width: 150px;height: 110px">
          <!-- small box -->
      
          <?php if(@$row['conter']==1):?>
          <div class="small-box <?= @$row['color']; ?>">
            <div class="inner">
                <h3 style="margin-bottom: 17px;"><?= @@$row['name']; ?></h3>

             <div style="        font-size: 10px;
       margin-top: -12px;
       margin-bottom: -2px;margin-right: -5px;"><?=@@$row['noa']?></div>
            </div>
            <div class="icon">
              <i class="ion home"></i>
            </div>
            <a href="<?=base_url('booked/index/'.@$row['name'])?>" class="small-box-footer"><?= @@$row['bookig']; ?>
             تسكين<i class="fa fa-arrow-circle-right"></i>
            </a>
          </div>
          
          <?php endif; ?>
          
            <?php if(@$row['conter']==4 ):?>
          
      
          <!-- /.box -->
      
          <div class="small-box <?= @$row['color']; ?>">
            <div class="inner">
                <h3 style="margin-bottom: 17px;"><?= @$row['name']; ?></h3>

              <p></p>
            </div>
            <div class="icon">
              <i class="ion home"></i>
            </div>
            <a href="<?=base_url('Dashboard/toopen/'.@$row['name'])?>" class="small-box-footer"><?= @$row['bookig']; ?>
            تغير الى متاحة <i class="fa fa-arrow-circle-right"></i>
            </a>
          </div>
          
          <?php endif; ?>
          
           <?php if(@$row['conter']==3 ):
               
               if(isset($row['checkout']) ){@$row['color']='bg-orange';}
               ?>
          
      
          <!-- /.box -->
      
          <div class="small-box <?= @$row['color']; ?>">
              <div class="inner">
                <h3 style="margin-bottom: 17px;"><?= @@$row['name']; ?></h3>

             <div style="        font-size: 12px;
       margin-top: -12px;
       margin-bottom: -2px;margin-right: -5px;"> منذ :  <?= @$this->booking->getNiceDuration(@$this->booking->tissme_now()-@@$row['timeend2'],1); ?></div>
            </div>
          
          
            <div class="icon">
              <i class="ion home"></i>
            </div>
            <a href="<?=base_url('show/id/'.@$row['bookingid'])?>" class="small-box-footer"><?= @$row['bookig']; ?>
             عرض  <i class="fa fa-arrow-circle-right"></i>
            </a>
          </div>
          
          <?php endif; ?>
          
          
          
          
                <?php if(@$row['conter']==2):?>
          <div class="small-box <?= @$row['color']; ?>">
            
            <div class="inner">
             
                <h3 style="margin-top: -10px;"><?= @$row['name']; ?></h3>

              <div style="        font-size: 12px;
       margin-top: -12px;
       margin-bottom: -2px;"><?=@$row['bookingname']?><br><span style=" font-size: 12px ;margin-top: -30px;font-weight: bold;"> -
                  <?php if (@$row['outsite']== 'ok'): ?>   غير متواجد
      <?php endif; ?>
                  </span></div>
            </div>
            <div class="icon">
              <i class="ion home"></i>
            </div>
              <a href="<?=base_url('show/id/'.@$row['bookingid'])?>" class="small-box-footer" style=" font-size: 12px;">
                  عرض     
            </a>
             
          </div>
          
          <?php if((int)@$row['timeend']< (int)@$this->booking->tissme_now()):?>
          <div class="progress vertical active" style="        margin-top: -126px;
    height: 80px;
    float: left;
    width: 100%;
    margin-left: 0px;">
                <div class="progress-bar progress-bar-primary progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="50" style="height: 100%;width: 100%;">
                    <h3 style="    font-size: 38px;margin-top: 0px;
    margin-right: -10px;"><?= @$row['name']; ?></h3>
      <div style="        font-size: 10px;
       margin-top: -12px;
       margin-bottom: -2px;text-align: right;padding-right: 10px"><?=@$row['bookingname']?>
      
      <br><span style=" font-size: 12px ;margin-top: -30px;font-weight: bold;"><?= @$this->booking->getNiceDuration(@$this->booking->tissme_now()-@$row['timeend']); ?>- <?php if (@$row['outsite']== 'ok'): ?>   غير متواجد
      <?php endif; ?></span></div>
     
                </div>
              </div>
             <?php endif; ?>
          
           <?php if(@$row['commentnbeh']):?> 
           <div class="overlay">
                <i class="fa" style="left: 10%;
                   right: 75%;top:15%;color: white;">  <img   src="<?= base_url()?>/public/warning.gif" style="width:30px"></i>
            </div> 
          
           <?php endif; ?> 
          <?php endif; ?>
           
        </div>
          
               
              
                    <?php endforeach; ?>
                
           
            </div>
            <!-- /.box-body -->
                  
          </div>
          <!-- /.box -->

          
          <!-- /.box -->
        </div>
     </div>
      </div>
      <!-- /.row -->
 <div class="row">
        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-green"><?=@$all_rooms_1?></span>

            <div class="info-box-content">
                <h3 >متاح</h3> 
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-red"><?=@$all_rooms_2?></span>

            <div class="info-box-content">
     <h3 >مشغول</h3>
         
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-yellow"><?=@$all_rooms_3?></span>

            <div class="info-box-content">
              <h3 >تنظيف</h3>
            
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
         <div class="col-md-3 col-sm-6 col-xs-12">
             
          <div class="info-box">
            <span class="info-box-icon bg-blue"><?=@$clintsout?>
           </span>

            <div class="info-box-content">
     <h3 >متاخرين</h3>
         
            </div>
       
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
      </div> 
       <div class="row">
  <?php

	if((@$all_rooms_1+@$all_rooms_3)<6)
	{
	
	if(@stristr(@$_SERVER['REQUEST_URI'],'/booking2/') or @stristr(@$_SERVER['REQUEST_URI'],'/booking4/')){
	    
	    @$dbhost="localhost";// ??????
@$dbuser="kuwaityc_booking";  // ??? ?????? ????? ????????
@$dbpass="qaz123";     // ??????? ????? ????????
@$dbname="kuwaityc_booking"; // ??? ????? ????????
 @$mysqli = new mysqli(@$dbhost,@$dbuser,@$dbpass,@$dbname);
@$sql = mysqli_query(@$mysqli,"select * from booking_rooms where conter=1 or  conter=3  ");

 @$num_sql1 = mysqli_num_rows(@$sql);	 
  ?>
            <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-green"><?=@$num_sql1?></span>

            <div class="info-box-content">
                <h3 >حولي</h3> 
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
           
           
           <?php 	}
	
		if(!@stristr(@$_SERVER['REQUEST_URI'],'/booking2/')){
	    
    @$dbhost="localhost";// ??????
@$dbuser="kuwaityc_bookin2";  // ??? ?????? ????? ????????
@$dbpass="qaz123";     // ??????? ????? ????????
@$dbname="kuwaityc_booking2"; // ??? ????? ????????
 @$mysqli = new mysqli(@$dbhost,@$dbuser,@$dbpass,@$dbname);
@$sql = mysqli_query(@$mysqli,"select * from booking_rooms where conter=1 or  conter=3  ");

 @$num_sql1 = mysqli_num_rows(@$sql);	 
 ?>
            <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-green"><?=@$num_sql1?></span>

            <div class="info-box-content">
                <h3 >السالمية</h3> 
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
           
           
           <?php
           
           
                }
	
	
	
	
		if(!@stristr(@$_SERVER['REQUEST_URI'],'/booking4/')){
	    
@$dbhost="localhost";//
@$dbuser="kuwaityc_booking";  // 
@$dbpass="qaz123";     // 
@$dbname="kuwaityc_booking4"; // 
 @$mysqli = new mysqli(@$dbhost,@$dbuser,@$dbpass,@$dbname);
@$sql = mysqli_query(@$mysqli,"select * from booking_rooms where conter=1 or  conter=3  ");

 @$num_sql1 = mysqli_num_rows(@$sql);	 
 ?>
            <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-green"><?=@$num_sql1?></span>

            <div class="info-box-content">
                <h3 >الرقعي</h3> 
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
           
           
           <?php
                }
}

?>  </div> 
       </div>
          <!-- /.info-box -->
        </div>
<meta http-equiv=refresh content=150;url=<?=base_url() . 'dashboard/'?>>