<?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>';
}

include "../ses_write.php";
?>
<!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 href="../components/css/icheck/flat/green.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../components/css/maps/jquery-jvectormap-2.0.1.css" />
    <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>

    <style>
        input[type=number] {
            -moz-appearance:textfield;
        }

        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
    </style>


    <!--[if lt IE 9]>
    <script src="../assets/js/ie8-responsive-file-warning.js"></script>
    <![endif]-->

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- DataTables CSS -->
    <link href="../components/data_table/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">

    <!-- DataTables Responsive CSS -->
    <link href="../components/data_table/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet">

    <!-- select2 -->
    <link href="../components/css/select/select2.min.css" rel="stylesheet">

    <!--- Autoload Text --->

    <!-- End -->

</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 -->

<script type="text/javascript">
    $(document).ready(function () {
        $('#next_follow_up').daterangepicker({
            singleDatePicker: true,
            calender_style: "picker_4"
        }, function (start, end, label) {
            console.log(start.toISOString(), end.toISOString(), label);
        });
    });
</script>
<script>
    function edit_exe_data(tid)
    {
        $.ajax({
            url   :"ajax_positive_fd.php" ,
            type  : "POST",
            data  :
            {
                btn_edt_exec_data : 1,
                tid               : tid
            },
            success:function(res118)
            {
                $('#edt_frm').html(res118);
            }
        });
    }
</script>
    <script>
        function add_exec_dt()
        {
            var ck_name = /^[A-Za-z .,0-9 ]{3,30}$/;
            var ck_disc = /^[A-Za-z .,0-9 ]/;
            var ck_num = /^[0-9 ]/;

            //EXE BDO
            if(document.getElementById('bdo_exec').value == "")
            {
                alert("please Enter BDO.!");
                $('#bdo_exec').focus();
                return false;
            }
            if(document.getElementById('bdo_exec').value.match(ck_disc))
            {

            }
            else
            {
                alert('Miss Match Error BDO Name..!');
                $('#bdo_exec').focus();
                return false;
            }

            //report
            if(document.getElementById('report').value == "")
            {
                alert("please Enter report.!");
                $('#report').focus();
                return false;
            }
            if(document.getElementById('report').value.match(ck_disc))
            {

            }
            else
            {
                alert('Miss Match Error report..!');
                $('#report').focus();
                return false;
            }

            //status
            if(document.getElementById('status').value == "")
            {
                alert("please Select status.!");
                $('#status').focus();
                return false;
            }

            if(document.getElementById('idex').value == "")
            {
                alert("Error");
                return false;
            }


           var bdo_exec = $('#bdo_exec').val();
           var next_follow_up = $('#next_follow_up').val();
           var status = $('#status').val();
           var report = $('#report').val();
           var idex = $('#idex').val();

            $.ajax({
                url   :"ajax_positive_fd.php" ,
                type  : "POST",
                data  :
                {
                    btn_upd_exec_data      : 1,
                    bdo_exec               : bdo_exec,
                    next_follow_up         : next_follow_up,
                    status                 : status,
                    report                 : report,
                    idex                   : idex
                },
                success:function(res1181)
                {
                    $('#alerts').html(res1181);
                }
            });

        }
    </script>
    <script>
        function show_exe_data()
        {
            $.ajax({
                url   :"ajax_positive_fd.php" ,
                type  : "POST",
                data  :
                {
                    btn_shw_exec_data      : 1
                },
                success:function(res1182)
                {
                    $('#show_data').html(res1182);
                }
            });
        }
    </script>
<!-- page content -->
<div class="right_col" role="main">

<div class="row">
    <div id="alerts"></div>
    <div class="col-md-12 col-sm-12 col-xs-12" id="edt_frm">

    </div>
