checkLevelModal(9); if($orderdate == "") { $msg = "Invalid data. Please try again."; $func -> modalMsg ($msg, "/index_intranet.php?view=forecast"); exit(); } // Forecast 기능 제한 (Admin : 1, Staff : 5, Driver : 9 만 가능) $permit = array("1", "5", "9"); if (in_array($_SESSION['ss_LEVEL'], $permit)) { $setTag = "ENABLED"; } else $setTag = "DISABLED"; // 환경변수 테이블에서 리스팅 값 가져옴 $qry_cfg = "SELECT * FROM tbl_config WHERE cfg_uid = 1 "; $rt_cfg = $jdb->fQuery($qry_cfg, "fetch query error"); if ($_SESSION['ss_LEVEL'] == 9) $listCnt = $rt_cfg['cfg_drivercnt']; else $listCnt = $rt_cfg['cfg_forecastcnt']; if ($listCnt == 0) $listCnt = 10000; // searching if($key_word) { $key_wordStr = urldecode(trim($key_word)); $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%')) "; } // Order By if ($sortorder == "RA") { $add_switch_query .= " ORDER BY c_name ASC, "; } else if ($sortorder == "RD") { $add_switch_query .= " ORDER BY c_name DESC, "; } else if ($sortorder == "AA") { $add_switch_query .= " ORDER BY TRIM(SUBSTRING(c_address,LOCATE(' ',c_address)+1)) ASC, CAST(TRIM(LEFT(c_address,LOCATE(' ',c_address) - 1)) AS SIGNED) ASC, "; } else if ($sortorder == "AD") { $add_switch_query .= " ORDER BY TRIM(SUBSTRING(c_address,LOCATE(' ',c_address)+1)) DESC, CAST(TRIM(LEFT(c_address,LOCATE(' ',c_address) - 1)) AS SIGNED) DESC, "; } else $add_switch_query = " ORDER BY "; if (!$c_areaall) { if(is_array($c_area)) { $count_a = count($c_area); for($ia = 0; $ia < $count_a; $ia ++) { $areaQRY .= "a_text = '".$c_area[$ia]."' OR "; $areaSTR .= $c_area[$ia]." / "; } } else { $areaQRY = ""; $areaSTR = "ALL"; } if ($count_a > 0) { $areaQRY = substr($areaQRY, 0, -4); $areaQRY = " AND c_city IN (SELECT a_city FROM tbl_area WHERE ".$areaQRY.")"; $areaSTR = substr($areaSTR, 0, -2); } } else { $areaQRY = ""; $areaSTR = "ALL"; } if(is_array($c_maincontainer)) { $count = count($c_maincontainer); for($i = 0; $i < $count; $i ++) { $containerQRY .= "c_maincontainer = '".$c_maincontainer[$i]."' OR "; $containerSTR .= $c_maincontainer[$i]." / "; } } else $containerQRY = ""; if ($count > 0) { $containerQRY = substr($containerQRY, 0, -4); $containerQRY = " AND (".$containerQRY.")"; $containerSTR = substr($containerSTR, 0, -2); } //echo "[$areaSTR][$areaQRY]

