File "report_all.php"

Full path: /home/atrmarke/public_html/atrdemolive.site/bshop/log/report_all.php
File size: 0.02 KB (17.16 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php
include("../db/cn.php");
ob_start();
if (isset($_SESSION['user_name']) && isset($_SESSION['user_role']) && isset($_SESSION['outlet_name']) && isset($_SESSION['outlet_address'])) {
    $userName = $_SESSION['user_name'];
    $userRole = $_SESSION['user_role'];
    $outlet_address = $_SESSION['outlet_address'];
    $outlet_name = $_SESSION['outlet_name'];
}
ob_end_flush();

	if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['transfer_add'])){
    $from_i = $_POST["from_i"];
    $to_i = $_POST["to_i"];
    $desc_i = $_POST["desc_i"];
    $amount_i = $_POST["amount_i"];
    $date_time = date("Y-m-d");

	
	mysqli_query($connection,"insert into transfer (from_i,to_i,desc_i,amount_i,date_time,user_name,role,outlet_name,outlet_address)
	values('".$from_i."','".$to_i."','".$desc_i."','".$amount_i."','".$date_time."','".$userName."','".$userRole."',
	'".$outlet_name."','".$outlet_address."')");
	
	echo "<script type='text/javascript'>window.location.href = 'report_all.php';</script>";
	
	}
	
	
	if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['withdraw_add'])){
	$userName1 = $_SESSION['user_name'];
     $userRole1 = $_SESSION['user_role'];
	@$name_detailnew = $_POST['desc1'];
	@$amountnew = $_POST["amount1"];
	$paid_wd = $_POST["paid_wd"];

	$date_timenew = date("Y-m-d");
	mysqli_query($connection,"insert into withdraw(name_detail,amount,paid_by,date_time,login_user,user_role,outlet_name,outlet_address)
	values('".$name_detailnew."','".$amountnew."','".$paid_wd."','".$date_timenew."','".$userName1."','".$userRole1."','".$outlet_name."','".$outlet_address."') ");
	
	}	
	
	
ob_end_flush();	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reporting</title>
    <!-- Bootstrap CSS -->
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <link rel="stylesheet" href="css/custom_css.css" />
         <!-- jsPDF and AutoTable -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.20/jspdf.plugin.autotable.min.js"></script>
</head>
<style>
 #table-container-wrapper {
    max-height: 460px; /* Adjust the maximum height as needed */
    overflow-y: auto; /* Enable vertical scroll when content overflows */
}


@media (max-width: 880px) {
    .col-4 {
        width: 33.33% !important;
    }
    .fa-wifi {
        display: none !important;
    }
    .col-6 {
        width: 50% !important;
    }
}

@media (min-width: 880px) {
    .sidebar {
        width: 100%;
        /* Change sidebar width to 100% on mobile */
        max-width: 120px; /* Set maximum width for the sidebar */
    }
}

@media (min-width: 880px) {
    .main-content {
        margin-left: ; /* Width of the sidebar */
    }
}

