checkLevelModal(10); // Delete 기능 제한 (Admin : 1, Staff : 5, Accounting : 6 만 가능) $permit = array("1", "5", "6"); if (in_array($_SESSION['ss_LEVEL'], $permit)) { $setTag = "ENABLED"; } else $setTag = "DISABLED"; // Admin 만 사용하는 기능을 위해 $permitAdm = array("1"); if (in_array($_SESSION['ss_LEVEL'], $permitAdm)) { $setTagAdm = "ENABLED"; } else $setTagAdm = "DISABLED"; $goStr = "switched=$switched&page=$page&key_word=$key_word&column=$column&sorting_type=$sorting_type&switch=$switch&cstatus=$cstatus"; // if ($mode == "create" || $mode == "") { $btnName = "CREATE"; $mode = "create"; $status = "1"; } else if ($mode == "update") { $btnName = "UPDATE"; //$admTag = "DISABLED"; } // User data query if ($mode == "update") { if($c_uid == "") { $msg = "Invalid data. Please try again."; $func -> modalMsg ($msg, "/index_intranet.php?view=customer_list&$goStr"); exit(); } $query = "SELECT * FROM tbl_customer WHERE c_uid = '$c_uid'"; $result = $jdb->fQuery($query, "query error"); // No data if ($result[0] =="") { $msg = "Invalid data. Please try again."; $func -> modalMsg ($msg, "/index_intranet.php?view=customer_list&$goStr"); exit(); } //echo "[$query]"; for($i=0; $i $value ) $$key = $value; } $c_nameSTR = str_replace("\\", "", $c_name); $c_payabletoSTR = str_replace("\\", "", $c_payableto); $c_mailingaddrSTR = str_replace("\\", "", $c_mailingaddr); $c_containerSTR = str_replace("\\", "", $c_container); $c_locationSTR = str_replace("\\", "", $c_location); //echo "