[$containerSTR][$containerQRY]"; //$c_fullquantityR = $c_fullquantity; // Get Area Info $qry_area = "SELECT * FROM tbl_area GROUP BY a_text ORDER BY a_text ASC "; $rt_area = $jdb->nQuery($qry_area, "list error"); $area_cnt=1; while($lt_area=mysqli_fetch_array($rt_area, MYSQLI_ASSOC)) { if ($area_cnt%6 == 0) $areaSTR = "
"; else $areaSTR = ""; //if ($c_areaall) $checkedFlag = "checked"; //else { if(is_array($c_area)) { $count_a = count($c_area); for($ia = 0; $ia < $count_a; $ia ++) { if ($c_area[$ia] == $lt_area['a_text']) { $checkedFlag = "checked"; break; } else $checkedFlag = ""; } } //} //echo "[".$c_area[$ia]."][".$lt_area['a_text']."][$checkedFlag]
"; $a_textSTR .= " ".$areaSTR; $checkedFlag = ""; $area_cnt++; } if ($c_fullcycle) { $fullcycleQRY = " AND (c_fullcycle >= $c_fullcycle) "; $fullcycleSTR = $c_fullcycle; } else $fullcycleSTR = 0; // 날짜간 일수 계산 $getPeriodOrderTmp = new DateTime($orderdate); $getPeriodNowTmp = new DateTime(date("Y-m-d")); $dDiffTmp = $getPeriodNowTmp->diff($getPeriodOrderTmp); $dDiff = $dDiffTmp->format('%r%a'); // 이미 Forecast Batch 에서 내일일자로 c_fullquantitydaily 저장됨 (2024.01.16) $dDiff = $dDiff -1; if ($c_fullquantity_a != "" || $c_fullquantity_b != "" ) { if ($c_fullquantity_a != "" && $c_fullquantity_b == "" ) { $fullquantityQRY = " AND ((c_fullquantity+($dDiff * c_fullquantitydaily)) >= $c_fullquantity_a) "; } else if ($c_fullquantity_a == "" && $c_fullquantity_b != "" ) { $fullquantityQRY = " AND ((c_fullquantity+($dDiff * c_fullquantitydaily)) < $c_fullquantity_b) "; } else { $fullquantityQRY = " AND (((c_fullquantity+($dDiff * c_fullquantitydaily)) >= $c_fullquantity_a) AND ((c_fullquantity+($dDiff * c_fullquantitydaily)) < $c_fullquantity_b)) "; } //$fullquantityQRY = " AND ((c_fullquantity+($dDiff * c_fullquantitydaily)) >= $c_fullquantity) "; //$fullquantitySTR = $c_fullquantity; $add_query_order = $add_switch_query." (c_fullquantity+($dDiff * c_fullquantitydaily)) DESC"; } else { //$fullquantitySTR = 0; $add_query_order = $add_switch_query. " (c_fullquantity+($dDiff * c_fullquantitydaily)) DESC"; } if ($c_driveruid) { $driveruidQRY = " AND (c_driveruid = '".$c_driveruid."') "; $org_driveruid = $c_driveruid; } if ($c_newaccount) { $tmpSTR = "-".$c_newaccount." days"; $getnewaccountDay = date('Ymd', strtotime($tmpSTR)); $newaccountQRY = " AND (c_contractdate >= '".$getnewaccountDay."') "; } if ($c_dormantaccount) { $tmpSTR = "-".$c_dormantaccount." days"; $getdormantaccountDay = date('Ymd', strtotime($tmpSTR)); $dormantaccountQRY = " AND (c_lastpickupdate <= '".$getdormantaccountDay."') "; } // 전체를 보이게 해달라는 요청으로 c_schedule 조건을 뺌 (2024.03.06) // 대신 리스트에서 S 로 표시 if ($c_type_w == "W" && $c_type_p == "P") $typeQRY = " "; else if ($c_type_w == "W" && $c_type_p != "P") $typeQRY = " AND (c_schedule = 'None' OR c_schedule = 'Will Call') "; else if ($c_type_w != "W" && $c_type_p == "P") $typeQRY = " AND (c_schedule != 'Will Call') "; else $typeQRY = " AND (c_schedule = 'None') "; // 전체를 보이게 하려면 아래를 주석처리 (2024.03.06) // 주석 처리하지 않으면 오더장이 생성된 계정은 리스트에서 보이지 않음 //$orderflagQRY = " AND c_orderflag = 0 "; if ($c_type_o == "O") $orderflagQRY = " AND c_orderflag = 0 "; else $orderflagQRY = " ";; $qry_driver = "SELECT m_initial, m_firstname, m_lastname, m_currentdriver FROM tbl_member WHERE m_uid = '$c_driveruid' "; $rt_driver = $jdb->fQuery($qry_driver, "fetch query error"); // $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 "; // 중복 제거 $uids_R = []; $uids_P = []; $qryR_dupQRY = ""; if ($c_type_r == 'R') { $orderdate = str_replace("-", "", $orderdate); $qryR_dupQRY = " and c_uid not in ("; $qryR_dup = "SELECT * FROM tbl_request WHERE r_driveruid ='$c_driveruid' AND r_status = 'A' AND r_requestdate = '$orderdate'"; $result=$jdb->nQuery($qryR_dup, "list error"); while($list=mysqli_fetch_array($result, MYSQLI_ASSOC)) { for($i=0; $i $value ) $$key = $value; } $qryR_dupQRY = $qryR_dupQRY . $r_customeruid . ','; $uids_R[] = $r_customeruid; } $qryR_dupQRY = $qryR_dupQRY . '0) '; // 의미없는 uid 추가 } $qryS_dupQRY = ""; if ($c_type_p == 'P') { $getWeekDay = strtoupper(date('D', strtotime($orderdate))); $orderdate = str_replace("-", "", $orderdate); $qryS_dupQRY = " and c_uid not in ("; $qryS_dup = "SELECT * FROM tbl_customer WHERE c_driveruid ='$org_driveruid' AND c_status = 'A' AND c_schedule IN ('1W','2W','3W','4W','5W','6W','8W','12W') AND c_scheduleday LIKE '%".$getWeekDay."%' "; $result=$jdb->nQuery($qryS_dup, "list error"); while($list=mysqli_fetch_array($result, MYSQLI_ASSOC)) { foreach ((Array)$list as $key => $value) { $$key = $value; } $isScheduleMatch = false; if ($c_schedulebasic == $orderdate) { // 최초 1회 $isScheduleMatch = true; } else { // 몇 주마다? $weekNum = intval(str_replace('W', '', $c_schedule)); // 기준일 체크 if (!empty($c_schedulebasic)) { $baseDate = strtotime($c_schedulebasic); $targetDate = strtotime($orderdate); // 날짜 차이 $diffDays = floor(($targetDate - $baseDate) / 86400); // 과거 제외 if ($diffDays >= 0) { $diffWeeks = floor($diffDays / 7); // n주 간격 체크 if (($diffWeeks % $weekNum) == 0) { $isScheduleMatch = true; } } } } if ($isScheduleMatch) { $qryS_dupQRY = $qryS_dupQRY . $c_uid . ','; $uids_P[] = $c_uid; } } $qryS_dupQRY = $qryS_dupQRY . '0) '; // 의미없는 uid 추가 } $uids_R = array_values(array_unique($uids_R)); $uids_P = array_values(array_unique($uids_P)); $containerMap_R = []; if (!empty($uids_R)) { $in = implode(',', array_map('intval', $uids_R)); $sql = " SELECT cc_customer_uid, cc_type, cc_owner_type, cc_is_used, cc_has_lock, cc_has_wheel, cc_has_woodframe FROM tbl_customer_container WHERE cc_status = 'A' AND cc_customer_uid IN ($in) ORDER BY cc_customer_uid, cc_type, cc_uid "; $res = $jdb->nQuery($sql, "Load R containers error"); while ($row = mysqli_fetch_assoc($res)) { $containerMap_R[$row['cc_customer_uid']][] = $row; } } $containerMap_P = []; if (!empty($uids_P)) { $in = implode(',', array_map('intval', $uids_P)); $sql = " SELECT cc_customer_uid, cc_type, cc_owner_type, cc_is_used, cc_has_lock, cc_has_wheel, cc_has_woodframe FROM tbl_customer_container WHERE cc_status = 'A' AND cc_customer_uid IN ($in) ORDER BY cc_customer_uid, cc_type, cc_uid "; $res = $jdb->nQuery($sql, "Load P containers error"); while ($row = mysqli_fetch_assoc($res)) { $containerMap_P[$row['cc_customer_uid']][] = $row; } } //total record $query = "SELECT COUNT(c_uid) FROM tbl_customer WHERE c_uid <> '' AND c_status = 'A' " . $orderflagQRY. $driveruidQRY . $typeQRY . $add_srchquery . $newaccountQRY . $dormantaccountQRY . $fullcycleQRY . $fullquantityQRY . $containerQRY . $areaQRY . $qryR_dupQRY . $qryS_dupQRY; //if ($qrySTR) { // $qrySTRSTR = base64_decode($qrySTR); // $query = "SELECT COUNT(c_uid) FROM tbl_customer // WHERE c_uid <> '' AND c_status = 'A' AND c_orderflag = 0 AND c_schedule = 'None' " . $qrySTRSTR; //} $total_count=$jdb->rQuery($query, "record query error"); //echo "



