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



		$contactmid = intval($_REQUEST['id']);
		 $eve11 = "select * from res_contact_master where contactmid=$contactmid  ";
															$re11 = mysqli_query($conn, $eve11);
															while($rt11 = mysqli_fetch_assoc($re11))
															{
																 $contactname=$rt11['contactname'];
																$contactnumber=$rt11['contactnumber'];
																$cmobilenumber=$rt11['cmobilenumber'];
																$contactemail=$rt11['contactemail'];
																$contactdepartmnet=$rt11['contactdepartmnet'];
																$clinktype=$rt11['clinktype'];
																$cposition=$rt11['cposition'];
																$cmiddlename=$rt11['cmiddlename'];
																$csurname=$rt11['csurname'];
																$caltenateemail=$rt11['caltenateemail'];
																$cremarks=$rt11['cremarks'];
																 $cmsgappname=$rt11['cmsgappname'];
																$cmsgappid=$rt11['cmsgappid'];
																$cvideoappname=$rt11['cvideoappname'];
																$cvideoappid=$rt11['cvideoappid'];
																$ccompanyname=$rt11['ccompanyname'];
																
																
																		
																			 
?>

						<!--begin::Row-->
						<input type="hidden" name="contactmid" value="<?php echo $contactmid; ?>">
																		<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-1 rol-cols-md-1 row-cols-lg-1">
													
																
																
													<!--end::Col-->
													</div>
												<!--end::Row-->
												
														<!--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">First 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="scontactname" value="<?php echo $contactname; ?>" 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">Middle 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="scmiddlename" value="<?php echo $cmiddlename; ?>" 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">Surname</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="scsurname" value="<?php echo $csurname; ?>" 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">
												
												<!--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 Number</span>
																<i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Enter contact Code"></i>
															</label>
															<!--end::Label-->
															
															<input type="text" class="form-control form-control-solid" name="scontactnumber" value="<?php echo $contactnumber; ?>" required>
															</div>
															
														
															<!--end::Input-->

														<!--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">Mobile Number</span>
																<i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" ></i>
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															
												
															
															<input type="text" class="form-control form-control-solid" name="scmobilenumber" value="<?php echo $cmobilenumber; ?>" required>
															
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													
													</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">
														<!--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</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-->
															<input type="text" class="form-control form-control-solid" name="scontactemail" value="<?php echo $contactemail; ?>" required>
															<!--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">Alternate Email</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															
												<input type="text" class="form-control form-control-solid" name="scaltenateemail" value="<?php echo $caltenateemail; ?>" required>
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													
													</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-->
													<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>Messaging app</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
													<select class="form-select form-select-solid" data-control="select2" data-dropdown-parent="#kt_modal_add_user_form4" name="scmsgappname" >
													<option value="0">select</option>
													<?php 
																			$eve = "select * from res_messagingapp_master";

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

																			{											
																				
																				$messagingappmid =$rt['messagingappmid'];
																				$messagingappname=$rt['messagingappname'];
																				
																				if($messagingappname == $cmsgappname)
																				{
																				
																				echo "<option value='$messagingappname' selected>$messagingappname</option>";
																				}else{
																					echo "<option value='$messagingappname'>$messagingappname</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>Messaging App ID</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<input type="text" class="form-control form-control-solid" name="scmsgappid" value="<?php echo $cmsgappid; ?>" />
													<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													</div>
													<!--end::Col-->
													<!--begin::Row-->
												<div class="row row-cols-1 row-cols-sm-2 rol-cols-md-1 row-cols-lg-2">
												<!--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>Video Calling app</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
													<select class="form-select form-select-solid" data-control="select2" data-dropdown-parent="#kt_modal_add_user_form4" name="scvideoappname" >
													<option value="0">select</option>
													<?php 
																			$eve = "select * from res_videocallingapp_master";

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

																			{											
																				
																				$videocallingappmid =$rt['videocallingappmid'];
																				$videocallingappname=$rt['videocallingappname'];
																				if($videocallingappname == $cvideoappname)
																				{
																				echo "<option value='$videocallingappname' selected>$videocallingappname</option>";
																				}else{
																					echo "<option value='$videocallingappname'>$videocallingappname</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>Video Calling App ID</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<input type="text" class="form-control form-control-solid" name="scvideoappid" value="<?php echo $cvideoappid; ?>" />
													<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													</div>
													<!--end::Col-->
												
												<!--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"  name="scontactdepartmnet" 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($contactdepartmnet == $departmentmid)
																				{
																				
																				echo "<option value='$departmentmid' selected>$dname</option>";
																				}else{
																					echo "<option value='$departmentmid'>$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="scposition" data-dropdown-parent="#kt_modal_add_user_form4" id="sdepartmentmid">
													<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($cposition == $rolemid)
																				{
																				
																				echo "<option value='$rolemid' selected>$rolename</option>";
																				}else{
																					echo "<option value='$rolemid'>$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">Remarks</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<textarea type="text" class="form-control form-control-solid" name="scremarks" value="" required><?php echo $cremarks; ?></textarea>
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													<!--end::Col-->
												</div>
												<!--end::Row-->
																										
													
															<?php } ?>