<?php
session_start(); 
		/*User Add Data page */

	include("connect.php");
	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
	$ftime=0;
	$ttime=23;
	$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	$cmpmid=$_SESSION['linkarisecmpmid'];
	
				date_default_timezone_set("Asia/Singapore");
				$mdate1= date('Y-m-d H:i:s');
				$mdate= date('d-m-Y');
			
			$query11 = "select companyprefix from res_company_master where companymid=$cmpmid";
															$stmt11=mysqli_query($conn,$query11);
															
															$cmpprefix="";
															
															if(mysqli_num_rows($stmt11) > 0)
															{
																while($rt11 = mysqli_fetch_assoc($stmt11))
																{
																	$cmpprefix=$rt11['companyprefix'];
																	
																}
															}
?>
<!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>User Add</title>
		<meta charset="utf-8" />
		<meta name="description" content="The most advanced Bootstrap Admin Theme on Themeforest trusted by 100,000 beginners and professionals. Multi-demo, Dark Mode, RTL support and complete React, Angular, Vue, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel versions. Grab your copy now and get life-time updates for free." />
		<meta name="keywords" content="metronic, bootstrap, bootstrap 5, angular, VueJs, React, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel starter kits, admin themes, web design, figma, web development, free templates, free admin themes, bootstrap theme, bootstrap template, bootstrap dashboard, bootstrap dak mode, bootstrap button, bootstrap datepicker, bootstrap timepicker, fullcalendar, datatables, flaticon" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta property="og:locale" content="en_US" />
		<meta property="og:type" content="article" />
		<meta property="og:title" content="Metronic - Bootstrap 5 HTML, VueJS, React, Angular. Laravel, Asp.Net Core, Ruby on Rails, Spring Boot, Blazor, Django, Express Node.js & Flask Admin Dashboard Theme" />
		<meta property="og:url" content="https://keenthemes.com/metronic" />
		<meta property="og:site_name" content="Keenthemes | Metronic" />
		<link rel="canonical" href="https://preview.keenthemes.com/metronic8" />
		<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
		<!--begin::Fonts(mandatory for all pages)-->
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
		<!--end::Fonts-->
		<!--begin::Vendor Stylesheets(used for this page only)-->
		<link href="assets/plugins/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css" />
		<!--end::Vendor Stylesheets-->
		<!--begin::Global Stylesheets Bundle(mandatory for all pages)-->
		<link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
		<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
		<!--end::Global Stylesheets Bundle-->
	</head>
	<!--end::Head-->
	<!--begin::Body-->
	<body id="kt_app_body" data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
		<!--begin::Theme mode setup on page load-->
		<script>var defaultThemeMode = "light"; var themeMode; if ( document.documentElement ) { if ( document.documentElement.hasAttribute("data-bs-theme-mode")) { themeMode = document.documentElement.getAttribute("data-bs-theme-mode"); } else { if ( localStorage.getItem("data-bs-theme") !== null ) { themeMode = localStorage.getItem("data-bs-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-bs-theme", themeMode); }</script>
		<!--end::Theme mode setup on page load-->
		<!--begin::Main-->
		<!--begin::Root-->
		<div class="d-flex flex-column flex-root app-root" id="kt_app_root">
			<!--begin::Page-->
			<div class="app-page flex-column flex-column-fluid" id="kt_app_page">
				<!--begin::Header-->
				<?php include('header2.php'); ?>
				
				<!--end::Header-->
				<!--begin::Wrapper-->
				<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
					<!--begin::Sidebar-->
				<?php include('sidebar2.php'); ?>
				<!--end::Sidebar-->
					<!--begin::Main-->
					<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
						<!--begin::Content wrapper-->
						<div class="d-flex flex-column flex-column-fluid">
							<!--begin::Toolbar-->
							<div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
								<!--begin::Toolbar container-->
								<div id="kt_app_toolbar_container" class="app-container container-xxl d-flex flex-stack">
									<!--begin::Page title-->
									<div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
										<!--begin::Title-->
										<h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">Add User</h1>
										<!--end::Title-->
										<!--begin::Breadcrumb-->
										<ul class="breadcrumb breadcrumb-separatorless fw-semibold fs-7 my-0 pt-1">
											<!--begin::Item-->
											<li class="breadcrumb-item text-muted">
												<a href="dashboard.php" class="text-muted text-hover-primary">Home</a>
											</li>
											<!--end::Item-->
											<!--begin::Item-->
											<li class="breadcrumb-item">
												<span class="bullet bg-gray-400 w-5px h-2px"></span>
											</li>
											<!--end::Item-->
											<!--begin::Item-->
											<li class="breadcrumb-item text-muted"> User</li>
											<!--end::Item-->
											<!--begin::Item-->
											
											<!--begin::Item-->
										
											<!--end::Item-->
										</ul>
										<!--end::Breadcrumb-->
									</div>
									<!--end::Page title-->
									<!--begin::Actions-->
									
									<!--end::Actions-->
								</div>
								<!--end::Toolbar container-->
							</div>
							<!--end::Toolbar-->
							<!--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::Contacts App- Add New Contact-->
							<div class="row g-7">
							<div class="col-xl-2">
							</div>
								<!--begin::Content-->
								<div class="col-xl-12">
									<!--begin::Contacts-->
									<div class="card card-flush h-lg-100" id="kt_contacts_main">
										<!--begin::Card header-->
										<div class="card-header pt-7" id="kt_chat_contacts_header">
											<!--begin::Card title-->
											<div class="card-title">
												<!--begin::Svg Icon | path: icons/duotune/communication/com005.svg-->
												<span class="svg-icon svg-icon-1 me-2">
													<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
														<path d="M20 14H18V10H20C20.6 10 21 10.4 21 11V13C21 13.6 20.6 14 20 14ZM21 19V17C21 16.4 20.6 16 20 16H18V20H20C20.6 20 21 19.6 21 19ZM21 7V5C21 4.4 20.6 4 20 4H18V8H20C20.6 8 21 7.6 21 7Z" fill="currentColor" />
														<path opacity="0.3" d="M17 22H3C2.4 22 2 21.6 2 21V3C2 2.4 2.4 2 3 2H17C17.6 2 18 2.4 18 3V21C18 21.6 17.6 22 17 22ZM10 7C8.9 7 8 7.9 8 9C8 10.1 8.9 11 10 11C11.1 11 12 10.1 12 9C12 7.9 11.1 7 10 7ZM13.3 16C14 16 14.5 15.3 14.3 14.7C13.7 13.2 12 12 10.1 12C8.10001 12 6.49999 13.1 5.89999 14.7C5.59999 15.3 6.19999 16 7.39999 16H13.3Z" fill="currentColor" />
													</svg>
												</span>
												<!--end::Svg Icon-->
												<h2>Add New User</h2>
											</div>
											<!--end::Card title-->
										</div>
										<!--end::Card header-->
										<!--begin::Card body-->
										<div class="card-body pt-5">
											<!--begin::Form-->
										
											<form id="kt_ecommerce_settings_general_form" class="form" action="useradd2.php" method="POST" enctype="multipart/form-data">
												
													<!--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">Name</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															<input type="text" class="form-control form-control" name="username"  value="" placeholder="Enter Username" required>
															<!--end::Input-->
														</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="">Mobile Number</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															
											
															
															
															<input type="text" class="form-control form-control" name="usermobile" value="" placeholder="Enter User Mobile No.">
														
															
															<!--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">
												
												
														<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="">Log-In ID</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															
													<input type="text" class="form-control form-control" id="userloginid" placeholder="Enter User Log-In ID" name="userloginid"  required>


															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
															<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="">Password</span>
																
															</label>
															<!--end::Label-->
															<!--begin::Input-->
															
												<input type="password" class="form-control form-control" name="userpassword" value="" placeholder="Enter Password">
															<!--end::Input-->
														</div>
														<!--end::Input group-->
													</div>
													
													</div>
												<!--end::Row-->
												<!--end::Row-->
											
												
												<!--begin::Separator-->
												<div class="separator mb-6"></div>
												<!--end::Separator-->
												<!--begin::Action buttons-->
													<div class="d-flex justify-content-end">
													<!--begin::Button-->
													<a type="reset" href="user.php"  class="btn btn-light me-3">Cancel</a>
													<!--end::Button-->
													<!--begin::Button-->
													<button type="submit"  id="btnsubmite" class="btn btn-primary">
														<span class="indicator-label">Save</span>
														<span class="indicator-progress">Please wait...
														<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
													</button>
													<!--end::Button-->
												</div>
												<!--end::Action buttons-->
											</form>
											
											<!--end::Form-->
										</div>
										<!--end::Card body-->
									</div>
									<!--end::Contacts-->
								</div>
								<!--end::Content-->
							</div>
							<!--end::Contacts App- Add New Contact-->
						</div>
						<!--end::Container-->
					</div>
					</div>
					<!--end::Content-->
					<?php include('footer.php'); ?>
					</div>
				<!--end::Wrapper-->
			</div>
			<!--end::Page-->
		</div>
		</div>
		<!--end::Root-->
		
		<!--end::Main-->
		
		<!--begin::Engage modals-->
		<!--end::Engage modals-->
		<!--begin::Engage toolbar-->
		<!--end::Engage toolbar-->
		<!--begin::Scrolltop-->
		<div id="kt_scrolltop" class="scrolltop" data-kt-scrolltop="true">
			<!--begin::Svg Icon | path: icons/duotune/arrows/arr066.svg-->
			<span class="svg-icon">
				<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
					<rect opacity="0.5" x="13" y="6" width="13" height="2" rx="1" transform="rotate(90 13 6)" fill="currentColor" />
					<path d="M12.5657 8.56569L16.75 12.75C17.1642 13.1642 17.8358 13.1642 18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25L12.7071 5.70711C12.3166 5.31658 11.6834 5.31658 11.2929 5.70711L5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75C6.16421 13.1642 6.83579 13.1642 7.25 12.75L11.4343 8.56569C11.7467 8.25327 12.2533 8.25327 12.5657 8.56569Z" fill="currentColor" />
				</svg>
			</span>
			<!--end::Svg Icon-->
		</div>
		<!--end::Scrolltop-->
		
		<!--begin::Javascript-->
		<script>var hostUrl = "assets/";</script>
		<!--begin::Global Javascript Bundle(mandatory for all pages)-->
		<script src="assets/plugins/global/plugins.bundle.js"></script>
		<script src="assets/js/scripts.bundle.js"></script>
		<!--end::Global Javascript Bundle-->
		<!--begin::Vendors Javascript(used for this page only)-->
		<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
		<!--end::Vendors Javascript-->
		<!--begin::Custom Javascript(used for this page only)-->
		<script src="assets/js/custom/apps/contacts/edit-contact.js"></script>
		<script src="assets/js/widgets.bundle.js"></script>
		<script src="assets/js/custom/widgets.js"></script>
		<script src="assets/js/custom/apps/chat/chat.js"></script>
		<script src="assets/js/custom/utilities/modals/upgrade-plan.js"></script>
		<script src="assets/js/custom/utilities/modals/users-search.js"></script>
		<!--end::Custom Javascript-->
		<!--end::Javascript-->
		<script>
  // JavaScript code to set the initial value and prevent modifying cmpprefix
  document.addEventListener("DOMContentLoaded", function () {
    var cmpprefix = "<?php echo $cmpprefix."-"; ?>"; // Get the cmpprefix from PHP
    var inputField = document.getElementById("userloginid");

    // Set the initial value to cmpprefix
    inputField.value = cmpprefix;

    // Prevent changes to cmpprefix
    inputField.addEventListener("input", function () {
      if (!inputField.value.startsWith(cmpprefix)) {
        inputField.value = cmpprefix;
      }
    });
  });
</script>
		
	</body>
	<!--end::Body-->
</html>