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



		$abmid = intval($_REQUEST['id']);
		 $eve11 = "select * from res_agentbranch_master where abmid=$abmid  ";
															$re11 = mysqli_query($conn, $eve11);
															while($rt11 = mysqli_fetch_assoc($re11))
															{
																 $abcontactname=$rt11['abcontactname'];
																$abmobilenumber=$rt11['abmobilenumber'];
																$abemailid=$rt11['abemailid'];
																
																$abdepartment=$rt11['abdepartment'];
																
																$abposition=$rt11['abposition'];
																$abname=$rt11['abname'];
																$abcremarks=$rt11['abcremarks'];
																
																			 
?>

						<!--begin::Row-->
						<input type="hidden" name="abmid" value="<?php echo $abmid; ?>">
																		<!--begin::Row-->
													<!--begin::Scroll-->
														<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
													<!--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">Branch Name</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<div class="w-100">
																<div class="form-floating border rounded">
													<input type="text" class="form-control form-control-solid" name="abname" value="<?php echo $abname; ?>" required>
													</div>
													</div>
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													<!--end::Col-->
													</div>
												<!--begin::Scroll-->
														<div class="row row-cols-1 row-cols-sm-3 rol-cols-md-1 row-cols-lg-3">
													<!--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">Contact Name</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<div class="w-100">
																<div class="form-floating border rounded">
															<input type="text" class="form-control form-control-solid" name="abcontactname" value="<?php echo $abcontactname; ?>" required>
													</div>
													</div>
															<!--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">Mobile Number</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<div class="w-100">
																<div class="form-floating border rounded">
													<input type="text" class="form-control form-control-solid" name="abmobilenumber" value="<?php echo $abmobilenumber; ?>" required>
													</div>
													</div>
															<!--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">Email Id</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<div class="w-100">
																<div class="form-floating border rounded">
													<input type="text" class="form-control form-control-solid" name="abemailid" value="<?php echo $abemailid; ?>" required>
													</div>
													</div>
															<!--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">
												 <!--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">Department</span>
																<i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Enter contact Code"></i>
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<select class="form-select form-select-solid" data-control="select2" data-dropdown-parent="#kt_modal_add_user_form5" name="bcontactdepartmnet" id="departmentmid">
													<option value="0">select</option>
													<?php 
																			$eve = "select * from res_department_master";

																			$re = mysqli_query($conn, $eve);
																			
																			while($rt = mysqli_fetch_assoc($re))

																			{											
																				
																				$departmentmid=$rt['departmentmid'];
																				$dname=$rt['departmentname'];
																				
																				if($abdepartment == $dname)
																				{
																				
																				echo "<option value='$dname' selected>$dname</option>";
																				}else{
																					echo "<option value='$dname'>$dname</option>";
																				}
																				 
																			}
																			
																			
																			
																			
																	?>
													</select>
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													<!--end::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">Position</span>
																<i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" ></i>
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															
												<select class="form-select form-select-solid" data-control="select2"  name="bcposition" data-dropdown-parent="#kt_modal_add_user_form5" id="bdepartmentmid">
													<option value="0">select</option>
													<?php 
																			$eve = "select * from res_role_master";

																			$re = mysqli_query($conn, $eve);
																			
																			while($rt = mysqli_fetch_assoc($re))

																			{											
																				
																				$rolemid=$rt['rolemid'];
																				$rolename=$rt['rolename'];
																				
																				if($rolename == $abposition)
																				{
																				
																				echo "<option value='$rolename' selected>$rolename</option>";
																				}else{
																					echo "<option value='$rolename'>$rolename</option>";
																				}
																				 
																			}
																			
																			
																			
																			
																	?>
													</select>
																		<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													
													</div>
												<!--end::Row-->
												
												<!--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">
														<!--begin::Input group-->
														<div class="fv-row mb-7">
															<!--begin::Label-->
															<label class="fs-6 fw-semibold form-label mt-3">
																<span class="required">Note</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<textarea type="text" class="form-control form-control-solid" name="bcremarks" value="" required><?php echo $abcremarks; ?></textarea>
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													<!--end::Col-->
												</div>
												<!--end::Row-->
																											
													
															<?php } ?>