</div>
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>Positive FeedBacks<small>View</small></h2>
                <ul class="nav navbar-right panel_toolbox">
                	<a href="positive_feedbackprint.php" target="_blank"> <i class="fa fa-print" style="font-size:20px; margin-top: 3px; float: left; margin-right: 10px;"></i></a>
                    <li>
                        <a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </li>
                    <li>
                        <a class="close-link"><i class="fa fa-close"></i></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="x_content" id="show_data">
                <div class="dataTables_wrapper">
                    <table class="table table-striped table-bordered table-hover table-responsive" id="dataTables-example">
                        <thead>
                        <tr>
                            <!--<th>#</th>-->
                            <th>ID</th>
                            <th>Company</th>
                            <th class="hidden-xs">Person</th>
                            <th>Exe. BDO</th>
                            <th class="hidden-xs">Phone</th>
                            <th class="hidden-xs">Follow Up</th>
                            <th>Exe. Status</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php
                        $stmt = mysqli_query($con,"SELECT * FROM tele_calls_det WHERE status='4' AND executive_status <> '5' ORDER BY id DESC ");
                        //$i=1;
                        while($res = mysqli_fetch_object($stmt))
                        {
                            $ex_bdo = $res->executive_bdo;
                            $qry15 = mysqli_query($con,"SELECT id,emp_name FROM employee_registration WHERE id='$ex_bdo'");
                            $qry15_fet = mysqli_fetch_object($qry15);

                            list($year,$month,$day) = explode('-', $res->executive_follow_up);
                            ?>
                            <tr class="odd gradeX" onclick="edit_exe_data(<?php echo $res->id; ?>)" title="Add Reort" style="cursor: pointer;">
                                <!--<td></td>-->
                                <td><?php echo $res->id; ?></td>
                                <td><?php echo $res->comp_name; ?></td>
                                <td class="hidden-xs"><?php echo $res->person_name; ?></td>
                                <td><?php echo $qry15_fet->emp_name; ?></td>
                                <td class="hidden-xs"><?php echo $res->phone; ?></td>
                                <td class="hidden-xs"><?php echo $day.' - '.$month.' - '.$year; ?></td>
                                <td class="center"><?php if($res->executive_status == 1){ echo 'Interested'; }elseif($res->executive_status == 2){ echo 'Order Lost'; }elseif($res->executive_status == 5){ echo 'Order Confirmed'; }elseif($res->executive_status == 6){ echo 'Quotation Placed'; }  ?></td>
                            </tr>
                            <?php
                            //$i++;
                        }
                        $stmt->close();
                        ?>
                        </tbody>
                    </table>
                </div>
                <!-- /.table-responsive -->
            </div>
        </div>
    </div>
</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>


<!-- 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>
<!-- tags -->
<script src="../components/js/tags/jquery.tagsinput.min.js"></script>
<!-- switchery -->
<script src="../components/js/switchery/switchery.min.js"></script>
<!-- daterangepicker -->
<script type="text/javascript" src="../components/js/moment.min2.js"></script>
<script type="text/javascript" src="../components/js/datepicker/daterangepicker.js"></script>

<!-- form validation -->
<!--<script type="text/javascript" src="js/parsley/parsley.min.js"></script>-->

<!-- textarea resize -->
<script src="../components/js/textarea/autosize.min.js"></script>
<script>
    autosize($('.resizable_textarea'));
</script>
<script src="../components/js/custom.js"></script>

<!-- DataTables JavaScript -->
<script src="../components/data_table/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="../components/data_table/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
    $(document).ready(function() {
        $('#dataTables-example').DataTable({
            responsive: true
        });
    });
</script>

<!-- select2 -->
<script src="../components/js/select/select2.full.js"></script>
<script>
    $(document).ready(function () {
        $(".country").select2({
            placeholder: "Select a Country",
            allowClear: true
        });
        $(".state").select2({
            placeholder: "Select a State",
            allowClear: true
        });
        $(".district").select2({
            placeholder: "Select a district",
            allowClear: true
        });
        $(".bdo").select2({
            placeholder: "Select a Telecaller (BDO)",
            allowClear: true
        });
    });
</script>
<!-- /select2 -->


</body>

</html>
