<?php 
session_start(); 
if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
include("connect.php");
include("mylibrary.php");
$_SESSION['frompage']='aplicationInquirydetailpage';
?>
<!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>Inquiry 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">Student 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">Coaching Managemnet</li>
										
										<li class="breadcrumb-item text-muted">Student 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
					
	
	
	
	date_default_timezone_set("Asia/Kolkata");
		$mdate1= date('Y-m-d H:i:s');
		$mdate= date('d-m-Y');
	$stiqmid=$_GET['id'];
	$eve = "select * from res_inquiry_master,res_studentinquiry_detail where res_inquiry_master.imid = res_studentinquiry_detail.imid and res_studentinquiry_detail.stiqmid=".$_GET['id'];
			$re = mysqli_query($conn, $eve);
			while($rt = mysqli_fetch_assoc($re))
			{
				
				$imid=$rt['imid'];
				$ipname=$rt['ipname'];
				$ipmiddlename=$rt['ipmiddlename'];
				$ipsurname=$rt['ipsurname'];
				$name=$ipname." ".$ipmiddlename." ".$ipsurname;
				$ipaddress=$rt['ipaddress'];
				$ipostcode=$rt['ipostcode'];
				$ipemail=$rt['ipemail'];
				$ipmobile=$rt['ipmobile'];
				$ihomemobile=$rt['ihomemobile'];
				$ipgender=$rt['ipgender'];
				//$ipdob=$rt['ipdob'];
				$idate=$rt['idate'];
				$ipbirthcountry=$rt['ipbirthcountry'];
				$ibirthstate=$rt['ibirthstate'];
				$ipbirthcity=$rt['ipbirthcity'];
				$address = $ipaddress.",".$ipbirthcity."-".$ipostcode.",".$ibirthstate.",".$ipbirthcountry;
				$imremarks=$rt['imremarks'];
				$imdetails=$rt['imdetails'];
				$imstatus=$rt['imstatus'];
				$registeredamount=$rt['registeredamount'];
				$entrybyuserid=$rt['entrybyuserid'];
				$visatmid=$rt['visatmid'];
				$ivisadate=$rt['ivisadate'];
				$ivisano=$rt['ivisano'];
				$ivisatraveldate=$rt['ivisatraveldate'];
				$ipdob=$rt['ipdob'];
				$ipmarritalstatus=$rt['ipmarritalstatus'];
				$ipstatus=$rt['ipstatus'];
				$sourceofinq=$rt['sourceofinq'];
				$ipoffer=$rt['ipoffer'];
				$referencename=$rt['referencename'];
				$agentid=$rt['agentid'];
				$branchmid=$rt['inqbranch'];
				
				//$inquirypurpose=$rt['inquirypurpose'];
				$siprefferedcountry=$rt['siprefferedcountry'];
				
				//$inquirypurpose1="<button data-toggle='modal' data-target='#view-modal' data-id='$imid' id='getUser' class='btn btn-xs btn-warning'>$inquirypurpose</button>";
				
				if($ivisadate=='0000-00-00')
				{
					$ivisadate="";
				}
				else
				{
					$ivisadate=date("d-m-Y",strtotime($rt['ivisadate']));
				}
				
				if($ipdob=='0000-00-00')
				{
					$ipdob="";
				}
				else
				{
					$ipdob=date("d-m-Y",strtotime($rt['ipdob']));
				}	
				
				if($ivisatraveldate=='0000-00-00')
				{
					$ivisatraveldate="";
				}
				else
				{
					$ivisatraveldate=date("d-m-Y",strtotime($rt['ivisatraveldate']));
				}
				
				$ivisaticket=$rt['ivisaticket'];
				$ivisacontactfrom=urldecode($rt['ivisacontactfrom']);
				$ivisaaddress=urldecode($rt['ivisaaddress']);
				$ivisaremarks=urldecode($rt['ivisaremarks']);
				$ivisadetail=urldecode($rt['ivisadetail']);
				$visaedit="<a data-toggle='modal' href='#responsive11' title='Edit' class='fa fa-edit fa-lg' >  </a>";
				
				$eveag = "select * from res_user_master where umid=$entrybyuserid";
				$reag = mysqli_query($conn, $eveag);
				if(mysqli_num_rows($reag) > 0)
				{
					while($rtag = mysqli_fetch_assoc($reag))
					{
						$entrybyuserid=$rtag['ufullname'];
					}
				}
				else
				{
					$entrybyuserid="";
				}
				
				
				if($agentid == 0)
				{
					$agentname="Direct";
				}else{
				$eveag = "select * from res_user_master where umid=$agentid";
				$reag = mysqli_query($conn, $eveag);
				if(mysqli_num_rows($reag) > 0)
				{
					while($rtag = mysqli_fetch_assoc($reag))
					{
						$agentname=$rtag['ufullname'];
					}
				}
				else
				{
					$agentname="";
				}
				}
				
				$eveag1 = "select * from res_country_master where countrymid=$siprefferedcountry";
				$reag1 = mysqli_query($conn, $eveag1);
				if(mysqli_num_rows($reag1) > 0)
				{
					while($rtag1 = mysqli_fetch_assoc($reag1))
					{
						$countryname=$rtag1['countryname'];
					}
				}
				else
				{
					$countryname="";
				}
			
				$eve2 = "select * from res_visatype_master where visatmid='$visatmid'";
				$re2 = mysqli_query($conn, $eve2);
				$visatype="";
				while($rt2 = mysqli_fetch_assoc($re2))
				{
					$visatype=$rt2['visatype'];
				}
			
			$eve3 = "select * from  res_payment_master where imid='$imid'";
			$re3 = mysqli_query($conn, $eve3);
			$receivedamount=0;
			while($rt3 = mysqli_fetch_assoc($re3))
			{
				$receivedamount=$rt3['receivedamount'];
			}
			//$receivedamount1=$registeredamount - $receivedamount;
			
			$eve31 = "select sum(paytotalamount) as cc,sum(payrecivedamt) as cc1,sum(paypendingamt) as cc2 from  res_payments_master where imid='$imid'";
			$re31 = mysqli_query($conn, $eve31);
			$totalamt=0;
			$totalreceivedamt=0;
			$totalpendingamt=0;
			while($rt31 = mysqli_fetch_assoc($re31))
			{
				$totalamt=$rt31['cc'];
				$totalreceivedamt=$rt31['cc1'];
				$totalpendingamt=$rt31['cc2'];
			}
			
			$siprefferservice=$rt['siprefferservice'];
																$siprefferedsubservice=$rt['siprefferedsubservice'];
																			$subservicename ="";
																			 $eves = "select * from res_subservice_master where subservicemid = $siprefferedsubservice ";
																			$res = mysqli_query($conn, $eves);
																			
																			while($rts = mysqli_fetch_assoc($res))

																			{
																				$subservicename = $rts['subservicename'];
																			}
			}
			 $full_url = $_SERVER['REQUEST_URI'];

