<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<?php 
require_once('Connections/courier.php'); 
$totalPatient = mysql_fetch_assoc(mysql_query("SELECT count(*) AS total FROM patient_information WHERE patient_status = 'In Use'"));

$totalPatientUploaded = mysql_fetch_assoc(mysql_query("SELECT count(*) AS total FROM patient_information a INNER JOIN patient_file_attachments b ON b.patient_id = a.id WHERE patient_status = 'In Use'"));
?>
<head>
 <meta charset="utf-8" />
 <title> Rx OPTICAL SYSTEM | Dashboard</title>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta content="width=device-width, initial-scale=1" name="viewport" />
 <meta content="" name="description" />
 <meta content="" name="author" />
 <!-- BEGIN LAYOUT FIRST STYLES -->
 <link href="//fonts.googleapis.com/css?family=Oswald:400,300,700" rel="stylesheet" type="text/css" />
 <!-- END LAYOUT FIRST STYLES -->
 <!-- BEGIN GLOBAL MANDATORY STYLES -->
 <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
 <link href="assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
 <link href="assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
 <link href="assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
 <link href="assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
 <!-- END GLOBAL MANDATORY STYLES -->
 <!-- BEGIN PAGE LEVEL PLUGINS -->
 <link href="assets/global/plugins/morris/morris.css" rel="stylesheet" type="text/css" />
 <!-- END PAGE LEVEL PLUGINS -->
 <!-- BEGIN THEME GLOBAL STYLES -->
 <link href="assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
 <link href="assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
 <!-- END THEME GLOBAL STYLES -->
 <!-- BEGIN THEME LAYOUT STYLES -->
 <link href="assets/layouts/layout6/css/layout.min.css" rel="stylesheet" type="text/css" />
 <link href="assets/layouts/layout6/css/custom.css" rel="stylesheet" type="text/css" />
 <link href="assets/apps/sweet/sweet-alert.css" rel="stylesheet" type="text/css"/>

 <link href="assets/apps/css/font-awesome-4.6.1/css/font-awesome.css" rel="stylesheet" type="text/css"/>
 <link href="assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css"/>
 <link href="assets/global/plugins/jquery-ui/jquery.timepicker.css" rel="stylesheet" type="text/css"/>
 <link href="assets/global/css/todo.css" rel="stylesheet" type="text/css"/>
 <link href="assets/apps/dist/css/lightgallery.css" rel="stylesheet" type="text/css"/>

 <!-- END THEME LAYOUT STYLES -->
 <link rel="shortcut icon" href="favicon.ico" /> </head>
 <!-- END HEAD -->

 <body class="">

  <!--<body class="page-sidebar-fixed">-->
   <!-- BEGIN HEADER -->
   <header class="page-header">
    <nav class="navbar" role="navigation">
     <div class="container-fluid">
      <div class="havbar-header">
       <!-- BEGIN LOGO -->
       <a id="index" class="navbar-brand" href="#">
        <img src="assets/layouts/layout6/img/acacia_logo.jpg" height="100px" alt="Logo" style="display: none;"> </a>
        <!-- END LOGO -->
        <!-- BEGIN TOPBAR ACTIONS -->
        <div class="topbar-actions">
         <!-- END HEADER SEARCH BOX -->
         <!-- BEGIN GROUP NOTIFICATION -->

         <!-- END GROUP NOTIFICATION -->
         <!-- BEGIN USER PROFILE -->
         <div class="btn-group-img btn-group">
          <button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" style="color: white">
           <img src="assets/layouts/layout5/img/avatar1.jpg" alt="" style="display: none; "> Account</button>
           <ul class="dropdown-menu-v2" role="menu">
            <li>
             <a href="#">
              <i class="icon-user"></i> My Profile
              <span class="badge badge-danger">1</span>
             </a>
            </li>
            <li class="divider"> </li>
            <li>
             <a href="#">
              <i class="icon-lock"></i> Lock Screen </a>
             </li>
             <li>
              <a href="<?php echo $logoutAction;?>">
               <i class="icon-key"></i> Log Out </a>
              </li>
             </ul>
            </div>
            <!-- END USER PROFILE -->
           </div>
           <!-- END TOPBAR ACTIONS -->
          </div>
         </div>
         <!--/container-->
        </nav>
       </header>
       <!-- END HEADER -->
       <!-- BEGIN CONTAINER -->
       <div class="container-fluid">
        <div class="page-content page-content-popup">
         <div class="page-content-fixed-header">
          <!-- BEGIN BREADCRUMBS -->
          <ul class="page-breadcrumb">
           <li>
            <a href="#">Dashboard</a>
           </li>
           <li>Main Dashboard</li>
          </ul>
          <!-- END BREADCRUMBS -->
          <div class="content-header-menu"><br>
           <form name="form" id="form" method="POST" style="padding-right:20px;">
            <div class="actions">
             <div class="portlet-input input-inline">
              <div class="input-icon right">
               <i class="icon-magnifier"></i>
               <input onkeyup="getstep('medical_list_claims_search');" name="searchtext_patient_no" id="searchtext_patient_no" type="text" class="form-control input-circle" placeholder="search..."> </div>
              </div>
             </div>
            </form>
            <br>
           </div>
          </div>

          <?php // include 'leftmenu.php'; ?>

          <div class="page-fixed-main-content" id="currentarea" style="min-height:500px;">

           <!-- BEGIN PAGE BASE CONTENT -->

           <div class="row widget-row">
            <div class="col-md-3">
             <!-- BEGIN WIDGET THUMB -->
             <div class="widget-thumb widget-bg-color-white text-uppercase margin-bottom-20 bordered">
              <h4 class="widget-thumb-heading">Total Active Patient</h4>
              <div class="widget-thumb-wrap">
               <i class="widget-thumb-icon bg-green icon-bulb"></i>
               <div class="widget-thumb-body">
                <span class="widget-thumb-subtitle"></span>
                <span class="widget-thumb-body-stat" data-counter="counterup" data-value="<?php echo $totalPatient['total']; ?>">0</span>
               </div>
              </div>
             </div>
             <!-- END WIDGET THUMB -->
            </div>
            <div class="col-md-3">
             <!-- BEGIN WIDGET THUMB -->
             <div class="widget-thumb widget-bg-color-white text-uppercase margin-bottom-20 bordered">
              <h4 class="widget-thumb-heading">No. of folders uploaded</h4>
              <div class="widget-thumb-wrap">
               <i class="widget-thumb-icon bg-red icon-layers"></i>
               <div class="widget-thumb-body">
                <span class="widget-thumb-subtitle"></span>
                <span class="widget-thumb-body-stat" data-counter="counterup" data-value="<?php echo $totalPatientUploaded['total'] ?>">0</span>
               </div>
              </div>
             </div>
             <!-- END WIDGET THUMB -->
            </div>
            <div class="col-md-3">
             <!-- BEGIN WIDGET THUMB -->
             <div class="widget-thumb widget-bg-color-white text-uppercase margin-bottom-20 bordered">
              <h4 class="widget-thumb-heading"></h4>
              <div class="widget-thumb-wrap">
               <i class="widget-thumb-icon bg-purple icon-screen-desktop"></i>
               <div class="widget-thumb-body">
                <span class="widget-thumb-subtitle"></span>
                <span class="widget-thumb-body-stat" data-counter="counterup" data-value=""></span>
               </div>
              </div>
             </div>
             <!-- END WIDGET THUMB -->
            </div>
            <div class="col-md-3">
             <!-- BEGIN WIDGET THUMB -->
             <div class="widget-thumb widget-bg-color-white text-uppercase margin-bottom-20 bordered">
              <h4 class="widget-thumb-heading"></h4>
              <div class="widget-thumb-wrap">
               <i class="widget-thumb-icon bg-blue icon-bar-chart"></i>
               <div class="widget-thumb-body">
                <span class="widget-thumb-subtitle"></span>
                <span class="widget-thumb-body-stat" data-counter="counterup" data-value=""></span>
               </div>
              </div>
             </div>
             <!-- END WIDGET THUMB -->
            </div>
           </div>

           <!-- END PAGE BASE CONTENT -->

          </div>
          <!-- BEGIN FOOTER -->
          <p class="copyright-v2"> <?php echo date('Y');?> ©  Rx HOPE HOSPTIAL SYSTEM</p>

          <?php

          require_once('Connections/courier.php'); 
          require_once('functions/functions.php'); 
          if (!function_exists("GetSQLValueString")) {
           function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
           {
            if (PHP_VERSION < 6) {
             $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
            }

            $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

            switch ($theType) {
             case "text":
             $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
             break;    
             case "long":
             case "int":
             $theValue = ($theValue != "") ? intval($theValue) : "NULL";
             break;
             case "double":
             $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
             break;
             case "date":
             $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
             break;
             case "defined":
             $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
             break;
            }
            return $theValue;
           }
          }

          mysql_select_db($database_courier, $courier);
          $searchtxt=$_POST["searchtext"];
          $typesearch=$_POST["typesearch"];
          $id=$_POST["id"];

          $query_rsodest = "SELECT
          a.*,b.surname, b.othernames, b.id as patient_id,
          DATE_FORMAT(
          a.datetimeadded,
          '%e %b %Y %r'
          ) AS datenew
          FROM process_claim_no a INNER JOIN patient_information b ON a.patient_no = b.card_number WHERE a.consulting_room_status = 'pending' and a.attending_officer_id = '".$_SESSION['myMM_Userid']."' and a.service_category='General' ORDER BY a.id ASC, a.datetimeadded DESC";

          $rsodest = mysql_query($query_rsodest, $courier) or die(mysql_error());
          $totalRows_rsodest = mysql_num_rows($rsodest);
          $row_rsodest = mysql_fetch_assoc($rsodest);

          ?>

          <button type="button" class="quick-sidebar-toggler" data-toggle="collapse">
           <span class="sr-only">Toggle Quick Sidebar</span>
           <i class="icon-logout"></i>
           <div class="quick-sidebar-notification">
            <span class="badge badge-danger"><?php echo $totalRows_rsodest;?></span>
           </div>
          </button>
