Server : Apache System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64 User : nobody ( 99) PHP Version : 8.1.23 Disable Function : NONE Directory : /home/dnlcambodia/www/dnl_dashboard/Feature/ |
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="content-type" content="text/html; charset=us-ascii"> <meta charset="utf-8"> <script src="./../../kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script> <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet"> <link id="pagestyle" href="../assets/css/material-dashboard.mine63c.css?v=3.1.0" rel="stylesheet"> <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet"> <title>Upload Function</title> <style> .async-hide { opacity: 0 !important } </style> <style> body { font-family: Arial, sans-serif; background-color: #f7f7f7; margin: 0; padding: 0; color: #333; } .container1 { display: inline-flex; justify-content: space-around; width: 100%; margin-top: 20px; } .sub-container1 { width: 40%; height: 850px; padding: 20px; background-color: #fff; border-radius: 5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .sub-container2 { width: 58%; height: 850px; padding: 20px; background-color: #fff; border-radius: 5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } label { display: block; font-weight: bold; margin-bottom: -19px; color: #555; } input[type="text"], textarea, select { width: 100%; padding: 8px; margin-bottom: -22px; border: 1px solid #ccc; border-radius: 3px; box-sizing: border-box; } select { height: 38px; } input[type="submit"] { background-color: #28a745; color: white; padding: 10px 20px; border: none; border-radius: 3px; cursor: pointer; } input[type="submit"]:hover { background-color: #218838; } table { width: 100%; border-collapse: collapse; margin-top: 20px; } table, th, td { border: 1px solid #ddd; padding: 8px; text-align: left; } th { background-color: #f8f9fa; color: #333; } tr:nth-child(even) { background-color: #f2f2f2; } /* Style for the edit link */ .edit { display: inline-block; padding: 5px 10px; background-color: #28a745; /* Blue color, you can change this to your desired color */ color: #fff; /* White text color */ text-decoration: none; /* Remove underline */ border-radius: 3px; /* Rounded corners */ } /* Hover effect for the edit link */ .edit:hover { background-color: #087401; color: #fff; /* Darker blue on hover */ } </style> </head> <body class="g-sidenav-show bg-gray-200"> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NKDMSK6" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <aside class="sidenav navbar navbar-vertical navbar-expand-xs border-0 border-radius-xl my-3 fixed-start ms-3 bg-gradient-dark" id="sidenav-main"> <div class="sidenav-header" style="margin-left:40px;"> <i class="fas fa-times p-3 cursor-pointer text-white opacity-5 position-absolute end-0 top-0 d-none d-xl-none" aria-hidden="true" id="iconSidenav"></i><a class="navbar-brand m-0" href="home.php" target="_blank"><img src="../assets/DNL-01.png" alt="main_logo"></a> </div> <hr class="horizontal light mt-0 mb-2"> <div class="collapse navbar-collapse w-auto" id="sidenav-collapse-main"> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link text-white " href="../home.php"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">dashboard</i> </div><span class="nav-link-text ms-1">Dashboard</span> </a> </li> <li class="nav-item"> <a class="nav-link text-white" href="../Service/upload_service.php"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">table_view</i> </div><span class="nav-link-text ms-1">Service</span> </a> </li> <li class="nav-item"> <a class="nav-link text-white" href="../PHP/createPost.php"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">receipt_long</i> </div><span class="nav-link-text ms-1">Blog Post</span> </a> </li> <li class="nav-item"> <a class="nav-link text-white" href="../table.php"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">view_in_ar</i> </div><span class="nav-link-text ms-1">Quotations</span> </a> </li> <li class="nav-item"> <a class="nav-link text-white" href="../Project/upload_project.php"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">format_textdirection_r_to_l</i> </div><span class="nav-link-text ms-1">Project</span> </a> </li> <li class="nav-item"> <a class="nav-link active text-white bg-gradient-primary" href="../Feature/function.php"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">notifications</i> </div><span class="nav-link-text ms-1">Feature</span> </a> </li> <li class="nav-item mt-3"> <h6 class="ps-4 ms-2 text-uppercase text-xs text-white font-weight-bolder opacity-8">Account pages</h6> </li> <li class="nav-item"> <a class="nav-link text-white" href="profile.html"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">person</i> </div><span class="nav-link-text ms-1">Profile</span> </a> </li> <li class="nav-item"> <a class="nav-link text-white" href="../index.php"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">login</i> </div><span class="nav-link-text ms-1">Sign In</span> </a> </li> <li class="nav-item"> <a class="nav-link text-white" href="sign-up.html"> <div class="text-white text-center me-2 d-flex align-items-center justify-content-center"> <i class="material-icons opacity-10">assignment</i> </div><span class="nav-link-text ms-1">Sign Up</span> </a> </li> </ul> </div> </aside> <main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg"> <nav class="navbar navbar-main navbar-expand-lg px-0 mx-4 shadow-none border-radius-xl" id="navbarBlur" data-scroll="true"> <div class="container-fluid py-1 px-3"> <div class="collapse navbar-collapse mt-sm-0 mt-2 me-md-0 me-sm-4" id="navbar"> <div class="ms-md-auto pe-md-3 d-flex align-items-center"> <div class="input-group input-group-outline"> <label class="form-label">Type here...</label> <input type="text" class="form-control"> </div> </div> <ul class="navbar-nav justify-content-end"> <li class="nav-item d-xl-none ps-3 d-flex align-items-center"> <a href="javascript:;" class="nav-link text-body p-0" id="iconNavbarSidenav"> <div class="sidenav-toggler-inner"></div> </a> </li> <li class="nav-item px-3 d-flex align-items-center"> <a href="javascript:;" class="nav-link text-body p-0"></a> </li> <li class="nav-item dropdown pe-2 d-flex align-items-center"> <a href="javascript:;" class="nav-link text-body p-0" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false"></a> <ul class="dropdown-menu dropdown-menu-end px-2 py-3 me-sm-n4" aria-labelledby="dropdownMenuButton"> <li class="mb-2"> <a class="dropdown-item border-radius-md" href="javascript:;"> <div class="d-flex py-1"> <div class="my-auto"><img src="../assets/img/team-2.jpg" class="avatar avatar-sm me-3" alt="team-2"></div> <div class="d-flex flex-column justify-content-center"> <h6 class="text-sm font-weight-normal mb-1"><span class="font-weight-bold">New message</span> from Laur</h6> <p class="text-xs text-secondary mb-0">13 minutes ago</p> </div> </div> </a> </li> <li class="mb-2"> <a class="dropdown-item border-radius-md" href="javascript:;"> <div class="d-flex py-1"> <div class="my-auto"><img src="https://demos.creative-tim.com/material-dashboard/assets/img/small-logos/logo-spotify.svg" class="avatar avatar-sm bg-gradient-dark me-3" alt="logo-spotify"></div> <div class="d-flex flex-column justify-content-center"> <h6 class="text-sm font-weight-normal mb-1"><span class="font-weight-bold">New album</span> by Travis Scott</h6> <p class="text-xs text-secondary mb-0">1 day</p> </div> </div> </a> </li> <li> <a class="dropdown-item border-radius-md" href="javascript:;"> <div class="d-flex py-1"> <div class="avatar avatar-sm bg-gradient-secondary me-3 my-auto"> <svg width="12px" height="12px" viewbox="0 0 43 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>credit-card</title> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g transform="translate(-2169.000000, -745.000000)" fill="#FFFFFF" fill-rule="nonzero"> <g transform="translate(1716.000000, 291.000000)"> <g transform="translate(453.000000, 454.000000)"> <path class="color-background" d="M43,10.7482083 L43,3.58333333 C43,1.60354167 41.3964583,0 39.4166667,0 L3.58333333,0 C1.60354167,0 0,1.60354167 0,3.58333333 L0,10.7482083 L43,10.7482083 Z" opacity="0.593633743"></path> <path class="color-background" d="M0,16.125 L0,32.25 C0,34.2297917 1.60354167,35.8333333 3.58333333,35.8333333 L39.4166667,35.8333333 C41.3964583,35.8333333 43,34.2297917 43,32.25 L43,16.125 L0,16.125 Z M19.7083333,26.875 L7.16666667,26.875 L7.16666667,23.2916667 L19.7083333,23.2916667 L19.7083333,26.875 Z M35.8333333,26.875 L28.6666667,26.875 L28.6666667,23.2916667 L35.8333333,23.2916667 L35.8333333,26.875 Z"></path> </g> </g> </g> </g> </svg> </div> <div class="d-flex flex-column justify-content-center"> <h6 class="text-sm font-weight-normal mb-1">Payment successfully completed</h6> <p class="text-xs text-secondary mb-0">2 days</p> </div> </div> </a> </li> </ul> </li> <li class="nav-item d-flex align-items-center"> <a href="sign-in.html" class="nav-link text-body font-weight-bold px-0"><span class="d-sm-inline d-none">Sign In</span></a> </li> </ul> </div> </div> </nav> <div class="container1"> <div class="sub-container1"> <h4></h4> <form action="./Process/upload_function.php" method="post"> <label for="title">Title:</label><br> <input type="text" id="title" name="title"><br><br> <label for="name">Name:</label><br> <input type="text" id="name" name="name"><br><br> <label for="content">Content:</label><br> <div id="editor" style="height: 300px;"></div> <input type="hidden" id="content" name="content"> <label for="description">Description:</label><br> <textarea id="description" name="description" rows="4" cols="50"></textarea><br><br> <label for="feature_id">Feature:</label><br> <select id="feature_id" name="feature_id"> <?php include '../PHP/config/db_conn.php'; // Assuming you have a database connection $conn $sql = "SELECT id, name FROM feature"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo "<option value='" . $row['id'] . "'>" . $row['name'] . "</option>"; } } ?> </select><br><br> <input type="submit" value="Submit"> </form> <script src="https://cdn.quilljs.com/1.3.6/quill.js"></script> <script> var quill = new Quill('#editor', { theme: 'snow' }); // Set the content of the hidden input field on form submission var form = document.querySelector('form'); form.onsubmit = function() { var content = document.querySelector('input[name=content]'); content.value = quill.root.innerHTML; }; </script> </div> <div class="sub-container2" style="height: 850px; overflow-y: scroll;"> <h4></h4> <table> <thead> <tr> <th>ID</th> <th>Name</th> <th>Title</th> <th>Description</th> <th>Content</th> <th>Feature</th> <th>Action</th> </tr> </thead> <tbody> <?php include '../PHP/config/db_conn.php'; // Assuming you have a database connection $conn $sql = "SELECT f.id, f.name, f.title, f.description, f.content, fe.name AS feature_name FROM function f LEFT JOIN feature fe ON f.feature_id = fe.id"; $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo "<tr><td>" . $row["id"] . "</td><td>" . $row["name"] . "</td><td>" . $row["title"] . "</td><td>" . $row["description"] . "</td><td>" . $row["content"] . "</td><td>" . $row["feature_name"] . "</td><td><a class='edit' href='edit_function.php?id=" . $row["id"] . "'>Edit</a></td></tr>"; } } else { echo "<tr><td colspan='6'>No functions found</td></tr>"; } $conn->close(); ?> </tbody> </table> </div> </div> </body> </html>