[c_type_w=$c_type_w][c_type_p=$c_type_p][c_type_o=$c_type_o][$total_count][$query]
"; $add_query .= " LIMIT ".$listCnt; $query = "SELECT * FROM tbl_customer WHERE c_uid <> '' AND c_status = 'A' " . $orderflagQRY. $driveruidQRY . $typeQRY . $add_srchquery . $newaccountQRY . $dormantaccountQRY . $fullcycleQRY . $fullquantityQRY . $containerQRY . $areaQRY . $qryR_dupQRY . $qryS_dupQRY . $add_query_order . $add_query; //if ($qrySTR) { // $query = "SELECT * FROM tbl_customer // WHERE c_uid <> '' AND c_status = 'A' AND c_orderflag = 0 AND c_schedule = 'None' " . $qrySTRSTR . $add_query_order . $add_query; //} //echo "[$query]
"; //if (!$qrySTR) { // $qrySTR = base64_encode($driveruidQRY . $newaccountQRY . $dormantaccountQRY . $fullcycleQRY . $fullquantityQRY . $containerQRY . $areaQRY); //} $result=$jdb->nQuery($query, "list error"); // container $rows = []; $customer_uids = []; while ($r = mysqli_fetch_assoc($result)) { $rows[] = $r; $customer_uids[] = (int)$r['c_uid']; } $customerContainerMap = []; $customer_uids = array_values(array_unique($customer_uids)); if ($customer_uids) { $in = implode(',', $customer_uids); $sql_cc = " SELECT cc_customer_uid, cc_type, cc_owner_type, cc_is_used, cc_has_lock, cc_has_wheel, cc_has_woodframe FROM tbl_customer_container WHERE cc_status = 'A' AND cc_customer_uid IN ($in) ORDER BY cc_customer_uid, cc_type, cc_uid "; $rc = $jdb->nQuery($sql_cc, "Load customer containers error"); while ($c = mysqli_fetch_assoc($rc)) { $cu = (int)$c['cc_customer_uid']; if (!isset($customerContainerMap[$cu])) $customerContainerMap[$cu] = []; $customerContainerMap[$cu][] = $c; } } $totalrowcnt = 1; $list_number = 1; foreach ($rows as $list) { 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); $customerContainers = $customerContainerMap[$c_uid] ?? []; ob_start(); include $_SERVER['DOCUMENT_ROOT'].'/lib/customer_container_chips.php'; $containerChipsHtml = ob_get_clean(); $c_lastpickupdateSTR = $func -> convertFormat ($c_lastpickupdate, 3); $c_fullquantitydateSTR = $func -> convertFormat ($c_fullquantitydate, 3); $c_fullquantityActual = round(floatval($c_fullquantity + ($dDiff * $c_fullquantitydaily))); $c_fullquantitySTR = number_format($c_fullquantityActual); if ($c_fullcycleflag == 1) { $c_fullcycleSTR = $c_fullcycleforced; $c_fullcycleCSS = "style='color:red;'"; } else { $c_fullcycleSTR = $c_fullcycle; $c_fullcycleCSS = ""; } if ($setTag == "") { $OPTIONstr = ""; //$OPTIONTITLEstr = "OPTION"; } else { $OPTIONstr = ""; //$OPTIONTITLEstr = ""; } /////////////////////// // Get This/Last year Quantity /////////////////////// $getThisYear = date("Y"); $getLastYear = date("Y", strtotime('last year')); //echo "