$hash_position = strpos($full_url, "#");

if (isset($_GET['tab'])) {
    $hash_value = $_GET['tab'];
   
} else {
   $hash_value = 'student_detail';
}
	
?>
					<!--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">
								<!--begin::Tab content-->
								<div class="tab-content">
									<!--begin::Tab pane-->
									<div class="tab-pane fade <?php if($hash_value == 'student_detail'){ echo 'show active'; }?>" id="student_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">
													
											<!--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"> Name
                  </th>
                  <td calspnad="3">
                    <?php echo $name;?>
                  </td>
                 
                </tr>
				 <tr>
				 <th class="fw-bold">Gender
                  </th>
                  <td >
                    <?php echo $ipgender;?>
                  </td>
                  <th class="fw-bold">Email
                  </th>
                  <td >
                    <?php echo $ipemail;?>
                  </td>								
                 
                </tr>
				<tr>
                  
                  <th class="fw-bold">Mobile Number
                  </th>
                  <td>
                    <?php echo $ipmobile;?>
                  </td>
				  <th class="fw-bold"> Alternative Contact Number
                  </th>
                  <td>
                    <?php echo $ihomemobile;?>
                  </td>
                </tr>	
               
                <tr>
				
                 <th class="fw-bold">Birth Date
                  </th>
                  <td>
                    <?php echo $ipdob;?>
                  </td>
				
                  <th class="fw-bold">Marrital Status
                  </th>
                  <td >
                    <?php echo $ipmarritalstatus;?>
                  </td>
				   
                </tr>
                <tr >
                  <th class="fw-bold">Address
                  </th>
                  <td colspan="2">
                    <?php echo $ipaddress;?>
                  </td>
                  
                </tr> 
				
				<tr >
                  <th class="fw-bold">City
                  </th>
                  <td >
                    <?php echo $ipbirthcity;?>
                  </td>
				  <th class="fw-bold">Postcode
                  </th>
                  <td >
                    <?php echo $ipostcode;?>
                  </td>
                  
                </tr>
				<tr >
                  <th class="fw-bold">State
                  </th>
                  <td >
                    <?php echo $ibirthstate;?>
                  </td>
				  <th class="fw-bold">Country
                  </th>
                  <td >
                    <?php echo $ipbirthcountry;?>
                  </td>
                  
                </tr>
				
               <!-- <tr>
                  <th class="fw-bold">Remark
                  </th>
                  <td colspan="2">
                    <?php echo $imremarks;?>
                  </td>
                 
                </tr>-->
                <tr >
				 <th class="fw-bold">Heard About Us
                  </th>
                  <td >
                    <?php echo $sourceofinq;?>
                  </td>
                 
                 
                </tr>
				
				<tr >
				 <th class="fw-bold">Agent
                  </th>
                  <td >
                    <?php echo $agentname;?>
                  </td>
                  <th class="fw-bold">Reference by 
                  </th>
                  <td >
                    <?php echo $referencename;?>
                  </td>
                 
                </tr>
               <tr >
				 <th class="fw-bold">Preferred Country
                  </th>
                  <td >
                    <?php echo $countryname;?>
                  </td>
                  <th class="fw-bold">Preferred Service 
                  </th>
                  <td >
                    <?php echo $siprefferservice;?>
                  </td>
                 
                </tr>
               <tr >
				 <th class="fw-bold">Preferred Sub Service
                  </th>
                  <td >
                    <?php echo $subservicename;?>
                 
               
				
               
              </table>
			  </div>
			  </div>
           
													<!--end::Card header-->
													<!--begin::Card body-->
													
													<!--end::Card body-->
												</div>
												<!--end::Payment address-->
												</div>
													<!--begin::Payment-->
													
											<!--begin::Medical Appointment-->
											<div class="card card-flush py-4 flex-row-fluid">
												<!--begin::Card header-->
												<div class="card-header">
													<div class="card-title text-uppercase">
														<h2>Book Set </h2>
													</div>
													<!--begin::Add user-->
													
											<a href="#" data-bs-toggle="modal" data-bs-target="#student_add_bookset" class="btn btn-sm btn-primary align-self-center"><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 </a>
										
											<!--end::Add user-->
												</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>Sr No.
                            </th>
                            <th>BookSet 
                            </th>
							
                           
							<th class="min-w-100px">Addedby</th>
