Browse Source

Default Year filter to current year

Alan Lam 7 năm trước cách đây
mục cha
commit
ca227784ac
1 tập tin đã thay đổi với 4 bổ sung và 0 xóa
  1. 4 0
      controllers/projects.php

+ 4 - 0
controllers/projects.php

@@ -16,6 +16,10 @@ $id = http::value("id", "int");
 $name = http::value("name", "trim");
 $year = http::value("year", "int");
 
+if($year === false) {
+	$year = date("Y");
+}
+
 if($id) $nvp["id"] = $id;
 if($name) $nvp["name"] = (new Constraint("CONTAINS"))->setValues($name);
 if($year) {