[$get1Mon][$get2Mon][$get3Mon]"; $qry_sum = "SELECT SUM(CASE WHEN d_visitdate like '".$getThisYear."%' THEN d_quantity ELSE 0 END) AS THISYEAR, SUM(CASE WHEN d_visitdate like '".$getLastYear."%' THEN d_quantity ELSE 0 END) AS LASTYEAR FROM tbl_daily WHERE d_customeruid = '".$c_uid."' AND d_status = 'F' "; //echo "LIST_TOT[$qry_sum]
"; $rt_sum = $jdb->fQuery($qry_sum, "fetch query error"); $getThisYearQ = number_format(floatval($rt_sum['THISYEAR'])); $getLastYearQ = number_format(floatval($rt_sum['LASTYEAR'])); $driverPopup = ""; if ($c_schedule == 'Will Call') { $list_numberSTR = "W"; $classSTR = "bg-will-call"; } else if ($c_schedule != 'Will Call' && $c_schedule != 'None' ) { $list_numberSTR = "S"; $classSTR = "bg-period-reg"; } else { $list_numberSTR = $list_number; $classSTR = ""; } $strList .= " $list_numberSTR $c_nameSTR   $driverPopup $c_accountno $containerChipsHtml $c_paymenttype $c_rate $c_addressSTR $c_city $getLastYearQ $getThisYearQ "; if ($_SESSION['ss_LEVEL'] == 9) { $strList .= " $c_fullcycleSTR "; } else { $strList .= " "; } $strList .= " $c_lastpickupdateSTR $c_fullquantitySTR "; $list_number++; $totalrowcnt++; } if( $total_count < 1 ) { $strList = " No Data "; } //echo "






