<?php
session_start();
include "connect.php";



		$id = intval($_REQUEST['id']);
		
		
		 $eve = "select * from res_payments_detail,res_inquiryservice_detail where res_payments_detail.isdid = res_inquiryservice_detail.isdid and  res_payments_detail.pddid=$id  ";
		
		$re = mysqli_query($conn, $eve);
	if(mysqli_num_rows($re) > 0)
	{
		 while($rt = mysqli_fetch_assoc($re))
		 {
			$ptype=$rt['ptype'];
$packagename='';
								if($ptype == 'Branch' || $ptype == 'Country')
								{
									$packagemid=$rt['packagemid'];
									 $evea3 = "select packagename from res_package_master where packagemid=$packagemid";
									$rea3 = mysqli_query($conn, $evea3);
									if(mysqli_num_rows($rea3) > 0)
									{
									while($rta3 = mysqli_fetch_assoc($rea3))
									{
										$packagename=$rta3['packagename'];
										
									}
									}
								}else if($ptype == 'Application'){
									$clgappmid=$rt['linkmid'];
									$eve23 = "select * from res_course_master,res_collegeapp_master where res_collegeapp_master.coursemid = res_course_master.coursemid  and  res_collegeapp_master.clgappmid=$clgappmid";

									$re23 = mysqli_query($conn, $eve23);

									while($rt23 = mysqli_fetch_assoc($re23))

									{

									$collegemid=$rt23['collegemid'];
									$collegemid=$rt23['collegemid'];
									$cnmid=$rt23['cnmid'];
									$clgappmid=$rt23['clgappmid'];
									$coursename="";
					$eve55= "select * from   res_coursename_master where cnmid=$cnmid";
					$re55 = mysqli_query($conn, $eve55);
					 while($rt55 = mysqli_fetch_assoc($re55))
					{
			
						
						$coursename=$rt55['coursename'];
						
					}
						$eve55= "select * from   res_college_master where collegemid=$collegemid";
					$re55 = mysqli_query($conn, $eve55);
					 while($rt55 = mysqli_fetch_assoc($re55))
					{
			
						
						$cmname=$rt55['cmname'];
						
					}
									

								}
								$packagename = $cmname."-".$coursename." application";
								}else if($ptype == 'Book Lost'){
									$bookmid=$rt['linkmid'];
									$eve78 = "select bookname,bookprice from res_book_master where  bookmid=$bookmid";
									$re78 = mysqli_query($conn, $eve78);
									if(mysqli_num_rows($re78) > 0)
									{
										while($rt78 = mysqli_fetch_assoc($re78))
										{
											$bookname=$rt78['bookname'];
											
											
										}
									}
									$packagename = $bookname." Lost";
								}else if($ptype == 'College Admission'){
									$admid=$rt['linkmid'];
										$eve23 = "select * from res_course_master,res_admission_master where res_admission_master.coursemid = res_course_master.coursemid   and  res_admission_master.admid=$admid";

									$re23 = mysqli_query($conn, $eve23);

									while($rt23 = mysqli_fetch_assoc($re23))

									{

									$collegemid=$rt23['collegemid'];
									$collegemid=$rt23['collegemid'];
									$cnmid=$rt23['cnmid'];
									$admid=$rt23['admid'];
									$coursename="";
					$eve55= "select * from   res_coursename_master where cnmid=$cnmid";
					$re55 = mysqli_query($conn, $eve55);
					 while($rt55 = mysqli_fetch_assoc($re55))
					{
			
						
						$coursename=$rt55['coursename'];
						
					}
						$eve55= "select * from   res_college_master where collegemid=$collegemid";
					$re55 = mysqli_query($conn, $eve55);
					 while($rt55 = mysqli_fetch_assoc($re55))
					{
			
						
						$cmname=$rt55['cmname'];
						
					}
									

								}
								$packagename = $cmname."-".$coursename." Admission";
								}
			 $paycurrency = $rt['paycurrency'];
			 $paycurrencyvalue = $rt['paycurrencyvalue'];
			  $paidamount = $rt['paidamount'];
			  $isdid = $rt['isdid'];
			
		 }
	}
		

?>

						<!--begin::Row-->
						<input type="hidden" name="pddid" value="<?php echo $id; ?>">
						<input type="hidden" name="isdid" value="<?php echo $isdid; ?>">
												<!--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">Purpose</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<input class="form-control form-control-solid fw-bold pe-5"  name="purpose" value="<?php echo $packagename; ?>" readonly>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													<!--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">Currency</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<input class="form-control form-control-solid fw-bold pe-5"  name="paycurrency" id="paycurrency23" value="<?php echo $paycurrency; ?>" readonly>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													</div>
												<!--end::Row-->
												<!--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">Payment in Currency Value</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<input class="form-control form-control-solid fw-bold pe-5"  name="paidamount" id="paycurrencyvalue23" value="<?php echo $paycurrencyvalue; ?>" readonly>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													<!--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">Fees in INR</label>
																	<!--end::Label-->
																	<!--begin::Input-->
																	<input class="form-control form-control-solid fw-bold pe-5"  name="paidamount23" id="paidamount" value="<?php echo $paidamount; ?>" readonly>
																	<!--end::Input-->
																</div>
																<!--end::Input group-->
																</div>
													<!--end::Col-->
													</div>
												<!--end::Row-->
												
