 <?php
     include "../../pidbco/pidbjoin.php";
 ?>
<style>
   	@media print {
       thead {display: table-header-group;}
    }
</style>	
   <body style="margin:0px; font-family:Arial, Helvetica, sans-serif; font-size:12px;" onload="window.print();window.close();">
     <div id="invoice" style="width:750px; height:1010px; margin:0px auto; background-color:#FFFFFF; padding:25px 0px;">
            <div style=" width:700px; height:1100px; margin:0px auto;">

               <!--<div style="text-align:right;margin-top: -25px;  " >
                <img src="../admin/logo.jpg" alt="logo" />
               </div> -->
               <?php
                 $newDate1 = date('d/m/Y');
			     $ip = $_SERVER['REMOTE_ADDR'];
               ?>
              <div style="text-align:right;margin-top: -25px;  " >
              	<span style=" font-size: 12px;" > Date : <?php echo $newDate1; ?></span><br>
              	<span style=" font-size: 12px; margin-top: 2px;">Ip &nbsp;&nbsp;&nbsp;&nbsp;: <?php echo $ip; ?>&nbsp;&nbsp;</span>
              </div>	
            <div style="text-align:left; margin-top:5px;font-weight:bold; font-size:20px;">
             <?php 
               
               echo 'TeleCallers Follow Up  ';
             ?>
         </div>

         <br />

         <div style="width:100%; height:390px;">
            <table style="width:100%; font-size:11px; border:none; ">
               <thead>
                <tr style="text-align:left; background-color:#CCCCCC;">
                    <th style=" border:solid 1px #999999;">
                      Company 
                    </th>
                    <th style=" border:solid 1px #999999;">
                      Contact Person 
                    </th>
                     <th style="width:14%; border:solid 1px #999999;">
                      Mobile
                    </th>
                     <th style=" border:solid 1px #999999;">
                      Location
                    </th>
                    <th style="border:solid 1px #999999;">
                      Remarks    
                    </th>
                    <th style="width:15%; border:solid 1px #999999;">
                      Status
                    </th>
                </tr>
               </thead>  
               <?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,remark 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);
                               

    $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';
    }  ?>
        <tr style="line-height:20px;">

        <td style="text-align:left; border:solid 1px #999999; border-top:none;">
        <?php echo $qry4_fet->comp_name; ?>
        </td>

        <td style="padding-left:5px; border:solid 1px #999999; border-top:none;">
        <?php echo $qry4_fet->person_name; ?>
        </td>
       <td style="text-align:left; padding-left:3px; border:solid 1px #999999; border-top:none;">
       	<?php echo $qry4_fet->phone; ?>
       	</td>
       	 <td style="text-align:left; padding-left:3px; border:solid 1px #999999; border-top:none;">
       	<?php echo $qry4_fet->location; ?>
       	</td>
        <td style="text-align:left; border:solid 1px #999999; border-top:none;padding-left:3px; ">
        <?php echo $qry_bdo_fet->report; ?>
        </td>

        <td style="text-align:left; padding-right:5px; border:solid 1px #999999; border-top:none;">
        <?php echo $s; ?>
        </td>

    </tr>
    
<?php  } } ?>
    
    
       </table>
       </div>
      <br />
     <br />
    </div>
  </div>
</body>