[".utf8_encode($c_phone)."]"; $c_phone = str_replace("\\", "", trim($c_phone)); $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_phoneextSTR = str_replace("\\", "", $c_phoneext); $c_cellSTR = str_replace("\\", "", $c_cell); $c_emailSTR = str_replace("\\", "", $c_email); $c_addressSTR = str_replace("\\", "", $c_address); $c_postalSTR = str_replace("\\", "", $c_postal); $c_postalSTR = preg_replace('/[^A-Za-z0-9\-]/', '', $c_postalSTR); $c_contractbySTR = str_replace("\\", "", $c_contractby); $c_hstnoSTR = str_replace("\\", "", $c_hstno); $c_identcodeSTR = str_replace("\\", "", $c_identcode); $c_comment_riSTR = str_replace("\\", "", $c_comment_ri); $c_comment_ciSTR = str_replace("\\", "", $c_comment_ci); $c_form_euSTR = $func -> convertFormat ($c_form_eu, 3); $c_form_corsiaSTR = $func -> convertFormat ($c_form_corsia, 3); $c_contractdateSTR = $func -> convertFormat ($c_contractdate, 3); if ($c_installdate != "N/A") $c_installdateSTR = $func -> convertFormat ($c_installdate, 3); else $c_installdateSTR = "N/A"; $c_schedulebasicSTR = $func -> convertFormat ($c_schedulebasic, 3); $c_fpickupSTR = $func -> convertFormat ($c_fpickup, 3); if ($c_removaldate != "N/A") $c_removaldateSTR = $func -> convertFormat ($c_removaldate, 3); else $c_removaldateSTR = "N/A"; if ($c_inactivedate != "N/A") $c_inactivedateSTR = $func -> convertFormat ($c_inactivedate, 3); else $c_inactivedateSTR = "N/A"; if ($c_inactivedateSTR == "-") $c_inactivedateSTR = str_replace("-", "", $c_inactivedateSTR); if ($c_exchangedate != "N/A") $c_exchangedateSTR = $func -> convertFormat ($c_exchangedate, 3); else $c_exchangedateSTR = "N/A"; if ($c_switchformdate != "N/A") $c_switchformdateSTR = $func -> convertFormat ($c_switchformdate, 3); else $c_switchformdateSTR = "N/A"; if (is_numeric($c_salescommissiondate)) $c_salescommissiondateSTR = $func -> convertFormat ($c_salescommissiondate, 7); else $c_salescommissiondateSTR = $c_salescommissiondate; } else { $c_salescommissiondateSTR = "NOT YET"; $c_fullcycle = 0; } // Get Status Info foreach ($arrStatus AS $key=>$value) { if ($key == $c_status) $selectStr = "selected"; else $selectStr = ""; $c_statusSTR .= " "; } // Get Payment Info foreach ($arrPaymenttype AS $key=>$value) { if ($key == $c_paymenttype) $selectStr = "selected"; else $selectStr = ""; $c_paymenttypeSTR .= ""; } // Get Bin (Main Container) Info foreach ($arrBin AS $key=>$value) { if ($key == $c_maincontainer) $selectStr = "selected"; else $selectStr = ""; $c_maincontainerSTR .= ""; } // Get Pickup Schedule foreach ($arrSchedule AS $key=>$value) { if ($key == $c_schedule) $selectStr = "selected"; else $selectStr = ""; $c_scheduleSTR .= ""; } // Get Driver Info => Region $curDR = ""; $qry_driver = "SELECT * FROM tbl_member WHERE m_level = 9 AND m_region != '' ORDER by m_initial ASC "; $rt_driver = $jdb->nQuery($qry_driver, "list error"); while($lt_driver=mysqli_fetch_array($rt_driver, MYSQLI_ASSOC)) { if ($lt_driver['m_uid'] == $c_driveruid) { $selectStr = "selected"; $curDR = $lt_driver['m_currentdriver']; } else $selectStr = ""; $c_driveruidSTR .= ""; } // Get Driver Info (Request) $qry_dr = "SELECT * FROM tbl_driver WHERE dr_status = 'A' ORDER by dr_initial ASC "; $rt_dr = $jdb->nQuery($qry_dr, "list error"); while($lt_dr=mysqli_fetch_array($rt_dr, MYSQLI_ASSOC)) { if ($lt_dr['dr_uid'] == $curDR) $selectStr = "selected"; else $selectStr = ""; $c_driveruidSTRRQ .= ""; } // Get City Info $qry_city = "SELECT * FROM tbl_area WHERE a_status = 'A' ORDER by a_city ASC "; $rt_city = $jdb->nQuery($qry_city, "list error"); while($lt_city=mysqli_fetch_array($rt_city, MYSQLI_ASSOC)) { if ($lt_city['a_city'] == $c_city) { $selectStr = "selected"; $a_textSTR = $lt_city['a_text']; } else { $selectStr = ""; } $c_citySTR .= ""; } // get scheduled day info $c_scheduledayTMP = explode('|', $c_scheduleday); for ($i=0; $i < count($c_scheduledayTMP); $i++) { if ($c_scheduledayTMP[$i] == "MON") $c_scheduledayMON = "checked"; if ($c_scheduledayTMP[$i] == "TUE") $c_scheduledayTUE = "checked"; if ($c_scheduledayTMP[$i] == "WED") $c_scheduledayWED = "checked"; if ($c_scheduledayTMP[$i] == "THU") $c_scheduledayTHU = "checked"; if ($c_scheduledayTMP[$i] == "FRI") $c_scheduledayFRI = "checked"; if ($c_scheduledayTMP[$i] == "SAT") $c_scheduledaySAT = "checked"; } // Get Sale Person $qry_sp = "SELECT * FROM tbl_salesperson WHERE s_status = 'A' ORDER by s_name ASC "; $rt_sp = $jdb->nQuery($qry_sp, "list error"); while($lt_sp=mysqli_fetch_array($rt_sp, MYSQLI_ASSOC)) { if ($lt_sp['s_name'] == $c_salesperson) $selectStr = "selected"; else $selectStr = ""; $c_salespersonSTR .= ""; } // Get Form info foreach ($arrForm AS $key=>$value) { if ($key == $c_form_new) $selectStr = "selected"; else $selectStr = ""; $c_form_newSTR .= ""; } // Get Sales Method info foreach ($arrSalesMethod AS $key=>$value) { if ($key == $c_salesmethod) $selectStr = "selected"; else $selectStr = ""; $c_salesmethodSTR .= ""; } // Get Form info foreach ($arrPaymentCycle AS $key=>$value) { //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... if ($key == $c_paymentcycle) $selectStr = "selected"; else $selectStr = ""; $c_paymentcycleSTR .= ""; } // 오늘 날짜의 오더장이 있는지 확인 // 있으면 정보를 가져와서 아래 조건 확인, 없는 경우 새로 생성 $qry_cnt_d = "SELECT COUNT(*) FROM tbl_daily WHERE d_customeruid = '$c_uid' AND d_orderdate = '".date("Ymd")."'"; $totcnt_d=$jdb->rQuery($qry_cnt_d, "record query error"); // $pickupButtonHtml = ""; $PICKUPstr = ""; $add_qry = ($_SESSION['ss_LEVEL'] == 9) ? " AND dr_uid = '".$_SESSION['ss_DRUID']."' " : ""; // display 기본값 $setDisplayNEWStr = " DISPLAY:none; "; $setDisplayBTNStr = " DISPLAY:block; "; $setDisplaySIGNYESStr = " DISPLAY:none; "; $setDisplaySIGNNEWStr = " DISPLAY:inline; "; if ($mode == "update") { if ($totcnt_d == 0) { // 신규 pickup 입력 상태 $PICKUPstr = $pickupButtonHtml; $d_orderdateSTR = date("Y-m-d"); $d_paymenttype = $c_paymenttype; $d_customeruid = $c_uid; } else { // 기존 daily 정보 조회 $query = "SELECT * FROM tbl_daily WHERE d_customeruid = '$c_uid' AND d_orderdate = '".date("Ymd")."' AND d_jobtype = 'UCO'"; $result = $jdb->fQuery($query, "fetch query error"); if (is_array($result)) { foreach ($result as $key => $value) { $$key = $value; } } // update 모드 강제 $d_mode = "update"; $d_orderdateSTR = $func->convertFormat($d_orderdate, 3); // pickup 버튼 노출 조건 $canInputPickup = ( ($d_orderdate == date("Ymd") && $d_status != "F") || $_SESSION['ss_LEVEL'] == "1" ); if ($canInputPickup) { $PICKUPstr = $pickupButtonHtml; } // signature 처리 $d_payeenameSTR = str_replace("\\", "", $d_payeename); $folderPath = getenv("DOCUMENT_ROOT")."/upload_sign/".$d_customeruid; $signFilePath = $folderPath."/".trim($d_payeesign); if (is_file($signFilePath)) { $d_payeesignSTR = ""; $setDisplayNEWStr = " DISPLAY:inline; "; $setDisplayBTNStr = " DISPLAY:none; "; $setDisplaySIGNYESStr = " DISPLAY:inline; "; $setDisplaySIGNNEWStr = " DISPLAY:none; "; } // note 조회 $qry_note = "SELECT * FROM tbl_note WHERE n_dailyuid = '$d_uid'"; $rt_note = $jdb->fQuery($qry_note, "fetch query error"); $n_noteSTRM = str_replace("\\", "", $rt_note['n_note']); } } // Level 7, 8 은 pickup 버튼 숨김 if ($_SESSION['ss_LEVEL'] == 7 || $_SESSION['ss_LEVEL'] == 8) { $PICKUPstr = ""; } if ($mode == "update") { // 현재 고객의 드라이버 정보 $qry_rg = "SELECT * FROM tbl_member WHERE m_uid = ".$c_driveruid; $rt_rg = $jdb->fQuery($qry_rg, "list error"); // 활성 드라이버 목록 $qry_driver = "SELECT * FROM tbl_driver WHERE dr_uid >= 1 AND dr_status = 'A' $add_qry ORDER BY dr_initial ASC"; $rt_driver = $jdb->nQuery($qry_driver, "list error"); $c_driveruidSTRM = ""; while ($lt_driver = mysqli_fetch_array($rt_driver, MYSQLI_ASSOC)) { $selected = ""; // 기본 선택값: member 의 current driver if ($lt_driver['dr_uid'] == $rt_rg['m_currentdriver']) { $selected = "selected"; } // update 상태면 daily 의 d_druid 가 우선 if ($d_mode == "update") { $selected = ($lt_driver['dr_uid'] == $d_druid) ? "selected" : ""; } $c_driveruidSTRM .= ""; } } addLog ("add", "CUSTOMER DETAIL", "VIEW", $lguserid, $query, $c_uid); ?>