"; ///////////////////////// // ADD REQUESTED DATA ///////////////////////// if ($c_type_r == 'R') { $orderdate = str_replace("-", "", $orderdate); $qry_r = "SELECT * FROM tbl_request WHERE r_druid ='".$rt_driver['m_currentdriver']."' AND r_status = 'A' AND r_requestdate = '$orderdate' ORDER BY r_uid DESC"; //echo "Request[$qry_r]
"; $rt_r=$jdb->nQuery($qry_r, "list error"); while($list=mysqli_fetch_array($rt_r, MYSQLI_ASSOC)) { for($i=0; $i $value ) $$key = $value; } $qry_rc = "SELECT * FROM tbl_customer WHERE c_uid = '$r_customeruid'"; $rt_rc = $jdb->fQuery($qry_rc, "query error"); //echo "[$qry_rc]"; for($i=0; $i $value ) $$key = $value; } $c_nameSTR = str_replace("\\", "", $c_name); $c_addressSTR = str_replace("\\", "", $c_address); $c_containerSTR = str_replace("\\", "", $c_container); $c_lastpickupdateSTR = $func -> convertFormat ($c_lastpickupdate, 3); $c_fullquantitydateSTR = $func -> convertFormat ($c_fullquantitydate, 3); //$c_fullquantitySTR = number_format(floatval($c_fullquantity)); $c_fullquantityActual = round(floatval($c_fullquantity + ($dDiff * $c_fullquantitydaily))); $c_fullquantitySTR = number_format($c_fullquantityActual); $customerContainers = $containerMap_R[$c_uid] ?? []; ob_start(); include $_SERVER['DOCUMENT_ROOT'].'/lib/customer_container_chips.php'; $containerChipsHtml = ob_get_clean(); /////////////////////// // Get This/Last year Quantity /////////////////////// $getThisYear = date("Y"); $getLastYear = date("Y", strtotime('last year')); //echo "



[$get1Mon][$get2Mon][$get3Mon]"; $qry_sum = "SELECT SUM(CASE WHEN d_visitdate like '".$getThisYear."%' THEN d_quantity ELSE 0 END) AS THISYEAR, SUM(CASE WHEN d_visitdate like '".$getLastYear."%' THEN d_quantity ELSE 0 END) AS LASTYEAR FROM tbl_daily WHERE d_customeruid = '".$r_customeruid."' AND d_status = 'F' "; //echo "LIST_TOT[$qry_sum]
"; $rt_sum = $jdb->fQuery($qry_sum, "fetch query error"); $getThisYearQ = number_format(floatval($rt_sum['THISYEAR'])); $getLastYearQ = number_format(floatval($rt_sum['LASTYEAR'])); $driverPopup = ""; $strList_r .= " R $c_nameSTR   $driverPopup $c_accountno $containerChipsHtml $c_paymenttype $c_rate $c_addressSTR $c_city $getLastYearQ $getThisYearQ $c_fullcycle $c_lastpickupdateSTR $c_fullquantitySTR "; $totalrowcnt++; } } //echo "



