Server IP : 103.53.40.154 / Your IP : 18.224.55.193 Web Server : Apache System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : ppcad7no ( 715) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/ppcad7no/designexstone.in/../hakkipikiadivasi.com/../shsindia.com/crm/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include_once('include/config.php'); if (!isLoggedIn()) { $_SESSION['msg'] = "You must log in first"; header('location: login.php'); } if (!isAdmin()) { $_SESSION['msg'] = "You are not Admin"; header('location: login.php'); } if ($_SERVER["REQUEST_METHOD"] === "POST") { if (isset($_POST['active'])) { // Handle the active logic here $checkedIDs = $_POST['checkedIDs']; foreach ($checkedIDs as $pageID) { $sql = "UPDATE salary_manage SET status='Approve' WHERE id='$pageID'"; $result = mysqli_query($db, $sql) or die("Query unsuccessful"); mysqli_query($db, "INSERT INTO `notification`(`emp_id`, `cus_id`, `info`, `action`, `action_by`, `user_type`, `date`) VALUES ('".$_POST['pageID']."','','Salary Approve','Salary Status','".$_SESSION['user']['id']."','".$_SESSION['user']['user_type']."','$currentDate')"); } if ($result) { echo "<script> window.alert('Activated successfully.'); window.location.href = 'salary-management.php'; </script>"; } } if (isset($_POST['inactive'])) { // Handle the inactive logic here $checkedIDs = $_POST['checkedIDs']; foreach ($checkedIDs as $pageID) { $sql = "UPDATE salary_manage SET status='Pending' WHERE id='$pageID'"; $result = mysqli_query($db, $sql) or die("Query unsuccessful"); mysqli_query($db, "INSERT INTO `notification`(`emp_id`, `cus_id`, `info`, `action`, `action_by`, `user_type`, `date`) VALUES ('".$_POST['pageID']."','','Salary Pending','Salary Status','".$_SESSION['user']['id']."','".$_SESSION['user']['user_type']."','$currentDate')"); } if ($result) { echo "<script> window.alert('Deactivated successfully.'); window.location.href = 'salary-management.php'; </script>"; } } if (isset($_POST['delete'])) { // Handle the inactive logic here $checkedIDs = $_POST['checkedIDs']; foreach ($checkedIDs as $pageID) { $sql = "DELETE FROM `salary_manage` WHERE id='$pageID'"; $result = mysqli_query($db, $sql) or die("Query unsuccessful"); mysqli_query($db, "INSERT INTO `notification`(`emp_id`, `cus_id`, `info`, `action`, `action_by`, `user_type`, `date`) VALUES ('".$_POST['pageID']."','','Salary Request Delete','Salary Status','".$_SESSION['user']['id']."','".$_SESSION['user']['user_type']."','$currentDate')"); } if($result){ echo "<script> window.alert('Deleted successfully.'); window.location.href = 'salary-management.php'; </script>"; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <?php include "top-links.php"?> </head> <body> <div class="wrapper"> <?php include "header.php"?> <?php include "sidebar.php"?> <div class="content-page"> <div class="content"> <?php // echo'<h1 class="page-title" style="text-align:center; padding-top:30px;">Coming Soon! </h1>'; // echo'<h4 class="page-title" style="text-align:center;">This Section is under construction.</h4>'; // exit; ?> <!-- Start Content--> <div class="container-fluid"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h4 class="header-title">Salary Report</h4> </div> <div class="card-body"> <table id="myTable" class="table table-striped dt-responsive nowrap w-100"> <thead> <tr> <th>Emp. Name</th> <th>Emp. Supervisor</th> <th>Emp. Company</th> <th class="">Emp. Salary</th> <th class="">Day Salary</th> <th class="">Date</th> <th class="">Status</th> <th class="">Slip Img</th> </tr> </thead> <tbody> <?php $limit = isset($_GET['entries']) ? $_GET['entries'] : 20; $page = isset($_GET['page']) ? $_GET['page'] : 1; $start = ($page - 1) * $limit; $searchTerm = isset($_GET['id']) ? $_GET['id'] : ''; $s = mysqli_fetch_assoc(mysqli_query($db, "select * from tbl_employee where emp_name='".$searchTerm."' ")); $sid = $s['emp_id']; $sql = "SELECT * FROM `salary_manage`"; if (!empty($searchTerm)) { $sql .= " WHERE `emp_id` LIKE '%$searchTerm%'"; } $sql .= " ORDER BY emp_id DESC LIMIT $start, $limit"; $run = mysqli_query($db, $sql) or die("Query Not run"); $count = $start; while ($data = mysqli_fetch_assoc($run)) { $count++; ?> <tr> <td> <?php $s = mysqli_fetch_assoc(mysqli_query($db, "select * from tbl_employee where emp_id='".$data["emp_id"]."' ")); echo $s['emp_name'] . '-' . $s['emp_number']; ?> </td> <td> <?php $d = mysqli_fetch_assoc(mysqli_query($db, "select * from login_tbl where id='".$s["emp_supervisor_id"]."' ")); echo $d['name']; ?> </td> <td> <?php $ds = mysqli_fetch_assoc(mysqli_query($db, "select * from tbl_customer where cus_id='".$s["emp_company_id"]."' ")); echo $ds['cp_name']; ?> </td> <td>₹<?php echo $s['slr']; ?> </td> <?php $salary = $s['slr']; // Monthly salary $dth = $data['date']; $month = date('m', strtotime($data['date'])); // May (Month 5) $year = date('Y', strtotime($data['date'])); $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year); $dailySalary = $salary / $daysInMonth; ?> <td> <?= $daysalary = number_format($dailySalary, 2)?> </td> <td><?php echo $data['date']; ?> </td> <td><?php echo $data['status']; ?> </td> <td> <a target="_blank" href="./images/<?php echo $data['slip_img']; ?>"><i class="ri-eye-fill" style="font-size: medium; color: #1a2942;" title="View"></i> </a> </td> </tr> <tr> <td> <?php $totalsalry = 0; $ds = mysqli_query($db, "select * from tbl_attendance where atndc_by_id='".$data["emp_id"]."' and atndc_datetime like '%$dth%' and status='P' ; "); echo "</br>Total Prasent: ". $totalp = mysqli_num_rows($ds); $totalsalry += $daysalary * $totalp; ?> </td> <td> <?php $ds = mysqli_query($db, "select * from tbl_attendance where atndc_by_id='".$data["emp_id"]."' and atndc_datetime like '%$dth%' and status='A' ; "); echo "</br>Total Absent: ". mysqli_num_rows($ds); ?> </td> <td> <?php $ds = mysqli_query($db, "select * from tbl_attendance where atndc_by_id='".$data["emp_id"]."' and atndc_datetime like '%$dth%' and status='H' ; "); echo "</br>Total Half Day: ". $totalhalf = mysqli_num_rows($ds); $chhs = $daysalary / 2; $totalsalry += $chhs * $totalhalf; ?> </td> <td> <?php $ds = mysqli_query($db, "select * from tbl_attendance where atndc_by_id='".$data["emp_id"]."' and atndc_datetime like '%$dth%' and status='SL' ; "); echo "</br>Short Leave: ". mysqli_num_rows($ds); ?> </td> <td> <?php $ds = mysqli_query($db, "select * from tbl_attendance where atndc_by_id='".$data["emp_id"]."' and atndc_datetime like '%$dth%' and status='R' ; "); echo "</br>Reject Leave: ". mysqli_num_rows($ds); ?> </td> <td> <?php $sundays = 0; $saturdays = 0; for ($day = 1; $day <= $daysInMonth; $day++) { // Get the day of the week for the current day $date = "$year-$month-$day"; $dayOfWeek = date('N', strtotime($date)); // 'N' returns 1 (for Monday) through 7 (for Sunday) // Check if it's a Sunday or Saturday if ($dayOfWeek == 7) { // Sunday $sundays++; } if ($dayOfWeek == 6) { // Saturday $saturdays++; } } echo "</br>Month Sunday : ".$saturdays; ?> </td> <td> <?php echo "</br>Month Saturday : " .$sundays; ?> </td> <td> <?php echo "</br>Total Salary : " .$totalsalry; ?> </td> </tr> <?php } ?> </tbody> </table> </div> <!-- end card body--> </div> <!-- end card --> </div><!-- end col--> </div> </div> </div> </div> </div> <script> function togglePasswordVisibility() { var passwordField = document.getElementById('password'); var passwordToggle = document.getElementById('password-toggle'); if (passwordField.type === 'password') { passwordField.type = 'text'; passwordToggle.className = 'fa fa-eye-slash'; } else { passwordField.type = 'password'; passwordToggle.className = 'fa fa-eye'; } } </script> <?php include "footer.php"?> </body> </html>