parent
7003cf5eee
commit
0bc18c4e13
|
|
@ -951,7 +951,6 @@ if ($actionStr == "DAILYRECORD") {
|
||||||
$columns[] = "h_balance_g";
|
$columns[] = "h_balance_g";
|
||||||
$columns[] = "h_balance_e";
|
$columns[] = "h_balance_e";
|
||||||
$columns[] = "h_balance_t";
|
$columns[] = "h_balance_t";
|
||||||
$columns[] = "h_createddate";
|
|
||||||
$columns[] = "h_comment";
|
$columns[] = "h_comment";
|
||||||
$columns[] = "h_druid";
|
$columns[] = "h_druid";
|
||||||
|
|
||||||
|
|
@ -972,7 +971,6 @@ if ($actionStr == "DAILYRECORD") {
|
||||||
|
|
||||||
$h_balance_t = floatval($h_balance_o) + floatval($h_balance_in) - floatval($h_balance_r) - floatval($h_balance_out);
|
$h_balance_t = floatval($h_balance_o) + floatval($h_balance_in) - floatval($h_balance_r) - floatval($h_balance_out);
|
||||||
$values[] = $h_balance_t;
|
$values[] = $h_balance_t;
|
||||||
$values[] = date("YmdHis");;
|
|
||||||
$values[] = str_replace("\\", "", trim($h_comment));
|
$values[] = str_replace("\\", "", trim($h_comment));
|
||||||
$values[] = $h_druid;
|
$values[] = $h_druid;
|
||||||
|
|
||||||
|
|
@ -983,14 +981,32 @@ if ($actionStr == "DAILYRECORD") {
|
||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
if($mode == "create") {
|
if($mode == "create") {
|
||||||
|
|
||||||
|
// 중복 체크 (h_date + h_druid) → 있으면 update 로 전환
|
||||||
|
$qry_dup = "SELECT h_uid FROM tbl_memberhis
|
||||||
|
WHERE h_date = '$h_date'
|
||||||
|
AND h_druid = '$h_druid'
|
||||||
|
ORDER BY h_uid DESC
|
||||||
|
LIMIT 1";
|
||||||
|
$rt_dup = $jdb->fQuery($qry_dup, "record query error");
|
||||||
|
|
||||||
|
if (!empty($rt_dup['h_uid'])) {
|
||||||
|
// 기존 레코드 update
|
||||||
|
$jdb->uQuery("tbl_memberhis", $columns, $values, " where h_uid = '".$rt_dup['h_uid']."' ");
|
||||||
|
$msg = "Updated successfully.";
|
||||||
|
} else {
|
||||||
|
$columns[] = "h_createddate";
|
||||||
|
$values[] = date("YmdHis");
|
||||||
|
|
||||||
|
// 신규 insert
|
||||||
$jdb->iQuery("tbl_memberhis", $columns, $values);
|
$jdb->iQuery("tbl_memberhis", $columns, $values);
|
||||||
$msg = "Saved successfully.";
|
$msg = "Saved successfully.";
|
||||||
|
}
|
||||||
|
|
||||||
$urlSTR = "/index_intranet.php?view=order_list&".$goStr;
|
$urlSTR = "/index_intranet.php?view=order_list&".$goStr;
|
||||||
$func -> modalMsg ($msg, $urlSTR);
|
$func -> modalMsg ($msg, $urlSTR);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if($mode == "update") {
|
else if($mode == "update") {
|
||||||
$jdb->uQuery("tbl_memberhis", $columns, $values, " where h_uid = '$h_uid' ORDER BY h_uid DESC LIMIT 1 ");
|
$jdb->uQuery("tbl_memberhis", $columns, $values, " where h_uid = '$h_uid' ORDER BY h_uid DESC LIMIT 1 ");
|
||||||
$msg = "Updated successfully.";
|
$msg = "Updated successfully.";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue