Changeset 18612 for branches/version-2_4-dev
- Timestamp:
- 2010/03/31 12:35:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_4-dev/data/class/pages/admin/customer/LC_Page_Admin_Customer.php
r18600 r18612 471 471 return $objErr->arrErr; 472 472 } 473 474 function lfSetWhere($arrForm){475 foreach ($arrForm as $key => $val) {476 477 $val = sfManualEscape($val);478 479 if($val == "") continue;480 481 switch ($key) {482 case 'product_id':483 $where .= " AND product_id = ?";484 $arrval[] = $val;485 break;486 case 'product_class_id':487 $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_class_id = ?)";488 $arrval[] = $val;489 break;490 case 'name':491 $where .= " AND name ILIKE ?";492 $arrval[] = "%$val%";493 break;494 case 'category_id':495 list($tmp_where, $tmp_arrval) = sfGetCatWhere($val);496 if($tmp_where != "") {497 $where.= " AND $tmp_where";498 $arrval = array_merge($arrval, $tmp_arrval);499 }500 break;501 case 'product_code':502 $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)";503 $arrval[] = "%$val%";504 break;505 case 'startyear':506 $date = sfGetTimestamp($_POST['startyear'], $_POST['startmonth'], $_POST['startday']);507 $where.= " AND update_date >= ?";508 $arrval[] = $date;509 break;510 case 'endyear':511 $date = sfGetTimestamp($_POST['endyear'], $_POST['endmonth'], $_POST['endday']);512 $where.= " AND update_date <= ?";513 $arrval[] = $date;514 break;515 case 'product_flag':516 global $arrSTATUS;517 $product_flag = sfSearchCheckBoxes($val);518 if($product_flag != "") {519 $where.= " AND product_flag LIKE ?";520 $arrval[] = $product_flag;521 }522 break;523 case 'status':524 $tmp_where = "";525 foreach ($val as $element){526 if ($element != ""){527 if ($tmp_where == ""){528 $tmp_where.="AND (status LIKE ? ";529 }else{530 $tmp_where.="OR status LIKE ? ";531 }532 $arrval[]=$element;533 }534 }535 if ($tmp_where != ""){536 $tmp_where.=")";537 $where.= "$tmp_where";538 }539 break;540 default:541 break;542 }543 }544 }545 473 } 546 474 ?>
Note: See TracChangeset
for help on using the changeset viewer.