<?php 
require 'lock.php'; 

$task_id = decryptId($_GET['task_id']);
if($task_id)
{
$taskgetquery=mysqli_query($con,"select task_master.*,user_master.user_name from task_master 
						inner join user_master ON user_master.user_id=task_master.task_userid
						where task_id='$task_id'");
$taskgetdata=mysqli_fetch_assoc($taskgetquery);
}
else
{
echo '<script> window.location="task-list"; </script>';
}
?>

<!DOCTYPE html>
<html lang="en">
<?php require 'head.php'; ?>
<body>
    <!-- Loader starts-->
    <div class="loader-wrapper">
      <div class="theme-loader">    
        <div class="loader-p"></div>
      </div>
    </div>
    <!-- Loader ends-->
    <!-- page-wrapper Start-->
    <div class="page-wrapper" id="pageWrapper">
      <?php include 'top.php'; ?>
      <!-- Page Header Ends                              -->
      <!-- Page Body Start-->
      <div class="page-body-wrapper horizontal-menu">
        <?php include 'header.php'; ?>
        <!-- Page Sidebar Ends-->
        <div class="page-body">
          <div class="container-fluid">
            <div class="page-header">
              <div class="row">
                <div class="col-6">
                  <h3>Task Status</h3>
                  <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="index">Home</a></li>
                    <li class="breadcrumb-item active">Task Status</li>
                  </ol>
                </div>
                <div class="col-6">
                    <a href="index" class="btn btn-secondary me-3">Back</a> 
                </div>
              </div>
            </div>
          </div>
          <!-- Container-fluid starts-->
           <div class="container-fluid">
            <div class="row">
              <div class="col-sm-12">
                <div class="card">
                  <div class="card-body">
				    <form action="task-status-db.php" method="post"  enctype="multipart/form-data">
	                <input type="hidden" class="form-control" name="task_id" value="<?php echo $task_id ?>"/>
                    <div class="form theme-form">
          
                      
                      <div class="row">
                       
                        <div class="col-sm-4">
                          <div class="mb-3">
                            <label>Priority <sup class="text-danger">*</sup></label>
                            <select class="form-select"  name="task_status" required>
                              <option value="<?php echo $taskgetdata['task_status'] ?>"><?php echo $taskgetdata['task_status'] ?></option>
                              <option value="Pending">Pending</option>
                              <option value="In Progress">In Progress</option>
                              <option value="On Hold">On Hold</option>
                              <option value="Review">Review</option>
                              <option value="Completed">Completed</option>
                            </select>
                          </div>
                        </div>
						
						
                      </div>
                     
                      
                      <div class="row">
                        <div class="col">
                          <div class="text-end">
						  <button class="btn btn-secondary me-3" name="taskadd" type="submit"> Update </button>
                        </div>
                      </div>
                    </div>
                  </div>
				  </form>	
                </div>
              </div>
            </div>
          </div>
          <!-- Container-fluid Ends-->
        </div>
        
		<?php include 'footer.php'; ?>
  </body>
</html>