<?php
   include "../../pidbco/pidbjoin.php";
   if(!isset($_SESSION)){
       session_start();
   }
   if(!isset($_SESSION['jay_proj_mngmnt']) && empty($_SESSION['jay_proj_mngmnt']))
   {
      echo '<script type="text/javascript">alert("You Want To Login Now.."); window.location.href="../Login";</script>';
   }
?>
<!DOCTYPE html>
  <html lang="en">
   <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Marketing</title>
    <!-- Bootstrap core CSS -->
    <link href="../components/css/bootstrap.min.css" rel="stylesheet">
    <link href="../components/fonts/css/font-awesome.min.css" rel="stylesheet">
    <link href="../components/css/animate.min.css" rel="stylesheet">
    <!-- Custom styling plus plugins -->
    <link href="../components/css/custom.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../components/css/maps/jquery-jvectormap-2.0.1.css" />
    <link href="../components/css/icheck/flat/green.css" rel="stylesheet" />
    <link href="../components/css/floatexamples.css" rel="stylesheet" type="text/css" />
    <script src="../components/js/jquery.min.js"></script>
    <script src="../components/js/nprogress.js"></script>
    <script>
        NProgress.start();
    </script>
    </head>
    <body class="nav-md">
    <div class="container body">
        <div class="main_container">
            <?php include("left_menu.php"); ?>
            <!-- top navigation -->
             <?php include("top_nav.php"); ?>
            <!-- /top navigation -->

            <?php
            $date = date('Y-m-d');
            $st1 = mysqli_query($con,"SELECT Count(*) as tot FROM tele_calls_det WHERE entered_date='$date'");
            $data1 = mysqli_fetch_object($st1);

            $st2 = mysqli_query($con,"SELECT Count(*) as tot1 FROM tele_calls_det WHERE executive_bdo != '' AND entered_date='$date'");
            $data2 = mysqli_fetch_object($st2);

            $st3 = mysqli_query($con,"SELECT Count(*) as tot3 FROM tele_calls_det WHERE executive_status = '5' AND entered_date='$date'");
            $data3 = mysqli_fetch_object($st3);

            $st4 = mysqli_query($con,"SELECT Count(*) as tot4 FROM order_det WHERE ord_date='$date'");
            $data4 = mysqli_fetch_object($st4);

            $st5 = mysqli_query($con,"SELECT Count(*) as tot5 FROM tele_reports WHERE entered_date = '$date'");
            $st6 = mysqli_query($con,"SELECT Count(*) as tot6 FROM executive_report WHERE entered_date = '$date'");
            $data5 = mysqli_fetch_object($st5);
            $data6 = mysqli_fetch_object($st6);
            $num_007 = ($data5->tot5 + $data6->tot6);
            ?>

            <!-- page content -->
            <div class="right_col" role="main">

                <!-- top tiles -->
                <div class="row tile_count">
                    <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count">
                        <div class="left"></div>
                        <div class="right">
                            <span class="count_top"><i class="fa fa-user"></i> Telecalling ( Today )</span>
                            <div class="count"><?php echo $data1->tot; ?></div>
                        </div>
                    </div>
                    <div class="animated flipInY col-md-3 col-sm-4 col-xs-4 tile_stats_count">
                        <div class="left"></div>
                        <div class="right">
                            <span class="count_top"><i class="fa fa-clock-o"></i> Positive Clients ( Today )</span>
                            <div class="count"><?php echo $data2->tot1; ?></div>
                        </div>
                    </div>
                    <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count">
                        <div class="left"></div>
                        <div class="right">
                            <span class="count_top"><i class="fa fa-user"></i> Followups ( Today )</span>
                            <div class="count green"><?php echo $num_007; ?></div>
                        </div>
                    </div>
                    
                    <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count">
                        <div class="left"></div>
                        <div class="right">
                            <span class="count_top"><i class="fa fa-user"></i> Confirmed ( Today )</span>
                            <div class="count"><?php echo $data3->tot3; ?></div>
                        </div>
                    </div>
                    <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count">
                        <div class="left"></div>
                        <div class="right">
                            <span class="count_top"><i class="fa fa-user"></i> Orders ( Today )</span>
                            <div class="count"><?php echo $data4->tot4; ?></div>
                        </div>
                    </div>
                </div>
                <!-- /top tiles -->

                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">

                    </div>

                </div>
                <br />

                <div class="row">


                 

                 

                   
                   


                </div>



                
            </div>
            <!-- /page content -->

        </div>

    </div>

    <div id="custom_notifications" class="custom-notifications dsp_none">
        <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
        </ul>
        <div class="clearfix"></div>
        <div id="notif-group" class="tabbed_notifications"></div>
    </div>

    <script src="../components/js/bootstrap.min.js"></script>

    <!-- gauge js -->
    <script type="text/javascript" src="../components/js/gauge/gauge.min.js"></script>
    <script type="text/javascript" src="../components/js/gauge/gauge_demo.js"></script>
    <!-- chart js -->
    <script src="../components/js/chartjs/chart.min.js"></script>
    <!-- bootstrap progress js -->
    <script src="../components/js/progressbar/bootstrap-progressbar.min.js"></script>
    <script src="../components/js/nicescroll/jquery.nicescroll.min.js"></script>
    <!-- icheck -->
    <script src="../components/js/icheck/icheck.min.js"></script>
    <!-- daterangepicker -->
    <script type="text/javascript" src="../components/js/moment.min.js"></script>
    <script type="text/javascript" src="../components/js/datepicker/daterangepicker.js"></script>

    <script src="../components/js/custom.js"></script>

    <!-- flot js -->
    <!--[if lte IE 8]><script type="text/javascript" src="../components/js/excanvas.min.js"></script><![endif]-->
    <script type="text/javascript" src="../components/js/flot/jquery.flot.js"></script>
    <script type="text/javascript" src="../components/js/flot/jquery.flot.pie.js"></script>
    <script type="text/javascript" src="../components/js/flot/jquery.flot.orderBars.js"></script>
    <script type="text/javascript" src="../components/js/flot/jquery.flot.time.min.js"></script>
    <script type="text/javascript" src="../components/js/flot/date.js"></script>
    <script type="text/javascript" src="../components/js/flot/jquery.flot.spline.js"></script>
    <script type="text/javascript" src="../components/js/flot/jquery.flot.stack.js"></script>
    <script type="text/javascript" src="../components/js/flot/curvedLines.js"></script>
    <script type="text/javascript" src="../components/js/flot/jquery.flot.resize.js"></script>
    <script>
        $(document).ready(function () {
            // [17, 74, 6, 39, 20, 85, 7]
            //[82, 23, 66, 9, 99, 6, 2]
            var data1 = [[gd(2012, 1, 1), 17], [gd(2012, 1, 2), 74], [gd(2012, 1, 3), 6], [gd(2012, 1, 4), 39], [gd(2012, 1, 5), 20], [gd(2012, 1, 6), 85], [gd(2012, 1, 7), 7]];

            var data2 = [[gd(2012, 1, 1), 82], [gd(2012, 1, 2), 23], [gd(2012, 1, 3), 66], [gd(2012, 1, 4), 9], [gd(2012, 1, 5), 119], [gd(2012, 1, 6), 6], [gd(2012, 1, 7), 9]];
            $("#canvas_dahs").length && $.plot($("#canvas_dahs"), [
                data1, data2
            ], {
                series: {
                    lines: {
                        show: false,
                        fill: true
                    },
                    splines: {
                        show: true,
                        tension: 0.4,
                        lineWidth: 1,
                        fill: 0.4
                    },
                    points: {
                        radius: 0,
                        show: true
                    },
                    shadowSize: 2
                },
                grid: {
                    verticalLines: true,
                    hoverable: true,
                    clickable: true,
                    tickColor: "#d5d5d5",
                    borderWidth: 1,
                    color: '#fff'
                },
                colors: ["rgba(38, 185, 154, 0.38)", "rgba(3, 88, 106, 0.38)"],
                xaxis: {
                    tickColor: "rgba(51, 51, 51, 0.06)",
                    mode: "time",
                    tickSize: [1, "day"],
                    //tickLength: 10,
                    axisLabel: "Date",
                    axisLabelUseCanvas: true,
                    axisLabelFontSizePixels: 12,
                    axisLabelFontFamily: 'Verdana, Arial',
                    axisLabelPadding: 10
                        //mode: "time", timeformat: "%m/%d/%y", minTickSize: [1, "day"]
                },
                yaxis: {
                    ticks: 8,
                    tickColor: "rgba(51, 51, 51, 0.06)"
                },
                tooltip: false
            });

            function gd(year, month, day) {
                return new Date(year, month - 1, day).getTime();
            }
        });
    </script>

    <!-- worldmap -->
    <script type="text/javascript" src="../components/js/maps/jquery-jvectormap-2.0.1.min.js"></script>
    <script type="text/javascript" src="../components/js/maps/gdp-data.js"></script>
    <script type="text/javascript" src="../components/js/maps/jquery-jvectormap-world-mill-en.js"></script>
    <script type="text/javascript" src="../components/js/maps/jquery-jvectormap-us-aea-en.js"></script>
    <script>
        $(function () {
            $('#world-map-gdp').vectorMap({
                map: 'world_mill_en',
                backgroundColor: 'transparent',
                zoomOnScroll: false,
                series: {
                    regions: [{
                        values: gdpData,
                        scale: ['#E6F2F0', '#149B7E'],
                        normalizeFunction: 'polynomial'
                    }]
                },
                onRegionTipShow: function (e, el, code) {
                    el.html(el.html() + ' (GDP - ' + gdpData[code] + ')');
                }
            });
        });
    </script>
    <!-- skycons -->
    <script src="../components/js/skycons/skycons.js"></script>
    <script>
        var icons = new Skycons({
                "color": "#73879C"
            }),
            list = [
                "clear-day", "clear-night", "partly-cloudy-day",
                "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind",
                "fog"
            ],
            i;

        for (i = list.length; i--;)
            icons.set(list[i], list[i]);

        icons.play();
    </script>

    <!-- dashbord linegraph -->
    <script>
        var doughnutData = [
            {
                value: 30,
                color: "#455C73"
            },
            {
                value: 30,
                color: "#9B59B6"
            },
            {
                value: 60,
                color: "#BDC3C7"
            },
            {
                value: 100,
                color: "#26B99A"
            },
            {
                value: 120,
                color: "#3498DB"
            }
    ];
        var myDoughnut = new Chart(document.getElementById("canvas1").getContext("2d")).Doughnut(doughnutData);
    </script>
    <!-- /dashbord linegraph -->
    <!-- datepicker -->
    <script type="text/javascript">
        $(document).ready(function () {

            var cb = function (start, end, label) {
                console.log(start.toISOString(), end.toISOString(), label);
                $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
                //alert("Callback has fired: [" + start.format('MMMM D, YYYY') + " to " + end.format('MMMM D, YYYY') + ", label = " + label + "]");
            }

            var optionSet1 = {
                startDate: moment().subtract(29, 'days'),
                endDate: moment(),
                minDate: '01/01/2012',
                maxDate: '12/31/2015',
                dateLimit: {
                    days: 60
                },
                showDropdowns: true,
                showWeekNumbers: true,
                timePicker: false,
                timePickerIncrement: 1,
                timePicker12Hour: true,
                ranges: {
                    'Today': [moment(), moment()],
                    'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                    'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                    'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                    'This Month': [moment().startOf('month'), moment().endOf('month')],
                    'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                },
                opens: 'left',
                buttonClasses: ['btn btn-default'],
                applyClass: 'btn-small btn-primary',
                cancelClass: 'btn-small',
                format: 'MM/DD/YYYY',
                separator: ' to ',
                locale: {
                    applyLabel: 'Submit',
                    cancelLabel: 'Clear',
                    fromLabel: 'From',
                    toLabel: 'To',
                    customRangeLabel: 'Custom',
                    daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
                    monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
                    firstDay: 1
                }
            };
            $('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
            $('#reportrange').daterangepicker(optionSet1, cb);
            $('#reportrange').on('show.daterangepicker', function () {
                console.log("show event fired");
            });
            $('#reportrange').on('hide.daterangepicker', function () {
                console.log("hide event fired");
            });
            $('#reportrange').on('apply.daterangepicker', function (ev, picker) {
                console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
            });
            $('#reportrange').on('cancel.daterangepicker', function (ev, picker) {
                console.log("cancel event fired");
            });
            $('#options1').click(function () {
                $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
            });
            $('#options2').click(function () {
                $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
            });
            $('#destroy').click(function () {
                $('#reportrange').data('daterangepicker').remove();
            });
        });
    </script>
    <script>
        NProgress.done();
    </script>
    <!-- /datepicker -->
    <!-- /footer content -->
</body>

</html>
