<?php 
//session_start();
ob_start();
error_reporting(0);
include("../../pidbco/pidbjoin.php");
$sujpath="./";
//if((!isset($_SESSION['user_name'])) && ($_SESSION['user_name'] == '')){
  //  header("Location: ../index.php");
//} 

$taskid=$_POST["taskid"];
$fromemp=$_POST["fromemp"];
$toemp=$_POST["toemp"];
$sqtask = mysqli_query($con, "SELECT * FROM `p_task`  where tid='$taskid'");
   $rstask = mysqli_fetch_array($sqtask);
?>

      <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 $rstask['tid']; ?>  - Task Register</h4>
        </div>
        <div class="modal-body" id="myModal2" >
      
        <div class="row"> 
         <div class="col-md-12" style="font-size: 14px; " >
          <div class="col-md-8" ><?php echo $fromemp; ?>&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-long-arrow-right" aria-hidden="true"></i>
            &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $toemp; ?>
            </div>
          <div class="col-md-4">
          <small class="label label-warning" > <?php echo $taskdate; ?> &nbsp; <?php echo $rstask['t_time']; ?></small>
           <small class="label label-danger" ><?php if($rstask['t_status'] == 1){ echo "Closed"; } else { echo "Open"; } ?></small>
          </div>
          </div>
         
       <div class="col-md-12" style="font-size: 18px; margin-top: 10px;">
       <div class="col-md-12 "  style="  padding-left: 2px; padding-right: 0px;background-color: #DCDCDC; " >         
         <div class="form-group " >
           &nbsp;&nbsp;&nbsp;
           <?php echo $rstask['t_action']; ?>
         </div></div>
         </div>
         
         <div class="col-md-12" style="font-size: 18px; margin-top: 5px;">
       <div class="col-md-12"  style="  padding-left: 2px; padding-right: 0px; " >          
         <div class="form-group">
         <?php 
         while($resw2 = mysqli_fetch_array($sqw)){
          $log_id = $resw2['log_id'];
          $sqemp = mysqli_query($con, "SELECT emp_name FROM `employee_registration` WHERE `id`='$log_id' ");
          $resemp = mysqli_fetch_array($sqemp);
            $reportemp = $resemp['emp_name'];
      
       ?>
         <div style="clear:both;"></div>
         <span style="font-style: italic;"><u><?php echo $resw2['reprt_date'].'&nbsp;'.$reportemp.' Says : &nbsp;'.$resw2['tas_report']; ?></u></span>  
         <?php } ?> 
         </div></div>
         </div>
         
         <div class="col-md-12" style="font-size: 18px; margin-top: 5px;">
       <div class="col-md-12"  style="  padding-left: 2px; padding-right: 0px; " >          
         <div class="form-group">
         <?php if($rstask['t_closedat'] != ''){ 
         
      $t_closedat = $rstask['t_closedat'];
          $exp4 = explode("-",$t_closedat);
          $yearr4 =  substr($exp4[0], 2, 4);
          $t_closedat = $exp4[2].'/'.$exp4[1].'/'.$yearr4; 
         ?>
         <div style="clear:both;"></div>
         <span style="font-style: italic;"><u><?php echo 'Report Closed by '.$toemp.' on '.$t_closedat; ?></u></span> 
         <?php } ?> 
         </div></div>
         </div>
         
         
     
     </div>  
       
       
        </div>
              <div class="modal-footer">
              </div>