<th class="min-w-100px">Addedon</th>
<th class="min-w-100px">Operation</th>
							
																	
																	
																</tr>
															</thead>
															<!--end::Table head-->
															<!--begin::Table body-->
															<tbody class="fw-semibold text-gray-600">
															<?php
															$i=1;
															$tt1=0;
															$evepay = "select * from res_booksettostudent_detail where stiqmid=".$_GET['id'];
															$repay = mysqli_query($conn, $evepay);
															$i=1;
															while($rtpay = mysqli_fetch_assoc($repay))
															{
															$bssdid=$rtpay['bssdid'];
															$booksetmid=$rtpay['booksetmid'];
															$bverify=$rtpay['bverify'];
				
				$booksetname = '';
				
				$eve2 = "select * from res_bookset_master where booksetmid ='$booksetmid'";
				
				$re2 = mysqli_query($conn, $eve2);
				
				if(mysqli_num_rows($re2) > 0)
				{
					
					while($rt2 = mysqli_fetch_assoc($re2))
					{
							$booksetname=$rt2['booksetname'];
					}
				}
				
				
				
								/* $stiqmid=$rtpay['stiqmid'];
								$siprefferservice='';
									$inquirydate='';
									$eve78 = "select siprefferservice,inquirydate from res_studentinquiry_detail where imid=$imid and stiqmid=$stiqmid";
									$re78 = mysqli_query($conn, $eve78);
									if(mysqli_num_rows($re78) > 0)
									{
										while($rt78 = mysqli_fetch_assoc($re78))
										{
											$siprefferservice=$rt78['siprefferservice'];
											$inquirydate=date("d-m-Y",strtotime($rt78['inquirydate']));
										}
									}
								 */
								
								
								
									
								
								
								$capaddedon='';	
														$capaddedon=date("d-m-Y",strtotime($rtpay['bssaddedon']));
													
														$capaddedby=$rtpay['bssaddedby'];

														$ufullname='';
														$utype='';
														$evea1 = "select ufullname,utype from res_user_master where umid=$capaddedby";
														$rea1 = mysqli_query($conn, $evea1);
														if(mysqli_num_rows($rea1) > 0)
														{
														while($rta1 = mysqli_fetch_assoc($rea1))
														{
															$ufullname=$rta1['ufullname'];
															$utype=$rta1['utype'];
														}
														}
														
														$adelete = "<a href='studentbooksetdelete.php?id=$bssdid&stiqmid=$stiqmid'  class='far fa-trash-alt fa-lg'>  </a>";
														if($bverify == 0)
														{
														$averify = "<a  href='booksetverification.php?id=$bssdid&p2=$stiqmid'  data-toggle='tooltip' data-placement='top' title='Verify' class='btn btn-sm btn-primary'> Verify</a>";
														}else{
															$averify = '';
														}
														
															?>
																<tr>
																	
																	 <td>
                              <?php echo $i++;?>
                            </td>
							<td><?php echo $booksetname; ?></td>
																	
                            
							
                          
                           
							<td><?php echo $ufullname." (".$utype.")"; ?></td>
<td><?php echo $capaddedon; ?></td>
<td><a  href="documentverification.php?id=<?php echo $rt1['iddid']; ?>&p2=<?php echo $_GET['id'];?>"  data-toggle='tooltip' data-placement='top' title='Verify' class='btn btn-sm btn-primary'> Verify
                              </a>
<?php echo $adelete; ?></td>
							
																	
																</tr>
															<?php } ?>
																</tbody>
															<!--end::Table head-->
														</table>
														<!--end::Table-->
													</div>
												</div>
												<!--end::Card body-->
											</div>
											<div class="card card-flush py-4 flex-row-fluid">
												<!--begin::Card header-->
												<div class="card-header">
													<div class="card-title text-uppercase">
														<h2>Book Issue</h2>
													</div>
													<!--begin::Add user-->
											
												
											<a href="#" data-bs-toggle="modal" data-bs-target="#student_add_book_issue" class="btn btn-sm btn-primary align-self-center"><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 </a>
										
											<!--end::Add user-->
												</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>Sr No.
                            </th>
                            <th>Book
                            </th>
							<th class="min-w-100px">Issue Date</th>
							<th class="min-w-100px">Return Date</th>
							<th class="min-w-100px">Book Status</th>
							<th class="min-w-100px">Action</th>
							
                           
							<th class="min-w-100px">Addedby</th>

							 
																	
																	
																</tr>
															</thead>
															<!--end::Table head-->
															<!--begin::Table body-->
															<tbody class="fw-semibold text-gray-600">
															<?php
															$i=1;
															$tt1=0;
															$evepay = "select * from res_bookissue_detail where stiqmid=".$_GET['id'];
															$repay = mysqli_query($conn, $evepay);
															$i=1;
															while($rtpay = mysqli_fetch_assoc($repay))
															{
															$bidid=$rtpay['bidid'];
															$ibstatus=$rtpay['ibstatus'];
															
								$bookmid=$rtpay['bookmid'];
								$ibexpreturndate=date("d-m-Y",strtotime($rtpay['ibexpreturndate']));
								$bookname='';
									$inquirydate='';
									
								
								if($rtpay['ibexpreturndate'] != NULL)
				{
				$ibexpreturndate=date("d-m-Y",strtotime($rtpay['ibexpreturndate']));
				}else{
					$ibexpreturndate='';
				}
				
				$renewal="<a href='#' data-bs-toggle='modal' data-id='".$bidid."' data-bs-target='#view-modal1' class='btn btn-sm btn-primary align-self-center' id='getUser1'>Renewal</a>";
				
				$return="<a href='returnbook.php?id=$bidid' class='btn btn-xs btn-inline btn-success'>Return </a>";
				$lost="<a href='lostbook.php?id=$bidid' onclick='return confirm(&#39;You have to pay $bookprice rupees, are you sure ?&#39;);' data-toggle='tooltip' data-placement='top' class='btn btn-xs btn-inline btn-danger'>Lost </a>";
				$action='';
				if($ibstatus == 'Issued' || $ibstatus== 'Renewed')
				{
				$action = $renewal."&nbsp;&nbsp;".$return."&nbsp;&nbsp;".$lost;
				}
								
								
									
								
								
								$capaddedon='';	
														$capaddedon=date("d-m-Y",strtotime($rtpay['bidate']));
														
														$biaddedby=$rtpay['biaddedby'];

														$ufullname='';
														$utype='';
														$evea1 = "select ufullname,utype from res_user_master where umid=$biaddedby";
														$rea1 = mysqli_query($conn, $evea1);
														if(mysqli_num_rows($rea1) > 0)
														{
														while($rta1 = mysqli_fetch_assoc($rea1))
														{
															$ufullname=$rta1['ufullname'];
															$utype=$rta1['utype'];
														}
														}
															?>
																<tr>
																	
																	 <td>
                              <?php echo $i++;?>
                            </td>
							<td><?php echo $bookname; ?></td>
							<td><?php echo $capaddedon; ?></td>
							<td><?php echo $ibexpreturndate; ?></td>
							<td><?php echo $ibstatus; ?></td>
							<td><?php echo $action; ?></td>
																	
                            
							
                          
                           
							<td><?php echo $ufullname." (".$utype.")"; ?></td>

							
																	
																</tr>
															<?php } ?>
																</tbody>
															<!--end::Table head-->
														</table>
														<!--end::Table-->
													</div>
												</div>
												<!--end::Card body-->
											</div>
											<div class="card card-flush py-4 flex-row-fluid">
												<!--begin::Card header-->
												<div class="card-header">
													<div class="card-title text-uppercase">
														<h2>Batch Allocation</h2>
													</div>
													<!--begin::Add user-->
											
												
											<a href="#" data-bs-toggle="modal" data-bs-target="#student_add_batch" class="btn btn-sm btn-primary align-self-center"><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 </a>
										
											<!--end::Add user-->
												</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>Sr No.
                            </th>
                            <th>Batch
                            </th>
							<th>Start Date
                            </th>
							
							<th>End Date
                            </th>
							<th>Timing
                            </th>
							<th>Staff
                            </th>
							
							
                           
							<th class="min-w-100px">Addedby</th>
