<?php  
session_start(); 
	include("connect.php");
	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
	
	if(isset($_POST['cnmid']))
	{
		  $_SESSION['cnmid']=$_POST['cnmid'];
		   $cnmid3=$_POST['cnmid'];
		 // echo "Hii";
	}
	
	if(isset($_POST['countrymid']))
	{
		  $_SESSION['countrymid']=$_POST['countrymid'];
		  $countrymid5 =$_POST['countrymid'];
	}
	
	if(isset($_POST['export']))
	{
	
	echo $selected_ids = $_POST['coursemid'];

// Connect to database and retrieve selected data
// ...

// Generate HTML table with only selected data
$html = '<table id="export1">';
$html .= '<thead>';
$html .= '<tr>';
$html .= '<th>Course Name</th>';
$html .= '<th>Credentials</th>';
$html .= '<th>College</th>';
$html .= '<th>Country</th>';
$html .= '<th>Duration</th>';
$html .= '<th>Fees</th>';
$html .= '<th>Eligibility</th>';
$html .= '<th>Facility</th>';
$html .= '<th>Documents</th>';
$html .= '<th>Remarks</th>';
$html .= '<th>Other</th>';

$html .= '</tr>';
$html .= '</thead>';
$html .= '<tbody>';


foreach ($selected_ids as $coursemids) {
	
	
	$empQuery = "select * from res_course_master,res_college_master where res_course_master.collegemid = res_college_master.collegemid and res_course_master.collegemid = res_college_master.collegemid and res_course_master.coursemid = $coursemids";
//$empQuery = "select * from res_inquiry_master WHERE 1 ";
$empRecords = mysqli_query($conn, $empQuery);
while ($rt = mysqli_fetch_assoc($empRecords)) {
	
	
	$coursemid=$rt['coursemid'];
				
				
				$collegemid=$rt['collegemid'];
				$losmid=$rt['levelofstudy'];
				$countrymid=$rt['countrymid'];
				$cnmid=$rt['cnmid'];
				
				$cmpbroucher=$rt['cmpbroucher'];
				$cmcoursebroucher=$rt['cmcoursebroucher'];
				$cmdesc=str_replace ("'","'",$rt['cmdesc']);
				$cmdesc=str_replace ('"','\"',$cmdesc);
				
				$cmduration=str_replace ("'","\'",$rt['cmduration']);
				$cmduration=str_replace ('"','\"',$cmduration);
				
				$cmfees=str_replace ("'","\'",$rt['cmfees']);
				$cmfees=str_replace ('"','\"',$cmfees);
				
				$cmdocument=str_replace ("'","\'",$rt['cmdocument']);
				$cmdocument=str_replace ('"','\"',$cmdocument);
				
				$cmeligibility=str_replace ("'","\'",$rt['cmeligibility']);
				$cmeligibility=str_replace ('"','\"',$cmeligibility);
				
				$cmfacility=str_replace ("'","\'",$rt['cmfacility']);
				$cmfacility=str_replace ('"','\"',$cmfacility);
				
				$cmremarks=str_replace ("'","\'",$rt['cmremarks']);
				$cmremarks=str_replace ('"','\"',$cmremarks);
				
				$cmother=str_replace ("'","\'",$rt['cmother']);
				$cmother=str_replace ('"','\"',$cmother);
				
				
					
						$cmname=$rt['cmname'];
						$cmpbroucher=$rt['cmpbroucher'];
						if($cmpbroucher==""){
							$cmpbroucher1="";
							}
						else{
						$cmpbroucher1="<a target='_blank' href='./docs/$cmpbroucher'>download</a>";
						}
						$cmcoursebroucher=$rt['cmcoursebroucher'];
						if($cmcoursebroucher==""){
							$cmcoursebroucher1="";
							}
						else{
						$cmcoursebroucher1="<a target='_blank' href='./docs/$cmcoursebroucher'>download</a>";
						}
						
						
					
					
					$countryname="";
					$eve5= "select * from   res_country_master where countrymid=$countrymid";
					$re5 = mysqli_query($conn, $eve5);
					 while($rt5 = mysqli_fetch_assoc($re5))
					{
			
						//$losmid=$rt4['losmid'];
						$countryname=$rt5['countryname'];
						
					}
					$coursename="";
					$eve55= "select * from   res_coursename_master where cnmid=$cnmid";
					$re55 = mysqli_query($conn, $eve55);
					 while($rt55 = mysqli_fetch_assoc($re55))
					{
			
						
						$coursename=$rt55['coursename'];
						
					}
					$levelofstudy="";
					$eve55= "select * from   res_levelofstudy_master where losmid=$losmid";
					$re55 = mysqli_query($conn, $eve55);
					 while($rt55 = mysqli_fetch_assoc($re55))
					{
			
						$losmid=$rt55['losmid'];
						$levelofstudy=$rt55['levelofstudy'];
						
					}
}
					
				
  $html .= '<tr>';
  $html .= '<td>' . $coursename . '</td>';
  $html .= '<td>' . $levelofstudy . '</td>';
  $html .= '<td>' . $cmname . '</td>';
  $html .= '<td>' . $countryname . '</td>';
  $html .= '<td>' . $cmduration . '</td>';
  $html .= '<td>' . $cmfees . '</td>';
  $html .= '<td>' . $cmeligibility . '</td>';
  $html .= '<td>' . $cmfacility . '</td>';
  $html .= '<td>' . $cmdocument . '</td>';
  $html .= '<td>' . $cmremarks . '</td>';
  $html .= '<td>' . $cmother . '</td>';
  $html .= '</tr>';
}

$html .= '</tbody>';
$html .= '</table>';

echo $html;
}
	?>
