<?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>
  </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 -->
<!-- page content -->
<div class="right_col" role="main">

    <div class="row">
        <div class="col-md-6 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                	
                    <h2>TeleCaller's Follow Up<small>Today's</small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                    	<a href="telecaller_follow_print.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">

                    <ul class="list-unstyled timeline">
                        <?php
                        $today = date('Y-m-d');
                        $qry4 = mysqli_query($con,"SELECT id,comp_name,person_name,phone,phone2,email,location,bdo,status,follow_up,entered_date FROM tele_calls_det WHERE follow_up = '$today' AND `status`!='2'");
                        $qry4_num = mysqli_num_rows($qry4);
                        if($qry4_num>0)
                        {
                            while($qry4_fet = mysqli_fetch_object($qry4))
                            {
                                $bdo = $qry4_fet->bdo;
                                $qry_emp = mysqli_query($con,"SELECT id, emp_name FROM employee_registration WHERE id='$bdo'");
                                $qry_emp_fet = mysqli_fetch_object($qry_emp);

                                $qry_bdo =mysqli_query($con,"SELECT * FROM tele_reports WHERE telecall_id = '{$qry4_fet->id}' AND tele_bdo_id = '$bdo' ORDER BY id DESC LIMIT 0,1");
                                $qry_bdo_fet=mysqli_fetch_object($qry_bdo);
                            ?>
                            <li>
                                <div class="block">
                                    <div class="tags">
                                        <a style="text-decoration: none;" class="tag">
                                            <span><?php echo $qry_emp_fet->emp_name; ?></span>
                                        </a>
                                    </div>
                                    <div class="block_content">
                                        <h2 class="title">
                                        	  <a href="" data-toggle="modal" data-target="#viewcustomers<?php echo $qry4_fet->id; ?>" style=" cursor: pointer; text-decoration: none;">
                                                <?php echo $qry4_fet->comp_name; ?></a>
                                        </h2>
                                        <div class="byline">
                                            contact Person <a style="text-decoration: none;"><?php echo $qry4_fet->person_name; ?></a>
                                        </div>
                                        <p class="excerpt">
                                            <?php
                                            if(!empty($qry_bdo_fet->report))
                                            {
                                            echo $qry_bdo_fet->report;
                                            }
                                            ?>
                                        </p>
                                    </div>
                                </div>
                                
                                
                                
         <?php
         $fw = $qry4_fet->follow_up;
         list($year,$month,$day) = explode('-', $fw);

    $en = $qry4_fet->entered_date;
    list($eyear,$emonth,$eday) = explode('-', $en);

    $s="";
    if($qry4_fet->status == 1)
    {
        $s = 'Interested';
    }
    elseif($qry4_fet->status == 2)
    {

        $s = 'Not-Interested';
    }
    elseif($qry4_fet->status == 3)
    {
        $s =  'Future';
    }
    elseif($qry4_fet->status == 4)
    {
        $s = 'Visit Scheduled';
    }
    ?>     
		                        
                                
  <div class="modal fade" id="viewcustomers<?php echo $qry4_fet->id; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header" style=" background-color: #E8E8E8;">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                
        <h4 class="modal-title" id="myModalLabel"> <?php echo $qry4_fet->comp_name; ?></h4>
      </div>
      <div class="modal-body" id="myModal2">
  
 <table id="datatable-fixed-header" class="table table-striped table-bordered">
	<tr>
		<td>Company</td>
		<td><?php echo $qry4_fet->comp_name; ?></td>
	</tr>
	
	<tr>
		<td>Contact Person</td>
		<td><?php echo $qry4_fet->person_name; ?></td>
	</tr> 
	<tr>
																	<td>Phone</td>
																	<td><?php echo $qry4_fet->phone; ?></td>
																</tr>
																<tr>
																	<td>Phone2</td>
																	<td><?php echo $qry4_fet->phone2; ?></td>
																</tr>
																<tr>
																	<td>Email</td>
																	<td><?php echo $qry4_fet->email; ?></td>
																</tr>
																<tr>
																	<td>Location</td>
																	<td><?php echo $qry4_fet->location; ?></td>
																</tr>
																
                                                                <tr>
																	<td>Date</td>
																	<td><?php echo $en; ?>&nbsp;<?php echo $qry4_fet->entered_time; ?></td>
																</tr> 
																<tr>
																	<td>Telecaller</td>
																	<td><?php echo $qry_emp_fet->emp_name; ?></td>
																</tr> 
																
																<tr>
																	<td>Last Follow</td>
																	<td><?php echo $fw; ?></td>
																</tr>
																<tr>
																	<td>Status</td>
																	<td><?php echo $s; ?></td>
																</tr>																
																
</table>																
  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
       
      </div>
    </div>
  </div>
</div>  
                                
                                
                                
                                
                                
                                
                                
                                
                            </li>
                            <?php
                            }
                        }
                        else
                        {
                        ?>
                            <div style="line-height: 55px;"><h4>No Data Found</h4></div>
                        <?php
                        }
                        ?>
                    </ul>

                </div>
            </div>
        </div>

        <div class="col-md-6 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                	
                    <h2>Executive's Follow Up<small>Today's </small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                    	<a href="executive_follow_print.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">
                    <ul class="list-unstyled timeline">
                        <?php
                        $today = date('Y-m-d');
                        $qry4 = mysqli_query($con,"SELECT id,comp_name,person_name,executive_bdo,executive_status,executive_follow_up,phone,phone2,email,location,follow_up,entered_date,status FROM tele_calls_det WHERE executive_follow_up = '$today'");
                        $qry4_num = mysqli_num_rows($qry4);
                        if($qry4_num>0)
                        {
                            while($qry4_fet = mysqli_fetch_object($qry4))
                            {
                                $bdo = $qry4_fet->executive_bdo;
                                $qry_emp = mysqli_query($con,"SELECT id, emp_name FROM employee_registration WHERE id='$bdo'");
                                $qry_emp_fet = mysqli_fetch_object($qry_emp);

                                $qry_bdo =mysqli_query($con,"SELECT * FROM executive_report WHERE tele_id = '{$qry4_fet->id}' AND 	executive_bdo_id = '$bdo' ORDER BY id DESC LIMIT 0,1");
                                $qry_bdo_fet=mysqli_fetch_object($qry_bdo);
                                ?>
                                <li>
                                    <div class="block">
                                        <div class="tags">
                                            <a style="text-decoration: none;" class="tag">
                                                <span><?php echo $qry_emp_fet->emp_name; ?></span>
                                            </a>
                                        </div>
                                        <div class="block_content">
                                            <h2 class="title">
                                            <a href="" data-toggle="modal" data-target="#viewcompany<?php echo $qry4_fet->id; ?>" style=" cursor: pointer; text-decoration: none;">
                                              <?php echo $qry4_fet->comp_name; ?></a>
                                            </h2>
                                            <div class="byline">
                                                contact Person <a style="text-decoration: none;"><?php echo $qry4_fet->person_name; ?></a>
                                            </div>
                                            <p class="excerpt">
                                                <?php
                                                if(!empty($qry_bdo_fet->report))
                                                {
                                                    echo $qry_bdo_fet->report;
                                                }
                                                ?>
                                            </p>
                                        </div>
                                    </div>
                                    
  
    <?php
    $fw = $qry4_fet->follow_up;
    list($year,$month,$day) = explode('-', $fw);

    $en = $qry4_fet->entered_date;
    list($eyear,$emonth,$eday) = explode('-', $en);

    $s="";
    if($qry4_fet->status == 1)
    {
        $s = 'Interested';
    }
    elseif($qry4_fet->status == 2)
    {

        $s = 'Not-Interested';
    }
    elseif($qry4_fet->status == 3)
    {
        $s =  'Future';
    }
    elseif($qry4_fet->status == 4)
    {
        $s = 'Visit Scheduled';
    }
    ?> 
                                    
  <div class="modal fade" id="viewcompany<?php echo $qry4_fet->id; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header" style=" background-color: #E8E8E8;">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                
        <h4 class="modal-title" id="myModalLabel"> <?php echo $qry4_fet->comp_name; ?></h4>
      </div>
      <div class="modal-body" id="myModal2">
  
 <table id="datatable-fixed-header" class="table table-striped table-bordered">
	<tr>
		<td>Company</td>
		<td><?php echo $qry4_fet->comp_name; ?></td>
	</tr>
	
	<tr>
		<td>Contact Person</td>
		<td><?php echo $qry4_fet->person_name; ?></td>
	</tr> 
	<tr>
																	<td>Phone</td>
																	<td><?php echo $qry4_fet->phone; ?></td>
																</tr>
																<tr>
																	<td>Phone2</td>
																	<td><?php echo $qry4_fet->phone2; ?></td>
																</tr>
																<tr>
																	<td>Email</td>
																	<td><?php echo $qry4_fet->email; ?></td>
																</tr>
																<tr>
																	<td>Location</td>
																	<td><?php echo $qry4_fet->location; ?></td>
																</tr>
																
                                                                <tr>
																	<td>Date</td>
																	<td><?php echo $en; ?>&nbsp;<?php echo $qry4_fet->entered_time; ?></td>
																</tr> 
																<tr>
																	<td>Telecaller</td>
																	<td><?php echo $qry_emp_fet->emp_name; ?></td>
																</tr> 
																
																<tr>
																	<td>Last Follow</td>
																	<td><?php echo $fw; ?></td>
																</tr>
																<tr>
																	<td>Status</td>
																	<td><?php echo $s; ?></td>
																</tr>																
																
</table>																
  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
       
      </div>
    </div>
  </div>
</div>  


                          
                                    
                                </li>
                            <?php
                            }
                        }
                        else
                        {
                            ?>
                            <div style="line-height: 55px;"><h4>No Data Found</h4></div>
                        <?php
                        }
                        ?>
                    </ul>

                </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>
<!-- 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>
<script src="../components/js/custom.js"></script>
</body>
</html>