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