<?php 
session_start(); 
if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
	include("connect.php");

?>
<!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>Traning Module 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">Traning Module  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">Traning Module  Managemnet</li>
										
										<li class="breadcrumb-item text-muted">Traning Module  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_traningmodule_master where tmmid=".$_GET['id']." ";
			$re = mysqli_query($conn, $eve);
			while($rt = mysqli_fetch_assoc($re))
			{
				$tmmid=$rt['tmmid'];
				$countrymid=$rt['countrymid'];
				$traningservicemid=$rt['traningservicemid'];
				$traningsubservicemid=$rt['traningsubservicemid'];
				
				
				$eveag1 = "select * from res_country_master where countrymid=$countrymid";
				$reag1 = mysqli_query($conn, $eveag1);
				if(mysqli_num_rows($reag1) > 0)
				{
					while($rtag1 = mysqli_fetch_assoc($reag1))
					{
						$countryname=$rtag1['countryname'];
					}
				}
				else
				{
					$countryname="";
				}
				
				$eveag1 = "select * from res_traningservice_master where traningservicemid=$traningservicemid";
				$reag1 = mysqli_query($conn, $eveag1);
				if(mysqli_num_rows($reag1) > 0)
				{
					while($rtag1 = mysqli_fetch_assoc($reag1))
					{
						$traningservicename=$rtag1['traningservicename'];
					}
				}
				else
				{
					$traningservicename="";
				}
				$eveag1 = "select * from res_traningsubservice_master where traningsubservicemid=$traningsubservicemid";
				$reag1 = mysqli_query($conn, $eveag1);
				if(mysqli_num_rows($reag1) > 0)
				{
					while($rtag1 = mysqli_fetch_assoc($reag1))
					{
						$traningsubservicename=$rtag1['traningsubservicename'];
					}
				}
				else
				{
					$traningsubservicename="";
				}
				
				/* $eveag1 = "select * from res_traningdocs_master where traningdocsmid=$traningdocsmid";
				$reag1 = mysqli_query($conn, $eveag1);
				if(mysqli_num_rows($reag1) > 0)
				{
					while($rtag1 = mysqli_fetch_assoc($reag1))
					{
						$traningdocsname=$rtag1['traningdocsname'];
					}
				}
				else
				{
					$traningdocsname="";
				} */
			}
				

				
	