/* Added new class to control overlay */
.overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: none; /* Initially hidden */
} /* Custom styles for sidebar */
    .sidebar {
        width: 100px;
        background: linear-gradient(180deg, #3C2F23, #060606);
        position: fixed;
        bottom: 0;
        top: 60px;
        transition: transform 0.3s ease-in-out;
        transform: translateX(0);
        z-index: 1;
        height: 100%;
        border-radius: 0px;
		   transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    }

    .sidebar.hide {
        transform: translateX(-100px);
        /* Move sidebar out of the viewport when it is hidden */
    }

    .sidebar .nav-item {
        padding: 10px 0;
        text-align: center;
        position: relative;
        font-size: 12px;
    }

    .sidebar .nav-link {
        color: #fff;
        position: relative;
        /* Ensure icon and text are positioned relative to the nav link */
        z-index: 2;
        /* Ensure the text and icon are above the hover background */
    }

    .sidebar .nav-link i {
        margin-bottom: 5px;
        /* Adjust the margin of the icon */
    }

    /* Custom styles for hover effect */
    .sidebar .nav-item:hover:after {
        background-color: #fff;
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        /* Ensure the hover background is below the text and icon */
    }

    .sidebar .nav-item:hover .nav-link {
        color: #503F2E;
    }

    /* Custom styles for divider */
    .sidebar .nav-item:after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 1px;
        background-color: #fff;
        transition: height 0.3s ease-in-out;
        /* Transition effect for smooth animation */
    }

    /* Custom styles for header */
 .header {
		
       background: linear-gradient(100deg, #3C2F23, #060606);
        color: #fff;
        padding: 10px;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 2;
        height: 69px;
        box-shadow: #FFF 2px 0px 0px 0px;
        /* Ensure header appears above sidebar */
    }

    .header .navbar-toggler {
        color: #fff;
    }

    .header .navbar-toggler-icon {
        color: #fff;
        /* Set the color of the toggle button to white */
    }

    .header .navbar-toggler.white {
        color: #fff !important;
        /* Ensure the toggle button is white */
    }

    .header .navbar-brand {
        color: #fff;
        /* Set navbar brand text color to white */
    }

    .header .nav-item .nav-link {
        color: #fff;
        /* Set nav link text color to white */
    }

.main-content {
    margin-top: 50px; /* Height of fixed header */
    margin-left: 70px; /* Initially, set margin-left to 0 */
    padding-top: 30px; /* Height of fixed header */
    transition: margin-left 0.3s ease-in-out; /* Add transition for smoother animation */
}


    /* Custom styles for search bar */
    .search-container {
        display: flex;
        align-items: center;
       width:100%;
        margin: 2px auto;


        float:left;
	}

/* Updated hide class to apply to the overlay */
.sidebar.hide, .overlay.hide {
    transform: translateX(-100%);
}

    .search-input {
        width: 100%;
        padding: 10px 30px 10px 10px;
        /* Adjust padding to accommodate the icon */
        border: 1px solid #ccc;
        border-radius: 20px;
        font-size: 16px;
    }

    .search-icon {
        position: relative;
        left: -25px;
        /* Adjust the position of the icon */
        color: #aaa;
    }

    .search-icon i {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }    .btn-dark {
        background: #503F2E;
        color: #fff;
        border: 1px solid #503F2E;
    }

    .btn-dark:hover {
        background: #fff;
        color: #503F2E;
        border: 1px solid #503F2E;
    }

    .bg-dark2 {
        background: #503F2E;
        color: #fff;
    }


    .modal-content {
        animation: modal-animation 0.5s;
    }

    @keyframes modal-animation {
        from {
            opacity: 0;
            transform: scale(0.8);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }	
    		.card {
    transition: all 0.3s ease-in-out;
    padding:10px;
}

.card:hover {
    background: #503F2E;
    color: #fff;
    box-shadow: 0 0 15px rgba(60, 47, 35, 0.7); /* Soft glow effect with color #1A5319 and opacity */
    border-radius: 10px;
	border:1px solid #fff;
	
}
	
</style>
<body>
<?php include("common/hd.php"); ?>
<?php include("common/sd.php"); ?>
<div class="main-content">
    <br>
    <div class="container">
        <div class="row">
            
            <div class="col-sm-3">
                
                <h1 class="mb-3">Reports</h1>
                
            </div>
            <div class="col-sm-6"></div>
            <div class="col-sm-3">
                 <button type="button" class="btn btn-dark " data-toggle="modal" data-target="#addWithdrawModal">
                Add Transfer</button>
                <a href="report_p.php" class="btn btn-dark btn-lg" ><i class="fas fa-arrow-left fa-1x"></i></a>
            </div>
            
        </div>
    </div>
    <br>
    <div class="container">
        
        <div class="row">
            <div class="col-sm-3 mb-4">
                <center> <div class="card">
                <div class="card-body">
                    <h5 class="card-title"><i class="fas fa-money-bill-wave fa-1x text-white" style="background:#503F2E;padding:20px; border-radius:90px; border:3px solid #fff;"></i></h5>
                    <p class="card-text"> <h5>Cash Reports</h5></p>
                    <a href="report_c.php" class="btn btn-sm btn-dark">Check Reports</a>
                </div>
            </div> </center>
                
            </div>
              <div class="col-sm-3 mb-4">
                <center> <div class="card">
                <div class="card-body">
                    <h5 class="card-title"><i class="fas fa-university fa-1x text-white" style="background:#503F2E;padding:20px; border-radius:90px; border:3px solid #fff;"></i></h5>
                    <p class="card-text"> <h5> Bank 1  Reports</h5></p>
                    <a href="report_bank.php" class="btn btn-sm btn-dark">Check Reports</a>
                </div>
            </div> </center>
                
            </div>
              <div class="col-sm-3 mb-4">
                <center> <div class="card">
                <div class="card-body">
                    <h5 class="card-title"><i class="fas fa-university fa-1x text-white" style="background:#503F2E;padding:20px; border-radius:90px; border:3px solid #fff;"></i></h5>
                    <p class="card-text"> <h5> Bank 2 Reports</h5></p>
                    <a href="report_bank2.php" class="btn btn-sm btn-dark">Check Reports</a>
                </div>
            </div> </center>
                
            </div>
            <div class="col-sm-3 mb-4">
                <center> <div class="card">
                <div class="card-body">
                    <h5 class="card-title"><i class="fas fa-university fa-1x text-white" style="background:#503F2E;padding:20px; border-radius:90px; border:3px solid #fff;"></i></h5>
                    <p class="card-text"> <h5>Bank 3 Report</h5></p>
                    <a href="report_bank3.php" class="btn btn-sm btn-dark">Check Reports</a>
                </div>
            </div> </center>
            </div>
             
              
                
            </div>
             
                
            </div>
           
        </div>
        
    </div>
    <div class="modal fade" id="addWithdrawModal" tabindex="-1" role="dialog" 
            aria-labelledby="addwithdrawModalLabel" aria-hidden="true" style="margin-top:80px;">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title text-capitalize" id="addwithdrawModalLabel">Transfer</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <!-- Form for adding purchase -->
                            <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data">
                            
                                <div class="form-group">
                                    <lable>From</lable>
                                    <select name="from_i" class="form-control">
                                        <option valuse="">Select</option>
                                        <option value="cash">Cash</option>
                                    <option value="bank1">Bank 1</option>
                                    <option value="bank2">Bank 2 </option>
                                    <option value="bank3">Bank 3</option>
                                    <option value="other">Other</option>
                                    
                                        
                                    </select>
                                    
                                </div>
                                
                                <div class="form-group">
                                    <lable>To</lable>
                                    <select name="to_i" class="form-control">
                                        <option valuse="">Select</option>
                                        <option value="cash">Cash</option>
                                         <option value="bank1">Bank 1</option>
                                    <option value="bank2">Bank 2 </option>
                                    <option value="bank3">Bank 3</option>
                                    <option value="other">Other</option>
                                    
                                        
                                    </select>
                                    
                                </div>
                                
                                <div class="form-group">
                                    <label>Description</label>
                                <input type="text" name="desc_i" class="form-control" >
                                </div>
                               
                                <div class="form-group">
                                    <label>Amount</label>
                                <input type="text" name="amount_i" class="form-control" >
                                </div>
                          
                                <button type="submit"  class="btn btn-dark" name="transfer_add">Enter</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script>
    $(document).ready(function(){
        $("#searchInput").on("keyup", function() {
            var value = $(this).val().toLowerCase();
            $("table tr").filter(function() {
                // Exclude header row from filtering
                if (!$(this).hasClass('header-row')) {
                    $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
                }
            });
        });
    });
	
	
document.addEventListener("DOMContentLoaded", function () {
    var sidebar = document.getElementById("sidebar");
    var overlay = document.createElement("div");
    overlay.classList.add("overlay");
    document.body.appendChild(overlay);

    function toggleSidebar() {
        sidebar.classList.toggle("hide");
        overlay.classList.toggle("hide");

        var mainContent = document.querySelector(".main-content");
        if (sidebar.classList.contains("hide")) {
            mainContent.style.marginLeft = "0";
        } else {
            mainContent.style.marginLeft = "100px"; // Width of the sidebar
        }
    }

    overlay.addEventListener("click", function () {
        toggleSidebar();
    });

    // Add toggle functionality to navbar toggler
    var navbarToggler = document.querySelector(".navbar-toggler");
    navbarToggler.addEventListener("click", function () {
        toggleSidebar();
    });

    // Automatically hide sidebar on all screen sizes
    // sidebar.classList.add("hide");
    // overlay.classList.add("hide");
    
    // Add class to body to prevent scrolling when sidebar is open
    // document.body.classList.add("noscroll");

    // Check if screen size is larger than a certain threshold (e.g., 768px for desktop screens)
    function checkScreenSize() {
        if (window.innerWidth > 768) {
            sidebar.classList.remove("hide");
            overlay.classList.remove("hide");
        } else {
            sidebar.classList.add("hide");
            overlay.classList.add("hide");
        }
    }

    // Check screen size on initial load and whenever the window is resized
    checkScreenSize();
    window.addEventListener("resize", checkScreenSize);
});
 
</script>
</html>