checkLevelModal(9); // 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); //$c_removaldateSTR = $func -> convertFormat ($c_removaldate, 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) { //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... if ($key == $c_status) $selectStr = "selected"; else $selectStr = ""; $c_statusSTR .= " "; } // Get Payment Info foreach ($arrPaymenttype AS $key=>$value) { //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... if ($key == $c_paymenttype) $selectStr = "selected"; else $selectStr = ""; $c_paymenttypeSTR .= " "; } // Get Bin (Main Container) Info foreach ($arrBin AS $key=>$value) { //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... if ($key == $c_maincontainer) $selectStr = "selected"; else $selectStr = ""; $c_maincontainerSTR .= " "; } // Get Pickup Schedule foreach ($arrSchedule AS $key=>$value) { //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... if ($key == $c_schedule) $selectStr = "selected"; else $selectStr = ""; $c_scheduleSTR .= " "; } // Get Driver Info $qry_driver = "SELECT * FROM tbl_member WHERE m_level = 9 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"; else $selectStr = ""; $c_driveruidSTR .= " "; } // 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) { //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... if ($key == $c_form_new) $selectStr = "selected"; else $selectStr = ""; $c_form_newSTR .= " "; } // Get Sales Method info foreach ($arrSalesMethod AS $key=>$value) { //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... 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"); if ($mode == "update") { if ($totcnt_d == 0) { $PICKUPstr = ""; //$PICKUPstr = ""; $d_orderdateSTR = date("Y-m-d"); $d_paymenttype = $c_paymenttype; $d_customeruid = $c_uid; $setDisplayNEWStr = " DISPLAY:none; "; $setDisplayBTNStr = " DISPLAY:block; "; $setDisplaySIGNYESStr = " DISPLAY:none; "; $setDisplaySIGNNEWStr = " DISPLAY:inline; "; } else { // d_orderdate 이 현재일이고, Finished 안된 경우만 입력할수 있음 // 운영자는 예외 // Get Information $query = "SELECT * FROM tbl_daily WHERE d_customeruid = '$c_uid' AND d_orderdate = '".date("Ymd")."'"; $result=$jdb->fQuery($query, "fetch query error"); // echo"$query"; for($i=0; $i $value ) $$key = $value; } // d_orderdate 는 변경못하게 했는데 수정할수 있게 해달라고 요청받음 // 운영자의 경우 d_orderdate 를 변경할수 있으므로 오늘날짜를 다른것으로 바꾸면 d_mode 는 update 가 아님 // 문제가 생길수 있음. 나중에 처리 필요 $d_mode = "update"; $d_orderdateSTR = $func -> convertFormat ($d_orderdate, 3); if (($d_orderdate == date("Ymd") && $d_status != "F") || $_SESSION['ss_LEVEL'] == "1") { $PICKUPstr = ""; //$PICKUPstr = ""; } else $PICKUPstr = ""; // signiture 처리 (2023.11.28) $d_payeenameSTR = str_replace("\\", "", $d_payeename); $folderPath = getenv("DOCUMENT_ROOT")."/upload_sign/".$d_customeruid; if (is_file($folderPath."/".trim($d_payeesign))) { $d_payeesignSTR = ""; $setDisplayNEWStr = " DISPLAY:inline; "; $setDisplayBTNStr = " DISPLAY:none; "; $setDisplaySIGNYESStr = " DISPLAY:inline; "; $setDisplaySIGNNEWStr = " DISPLAY:none; "; } else { $setDisplayNEWStr = " DISPLAY:none; "; $setDisplayBTNStr = " DISPLAY:block; "; $setDisplaySIGNYESStr = " DISPLAY:none; "; $setDisplaySIGNNEWStr = " DISPLAY:inline; "; } // 이미 존재하는 오더장을 수정한다면 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']); //echo "



[$qry_note][$n_noteSTR]"; } } else $PICKUPstr = ""; if ($_SESSION['ss_LEVEL'] == 7) $PICKUPstr = ""; if ($_SESSION['ss_LEVEL'] == 9) $add_qry = " AND m_uid = '".$_SESSION['ss_UID']."' "; else $add_qry = ""; // Get Driver Info $qry_driver = "SELECT * FROM tbl_member WHERE m_level = 9 ".$add_qry." 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"; else $selectStr = ""; $c_driveruidSTRM .= " "; } addLog ("add", "CUSTOMER DETAIL", "VIEW", $lguserid, $query, $c_uid); ?>

Restaurant Information

Account No > Status
Restaurant Name Inactive Date
Init
Address 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(); } // $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(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; //echo "[$total_count][$list_count][$page_count][$list_number]
[$query]
[$query_note]"; $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; } //$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]; $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