source: branches/comu-ver2/data/class/pages/admin/customer/LC_Page_Admin_Customer.php @ 18187

Revision 18187, 26.2 KB checked in by ramrun, 15 years ago (diff)

#261 設定見直し

  • Property svn:eol-style set to LF
  • Property svn:keywords set to "Id Revision Date"
Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23
24// {{{ requires
25require_once(CLASS_PATH . "pages/LC_Page.php");
26
27/**
28 * 顧客管理 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Admin_Customer extends LC_Page {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46        $this->tpl_mainpage = 'customer/index.tpl';
47        $this->tpl_mainno = 'customer';
48        $this->tpl_subnavi = 'customer/subnavi.tpl';
49        $this->tpl_subno = 'index';
50        $this->tpl_pager = TEMPLATE_DIR . 'admin/pager.tpl';
51        $this->tpl_subtitle = '顧客マスタ';
52
53        $masterData = new SC_DB_MasterData_Ex();
54        $this->arrPref = $masterData->getMasterData("mtb_pref",
55                             array("pref_id", "pref_name", "rank"));
56
57        $this->arrJob = $masterData->getMasterData("mtb_job");
58        $this->arrJob["不明"] = "不明";
59        $this->arrSex = $masterData->getMasterData("mtb_sex");
60        $this->arrPageRows = $masterData->getMasterData("mtb_page_rows");
61        $this->arrMAILMAGATYPE = $masterData->getMasterData("mtb_mail_magazine_type");
62        $this->arrHtmlmail[''] = "すべて";
63        $this->arrHtmlmail[1] = $this->arrMAILMAGATYPE[1];
64        $this->arrHtmlmail[2] = $this->arrMAILMAGATYPE[2];
65
66        $this->arrStatus[1] = "仮会員";
67        $this->arrStatus[2] = "本会員";
68
69        //---- CSVダウンロード用
70        $this->arrColumnCSV = array(0  => array("sql" => "customer_id",
71                                                "csv" => "customer_id",
72                                                "header" => "顧客ID"),
73                                    1  => array("sql" => "name01",
74                                                "csv" => "name01",
75                                                "header" => "名前1"),
76                                    2  => array("sql" => "name02",
77                                                "csv" => "name02",
78                                                "header" => "名前2"),
79                                    3  => array("sql" => "kana01",
80                                                "csv" => "kana01",
81                                                "header" => "フリガナ1"),
82                                    4  => array("sql" => "kana02",
83                                                "csv" => "kana02",
84                                                "header" => "フリガナ2"),
85                                    5  => array("sql" => "zip01",
86                                                "csv" => "zip01",
87                                                "header" => "郵便番号1"),
88                                    6  => array("sql" => "zip02",
89                                                "csv" => "zip02",
90                                                "header" => "郵便番号2"),
91                                    7  => array("sql" => "pref",
92                                                "csv" => "pref",
93                                                "header" => "都道府県"),
94                                    8  => array("sql" => "addr01",
95                                                "csv" => "addr01",
96                                                "header" => "住所1"),
97                                    9  => array("sql" => "addr02",
98                                                "csv" => "addr02",
99                                                "header" => "住所2"),
100                                    10 => array("sql" => "email",
101                                                "csv" => "email",
102                                                "header" => "E-MAIL"),
103                                    11 => array("sql" => "tel01",
104                                                "csv" => "tel01",
105                                                "header" => "TEL1"),
106                                    12 => array("sql" => "tel02",
107                                                "csv" => "tel02",
108                                                "header" => "TEL2"),
109                                    13 => array("sql" => "tel03",
110                                                "csv" => "tel03",
111                                                "header" => "TEL3"),
112                                    14 => array("sql" => "fax01",
113                                                "csv" => "fax01",
114                                                "header" => "FAX1"),
115                                    15 => array("sql" => "fax02",
116                                                "csv" => "fax02",
117                                                "header" => "FAX2"),
118                                    16 => array("sql" => "fax03",
119                                                "csv" => "fax03",
120                                                "header" => "FAX3"),
121                                    17 => array("sql" => "CASE WHEN sex = 1 "
122                                                . " THEN '男性' "
123                                                . " ELSE '女性' END AS sex",
124                                                "csv" => "sex",
125                                                "header" => "性別"),
126                                    18 => array("sql" => "job",
127                                                "csv" => "job",
128                                                "header" => "職業"),
129                                    19 => array("sql" => "cast(birth as date) AS birth",
130                                                "csv" => "birth",
131                                                "header" => "誕生日"),
132                                    20 => array("sql" => "cast(first_buy_date as date) AS first_buy_date",
133                                                "csv" => "first_buy_date",
134                                                "header" => "初回購入日"),
135                                    21 => array("sql" => "cast(last_buy_date as date) AS last_buy_date",
136                                                "csv" => "last_buy_date",
137                                                "header" => "最終購入日"),
138                                    22 => array("sql" => "buy_times",
139                                                "csv" => "buy_times",
140                                                "header" => "購入回数"),
141                                    23 => array("sql" => "point",
142                                                "csv" => "point",
143                                                "header" => "ポイント残高"),
144                                    24 => array("sql" => "note",
145                                                "csv" => "note",
146                                                "header" => "備考"),
147                                    25 => array("sql" => "cast(create_date as date) AS create_date",
148                                                "csv" => "create_date",
149                                                "header" => "登録日"),
150                                    26 => array("sql" => "cast(update_date as date) AS update_date",
151                                                "csv" => "update_date",
152                                                "header" => "更新日")
153                                    );
154        $this->httpCacheControl('nocache');
155    }
156
157    /**
158     * Page のプロセス.
159     *
160     * @return void
161     */
162    function process() {
163        //---- ページ初期設定
164        $objQuery = new SC_Query();
165        $objView = new SC_AdminView();
166        $objDate = new SC_Date(1901);
167        $objDb = new SC_Helper_DB_Ex();
168        $this->arrYear = $objDate->getYear();   // 日付プルダウン設定
169        $this->arrMonth = $objDate->getMonth();
170        $this->arrDay = $objDate->getDay();
171        $this->objDate = $objDate;
172
173        // 認証可否の判定
174        $objSess = new SC_Session();
175        SC_Utils_Ex::sfIsSuccess($objSess);
176
177        // POST値の引き継ぎ
178        $this->arrForm = $_POST;
179
180        // ページ送り用
181        $this->arrHidden['search_pageno'] =
182                isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
183
184        // 検索ワードの引き継ぎ
185        foreach ($_POST as $key => $val) {
186            switch($key) {
187            case 'sex':
188            case 'status':
189                $this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
190                if(!is_array($val)) {
191                    $this->arrForm[$key] = split("-", $val);
192                }
193                break;
194            default:
195                $this->arrHidden[$key] = $val;
196                break;
197            }
198        }
199
200        if (!isset($_POST['mode'])) $_POST['mode'] = "";
201
202        // 顧客削除
203        if ($_POST['mode'] == "delete") {
204            $sql = "SELECT status,email FROM dtb_customer WHERE customer_id = ? AND del_flg = 0";
205            $result_customer = $objQuery->conn->getAll($sql, array($_POST["edit_customer_id"]));
206
207            if ($result_customer[0]["status"] == 2) {           //本会員削除
208                $arrDel = array("del_flg" => 1, "update_date" => "NOW()");
209                $objQuery->conn->autoExecute("dtb_customer", $arrDel, "customer_id = " . SC_Utils_Ex::sfQuoteSmart($_POST["edit_customer_id"]) );
210            } elseif ($result_customer[0]["status"] == 1) {     //仮会員削除
211                $sql = "DELETE FROM dtb_customer WHERE customer_id = ?";
212                $objQuery->conn->query($sql, array($_POST["edit_customer_id"]));
213            }
214        }
215        // 登録メール再送
216        if ($_POST['mode'] == "resend_mail") {
217            $arrRet = $objQuery->select("name01, name02, secret_key, email", "dtb_customer","customer_id = ? AND del_flg <> 1 AND status = 1", array($_POST["edit_customer_id"]));
218            if( is_array($arrRet) === true && count($arrRet) > 0 ){
219
220                $this->name01 = $arrRet[0]['name01'];
221                $this->name02 = $arrRet[0]['name02'];
222                $this->uniqid = $arrRet[0]['secret_key'];
223
224                $CONF = $objDb->sf_getBasisData();
225                $this->CONF = $CONF;
226                $objMailText = new SC_SiteView();
227                $objMailText->assignobj($this);
228                $mailHelper = new SC_Helper_Mail_Ex();
229
230                $subject = $mailHelper->sfMakesubject('会員登録のご確認');
231                $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
232
233                $objMail = new SC_SendMail();
234                $objMail->setItem(
235                                    ''                  // 宛先
236                                    , $subject          // サブジェクト
237                                    , $toCustomerMail   // 本文
238                                    , $CONF["email03"]  // 配送元アドレス
239                                    , $CONF["shop_name"]// 配送元 名前
240                                    , $CONF["email03"]  // reply_to
241                                    , $CONF["email04"]  // return_path
242                                    , $CONF["email04"]  //  Errors_to
243                                 );
244                // 宛先の設定
245                $name = $this->name01 . $this->name02 ." 様";
246                $objMail->setTo($arrRet[0]["email"], $name);
247                $objMail->sendMail();
248            }
249
250        }
251
252        if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "resend_mail") {
253
254            // 入力文字の強制変換
255            $this->lfConvertParam();
256            // エラーチェック
257            $this->arrErr = $this->lfCheckError($this->arrForm);
258
259            $where = "del_flg = 0";
260
261            /* 入力エラーなし */
262            if (count($this->arrErr) == 0) {
263
264                //-- 検索データ取得
265                $objSelect = new SC_CustomerList($this->arrForm, "customer");
266
267                // 表示件数設定
268                $page_rows = $this->arrForm['page_rows'];
269                if(is_numeric($page_rows)) {
270                    $page_max = $page_rows;
271                } else {
272                    $page_max = SEARCH_PMAX;
273                }
274
275                if (!isset($this->arrForm['search_pageno'])) $this->arrForm['search_pageno'] = "";
276
277                if ($this->arrForm['search_pageno'] == 0){
278                    $this->arrForm['search_pageno'] = 1;
279                }
280
281                $offset = $page_max * ($this->arrForm['search_pageno'] - 1);
282                $objSelect->setLimitOffset($page_max, $offset);
283
284                if ($_POST["mode"] == 'csv') {
285                    $searchSql = $objSelect->getListCSV($this->arrColumnCSV);
286                }else{
287                    $searchSql = $objSelect->getList();
288                }
289
290                $this->search_data = $objQuery->conn->getAll($searchSql, $objSelect->arrVal);
291
292                switch($_POST['mode']) {
293                case 'csv':
294                    require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php");
295
296                    $objCSV = new SC_Helper_CSV_Ex();
297                    $i = 0;
298                    $header = "";
299
300                    // CSVカラム取得
301                    $arrCsvOutput = ($objCSV->sfgetCsvOutput(2, " WHERE csv_id = 2 AND status = 1"));
302
303                    if (count($arrCsvOutput) <= 0) break;
304
305                    foreach($arrCsvOutput as $data) {
306                        $arrColumn[] = $data["col"];
307                        if ($i != 0) $header .= ", ";
308                        $header .= $data["disp_name"];
309                        $i ++;
310                    }
311                    $header .= "\n";
312
313                    //- 都道府県/職業の変換
314                    for($i = 0; $i < count($this->search_data); $i ++) {
315                        $this->search_data[$i]["pref"] = $this->arrPref[ $this->search_data[$i]["pref"] ];
316                        $this->search_data[$i]["job"]  = $this->arrJob[ $this->search_data[$i]["job"] ];
317                    }
318
319                    //- CSV出力
320                    $data = SC_Utils_Ex::getCSVData($this->search_data, $arrColumn);
321
322                    SC_Utils_Ex::sfCSVDownload($header.$data);
323                    exit;
324                    break;
325                case 'delete_all':
326                    // 検索結果をすべて削除
327                    $where = "product_id IN (SELECT product_id FROM vw_products_nonclass AS noncls WHERE $where)";
328                    $sqlval['del_flg'] = 1;
329                    $objQuery->update("dtb_products", $sqlval, $where, $arrval);
330
331                    $sql = "SELECT status,email FROM dtb_customer WHERE customer_id = ? AND del_flg = 0";
332                    $result_customer = $objQuery->conn->getAll($sql, array($_POST["del_customer_id"]));
333
334                    if ($result_customer[0]["status"] == 2) {           //本会員削除
335                        $arrDel = array("del_flg" => 1, "update_date" => "NOW()");
336                        $objQuery->conn->autoExecute("dtb_customer", $arrDel, "customer_id = " . SC_Utils_Ex::sfQuoteSmart($_POST["del_customer_id"]) );
337                    } elseif ($result_customer[0]["status"] == 1) {     //仮会員削除
338                        $sql = "DELETE FROM dtb_customer WHERE customer_id = ?";
339                        $objQuery->conn->query($sql, array($_POST["del_customer_id"]));
340                    }
341
342                    break;
343                default:
344
345                    // 行数の取得
346                    $linemax = $objQuery->conn->getOne( $objSelect->getListCount(), $objSelect->arrVal);
347                    $this->tpl_linemax = $linemax;              // 何件が該当しました。表示用
348
349                    // ページ送りの取得
350                    $objNavi = new SC_PageNavi($this->arrHidden['search_pageno'],
351                                               $linemax, $page_max,
352                                               "fnCustomerPage", NAVI_PMAX);
353                    $startno = $objNavi->start_row;
354                    $this->arrPagenavi = $objNavi->arrPagenavi;
355                }
356            }
357        }
358
359        $this->arrCatList = $objDb->sfGetCategoryList();
360
361        //---- ページ表示
362        $objView->assignobj($this);
363        $objView->display(MAIN_FRAME);
364    }
365
366    /**
367     * デストラクタ.
368     *
369     * @return void
370     */
371    function destroy() {
372        parent::destroy();
373    }
374
375    //---- 取得文字列の変換
376    function lfConvertParam() {
377        /*
378         *  文字列の変換
379         *  K :  「半角(ハンカク)片仮名」を「全角片仮名」に変換
380         *  C :  「全角ひら仮名」を「全角かた仮名」に変換
381         *  V :  濁点付きの文字を一文字に変換。"K","H"と共に使用します
382         *  n :  「全角」数字を「半角(ハンカク)」に変換
383         *  a :  全角英数字を半角英数字に変換する
384         */
385        // カラム名とコンバート情報
386        $arrConvList['customer_id'] = "n" ;
387        $arrConvList['name'] = "aKV" ;
388        $arrConvList['pref'] = "n" ;
389        $arrConvList['kana'] = "CKV" ;
390        $arrConvList['b_start_year'] = "n" ;
391        $arrConvList['b_start_month'] = "n" ;
392        $arrConvList['b_start_day'] = "n" ;
393        $arrConvList['b_end_year'] = "n" ;
394        $arrConvList['b_end_month'] = "n" ;
395        $arrConvList['b_end_day'] = "n" ;
396        $arrConvList['tel'] = "n" ;
397        $arrConvList['birth_month'] = "n" ;
398        $arrConvList['email'] = "a" ;
399        $arrConvList['buy_total_from'] = "n" ;
400        $arrConvList['buy_total_to'] = "n" ;
401        $arrConvList['buy_times_from'] = "n" ;
402        $arrConvList['buy_times_to'] = "n" ;
403        $arrConvList['start_year'] = "n" ;
404        $arrConvList['start_month'] = "n" ;
405        $arrConvList['start_day'] = "n" ;
406        $arrConvList['end_year'] = "n" ;
407        $arrConvList['end_month'] = "n" ;
408        $arrConvList['end_day'] = "n" ;
409        $arrConvList['page_rows'] = "n" ;
410        $arrConvList['buy_start_year'] = "n" ;      // 最終購入日 START 年
411        $arrConvList['buy_start_month'] = "n" ;     // 最終購入日 START 月
412        $arrConvList['buy_start_day'] = "n" ;       // 最終購入日 START 日
413        $arrConvList['buy_end_year'] = "n" ;            // 最終購入日 END 年
414        $arrConvList['buy_end_month'] = "n" ;       // 最終購入日 END 月
415        $arrConvList['buy_end_day'] = "n" ;         // 最終購入日 END 日
416        $arrConvList['buy_product_name'] = "aKV" ;  // 購入商品名
417        $arrConvList['buy_product_code'] = "aKV" ;  // 購入商品コード
418        $arrConvList['category_id'] = "" ;          // カテゴリ
419
420        // 文字変換
421        foreach ($arrConvList as $key => $val) {
422            // POSTされてきた値のみ変換する。
423            if(isset($this->arrForm[$key])) {
424                $this->arrForm[$key] = mb_convert_kana($this->arrForm[$key] ,$val);
425            }
426        }
427    }
428
429    //---- 入力エラーチェック
430    function lfCheckError($array) {
431
432        $objErr = new SC_CheckError($array);
433
434        $objErr->doFunc(array("顧客コード", "customer_id", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
435        $objErr->doFunc(array("都道府県", "pref", 2), array("NUM_CHECK","MAX_LENGTH_CHECK"));
436        $objErr->doFunc(array("顧客名", "name", STEXT_LEN), array("MAX_LENGTH_CHECK"));
437        $objErr->doFunc(array("顧客名(カナ)", "kana", STEXT_LEN), array("SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANABLANK_CHECK"));
438        $objErr->doFunc(array("誕生日(開始日)", "b_start_year", "b_start_month", "b_start_day"), array("CHECK_DATE"));
439        $objErr->doFunc(array("誕生日(終了日)", "b_end_year", "b_end_month", "b_end_day"), array("CHECK_DATE"));
440        $objErr->doFunc(array("誕生日(開始日)","誕生日(終了日)", "b_start_year", "b_start_month", "b_start_day", "b_end_year", "b_end_month", "b_end_day"), array("CHECK_SET_TERM"));
441        $objErr->doFunc(array("誕生月", "birth_month", 2), array("NUM_CHECK","MAX_LENGTH_CHECK"));
442        $objErr->doFunc(array('メールアドレス', "email", STEXT_LEN) ,array("EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK"));
443        $objErr->doFunc(array('携帯メールアドレス', "email_mobile", STEXT_LEN) ,array("EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK"));
444        $objErr->doFunc(array("電話番号", "tel", TEL_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
445        $objErr->doFunc(array("購入金額(開始)", "buy_total_from", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
446        $objErr->doFunc(array("購入金額(終了)", "buy_total_to", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
447        if ( (is_numeric($array["buy_total_from"]) && is_numeric($array["buy_total_to"]) ) && ($array["buy_total_from"] > $array["buy_total_to"]) ) $objErr->arrErr["buy_total_from"] .= "※ 購入金額の指定範囲が不正です。";
448        $objErr->doFunc(array("購入回数(開始)", "buy_times_from", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
449        $objErr->doFunc(array("購入回数(終了)", "buy_times_to", INT_LEN), array("NUM_CHECK","MAX_LENGTH_CHECK"));
450        if ( (is_numeric($array["buy_times_from"]) && is_numeric($array["buy_times_to"]) ) && ($array["buy_times_from"] > $array["buy_times_to"]) ) $objErr->arrErr["buy_times_from"] .= "※ 購入回数の指定範囲が不正です。";
451        $objErr->doFunc(array("登録・更新日(開始日)", "start_year", "start_month", "start_day",), array("CHECK_DATE"));
452        $objErr->doFunc(array("登録・更新日(終了日)", "end_year", "end_month", "end_day"), array("CHECK_DATE"));
453        $objErr->doFunc(array("登録・更新日(開始日)","登録・更新日(終了日)", "start_year", "start_month", "start_day", "end_year", "end_month", "end_day"), array("CHECK_SET_TERM"));
454        $objErr->doFunc(array("表示件数", "page_rows", 3), array("NUM_CHECK","MAX_LENGTH_CHECK"));
455        $objErr->doFunc(array("最終購入日(開始日)", "buy_start_year", "buy_start_month", "buy_start_day",), array("CHECK_DATE"));   //最終購入日(開始日)
456        $objErr->doFunc(array("最終購入(終了日)", "buy_end_year", "buy_end_month", "buy_end_day"), array("CHECK_DATE"));            //最終購入日(終了日)
457        //購入金額(from) > 購入金額(to) の場合はエラーとする
458        $objErr->doFunc(array("最終購入日(開始日)","登録・更新日(終了日)", "buy_start_year", "buy_start_month", "buy_start_day", "buy_end_year", "buy_end_month", "buy_end_day"), array("CHECK_SET_TERM"));
459        $objErr->doFunc(array("購入商品コード", "buy_product_code", STEXT_LEN), array("MAX_LENGTH_CHECK"));                     //購入商品コード
460        $objErr->doFunc(array("購入商品名", "buy_product_name", STEXT_LEN), array("MAX_LENGTH_CHECK"));                         //購入商品名称
461
462        return $objErr->arrErr;
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}
537?>
Note: See TracBrowser for help on using the repository browser.