?>
					<!--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::Card-->
							<div class="card">
								<!--begin::Card header-->
								<div class="card-header border-0 pt-6">
									<!--begin::Card title-->
									<div class="card-title">
									
									<h2><?php echo $countryname." - ".$traningservicename." - ".$traningsubservicename; ?></h2>
										</div>
									<!--begin::Card title-->
									<!--begin::Card toolbar-->
									<div class="card-toolbar">
										<!--begin::Toolbar-->
										<div class="d-flex justify-content-end" data-kt-user-table-toolbar="base">
											
											<!--begin::Add user-->
											
											
											<a href="#" data-bs-toggle="modal" data-bs-target="#student_followup" class="btn btn-sm btn-primary align-self-center me-3" ><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="11.364" y="20.364" width="16" height="2" rx="1" transform="rotate(-90 11.364 20.364)" fill="currentColor" />
													<rect x="4.36396" y="11.364" width="16" height="2" rx="1" fill="currentColor" />
												</svg>
											</span>Add New</a>
											<a href="traningmodule.php" class="btn btn-icon btn-light btn-sm btn-primary ">Back</a>
											<!--end::Add user-->
										</div>
										<!--end::Toolbar-->
										</div>
								</div>
								<!--end::Card header-->
								<!--begin::Card body-->
								<div class="card-body py-4">
									<!--begin::Table-->
									<table  id='empTable' class='table align-middle table-row-dashed fs-6 gy-5 display dataTable' >
										<!--begin::Table head-->
										<thead>
											<!--begin::Table row-->
											<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
												 <th>Document Type</th>
												 <th>Add Document </th>
												 <th>Delete </th>
												
												
												
												
											</tr>
											<!--end::Table row-->
										</thead>
										<!--end::Table head-->
										<!--begin::Table body-->
										<tbody class="text-gray-600 fw-semibold">
										
											<?php
											$rolemid = $_SESSION['userrolemid'];
											if($_SESSION['utype'] == 'admin')
													{
														 $eve1 = "select * from res_traningmoduledoctype_detail WHERE tmmid =".$_GET['id'];
													}else{
											  $eve1 = "select * from res_traningmoduledoctype_detail WHERE tmmid =".$_GET['id']." and traningdocsmid in (select traningdocsmid from res_traningmoduleroleallocation_detail where rolemid=$rolemid)";
													}
											$re1 = mysqli_query($conn, $eve1);
											$i=1;
											while ($row = mysqli_fetch_assoc($re1)) {
											
									$tmdtdid=$row['tmdtdid'];
									$traningdocsmid=$row['traningdocsmid'];
									$eveag1 = "select * from res_traningdocs_master where traningdocsmid=$traningdocsmid";
				$reag1 = mysqli_query($conn, $eveag1);
				if(mysqli_num_rows($reag1) > 0)
				{
					while($rtag1 = mysqli_fetch_assoc($reag1))
					{
						$traningdocsname=$rtag1['traningdocsname'];
					}
				}
				else
				{
					$traningdocsname="";
				} 
				$view = "<a href='traningmoduledetail.php?id=$tmdtdid' data-toggle='tooltip' data-placement='top' title='Edit' > View </a>";
				$adelete = "<a href='traningmoduledoctypedelete.php?id=$tmdtdid&tmmid=$tmmid' data-toggle='tooltip' data-placement='top' title='Delete' class='fa fa-trash-alt'>  </a>";
																			?>
											<tr>
											
											<td><span class="svg-icon svg-icon-2x svg-icon-primary me-4">
															<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
																<path opacity="0.3" d="M10 4H21C21.6 4 22 4.4 22 5V7H10V4Z" fill="currentColor" />
																<path d="M9.2 3H3C2.4 3 2 3.4 2 4V19C2 19.6 2.4 20 3 20H21C21.6 20 22 19.6 22 19V7C22 6.4 21.6 6 21 6H12L10.4 3.60001C10.2 3.20001 9.7 3 9.2 3Z" fill="currentColor" />
															</svg>
														</span> <?php echo $traningdocsname; ?></th>
											<td><?php echo $view; ?></th>
											<td><?php echo $adelete; ?></th>
											
											</tr>
											<?php } ?>
											
										</tbody>
										<!--end::Table body-->
									</table>
									<!--end::Table-->
								</div>
								<!--end::Card body-->
							</div>
							<!--end::Card-->
						</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-->
							<!--begin::Modal - Student follow up-->
							<div class="modal fade" id="student_followup" tabindex="-1" aria-hidden="true">
								<!--begin::Modal dialog-->
								<div class="modal-dialog modal-dialog-centered mw-750px">
									<!--begin::Modal content-->
									<div class="modal-content rounded">
										<!--begin::Modal header-->
										<div class="modal-header pb-10 border-0 ">
										<div class="card-title text-uppercase ">
														<h2>Add Document</h2>
													</div>
											<!--begin::Close-->
											<div class="btn btn-sm btn-icon btn-active-color-primary justify-content-end" data-bs-dismiss="modal">
												<!--begin::Svg Icon | path: icons/duotune/arrows/arr061.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">
														<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>
										<!--begin::Modal header-->
										<!--begin::Modal body-->
										<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15">
											<!--begin::Form-->
														<form id="kt_modal_add_user_form" class="form" action="traningdocument3.php" method="POST" enctype="multipart/form-data">
														<input type="hidden" name="tmmid" value="<?php echo $_GET['id']; ?>">
													
																	<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1" id="">
													
													
													<!--begin::Col-->
													<div class="col-md-6 fv-row" id="subservice1">
																<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class="required fw-semibold fs-6 mb-2"> Document Type</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<select class="form-select form-select-solid" data-control="select2"   name="traningdocsmid" id="traningdocsmid" >
																	<option value="0">Select</option>
													<?php 
													if($_SESSION['utype'] == 'admin')
													{
														$eve1 = "select * from res_traningdocs_master ";
													}else{
	
																			$eve1 = "select * from res_traningdocs_master where traningdocsmid in (select traningdocsmid from res_traningmoduleroleallocation_detail where rolemid=$rolemid)";
	
	}

																			$re1 = mysqli_query($conn, $eve1);
																			
																			while($rt1 = mysqli_fetch_assoc($re1))

																			{											
																				
																				
																				
																				
																				$traningdocsname=$rt1['traningdocsname'];
																				$traningdocsmid=$rt1['traningdocsmid'];
																				
																				echo "<option value='$traningdocsmid'>$traningdocsname</option>";
																				 
																			}
																			
																	?>
													</select>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													
													</div>
													
												<!--end::Row-->
												
												
												
															<!--end::Scroll-->
															<!--begin::Actions-->
															<div class="text-center pt-15">
																<button type="reset" class="btn btn-light me-3" data-kt-users-modal-action="cancel" data-bs-dismiss="modal" data-bs-dismiss="modal">Discard</button>
																<button type="submit" class="btn btn-primary" data-kt-users-modal-action="submit">
																	<span class="indicator-label">Submit</span>
																	<span class="indicator-progress">Please wait...
																	<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
																</button>
															</div>
															
															<!--end::Actions-->
														</form>
														<!--end::Form-->
													</div>
										<!--end::Modal body-->
							
									
		<!--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-->
		<script type="text/javascript">
		$(document).ready(function(){
			$("#kt_daterangepicker_1").daterangepicker({
        singleDatePicker: true,
        showDropdowns: true,
        minYear: 1901,
        maxYear: parseInt(moment().format("yyyy"),12),
		locale: {
        format: "DD-M-Y"
    }
    }
);
		});
		</script>
		<script type="text/javascript">
		$(document).ready(function(){
			$("#kt_daterangepicker_2").daterangepicker({
        singleDatePicker: true,
        showDropdowns: true,
        minYear: 1901,
        maxYear: parseInt(moment().format("yyyy"),12),
		locale: {
        format: "DD-M-Y"
    }
    }
);
		});
		</script>
		<script type="text/javascript">

