|
|
@@ -14,17 +14,23 @@ $nvp = ["customer_id" => $customer->id];
|
|
|
|
|
|
$id = http::value("id", "int");
|
|
|
$name = http::value("name", "trim");
|
|
|
+$year = http::value("year", "int");
|
|
|
|
|
|
if($id) $nvp["id"] = $id;
|
|
|
if($name) $nvp["name"] = (new Constraint("CONTAINS"))->setValues($name);
|
|
|
+if($year) {
|
|
|
+ $min_dts = "{$year}-01-01 00:00:00";
|
|
|
+ $max_dts = "{$year}-12-31 23:59:59";
|
|
|
+ $nvp["dts_start"] = (new Constraint("BETWEEN"))->setValues($min_dts, $max_dts);
|
|
|
+}
|
|
|
|
|
|
-$projects = Project::query($nvp, ["sort" => "dts_deadline", "order" => "desc"]);
|
|
|
+$projects = Project::query($nvp, ["sort" => "dts_start", "order" => "desc"]);
|
|
|
$templates = Template::load(array_column($projects, "template_id"));
|
|
|
|
|
|
$filter_count = count($nvp) - 1;
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
-View::include("projects", compact("customer", "filter_count", "projects"));
|
|
|
+View::include("projects", compact("customer", "filter_count", "projects", "year"));
|
|
|
View::includeOnce("footer");
|
|
|
|
|
|
?>
|