|
@@ -1,4 +1,4 @@
|
|
|
-<?php
|
|
|
|
|
|
|
+<?php /** @noinspection PhpUnhandledExceptionInspection */
|
|
|
|
|
|
|
|
Core::addBreadcrumb("/account", "Account");
|
|
Core::addBreadcrumb("/account", "Account");
|
|
|
Core::addBreadcrumb("/account/projects", "Projects");
|
|
Core::addBreadcrumb("/account/projects", "Projects");
|
|
@@ -31,11 +31,13 @@ else {
|
|
|
$id = http::value("id", "int");
|
|
$id = http::value("id", "int");
|
|
|
$name = http::value("name", "trim");
|
|
$name = http::value("name", "trim");
|
|
|
$year = http::value("year", "int");
|
|
$year = http::value("year", "int");
|
|
|
|
|
+$report_month = http::value("report_month", "db");
|
|
|
|
|
|
|
|
if($year === false) {
|
|
if($year === false) {
|
|
|
$year = date("Y");
|
|
$year = date("Y");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
if($id) $nvp["id"] = $id;
|
|
if($id) $nvp["id"] = $id;
|
|
|
if($name) $nvp["name"] = (new Constraint("CONTAINS"))->setValues($name);
|
|
if($name) $nvp["name"] = (new Constraint("CONTAINS"))->setValues($name);
|
|
|
if($year) {
|
|
if($year) {
|
|
@@ -43,6 +45,9 @@ if($year) {
|
|
|
$max_dts = "{$year}-12-31 23:59:59";
|
|
$max_dts = "{$year}-12-31 23:59:59";
|
|
|
$nvp["dts_start"] = (new Constraint("BETWEEN"))->setValues($min_dts, $max_dts);
|
|
$nvp["dts_start"] = (new Constraint("BETWEEN"))->setValues($min_dts, $max_dts);
|
|
|
}
|
|
}
|
|
|
|
|
+if($report_month) {
|
|
|
|
|
+ $nvp["dts_report"] = (new Constraint("BEGINS_WITH"))->setValues($report_month);
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
$projects = Project::query($nvp, ["sort" => "dts_start", "order" => "desc"]);
|
|
$projects = Project::query($nvp, ["sort" => "dts_start", "order" => "desc"]);
|
|
|
$templates = Template::load(array_column($projects, "template_id"));
|
|
$templates = Template::load(array_column($projects, "template_id"));
|
|
@@ -50,5 +55,5 @@ $templates = Template::load(array_column($projects, "template_id"));
|
|
|
$filter_count = count($nvp);
|
|
$filter_count = count($nvp);
|
|
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
-View::include("projects", compact("customer", "filter_count", "projects", "year"));
|
|
|
|
|
|
|
+View::include("projects", compact("customer", "filter_count", "projects", "year", "report_month"));
|
|
|
View::includeOnce("footer");
|
|
View::includeOnce("footer");
|