<?php
session_start();
require_once('Connections/courier.php');
require_once 'functions/functions.php';

$query_claim = "select * from special_order_details where item_order_status='Added' order by id desc;";
$rsclaim = mysql_query($query_claim, $courier) or die(mysql_error());
$row_rsclaim = mysql_fetch_assoc($rsclaim);
$totalRows_rsclaim = mysql_num_rows($rsclaim);
$reserved_frames = mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS reserved_frames FROM claims_details WHERE payment_status='Owing' AND mode_of_payment='frame reserve'"));

?>
<h1 class="page-title"> Optical Dashboard
                        <small>Statistics, Charts & Reports</small>
                    </h1>
                    <div class="page-bar">
                        <ul class="page-breadcrumb">
                            <li>
                                <i class="icon-home"></i>
                                <a href="index.html">Home</a>
                                <i class="fa fa-angle-right"></i>
                            </li>
                            <li>
                                <span>Dashboard</span>
                            </li>
                        </ul>
                        <div class="page-toolbar">
                            <div class="btn-group pull-right">
                                <button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true"> Actions
                                    <i class="fa fa-angle-down"></i>
                                </button>
                                <ul class="dropdown-menu pull-right" role="menu"></ul>
                            </div>
                        </div>
                    </div>
                    <!-- END PAGE HEADER-->
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="cursor:pointer;" onclick="getstep('create_special_orders');">
                            <div class="dashboard-stat2 ">
                                <div class="display">
                                    <div class="number">
                                        <h3 class="font-green-sharp">
                                            <span data-counter="counterup" data-value="<?php echo $totalRows_rsclaim; ?>">0</span>
                                            <small class="font-green-sharp"></small>
                                        </h3>
                                        <small>SPECIAL ORDERS - LENS</small>
                                    </div>
                                    <div class="icon">
                                        <i class="icon-pie-chart"></i>
                                    </div>
                                </div>
                                <div class="progress-info">
                                    <div class="progress">
                                        <!-- <span style="width: 100%;" class="progress-bar progress-bar-success green-sharp"></span> -->
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="cursor:pointer;" onclick="getstep('list_reserved_frames');">
                            <div class="dashboard-stat2 ">
                                <div class="display">
                                    <div class="number">
                                        <h3 class="font-red-haze">
                                            <span data-counter="counterup" data-value="<?php echo $reserved_frames['reserved_frames'];?>">0</span>
                                            <small class="font-red-haze"></small>
                                        </h3>
                                        <small>RESERVED FRAMES</small>
                                    </div>
                                    <div class="icon">
                                        <i class="icon-like"></i>
                                    </div>
                                </div>
                                <div class="progress-info">
                                    <div class="progress">
                                        <!-- <span style="width: 100%;" class="progress-bar progress-bar-success red-haze"></span> -->
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="cursor:pointer;">
                            <div class="dashboard-stat2 ">
                                <div class="display">
                                    <div class="number">
                                        <h3 class="font-blue-sharp">
                                            <span data-counter="counterup" data-value="0">0</span>
                                        </h3>
                                        <small>N/A</small>
                                    </div>
                                    <div class="icon">
                                        <i class="icon-users"></i>
                                    </div>
                                </div>
                                <div class="progress-info">
                                    <div class="progress">
                                        <!-- <span style="width: 45%;" class="progress-bar progress-bar-success blue-sharp"></span> -->
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="cursor:pointer;" onclick="getstep('list_of_appointments_today');">
                            <div class="dashboard-stat2 ">
                                <div class="display">
                                    <div class="number">
                                        <h3 class="font-purple-soft">
                                            <span data-counter="counterup" data-value="<?php echo $appointments['total_appointments']; ?>">0</span>
                                        </h3>
                                        <small>N/A</small>
                                    </div>
                                    <div class="icon">
                                        <i class="icon-user"></i>
                                    </div>
                                </div>
                                <div class="progress-info">
                                    <div class="progress">
                                        <!-- <span style="width: 57%;" class="progress-bar progress-bar-success purple-soft"></span> -->
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-6 col-xs-12 col-sm-12">
                            <div class="portlet light ">
                                <div class="portlet-title">
                                    <div class="caption">
                                        <span class="caption-subject bold uppercase font-dark">UPCOMING</span>
                                    </div>
                                </div>
                                <div class="portlet-body">
                                <div id="container2" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6 col-xs-12 col-sm-12">
                            <div class="portlet light ">
                                <div class="portlet-title">
                                    <div class="caption ">
                                        <span class="caption-subject font-dark bold uppercase">UPCOMING</span>
                                    </div>
                                </div>
                                <div class="portlet-body">
                                <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                                </div>
                            </div>
                        </div>
                    </div>