[LOGIN] Added version info.
[EXPORT] Added oil history daily download button. Applied team using checkbox.
This commit is contained in:
Hyojin Ahn 2026-03-26 11:03:12 -04:00
parent 4d3804dbdb
commit 95cdc81b15
5 changed files with 315 additions and 563 deletions

View File

@ -36,6 +36,33 @@ $customerSTR .= "</tr>";
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
$('input[name="columnPreset"]').change(function(){
let type = $(this).val();
$('#checkboxcustomer input:checkbox:not(:disabled)').prop('checked', false);
if(type == "CS"){
presetCS.forEach(col => $('#customer_'+col).prop('checked', true));
}
if(type == "PL"){
presetPL.forEach(col => $('#customer_'+col).prop('checked', true));
}
if(type == "ALL"){
$('#checkboxcustomer input:checkbox:not(:disabled)').prop('checked', true);
}
if(type == "CLEAR"){
$('#checkboxcustomer input:checkbox:not(:disabled)').prop('checked', false);
}
});
$('#checkboxcustomer input[type=checkbox]').change(function(){
$('input[name="columnPreset"]').prop('checked', false);
});
$("#checkboxallcustomer").click(function () { $("#checkboxallcustomer").click(function () {
$('#checkboxcustomer input:checkbox:not(:disabled)').not('this').prop('checked', this.checked); $('#checkboxcustomer input:checkbox:not(:disabled)').not('this').prop('checked', this.checked);
@ -46,6 +73,9 @@ $(document).ready(function(){
}); });
}); });
const presetCS = <?=json_encode(array_keys($customerArray_cs))?>;
const presetPL = <?=json_encode(array_keys($customerArray_pl))?>;
</script> </script>
@ -82,307 +112,20 @@ $(document).ready(function(){
<input type=hidden name=actionStr value="CUSTOMER"> <input type=hidden name=actionStr value="CUSTOMER">
<table id="checkboxcustomer" class="td-search"> <table id="checkboxcustomer" class="td-search">
<tr>
<td>
<div class="radio-segment" style="margin:4px;">
<label><input type="radio" name="columnPreset" value="CS"><span>CS</span></label>
<label><input type="radio" name="columnPreset" value="PL"><span>PL</span></label>
<label><input type="radio" name="columnPreset" value="ALL" checked><span>ALL</span></label>
<label><input type="radio" name="columnPreset" value="CLEAR"><span>Clear</span></label>
</div>
</td>
<td>
<div class="text-center" style="margin:4px;"><button class="btn-sub" type="submit">CSV DOWNLOAD</button></div>
</td>
</tr>
<?=$customerSTR ?> <?=$customerSTR ?>
<!--
<tr>
<td>
<label class="container-chk">Account No
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Account Status
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Restaurant Name
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Driver
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Address
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">City
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Postal Code
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Area
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Phone
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Ext
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Cell
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Rate
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Payment
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Main Container
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Container Detail
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Container Location
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Pickup Schedule
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Pickup Weekday
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Main Container
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Cycle
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Forced Cycle
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Sludge
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Comment
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Contract Date
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Form
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">US
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">EU Date
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Contact By
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Email
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Removal Date
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Sales Person
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Sales Method
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Sale Commission Date
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Install Date
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">First Pickup Date
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Payable To
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Payment Cycle
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Mailing Address
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Comment
<input type="checkbox" name="export_customer[]" value="c_accountno" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
-->
<tr>
<td colspan="2"></td>
<td>
<label class="container-chk">Select All
<input type="checkbox" name="checkboxallcustomer" id="checkboxallcustomer" checked="checked" value="1">
<span class="checkmark"></span>
</label>
</td>
<td>
<div class="text-center"><button class="btn-sub" type="submit">CSV DOWNLOAD</button></div>
</td>
</tr>
</table> </table>

View File

@ -9,8 +9,8 @@ $func->checkLevelModal(7);
// EXPORT - OIL HISTORY // EXPORT - OIL HISTORY
////////////////////////////////// //////////////////////////////////
$oil_cnt = 2; $oil_cnt = 1;
//$oilSTR = "<tr>"; $oilSTR .= "<tr>";
foreach ($oilhistoryArray AS $key=>$value) foreach ($oilhistoryArray AS $key=>$value)
{ {
//echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]... //echo "[$key][$value]"; => [0][Waiting][1][Confirmed][E][Declined]...
@ -42,8 +42,32 @@ $thisMonth = date("Y-m")."-01";
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
$("#checkboxalloil").click(function () { $('input[name="columnPreset"]').change(function(){
$('#checkboxoil input:checkbox:not(:disabled)').not('this').prop('checked', this.checked);
let type = $(this).val();
$('#checkboxoil input:checkbox:not(:disabled)').prop('checked', false);
if(type == "ACC"){
presetACC.forEach(col => $('#oil_'+col).prop('checked', true));
}
if(type == "MKT"){
presetMKT.forEach(col => $('#oil_'+col).prop('checked', true));
}
if(type == "ALL"){
$('#checkboxoil input:checkbox:not(:disabled)').prop('checked', true);
}
if(type == "CLEAR"){
$('#checkboxoil input:checkbox:not(:disabled)').prop('checked', false);
}
});
$('#checkboxoil input[type=checkbox]').change(function(){
$('input[name="columnPreset"]').prop('checked', false);
}); });
$('#oil_period_from, #oil_period_to').datepicker({ $('#oil_period_from, #oil_period_to').datepicker({
@ -67,9 +91,10 @@ $(document).ready(function(){
$("#exportoil").submit(function() { $("#exportoil").submit(function() {
$("input").removeAttr("disabled"); $("input").removeAttr("disabled");
}); });
}); });
const presetACC = <?=json_encode(array_keys($oilhistoryArray_acc))?>;
const presetMKT = <?=json_encode(array_keys($oilhistoryArray_mkt))?>;
</script> </script>
@ -111,132 +136,23 @@ $(document).ready(function(){
<input class="txt-first-period-input" type="text" id="oil_period_from" name="oil_period_from" value="<?=$thisMonth?>" placeholder="2023-04-01" readonly> ~ <input class="txt-first-period-input" type="text" id="oil_period_from" name="oil_period_from" value="<?=$thisMonth?>" placeholder="2023-04-01" readonly> ~
<input type="text" id="oil_period_to" name="oil_period_to" value="<?=$todayDate?>" placeholder="2023-04-31" readonly> <input type="text" id="oil_period_to" name="oil_period_to" value="<?=$todayDate?>" placeholder="2023-04-31" readonly>
</td> </td>
<td>
<div class="radio-segment" style="margin:4px;">
<label><input type="radio" name="columnPreset" value="ACC"><span>ACC</span></label>
<label><input type="radio" name="columnPreset" value="MKT"><span>MKT</span></label>
<label><input type="radio" name="columnPreset" value="ALL" checked><span>ALL</span></label>
<label><input type="radio" name="columnPreset" value="CLEAR"><span>Clear</span></label>
</div>
</td>
<td>
<div class="text-center" style="margin:4px;"><button class="btn-sub" type="submit" name="downloadType" value="daily">Daily DOWNLOAD</button></div>
</td>
<td>
<div class="text-center" style="margin:4px;"><button class="btn-sub" type="submit" name="downloadType" value="calendar">Calendar DOWNLOAD</button></div>
</td>
</tr>
<?=$oilSTR?> <?=$oilSTR?>
<!--
<td>
<label class="container-chk">Account No
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Account Status
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Restaurant Name
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Driver
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Address
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Payment
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Payment Cycle
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Payable To
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Mailing Address
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Pickup Date
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
<label class="container-chk">Oil Quantity
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td>
<label class="container-chk">Paid (Cash)
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
-->
<tr>
<td colspan="2"></td>
<td>
<label class="container-chk">Select All
<input type="checkbox" name="checkboxalloil" id="checkboxalloil" checked="checked" value="1">
<span class="checkmark"></span>
</label>
</td>
<td>
<div class="text-center"><button class="btn-sub" type="submit">CSV DOWNLOAD</button></div>
</td>
</tr>
</table> </table>

View File

@ -139,7 +139,8 @@ if ($actionStr == "CUSTOMER") {
if (($cnt++ % 300) == 0) flush(); // 300 raw 씩 출력 if (($cnt++ % 300) == 0) flush(); // 300 raw 씩 출력
} }
} else if ($actionStr == "OILHISTORY") { } else if ($actionStr == "OILHISTORY") {
$downloadType = $_POST['downloadType'];
if ($downloadType == "calendar") {
// customer // customer
$query = "SELECT * FROM tbl_customer ORDER BY c_accountno DESC "; $query = "SELECT * FROM tbl_customer ORDER BY c_accountno DESC ";
$result = $jdb->nQuery($query, "list error"); $result = $jdb->nQuery($query, "list error");
@ -281,7 +282,63 @@ if ($actionStr == "CUSTOMER") {
if (($cnt++ % 300) == 0) flush(); // 300 raw 씩 출력 if (($cnt++ % 300) == 0) flush(); // 300 raw 씩 출력
} }
} else if ($downloadType == "daily") {
$oil_period_toTMP = str_replace("-", "", $oil_period_to);
$oil_period_fromTMP = str_replace("-", "", $oil_period_from);
/* -------- HEADER ROW -------- */
echo "<Row>";
foreach ($export_oil as $col) {
if (isset($oilhistoryArray[$col])) {
echo "<Cell><Data ss:Type=\"String\">".$oilhistoryArray[$col]."</Data></Cell>\n";
}
}
echo "</Row>\n";
/* -------- DATA QUERY -------- */
$qry = "
SELECT d_accountno as c_accountno, c_status, d_name as c_name, m_region as c_driveruid, m.m_currentdriverinitial as m_currentdriverinitial
, d_address as c_address, d_city as c_city, d_postal as c_postal, d_area as c_area
, d_phone as c_phone, c_phoneext, c_cell, d_rate as c_rate, d_paymenttype as c_paymenttype
, d_maincontainer as c_maincontainer, d_container as c_container, d_location as c_location, c_schedule
, c_scheduleday, d_fullcycle as c_fullcycle, d_fullcycleforced as c_fullcycleforced, c_comment_ri
, c_contractdate, c_form_new, c_form_us, c_form_eu
, c_form_corsia, c_contractby, c_email, c_removaldate
, c_salesperson, c_salesmethod, c_salescommissiondate, c_installdate
, c_fpickup, c_payableto, c_paymentcycle, c_mailingaddr
, c_comment_ci, c_expoilmonth, c_hstno, c_identcode
, c_geolat, c_geolon
, CONCAT(
SUBSTRING(d_orderdate,1,4),'-',
SUBSTRING(d_orderdate,5,2),'-',
SUBSTRING(d_orderdate,7,2)
) as d_inputdate
, d_quantity
, d_sludge
FROM tbl_daily d
JOIN tbl_customer c
ON d.d_customeruid = c.c_uid
JOIN tbl_member m
ON d.d_driveruid = m.m_uid
WHERE d.d_status = 'F'
AND d.d_orderdate BETWEEN '$oil_period_fromTMP' AND '$oil_period_toTMP'
ORDER BY d.d_orderdate, c.c_accountno
";
$result = $jdb->nQuery($qry, "daily export error");
$cnt = 0;
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo "<Row>";
foreach ($export_oil as $col) {
echo "<Cell><Data ss:Type=\"String\">".$row[$col]."</Data></Cell>\n";
}
echo "</Row>\n";
if (($cnt++ % 300) == 0) flush();
}
}
} else if ($actionStr == "ORDER") { } else if ($actionStr == "ORDER") {

View File

@ -57,6 +57,34 @@ $oilhistoryArray = array(
"c_geolat"=>"Latitude", "c_geolon"=>"Longitude", "c_geolat"=>"Latitude", "c_geolon"=>"Longitude",
"d_inputdate"=>"Pickup Date","d_quantity"=>"Oil Quantity", "d_sludge"=>"Sludge" "d_inputdate"=>"Pickup Date","d_quantity"=>"Oil Quantity", "d_sludge"=>"Sludge"
); );
$customerArray_cs = array(
"c_accountno"=>"Account No", "c_status"=>"Account Status", "c_name"=>"Restaurant Name",
"c_address"=>"Address", "c_rate"=>"Rate", "c_container"=>"Container Detail", "c_contractdate"=>"Contract Date",
"c_form_us"=>"US", "c_form_eu"=>"EU Date", "c_salesperson"=>"Sales Person", "c_salesmethod"=>"Sales Method", "c_salescommissiondate"=>"Sale Commission Date",
"c_installdate"=>"Install Date", "c_fpickup"=>"First Pickup Date", "c_exchangedate"=>"Container Exc. Date"
);
$customerArray_pl = array(
"c_accountno"=>"Account No", "c_status"=>"Account Status", "c_name"=>"Restaurant Name",
"m_currentdriverinitial"=>"Current Driver", "c_address"=>"Address", "c_city"=>"City", "c_rate"=>"Rate",
"c_contractdate"=>"Contract Date", "c_form_us"=>"US", "c_form_eu"=>"EU Date", "c_form_corsia"=>"CORSIA Date",
"c_email"=>"Email", "c_geolat"=>"Latitude", "c_geolon"=>"Longitude"
);
$oilhistoryArray_acc = array(
"d_inputdate"=>"Pickup Date", "c_accountno"=>"Account No", "c_name"=>"Restaurant Name", "d_quantity"=>"Oil Quantity", "d_sludge"=>"Sludge",
"c_rate"=>"Rate", "c_status"=>"Account Status", "c_paymentcycle"=>"Payment Cycle", "c_driveruid"=>"Region", "m_currentdriverinitial"=>"Current Driver",
"c_paymenttype"=>"Payment", "c_address"=>"Address", "c_city"=>"City", "c_postal"=>"Postal Code", "c_phone"=>"Phone",
"c_payableto"=>"Payable To", "c_mailingaddr"=>"Mailing Address", "c_comment_ci"=>"Comment2"
);
$oilhistoryArray_mkt = array(
"c_accountno"=>"Account No", "c_status"=>"Account Status", "c_name"=>"Restaurant Name", "c_driveruid"=>"Region", "m_currentdriverinitial"=>"Current Driver",
"c_address"=>"Address", "c_city"=>"City", "c_rate"=>"Rate", "c_container"=>"Container Detail", "c_schedule"=>"Pickup Schedule",
"c_contractdate"=>"Contract Date", "c_removaldate"=>"Removal Date", "c_salesperson"=>"Sales Person", "c_installdate"=>"Install Date",
"c_fpickup"=>"First Pickup Date", "c_expoilmonth"=>"Expected Oil Vol per Month", "d_inputdate"=>"Pickup Date","d_quantity"=>"Oil Quantity", "d_sludge"=>"Sludge"
);
// "d_payamount"=>"Paid (Cash)" // "d_payamount"=>"Paid (Cash)"
$orderArray = array( $orderArray = array(

View File

@ -1,6 +1,7 @@
<?php <?php
$destination = isset($_GET['destination']) ? $_GET['destination'] : ''; $destination = isset($_GET['destination']) ? $_GET['destination'] : '';
$mode = isset($_GET['mode']) ? $_GET['mode'] : ''; $mode = isset($_GET['mode']) ? $_GET['mode'] : '';
$appVersion = 'v1.1.1';
?> ?>
<? <?
@ -107,6 +108,13 @@ if ($_SESSION['ss_LOGIN'] == 1) {
<label><div class="g-recaptcha" id="RecaptchaField1" required="required" required ></div></label> <label><div class="g-recaptcha" id="RecaptchaField1" required="required" required ></div></label>
<div class="text-center"><button class="btn-primary" type="submit">LOGIN</button></div> <div class="text-center"><button class="btn-primary" type="submit">LOGIN</button></div>
</form> </form>
<div class="text-center mt-3">
<small class="text-muted">
<a href="https://docs.google.com/spreadsheets/d/1PsjWNuUNyjZv7AuFSJwm5m_rsj36d9q19r27PhZp43M/edit?usp=sharing" target="_blank">
<?=$appVersion?>
</a>
</small>
</div>
</div><!-- End login Form --> </div><!-- End login Form -->