<!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>Course Finder</title>
		<meta charset="utf-8" />
		<meta name="description" content="The most advanced Bootstrap Admin Theme on Themeforest trusted by 100,000 beginners and professionals. Multi-demo, Dark Mode, RTL support and complete React, Angular, Vue, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel versions. Grab your copy now and get life-time updates for free." />
		<meta name="keywords" content="metronic, bootstrap, bootstrap 5, angular, VueJs, React, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel starter kits, admin themes, web design, figma, web development, free templates, free admin themes, bootstrap theme, bootstrap template, bootstrap dashboard, bootstrap dak mode, bootstrap button, bootstrap datepicker, bootstrap timepicker, fullcalendar, datatables, flaticon" />
		<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" />
		 <link href='DataTables/datatables.min.css' rel='stylesheet' type='text/css'>
		<!--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="../../demo4/dist/index.html" 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">Course Finder</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">Course Finder</li>
									</ul>
									<!--end::Breadcrumb-->
								</div>
								<!--end::Page title=-->
							</div>
							<!--begin::Wrapper-->
							<?php include('header.php'); ?>
							<!--end::Wrapper-->
						</div>
						<!--end::Container-->
					</div>
					<!--end::Header-->
					<!--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">
										<!--begin::Search-->
										<!--end::Search-->
									</div>
									<!--begin::Card title-->
									<!--begin::Card toolbar-->
									<form method="POST" action="leadcourse.php" >
									<div class="card-toolbar flex-row-fluid justify-content-end gap-5">
									
									<div class="input-group w-350px ">
										
														<label class="form-label fs-6 fw-semibold">Country:</label>
														<select class="form-select form-select-solid fw-bold" data-kt-select2="true" data-placeholder="Select option" data-allow-clear="true" data-kt-user-table-filter="role" data-hide-search="true" name="countrymid[]" multiple>
															<option value="All" <?php if(isset($_POST['countrymid']) && in_array("All",$_POST['countrymid'])){ echo 'selected';} ?>>All</option>
															<?php

													include("connect.php");
													$eve_category = "select * from res_country_master";
													$re_category = mysqli_query($conn, $eve_category);
																									
															while($rt_category = mysqli_fetch_assoc($re_category))
															{
																if(isset($_POST['countrymid']) && in_array($rt_category['countrymid'],$_POST['countrymid'])){
																echo "<option value='$rt_category[countrymid]' selected>$rt_category[countryname]</option>";
																}
																else{
																echo "<option value='$rt_category[countrymid]'>$rt_category[countryname]</option>";
																	}
															}		
														?>	
														</select>
													
										</div>
									<div class="input-group w-450px">
										
														<label class="form-label fs-6 fw-semibold">Course</label>
														<select class="form-select form-select-solid fw-bold" data-kt-select2="true" data-placeholder="Select option" data-allow-clear="true" data-kt-user-table-filter="two-step" data-hide-search="true" name="cnmid[]" multiple>
															<option value="All" <?php if(isset($_POST['cnmid']) && in_array("All",$_POST['cnmid'])){ echo 'selected';} ?>>All</option>
														<?php
 $eve_category1 = "select * from res_coursename_master";
													$re_category1 = mysqli_query($conn, $eve_category1);														
															while($rt_category1 = mysqli_fetch_assoc($re_category1))
															{
																if(isset($_POST['cnmid']) && in_array($rt_category1['cnmid'],$_POST['cnmid'])){
																echo "<option value='$rt_category1[cnmid]' selected>$rt_category1[coursename]</option>";
																}
																else{
																echo "<option value='$rt_category1[cnmid]'>$rt_category1[coursename]</option>";
																	}
															}		
														?>
														</select>
													
										</div>
										<div class="justify-content-end align-items-center ">
										<button type="submit" name="submit" class="btn btn-light-primary me-3">
                                                   Filter
												
												</button>
                                                   
                                                </div>
										
										</div>
										</form>
									<!--end::Card toolbar-->
								</div>
								<!--end::Card header-->
								<!--begin::Card body-->
									<form id="kt_modal_export_users_form1" class="form" method="POST" action="leadcourseallocation.php">
										<div class=" card-toolbar justify-content-end align-items-center gap-5 pt-10 ps-10">
										<button type="submit" name="export" class="btn btn-light-primary me-5 pe-10">
                                                 Export 
												
												</button>
												
												<!--begin::Filter-->
											<button type="button" class="btn btn-light-primary me-3" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end">
											<!--begin::Svg Icon | path: icons/duotune/general/gen031.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="M19.0759 3H4.72777C3.95892 3 3.47768 3.83148 3.86067 4.49814L8.56967 12.6949C9.17923 13.7559 9.5 14.9582 9.5 16.1819V19.5072C9.5 20.2189 10.2223 20.7028 10.8805 20.432L13.8805 19.1977C14.2553 19.0435 14.5 18.6783 14.5 18.273V13.8372C14.5 12.8089 14.8171 11.8056 15.408 10.964L19.8943 4.57465C20.3596 3.912 19.8856 3 19.0759 3Z" fill="currentColor" />
												</svg>
											</span>
											<!--end::Svg Icon-->Shortlist</button>
											<!--begin::Menu 1-->
											<div class="menu menu-sub menu-sub-dropdown w-300px w-md-325px" data-kt-menu="true">
												<!--begin::Header-->
												<div class="px-7 py-5">
													<div class="fs-5 text-dark fw-bold">Shortlist to Lead</div>
												</div>
												<!--end::Header-->
												<!--begin::Separator-->
												<div class="separator border-gray-200"></div>
												<!--end::Separator-->
												<!--begin::Content-->
												<?php
													include("connect.php");
													$eve_category = "select * from res_branch_master";
													$re_category = mysqli_query($conn, $eve_category);
												?>
												
												<div class="px-7 py-5" data-kt-user-table-filter="form">
												<?php
															if($_SESSION['utype']=="admin")
															{
															?>
													<!--begin::Input group-->
													<div class="mb-10">
														<label class="form-label fs-6 fw-semibold">Branch:</label>
														<select class="form-select form-select-solid fw-bold" data-kt-select2="true" data-placeholder="Select option" data-allow-clear="true" data-kt-user-table-filter="role"  name="branchmid" id="branchmid">
															<option value="0">Select</option>
															<?php		
															while($rt_category = mysqli_fetch_assoc($re_category))
															{
																
																echo "<option value='$rt_category[branchmid]'>$rt_category[branchname]</option>";
																	
															}		
														?>	
														</select>
													</div>
													<!--end::Input group-->
													<?php }else{?>
													<input type="hidden" name="branchmid" id="branchmid" value="<?php echo $_SESSION['branchid']; ?>">
													<?php }?>
													<?php
													
													 $eve_category1 = "select * from res_inquiry_master";
													$re_category1 = mysqli_query($conn, $eve_category1);
												?>
													<!--begin::Input group-->
													<div class="mb-10">
														<label class="form-label fs-6 fw-semibold">Lead</label>
														<select class="form-select form-select-solid fw-bold" data-kt-select2="true" data-placeholder="Select option" data-allow-clear="true" data-kt-user-table-filter="two-step"  name="imid" id="imid">
															<option value="0">Select</option>
														<?php		
															while($rt_category1 = mysqli_fetch_assoc($re_category1))
															{
																
																echo "<option value='$rt_category1[imid]'>$rt_category1[ipname] $rt_category1[ipmiddlename] $rt_category1[ipsurname] </option>";
																	
															}		
														?>
														</select>
													</div>
													<!--end::Input group-->
													<!--begin::Input group-->
													<div class="mb-10">
														<label class="form-label fs-6 fw-semibold">Inquiry</label>
														<select class="form-select form-select-solid fw-bold" data-kt-select2="true" data-placeholder="Select option" data-allow-clear="true" data-kt-user-table-filter="two-step" data-hide-search="true" name="stiqmid" id="stiqmid">
															<option value="0">Select Lead</option>
														<?php		
															while($rt_category1 = mysqli_fetch_assoc($re_category1))
															{
																
																echo "<option value='$rt_category1[imid]'>$rt_category1[ipname] $rt_category1[ipmiddlename] $rt_category1[ipsurname] </option>";
																	
															}		
														?>
														</select>
													</div>
													<!--end::Input group-->
													<!--begin::Actions-->
													<div class="d-flex justify-content-end">
														<button type="reset" class="btn btn-light btn-active-light-primary fw-semibold me-2 px-6" data-kt-menu-dismiss="true" data-kt-user-table-filter="reset">Reset</button>
														<button type="submit" class="btn btn-primary fw-semibold px-6" data-kt-menu-dismiss="true" data-kt-user-table-filter="filter">Apply</button>
													</div>
													<!--end::Actions-->
												</div>
												
												<!--end::Content-->
											</div>
											<!--end::Menu 1-->
											<!--end::Filter-->
											
                                                   
                                                </div>
								<div class="card-body py-4">
									<!--begin::Table-->
									<table class="table align-middle table-row-dashed fs-6 gy-5" id="empTable">
									<thead>
											<!--begin::Table row-->
											<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
												 <th class="w-10px pe-2">
													<div class="form-check form-check-sm form-check-custom form-check-solid me-3">
														<input class="form-check-input" type="checkbox" data-kt-check="true" data-kt-check-target="#empTable .form-check-input" value="1" />
													</div>
												</th>
												 <th>SrNo</th>
												  <?php
							if(($_SESSION['utype']=='admin') || ($_SESSION['utype']=='branchmanager'))
							{
			?>
												
												 <?php
							}
							?>
												<th>Course Name</th>
												<th>Credentials</th>
												
												<th>College</th>
												<th>Country</th>
												<th>Duration</th>
												<th>Fees</th>
												<th>Eligibility</th>
												<th>Facility</th>
												<th>Documents</th>
												<th>Remarks</th>
												<th>Other</th>
												<th>Broucher</th>
												<th>Course Broucher</th>
												
												
											</tr>
											<!--end::Table row-->
										</thead>
										<!--end::Table head-->
										<!--begin::Table body-->
										<tbody class="text-gray-600 fw-semibold">
										
											
											
										</tbody>
										</table><!--end::Table-->
								</div>
								</form>
								<!--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::Scrolltop-->
		<div id="kt_scrolltop" class="scrolltop" data-kt-scrolltop="true">
			<!--begin::Svg Icon | path: icons/duotune/arrows/arr066.svg-->
			<span class="svg-icon">
				<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
					<rect opacity="0.5" x="13" y="6" width="13" height="2" rx="1" transform="rotate(90 13 6)" fill="currentColor" />
					<path d="M12.5657 8.56569L16.75 12.75C17.1642 13.1642 17.8358 13.1642 18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25L12.7071 5.70711C12.3166 5.31658 11.6834 5.31658 11.2929 5.70711L5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75C6.16421 13.1642 6.83579 13.1642 7.25 12.75L11.4343 8.56569C11.7467 8.25327 12.2533 8.25327 12.5657 8.56569Z" fill="currentColor" />
				</svg>
			</span>
			<!--end::Svg Icon-->
		</div>
		<!--end::Scrolltop-->
		<!--begin::Modals-->
		<!--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/custom/apps/user-management/users/list/table.js"></script>
		<script src="assets/js/custom/apps/user-management/users/list/export-users.js"></script>
		<script src="assets/js/custom/apps/user-management/users/list/add.js"></script>
		<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>
		<script type="text/javascript" src="myjs/64/jquery.base64.js"/></script>
		<script type="text/javascript" src="myjs/tableexport.js"/></script>
		<script type="text/javascript" src="js/notification.js"/></script>
		<!--end::Custom Javascript-->
		<!-- Datatable JS -->
        <script src="DataTables/datatables.min.js"></script>
		<script>
