Server IP : 162.214.80.37 / Your IP : 216.73.216.83 Web Server : Apache System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : imyrqtmy ( 2189) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/imyrqtmy/public_html/localapp/vendor/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); $se = $_SESSION["id"]; if (!isset($_SESSION['id'])) { header("Location: login.php"); } include("inc/config.php");; ?> <!DOCTYPE html> <html lang="en"> <?php require "inc/head.php"; ?> <body> <!-- header--> <?php require "inc/header.php"; ?> <!-- End Main-content Top bar--> <!-- main-content--> <div class="wrapper"> <?php require "inc/sidebar.php"; ?> <div id="content"> <div class="row mb-4"> <div class="col-12 col-sm-12"> <div class="row"> <div class="col-12 col-md-12 mb-4"> <div class="card redial-border-light redial-shadow"> <div class="card-body" style="overflow: visible;"> <!-- <h6 class="header-title pl-3 redial-relative">Advanced Select</h6> --> <div class="card redial-border-light redial-shadow mb-4"> <div class="card-body"> <h6 class="header-title pl-3 redial-relative">Project Form</h6> <form action="add_project.php" method="post" enctype="multipart/form-data"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="redial-font-weight-600">Project Name</label> <input type="text" name="project_name" class="form-control" placeholder="Project Name" /> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="redial-font-weight-600">Task Name</label> <input type="text" name="task_name" class="form-control" placeholder="Enter Task" /> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="redial-font-weight-600">Start Date & Time</label> <input type="datetime-local" id="start_datetime" name="start_datetime" class="form-control" /> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="redial-font-weight-600">End Date & Time</label> <input type="datetime-local" id="end_datetime" name="end_datetime" class="form-control" /> </div> </div> <div class="col-md-12"> <div class="form-group"> <label class="redial-font-weight-600">Total Time (Days:Hours:Minutes)</label> <input type="text" id="total_time" name="total_time" class="form-control" readonly /> </div> </div> </div> <div class="row"> <?php // Fetch employees $query = "SELECT * FROM employees"; $query_run = mysqli_query($conn, $query); if (mysqli_num_rows($query_run) > 0) { ?> <div class="col-md-6"> <div class="form-group"> <label class="redial-font-weight-600">Employee Name</label> <select name="emp_name" class="form-control" required> <option value="" disabled selected>Select Employee</option> <?php foreach ($query_run as $row) { // Combine first and last name for the dropdown $full_name = $row['femp_name'] . ' ' . $row['lemp_name']; echo '<option value="' . $full_name . '">' . $full_name . '</option>'; } ?> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="redial-font-weight-600">Employee Hour Rate</label> <input type="text" name="erh" class="form-control" value="<?php echo $row['erh'] ?>" readonly /> </div> </div> <?php } else { echo '<p>No employees found</p>'; } ?> </div> <div class="form-group"> <label class="redial-font-weight-600 d-block">Total Amt</label> <input type="text" class="form-control" name="total_amt" /> </div> <div class="redial-divider my-4"></div> <button type="submit" name="add_project" class="btn btn-primary btn-xs">Submit</button> </form> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- End main-content--> <!-- Top To Bottom--> <a href="#" class="scrollup text-center redial-bg-primary redial-rounded-circle-50"> <h4 class="text-white mb-0"><i class="icofont icofont-long-arrow-up"></i></h4> </a> <!-- End Top To Bottom--> <!-- Chat--> <!-- End Chat--> <!-- jQuery --> <script> document.addEventListener('DOMContentLoaded', function () { const startDateTimeInput = document.getElementById('start_datetime'); const endDateTimeInput = document.getElementById('end_datetime'); const totalTimeInput = document.getElementById('total_time'); function calculateTotalTime() { const startDateTime = startDateTimeInput.value; const endDateTime = endDateTimeInput.value; if (startDateTime && endDateTime) { const start = new Date(startDateTime); const end = new Date(endDateTime); if (end > start) { const diffMs = end - start; // Difference in milliseconds const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24)); const diffHrs = Math.floor((diffMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); const diffMins = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60)); totalTimeInput.value = `${diffDays}d ${diffHrs}h ${diffMins}m`; } else { alert('End date and time must be after start date and time'); totalTimeInput.value = ''; } } } endDateTimeInput.addEventListener('change', calculateTotalTime); }); </script> <script src="dist/js/plugins.min.js"></script> <script src="dist/js/common.js"></script> </body> </html>