Restaurant Information

Account No Status
Restaurant Name Inactive Date
Init
Address Region (Default Driver)
City Rate
Area Payment
Postal Code Main Volume
Phone Main Container
Ext Container Detail
Cell Container Exc. Date
Init
Cycle Container Location
Forced Cycle Pickup Schedule
Expected Oil Volume Per Month Pickup Weekday
Comment

Contact Information

Contract Date Sales Person
Form Sales Method
US Sale Commission Date
EU Date Install Date
N/A
CORSIA Date First Pickup
Init
Switch Form Date
Init
Payable To
Contact By Payment Cycle
Email Mailing Address
Removal Date
Init
HST No
Sludge Identification Code
Comment
modalMsg ($msg, "/index_intranet.php?view=customer_list&$goStr"); exit(); } //total record $query = "SELECT COUNT(n_uid) FROM tbl_note WHERE n_uid <> '' AND n_status != 'D' AND n_customeruid = '$c_uid' " . $add_query; $total_count=$jdb->rQuery($query, "record query error"); //echo "[$total_count][$query]
"; //페이징변수설정 if(!$pageqna) $pageqna = 1; if ($pageflag != "note") $pageqna = 1; if(!$list_count) $list_count = $INIT_PAGECNT_NOTE; //출력리스트 갯수 if(!$page_count) $page_count = $INIT_PAGEVIEWCNT; //출력페이지 갯수 $list_number = $total_count - (($pageqna-1)*$list_count); $start_number = $list_count * ($pageqna-1); $add_query .= " LIMIT $start_number, $INIT_PAGECNT_NOTE"; $query_note = "SELECT * FROM tbl_note where n_uid <> '' AND n_status != 'D' AND n_customeruid = '$c_uid' " . $add_query; $result_note=$jdb->nQuery($query_note, "list error"); while($list_note=mysqli_fetch_array($result_note, MYSQLI_ASSOC)) { for($i=0; $i $value ) $$key = $value; } $n_noteSTR = str_replace("\\", "", $n_note); $n_createddateSTR = $func -> convertFormat ($n_createddate, 1); $qry_writer = "SELECT m_firstname, m_lastname FROM tbl_member WHERE m_uid = '$n_memberuid' "; $rt_writer = $jdb->fQuery($qry_writer, "fetch query error"); if ($setTagAdm == "ENABLED") { $OPTIONstr = ""; //$OPTIONTITLEstr = "OPTION"; } else { $OPTIONstr = ""; //$OPTIONTITLEstr = ""; } $strList .= " $list_number $n_createddateSTR ".$rt_writer['m_firstname']." ".$rt_writer['m_lastname']." $n_noteSTR $OPTIONstr "; $list_number--; } if( $total_count < 1 ) { $strList = "No Data"; } ?>