<th class="min-w-100px">Issue Date</th>
<th class="min-w-100px">Operation</th>
							 
																	
																	
																</tr>
															</thead>
															<!--end::Table head-->
															<!--begin::Table body-->
															<tbody class="fw-semibold text-gray-600">
															<?php
															$i=1;
															$tt1=0;
															$evepay = "select * from res_batchallocation_detail,res_batch_master where res_batchallocation_detail.batchmid= res_batch_master.batchmid and res_batchallocation_detail.stiqmid=".$_GET['id'];
															$repay = mysqli_query($conn, $evepay);
															$i=1;
															while($rt1 = mysqli_fetch_assoc($repay))
															{
															$badid= $rt1['badid'];
															$batchname=checkvalidstring ($rt1['batchname']);
				$batchtiming=checkvalidstring ($rt1['batchtiming']);
				$batchstartdate=date("d-m-Y",strtotime($rt1['batchstartdate']));
				$batchenddate=date("d-m-Y",strtotime($rt1['batchenddate']));
				
	
	
				$umid=$rt1['umid'];
				
				$ufullname='';
				
				$eve2 = "select * from res_user_master where umid ='$umid'";
				
				$re2 = mysqli_query($conn, $eve2);
				
				if(mysqli_num_rows($re2) > 0)
				{
					
					while($rt2 = mysqli_fetch_assoc($re2))
					{
							$ufullname1=$rt2['ufullname'];
					}
				}
						$capaddedon='';	
														$capaddedon=date("d-m-Y",strtotime($rt1['baaddedon']));
														
														$biaddedby=$rt1['baaddedby'];

														$ufullname='';
														$utype='';
														$evea1 = "select ufullname,utype from res_user_master where umid=$biaddedby";
														$rea1 = mysqli_query($conn, $evea1);
														if(mysqli_num_rows($rea1) > 0)
														{
														while($rta1 = mysqli_fetch_assoc($rea1))
														{
															$ufullname=$rta1['ufullname'];
															$utype=$rta1['utype'];
														}
														}
														
														$adelete = "<a href='studentbatchdelete.php?id=$badid&stiqmid=$stiqmid'  class='far fa-trash-alt fa-lg'>  </a>";
														
															
															?>
																<tr>
																	
																	 <td>
                              <?php echo $i++;?>
                            </td>
							<td><?php echo $batchname; ?></td>
							<td><?php echo $batchstartdate; ?></td>
							<td><?php echo $batchenddate; ?></td>
							<td><?php echo $batchtiming; ?></td>
							<td><?php echo $ufullname1; ?></td>
																	
                            
							
                          
                           
							<td><?php echo $ufullname." (".$utype.")"; ?></td>
<td><?php echo $capaddedon; ?></td>
<td><?php echo $adelete; ?></td>
							
																	
																</tr>
															<?php } ?>
																</tbody>
															<!--end::Table head-->
														</table>
														<!--end::Table-->
													</div>
												</div>
												<!--end::Card body-->
											</div>
											<div class="card card-flush py-4 flex-row-fluid">
												<!--begin::Card header-->
												<div class="card-header">
													<div class="card-title text-uppercase">
														<h2>Book Test</h2>
													</div>
													<!--begin::Add user-->
											
												
											<a href="#" data-bs-toggle="modal" data-bs-target="#student_add_test" class="btn btn-sm btn-primary align-self-center"><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 </a>
										
											<!--end::Add user-->
												</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>Sr No.
                            </th>
                            <th>Test
                            </th>
							<th>Test Date
                            </th>
							
							<th>Test Center
                            </th>
							<th>Booking reference Number
                            </th>
							<th>Test Score
                            </th>
							
							
							
                           
							<th class="min-w-100px">Addedby</th>
