[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: expenses_report.php
<?php include("../admin/includes/functions/functions.php");?> <?php include("../admin/db/db.php");?> <?php if(!isset($_SESSION['username_Xw211qAAsq4'])) { header('Location: ../auth/'); exit(); } else{ $pageTitle1 = 'Expenses Report'; $shopname = $_SESSION['business_name_Xw211qAAsq4']; $currency = mysqli_query($new,"SELECT currency from barber_admin WHERE business_name = '$shopname'"); $fechC = mysqli_fetch_array($currency); $qurtyCurrency = $fechC['currency']; $active = 1; $stmt1 = $con->prepare("SELECT rate FROM comm_rate WHERE business_name = ? and active = ?"); $stmt1->execute(array($shopname,$active)); $rows = $stmt1->fetchAll(); foreach($rows as $row) { $comRate1 = $row['rate']; if($comRate1 == 0){ $comRate = 0; } else { $comRate = $comRate1; } } if(isset($_POST['god'])){ $fdate= test_input($_POST['fdate']); $tdate= test_input($_POST['tdate']); $newF = date("Y-m-d", strtotime($fdate)); $newT = date("Y-m-d", strtotime($tdate)); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title> <?php echo $shopname;?> || <?php echo $pageTitle1;?></title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- App favicon --> <link rel="shortcut icon" href="../assets/icon.png" type="image/x-icon"> <link rel="icon" href="../assets/icon.png" type="image/x-icon"> <script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <link href="plugins/daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css" /> <!-- App css --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/theme.min.css" rel="stylesheet" type="text/css" /> <style type="text/css"> .table-hover tbody tr:hover td, .table-hover tbody tr:hover th { background-color: #e6ecff; } </style> <style> #preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; background-color: #fff; } #loader { display: block; position: absolute; top: 50%; left: 50%; border: 16px solid #f3f3f3; border-top: 16px solid #3498db; border-radius: 50%; width: 70px; height: 70px; animation: spin 2s linear infinite; } .table-hover tbody tr:hover td, .table-hover tbody tr:hover th { background-color: #e6ecff; } </style> <style type="text/css"> .order-card { color: #fff; } .bg-c-blue { background: linear-gradient(45deg,#4099ff,#73b4ff); } .bg-c-green { background: linear-gradient(45deg,#2ed8b6,#59e0c5); } .bg-c-yellow { background: linear-gradient(45deg,#FFB64D,#ffcb80); } .bg-c-pink { background: linear-gradient(45deg,#FF5370,#ff869a); } .card { border-radius: 5px; -webkit-box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16); box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16); border: none; margin-bottom: 30px; -webkit-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; } .card .card-block { padding: 25px; } .order-card i { font-size: 26px; } .f-left { float: left; } .f-right { float: right; } </style> </head> <body> <div id="preloader"> <div id="loader"></div> </div> <!-- Begin page --> <div id="layout-wrapper"> <div class="header-border"></div> <?php include("includes/template/head.php");?> <?php include("includes/template/side.php");?> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <div class="row no-print"> <div class="col-md-4 col-xl-4"> <div class="card bg-c-blue order-card"> <div class="card-block"> <h6 class="m-b-20" style="color:#fff">Today Expenses</h6> <h2 class="text-right"><span style="color:#fff"> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT sum(item_amount) as price from expenses WHERE date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $todayexpe =$rowsService['price']; } echo $todayss = number_format($todayexpe,2).' '.$qurtyCurrency; ?> </span></h2> </div> </div> </div> <div class="col-md-4 col-xl-4"> <div class="card bg-c-green order-card"> <div class="card-block"> <h6 class="m-b-20" style="color:#fff">A Week Expenses</h6> <h2 class="text-right"><span style="color:#fff"> <?php $pastdate= date("Y-m-d", strtotime("-1 week")); $crrntdte=date("Y-m-d"); $stmtServices = $con->prepare("SELECT sum(item_amount) as price from expenses WHERE date between '$pastdate' AND '$crrntdte' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $weekexpe =$rowsService['price']; } echo $week = number_format($weekexpe,2).' '.$qurtyCurrency; ?> </span></h2> </div> </div> </div> <div class="col-md-4 col-xl-4"> <div class="card bg-c-yellow order-card"> <div class="card-block"> <h6 class="m-b-20" style="color:#fff">A Month Expenses</h6> <h2 class="text-right"><span style="color:#fff"> <?php $monthdate= date("Y-m-d", strtotime("-1 month")); $crrntdte=date("Y-m-d"); $stmtServices = $con->prepare("SELECT sum(item_amount) as price from expenses WHERE date between '$monthdate' AND '$crrntdte' and business_name = ? "); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $monthlyexpe =$rowsService['price']; } echo $monthly = number_format($monthlyexpe,2).' '.$qurtyCurrency; ?> </span></h2> </div> </div> </div> </div> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <form method="POST" class="form-inline" > <div class="col-md-4"> <label>Search from this Date</label> <div class="form-group"> <input type="date" class="form-control date" name="fdate" style="width:100%"> </div> </div> <div class="col-md-4"> <label>To that Date</label> <div class="form-group"> <input type="date" class="form-control date" name="tdate" style="width:100%"> </div> </div> <div class="col-md-2"> <div class="md-form"> <label>Click to search</label> <button type="submit" name="god" class="btn btn-primary" style="width:100%"> Search</button> </div> </div> </form> <div class="table-responsive"> <table class="table table-bordered"> <br /> <center><h3>Expenses Report</h3></center> <center> From <?php echo $newF; ?> to. <?php echo $newT ;?> </center> <thead> <tr> <th>Vendor Name</th> <th>Item name</th> <th>Item Price</th> <th>Expenses Date</th> </tr> </thead> <tbody> <tr> <?php $stmt = $con->prepare("SELECT * FROM expenses,vendors WHERE expenses.vendor_id = vendors.vendor_id AND expenses.date between '$newF' and '$newT' and expenses.business_name = ? "); $stmt->execute(array($shopname)); $rows = $stmt->fetchAll(); foreach($rows as $service){ $tt+= $service['item_amount']; ?> <td><?php echo $service['vendor_name'];?></td> <td><?php echo $service['item_name'];?></td> <td><?php echo $service['item_amount'];?></td> <td><?php echo $service['date'];?></td> </tr> <?php } ?> <tr> <th scope="row"></th> <td colspan="1"></td> <td>Total : </b><?php echo number_format($tt,2).' '.$qurtyCurrency;?></td> <td></td> </tr> </tbody> </table> </div> </div> </div> </div> <!-- container-fluid --> </div> <!-- End Page-content --> <?php include("includes/template/newfooter.php");?> </div> <!-- end main content--> </div> <!-- END layout-wrapper --> <!-- Overlay--> <div class="menu-overlay"></div> <?php include("includes/modals/ServicesModal.php");?> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/bootstrap.bundle.min.js"></script> <script src="assets/js/metismenu.min.js"></script> <script src="assets/js/waves.js"></script> <script src="assets/js/simplebar.min.js"></script> <script src="plugins/raphael/raphael.min.js"></script> <script src="assets/pages/dashboard-demo.js"></script> <script src="assets/js/theme.js"></script> <script src="plugins/autonumeric/autoNumeric-min.js"></script> <script src="plugins/bootstrap-datepicker/bootstrap-datepicker.min.js"></script> <script src="plugins/daterangepicker/daterangepicker.js"></script> <script src="plugins/bootstrap-maxlength/bootstrap-maxlength.min.js"></script> <script src="plugins/moment/moment.js"></script> <script src="plugins/daterangepicker/daterangepicker.js"></script> <script src="plugins/select2/select2.min.js"></script> <script src="plugins/switchery/switchery.min.js"></script> <script src="plugins/bootstrap-colorpicker/bootstrap-colorpicker.min.js"></script> <script src="plugins/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js"></script> <!-- Custom Js --> <script src="assets/pages/advanced-plugins-demo.js"></script> <script src="assets/pages/datatables-demo.js"></script> <script type="text/javascript"> document.onreadystatechange = function() { if (document.readyState !== "complete") { document.querySelector("#preloader").style.display = "block"; } else { document.querySelector("#preloader").style.display = "none"; } }; </script> <!-- jQuery --> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.74 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002