[".date('D')."][".strtoupper(date('D'))."][$ttt]"; ///////////////////////// // ADD SCHEDULED DATA ///////////////////////// // Pick Up 입력시 tbl_customer 의 c_schedulebasic 에 다음 픽업일자 넣어줌. // c_schedulebasic 존재하고 orderdate 일자와 동일하면 보여줌 if ($c_type_p == 'P') { /* select c_accountno,c_schedule,c_scheduleday from tbl_customer where c_schedule > '1W' AND c_schedule <= '6W' Order by c_schedule asc */ $getWeekDay = strtoupper(date('D', strtotime($orderdate))); $orderdate = str_replace("-", "", $orderdate); $qry_s = " SELECT * FROM tbl_customer WHERE c_driveruid ='$org_driveruid' AND c_status = 'A' AND c_schedule IN ('1W','2W','3W','4W','5W','6W','8W','12W') AND c_scheduleday LIKE '%".$getWeekDay."%' ORDER BY c_uid DESC "; //echo "




Scheduled[$qry_s]
"; $rt_s=$jdb->nQuery($qry_s, "list error"); while($list=mysqli_fetch_array($rt_s, MYSQLI_ASSOC)) { for($i=0; $i $value ) $$key = $value; } // 2주 이상 스케줄 적용 $isScheduleMatch = false; // 최초 1회 if ($c_schedulebasic == $orderdate) { $isScheduleMatch = true; } else { // 몇 주마다? $weekNum = intval(str_replace('W', '', $c_schedule)); if (!empty($c_schedulebasic)) { $baseDate = strtotime($c_schedulebasic); $targetDate = strtotime($orderdate); // 날짜 차이 $diffDays = floor(($targetDate - $baseDate) / 86400); // 과거 제외 if ($diffDays >= 0) { $diffWeeks = floor($diffDays / 7); // n주 간격 체크 if (($diffWeeks % $weekNum) == 0) { $isScheduleMatch = true; } } } } if (!$isScheduleMatch) continue; $c_nameSTR = str_replace("\\", "", $c_name); $c_addressSTR = str_replace("\\", "", $c_address); $c_containerSTR = str_replace("\\", "", $c_container); $c_lastpickupdateSTR = $func -> convertFormat ($c_lastpickupdate, 3); $c_fullquantitydateSTR = $func -> convertFormat ($c_fullquantitydate, 3); //$c_fullquantitySTR = number_format(floatval($c_fullquantity)); $c_fullquantityActual = round(floatval($c_fullquantity + ($dDiff * $c_fullquantitydaily))); $c_fullquantitySTR = number_format($c_fullquantityActual); $customerContainers = $containerMap_P[$c_uid] ?? []; ob_start(); include $_SERVER['DOCUMENT_ROOT'].'/lib/customer_container_chips.php'; $containerChipsHtml = ob_get_clean(); /////////////////////// // Get This/Last year Quantity /////////////////////// $getThisYear = date("Y"); $getLastYear = date("Y", strtotime('last year')); //echo "



[$get1Mon][$get2Mon][$get3Mon]"; $qry_sum = "SELECT SUM(CASE WHEN d_visitdate like '".$getThisYear."%' THEN d_quantity ELSE 0 END) AS THISYEAR, SUM(CASE WHEN d_visitdate like '".$getLastYear."%' THEN d_quantity ELSE 0 END) AS LASTYEAR FROM tbl_daily WHERE d_customeruid = '".$c_uid."' AND d_status = 'F' "; //echo "LIST_TOT[$qry_sum]
"; $rt_sum = $jdb->fQuery($qry_sum, "fetch query error"); $getThisYearQ = number_format(floatval($rt_sum['THISYEAR'])); $getLastYearQ = number_format(floatval($rt_sum['LASTYEAR'])); $driverPopup = ""; $strList_s .= " S $c_nameSTR   $driverPopup $c_accountno $containerChipsHtml $c_paymenttype $c_rate $c_addressSTR $c_city $getLastYearQ $getThisYearQ $c_fullcycle $c_lastpickupdateSTR $c_fullquantitySTR "; $totalrowcnt++; } } //echo "



[".date('D')."][".strtoupper(date('D'))."][$ttt]"; addLog ("add", "FORECAST LIST", "VIEW", $lguserid, $query, $lgno); ?>
Will Call Scheduled Request
Option No Restaurant Name Container Payment Rate Address City Cycle Last PU Liter