checkLevelModal(9); // Delete, Add 기능 제한 (Admin : 1, Staff : 5, Accounting : 6 만 가능) $permit = array("1", "5", "6"); if (in_array($_SESSION['ss_LEVEL'], $permit)) { $setTag = "ENABLED"; } else $setTag = "DISABLED"; if ($cstatus == 'T') $status_query = " AND (tbl_customer.c_status = 'A' OR tbl_customer.c_status = 'I') "; else if ($cstatus == 'I') $status_query = " AND (tbl_customer.c_status = 'I') "; else { $cstatus = 'A'; $status_query = " AND (tbl_customer.c_status = 'A') "; } if ($cistop == 'A') { $cistop_query = " AND tbl_customer.c_is_top = 'A' "; } else if ($cistop == 'G') { $cistop_query = " AND tbl_customer.c_is_top = 'G' "; } else { $cistop = 'T'; $cistop_query = ""; } if ($_SESSION['ss_LEVEL'] == 9) { $add_allquery = $status_query . $cistop_query . " AND c_driveruid = '".$_SESSION['ss_UID']."' "; } else { $add_allquery = $status_query . $cistop_query; } //$add_query .= "tbl_groups INNER JOIN naloxca_bbs.tbl_customer ON (tbl_groups.g_uid = tbl_customer.m_gid) "; $add_srchquery = ""; $add_query = ""; // searching if($key_word) { $key_wordStr = urldecode(trim($key_word)); // single quote, double quote 문제 해결 위해 사용 $key_wordStr = addslashes($key_wordStr); $add_srchquery .= " AND ((c_accountno LIKE '%$key_wordStr%') OR (c_name LIKE '%$key_wordStr%') OR (c_address LIKE '%$key_wordStr%') OR (c_phone LIKE '%$key_wordStr%') OR (c_cell LIKE '%$key_wordStr%') OR (c_email LIKE '%$key_wordStr%') OR (c_payableto LIKE '%$key_wordStr%') OR (c_rate LIKE '%$key_wordStr%') OR (c_location LIKE '%$key_wordStr%') OR (c_city LIKE '%$key_wordStr%') OR (c_postal LIKE '%$key_wordStr%') OR (c_contractby LIKE '%$key_wordStr%') OR (c_salesperson LIKE '%$key_wordStr%') OR (c_salesmethod LIKE '%$key_wordStr%') OR (c_paymenttype LIKE '%$key_wordStr%')) "; } // sorting if($switch) { $switched = $func -> switchOrder($switch, $switched); if ($switch == "c_address") { $add_query .= " ORDER BY TRIM(SUBSTRING(c_address,LOCATE(' ',c_address)+1)) $switched, CAST(TRIM(LEFT(c_address,LOCATE(' ',c_address) - 1)) AS SIGNED) $switched"; } else { $add_query .= " ORDER BY $switch $switched "; } $switched = $switch . "^" . $switched; }else if($switched) { $switched1 = explode("^", $switched); $add_query .= " ORDER BY $switched1[0] $switched1[1] "; } else { if ($cstatus == 'I') $add_query .= " ORDER BY c_removaldate DESC, c_name ASC"; else $add_query .= " ORDER BY c_uid DESC"; } $getSWHStr = $switched; // $query = "SELECT * FROM tbl_sampletypes // INNER JOIN tbl_members ON (tbl_sampletypes.t_uid = tbl_members.m_gid) // where tbl_members.m_uid != '' // ORDER BY tbl_members.m_uid DESC "; //total record $query = "SELECT COUNT(c_uid) FROM tbl_customer INNER JOIN tbl_member ON (tbl_customer.c_driveruid = tbl_member.m_uid) where tbl_customer.c_uid <> '' " . $add_allquery . $add_srchquery . $add_query; $total_count=$jdb->rQuery($query, "record query error"); //echo "




[$key_word][$total_count][$query]
"; //페이징변수설정 if(!$page) $page = 1; if(!$list_count) $list_count = $INIT_PAGECNT; //출력리스트 갯수 if(!$page_count) $page_count = $INIT_PAGEVIEWCNT; //출력페이지 갯수 $list_number = $total_count - (($page-1)*$list_count); $start_number = $list_count * ($page-1); $add_query .= " LIMIT $start_number, $INIT_PAGECNT"; $query = "SELECT * FROM tbl_customer INNER JOIN tbl_member ON (tbl_customer.c_driveruid = tbl_member.m_uid) where tbl_customer.c_uid <> '' " . $add_allquery . $add_srchquery . $add_query; //echo "



[$query]"; $result=$jdb->nQuery($query, "list error"); while($list=mysqli_fetch_array($result, MYSQLI_ASSOC)) { for($i=0; $i $value ) $$key = $value; } //$logindateStr = $func -> convertFormat ($MLOGINDATE, 1); //$signupdateStr = $func -> convertFormat ($MSIGNUPDATE, 1); //$qry = "SELECT CNAME FROM tbl_company WHERE CUID = '$MCOMPANY' "; //$rtd=$jdb->fQuery($qry, "fetch query error"); //if ($MCOMPANY == "0" || $MCOMPANY == "") $companyStr = "-"; //else $companyStr = $rtd[CNAME]; $c_phone = preg_replace('/[^A-Za-z0-9\-]/', '', $c_phone); $c_phoneSTR = substr ($c_phone, 0, 3)."-".substr ($c_phone, 3, 3)."-".substr ($c_phone, 6, 4); $c_nameSTR = str_replace("\\", "", $c_name); $c_addressSTR = str_replace("\\", "", $c_address); $c_containerSTR = str_replace("\\", "", $c_container); $c_statusSTR = $arrStatus[$c_status]; $c_istopSTR = ($c_is_top === 'A') ? 'A Rank' : (($c_is_top === 'G') ? 'Ghost' : ''); $todayQty = number_format(round(floatval($c_fullquantity - $c_fullquantitydaily))); //$qry_driver = "SELECT m_firstname, m_lastname FROM tbl_member WHERE m_uid = '$c_driveruid' "; //$rt_driver = $jdb->fQuery($qry_driver, "fetch query error"); if ($setTag == "ENABLED") { $OPTIONstr = "   "; //$OPTIONTITLEstr = "OPTION"; } else { $OPTIONstr = ""; //$OPTIONTITLEstr = ""; } $driverPopup = ""; $strList .= " $list_number ".$todayQty." $c_nameSTR   $driverPopup $c_accountno $c_addressSTR $c_city $c_postal $c_paymenttype $c_rate $c_maincontainer $c_container $m_initial $c_phoneSTR $c_statusSTR $c_istopSTR "; $list_number--; } if( $total_count < 1 ) { $strList = " No Data "; } addLog ("add", "CUSTOMER LIST", "VIEW", $lguserid, $query, $lgno); ?>
ADD