$('#agentcountry').on('change',function(){
var agentcountry = $(this).val();

if(agentcountry){
$.ajax({
	
type:'POST',
url:'getstatedata1.php',
data:'countrymid='+agentcountry,
success:function(html){
$('#agentstate').html(html);
}
});
}else{
$('#agentstate').html('<option value="0">No Data Found</option>');
}
});

</script>

<script type="text/javascript">
$(document).ready(function(){
$('#agentstate').on('change',function(){
var agentstate = $(this).val();
//alert(agentstate);
if(agentstate){
$.ajax({
type:'POST',
url:'getcitydata1.php',
data:'statemid='+agentstate,
success:function(html){
$('#agentcity').html(html);
}
});
}else{
$('#agentcity').html('<option value="0">No Data Found</option>');
}
});
});
</script>

<script type="text/javascript">
$(document).ready(function(){
$('#agentcity').on('change',function(){
var agentcity = $(this).val();
//alert(agentcity);
if(agentcity){
$.ajax({
type:'POST',
url:'getareadata1.php',
data:'citymid='+agentcity,
success:function(html){
$('#agentarea').html(html);
}
});
}else{
$('#agentarea').html('<option value="0">No Data Found</option>');
}
});
});
</script>
<?php

if(isset($_SESSION['msg']))
{
	$tt = $_SESSION['msg'];
	echo "<input type=\"hidden\" id=\"mymsg\" value=\"$tt\"/>";
	unset($_SESSION['msg']);
	
	
?>	
								
		<script lang="javascript">

var a = [
    function () {
	

		var mymsg = document.getElementById("mymsg").value;
		toastr.success(mymsg, "Operation Completed")
		
    },
    function () {
        $('span').show();
    },
    function () {
        $('p').fadeIn(100);
    }
];		
					

a[0]();
</script>


		
	
<?php
}

if(isset($_SESSION['msg1']))
{
	$tt1 = $_SESSION['msg1'];
	echo "<input type=\"hidden\" id=\"mymsg1\" value=\"$tt1\"/>";
	unset($_SESSION['msg1']);
	
	
	?>	
								
		<script lang="javascript">

var a = [
    function () {
	

		var mymsg = document.getElementById("mymsg1").value;
		toastr.warning(mymsg, "Error")
		
    },
    function () {
        $('span').show();
    },
    function () {
        $('p').fadeIn(100);
    }
];		
					

a[0]();
</script>
	
<?php

}
?>		
		<!--end::Javascript-->
	</body>
	<!--end::Body-->
</html>