<!--                <a href="#index" class="go2top">
                    <i class="icon-arrow-up"></i>
                   </a>-->
                  </div>
                 </div>
                 <!-- END CONTAINER -->
                 <!-- BEGIN QUICK SIDEBAR -->
                 <a id="hide_quick_slider" href="javascript:;" class="page-quick-sidebar-toggler">
                  <i class="icon-login"></i>
                 </a>
                 <div class="page-quick-sidebar-wrapper" data-close-on-body-click="false">
                  <div class="page-quick-sidebar">
                   <ul class="nav nav-tabs">
                    <li class="active">
                     <a href="javascript:;" data-target="#quick_sidebar_tab_1" data-toggle="tab"> Patients
                      <span class="badge badge-danger"><?php echo $totalRows_rsodest;?></span>
                     </a>
                    </li>
                   </ul>
                   <div class="tab-content">
                    <div class="tab-pane active page-quick-sidebar-chat" id="quick_sidebar_tab_1">
                     <div class="page-quick-sidebar-chat-users">
                      <h3 class="list-heading">Waiting Patients</h3>
                      <ul class="media-list list-items">
                       <?php
                       do {
                        list($row_rsodest['picpath'], $row_rsodest['insurance_no1'], $row_rsodest['insurance_company1']) = patient_sub_info($row_rsodest['patient_no'],$courier);
                        $picpath="../".FOLDER_NAME.$row_rsodest['picpath']; 
                        if(!$picpath){ 
                         if($row_rsodest['insurance_no1']){
                          $inspicpath=getpicpath($row_rsodest['insurance_company1']);
                          if($inspicpath){
                           $member_id=preg_replace("/[^0-9]/","",$row_rsodest['insurance_no1']);
                           $picpath="../".FOLDER_NAME.$inspicpath."/".ltrim($member_id,0).".jpg";
                          }else{
                           $picpath="../".FOLDER_NAME."images/profile.gif";		
                          }
                         }else{
                          $picpath="../".FOLDER_NAME."images/profile.gif";	
                         }
                        }?> 

                        <li onclick="save_information('view_medical_history_details','<?php echo $row_rsodest['patient_no'].'@@@'. $row_rsodest['patient_id'];?>', '<?php echo $row_rsodest['process_claim_no'];?>', 'currentarea');$('#hide_quick_slider').trigger('click');" class="media">
                         <img class="media-object" style="height:50px;" src="<?php echo $picpath;?>" alt="...">
                         <div class="media-body">
                          <h4 class="media-heading"><?php echo strtoupper($row_rsodest['surname']." ".$row_rsodest['othernames']); ?></h4>
                          <div class="media-heading-sub"> 
                           <?php echo 'PATIENT NO : '. $row_rsodest['patient_no'];?> <br>
                           <?php echo 'VISIT NO : '. $row_rsodest['process_claim_no'];?>
                          </div>
                         </div>
                        </li>
                       <?php }  while ($row_rsodest = mysql_fetch_assoc($rsodest)); ?>
                      </ul>
                     </div>
                    </div>
                   </div>
                  </div>
                 </div>
                 <!-- END QUICK SIDEBAR -->
        <!--[if lt IE 9]>