<th class="min-w-100px">Added On</th>
<th class="min-w-100px">Delete</th>

							 
																	
																	
																</tr>
															</thead>
															<!--end::Table head-->
															<!--begin::Table body-->
															<tbody class="fw-semibold text-gray-600">
															<?php
															$i=1;
															$tt1=0;
															$evepay = "select * from res_testallocation_detail,res_test_master where res_testallocation_detail.testmid= res_test_master.testmid and res_testallocation_detail.stiqmid=".$_GET['id'];
															$repay = mysqli_query($conn, $evepay);
															$i=1;
															while($rt1 = mysqli_fetch_assoc($repay))
															{
															$tadid= $rt1['tadid'];
															$testname=checkvalidstring ($rt1['testname']);
				$testscore=$rt1['testscore'];
				$testcenter=checkvalidstring ($rt1['testcenter']);
				$tbookingrefnumber=checkvalidstring ($rt1['tbookingrefnumber']);
				$testdatetime=date("d-m-Y H:i",strtotime($rt1['testdatetime']));
				
					$capaddedon='';	
														$capaddedon=date("d-m-Y",strtotime($rt1['taddedon']));
														
														$biaddedby=$rt1['taddedby'];
														
														if($testscore == 0)
														{
															$testscore1 ="<a href='#' data-bs-toggle='modal' data-id='".$tadid."' data-bs-target='#view-modal2' class='btn btn-sm btn-primary align-self-center' id='getUser2'>Update Score</a>";
															
														}else{
															$testscore1 = $testscore;
														}

														$ufullname='';
														$utype='';
														$evea1 = "select ufullname,utype from res_user_master where umid=$biaddedby";
														$rea1 = mysqli_query($conn, $evea1);
														if(mysqli_num_rows($rea1) > 0)
														{
														while($rta1 = mysqli_fetch_assoc($rea1))
														{
															$ufullname=$rta1['ufullname'];
															$utype=$rta1['utype'];
														}
														}
														$adelete = "<a href='studenttestdelete.php?id=$tadid&stiqmid=$stiqmid'  class='far fa-trash-alt fa-lg'>  </a>";
														
														
															
															?>
																<tr>
																	
																	 <td>
                              <?php echo $i++;?>
                            </td>
							<td><?php echo $testname; ?></td>
							<td><?php echo $testdatetime; ?></td>
							<td><?php echo $testcenter; ?></td>
							<td><?php echo $tbookingrefnumber; ?></td>
							<td><?php echo $testscore1; ?></td>
							<td><?php echo $ufullname." (".$utype.")"; ?></td>
<td><?php echo $capaddedon; ?></td>
<td><?php echo $adelete; ?></td>

							
																	
																</tr>
															<?php } ?>
																</tbody>
															<!--end::Table head-->
														</table>
														<!--end::Table-->
													</div>
												</div>
												<!--end::Card body-->
											</div>
											<div class="card card-flush py-4 flex-row-fluid">
												<!--begin::Card header-->
												<div class="card-header">
													<div class="card-title text-uppercase">
														<h2>Communication History</h2>
													</div>
													<!--begin::Add user-->
											
												
											<a href="#" data-bs-toggle="modal" data-bs-target="#student_add_communication" class="btn btn-sm btn-primary align-self-center"><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 </a>
										
											<!--end::Add user-->
												</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>Sr No.
                            </th>
                            <th>With
                            </th>
							<th>Staff
                            </th>
							
							<th>Message
                            </th>
							
							
							
                           
							<th class="min-w-100px">Addedby</th>
