mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 01:37:02 +02:00
added search capabilities to admin sections
This commit is contained in:
@ -3,8 +3,12 @@
|
||||
|
||||
class ModelPolicyArchiving extends Model {
|
||||
|
||||
public function get_rules() {
|
||||
$query = $this->db->query("SELECT * FROM " . TABLE_ARCHIVING_RULE . " ORDER BY id");
|
||||
public function get_rules($s = '') {
|
||||
if($s) {
|
||||
$query = $this->db->query("SELECT * FROM " . TABLE_ARCHIVING_RULE . " WHERE `from` LIKE ? OR `to` LIKE ? OR subject LIKE ? ORDER BY domain, id", array('%' . $s . '%', '%' . $s . '%', '%' . $s . '%'));
|
||||
} else {
|
||||
$query = $this->db->query("SELECT * FROM " . TABLE_ARCHIVING_RULE . " ORDER BY id");
|
||||
}
|
||||
|
||||
if(isset($query->rows)) { return $query->rows; }
|
||||
|
||||
|
@ -3,8 +3,12 @@
|
||||
|
||||
class ModelPolicyRetention extends Model {
|
||||
|
||||
public function get_rules() {
|
||||
$query = $this->db->query("SELECT * FROM " . TABLE_RETENTION_RULE . " ORDER BY domain, id");
|
||||
public function get_rules($s = '') {
|
||||
if($s) {
|
||||
$query = $this->db->query("SELECT * FROM " . TABLE_RETENTION_RULE . " WHERE domain LIKE ? OR `from` LIKE ? OR subject LIKE ? ORDER BY domain, id", array('%' . $s . '%', '%' . $s . '%', '%' . $s . '%'));
|
||||
} else {
|
||||
$query = $this->db->query("SELECT * FROM " . TABLE_RETENTION_RULE . " ORDER BY domain, id");
|
||||
}
|
||||
|
||||
if(isset($query->rows)) { return $query->rows; }
|
||||
|
||||
|
Reference in New Issue
Block a user