<script src="assets/global/plugins/respond.min.js"></script>
<script src="assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
<!-- BEGIN CORE PLUGINS -->
<script src="assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script> 
<script src="assets/global/plugins/jquery-ui/jquery.timepicker.js" type="text/javascript"></script> 
<script src="assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="assets/global/plugins/moment.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/morris/morris.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/morris/raphael-min.js" type="text/javascript"></script>
<script src="assets/global/plugins/counterup/jquery.waypoints.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/counterup/jquery.counterup.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/horizontal-timeline/horozontal-timeline.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
<script src="assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
<script src="assets/global/scripts/app.min.js" type="text/javascript"></script>
<script language="javascript" src="assets/apps/scripts/jquery.form.js"></script>
<script language="javascript" src="assets/apps/sweet/sweet-alert.js"></script>
<script src="assets/layouts/layout6/scripts/layout.min.js" type="text/javascript"></script>
<script src="assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
<script src="assets/apps/scripts/jquery.autocomplete.min.js" type="text/javascript"></script>
<script src="assets/apps/scripts/leftmenu.js" type="text/javascript"></script>
<!-- END THEME LAYOUT SCRIPTS -->

<script type="text/javascript" src="assets/apps/drawings/lib/jquery.ui.core.1.10.3.min.js"></script>
<script type="text/javascript" src="assets/apps/drawings/lib/jquery.ui.widget.1.10.3.min.js"></script>
<script type="text/javascript" src="assets/apps/drawings/lib/jquery.ui.mouse.1.10.3.min.js"></script>
<script type="text/javascript" src="assets/apps/drawings/lib/jquery.ui.draggable.1.10.3.min.js"></script>

