ÿØÿà JFIF ` ` ÿþ
Server : Apache System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : tkt_travelbus ( 1137) PHP Version : 7.0.0p1 Disable Function : mysql_pconnect Directory : /tkt_travelbus/www/admin/account_inout/ |
Upload File : |
<? include "../include/top_proc.html"; include "_common.php"; //$memo = insert_smart($memo); //$saving_provider = insert_smart($saving_provider); //$saving_amount = str_replace(",", "", $saving_amount); // 입금액 //$amount = str_replace(",", "", $amount); // 입금액 //deanLog("SqlType", $SqlType, "k1"); switch ($SqlType) { // 입금 수정 case "account_inout_edit": if (!$no) { error_msg("필수값이 없습니다."); } $inout_provider = insert_smart($edit_inout_provider); //$inout_amount = str_replace(",", "", $edit_inout_amount); $inout_amount = preg_replace("/[^0-9]*/s", "", $edit_inout_amount); $memo = insert_smart($edit_memo); $sql = "UPDATE TB_ACCOUNT_INOUT_BREAKDOWN SET "; $sql .= "inout_provider = '{$inout_provider}'"; $sql .= ", inout_amount = {$inout_amount}"; $sql .= ", memo = '{$memo}'"; $sql .= ", modify_admin_id = '{$MemberID}' "; $sql .= ", modify_admin_nm = '{$MemberName}' "; $sql .= ", modify_datetime = now()"; $sql .= " where no = '{$no}' "; //deanLog("sql", $sql, "k1"); db_query($sql); error_msg("alert('수정되었습니다.');parent.document.location.reload();", "script"); break; // 승인완료입금 삭제 case "approval_finish_delete": if (!$no) { error_msg("필수값이 없습니다."); } $sql = "DELETE FROM TB_ACCOUNT_INOUT_BREAKDOWN WHERE no = {$no} and flag_approval = '1' and process_amount = 0"; db_query($sql); error_msg("alert('삭제되었습니다.');ajax_loader('account_inout_list.html?" . $bankhref . "&page=', 'ajax_list');", "script"); break; // 승인대기입금 등록 case "approval_standby_insert": $basic_date = $insert_basic_date; $saving_provider = insert_smart($insert_saving_provider); //$saving_amount = str_replace(",", "", $insert_saving_amount); $saving_amount = preg_replace("/[^0-9]*/s", "", $insert_saving_amount); $memo = insert_smart($insert_memo); switch ($insert_flag_division_s) { case '1': $bank_account_info_array = explode("|||", $insert_bank_account); $bank_code = $bank_account_info_array[0]; $bank_name = $bank_account_info_array[1]; //$account_number = str_replace("-", "", $bank_account_info_array[2]); $account_number = preg_replace("/[^0-9]*/s", "", $bank_account_info_array[2]); break; case '2': $bank_code = ""; $bank_name = ""; $account_number = $insert_note_type; break; } $sql = "INSERT TB_ACCOUNT_INOUT_BREAKDOWN SET "; $sql .= "flag_division = '{$insert_flag_division_s}' "; $sql .= ", basic_date = '{$basic_date}'"; $sql .= ", basic_time = '000000' "; $sql .= ", bank_code = '{$bank_code}' "; $sql .= ", bank_name = '{$bank_name}' "; $sql .= ", account_number = '{$account_number}' "; $sql .= ", inout_provider = '{$saving_provider}' "; $sql .= ", inout_amount = {$saving_amount} "; $sql .= ", process_amount = 0 "; $sql .= ", memo = '{$memo}' "; $sql .= ", register_admin_id = '{$MemberID}' "; $sql .= ", register_admin_nm = '{$MemberName}' "; $sql .= ", register_datetime = now() "; $sql .= ", flag_inout = '1' "; $sql .= ", flag_approval = '0' "; //deanLog("sql", $sql, "k1"); db_query($sql); error_msg("alert('저장되었습니다.');ajax_loader('approval_standby_list_ajax.html?" . $bankhref . "&page=', 'ajax_list');", "script"); break; // 승인대기입금 수정 case "approval_standby_edit": if (!$no) { error_msg("필수값이 없습니다."); } $basic_date = $edit_basic_date; $edit_account_number = preg_replace("/[^0-9]*/s", "", $edit_account_number); $saving_provider = insert_smart($edit_saving_provider); //$saving_amount = str_replace(",", "", $edit_saving_amount); $saving_amount = preg_replace("/[^0-9]*/s", "", $edit_saving_amount); $memo = insert_smart($edit_memo); $sql = "UPDATE TB_ACCOUNT_INOUT_BREAKDOWN SET"; $sql .= " basic_date = '{$basic_date}' "; $sql .= ", account_number = '{$edit_account_number}' "; $sql .= ", inout_provider = '{$saving_provider}' "; $sql .= ", inout_amount = {$saving_amount} "; $sql .= ", memo = '{$memo}' "; $sql .= ", modify_admin_id = '{$MemberID}' "; $sql .= ", modify_admin_nm = '{$MemberName}' "; $sql .= ", modify_datetime = now() "; $sql .= "where no = '{$no}' and flag_approval = '0' "; //deanLog("sql", $sql, "k1"); db_query($sql); error_msg("alert('수정되었습니다.');parent.document.location.reload();", "script"); break; // 승인대기입금 삭제 case "approval_standby_delete": if (!$no) { error_msg("필수값이 없습니다."); } $sql = "DELETE FROM TB_ACCOUNT_INOUT_BREAKDOWN WHERE no = '{$no}' and flag_approval = '0' "; db_query($sql); error_msg("alert('삭제되었습니다.');ajax_loader('approval_standby_list_ajax.html?" . $bankhref . "&page=', 'ajax_list');", "script"); break; // 승인대기입금 승인 case "approval_standby_verify": if (!$no) { error_msg("필수값이 없습니다."); } $sql = "UPDATE TB_ACCOUNT_INOUT_BREAKDOWN SET"; $sql .= " flag_approval = '1'"; $sql .= ", approval_admin_id = '{$MemberID}' "; $sql .= ", approval_admin_nm = '{$MemberName}' "; $sql .= ", approval_datetime = now() "; $sql .= "where no = '{$no}' and flag_approval = '0' "; //deanLog("sql", $sql, "k1"); db_query($sql); error_msg("alert('승인처리되었습니다.');parent.document.location.reload();", "script"); break; // 예약연결 저장 case "ma_link_reservation": if (!is_array($res_no_arr) || !$no) { error_msg("필수값이 없습니다."); } $account_number = str_replace('-', '', $account_number); $amount_total = 0; for ($i = 0; $i < count($res_no_arr); $i++) { $res_no = $res_no_arr[$i]; $ioac_cd = $pay_ioac_cd[$i]; //$amount = str_replace(",", "", $pay_amount[$i]); $amount = preg_replace("/[^0-9]*/s", "", $pay_amount[$i]); $amount_total += (int)$amount; $remarks = $pay_remarks[$i]; $sql = "INSERT TB_ACCOUNT_INOUT_LINK SET "; $sql.= "process_date = CURDATE() "; $sql.= ", inout_no = {$no} "; $sql.= ", flag_reservation = '{$flag_reservation_s}' "; $sql.= ", res_no = '{$res_no}' "; $sql.= ", amount = '{$amount}' "; $sql.= ", register_admin_id = '{$admin_id}' "; $sql.= ", register_admin_nm = '{$admin_nm}' "; $sql.= ", register_datetime = now() "; //deanLog("sql", $sql, "k1"); db_query($sql); $matching_idx = db_insert_id(); //deanLog("flag_division", $flag_division, "k1"); if ($flag_division == "1") { $sql = "INSERT INTO TB_ACCOUNT_CUSTOMER (res_no, acc_dt, ioac_cd, bank_plus, pgcase_cd, bank_cd, bank_nm, bank_number, bank_owner, remarks, ins_dt, admin_id, admin_nm, matching_idx) SELECT '{$res_no}', CURDATE(), '{$ioac_cd}', {$amount}, 'INST001', code, cd_nm, '{$account_number}', cd_memo2, '{$remarks}', now(), '{$admin_id}', '{$admin_nm}', {$matching_idx} FROM TB_CODEC WHERE cd_a = 'PRD' AND cd_b = 'INBK' AND cd_memo = '{$account_number}' "; //deanLog("sql", $sql, "k1"); db_query($sql); } else { $sql = "INSERT TB_ACCOUNT_CUSTOMER SET "; $sql.= "res_no = '{$res_no}' "; $sql.= ", acc_dt = CURDATE() "; $sql.= ", ioac_cd = '{$ioac_cd}' "; $sql.= ", bank_plus = '{$amount}' "; $sql.= ", bank_number = '{$account_number}' "; $sql.= ", remarks = '{$remarks}' "; $sql.= ", ins_dt = now() "; $sql.= ", admin_id = '{$admin_id}' "; $sql.= ", admin_nm = '{$admin_nm}' "; $sql.= ", matching_idx = {$matching_idx} "; //deanLog("sql", $sql, "k1"); db_query($sql); } } $sql = " update TB_ACCOUNT_INOUT_BREAKDOWN set process_amount = process_amount + {$amount_total} where no = {$no} "; //deanLog("sql", $sql, "k1"); db_query($sql); // 입금완료 처리 (검색을 위해 추가) // 관리자검색요소 업데이트 if ($res_no) { db_query("call SP_RES_GOOD_SEARCH('".$res_no."');"); } error_msg("parent.document.location.href='account_inout_list.html?{$bankhref}'","script"); break; // 수기 입력 case "ma_link_note": if (!$no) { error_msg("필수값이 없습니다."); } //$amount = str_replace(",", "", $amount); $amount = preg_replace("/[^0-9]*/s", "", $amount); $sql = "INSERT TB_ACCOUNT_INOUT_LINK SET "; $sql.= "process_date = '{$process_date}' "; $sql.= ", inout_no = '" . $no . "' "; $sql.= ", flag_reservation = 'Z' "; $sql.= ", res_no = NULL "; $sql.= ", customer_name = '{$customer_name}' "; $sql.= ", amount = '{$amount}' "; $sql.= ", memo = '{$memo}' "; $sql.= ", register_admin_id = '{$admin_id}' "; $sql.= ", register_admin_nm = '{$admin_nm}' "; $sql.= ", register_datetime = now() "; db_query($sql); $sql = " update TB_ACCOUNT_INOUT_BREAKDOWN set process_amount = process_amount + {$amount} where no = {$no} "; //deanLog("sql", $sql, "k1"); db_query($sql); error_msg("alert('저장되었습니다.');parent.document.location.href='account_inout_list.html?{$bankhref}'","script"); break; // 예약연결된 내역 삭제 case "ma_link_delete": if (!$inout_no || !$link_no) { error_msg("필수값이 없습니다."); } $sql = "DELETE FROM TB_ACCOUNT_CUSTOMER WHERE res_no = '{$res_no}' and matching_idx = '{$link_no}' "; //deanLog("sql", $sql, "k1"); db_query($sql); $sql = "DELETE FROM TB_ACCOUNT_INOUT_LINK WHERE no = '{$link_no}'"; //deanLog("sql", $sql, "k1"); db_fetch($sql); $sql = " update TB_ACCOUNT_INOUT_BREAKDOWN set process_amount = process_amount - {$amount} where no = {$inout_no} "; //deanLog("sql", $sql, "k1"); db_query($sql); // 입금완료 처리 (검색을 위해 추가) // 관리자검색요소 업데이트 if ($res_no) { db_query("call SP_RES_GOOD_SEARCH('".$res_no."');"); } error_msg("alert('삭제되었습니다.');ajax_post('ajax_list','account_inout_list_ajax.html','frm_search','',true)","script"); break; } ?>