<?php 
session_start(); 
if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
	include("connect.php");
	date_default_timezone_set("Asia/Kolkata");
				$mdate1= date('Y-m-d H:i:s');
				$mdate2= date('Y-m-d');
				$mdate= date('d-m-Y');
	

?>
<!DOCTYPE html>
<!--
Author: Keenthemes
Product Name: Metronic - Bootstrap 5 HTML, VueJS, React, Angular. Laravel, Asp.Net Core, Ruby on Rails, Spring Boot, Blazor, Django, Express Node.js & Flask Admin Dashboard Theme
Purchase: https://1.envato.market/EA4JP
Website: http://www.keenthemes.com
Contact: support@keenthemes.com
Follow: www.twitter.com/keenthemes
Dribbble: www.dribbble.com/keenthemes
Like: www.facebook.com/keenthemes
License: For each use you must have a valid license purchased only from above link in order to legally use the theme for your project.
-->
<html lang="en">
	<!--begin::Head-->
	<head>
		<title>Task Detail</title>
		<meta charset="utf-8" />
		
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta property="og:locale" content="en_US" />
		<meta property="og:type" content="article" />
		<meta property="og:title" content="Metronic - Bootstrap 5 HTML, VueJS, React, Angular. Laravel, Asp.Net Core, Ruby on Rails, Spring Boot, Blazor, Django, Express Node.js & Flask Admin Dashboard Theme" />
		<meta property="og:url" content="https://keenthemes.com/metronic" />
		<meta property="og:site_name" content="Keenthemes | Metronic" />
		<link rel="canonical" href="https://preview.keenthemes.com/metronic8" />
		<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
		<!--begin::Fonts(mandatory for all pages)-->
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
		<!--end::Fonts-->
		<!--begin::Vendor Stylesheets(used for this page only)-->
		<link href="assets/plugins/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css" />
		<!--end::Vendor Stylesheets-->
		<!--begin::Global Stylesheets Bundle(mandatory for all pages)-->
		<link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
		<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
		<style>
		    body{
		        background-image: none !important;
    background-color: #F3F6F9;
		    }
		</style>
		<!--end::Global Stylesheets Bundle-->
	</head>
	<!--end::Head-->
	<!--begin::Body-->
	<body id="kt_body" class="header-fixed header-tablet-and-mobile-fixed aside-fixed aside-secondary-disabled">
		<!--begin::Theme mode setup on page load-->
		<script>var defaultThemeMode = "light"; var themeMode; if ( document.documentElement ) { if ( document.documentElement.hasAttribute("data-theme-mode")) { themeMode = document.documentElement.getAttribute("data-theme-mode"); } else { if ( localStorage.getItem("data-theme") !== null ) { themeMode = localStorage.getItem("data-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-theme", themeMode); }</script>
		<!--end::Theme mode setup on page load-->
		<!--begin::Main-->
		<!--begin::Root-->
		<div class="d-flex flex-column flex-root">
			<!--begin::Page-->
			<div class="page d-flex flex-row flex-column-fluid">
				<!--begin::Aside-->
				<?php include('sidebar.php'); ?>
				<!--end::Aside-->
				<!--begin::Wrapper-->
				<div class="wrapper d-flex flex-column flex-row-fluid" id="kt_wrapper">
					<!--begin::Header-->
					<div id="kt_header" style="" class="header align-items-stretch">
						<!--begin::Container-->
						<div class="container-fluid d-flex align-items-stretch justify-content-between">
							<!--begin::Aside mobile toggle-->
							<div class="d-flex align-items-center d-lg-none ms-n3 me-1" title="Show aside menu">
								<div class="btn btn-icon btn-active-color-primary w-40px h-40px" id="kt_aside_toggle">
									<!--begin::Svg Icon | path: icons/duotune/abstract/abs015.svg-->
									<span class="svg-icon svg-icon-1">
										<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M21 7H3C2.4 7 2 6.6 2 6V4C2 3.4 2.4 3 3 3H21C21.6 3 22 3.4 22 4V6C22 6.6 21.6 7 21 7Z" fill="currentColor" />
											<path opacity="0.3" d="M21 14H3C2.4 14 2 13.6 2 13V11C2 10.4 2.4 10 3 10H21C21.6 10 22 10.4 22 11V13C22 13.6 21.6 14 21 14ZM22 20V18C22 17.4 21.6 17 21 17H3C2.4 17 2 17.4 2 18V20C2 20.6 2.4 21 3 21H21C21.6 21 22 20.6 22 20Z" fill="currentColor" />
										</svg>
									</span>
									<!--end::Svg Icon-->
								</div>
							</div>
							<!--end::Aside mobile toggle-->
							<!--begin::Mobile logo-->
							<div class="d-flex align-items-center flex-grow-1 flex-lg-grow-0">
								<a href="dashboard.php" class="d-lg-none">
									<img alt="Logo" src="assets/media/logos/demo4-mobile.svg" class="h-25px" />
								</a>
							</div>
							<!--end::Mobile logo-->
							<div class="d-flex align-items-center" id="kt_header_wrapper">
								<!--begin::Page title-->
								<div class="page-title d-flex flex-column align-items-start justify-content-center flex-wrap me-lg-20 pb-5 pb-lg-0" data-kt-swapper="true" data-kt-swapper-mode="prepend" data-kt-swapper-parent="{default: '#kt_content_container', lg: '#kt_header_wrapper'}">
									<!--begin::Heading-->
									<h1 class="text-dark fw-bold my-1 fs-3 lh-1">Task Details</h1>
									<!--end::Heading-->
									<!--begin::Breadcrumb-->
									<ul class="breadcrumb fw-semibold fs-8 my-1">
										<li class="breadcrumb-item text-muted">
											<a href="dashboard.php" class="text-muted">Home</a>
										</li>
										<li class="breadcrumb-item text-muted">Task Managemnet</li>
										
										<li class="breadcrumb-item text-muted">Task Details</li>
									</ul>
									<!--end::Breadcrumb-->
								</div>
								<!--end::Page title=-->
							</div>
							<!--begin::Wrapper-->
							<?php include('header.php'); ?>
							<!--end::Wrapper-->
						</div>
						<!--end::Container-->
					</div>
					<!--end::Header-->
					<?php
					
	
	
	
	$eve = "select * from res_task_master where taskmid=".$_GET['id']." ";
			$re = mysqli_query($conn, $eve);
			while($rt = mysqli_fetch_assoc($re))
			{
				$taskmid=$rt['taskmid'];
				$taskname=$rt['taskname'];
				$taskpriority=$rt['taskpriority'];
				$taskduedate=date("d-m-Y H:i",strtotime($rt['taskduedate']));
				$tasknote=$rt['tasknote'];
				$taskurl=$rt['taskurl'];
				
				

				
			}
			
	
?>
					<!--begin::Content-->
					<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
						<!--begin::Container-->
						<div class="container-xxl" id="kt_content_container">
							<!--begin::Order details page-->
							<div class="d-flex flex-column gap-7 gap-lg-10">
								<!--<div class="d-flex flex-wrap flex-stack gap-5 gap-lg-10">
									
									<!--begin::Button-->
									<?php /*if($_SESSION['frompage'] == 'Inquirylistpage') {?>
									<a href="inquiry.php" class="btn btn-icon btn-light btn-sm ms-auto me-lg-n7">
									<?php } else if ($_SESSION['frompage'] == 'planStudiesInquirylistpage') { ?>
									<a href="planstudiesinquiry.php" class="btn btn-icon btn-light btn-sm ms-auto me-lg-n7">
									<?php } else if ($_SESSION['frompage'] == 'taskDetail') {  ?>
									<!--<a href="taskinquiry.php?id=<?php echo $_SESSION['taskid']; ?>" class="btn btn-icon btn-light btn-sm ms-auto me-lg-n7">
									<?php }else{ ?>
									<a href="inquiry.php" class="btn btn-icon btn-light btn-sm ms-auto me-lg-n7">
									<?php }  */?>
										<!--begin::Svg Icon | path: icons/duotune/arrows/arr074.svg-->
										<!--<span class="svg-icon svg-icon-2">
											<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
												<path d="M11.2657 11.4343L15.45 7.25C15.8642 6.83579 15.8642 6.16421 15.45 5.75C15.0358 5.33579 14.3642 5.33579 13.95 5.75L8.40712 11.2929C8.01659 11.6834 8.01659 12.3166 8.40712 12.7071L13.95 18.25C14.3642 18.6642 15.0358 18.6642 15.45 18.25C15.8642 17.8358 15.8642 17.1642 15.45 16.75L11.2657 12.5657C10.9533 12.2533 10.9533 11.7467 11.2657 11.4343Z" fill="currentColor" />
											</svg>
										</span>
										<!--end::Svg Icon-->
									</a>
									<!--end::Button-->
									
								
								
								<!--begin::Tab content-->
								<div class="tab-content">
									<!--begin::Tab pane-->
									<div class="tab-pane fade show active" id="User_detail" role="tab-panel">
										<!--begin::Orders-->
										<div class="d-flex flex-column gap-7 gap-lg-10">
											<div class="d-flex flex-column flex-xl-row gap-7 gap-lg-10">
												<!--begin::Payment address-->
												<div class="card card-flush py-4 flex-row-fluid overflow-hidden">
													<!--begin::Background-->
													
													<!--end::Background-->
												<!--	<div class="d-flex justify-content-end" data-kt-user-table-toolbar="base">
													
													<!--begin::Add user-->
											<!--<a href="inquiryedit.php?id=&from=detail" class="btn 
btn-primary ">
											<!--begin::Svg Icon | path: icons/duotune/arrows/arr075.svg-->
											
											<!--end::Svg Icon--><!--Edit <i class="fa fa-edit"> </i></a>
											<!--end::Add user-->
											<!--	</div>
													<!--begin::Card header-->
													<div class="card-body pt-0">
													<div class="table-responsive">
													<table class="table align-middle table-row-dashed fs-6 gy-5 mb-0">
                
                <tr>
                  <th class="fw-bold">Task Name
                  </th>
                  <td>
                    <?php echo $taskname;?>
                  </td>
                  <th class="fw-bold">Priority
                  </th>
                  <td>
                    <?php echo $taskpriority;?>
                  </td>
                </tr>
				
				<tr>
                  <th class="fw-bold">Due Date
                  </th>
                  <td>
                    <?php echo $taskduedate;?>
                  </td>
				  <th class="fw-bold">URL
                  </th>
                  <td>
                    <?php echo $taskurl;?>
                  </td>
				  
                </tr>	
				
               <tr>
                 
				  <th class="fw-bold">Note
                  </th>
                  <td colspan="3">
                    <?php echo $tasknote;?>
                  </td>
				  
                </tr>	
				
               
				
              </table>
			  </div>
			  </div>
           
													<!--end::Card header-->
													<!--begin::Card body-->
													
													<!--end::Card body-->
												</div>
												<!--end::Payment address-->
												</div>
											
											</div>
										<!--end::Orders-->
									</div>
									<!--end::Tab pane-->
									
								</div>
								<!--begin::Order history-->
											<div class="card card-flush py-4 flex-row-fluid">
												<!--begin::Card header-->
													<div class="card-header cursor-pointer">
														<!--begin::Card title-->
														<div class="card-title m-0">
															<h3 class="fw-bold m-0 text-uppercase">Task Allocated Users</h3>
														</div>
														<!--end::Card title-->
														
													</div>
												
												<!--end::Card header-->
												<!--begin::Card body-->
												<div class="card-body pt-0">
													<div class="table-responsive">
														<!--begin::Table-->
														<table class="table align-middle table-row-dashed fs-6 gy-5 mb-0">
															<!--begin::Table head-->
															<thead>
																<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
																	<th class="min-w-100px">Name </th>
																	
																	<th class="min-w-100px">Status </th>
																	<th class="min-w-100px">Remark </th>
																	<th class="min-w-100px">Last Updated On </th>
																	

																	
																	
																</tr>
															</thead>
															<!--end::Table head-->
															<!--begin::Table body-->
															<tbody class="fw-semibold text-gray-600">
															<?php 
															$umid1 = $_SESSION['umid'];
															
															if($_SESSION['utype'] == 'admin')
															{
																$eve11 = "select * from res_taskallocation_detail where taskmid=$taskmid  ";
															}else{
															$eve11 = "select * from res_taskallocation_detail where taskmid=$taskmid and (taskmid in (select taskmid from res_task_master where taddedby=$umid1) or umid=$umid1) ";
															}
															$re11 = mysqli_query($conn, $eve11);
															while($rt11 = mysqli_fetch_assoc($re11))
															{
																
																
																$umid =$rt11['umid'];
																$taskstatus=$rt11['taskstatus'];
																$taremark=$rt11['taremark'];
																
																if($taskstatus == 'Pending')
																{
																	$taskstatus1 = "<div class='badge badge-light-danger fw-bold'>Pending</div>";
																}else if ($taskstatus == 'Completed')
																{
																	$taskstatus1 = "<div class='badge badge-light-success fw-bold'>Completed</div>";
																}else{
																	$taskstatus1 = "<div class='badge badge-light-primary fw-bold'>In Process</div>";
																}
																
																$taupdatedon=date("d-m-Y H:i:s",strtotime($rt11['taupdatedon']));
																
																		
																			
																			
																		
																			 $eveag1 = "select * from res_user_master where umid=$umid";
																		$reag1 = mysqli_query($conn, $eveag1);
																		if(mysqli_num_rows($reag1) > 0)
																		{
																			while($rtag1 = mysqli_fetch_assoc($reag1))
																			{
																				$ufullname=$rtag1['ufullname'];
																			}
																		}
																		else
																		{
																			$ufullname="";
																		}
																		
																
																
																
																
															
															?>
																<tr>
																	
																	<td><?php echo $ufullname; ?></td>
																	
																	<td><?php echo $taskstatus1; ?></td>
																	<td><?php echo $taremark; ?></td>
																	<td><?php echo $taupdatedon; ?></td>
																	
																</tr>
															<?php } ?>
																</tbody>
															<!--end::Table head-->
														</table>
														<!--end::Table-->
													</div>
												</div>
												<!--end::Card body-->
											</div>
											<!--end::Order history-->
		<!--begin::Messenger-->
			<div class="card w-100 rounded-0 border-0" id="kt_chat_messenger">
				<!--begin::Card header-->
				<div class="card-header pe-5" id="kt_drawer_chat_messenger_header">
					<!--begin::Title-->
					<div class="card-title">
						<!--begin::User-->
						<div class="d-flex justify-content-center flex-column me-3">
							<a href="#" class="fs-4 fw-bold text-gray-900 text-hover-primary me-1 mb-2 lh-1">Comments</a>
							<!--begin::Info-->
							
							<!--end::Info-->
						</div>
						<!--end::User-->
					</div>
					<!--end::Title-->
					<!--begin::Card toolbar-->
					<div class="card-toolbar">
						<!--begin::Close-->
						<div class="btn btn-sm btn-icon btn-active-light-primary" id="kt_drawer_chat_close">
							<!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg-->
							<span class="svg-icon svg-icon-2">
								<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
									<rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor" />
									<rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor" />
								</svg>
							</span>
							<!--end::Svg Icon-->
						</div>
						<!--end::Close-->
					</div>
					<!--end::Card toolbar-->
				
					</div>
				<!--end::Card header-->
				<!--begin::Card body-->
				<div class="card-body" id="kt_drawer_chat_messenger_body">
					<!--begin::Messages-->
					<div class="scroll-y me-n5 pe-5" data-kt-element="messages" data-kt-scroll="true" data-kt-scroll-activate="true" data-kt-scroll-height="auto" data-kt-scroll-dependencies="#kt_drawer_chat_messenger_header, #kt_drawer_chat_messenger_footer" data-kt-scroll-wrappers="#kt_drawer_chat_messenger_body" data-kt-scroll-offset="0px">
					
					<?php 
						$eve98 = "select * from res_taskchat_detail where taskmid=$taskmid ";
						$re98 = mysqli_query($conn, $eve98);
						if(mysqli_num_rows($re98) > 0)
						{
			while($rt98 = mysqli_fetch_assoc($re98))
			{
				$chatmessage = $rt98['chatmessage'];
				$tctaddedon = date("d-m H:i",strtotime($rt98['tctaddedon']));
				
				$tctaddedby = $rt98['tctaddedby'];
				
				$uimage='';
				$chatname='';
				
				$eveag = "select ufullname,utype,uimage from res_user_master where umid=$tctaddedby";
				$reag = mysqli_query($conn, $eveag);
				if(mysqli_num_rows($reag) > 0)
				{
					while($rtag = mysqli_fetch_assoc($reag))
					{
						$chatname=$rtag['ufullname'];
						$utype=$rtag['utype'];
						$uimage=$rtag['uimage'];
						
						if(strlen($uimage)>3)
				{
					$uimage="<img src='docs/$uimage' width='80px' height='80px'>";
				}
					}
				}
				
				
					?>
						<!--begin::Message(in)-->
						<div class="d-flex justify-content-<?php if($_SESSION['umid'] == $tctaddedby)
				{ echo 'end'; }else{ echo 'start'; } ?>  mb-10">
							<!--begin::Wrapper-->
							<div class="d-flex flex-column align-items-<?php if($_SESSION['umid'] == $tctaddedby)
				{ echo 'end'; }else{ echo 'start'; } ?>">
								<!--begin::User-->
								<div class="d-flex align-items-center mb-2">
									<!--begin::Avatar-->
									<div class="symbol symbol-35px symbol-circle">
										<?php echo $uimage; ?>
									</div>
									<!--end::Avatar-->
									<!--begin::Details-->
									<div class="ms-3">
										<a href="#" class="fs-5 fw-bold text-gray-900 text-hover-<?php if($_SESSION['umid'] == $tctaddedby)
				{ echo 'primary'; }else{ echo 'info'; } ?> me-1"><?php if($_SESSION['umid'] == $tctaddedby)
				{ echo 'You'; }else{ echo $chatname; } ?></a>
										<span class="text-muted fs-7 mb-1"><?php echo $tctaddedon; ?></span>
									</div>
									<!--end::Details-->
								</div>
								<!--end::User-->
								<!--begin::Text-->
								<div class="p-5 rounded bg-light-<?php if($_SESSION['umid'] == $tctaddedby)
				{ echo 'primary'; }else{ echo 'info'; } ?> text-dark fw-semibold mw-lg-400px text-<?php if($_SESSION['umid'] == $tctaddedby)
				{ echo 'end'; }else{ echo 'start'; } ?>" data-kt-element="message-text"><?php echo $chatmessage; ?></div>
								<!--end::Text-->
							</div>
							<!--end::Wrapper-->
						</div>
						<!--end::Message(in)-->
						<?php } } ?>
						</div>
					<!--end::Messages-->
				</div>
				<!--end::Card body-->
				<!--begin::Card footer-->
				<div class="card-footer pt-4" id="kt_drawer_chat_messenger_footer">
				<form id="kt_modal_add_user_form123" class="form" action="taskchatadd2.php" method="POST">
				<input type="hidden" name="taskmid" value="<?php echo $taskmid; ?>">
					<!--begin::Input-->
					<textarea class="form-control form-control-flush mb-3" rows="1" name="chatmessage" placeholder="Type a comment"></textarea>
					<!--end::Input-->
					<!--begin:Toolbar-->
					<div class="d-flex flex-stack">
						
						<!--begin::Send-->
						<button class="btn btn-primary" type="submit" data-kt-users-modal-action="submit">Add Comment</button>
						<!--end::Send-->
					</div>
					<!--end::Toolbar-->
					</form>
				</div>
				<!--end::Card footer-->
			</div>
			<!--end::Messenger-->
		
												
							</div>
							<!--end::Order details page-->
						</div>
						<!--end::Container-->
					</div>
					<!--end::Content-->
					<!--begin::Footer-->
					<?php include('footer.php'); ?>
					<!--end::Footer-->
				</div>
				<!--end::Wrapper-->
			</div>
			<!--end::Page-->
		</div>
		<!--end::Root-->
		<!--begin::Drawers-->
		
		<!--begin::Engage modals-->
		<!--end::Engage modals-->
		<!--begin::Modal - Add task-->
							
									
		<!--end::Modals-->
		<!--begin::Javascript-->
		<script>var hostUrl = "assets/";</script>
		<!--begin::Global Javascript Bundle(mandatory for all pages)-->
		<script src="assets/plugins/global/plugins.bundle.js"></script>
		<script src="assets/js/scripts.bundle.js"></script>
		<!--end::Global Javascript Bundle-->
		<!--begin::Vendors Javascript(used for this page only)-->
		<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
		<!--end::Vendors Javascript-->
		<!--begin::Custom Javascript(used for this page only)-->
		<script src="assets/js/widgets.bundle.js"></script>
		<script src="assets/js/custom/widgets.js"></script>
		<script src="assets/js/custom/apps/chat/chat.js"></script>
		<script src="assets/js/custom/utilities/modals/upgrade-plan.js"></script>
		<script src="assets/js/custom/utilities/modals/users-search.js"></script>
		<!--end::Custom Javascript-->
		<!--end::Javascript-->
	</body>
	<!--end::Body-->
</html>