<link rel="Stylesheet" type="text/css" href="assets/apps/drawings/lib/wColorPicker.min.css" />
<script type="text/javascript" src="assets/apps/drawings/lib/wColorPicker.min.js"></script>

<link rel="Stylesheet" type="text/css" href="assets/apps/drawings/wPaint.min.css" />
<script type="text/javascript" src="assets/apps/drawings/wPaint.min.js"></script>
<script type="text/javascript" src="assets/apps/drawings/plugins/main/wPaint.menu.main.min.js"></script>
<script type="text/javascript" src="assets/apps/drawings/plugins/text/wPaint.menu.text.min.js"></script>
<script type="text/javascript" src="assets/apps/drawings/plugins/shapes/wPaint.menu.main.shapes.min.js"></script>
<script type="text/javascript" src="assets/apps/drawings/plugins/file/wPaint.menu.main.file.min.js"></script>

<script type="text/javascript" src="assets/apps/dist/js/lightgallery.js"></script>
<script type="text/javascript" src="assets/apps/dist/js/lg-fullscreen.js"></script>
<script type="text/javascript" src="assets/apps/dist/js/lg-thumbnail.js"></script>
<script type="text/javascript" src="assets/apps/dist/js/lg-autoplay.js"></script>
<script type="text/javascript" src="assets/apps/dist/js/lg-zoom.js"></script>

<script type="text/javascript">
 $(document).ready(function() {
  $("body").on("click", ".date_time_picker", function(){
   if (!$(this).hasClass("hasDatepicker"))
   {
    $(this).datepicker({
     numberOfMonths: 1,
     changeMonth: true,
     changeYear: true
    });
    $(this).datepicker("option", "dateFormat", "yy-mm-dd");
    $(this).datepicker("show");
   }
  });

  $("body").on("click", ".time_picker", function(){
   $(this).timepicker(
    { 'step': 5
//                      'timeFormat': 'H:i:a' 
});
   $(this).timepicker("show");
  });

 });

</script>
</body>

</html>