You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
1.0 KiB

<?php
// $today = date('Ym01', strtotime('-1 month',strtotime(date('Ym01'))));
// $yesterday = date("Ym01", strtotime('-1 month',strtotime(date('2023-11-17'))));
// echo "today: " . $today . "<br>";
// echo "yesterday: " . $yesterday . "<br>";
// echo $today-$yesterday;
// echo "<br>";
// $test = date('Ymd', $today-$yesterday);
// echo $test;
include './header.php';
$sql = "SELECT
salOrderStagePay.BillNo,
salOrderStagePay.PayStage
FROM salOrderStagePay
LEFT JOIN salSalesOrder
ON salSalesOrder.BillNo = salOrderStagePay.BillNo WHERE salSalesOrder.ModeId = 'M' AND (salSalesOrder.CurrentState=2 OR salSalesOrder.CurrentState=4) ";
$query = $conn->query($sql);
$contracts = array();
foreach ($query as $row) {
if (!array_key_exists($row['BillNo'], $contracts)) {
$contracts[$row['BillNo']] = [$row['BillNo'], $row['PayStage']];
}else{
array_push($contracts[$row['BillNo']], $row['PayStage']);
}
}
foreach($contracts as $contract){
foreach($contract as $con){
echo $con.";";
}
echo "<br>";
}