Note

No Date Creator Note Option

Image

nQuery($qry_img, "image list error"); // 분류 배열 $install = []; $container = []; while ($img = mysqli_fetch_array($rt_img, MYSQLI_ASSOC)) { if ($img['i_type'] == "install") $install[] = $img; else $container[] = $img; } if (count($install) + count($container) == 0) { echo "

No images found.

"; } else { // =========================== // INSTALL // =========================== if (count($install) > 0) { echo "

Install

"; foreach ($install as $img) { echo '
'; echo '
'; $files = explode(",", $img['i_filename']); foreach ($files as $f) { $imgPath = $img['i_filepath'] . trim($f); echo '
'; } echo '
'; echo '
Note: '.nl2br($img['i_note']).'
'; echo "Created: " . date("Y-m-d H:i:s", strtotime($img['i_createddate'])).'
'; echo "Created by: " . $img['m_firstname']. ' ' . $img['m_lastname']. ' (' . $img['m_initial']. ')'; echo '
'; } } // =========================== // CONTAINER // =========================== // if (count($container) > 0) { // echo "

Container

"; // foreach ($container as $img) { // echo '
'; // echo '
'; // $files = explode(",", $img['i_filename']); // foreach ($files as $f) { // $imgPath = $img['i_filepath'] . trim($f); // echo ' //
// //
// '; // } // echo '
'; // echo '
// Note: '.nl2br($img['i_note']).'
'; // echo "Created: " . date("Y-m-d H:i:s", strtotime($img['i_createddate'])).'
'; // echo ' //
// '; // echo '
'; // } // } } ?>