$(document).ready(function() {
   $('#empTable').DataTable({
                'processing': true,
                'serverSide': true,
				'searchable': true,
				 'orderable': false,
				
                'serverMethod': 'post',
                'ajax': {
                    'url':'leadcourseajax.php'
                },
                'columns': [
				 { "data": "coursemid" },
    	   { "data": "coursemid1" },
		   <?php
							if(($_SESSION['utype']=='admin') || ($_SESSION['utype']=='branchmanager'))
							{
			?>
		  // { "data": "op"},
							<?php
							}
							?>
		   { "data": "cnmid" },
		    { "data": "levelofstudy" },
		  
		   { "data": "collegemid" },
		  
		   { "data": "countrymid" },
		   { "data": "cmduration" },		   
		   { "data": "cmfees" },		   
		   { "data": "cmeligibility" },		   
		   { "data": "cmfacility" },		   
		   { "data": "cmdocument"},		   
		   { "data": "cmremarks" },		   
		   { "data": "cmother" },		   
		   { "data": "cmpbroucher" },		   
		   { "data": "cmcoursebroucher"},		   
		   //{ "data": "cemail","title":"Send Email" }		   
		   
		   
		   
		   
			
        ],
      'columnDefs': [{
         'targets': 0,
         'searchable': false,
         'orderable': false,
         'className': 'dt-body-center',
         'render': function (data, type, full, meta){
             return '<div class="form-check form-check-sm form-check-custom form-check-solid me-3"><input type="checkbox" class="form-check-input" name="coursemid[]" value="' + $('<div/>').text(data).html() + '"></div>';
         }
      }],
     
		
		
		
    } );
} );
</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

}
?>
<script type="text/javascript">
			$(document).ready(function(){
				$('#branchmid').on('change',function(){
					var branchmid = $(this).val();
					
					if(branchmid){
						//alert(branchmid);
						$.ajax({
							type:'POST',
							url:'branchlead.php',
							data:'branchmid='+branchmid,
							success:function(html){
								$('#imid').html(html);
							}
						});
					}else{
						$('#imid').html('<option value=""></option>');
					}
				});
			});
	</script>
	<script type="text/javascript">
			$(document).ready(function(){
				
					var branchmid = $('#branchmid').val();
					
					if(branchmid){
						//alert(branchmid);
						$.ajax({
							type:'POST',
							url:'branchlead.php',
							data:'branchmid='+branchmid,
							success:function(html){
								$('#imid').html(html);
							}
						});
					}else{
						$('#imid').html('<option value=""></option>');
					}
				
			});
	</script>
	<script type="text/javascript">
			$(document).ready(function(){
				$('#imid').on('change',function(){
					var imid = $(this).val();
					
					if(imid){
						//alert(branchmid);
						$.ajax({
							type:'POST',
							url:'leadinquiry.php',
							data:'imid='+imid,
							success:function(html){
								$('#stiqmid').html(html);
							}
						});
					}else{
						$('#stiqmid').html('<option value=""></option>');
					}
				});
			});
	</script>
	<script type="text/javascript">
			$(document).ready(function(){
				
					var imid = $('#imid').val();
					
					if(imid){
						//alert(branchmid);
						$.ajax({
							type:'POST',
							url:'leadinquiry.php',
							data:'imid='+imid,
							success:function(html){
								$('#stiqmid').html(html);
							}
						});
					}else{
						$('#stiqmid').html('<option value=""></option>');
					}
				
			});
	</script>
	
		
		<!--end::Javascript-->
	</body>
	<!--end::Body-->
</html>