| @@ 66-72 (lines=7) @@ | ||
| 63 | ||
| 64 | $newFilter = false; |
|
| 65 | ||
| 66 | if (isset($_POST['filter_attribute_id'])) { |
|
| 67 | if (intval($_POST['filter_attribute_id']) != 0) { |
|
| 68 | $criteria->add(new Criteria('attribute_id', intval($_POST['filter_attribute_id']), '=')); |
|
| 69 | } |
|
| 70 | $filter_attribute_id = intval($_POST['filter_attribute_id']); |
|
| 71 | $newFilter = true; |
|
| 72 | } |
|
| 73 | if (isset($_POST['filter_attribute_title']) && xoops_trim($_POST['filter_attribute_title']) != '') { |
|
| 74 | $criteria->add(new Criteria('attribute_title', '%' . $_POST['filter_attribute_title'] . '%', 'LIKE')); |
|
| 75 | $filter_attribute_title = $_POST['filter_attribute_title']; |
|
| @@ 78-82 (lines=5) @@ | ||
| 75 | $filter_attribute_title = $_POST['filter_attribute_title']; |
|
| 76 | $newFilter = true; |
|
| 77 | } |
|
| 78 | if (isset($_POST['filter_attribute_product_id']) && intval($_POST['filter_attribute_product_id']) != 0) { |
|
| 79 | $criteria->add(new Criteria('attribute_product_id', intval($_POST['filter_attribute_product_id']), '=')); |
|
| 80 | $filter_attribute_product_id = intval($_POST['filter_attribute_product_id']); |
|
| 81 | $newFilter = true; |
|
| 82 | } |
|
| 83 | if (isset($_POST['filter_attribute_weight']) && intval($_POST['filter_attribute_weight']) != 0) { |
|
| 84 | $criteria->add(new Criteria('attribute_weight', intval($_POST['filter_attribute_weight']), '=')); |
|
| 85 | $filter_attribute_weight = intval($_POST['filter_attribute_weight']); |
|
| @@ 83-87 (lines=5) @@ | ||
| 80 | $filter_attribute_product_id = intval($_POST['filter_attribute_product_id']); |
|
| 81 | $newFilter = true; |
|
| 82 | } |
|
| 83 | if (isset($_POST['filter_attribute_weight']) && intval($_POST['filter_attribute_weight']) != 0) { |
|
| 84 | $criteria->add(new Criteria('attribute_weight', intval($_POST['filter_attribute_weight']), '=')); |
|
| 85 | $filter_attribute_weight = intval($_POST['filter_attribute_weight']); |
|
| 86 | $newFilter = true; |
|
| 87 | } |
|
| 88 | if (isset($_POST['filter_attribute_type']) && intval($_POST['filter_attribute_type']) != 0) { |
|
| 89 | $criteria->add(new Criteria('attribute_type', intval($_POST['filter_attribute_type']), '=')); |
|
| 90 | $filter_attribute_type = intval($_POST['filter_attribute_type']); |
|
| @@ 88-92 (lines=5) @@ | ||
| 85 | $filter_attribute_weight = intval($_POST['filter_attribute_weight']); |
|
| 86 | $newFilter = true; |
|
| 87 | } |
|
| 88 | if (isset($_POST['filter_attribute_type']) && intval($_POST['filter_attribute_type']) != 0) { |
|
| 89 | $criteria->add(new Criteria('attribute_type', intval($_POST['filter_attribute_type']), '=')); |
|
| 90 | $filter_attribute_type = intval($_POST['filter_attribute_type']); |
|
| 91 | $newFilter = true; |
|
| 92 | } |
|
| 93 | ||
| 94 | if ($filter_attribute_id == 0 && $filter_attribute_title == '' && $filter_attribute_weight == 0 && $filter_attribute_type == 0) { |
|
| 95 | $newFilter = true; |
|
| @@ 52-58 (lines=7) @@ | ||
| 49 | $criteria = new CriteriaCompo(); |
|
| 50 | $criteria->add(new Criteria('product_id', 0, '<>')); |
|
| 51 | ||
| 52 | if (isset($_POST['filter_product_id'])) { |
|
| 53 | if (intval($_POST['filter_product_id']) != 0) { |
|
| 54 | $criteria->add(new Criteria('product_id', intval($_POST['filter_product_id']), '=')); |
|
| 55 | } |
|
| 56 | $filter_product_id = intval($_POST['filter_product_id']); |
|
| 57 | $newFilter = true; |
|
| 58 | } |
|
| 59 | if (isset($_POST['filter_product_cid']) && intval($_POST['filter_product_cid']) != 0) { |
|
| 60 | $criteria->add(new Criteria('product_cid', intval($_POST['filter_product_cid']), '=')); |
|
| 61 | $filter_product_cid = intval($_POST['filter_product_cid']); |
|
| @@ 59-63 (lines=5) @@ | ||
| 56 | $filter_product_id = intval($_POST['filter_product_id']); |
|
| 57 | $newFilter = true; |
|
| 58 | } |
|
| 59 | if (isset($_POST['filter_product_cid']) && intval($_POST['filter_product_cid']) != 0) { |
|
| 60 | $criteria->add(new Criteria('product_cid', intval($_POST['filter_product_cid']), '=')); |
|
| 61 | $filter_product_cid = intval($_POST['filter_product_cid']); |
|
| 62 | $newFilter = true; |
|
| 63 | } |
|
| 64 | if (isset($_POST['filter_product_recommended']) && intval($_POST['filter_product_recommended']) != 0) { |
|
| 65 | if (intval($_POST['filter_product_recommended']) == 1) { |
|
| 66 | $criteria->add(new Criteria('product_recommended', '0000-00-00', '<>')); |
|
| @@ 83-87 (lines=5) @@ | ||
| 80 | $filter_product_sku = $_POST['filter_product_sku']; |
|
| 81 | $newFilter = true; |
|
| 82 | } |
|
| 83 | if (isset($_POST['filter_product_online']) && intval($_POST['filter_product_online']) != 0) { |
|
| 84 | $criteria->add(new Criteria('product_online', intval($_POST['filter_product_online']) - 1, '=')); |
|
| 85 | $filter_product_online = intval($_POST['filter_product_online']); |
|
| 86 | $newFilter = true; |
|
| 87 | } |
|
| 88 | if (isset($_POST['filter_product_price']) && intval($_POST['filter_product_price']) != 0) { |
|
| 89 | $criteria->add(new Criteria('product_price', intval($_POST['filter_product_price']), '>=')); |
|
| 90 | $filter_product_price = intval($_POST['filter_product_price']); |
|
| @@ 88-92 (lines=5) @@ | ||
| 85 | $filter_product_online = intval($_POST['filter_product_online']); |
|
| 86 | $newFilter = true; |
|
| 87 | } |
|
| 88 | if (isset($_POST['filter_product_price']) && intval($_POST['filter_product_price']) != 0) { |
|
| 89 | $criteria->add(new Criteria('product_price', intval($_POST['filter_product_price']), '>=')); |
|
| 90 | $filter_product_price = intval($_POST['filter_product_price']); |
|
| 91 | $newFilter = true; |
|
| 92 | } |
|
| 93 | if ($filter_product_id == 0 && $filter_product_cid == 0 && $filter_product_recommended == 0 && $filter_product_price == 0 && $filter_product_online == 0 && $filter_product_title == '' && $filter_product_sku == '') { |
|
| 94 | $newFilter = true; |
|
| 95 | } |
|