<th class="min-w-100px">Added On</th>
<th class="min-w-100px">Delete</th>
							 
																	
																	
																</tr>
															</thead>
															<!--end::Table head-->
															<!--begin::Table body-->
															<tbody class="fw-semibold text-gray-600">
															<?php
															$i=1;
															$tt1=0;
															$evepay = "select * from res_coachingcommunication_detail where  stiqmid=".$_GET['id'];
															$repay = mysqli_query($conn, $evepay);
															$i=1;
															while($rt1 = mysqli_fetch_assoc($repay))
															{
															$ccmessage=checkvalidstring ($rt1['ccmessage']);
															$ccwith=checkvalidstring ($rt1['ccwith']);
				
						$umid=$rt1['umid'];
				
				$ufullname='';
				
				$eve2 = "select * from res_user_master where umid ='$umid'";
				
				$re2 = mysqli_query($conn, $eve2);
				
				if(mysqli_num_rows($re2) > 0)
				{
					
					while($rt2 = mysqli_fetch_assoc($re2))
					{
							$ufullname1=$rt2['ufullname'];
					}
				}
					$capaddedon='';	
														$capaddedon=date("d-m-Y",strtotime($rt1['ccaddedon']));
														
														$biaddedby=$rt1['ccaddedby'];

														$ufullname='';
														$utype='';
														$evea1 = "select ufullname,utype from res_user_master where umid=$biaddedby";
														$rea1 = mysqli_query($conn, $evea1);
														if(mysqli_num_rows($rea1) > 0)
														{
														while($rta1 = mysqli_fetch_assoc($rea1))
														{
															$ufullname=$rta1['ufullname'];
															$utype=$rta1['utype'];
														}
														}
														$adelete = "<a href='studentcommunicationdelete.php?id=$ccdid&stiqmid=$stiqmid'  class='far fa-trash-alt fa-lg'>  </a>";
															
															?>
																<tr>
																	
																	 <td>
                              <?php echo $i++;?>
                            </td>
							<td><?php echo $ccwith; ?></td>
							<td><?php echo $ufullname1; ?></td>
							<td><?php echo $ccmessage; ?></td>
							
							
																	
                            
							
                          
                           
							<td><?php echo $ufullname." (".$utype.")"; ?></td>
<td><?php echo $capaddedon; ?></td>
<td><?php echo $adelete; ?></td>
							
																	
																</tr>
															<?php } ?>
																</tbody>
															<!--end::Table head-->
														</table>
														<!--end::Table-->
													</div>
												</div>
												<!--end::Card body-->
											</div>
											
											
											</div>
										<!--end::Orders-->
									</div>
									<!--end::Tab pane-->
									
								</div>
								<!--end::Tab content-->
								
							</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::Modal - Student Course-->
						<!--begin::Modal - Common Document-->
							<div class="modal fade" id="student_add_bookset" 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 Book Set Given to Lead</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_form132" class="form" action="booksettolead2.php" method="POST"  enctype="multipart/form-data">
														<input type="hidden" name="stiqmid" value="<?php echo $stiqmid; ?>">
															<!--begin::Scroll-->
																
																<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
													<!--begin::Col-->
													<div class="col-md-6 fv-row">
																<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class="required fw-semibold fs-6 mb-2">Select Book Set:</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<?php
							include("connect.php");
							$eve_category2 = "select * from res_bookset_master";
							$re_category2 = mysqli_query($conn, $eve_category2);
							?>
													<select class="form-select form-select-solid" data-control="select2"  data-dropdown-parent="#kt_modal_add_user_form132" name="booksetmid" id="booksetmid">
													  <option value="0">Select
													  </option>
													  <?php		
							while($rt_category2 = mysqli_fetch_assoc($re_category2))
							{
							echo "<option value='$rt_category2[booksetmid]'>$rt_category2[booksetname]</option>";
							}		
							?>	
                        </select>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													
													</div>
												<!--end::Row-->	
															<!--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>
															</div>
															<!--end::Actions-->
														</form>
														<!--end::Form-->
													</div>
										<!--end::Modal body-->
									</div>
									<!--end::Modal content-->
								</div>
								<!--end::Modal dialog-->
							<!--begin::Modal - Common Document-->
							<div class="modal fade" id="student_add_book_issue" 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>Issue Book</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_form133" class="form" action="issuebooklead2.php" method="POST"  enctype="multipart/form-data">
														<input type="hidden" name="stiqmid" value="<?php echo $stiqmid; ?>">
															<!--begin::Scroll-->
																
																<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-2 rol-cols-md-1 row-cols-lg-2">
													<!--begin::Col-->
													<div class="col-md-6 fv-row">
																<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class="required fw-semibold fs-6 mb-2">Select Book :</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<?php
							include("connect.php");
							$eve_category2 = "select * from res_book_master";
							$re_category2 = mysqli_query($conn, $eve_category2);
							?>
													<select class="form-select form-select-solid" data-control="select2"  data-dropdown-parent="#kt_modal_add_user_form133" name="bookmid" id="bookmid">
													  <option value="0">Select
													  </option>
													  <?php		
							while($rt_category2 = mysqli_fetch_assoc($re_category2))
							{
							echo "<option value='$rt_category2[bookmid]'>$rt_category2[bookname]</option>";
							}		
							?>	
                        </select>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													<!--begin::Col-->
													<div class="col">
														<!--begin::Input group-->
														<div class="fv-row  mb-7">
															<!--begin::Label-->
															<label class="fs-6 fw-semibold form-label mt-3">
																<span class="required">Return Date</span>
															</label>
															<!--end::Label-->
															<!--begin::Datepicker-->
															<input class="form-control form-control-solid fw-bold pe-5" placeholder="Select date" name="ibexpreturndate" id="kt_daterangepicker_1" required>
															<!--end::Datepicker--></div>
														<!--end::Input group-->
													</div>
													<!--end::Col-->
													</div>
												<!--end::Row-->	
															<!--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>
															</div>
															<!--end::Actions-->
														</form>
														<!--end::Form-->
													</div>
										<!--end::Modal body-->
									</div>
									<!--end::Modal content-->
								</div>
								<!--end::Modal dialog-->
						<!--begin::Modal - Common Document-->
							<div class="modal fade" id="student_add_batch" 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>Batch Allocation</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_form134" class="form" action="batchallocation2.php" method="POST"  enctype="multipart/form-data">
														<input type="hidden" name="stiqmid" value="<?php echo $stiqmid; ?>">
															<!--begin::Scroll-->
																
																<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
													<!--begin::Col-->
													<div class="col-md-6 fv-row">
																<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class="required fw-semibold fs-6 mb-2">Select Batch :</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<?php
							include("connect.php");
							 $eve_category2 = "select * from res_batch_master where subservicemid=$siprefferedsubservice and branchmid=$branchmid and batchmid not in (select batchmid from res_batchallocation_detail where stiqmid=$stiqmid)";
							$re_category2 = mysqli_query($conn, $eve_category2);
							?>
													<select class="form-select form-select-solid" data-control="select2"  data-dropdown-parent="#kt_modal_add_user_form134" name="batchmid" id="batchmid">
													  <option value="0">Select
													  </option>
													  <?php		
							while($rt_category2 = mysqli_fetch_assoc($re_category2))
							{
							echo "<option value='$rt_category2[batchmid]'>$rt_category2[batchname] ($rt_category2[batchtiming])</option>";
							}		
							?>	
                        </select>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													
													</div>
												<!--end::Row-->	
															<!--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>
															</div>
															<!--end::Actions-->
														</form>
														<!--end::Form-->
													</div>
										<!--end::Modal body-->
									</div>
									<!--end::Modal content-->
								</div>
								<!--end::Modal dialog-->
						<!--begin::Modal - Common Document-->
							<div class="modal fade" id="student_add_test" 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>Test Allocation</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_form135" class="form" action="testallocation2.php" method="POST"  enctype="multipart/form-data">
														<input type="hidden" name="stiqmid" value="<?php echo $stiqmid; ?>">
															<!--begin::Scroll-->
																
																<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
													<!--begin::Col-->
													<div class="col-md-6 fv-row">
																<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class="required fw-semibold fs-6 mb-2">Select Test :</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<?php
							include("connect.php");
							 $eve_category2 = "select * from res_test_master where subservicemid=$siprefferedsubservice  and testmid not in (select testmid from res_testallocation_detail where stiqmid=$stiqmid)";
							$re_category2 = mysqli_query($conn, $eve_category2);
							?>
													<select class="form-select form-select-solid" data-control="select2"  data-dropdown-parent="#kt_modal_add_user_form135" name="testmid" id="testmid">
													  <option value="0">Select
													  </option>
													  <?php		
							while($rt_category2 = mysqli_fetch_assoc($re_category2))
							{
							echo "<option value='$rt_category2[testmid]'>$rt_category2[testname] ($rt_category2[testdatetime])</option>";
							}		
							?>	
                        </select>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													
													</div>
												<!--end::Row-->	
												<!--begin::Input group-->
												<div class="fv-row mb-7">
													<!--begin::Label-->
													<label class="fs-6 fw-semibold form-label mt-3">
														<span class="required">Booking Reference Number</span>
														
													</label>
													<!--end::Label-->
													<!--begin::Input-->
													<input type="text" class="form-control form-control-solid" name="tbookingrefnumber" value="" required>
													<!--end::Input-->
												</div>
												<!--end::Input group-->
															<!--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>
															</div>
															<!--end::Actions-->
														</form>
														<!--end::Form-->
													</div>
										<!--end::Modal body-->
									</div>
									<!--end::Modal content-->
								</div>
								<!--end::Modal dialog-->
						<!--begin::Modal - Common Document-->
							<div class="modal fade" id="student_add_communication" 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></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_form136" class="form" action="coachingcommunication2.php" method="POST"  enctype="multipart/form-data">
														<input type="hidden" name="stiqmid" value="<?php echo $stiqmid; ?>">
															<!--begin::Scroll-->
																
																<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-2 rol-cols-md-1 row-cols-lg-2">
													<!--begin::Col-->
													<div class="col-md-6 fv-row">
																<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class="required fw-semibold fs-6 mb-2">Communicate with :</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	
													<select class="form-select form-select-solid" data-control="select2"  data-dropdown-parent="#kt_modal_add_user_form136" name="ccwith" id="ccwith">
													  <option value="Parents">Parents
													  </option> <option value="Student">Student
													  </option>
													 
                        </select>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													<!--begin::Col-->
													<div class="col" >
												<!--end::Row-->
												<!--begin::Input group-->
												<div class="fv-row mb-7">
													<!--begin::Label-->
													<label class="fs-6 fw-semibold form-label mt-3">
														<span class="required">User</span>
														
													</label>
													<!--end::Label-->
													<!--begin::Input-->
													<select class="form-select form-select-solid " data-control="select2" data-dropdown-parent="#kt_modal_add_user_form136"  name="umid" id="umid" >
													<option value="0">Select</option>
													<?php
													$eve="SELECT * FROM res_user_master WHERE utype not in ('agent','referral','admin') and ustatus='Approved' and  branchmid = $branchmid  ";

													$re = mysqli_query($conn, $eve);
													//echo '<option value="'.$eve.'">'.$eve.'</option>';
													//Count total number of rows
													if(mysqli_num_rows($re) > 0)
													{
													
														while($rt = mysqli_fetch_assoc($re)){
															echo '<option value="'.$rt['umid'].'">'.$rt['ufullname'].'</option>';

														}
													}
													?>
													
													</select>
													<!--end::Input-->
												</div>
												<!--end::Input group-->
												</div>
													<!--end::Col-->
													</div>
												<!--end::Row-->	
												<!--begin::Input group-->
												<div class="fv-row mb-7">
													<!--begin::Label-->
													<label class="fs-6 fw-semibold form-label mt-3">
														<span class="required">Message</span>
														
													</label>
													<!--end::Label-->
													<!--begin::Input-->
													<textarea type="text" class="form-control form-control-solid" name="ccmessage" value="" required></textarea>
													<!--end::Input-->
												</div>
												<!--end::Input group-->
															<!--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>
															</div>
															<!--end::Actions-->
														</form>
														<!--end::Form-->
													</div>
										<!--end::Modal body-->
									</div>
									<!--end::Modal content-->
								</div>
								<!--end::Modal dialog-->
						<!--end::Modal - Visa File Submission-->
						
			<!--begin::Modal - Document -->
							<div class="modal fade" id="view-modal1" 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>Renewal Book</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_form6" class="form" action="renewalbook2.php" method="POST"  enctype="multipart/form-data">
														<input type="hidden" name="stiqmid" value="<?php echo $stiqmid; ?>">
															<!--begin::Scroll-->
															<!-- content will be load here -->
															<div id="dynamic-content1"></div>
																<!--begin::Actions-->
												<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class=" fw-semibold fs-6 mb-2"> last date to return</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<input class="form-control form-control-solid fw-bold pe-5" placeholder="Select date" name="ibexpreturndate" id="kt_daterangepicker_2" required>
																	</div>
																	
																	
												
												
															<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-->
									</div>
									<!--end::Modal content-->
								</div>
								</div>
			<!--begin::Modal - Document -->
							<div class="modal fade" id="view-modal2" 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 Score</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_form6" class="form" action="testscore2.php" method="POST"  enctype="multipart/form-data">
														<input type="hidden" name="stiqmid" value="<?php echo $stiqmid; ?>">
															<!--begin::Scroll-->
															<!-- content will be load here -->
															<div id="dynamic-content2"></div>
																<!--begin::Actions-->
												<!--begin::Input group-->
																<div class="fv-row mb-7">
																	<!--begin::Label-->
																	<label class=" fw-semibold fs-6 mb-2"> Test Score</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<input class="form-control form-control-solid fw-bold pe-5"  name="testscore"  required>
																	</div>
																	
																	
												
												
															<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-->
									</div>
									<!--end::Modal content-->
								</div>
								</div>
								
									
		<!--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").flatpickr({
        enableTime:!1,dateFormat:"d-m-Y"
    }
   
);
		});
		</script>
		
		<script type="text/javascript">
		$(document).ready(function(){
			$("#kt_daterangepicker_2").flatpickr({
        enableTime:!1,dateFormat:"d-m-Y"
    });
		});
		</script>
	<script>
	$(document).ready(function(){

		$(document).on('click', '#getUser1', function(e){

			e.preventDefault();

			var uid = $(this).data('id');   // it will get id of clicked row

			$('#dynamic-content1').html(''); // leave it blank before ajax call
			$('#modal-loader').show();      // load ajax loader

			$.ajax({
				url: 'renewalbook.php',
				type: 'POST',
				data: 'id='+uid,
				dataType: 'html'
			})
			.done(function(data){
				console.log(data);
				$('#dynamic-content1').html('');
				$('#dynamic-content1').html(data); // load response
				$('#modal-loader').hide();		  // hide ajax loader
			})
			.fail(function(){
				$('#dynamic-content1').html('<i class="glyphicon glyphicon-info-sign"></i> Something went wrong, Please try again...');
				$('#modal-loader').hide();
			});

		});

	});

</script>
<script>
	$(document).ready(function(){

		$(document).on('click', '#getUser2', function(e){

			e.preventDefault();

			var uid = $(this).data('id');   // it will get id of clicked row

			$('#dynamic-content2').html(''); // leave it blank before ajax call
			$('#modal-loader').show();      // load ajax loader

			$.ajax({
				url: 'testscore.php',
				type: 'POST',
				data: 'id='+uid,
				dataType: 'html'
			})
			.done(function(data){
				console.log(data);
				$('#dynamic-content2').html('');
				$('#dynamic-content2').html(data); // load response
				$('#modal-loader').hide();		  // hide ajax loader
			})
			.fail(function(){
				$('#dynamic-content2').html('<i class="glyphicon glyphicon-info-sign"></i> Something went wrong, Please try again...');
				$('#modal-loader').hide();
			});

		});

	});

</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>