2079 lines
69 KiB
PHP
2079 lines
69 KiB
PHP
<?
|
|
// Level 9 이하만 사용 가능
|
|
$func->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<sizeof($result); $i++) {
|
|
//list($key, $value) = each($result);
|
|
foreach ( (Array) $result as $key => $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 "<br><br><br><br><br>[".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 .= "
|
|
<option value='$key' $selectStr>$value</option>";
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='$key' $selectStr>$value</option>";
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='$key' $selectStr>$value</option>";
|
|
}
|
|
|
|
// 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 .= "
|
|
<option value='$key' $selectStr>$value</option>";
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='".$lt_driver['m_uid']."' $selectStr>".$lt_driver['m_initial']."</option>";
|
|
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='".$lt_city['a_city']."' $selectStr>".$lt_city['a_city']."</option>";
|
|
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='".$lt_sp['s_name']."' $selectStr>".$lt_sp['s_name']."</option>";
|
|
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='$key' $selectStr>$value</option>";
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='$key' $selectStr>$value</option>";
|
|
}
|
|
|
|
|
|
// 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 .= "
|
|
<option value='$key' $selectStr>$value</option>";
|
|
}
|
|
|
|
|
|
// 오늘 날짜의 오더장이 있는지 확인
|
|
// 있으면 정보를 가져와서 아래 조건 확인, 없는 경우 새로 생성
|
|
|
|
$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 = "<button type='button' class='btn-primary text-center btn-width-230' data-bs-toggle='modal' data-bs-target='#input-pickup-modal' data-input-pickup-type='standard-access'>INPUT PICKUP</button>";
|
|
//$PICKUPstr = "<button type='button' class='pickupOrder btn icon-pickup' data-toggle='modal' data-target='#myModalpickupOrder' data-id=\"$d_uid\" style=\"cursor:pointer;cursor:hand;\"><i class='bi bi-truck icon-edit'></i></button>";
|
|
|
|
$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<sizeof($result); $i++)
|
|
{
|
|
//list($key, $value) = each($result);
|
|
foreach ( (Array) $result as $key => $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 = "<button type='button' class='btn-primary text-center btn-width-230' data-bs-toggle='modal' data-bs-target='#input-pickup-modal' data-input-pickup-type='standard-access'>INPUT PICKUP</button>";
|
|
//$PICKUPstr = "<button type='button' class='pickupOrder btn icon-pickup' data-toggle='modal' data-target='#myModalpickupOrder' data-id=\"$d_uid\" style=\"cursor:pointer;cursor:hand;\"><i class='bi bi-truck icon-edit'></i></button>";
|
|
}
|
|
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 = "<img style='border:1px solid;' src='/upload_sign/".$d_customeruid."/".$d_payeesign."'>";
|
|
$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 "<br><br><br><br>[$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 .= "
|
|
<option value='".$lt_driver['m_uid']."' $selectStr>".$lt_driver['m_initial']."</option>";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addLog ("add", "CUSTOMER DETAIL", "VIEW", $lguserid, $query, $c_uid);
|
|
|
|
?>
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
|
|
$(function () {
|
|
$('#c_contractdate, #c_form_eu, #c_form_corsia, #c_installdate, #c_fpickup, #c_removaldate, #d_visitdate, #c_exchangedate, #c_inactivedate, #c_switchformdate').datepicker({
|
|
|
|
dateFormat: 'yy-mm-dd',
|
|
//minDate: "-10D",
|
|
//maxDate: "+1M",
|
|
//maxDate: "+1M +10D",
|
|
//showOn: "button",
|
|
//yearRange: '-50:+5',
|
|
buttonImage: "/images/cal_red.png",
|
|
//beforeShowDay: $.datepicker.noWeekends,
|
|
buttonImageOnly: true,
|
|
//showOn: "both",
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
firstDay: 7
|
|
});
|
|
$('#c_salescommissiondate').datepicker({
|
|
|
|
dateFormat: 'yy-mm',
|
|
//minDate: "-10D",
|
|
//maxDate: "+1M",
|
|
//maxDate: "+1M +10D",
|
|
//showOn: "button",
|
|
//yearRange: '-50:+5',
|
|
buttonImage: "/images/cal_red.png",
|
|
//beforeShowDay: $.datepicker.noWeekends,
|
|
buttonImageOnly: true,
|
|
//showOn: "both",
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
firstDay: 7
|
|
});
|
|
|
|
//var array = ["2023-05-27","2023-05-29"];
|
|
var array = [];
|
|
|
|
$('#r_requestdate').datepicker({
|
|
|
|
dateFormat: 'yy-mm-dd',
|
|
minDate: "0D",
|
|
//maxDate: "+5D",
|
|
//maxDate: "+1M +10D",
|
|
//showOn: "button",
|
|
//yearRange: '-50:+5',
|
|
buttonImage: "/images/cal_red.png",
|
|
//beforeShowDay: $.datepicker.noWeekends,
|
|
buttonImageOnly: true,
|
|
//showOn: "both",
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
firstDay: 7,
|
|
beforeShowDay: function(date) {
|
|
// Sat, Sunday
|
|
// if(date.getDay()==6||date.getDay()==0) return [false,"","Not available"];
|
|
|
|
//if(date.getDay()==0) return [false,"","Not available"];
|
|
|
|
// Specific Date
|
|
if($.inArray($.datepicker.formatDate('yy-mm-dd', date ), array) > -1)
|
|
{
|
|
return [false,"","Not available"];
|
|
}
|
|
else
|
|
{
|
|
return [true,'',"Available"];
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
/*
|
|
$(function() {
|
|
$( "#c_salescommissiondate" ).datepicker();
|
|
});
|
|
*/
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
/*
|
|
// Use datepicker on the date inputs
|
|
$("input[type=date]").datepicker({
|
|
dateFormat: 'yyyy-mm-dd',
|
|
buttonImageOnly: true,
|
|
onSelect: function(dateText, inst) {
|
|
$(inst).val(dateText); // Write the value in the input
|
|
}
|
|
});
|
|
|
|
// Code below to avoid the classic date-picker
|
|
$("input[type=date]").on('click', function() {
|
|
return false;
|
|
});
|
|
|
|
|
|
$( function() {
|
|
$( "#c_contractdate" ).datepicker();
|
|
} );
|
|
|
|
|
|
$(function() {
|
|
$( "#c_contractdate" ).datepicker({showOn: 'both', buttonText: 'Pick date'});
|
|
});
|
|
*/
|
|
|
|
|
|
<? if ($setTag == "DISABLED") { ?>
|
|
$(document).ready(function() {
|
|
|
|
$('#customer-button-id').prop('disabled', true);
|
|
$("#customer-button-id").css({'color': '#ffffff', 'background-color' : '#a5a5a5'});
|
|
|
|
});
|
|
<? } ?>
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
// Decimal (ex 11, 11.0)
|
|
$("#c_rate, #d_quantity, #d_payamount, #c_mainvolume, #c_fullcycle, #c_fullcycleforced").on("input", function(evt) {
|
|
var self = $(this);
|
|
self.val(self.val().replace(/[^0-9\.]/g, ''));
|
|
if ((evt.which != 46 || self.val().indexOf('.') != -1) && (evt.which < 48 || evt.which > 57))
|
|
{
|
|
evt.preventDefault();
|
|
}
|
|
});
|
|
|
|
// Number Only (ex 1, 1000 not 10.1)
|
|
$('#c_expoilmonth').keyup(function(e)
|
|
{
|
|
if (/\D/g.test(this.value))
|
|
{
|
|
// Filter non-digits from input value.
|
|
this.value = this.value.replace(/\D/g, '');
|
|
}
|
|
});
|
|
|
|
|
|
// 알파벳 + 숫자 만 입력 가능. 6자리 제한.(maxlength="6") 소문자 입력시 자동 대문자로 변환
|
|
$('#c_postal').keyup(function (e) {
|
|
|
|
$(this).val($(this).val().toUpperCase());
|
|
var regex = new RegExp("^[a-zA-Z0-9]+$");
|
|
var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
|
|
|
|
if (regex.test(str)) {
|
|
return true;
|
|
}
|
|
e.preventDefault();
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
// 숫자만 입력가능 xxx-xxx-xxxx 형식으로 자동 - 삽입
|
|
$('#c_phone').on('input', function() {
|
|
var number = $(this).val().replace(/[^\d]/g, '')
|
|
if (number.length == 7) {
|
|
number = number.replace(/(\d{3})(\d{4})/, "$1-$2");
|
|
} else if (number.length == 10) {
|
|
number = number.replace(/(\d{3})(\d{3})(\d{4})/, "$1-$2-$3");
|
|
}
|
|
$(this).val(number);
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<SCRIPT>
|
|
|
|
// xmlhttp RUN script
|
|
function xmlhttpPost(strURL, param, tagID) {
|
|
|
|
var xmlHttpReq = false;
|
|
var self = this;
|
|
|
|
// Mozilla/Safari
|
|
if (window.XMLHttpRequest) {
|
|
self.xmlHttpReq = new XMLHttpRequest();
|
|
}
|
|
|
|
// IE
|
|
else if (window.ActiveXObject) {
|
|
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
|
|
}
|
|
|
|
self.xmlHttpReq.open('POST', strURL, true);
|
|
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
self.xmlHttpReq.onreadystatechange = function() {
|
|
if (self.xmlHttpReq.readyState == 4) {
|
|
updatepage(self.xmlHttpReq.responseText, tagID);
|
|
}
|
|
}
|
|
self.xmlHttpReq.send(getquerystring(param));
|
|
}
|
|
|
|
|
|
function getquerystring(param) {
|
|
qstr = 's=' + escape(param); // NOTE: no '?' before querystring
|
|
return qstr;
|
|
}
|
|
|
|
|
|
|
|
function updatepage(str, tagID){
|
|
document.getElementById(tagID).innerHTML = str;
|
|
}
|
|
|
|
|
|
function checkAccountNo() {
|
|
var str = document.getElementById('c_accountno').value;
|
|
//alert(str);
|
|
|
|
str = str.toUpperCase();
|
|
|
|
if (str=="") {
|
|
//document.getElementById("PPMUNITPRICEid").value="";
|
|
//return;
|
|
}
|
|
|
|
if (window.XMLHttpRequest) {
|
|
// code for IE7+, Firefox, Chrome, Opera, Safari
|
|
xmlhttp=new XMLHttpRequest();
|
|
} else { // code for IE6, IE5
|
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|
}
|
|
xmlhttp.onreadystatechange=function() {
|
|
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
|
|
var rt = xmlhttp.responseText;
|
|
//alert(rt);
|
|
|
|
if (rt.trim() >= 1) {
|
|
|
|
//alert("Existing no. Please change the no.");
|
|
//document.getElementById("emailcheckid").innerHTML= "<font color='#FF0000'>(Existing Email. Please input other Email.)</font>";
|
|
//document.getElementById('PPPPONOid').value="";
|
|
document.getElementById('accountNoValidateid').value = 0;
|
|
//alert('This email is already in use. Please enter a different email.');
|
|
$('#myModal').find('.modal-body').text('This Account # is already in use. Please enter a different Account #.');
|
|
$('#myModal').modal('show');
|
|
$('#myModal').on('hidden.bs.modal', function () {
|
|
document.getElementById('c_accountno').value = "";
|
|
document.getElementById('c_accountno').focus();
|
|
});
|
|
|
|
return false;
|
|
}
|
|
else {
|
|
//alert("Available no.");
|
|
//document.getElementById("emailcheckid").innerHTML= "<font color='#0000FF'>(Available no.)</font>";
|
|
|
|
document.getElementById('accountNoValidateid').value = 1;
|
|
document.getElementById('c_accountno').value = str;
|
|
return true;
|
|
}
|
|
|
|
//document.getElementById('ORGCPTYPEid').value=sellunit.trim();
|
|
}
|
|
}
|
|
xmlhttp.open("GET","/lib/checkaccountnolib.php?s="+str,true);
|
|
xmlhttp.send();
|
|
}
|
|
|
|
</SCRIPT>
|
|
|
|
<SCRIPT language=javascript>
|
|
$(document).ready(function() {
|
|
//set initial state.
|
|
$('#na').val($(this).is(':checked'));
|
|
|
|
$('#na').change(function() {
|
|
if($(this).is(":checked")) {
|
|
//var returnVal = confirm("Are you sure?");
|
|
//$(this).attr("checked", returnVal);
|
|
$(this).attr("checked", 1);
|
|
document.getElementById('c_installdate').value = "N/A";
|
|
}
|
|
else {
|
|
document.getElementById('c_installdate').value = "";
|
|
}
|
|
|
|
$('#na').val($(this).is(':checked'));
|
|
});
|
|
|
|
|
|
//set initial state.
|
|
$('#rdna').val($(this).is(':checked'));
|
|
|
|
$('#rdna').change(function() {
|
|
if($(this).is(":checked")) {
|
|
//var returnVal = confirm("Are you sure?");
|
|
//$(this).attr("checked", returnVal);
|
|
$(this).attr("checked", 1);
|
|
document.getElementById('c_removaldate').value = "";
|
|
}
|
|
else {
|
|
document.getElementById('c_removaldate').value = "";
|
|
}
|
|
|
|
$('#rdna').val($(this).is(':checked'));
|
|
});
|
|
|
|
//set initial state.
|
|
$('#iana').val($(this).is(':checked'));
|
|
|
|
$('#iana').change(function() {
|
|
if($(this).is(":checked")) {
|
|
//var returnVal = confirm("Are you sure?");
|
|
//$(this).attr("checked", returnVal);
|
|
$(this).attr("checked", 1);
|
|
document.getElementById('c_inactivedate').value = "";
|
|
}
|
|
else {
|
|
document.getElementById('c_inactivedate').value = "";
|
|
}
|
|
|
|
$('#iana').val($(this).is(':checked'));
|
|
});
|
|
|
|
//set initial state.
|
|
$('#cena').val($(this).is(':checked'));
|
|
|
|
$('#cena').change(function() {
|
|
if($(this).is(":checked")) {
|
|
//var returnVal = confirm("Are you sure?");
|
|
//$(this).attr("checked", returnVal);
|
|
$(this).attr("checked", 1);
|
|
document.getElementById('c_exchangedate').value = "";
|
|
}
|
|
else {
|
|
document.getElementById('c_exchangedate').value = "";
|
|
}
|
|
|
|
$('#cena').val($(this).is(':checked'));
|
|
});
|
|
|
|
|
|
//set initial state.
|
|
$('#fpna').val($(this).is(':checked'));
|
|
|
|
$('#fpna').change(function() {
|
|
if($(this).is(":checked")) {
|
|
//var returnVal = confirm("Are you sure?");
|
|
//$(this).attr("checked", returnVal);
|
|
$(this).attr("checked", 1);
|
|
document.getElementById('c_fpickup').value = "";
|
|
}
|
|
else {
|
|
document.getElementById('c_fpickup').value = "";
|
|
}
|
|
|
|
$('#fpna').val($(this).is(':checked'));
|
|
});
|
|
|
|
|
|
//set initial state.
|
|
$('#sfna').val($(this).is(':checked'));
|
|
|
|
$('#sfna').change(function() {
|
|
if($(this).is(":checked")) {
|
|
//var returnVal = confirm("Are you sure?");
|
|
//$(this).attr("checked", returnVal);
|
|
$(this).attr("checked", 1);
|
|
document.getElementById('c_switchformdate').value = "";
|
|
}
|
|
else {
|
|
document.getElementById('c_switchformdate').value = "";
|
|
}
|
|
|
|
$('#sfna').val($(this).is(':checked'));
|
|
});
|
|
});
|
|
</SCRIPT>
|
|
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
//$("#email").val("");
|
|
//$('#userinfo')[0].reset();
|
|
|
|
$("#customerinfo").validate({
|
|
// Specify validation rules
|
|
ignore: ".ignore",
|
|
rules: {
|
|
c_accountno: {
|
|
required: true,
|
|
},
|
|
c_status: {
|
|
required: true,
|
|
},
|
|
c_inactivedate: {
|
|
required: function(elem) {
|
|
if ($("#c_status").val() == 'I') { return true; }
|
|
else { return false; }
|
|
},
|
|
},
|
|
c_name: {
|
|
required: true,
|
|
},
|
|
c_driveruid: {
|
|
required: true,
|
|
},
|
|
c_phone: {
|
|
required: true,
|
|
minlength: 10,
|
|
maxlength: 12,
|
|
},
|
|
},
|
|
messages: {
|
|
|
|
c_accountno: {
|
|
required: "Please input Account No",
|
|
},
|
|
c_status: {
|
|
required: "Please select Status",
|
|
},
|
|
c_inactivedate: {
|
|
required: "Please Input Inactive Date",
|
|
},
|
|
c_name: {
|
|
required: "Please input Restaurant name",
|
|
},
|
|
c_driveruid: {
|
|
required: "Please select Driver",
|
|
},
|
|
c_phone: {
|
|
required: "Please enter phone number (Number Only)",
|
|
minlength: "Phone number field accept only 10-15 digits",
|
|
maxlength: "Phone number field accept only 10-15 digits",
|
|
},
|
|
},
|
|
|
|
errorElement : 'div',
|
|
|
|
/*submitHandler: function(form) {
|
|
if (grecaptcha.getResponse(1) == '') alert("Error");
|
|
else form.submit();
|
|
|
|
}*/
|
|
|
|
});
|
|
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
//$("#email").val("");
|
|
//$('#userinfo')[0].reset();
|
|
|
|
$("#addrequest").validate({
|
|
// Specify validation rules
|
|
ignore: ".ignore",
|
|
rules: {
|
|
r_requestdate: {
|
|
required: true,
|
|
},
|
|
r_driveruid: {
|
|
required: true,
|
|
},
|
|
},
|
|
messages: {
|
|
|
|
c_accountno: {
|
|
required: "Please input request date",
|
|
},
|
|
r_driveruid: {
|
|
required: "Please select driver",
|
|
},
|
|
},
|
|
|
|
errorElement : 'div',
|
|
|
|
/*submitHandler: function(form) {
|
|
if (grecaptcha.getResponse(1) == '') alert("Error");
|
|
else form.submit();
|
|
|
|
}*/
|
|
|
|
});
|
|
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!--link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.css"-->
|
|
<!--link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/south-street/jquery-ui.css" rel="stylesheet"-->
|
|
|
|
|
|
<script type="text/javascript" src="/assets/js/jquery.ui.touch-punch.min.js"></script>
|
|
<script type="text/javascript" src="/assets/js/jquery.signature.min.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/assets/css/jquery.signature.css">
|
|
|
|
|
|
<style>
|
|
.kbw-signature { width: 340px; height: 120px;}
|
|
#sig canvas{
|
|
/*width: 100% !important;*/
|
|
width: 100%;
|
|
height: auto;
|
|
border-bottom: 1px solid #BCBBBB;
|
|
}
|
|
|
|
.btn-clear{
|
|
color: #fff;
|
|
background: #BCBBBB;
|
|
|
|
border-radius: 5px;
|
|
border: 1px solid #BCBBBB;
|
|
float:right;
|
|
}
|
|
|
|
/* Map > Input > Sludge */
|
|
.number-input {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
}
|
|
|
|
.number-input input {
|
|
width: 100%;
|
|
text-align: center;
|
|
}
|
|
|
|
.number-input button {
|
|
padding: 5px 10px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* 기본 화살표 제거 */
|
|
.d_sludge::-webkit-inner-spin-button,
|
|
.d_sludge::-webkit-outer-spin-button {
|
|
-webkit-appearance: none;
|
|
margin: 0;
|
|
}
|
|
.d_sludge {
|
|
-moz-appearance: textfield;
|
|
}
|
|
|
|
.left, .right {
|
|
background: none;
|
|
border: none;
|
|
color: #77B469;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
margin: 0;
|
|
appearance: none;
|
|
box-shadow: none;
|
|
outline: none;
|
|
}
|
|
</style>
|
|
|
|
|
|
|
|
<SCRIPT language=javascript>
|
|
|
|
$(document).ready(function()
|
|
{
|
|
$('#signednew').change(function()
|
|
{
|
|
if(this.checked != true)
|
|
{
|
|
document.getElementById("signitureedid").style.display="inline";
|
|
document.getElementById("signitureid").style.display="none";
|
|
document.getElementById("clrbtnid").style.display="none";
|
|
}
|
|
else {
|
|
document.getElementById("signitureedid").style.display="none";
|
|
document.getElementById("signitureid").style.display="inline";
|
|
document.getElementById("clrbtnid").style.display="inline";
|
|
}
|
|
});
|
|
});
|
|
|
|
</SCRIPT>
|
|
|
|
|
|
<style>
|
|
.error{
|
|
color: red;
|
|
font-weight: 200;
|
|
padding:-1em;
|
|
}
|
|
</style>
|
|
|
|
|
|
<? include getenv("DOCUMENT_ROOT")."/include/message_js.php"; ?>
|
|
|
|
|
|
<main id="main" class="main">
|
|
|
|
<!-- ======= Breadcrumbs ======= -->
|
|
<div class="breadcrumbs">
|
|
<div class="container">
|
|
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<h2>CUSTOMER</h2>
|
|
<ol>
|
|
<li><a href="index.html">HOME</a></li>
|
|
<li>CUSTOMER</li>
|
|
</ol>
|
|
</div>
|
|
|
|
<? if ($mode == "update") { ?>
|
|
<div class="wrap-border">
|
|
<table class=" col-float-right">
|
|
<tr>
|
|
<td>
|
|
<? if ($setTag == "ENABLED") { ?>
|
|
<button type="button" id="request-button-id" class="btn-blue-sub btn-width-200" data-bs-toggle="modal" data-bs-target="#request-modal" data-request-type="standard-access"> REQUEST </button>
|
|
<? } ?>
|
|
</td>
|
|
<td>
|
|
<?=$PICKUPstr?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div><!--wrap-border-->
|
|
<? } ?>
|
|
|
|
</div><!--container Ends-->
|
|
</div><!-- Breadcrumbs Ends-->
|
|
<FORM NAME=customerinfo id=customerinfo METHOD=POST ACTION=/doc/customer_process.php >
|
|
|
|
<input type=hidden name=mode value="<?=$mode?>">
|
|
<input type=hidden name=actionStr value="CUSTOMERINFO">
|
|
<input type=hidden name=c_uid value="<?=$c_uid?>">
|
|
<input type=hidden name=c_forceddate value="<?=$c_forceddate?>">
|
|
<input type=hidden name=directurl value="index_intranet.php">
|
|
<input type=hidden name=accountNoValidate id='accountNoValidateid' value="">
|
|
|
|
<input type=hidden name=switched value="<?=$switched?>">
|
|
<input type=hidden name=page value="<?=$page?>">
|
|
<input type=hidden name=key_word value="<?=$key_word?>">
|
|
<input type=hidden name=column value="<?=$column?>">
|
|
<input type=hidden name=sorting_type value="<?=$sorting_type?>">
|
|
<input type=hidden name=switch value="<?=$switch?>">
|
|
<input type=hidden name=cstatus value="<?=$cstatus?>">
|
|
|
|
<section class="page">
|
|
|
|
|
|
<div class="container customer-info" data-aos="fade-up">
|
|
|
|
<div class="wrap-border">
|
|
<div class="h3-title-section">
|
|
<h3><span style="color:var(--color-primary);">Restaurant</span> Information</h3>
|
|
</div>
|
|
<table class="tb-info-box">
|
|
<tr>
|
|
<td class="td-title-info">Account No</td>
|
|
<td class="td-text-info">
|
|
<input class="accountNo" type="text" id="c_accountno" name="c_accountno" required='required' onBlur="checkAccountNo();" VALUE="<?=$c_accountno?>" <?=$admTag?>>
|
|
</td>
|
|
|
|
<td class="td-title-info">Status</td>
|
|
<td class="td-text-info">
|
|
<select name="c_status" id="c_status" required='required' class="custom-select">
|
|
<option value=''>Select</option>
|
|
<?=$c_statusSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Restaurant Name</td>
|
|
<td class="td-text-info">
|
|
<input class="restaurantName" type="text" id="c_name" name="c_name" required='required' value="<?=htmlspecialchars($c_nameSTR, ENT_QUOTES)?>" placeholder="Green Oil Inc">
|
|
</td>
|
|
|
|
<td class="td-title-info">Inactive Date <div style="display: inline; float:right; padding-right: 30px;">Init <input type="checkbox" id="iana" name="iana" value="1"></div></td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_inactivedate" name="c_inactivedate" value="<?=$c_inactivedateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Address</td>
|
|
<td class="td-text-info">
|
|
<input class="address" type="text" id="c_address" name="c_address" required='required' value="<?=htmlspecialchars($c_addressSTR, ENT_QUOTES)?>" placeholder="4490 Chesswood Dr Unit #9">
|
|
</td>
|
|
|
|
<td class="td-title-info">Driver</td>
|
|
<td class="td-text-info">
|
|
<select name="c_driveruid" id="c_driveruid" class="custom-select">
|
|
<option value=''>Select</option>
|
|
<?=$c_driveruidSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">City</td>
|
|
<td class="td-text-info">
|
|
<select name="c_city" id="c_city" class="custom-select" required='required' >
|
|
<option value=''>Select</option>
|
|
<?=$c_citySTR?>
|
|
</select>
|
|
</td>
|
|
|
|
<td class="td-title-info">Rate</td>
|
|
<td class="td-text-info">
|
|
<input class="rate" type="text" id="c_rate" name="c_rate" required='required' value="<?=$c_rate?>" placeholder="0.150" maxlength="6">
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
<td class="td-title-info">Area</td>
|
|
<td class="td-text-info">
|
|
<input class="area" type="text" id="a_text" name="a_text" value="<?=$a_textSTR?>" disabled>
|
|
</td>
|
|
|
|
<td class="td-title-info">Payment</td>
|
|
<td class="td-text-info">
|
|
<select name="c_paymenttype" id="c_paymenttype" class="custom-select" required='required' >
|
|
<option value=''>Select</option>
|
|
<?=$c_paymenttypeSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Postal Code</td>
|
|
<td class="td-text-info">
|
|
<input class="postalCode" type="text" id="c_postal" name="c_postal" value="<?=htmlspecialchars($c_postalSTR, ENT_QUOTES)?>" placeholder="M3J2B9" required='required' maxlength="6">
|
|
</td>
|
|
|
|
<td class="td-title-info">Main Volume</td>
|
|
<td class="td-text-info">
|
|
<input class="cycle" type="text" id="c_mainvolume" name="c_mainvolume" placeholder="365" value="<?=$c_mainvolume?>" maxlength="4">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Phone</td>
|
|
<td class="td-text-info">
|
|
<input class="phone" type="text" id="c_phone" name="c_phone" placeholder="416-777-8888" value="<?=htmlspecialchars($c_phoneSTR, ENT_QUOTES)?>" required='required' maxlength="12">
|
|
</td>
|
|
|
|
<td class="td-title-info">Main Container</td>
|
|
<td class="td-text-info">
|
|
<select name="c_maincontainer" id="c_maincontainer" class="custom-select" required='required'>
|
|
<option value=''>Select</option>
|
|
<?=$c_maincontainerSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Ext</td>
|
|
<td class="td-text-info">
|
|
<input class="cell" type="text" id="c_phoneext" name="c_phoneext" placeholder="1234" value="<?=htmlspecialchars($c_phoneextSTR, ENT_QUOTES)?>">
|
|
</td>
|
|
|
|
<td class="td-title-info">Container Detail</td>
|
|
<td class="td-text-info">
|
|
<input class="containerDetail" type="text" id="c_container" name="c_container" value="<?=htmlspecialchars($c_containerSTR, ENT_QUOTES)?>">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Cell</td>
|
|
<td class="td-text-info">
|
|
<input class="cell" type="text" id="c_cell" name="c_cell" placeholder="416-777-8888" value="<?=htmlspecialchars($c_cellSTR, ENT_QUOTES)?>">
|
|
</td>
|
|
|
|
<td class="td-title-info">Container Exc. Date <div style="display: inline; float:right; padding-right: 30px;">Init <input type="checkbox" id="cena" name="cena" value="1"></div></td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_exchangedate" name="c_exchangedate" value="<?=$c_exchangedateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Cycle</td>
|
|
<td class="td-text-info">
|
|
<input class="cycle" type="text" id="c_fullcycle" name="c_fullcycle" placeholder="365" value="<?=$c_fullcycle?>" maxlength="6">
|
|
</td>
|
|
|
|
<td class="td-title-info">Container Location</td>
|
|
<td class="td-text-info">
|
|
<input class="containerLocation" type="text" id="c_location" name="c_location" value="<?=htmlspecialchars($c_locationSTR, ENT_QUOTES)?>" placeholder="beside of back door">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Forced Cycle</td>
|
|
<td class="td-text-info">
|
|
<input class="cycle" type="text" id="c_fullcycleforced" name="c_fullcycleforced" style='color:red;' placeholder="365" value="<?=$c_fullcycleforced?>" maxlength="6">
|
|
</td>
|
|
|
|
<td class="td-title-info">Pickup Schedule</td>
|
|
<td class="td-text-info">
|
|
<select name="c_schedule" id="c_schedule" class="custom-select" required='required'>
|
|
<option value=''>Select</option>
|
|
<?=$c_scheduleSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Expected Oil Volume Per Month</td>
|
|
<td class="td-text-info">
|
|
<input class="cycle" type="text" id="c_expoilmonth" name="c_expoilmonth" placeholder="100" value="<?=$c_expoilmonth?>" maxlength="7">
|
|
</td>
|
|
|
|
<td class="td-title-info">Pickup Weekday</td>
|
|
<td class="td-text-info">
|
|
|
|
<label class="container-chk">MON
|
|
<input type="checkbox" id="c_scheduleday_mon" name="c_scheduleday[]" value="MON" <?=$c_scheduledayMON?>>
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
<label class="container-chk">TUE
|
|
<input type="checkbox" id="c_scheduleday_tue" name="c_scheduleday[]" value="TUE" <?=$c_scheduledayTUE?>>
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
<label class="container-chk">WED
|
|
<input type="checkbox" id="c_scheduleday_wed" name="c_scheduleday[]" value="WED" <?=$c_scheduledayWED?>>
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
<label class="container-chk">THU
|
|
<input type="checkbox" id="c_scheduleday_thu" name="c_scheduleday[]" value="THU" <?=$c_scheduledayTHU?>>
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
<label class="container-chk">FRI
|
|
<input type="checkbox" id="c_scheduleday_fri" name="c_scheduleday[]" value="FRI" <?=$c_scheduledayFRI?>>
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
<label class="container-chk">SAT
|
|
<input type="checkbox" id="c_scheduleday_sat" name="c_scheduleday[]" value="SAT" <?=$c_scheduledaySAT?>>
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Comment</td>
|
|
<td class="td-text-info" colspan="3">
|
|
<input class="comment_ri" type="text" id="c_comment_ri" name="c_comment_ri" value="<?=htmlspecialchars($c_comment_riSTR, ENT_QUOTES)?>" placeholder="">
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div><!--wrap-border-->
|
|
<!--
|
|
<div class="btn-box">
|
|
<button id="customer-button-id" class="btn-save text-center" href="#">SAVE</button>
|
|
</div>
|
|
-->
|
|
</div><!--Container Ends-->
|
|
|
|
<!--Restaurant Information Ends-->
|
|
|
|
</section>
|
|
|
|
<section class="page">
|
|
|
|
|
|
<div class="container customer-info" data-aos="fade-up">
|
|
|
|
<div class="wrap-border">
|
|
<div class="h3-title-section">
|
|
<h3><span style="color:var(--color-primary);">Contact</span> Information</h3>
|
|
</div>
|
|
<table class="tb-info-box">
|
|
<tr>
|
|
<td class="td-title-info">Contract Date</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_contractdate" name="c_contractdate" value="<?=$c_contractdateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
|
|
<td class="td-title-info">Sales Person</td>
|
|
<td class="td-text-info">
|
|
<select name="c_salesperson" id="c_salesperson" class="custom-select" required='required'>
|
|
<option value="">Select</option>
|
|
<?=$c_salespersonSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Form</td>
|
|
<td class="td-text-info">
|
|
<select name="c_form_new" id="c_form_new" class="custom-select">
|
|
<?=$c_form_newSTR?>
|
|
</select>
|
|
</td>
|
|
|
|
<td class="td-title-info">Sales Method</td>
|
|
<td class="td-text-info">
|
|
<select name="c_salesmethod" id="c_salesmethod" class="custom-select">
|
|
<?=$c_salesmethodSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">US</td>
|
|
<td class="td-text-info">
|
|
<select name="c_form_us" id="c_form_us" class="custom-select">
|
|
<option value="Y" <?=($c_form_us == "Y")?"selected":"";?>>Yes</option>
|
|
<option value="N" <?=($c_form_us == "N")?"selected":"";?>>No</option>
|
|
<option value="R" <?=($c_form_us == "R")?"selected":"";?>>Yes(R)</option>
|
|
</select>
|
|
</td>
|
|
|
|
<td class="td-title-info">Sale Commission Date</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_salescommissiondate" name="c_salescommissiondate" value="<?=$c_salescommissiondateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">EU Date</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_form_eu" name="c_form_eu" value="<?=$c_form_euSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
|
|
<td class="td-title-info">Install Date <div style="display: inline; float:right; padding-right: 30px;">N/A<input type="checkbox" id="na" name="na" value="1"></div></td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_installdate" name="c_installdate" value="<?=$c_installdateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">CORSIA Date</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_form_corsia" name="c_form_corsia" value="<?=$c_form_corsiaSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
|
|
<td class="td-title-info">First Pickup<div style="display: inline; float:right; padding-right: 30px;">Init <input type="checkbox" id="fpna" name="fpna" value="1"></div></td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_fpickup" name="c_fpickup" value="<?=$c_fpickupSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Switch Form Date <div style="display: inline; float:right; padding-right: 30px;">Init <input type="checkbox" id="sfna" name="sfna" value="1"></div></td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_switchformdate" name="c_switchformdate" value="<?=$c_switchformdateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
|
|
<td class="td-title-info">Payable To</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_payableto" name="c_payableto" value="<?=htmlspecialchars($c_payabletoSTR, ENT_QUOTES)?>" placeholder="Green Oil Inc.">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Contact By</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_contractby" name="c_contractby" value="<?=$c_contractby?>" >
|
|
</td>
|
|
|
|
<td class="td-title-info">Payment Cycle</td>
|
|
<td class="td-text-info">
|
|
<select name="c_paymentcycle" id="c_paymentcycle" class="custom-select">
|
|
<option value="">Select</option>
|
|
<?=$c_paymentcycleSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Email</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_email" name="c_email" value="<?=$c_emailSTR?>" placeholder="company@company.com">
|
|
</td>
|
|
|
|
<td class="td-title-info">Mailing Address</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_mailingaddr" name="c_mailingaddr" value="<?=htmlspecialchars($c_mailingaddrSTR, ENT_QUOTES)?>" placeholder="4490 Chesswood Dr Unit #9, North York, ON M3J2B9">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Removal Date <div style="display: inline; float:right; padding-right: 30px;">Init <input type="checkbox" id="rdna" name="rdna" value="1"></div></td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_removaldate" name="c_removaldate" value="<?=$c_removaldateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly>
|
|
</td>
|
|
|
|
<td class="td-title-info">HST No</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="c_hstno" name="c_hstno" value="<?=htmlspecialchars($c_hstnoSTR, ENT_QUOTES)?>" placeholder="R121345678">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Sludge</td>
|
|
<td class="td-text-info">
|
|
<input class="sludge" type="text" id="c_sludge" name="c_sludge" value="<?=$c_sludge?>">
|
|
</td>
|
|
|
|
<td class="td-title-info">Identification Code</td>
|
|
<td class="td-text-info">
|
|
<input class="c_identcode" type="text" id="c_identcode" name="c_identcode" value="<?=htmlspecialchars($c_identcodeSTR, ENT_QUOTES)?>" placeholder="">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Comment</td>
|
|
<td class="td-text-info" colspan="3">
|
|
<input class="comment_ci" type="text" id="c_comment_ci" name="c_comment_ci" value="<?=htmlspecialchars($c_comment_ciSTR, ENT_QUOTES)?>" placeholder="">
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
</div><!--wrap-border-->
|
|
|
|
<div class="btn-box">
|
|
<button type="submit" id="customer-button-id" class="btn-save text-center" href="#">SAVE</button>
|
|
</div><!--btn-box Ends-->
|
|
|
|
</div>
|
|
<!--Contact Information Ends-->
|
|
|
|
</section>
|
|
|
|
</FORM>
|
|
|
|
|
|
|
|
|
|
<?
|
|
|
|
if ($_SESSION['ss_LEVEL'] == "1" || $_SESSION['ss_LEVEL'] == "5" || $_SESSION['ss_LEVEL'] == "6" || $_SESSION['ss_LEVEL'] == "7" ) {
|
|
$add_query = " ORDER BY n_uid DESC";
|
|
}
|
|
else if ($_SESSION['ss_LEVEL'] == "9" && $_SESSION['ss_UID'] == $c_driveruid) {
|
|
$add_query = " AND n_memberuid = '".$_SESSION['ss_UID']."' ORDER BY n_uid DESC";
|
|
}
|
|
else {
|
|
$msg = "Invalid User Level. Please try again.";
|
|
$func -> 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]<br>";
|
|
|
|
//페이징변수설정
|
|
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]<br>[$query]<br>[$query_note]";
|
|
|
|
$result_note=$jdb->nQuery($query_note, "list error");
|
|
|
|
while($list_note=mysqli_fetch_array($result_note, MYSQLI_ASSOC)) {
|
|
for($i=0; $i<sizeof($list_note); $i++) {
|
|
//list($key, $value) = each($list_note);
|
|
foreach ( (Array) $list_note as $key => $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 = "<a class=\"deleteClass btn-member\" data-toggle=\"modal\" data-target=\"#myModalDelete\" data-id=\"$n_uid\"><i class=\"bi bi-x-circle icon-delete\"></i></a>";
|
|
//$OPTIONTITLEstr = "OPTION";
|
|
}
|
|
else {
|
|
$OPTIONstr = "";
|
|
//$OPTIONTITLEstr = "";
|
|
}
|
|
|
|
$strList .= "
|
|
<tr>
|
|
<td class=\"td-text-info\">$list_number</td>
|
|
<td class=\"td-text-info\">$n_createddateSTR</td>
|
|
<td class=\"td-text-info\">".$rt_writer['m_firstname']." ".$rt_writer['m_lastname']."</td>
|
|
<td class=\"td-text-info\">$n_noteSTR</td>
|
|
<td class=\"td-text-info\" align=center>$OPTIONstr</td>
|
|
</tr>
|
|
";
|
|
|
|
$list_number--;
|
|
}
|
|
|
|
|
|
if( $total_count < 1 ) {
|
|
$strList = "
|
|
<tr><td colspan='5' align=center height='30'><B>No Data</B></td></tr>
|
|
";
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
|
|
<SCRIPT TYPE="TEXT/JAVASCRIPT">
|
|
$(function () {
|
|
$(".deleteClass").click(function () {
|
|
var my_id_value = $(this).data('id');
|
|
$(".modal-footer #n_uid").val(my_id_value);
|
|
})
|
|
});
|
|
</SCRIPT>
|
|
|
|
|
|
<section class="page">
|
|
|
|
|
|
<div class="container customer-info" data-aos="fade-up">
|
|
|
|
|
|
|
|
<div class="wrap-border">
|
|
<div class="h3-title-section">
|
|
<h3><span style="color:var(--color-primary);">Note</span> </h3>
|
|
</div>
|
|
|
|
<? if ($mode == "update" && $_SESSION['ss_LEVEL'] != 7) { ?>
|
|
<div class="btn-box">
|
|
<button type="button" class="btn-save text-center" data-bs-toggle="modal" data-bs-target="#add-note-modal" data-add-note-type="standard-access">ADD</button>
|
|
</div><!--btn-box Ends-->
|
|
<? } ?>
|
|
|
|
<p style="clear: both;"></p>
|
|
|
|
<table class="tb-info-box-note">
|
|
<tr>
|
|
<td class="td-title-info td-num" width="5%">No </td>
|
|
<td class="td-title-info td-date-note">Date </td>
|
|
<td class="td-title-info td-creator-note">Creator </td>
|
|
<td class="td-title-info td-note">Note </td>
|
|
<td class="td-title-info td-opt">Option </td>
|
|
</tr>
|
|
|
|
<?=$strList?>
|
|
|
|
<!--
|
|
<tr>
|
|
<td class="td-text-info">2023-10-31</td>
|
|
<td class="td-text-info">Dustin Choi</td>
|
|
<td class="td-text-info">stolen D replacement (11/7/2017),
|
|
broken D replaced (7/30/2018)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-text-info">2023-10-31</td>
|
|
<td class="td-text-info">Dustin Choi</td>
|
|
<td class="td-text-info">stolen D replacement (11/7/2017), <br>
|
|
broken D replaced (7/30/2018)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-text-info">2023-10-31</td>
|
|
<td class="td-text-info">Dustin Choi</td>
|
|
<td class="td-text-info">stolen D replacement (11/7/2017), <br>
|
|
broken D replaced (7/30/2018)</td>
|
|
</tr>
|
|
-->
|
|
|
|
|
|
|
|
|
|
</table>
|
|
</div><!--wrap-border-->
|
|
|
|
<div class="container-inner">
|
|
<div class="pagination">
|
|
<!--a href="#" ><i class="bi bi-arrow-left"></i></a>
|
|
<a href="#"class="active">1</a>
|
|
<a href="#">2</a>
|
|
<a href="#">3</a>
|
|
<a href="#">4</a>
|
|
<a href="#">5</a>
|
|
<a href="#">6</a>
|
|
<a href="#"><i class="bi bi-arrow-right"></i></a-->
|
|
|
|
<?
|
|
|
|
$page_string = "view=$view&c_uid=$c_uid&pageflag=note&key_word=$key_word&key_CTGSEQ=$key_CTGSEQ&column=$column&mode=$mode&switched=$getSWHStr&cstatus=$cstatus";
|
|
//$paging = new PAGE('page',$total_count,$list_count,$page_count,$page,$page_string,'#c71930','','','#c71930','');
|
|
$paging = new PAGE('pageqna',$total_count,$list_count,$page_count,$pageqna,$page_string,'#c71930','','','#c71930','');
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<!--Note Ends-->
|
|
|
|
<div class="row text-center">
|
|
<div class="col-sm-4 item-inner">
|
|
<a class="btn-sub text-center" href="/index_intranet.php?view=customer_list&<?=$goStr?>">LIST</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!--div class="grid-layout-col-3">
|
|
<div class="grid-col-3">
|
|
<a class="btn-sub-white text-center" href="#">LIST</a>
|
|
</div>
|
|
<div class="grid-col-3 ">
|
|
<a class="btn-sub text-center" href="#">ADD/UPDATE</a>
|
|
</div>
|
|
<div class="grid-col-3 ">
|
|
<a class="btn-gray text-center" href="#">DELETE</a>
|
|
</div>
|
|
</div-->
|
|
|
|
|
|
</section>
|
|
|
|
|
|
</main><!-- End #main -->
|
|
|
|
|
|
<!-- Modal delete Form -->
|
|
<div class="container">
|
|
|
|
<!-- Modal -->
|
|
<div class="modal fade" id="myModalDelete" data-backdrop="static" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">MESSAGE</h4>
|
|
<button type="button" class="btn" data-dismiss="modal" aria-label="Close" style="color:#fff;"><i class="bi bi-x"></i></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>Are you sure to delete?</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
|
|
<FORM NAME=newModalDeleteForm METHOD=POST ACTION="/lib/user_process.php" id="newModalDeleteForm">
|
|
<input type=hidden name=actionStr value="DELETENOTE">
|
|
<input type=hidden name=actionPage value="">
|
|
<input type=hidden name=n_uid id=n_uid value="">
|
|
<input type=hidden name=c_uid id=c_uid value="<?=$c_uid?>">
|
|
<input type=hidden name=mode value="delete">
|
|
<input type=hidden name=goStr id=goStr value="<?=$goStr?>">
|
|
|
|
<div class="text-center grid-layout-col-2">
|
|
<button type="button" class="btn-gray" data-dismiss="modal">NO</button>
|
|
<button type="submit" class="btn-sub">YES</button>
|
|
</div>
|
|
|
|
</FORM>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Modal Add Note Form -->
|
|
<div id="add-note-modal" class="modal fade">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">ADD A NOTE</h4>
|
|
<button type="button" class="btn" data-bs-dismiss="modal" aria-label="Close" style="color:#fff;"><i class="bi bi-x"></i></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
<FORM NAME=addnote id=addnote METHOD=POST ACTION="/lib/user_process.php">
|
|
<input type=hidden name=actionStr value="ADDNOTE">
|
|
<input type=hidden name=actionPage value="">
|
|
<input type=hidden name=n_customeruid id=n_customeruid value="<?=$c_uid?>">
|
|
<input type=hidden name=n_memberuid id=n_memberuid value="<?=$_SESSION['ss_UID']?>">
|
|
<input type=hidden name=goStr id=goStr value="<?=$goStr?>">
|
|
<input type=hidden name=mode value="create">
|
|
|
|
<table class="tb-info-box">
|
|
<!--
|
|
<tr>
|
|
<td class="td-title-info">TYPE</td>
|
|
<td class="td-text-info">
|
|
<select id="n_type" name="n_type" class="custom-select">
|
|
|
|
<? if ($_SESSION['ss_LEVEL'] == "1" || $_SESSION['ss_LEVEL'] == "5") { ?>
|
|
<option value="B">Accounting</option>
|
|
<option value="D">Driver</option>
|
|
<option value="S">Staff</option>
|
|
<option value="A">All</option>
|
|
<? } else if ($_SESSION['ss_LEVEL'] == "6") { ?>
|
|
<option value="B">Accounting</option>
|
|
<option value="A">All</option>
|
|
<? } else if ($_SESSION['ss_LEVEL'] == "9") { ?>
|
|
<option value="D">Driver</option>
|
|
<option value="A">All</option>
|
|
<? } ?>
|
|
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="td-title-info">SHOW</td>
|
|
<td class="td-text-info">
|
|
<select id="n_view" name="n_view" class="custom-select">
|
|
<option value="1">All</option>
|
|
<option value="0">Myself</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
-->
|
|
<tr>
|
|
<td class="td-title-info">WRITER</td>
|
|
<td class="td-text-info"><?=$_SESSION['ss_NAME']?>
|
|
<!--select id="n_memberuid" name="n_memberuid" class="custom-select">
|
|
<option value="hk">H.K</option>
|
|
<option value="dc">D.C</option>
|
|
</select-->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="td-title-info">NOTE</td>
|
|
<td class="td-text-info">
|
|
<textarea id="n_note" class="textarea" name="n_note" rows="4" cols="20" required='required' ></textarea>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<div class="text-center grid-layout-col-2">
|
|
<button type="submit" class="btn-sub">ADD</button>
|
|
<button type="button" class="btn-gray" data-bs-dismiss="modal">CLOSE</button>
|
|
</div>
|
|
</FORM>
|
|
</div>
|
|
</div><!-- modal-content ends -->
|
|
</div><!-- modal-dialog ends -->
|
|
</div><!-- request-modal ends -->
|
|
|
|
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
//$("#email").val("");
|
|
//$('#userinfo')[0].reset();
|
|
|
|
$("#pickupOrder").validate({
|
|
// Specify validation rules
|
|
ignore: ".ignore",
|
|
rules: {
|
|
d_quantity: {
|
|
required: true,
|
|
//minlength: 6,
|
|
},
|
|
d_payamount: {
|
|
required: "#d_paystatuspaid:checked",
|
|
//minlength: 6,
|
|
},
|
|
},
|
|
messages: {
|
|
d_quantity: {
|
|
required: "Please input Oil Quantity",
|
|
//minlength: "Minimum of 6 characters.",
|
|
},
|
|
d_payamount: {
|
|
required: "Please input Cash Amount",
|
|
//minlength: "Minimum of 6 characters.",
|
|
},
|
|
},
|
|
|
|
errorElement : 'div',
|
|
|
|
submitHandler: function(form) {
|
|
//if (grecaptcha.getResponse(1) == '') alert("Error");
|
|
//else form.submit();
|
|
form.submit();
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
<div class="container">
|
|
<!-- Modal Input Pickup Form -->
|
|
<div id="input-pickup-modal" class="modal fade customer-info">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">ORDER DETAIL</h4>
|
|
<button type="button" class="btn" data-bs-dismiss="modal" aria-label="Close" style="color:#fff;"><i class="bi bi-x"></i></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
<FORM NAME=pickupOrder id=pickupOrder METHOD=POST ACTION="/lib/user_process.php">
|
|
<input type=hidden name=actionStr value="PICKUPORDERCUSTOMER">
|
|
<input type=hidden name=actionPage value="">
|
|
<input type=hidden name=d_uid id=d_uid value="<?=$d_uid?>">
|
|
<input type=hidden name=c_uid id=c_uid value="<?=$c_uid?>">
|
|
<input type=hidden name=d_paymenttype id=d_paymenttype value="<?=$d_paymenttype?>">
|
|
<input type=hidden name=d_customeruid id=d_customeruid value="<?=$c_uid?>">
|
|
<input type=hidden name=d_mode id=d_mode value="<?=$d_mode?>">
|
|
<input type=hidden name=goStr id=goStr value="<?=$goStr?>">
|
|
|
|
<? if (trim($d_payeesign) != "") { ?>
|
|
<input type=hidden name=d_payeesign id=d_payeesign value="<?=$d_payeesign?>">
|
|
<? }?>
|
|
|
|
|
|
<table class="tb-info-box">
|
|
|
|
<tr>
|
|
<td class="td-title-info">Restaurant Name</td>
|
|
<td class="td-text-info shortinput-store-name"><?=$c_name?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Visited Date</td>
|
|
<td class="td-text-info">
|
|
<? if ($setTag == "ENABLED") { ?>
|
|
<input type="text" id="d_visitdate" name="d_visitdate" value="<?=$d_orderdateSTR?>" readonly>
|
|
<? } else { ?>
|
|
<input type="text" name="d_visitdate" value="<?=$d_orderdateSTR?>" readonly>
|
|
<? } ?>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Driver</td>
|
|
<td class="td-text-info">
|
|
<select id="d_driveruid" name="d_driveruid" class="custom-select">
|
|
<?=$c_driveruidSTRM?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Oil Quantity</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="d_quantity" name="d_quantity" placeholder="500" value="<?=$d_quantity?>" required='required' minlength="1" maxlength="10">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Sludge (%)</td>
|
|
<td class="td-text-info">
|
|
<div class="number-input">
|
|
<button class="left" type="button">▼</button>
|
|
<input type="number" class="d_sludge" id="d_sludge" name="d_sludge" value="<?=$d_sludge?>" min="0" max="100" placeholder="50">
|
|
<button class="right" type="button">▲</button>
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<? if ($d_paymenttype =="CA") { ?>
|
|
<tr>
|
|
<td class="td-title-info">Cash</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="d_payamount" name="d_payamount" value="<?=$d_payamount?>" placeholder="100" >
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Pay Status</td>
|
|
<td class="td-text-info">
|
|
|
|
<label class="container-chk">Paid
|
|
<input type="radio" name="d_paystatus" id="d_paystatuspaid" required='required' <?=($d_paystatus == "P")?"checked":"";?> value="P">
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
|
|
<label class="container-chk">UnPaid
|
|
<input type="radio" name="d_paystatus" id="d_paystatusunpaid" required='required' <?=($d_paystatus == "N" || $d_paystatus == "")?"checked":"";?> value="N">
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="td-title-info">Customer Name</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="d_payeename" name="d_payeename" value="<?=htmlspecialchars($d_payeenameSTR, ENT_QUOTES)?>" placeholder="Customer Name" >
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="td-title-info">Signature
|
|
<div id="newbtnid" style="<?=$setDisplayNEWStr?> float:right; padding-right: 10px;">New <input type="checkbox" id="signednew" name="signednew" value="1" ></div>
|
|
<div id="clrbtnid" style="<?=$setDisplayBTNStr?> float:right; padding-right: 10px;padding-bottom: 10px;"><button type="button" id="clear" class="btn-clear">Clear</button></div>
|
|
</td>
|
|
<td class="td-text-info">
|
|
<div id="signitureedid" style="<?=$setDisplaySIGNYESStr?>">
|
|
<?=$d_payeesignSTR?>
|
|
</div>
|
|
|
|
<div id="signitureid" style="<?=$setDisplaySIGNNEWStr?>">
|
|
<div id="sig" ></div>
|
|
<br/>
|
|
<textarea id="signature64" name="signed" class="textarea" style="display: none;width: 100%;"></textarea>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<!--tr>
|
|
<td class="td-title-info">Pay Status</td>
|
|
<td class="td-text-info">
|
|
<select name="d_paystatus" id="d_paystatus" class="custom-select" required='required' >
|
|
<option value="">Select</option>
|
|
<option <?=($d_paystatus == "P")?"selected":"";?> value="P">Paid</option>
|
|
<option <?=($d_paystatus == "N")?"selected":"";?> value="N">UnPaid</option>
|
|
</select>
|
|
</td>
|
|
</tr-->
|
|
<? } ?>
|
|
|
|
<tr>
|
|
<td class="td-title-info">Note</td>
|
|
<td class="td-text-info">
|
|
<textarea id="d_note" class="textarea" name="d_note" rows="4" cols="20"><?=$n_noteSTRM?></textarea>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<div class="text-center grid-layout-col-2">
|
|
<button type="submit" id="buttonADD" class="btn-sub">ADD</button>
|
|
<button type="button" class="btn-gray" data-bs-dismiss="modal">CLOSE</button>
|
|
</div>
|
|
</FORM>
|
|
</div>
|
|
|
|
</div><!-- modal-content ends -->
|
|
</div><!-- modal-dialog ends -->
|
|
</div><!-- input-pickup-modal ends -->
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Modal Request Form -->
|
|
<div id="request-modal" class="modal fade customer-info">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">REQUEST</h4>
|
|
<button type="button" class="btn" data-bs-dismiss="modal" aria-label="Close" style="color:#fff;"><i class="bi bi-x"></i></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
<FORM NAME=addrequest id=addrequest METHOD=POST ACTION="/lib/user_process.php">
|
|
<input type=hidden name=actionStr value="ADDREQUEST">
|
|
<input type=hidden name=actionPage value="">
|
|
<input type=hidden name=r_customeruid id=r_customeruid value="<?=$c_uid?>">
|
|
<input type=hidden name=r_memberuid id=r_memberuid value="<?=$_SESSION['ss_UID']?>">
|
|
<input type=hidden name=goStr id=goStr value="<?=$goStr?>">
|
|
<input type=hidden name=mode value="create">
|
|
|
|
<table class="tb-info-box">
|
|
<tr>
|
|
<td class="td-title-info">Request Date</td>
|
|
<td class="td-text-info">
|
|
<input type="text" id="r_requestdate" name="r_requestdate" value="<?=$r_requestdateSTR?>" placeholder="<?=date('Y-m-d')?>" readonly required='required' >
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="td-title-info">Driver</td>
|
|
<td class="td-text-info">
|
|
<select id="r_driveruid" name="r_driveruid" class="custom-select">
|
|
<option value=''>Select</option>
|
|
<?=$c_driveruidSTR?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="td-title-info">Note</td>
|
|
<td class="td-text-info">
|
|
<textarea id="r_note" class="textarea" name="r_note" rows="4" cols="20" ></textarea>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<div class="text-center grid-layout-col-2">
|
|
<button type="submit" class="btn-sub">REQUEST</button>
|
|
<button type="button" class="btn-gray" data-bs-dismiss="modal" >CLOSE</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div><!-- modal-content ends -->
|
|
</div><!-- modal-dialog ends -->
|
|
</div><!-- request-modal ends -->
|
|
|
|
|
|
|
|
<script>
|
|
/**
|
|
* Request type on click
|
|
*/
|
|
on('show.bs.modal', '#request-modal', function(event) {
|
|
select('#request-modal #request-type').value = event.relatedTarget.getAttribute('data-request-type')
|
|
})
|
|
|
|
|
|
on('show.bs.modal', '#add-note-modal', function(event) {
|
|
select('#add-note-modal #add-note-type').value = event.relatedTarget.getAttribute('data-add-note-type')
|
|
})
|
|
|
|
|
|
on('show.bs.modal', '#input-pickup-modal', function(event) {
|
|
select('#input-pickup-modal #input-pickup-type').value = event.relatedTarget.getAttribute('data-input-pickup-type')
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
var sig = $('#sig').signature({syncField: '#signature64', syncFormat: 'PNG', thickness: 2});
|
|
$('#clear').click(function(e) {
|
|
e.preventDefault();
|
|
sig.signature('clear');
|
|
$("#signature64").val('');
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
document.querySelectorAll('.number-input').forEach(container => {
|
|
const input = container.querySelector('.d_sludge');
|
|
const leftBtn = container.querySelector('.left');
|
|
const rightBtn = container.querySelector('.right');
|
|
const step = 5;
|
|
|
|
leftBtn.addEventListener('click', () => {
|
|
const min = input.min ? parseInt(input.min) : -Infinity;
|
|
let value = parseInt(input.value || 0);
|
|
if (value - step >= min) input.value = value - step;
|
|
});
|
|
|
|
rightBtn.addEventListener('click', () => {
|
|
const max = input.max ? parseInt(input.max) : Infinity;
|
|
let value = parseInt(input.value || 0);
|
|
if (value + step <= max) input.value = value + step;
|
|
});
|
|
});
|
|
});
|
|
|
|
function buildContent(property) {
|
|
$(".shortinput-store-name").text(property.name);
|
|
}
|
|
|
|
</script>
|