inc_ViewBtn.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!-- <div class="col-12 d-flex justify-content-center mt-5">
  2. <button type="button" class="btn btn-secondary" style="width:120px;">목록</button>
  3. <?php if($ds_status_sale == "B0" || $ds_status_sale == "C0") { ?>
  4. <button type="button" class="btn btn-primary ms-2" style="width:120px;" id="btn_update_car">차량 정보 수정</button>
  5. <?php } ?>
  6. </div> -->
  7. <div class="btn--wrapper col-12 d-flex justify-content-center mt90" style="max-width:1200px; margin:0 auto;">
  8. <button type="button" class="btn btn-secondary list--btn" style="width:190px; height:65px;" id="btn_list">목록</button>
  9. <?php if($ds_status_sale == "B0" || $ds_status_sale == "C0" || $ds_status_sale == "D0") { ?>
  10. <!-- <button type="button" class="btn btn-primary ms-2" style="width:120px;" id="btn_update_car">차량 정보 수정</button> -->
  11. <?php } ?>
  12. <?php
  13. ?>
  14. <?php if($ds_status_sale == "Z0" && $ds_status_contract_step1_sale == "Y" && $ds_status_contract_step2_sale == "Y" && $ds_status_contract_step3_sale == "Y" && $ds_status_contract_step4_sale == "Y" && $ds_status_contract_step5_sale != "Y") { ?>
  15. <button type="button" class="btn btn-primary comp--btn" style="width:190px; height:65px;" id="btn_end_proc">거래 완료 처리</button>
  16. <?php } ?>
  17. </div>
  18. <script>
  19. function go_list() {
  20. var url = "<?=$list_url?>";
  21. var params = {
  22. ListPageNo : "<?=$PageNo?>",
  23. PageSort : "<?=$PageSort?>",
  24. searchtype : "<?=$searchtype?>",
  25. searchword : "<?=$searchword?>",
  26. }
  27. link(url+"?"+$.param(params));
  28. }
  29. $(function() {
  30. $("#btn_list").on("click", function() {
  31. go_list();
  32. });
  33. $("#btn_update_car").on("click", function() {
  34. var custom_opts = {
  35. title : '',
  36. btn_close_show : false,
  37. }
  38. custom_opts.title = '차량정보를 수정 하시겠습니까?\n수정 페이지로 이동합니다.';
  39. custom_modal_confirm(custom_opts, function(confirm) {
  40. if(confirm) {
  41. $("#btn_update_car").hide();
  42. var data = {
  43. mode : "updateCar"
  44. , cd_car : '<?=$cd_car?>'
  45. , cd_sale : '<?=$cd_sale?>'
  46. , nm_name : '<?=$nm_name?>'
  47. , nm_hp : '<?=$nm_hp_sale?>'
  48. , ds_area : '<?=$ds_area_sale?>'
  49. , nm_number : '<?=$nm_number?>'
  50. };
  51. $.post("sell_proc.php", data, function(res) {
  52. $("#btn_update_car").show();
  53. custom_modal_confirm_close();
  54. if(res.CODE != "0000"){
  55. custom_opts.title = "수정 세션 생성에 실패 했습니다.";
  56. custom_modal_alert(custom_opts);
  57. return false;
  58. }
  59. link("sell_step1.php");
  60. }, "json");
  61. }else {
  62. $("#btn_update_car").show();
  63. return false;
  64. }
  65. });
  66. });
  67. $("#btn_end_proc").on("click", function() {
  68. var custom_opts = {
  69. title : '',
  70. btn_close_show : false,
  71. }
  72. custom_opts.title = '거래완료 처리하시겠습니까?';
  73. custom_modal_confirm(custom_opts, function(confirm) {
  74. if(confirm) {
  75. $("#btn_end_proc").hide();
  76. var data = {
  77. mode : "TenderEndAAP"
  78. , cd_car : '<?=$cd_car?>'
  79. , cd_sale : '<?=$cd_sale?>'
  80. , nm_name : '<?=$nm_name?>'
  81. , nm_hp : '<?=$nm_hp_sale?>'
  82. , ds_area : '<?=$ds_area_sale?>'
  83. , nm_number : '<?=$nm_number?>'
  84. };
  85. $.post("sale_proc.php", data, function(res) {
  86. $("#btn_end_proc").show();
  87. custom_modal_confirm_close();
  88. if(res.CODE != "0000"){
  89. custom_opts.title = "거래완료 처리에 실패했습니다.";
  90. custom_modal_alert(custom_opts);
  91. return false;
  92. }
  93. custom_opts.title = "거래완료 처리되었습니다.";
  94. custom_modal_alert(custom_opts, function() {
  95. reload();
  96. });
  97. return false;
  98. }, "json");
  99. }else {
  100. $("#btn_end_proc").show();
  101. return false;
  102. }
  103. });
  104. });
  105. });
  106. </script>